chore: remove lib folder
This commit is contained in:
parent
0254e0a8cd
commit
d915c3937c
3
.gitignore
vendored
3
.gitignore
vendored
@ -84,3 +84,6 @@ android/generated
|
||||
|
||||
# Misc
|
||||
.xcode.env.local
|
||||
|
||||
# Lib
|
||||
lib
|
||||
|
||||
@ -1,258 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TrueSheet = void 0;
|
||||
var _react = require("react");
|
||||
var _reactNative = require("react-native");
|
||||
var _TrueSheetModule = require("./TrueSheetModule.js");
|
||||
var _TrueSheetGrabber = require("./TrueSheetGrabber.js");
|
||||
var _TrueSheetFooter = require("./TrueSheetFooter.js");
|
||||
var _jsxRuntime = require("react/jsx-runtime");
|
||||
const NATIVE_COMPONENT_NAME = 'TrueSheetView';
|
||||
const LINKING_ERROR = `The package '@lodev09/react-native-true-sheet' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
||||
ios: "- You have run 'pod install'\n",
|
||||
default: ''
|
||||
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
||||
const TrueSheetNativeView = (0, _reactNative.requireNativeComponent)(NATIVE_COMPONENT_NAME);
|
||||
if (!TrueSheetNativeView) {
|
||||
throw new Error(LINKING_ERROR);
|
||||
}
|
||||
class TrueSheet extends _react.PureComponent {
|
||||
displayName = 'TrueSheet';
|
||||
/**
|
||||
* Map of sheet names against their handle.
|
||||
*/
|
||||
static handles = {};
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.ref = /*#__PURE__*/(0, _react.createRef)();
|
||||
this.onMount = this.onMount.bind(this);
|
||||
this.onDismiss = this.onDismiss.bind(this);
|
||||
this.onPresent = this.onPresent.bind(this);
|
||||
this.onSizeChange = this.onSizeChange.bind(this);
|
||||
this.onDragBegin = this.onDragBegin.bind(this);
|
||||
this.onDragChange = this.onDragChange.bind(this);
|
||||
this.onDragEnd = this.onDragEnd.bind(this);
|
||||
this.onContentLayout = this.onContentLayout.bind(this);
|
||||
this.onFooterLayout = this.onFooterLayout.bind(this);
|
||||
this.onContainerSizeChange = this.onContainerSizeChange.bind(this);
|
||||
this.state = {
|
||||
containerWidth: undefined,
|
||||
containerHeight: undefined,
|
||||
contentHeight: undefined,
|
||||
footerHeight: undefined,
|
||||
scrollableHandle: null
|
||||
};
|
||||
}
|
||||
static getHandle(name) {
|
||||
const handle = TrueSheet.handles[name];
|
||||
if (!handle) {
|
||||
console.warn(`Could not get native view tag from "${name}". Check your name prop.`);
|
||||
return;
|
||||
}
|
||||
return handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Present the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static async present(name, index = 0) {
|
||||
const handle = TrueSheet.getHandle(name);
|
||||
if (!handle) return;
|
||||
await _TrueSheetModule.TrueSheetModule.present(handle, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dismiss the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static async dismiss(name) {
|
||||
const handle = TrueSheet.getHandle(name);
|
||||
if (!handle) return;
|
||||
await _TrueSheetModule.TrueSheetModule.dismiss(handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resize the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static async resize(name, index) {
|
||||
await TrueSheet.present(name, index);
|
||||
}
|
||||
get handle() {
|
||||
const nodeHandle = (0, _reactNative.findNodeHandle)(this.ref.current);
|
||||
if (nodeHandle == null || nodeHandle === -1) {
|
||||
throw new Error('Could not get native view tag');
|
||||
}
|
||||
return nodeHandle;
|
||||
}
|
||||
updateState() {
|
||||
const scrollableHandle = this.props.scrollRef?.current ? (0, _reactNative.findNodeHandle)(this.props.scrollRef.current) : null;
|
||||
if (this.props.name) {
|
||||
TrueSheet.handles[this.props.name] = this.handle;
|
||||
}
|
||||
this.setState({
|
||||
scrollableHandle
|
||||
});
|
||||
}
|
||||
onSizeChange(event) {
|
||||
this.props.onSizeChange?.(event);
|
||||
}
|
||||
onContainerSizeChange(event) {
|
||||
this.setState({
|
||||
containerWidth: event.nativeEvent.width,
|
||||
containerHeight: event.nativeEvent.height
|
||||
});
|
||||
}
|
||||
onPresent(event) {
|
||||
this.props.onPresent?.(event);
|
||||
}
|
||||
onFooterLayout(event) {
|
||||
this.setState({
|
||||
footerHeight: event.nativeEvent.layout.height
|
||||
});
|
||||
}
|
||||
onContentLayout(event) {
|
||||
this.setState({
|
||||
contentHeight: event.nativeEvent.layout.height
|
||||
});
|
||||
}
|
||||
onDismiss() {
|
||||
this.props.onDismiss?.();
|
||||
}
|
||||
onMount() {
|
||||
this.props.onMount?.();
|
||||
}
|
||||
onDragBegin(event) {
|
||||
this.props.onDragBegin?.(event);
|
||||
}
|
||||
onDragChange(event) {
|
||||
this.props.onDragChange?.(event);
|
||||
}
|
||||
onDragEnd(event) {
|
||||
this.props.onDragEnd?.(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Present the sheet. Optionally accepts a size `index`.
|
||||
* See `sizes` prop
|
||||
*/
|
||||
async present(index = 0) {
|
||||
await _TrueSheetModule.TrueSheetModule.present(this.handle, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes the Sheet programmatically by `index`.
|
||||
* This is an alias of the `present(index)` method.
|
||||
*/
|
||||
async resize(index) {
|
||||
await this.present(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dismisses the Sheet
|
||||
*/
|
||||
async dismiss() {
|
||||
await _TrueSheetModule.TrueSheetModule.dismiss(this.handle);
|
||||
}
|
||||
componentDidMount() {
|
||||
if (this.props.sizes && this.props.sizes.length > 3) {
|
||||
console.warn('TrueSheet only supports a maximum of 3 sizes; collapsed, half-expanded and expanded. Check your `sizes` prop.');
|
||||
}
|
||||
this.updateState();
|
||||
}
|
||||
componentDidUpdate() {
|
||||
this.updateState();
|
||||
}
|
||||
render() {
|
||||
const {
|
||||
sizes = ['medium', 'large'],
|
||||
backgroundColor = 'white',
|
||||
dismissible = true,
|
||||
grabber = true,
|
||||
dimmed = true,
|
||||
initialIndexAnimated = true,
|
||||
edgeToEdge = false,
|
||||
keyboardMode = 'resize',
|
||||
initialIndex,
|
||||
dimmedIndex,
|
||||
grabberProps,
|
||||
blurTint,
|
||||
cornerRadius,
|
||||
maxHeight,
|
||||
FooterComponent,
|
||||
style,
|
||||
contentContainerStyle,
|
||||
children,
|
||||
...rest
|
||||
} = this.props;
|
||||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TrueSheetNativeView, {
|
||||
ref: this.ref,
|
||||
style: $nativeSheet,
|
||||
scrollableHandle: this.state.scrollableHandle,
|
||||
sizes: sizes,
|
||||
blurTint: blurTint,
|
||||
background: (0, _reactNative.processColor)(backgroundColor),
|
||||
cornerRadius: cornerRadius,
|
||||
contentHeight: this.state.contentHeight,
|
||||
footerHeight: this.state.footerHeight,
|
||||
grabber: grabber,
|
||||
dimmed: dimmed,
|
||||
dimmedIndex: dimmedIndex,
|
||||
edgeToEdge: edgeToEdge,
|
||||
initialIndex: initialIndex,
|
||||
initialIndexAnimated: initialIndexAnimated,
|
||||
keyboardMode: keyboardMode,
|
||||
dismissible: dismissible,
|
||||
maxHeight: maxHeight,
|
||||
onMount: this.onMount,
|
||||
onPresent: this.onPresent,
|
||||
onDismiss: this.onDismiss,
|
||||
onSizeChange: this.onSizeChange,
|
||||
onDragBegin: this.onDragBegin,
|
||||
onDragChange: this.onDragChange,
|
||||
onDragEnd: this.onDragEnd,
|
||||
onContainerSizeChange: this.onContainerSizeChange,
|
||||
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
||||
collapsable: false,
|
||||
style: [{
|
||||
overflow: _reactNative.Platform.select({
|
||||
ios: undefined,
|
||||
android: 'hidden'
|
||||
}),
|
||||
// Update the width on JS side.
|
||||
// New Arch interop does not support updating it in native :/
|
||||
width: this.state.containerWidth,
|
||||
height: this.state.containerHeight
|
||||
}, style],
|
||||
...rest,
|
||||
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
||||
collapsable: false,
|
||||
onLayout: this.onContentLayout,
|
||||
style: contentContainerStyle,
|
||||
children: children
|
||||
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
||||
collapsable: false,
|
||||
onLayout: this.onFooterLayout,
|
||||
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrueSheetFooter.TrueSheetFooter, {
|
||||
Component: FooterComponent
|
||||
})
|
||||
}), _reactNative.Platform.OS === 'android' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TrueSheetGrabber.TrueSheetGrabber, {
|
||||
visible: grabber,
|
||||
...grabberProps
|
||||
})]
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.TrueSheet = TrueSheet;
|
||||
const $nativeSheet = {
|
||||
position: 'absolute',
|
||||
width: '100%',
|
||||
left: -9999,
|
||||
zIndex: -9999
|
||||
};
|
||||
//# sourceMappingURL=TrueSheet.js.map
|
||||
File diff suppressed because one or more lines are too long
@ -1,6 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
//# sourceMappingURL=TrueSheet.types.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":[],"sourceRoot":"../../src","sources":["TrueSheet.types.ts"],"mappings":"","ignoreList":[]}
|
||||
@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TrueSheetFooter = void 0;
|
||||
var _jsxRuntime = require("react/jsx-runtime");
|
||||
const TrueSheetFooter = props => {
|
||||
const {
|
||||
Component
|
||||
} = props;
|
||||
if (!Component) return null;
|
||||
if (typeof Component !== 'function') {
|
||||
return Component;
|
||||
}
|
||||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {});
|
||||
};
|
||||
exports.TrueSheetFooter = TrueSheetFooter;
|
||||
//# sourceMappingURL=TrueSheetFooter.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":["TrueSheetFooter","props","Component","_jsxRuntime","jsx","exports"],"sourceRoot":"../../src","sources":["TrueSheetFooter.tsx"],"mappings":";;;;;;;AAMO,MAAMA,eAAe,GAAIC,KAA2B,IAAK;EAC9D,MAAM;IAAEC;EAAU,CAAC,GAAGD,KAAK;EAE3B,IAAI,CAACC,SAAS,EAAE,OAAO,IAAI;EAE3B,IAAI,OAAOA,SAAS,KAAK,UAAU,EAAE;IACnC,OAAOA,SAAS;EAClB;EAEA,oBAAO,IAAAC,WAAA,CAAAC,GAAA,EAACF,SAAS,IAAE,CAAC;AACtB,CAAC;AAAAG,OAAA,CAAAL,eAAA,GAAAA,eAAA","ignoreList":[]}
|
||||
@ -1,54 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TrueSheetGrabber = void 0;
|
||||
var _reactNative = require("react-native");
|
||||
var _jsxRuntime = require("react/jsx-runtime");
|
||||
const GRABBER_DEFAULT_HEIGHT = 4;
|
||||
const GRABBER_DEFAULT_WIDTH = 32;
|
||||
|
||||
// M3 spec: #49454F 0.4 alpha
|
||||
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
|
||||
/**
|
||||
* Grabber component.
|
||||
* Used by defualt for Android but feel free to re-use.
|
||||
*/
|
||||
const TrueSheetGrabber = props => {
|
||||
const {
|
||||
visible = true,
|
||||
color = GRABBER_DEFAULT_COLOR,
|
||||
width = GRABBER_DEFAULT_WIDTH,
|
||||
height = GRABBER_DEFAULT_HEIGHT,
|
||||
topOffset = 0,
|
||||
style
|
||||
} = props;
|
||||
if (!visible) return null;
|
||||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
||||
style: [$wrapper, style, {
|
||||
height: GRABBER_DEFAULT_HEIGHT * 4,
|
||||
top: topOffset
|
||||
}],
|
||||
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
||||
style: [$grabber, {
|
||||
height,
|
||||
width,
|
||||
backgroundColor: color
|
||||
}]
|
||||
})
|
||||
});
|
||||
};
|
||||
exports.TrueSheetGrabber = TrueSheetGrabber;
|
||||
const $wrapper = {
|
||||
position: 'absolute',
|
||||
alignSelf: 'center',
|
||||
paddingHorizontal: 12,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
zIndex: 9999
|
||||
};
|
||||
const $grabber = {
|
||||
borderRadius: GRABBER_DEFAULT_HEIGHT / 2
|
||||
};
|
||||
//# sourceMappingURL=TrueSheetGrabber.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":["_reactNative","require","_jsxRuntime","GRABBER_DEFAULT_HEIGHT","GRABBER_DEFAULT_WIDTH","GRABBER_DEFAULT_COLOR","TrueSheetGrabber","props","visible","color","width","height","topOffset","style","jsx","View","$wrapper","top","children","$grabber","backgroundColor","exports","position","alignSelf","paddingHorizontal","alignItems","justifyContent","zIndex","borderRadius"],"sourceRoot":"../../src","sources":["TrueSheetGrabber.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAoF,IAAAC,WAAA,GAAAD,OAAA;AAEpF,MAAME,sBAAsB,GAAG,CAAC;AAChC,MAAMC,qBAAqB,GAAG,EAAE;;AAEhC;AACA,MAAMC,qBAAqB,GAAG,oBAAoB;AAwClD;AACA;AACA;AACA;AACO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAChE,MAAM;IACJC,OAAO,GAAG,IAAI;IACdC,KAAK,GAAGJ,qBAAqB;IAC7BK,KAAK,GAAGN,qBAAqB;IAC7BO,MAAM,GAAGR,sBAAsB;IAC/BS,SAAS,GAAG,CAAC;IACbC;EACF,CAAC,GAAGN,KAAK;EAET,IAAI,CAACC,OAAO,EAAE,OAAO,IAAI;EAEzB,oBACE,IAAAN,WAAA,CAAAY,GAAA,EAACd,YAAA,CAAAe,IAAI;IAACF,KAAK,EAAE,CAACG,QAAQ,EAAEH,KAAK,EAAE;MAAEF,MAAM,EAAER,sBAAsB,GAAG,CAAC;MAAEc,GAAG,EAAEL;IAAU,CAAC,CAAE;IAAAM,QAAA,eACrF,IAAAhB,WAAA,CAAAY,GAAA,EAACd,YAAA,CAAAe,IAAI;MAACF,KAAK,EAAE,CAACM,QAAQ,EAAE;QAAER,MAAM;QAAED,KAAK;QAAEU,eAAe,EAAEX;MAAM,CAAC;IAAE,CAAE;EAAC,CAClE,CAAC;AAEX,CAAC;AAAAY,OAAA,CAAAf,gBAAA,GAAAA,gBAAA;AAED,MAAMU,QAAmB,GAAG;EAC1BM,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,QAAQ;EACnBC,iBAAiB,EAAE,EAAE;EACrBC,UAAU,EAAE,QAAQ;EACpBC,cAAc,EAAE,QAAQ;EACxBC,MAAM,EAAE;AACV,CAAC;AAED,MAAMR,QAAmB,GAAG;EAC1BS,YAAY,EAAEzB,sBAAsB,GAAG;AACzC,CAAC","ignoreList":[]}
|
||||
@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TrueSheetModule = void 0;
|
||||
var _reactNative = require("react-native");
|
||||
const LINKING_ERROR = `The package '@lodev09/react-native-true-sheet' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
||||
ios: "- You have run 'pod install'\n",
|
||||
default: ''
|
||||
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
||||
|
||||
// NativeModules automatically resolves 'TrueSheetView' to 'TrueSheetViewModule'
|
||||
const TrueSheetModule = exports.TrueSheetModule = _reactNative.NativeModules.TrueSheetView ? _reactNative.NativeModules.TrueSheetView : new Proxy({}, {
|
||||
get() {
|
||||
throw new Error(LINKING_ERROR);
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=TrueSheetModule.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","TrueSheetModule","exports","NativeModules","TrueSheetView","Proxy","get","Error"],"sourceRoot":"../../src","sources":["TrueSheetModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,2FAA2F,GAC3FC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACO,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,0BAAa,CAACC,aAAa,GACtDD,0BAAa,CAACC,aAAa,GAC3B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACX,aAAa,CAAC;EAChC;AACF,CACF,CAAC","ignoreList":[]}
|
||||
@ -1,52 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {
|
||||
TrueSheet: true
|
||||
};
|
||||
exports.TrueSheet = void 0;
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
var _reactNative = require("react-native");
|
||||
var _jsxRuntime = require("react/jsx-runtime");
|
||||
var _TrueSheetGrabber = require("../TrueSheetGrabber.js");
|
||||
Object.keys(_TrueSheetGrabber).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _TrueSheetGrabber[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TrueSheetGrabber[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _TrueSheetFooter = require("../TrueSheetFooter.js");
|
||||
Object.keys(_TrueSheetFooter).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _TrueSheetFooter[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TrueSheetFooter[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
class TrueSheet extends _react.default.Component {
|
||||
static dismiss = jest.fn();
|
||||
static present = jest.fn();
|
||||
static resize = jest.fn();
|
||||
dismiss = jest.fn();
|
||||
present = jest.fn();
|
||||
resize = jest.fn();
|
||||
render() {
|
||||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
||||
...this.props
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.TrueSheet = TrueSheet;
|
||||
//# sourceMappingURL=index.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_TrueSheetGrabber","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_TrueSheetFooter","e","__esModule","default","TrueSheet","React","Component","dismiss","jest","fn","present","resize","render","jsx","View","props"],"sourceRoot":"../../../src","sources":["__mocks__/index.js"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAmC,IAAAE,WAAA,GAAAF,OAAA;AAEnC,IAAAG,iBAAA,GAAAH,OAAA;AAAAI,MAAA,CAAAC,IAAA,CAAAF,iBAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,iBAAA,CAAA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ACjC;AACF;AAACnB,OAAA,CAAAQ,SAAA,GAAAA,SAAA","ignoreList":[]}
|
||||
@ -1,39 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _TrueSheet = require("./TrueSheet.js");
|
||||
Object.keys(_TrueSheet).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _TrueSheet[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TrueSheet[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _TrueSheetTypes = require("./TrueSheet.types.js");
|
||||
Object.keys(_TrueSheetTypes).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _TrueSheetTypes[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TrueSheetTypes[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _TrueSheetGrabber = require("./TrueSheetGrabber.js");
|
||||
Object.keys(_TrueSheetGrabber).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _TrueSheetGrabber[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TrueSheetGrabber[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=index.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":["_TrueSheet","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_TrueSheetTypes","_TrueSheetGrabber"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,UAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,UAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,UAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,eAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,eAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,eAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,eAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,iBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,iBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,iBAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,iBAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
||||
@ -1,253 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
import { PureComponent, createRef } from 'react';
|
||||
import { requireNativeComponent, Platform, findNodeHandle, View, processColor } from 'react-native';
|
||||
import { TrueSheetModule } from "./TrueSheetModule.js";
|
||||
import { TrueSheetGrabber } from "./TrueSheetGrabber.js";
|
||||
import { TrueSheetFooter } from "./TrueSheetFooter.js";
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
const NATIVE_COMPONENT_NAME = 'TrueSheetView';
|
||||
const LINKING_ERROR = `The package '@lodev09/react-native-true-sheet' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
||||
ios: "- You have run 'pod install'\n",
|
||||
default: ''
|
||||
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
||||
const TrueSheetNativeView = requireNativeComponent(NATIVE_COMPONENT_NAME);
|
||||
if (!TrueSheetNativeView) {
|
||||
throw new Error(LINKING_ERROR);
|
||||
}
|
||||
export class TrueSheet extends PureComponent {
|
||||
displayName = 'TrueSheet';
|
||||
/**
|
||||
* Map of sheet names against their handle.
|
||||
*/
|
||||
static handles = {};
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.ref = /*#__PURE__*/createRef();
|
||||
this.onMount = this.onMount.bind(this);
|
||||
this.onDismiss = this.onDismiss.bind(this);
|
||||
this.onPresent = this.onPresent.bind(this);
|
||||
this.onSizeChange = this.onSizeChange.bind(this);
|
||||
this.onDragBegin = this.onDragBegin.bind(this);
|
||||
this.onDragChange = this.onDragChange.bind(this);
|
||||
this.onDragEnd = this.onDragEnd.bind(this);
|
||||
this.onContentLayout = this.onContentLayout.bind(this);
|
||||
this.onFooterLayout = this.onFooterLayout.bind(this);
|
||||
this.onContainerSizeChange = this.onContainerSizeChange.bind(this);
|
||||
this.state = {
|
||||
containerWidth: undefined,
|
||||
containerHeight: undefined,
|
||||
contentHeight: undefined,
|
||||
footerHeight: undefined,
|
||||
scrollableHandle: null
|
||||
};
|
||||
}
|
||||
static getHandle(name) {
|
||||
const handle = TrueSheet.handles[name];
|
||||
if (!handle) {
|
||||
console.warn(`Could not get native view tag from "${name}". Check your name prop.`);
|
||||
return;
|
||||
}
|
||||
return handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Present the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static async present(name, index = 0) {
|
||||
const handle = TrueSheet.getHandle(name);
|
||||
if (!handle) return;
|
||||
await TrueSheetModule.present(handle, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dismiss the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static async dismiss(name) {
|
||||
const handle = TrueSheet.getHandle(name);
|
||||
if (!handle) return;
|
||||
await TrueSheetModule.dismiss(handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resize the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static async resize(name, index) {
|
||||
await TrueSheet.present(name, index);
|
||||
}
|
||||
get handle() {
|
||||
const nodeHandle = findNodeHandle(this.ref.current);
|
||||
if (nodeHandle == null || nodeHandle === -1) {
|
||||
throw new Error('Could not get native view tag');
|
||||
}
|
||||
return nodeHandle;
|
||||
}
|
||||
updateState() {
|
||||
const scrollableHandle = this.props.scrollRef?.current ? findNodeHandle(this.props.scrollRef.current) : null;
|
||||
if (this.props.name) {
|
||||
TrueSheet.handles[this.props.name] = this.handle;
|
||||
}
|
||||
this.setState({
|
||||
scrollableHandle
|
||||
});
|
||||
}
|
||||
onSizeChange(event) {
|
||||
this.props.onSizeChange?.(event);
|
||||
}
|
||||
onContainerSizeChange(event) {
|
||||
this.setState({
|
||||
containerWidth: event.nativeEvent.width,
|
||||
containerHeight: event.nativeEvent.height
|
||||
});
|
||||
}
|
||||
onPresent(event) {
|
||||
this.props.onPresent?.(event);
|
||||
}
|
||||
onFooterLayout(event) {
|
||||
this.setState({
|
||||
footerHeight: event.nativeEvent.layout.height
|
||||
});
|
||||
}
|
||||
onContentLayout(event) {
|
||||
this.setState({
|
||||
contentHeight: event.nativeEvent.layout.height
|
||||
});
|
||||
}
|
||||
onDismiss() {
|
||||
this.props.onDismiss?.();
|
||||
}
|
||||
onMount() {
|
||||
this.props.onMount?.();
|
||||
}
|
||||
onDragBegin(event) {
|
||||
this.props.onDragBegin?.(event);
|
||||
}
|
||||
onDragChange(event) {
|
||||
this.props.onDragChange?.(event);
|
||||
}
|
||||
onDragEnd(event) {
|
||||
this.props.onDragEnd?.(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Present the sheet. Optionally accepts a size `index`.
|
||||
* See `sizes` prop
|
||||
*/
|
||||
async present(index = 0) {
|
||||
await TrueSheetModule.present(this.handle, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes the Sheet programmatically by `index`.
|
||||
* This is an alias of the `present(index)` method.
|
||||
*/
|
||||
async resize(index) {
|
||||
await this.present(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dismisses the Sheet
|
||||
*/
|
||||
async dismiss() {
|
||||
await TrueSheetModule.dismiss(this.handle);
|
||||
}
|
||||
componentDidMount() {
|
||||
if (this.props.sizes && this.props.sizes.length > 3) {
|
||||
console.warn('TrueSheet only supports a maximum of 3 sizes; collapsed, half-expanded and expanded. Check your `sizes` prop.');
|
||||
}
|
||||
this.updateState();
|
||||
}
|
||||
componentDidUpdate() {
|
||||
this.updateState();
|
||||
}
|
||||
render() {
|
||||
const {
|
||||
sizes = ['medium', 'large'],
|
||||
backgroundColor = 'white',
|
||||
dismissible = true,
|
||||
grabber = true,
|
||||
dimmed = true,
|
||||
initialIndexAnimated = true,
|
||||
edgeToEdge = false,
|
||||
keyboardMode = 'resize',
|
||||
initialIndex,
|
||||
dimmedIndex,
|
||||
grabberProps,
|
||||
blurTint,
|
||||
cornerRadius,
|
||||
maxHeight,
|
||||
FooterComponent,
|
||||
style,
|
||||
contentContainerStyle,
|
||||
children,
|
||||
...rest
|
||||
} = this.props;
|
||||
return /*#__PURE__*/_jsx(TrueSheetNativeView, {
|
||||
ref: this.ref,
|
||||
style: $nativeSheet,
|
||||
scrollableHandle: this.state.scrollableHandle,
|
||||
sizes: sizes,
|
||||
blurTint: blurTint,
|
||||
background: processColor(backgroundColor),
|
||||
cornerRadius: cornerRadius,
|
||||
contentHeight: this.state.contentHeight,
|
||||
footerHeight: this.state.footerHeight,
|
||||
grabber: grabber,
|
||||
dimmed: dimmed,
|
||||
dimmedIndex: dimmedIndex,
|
||||
edgeToEdge: edgeToEdge,
|
||||
initialIndex: initialIndex,
|
||||
initialIndexAnimated: initialIndexAnimated,
|
||||
keyboardMode: keyboardMode,
|
||||
dismissible: dismissible,
|
||||
maxHeight: maxHeight,
|
||||
onMount: this.onMount,
|
||||
onPresent: this.onPresent,
|
||||
onDismiss: this.onDismiss,
|
||||
onSizeChange: this.onSizeChange,
|
||||
onDragBegin: this.onDragBegin,
|
||||
onDragChange: this.onDragChange,
|
||||
onDragEnd: this.onDragEnd,
|
||||
onContainerSizeChange: this.onContainerSizeChange,
|
||||
children: /*#__PURE__*/_jsxs(View, {
|
||||
collapsable: false,
|
||||
style: [{
|
||||
overflow: Platform.select({
|
||||
ios: undefined,
|
||||
android: 'hidden'
|
||||
}),
|
||||
// Update the width on JS side.
|
||||
// New Arch interop does not support updating it in native :/
|
||||
width: this.state.containerWidth,
|
||||
height: this.state.containerHeight
|
||||
}, style],
|
||||
...rest,
|
||||
children: [/*#__PURE__*/_jsx(View, {
|
||||
collapsable: false,
|
||||
onLayout: this.onContentLayout,
|
||||
style: contentContainerStyle,
|
||||
children: children
|
||||
}), /*#__PURE__*/_jsx(View, {
|
||||
collapsable: false,
|
||||
onLayout: this.onFooterLayout,
|
||||
children: /*#__PURE__*/_jsx(TrueSheetFooter, {
|
||||
Component: FooterComponent
|
||||
})
|
||||
}), Platform.OS === 'android' && /*#__PURE__*/_jsx(TrueSheetGrabber, {
|
||||
visible: grabber,
|
||||
...grabberProps
|
||||
})]
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
const $nativeSheet = {
|
||||
position: 'absolute',
|
||||
width: '100%',
|
||||
left: -9999,
|
||||
zIndex: -9999
|
||||
};
|
||||
//# sourceMappingURL=TrueSheet.js.map
|
||||
File diff suppressed because one or more lines are too long
@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
export {};
|
||||
//# sourceMappingURL=TrueSheet.types.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":[],"sourceRoot":"../../src","sources":["TrueSheet.types.ts"],"mappings":"","ignoreList":[]}
|
||||
@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
export const TrueSheetFooter = props => {
|
||||
const {
|
||||
Component
|
||||
} = props;
|
||||
if (!Component) return null;
|
||||
if (typeof Component !== 'function') {
|
||||
return Component;
|
||||
}
|
||||
return /*#__PURE__*/_jsx(Component, {});
|
||||
};
|
||||
//# sourceMappingURL=TrueSheetFooter.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":["TrueSheetFooter","props","Component","_jsx"],"sourceRoot":"../../src","sources":["TrueSheetFooter.tsx"],"mappings":";;;AAMA,OAAO,MAAMA,eAAe,GAAIC,KAA2B,IAAK;EAC9D,MAAM;IAAEC;EAAU,CAAC,GAAGD,KAAK;EAE3B,IAAI,CAACC,SAAS,EAAE,OAAO,IAAI;EAE3B,IAAI,OAAOA,SAAS,KAAK,UAAU,EAAE;IACnC,OAAOA,SAAS;EAClB;EAEA,oBAAOC,IAAA,CAACD,SAAS,IAAE,CAAC;AACtB,CAAC","ignoreList":[]}
|
||||
@ -1,49 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
import { View } from 'react-native';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const GRABBER_DEFAULT_HEIGHT = 4;
|
||||
const GRABBER_DEFAULT_WIDTH = 32;
|
||||
|
||||
// M3 spec: #49454F 0.4 alpha
|
||||
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
|
||||
/**
|
||||
* Grabber component.
|
||||
* Used by defualt for Android but feel free to re-use.
|
||||
*/
|
||||
export const TrueSheetGrabber = props => {
|
||||
const {
|
||||
visible = true,
|
||||
color = GRABBER_DEFAULT_COLOR,
|
||||
width = GRABBER_DEFAULT_WIDTH,
|
||||
height = GRABBER_DEFAULT_HEIGHT,
|
||||
topOffset = 0,
|
||||
style
|
||||
} = props;
|
||||
if (!visible) return null;
|
||||
return /*#__PURE__*/_jsx(View, {
|
||||
style: [$wrapper, style, {
|
||||
height: GRABBER_DEFAULT_HEIGHT * 4,
|
||||
top: topOffset
|
||||
}],
|
||||
children: /*#__PURE__*/_jsx(View, {
|
||||
style: [$grabber, {
|
||||
height,
|
||||
width,
|
||||
backgroundColor: color
|
||||
}]
|
||||
})
|
||||
});
|
||||
};
|
||||
const $wrapper = {
|
||||
position: 'absolute',
|
||||
alignSelf: 'center',
|
||||
paddingHorizontal: 12,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
zIndex: 9999
|
||||
};
|
||||
const $grabber = {
|
||||
borderRadius: GRABBER_DEFAULT_HEIGHT / 2
|
||||
};
|
||||
//# sourceMappingURL=TrueSheetGrabber.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":["View","jsx","_jsx","GRABBER_DEFAULT_HEIGHT","GRABBER_DEFAULT_WIDTH","GRABBER_DEFAULT_COLOR","TrueSheetGrabber","props","visible","color","width","height","topOffset","style","$wrapper","top","children","$grabber","backgroundColor","position","alignSelf","paddingHorizontal","alignItems","justifyContent","zIndex","borderRadius"],"sourceRoot":"../../src","sources":["TrueSheetGrabber.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAyD,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEpF,MAAMC,sBAAsB,GAAG,CAAC;AAChC,MAAMC,qBAAqB,GAAG,EAAE;;AAEhC;AACA,MAAMC,qBAAqB,GAAG,oBAAoB;AAwClD;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAChE,MAAM;IACJC,OAAO,GAAG,IAAI;IACdC,KAAK,GAAGJ,qBAAqB;IAC7BK,KAAK,GAAGN,qBAAqB;IAC7BO,MAAM,GAAGR,sBAAsB;IAC/BS,SAAS,GAAG,CAAC;IACbC;EACF,CAAC,GAAGN,KAAK;EAET,IAAI,CAACC,OAAO,EAAE,OAAO,IAAI;EAEzB,oBACEN,IAAA,CAACF,IAAI;IAACa,KAAK,EAAE,CAACC,QAAQ,EAAED,KAAK,EAAE;MAAEF,MAAM,EAAER,sBAAsB,GAAG,CAAC;MAAEY,GAAG,EAAEH;IAAU,CAAC,CAAE;IAAAI,QAAA,eACrFd,IAAA,CAACF,IAAI;MAACa,KAAK,EAAE,CAACI,QAAQ,EAAE;QAAEN,MAAM;QAAED,KAAK;QAAEQ,eAAe,EAAET;MAAM,CAAC;IAAE,CAAE;EAAC,CAClE,CAAC;AAEX,CAAC;AAED,MAAMK,QAAmB,GAAG;EAC1BK,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,QAAQ;EACnBC,iBAAiB,EAAE,EAAE;EACrBC,UAAU,EAAE,QAAQ;EACpBC,cAAc,EAAE,QAAQ;EACxBC,MAAM,EAAE;AACV,CAAC;AAED,MAAMP,QAAmB,GAAG;EAC1BQ,YAAY,EAAEtB,sBAAsB,GAAG;AACzC,CAAC","ignoreList":[]}
|
||||
@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
import { NativeModules, Platform } from 'react-native';
|
||||
const LINKING_ERROR = `The package '@lodev09/react-native-true-sheet' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
||||
ios: "- You have run 'pod install'\n",
|
||||
default: ''
|
||||
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
||||
|
||||
// NativeModules automatically resolves 'TrueSheetView' to 'TrueSheetViewModule'
|
||||
export const TrueSheetModule = NativeModules.TrueSheetView ? NativeModules.TrueSheetView : new Proxy({}, {
|
||||
get() {
|
||||
throw new Error(LINKING_ERROR);
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=TrueSheetModule.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","TrueSheetModule","TrueSheetView","Proxy","get","Error"],"sourceRoot":"../../src","sources":["TrueSheetModule.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACjB,2FAA2F,GAC3FD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,OAAO,MAAMC,eAAe,GAAGN,aAAa,CAACO,aAAa,GACtDP,aAAa,CAACO,aAAa,GAC3B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CACF,CAAC","ignoreList":[]}
|
||||
@ -1,21 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
import React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
export * from "../TrueSheetGrabber.js";
|
||||
export * from "../TrueSheetFooter.js";
|
||||
export class TrueSheet extends React.Component {
|
||||
static dismiss = jest.fn();
|
||||
static present = jest.fn();
|
||||
static resize = jest.fn();
|
||||
dismiss = jest.fn();
|
||||
present = jest.fn();
|
||||
resize = jest.fn();
|
||||
render() {
|
||||
return /*#__PURE__*/_jsx(View, {
|
||||
...this.props
|
||||
});
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":["React","View","jsx","_jsx","TrueSheet","Component","dismiss","jest","fn","present","resize","render","props"],"sourceRoot":"../../../src","sources":["__mocks__/index.js"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEnC,cAAc,wBAAqB;AACnC,cAAc,uBAAoB;AAElC,OAAO,MAAMC,SAAS,SAASJ,KAAK,CAACK,SAAS,CAAC;EAC7C,OAAOC,OAAO,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;EAC1B,OAAOC,OAAO,GAAGF,IAAI,CAACC,EAAE,CAAC,CAAC;EAC1B,OAAOE,MAAM,GAAGH,IAAI,CAACC,EAAE,CAAC,CAAC;EAEzBF,OAAO,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;EACnBC,OAAO,GAAGF,IAAI,CAACC,EAAE,CAAC,CAAC;EACnBE,MAAM,GAAGH,IAAI,CAACC,EAAE,CAAC,CAAC;EAElBG,MAAMA,CAAA,EAAG;IACP,oBAAOR,IAAA,CAACF,IAAI;MAAA,GAAK,IAAI,CAACW;IAAK,CAAG,CAAC;EACjC;AACF","ignoreList":[]}
|
||||
@ -1,6 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
export * from "./TrueSheet.js";
|
||||
export * from "./TrueSheet.types.js";
|
||||
export * from "./TrueSheetGrabber.js";
|
||||
//# sourceMappingURL=index.js.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,gBAAa;AAC3B,cAAc,sBAAmB;AACjC,cAAc,uBAAoB","ignoreList":[]}
|
||||
@ -1 +0,0 @@
|
||||
{"type":"commonjs"}
|
||||
70
lib/typescript/commonjs/src/TrueSheet.d.ts
vendored
70
lib/typescript/commonjs/src/TrueSheet.d.ts
vendored
@ -1,70 +0,0 @@
|
||||
import { PureComponent, type ReactNode } from 'react';
|
||||
import { type NativeSyntheticEvent } from 'react-native';
|
||||
import type { TrueSheetProps } from './TrueSheet.types';
|
||||
export type ContainerSizeChangeEvent = NativeSyntheticEvent<{
|
||||
width: number;
|
||||
height: number;
|
||||
}>;
|
||||
interface TrueSheetState {
|
||||
containerWidth?: number;
|
||||
containerHeight?: number;
|
||||
contentHeight?: number;
|
||||
footerHeight?: number;
|
||||
scrollableHandle: number | null;
|
||||
}
|
||||
export declare class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
||||
displayName: string;
|
||||
private readonly ref;
|
||||
/**
|
||||
* Map of sheet names against their handle.
|
||||
*/
|
||||
private static readonly handles;
|
||||
constructor(props: TrueSheetProps);
|
||||
private static getHandle;
|
||||
/**
|
||||
* Present the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static present(name: string, index?: number): Promise<void>;
|
||||
/**
|
||||
* Dismiss the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static dismiss(name: string): Promise<void>;
|
||||
/**
|
||||
* Resize the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static resize(name: string, index: number): Promise<void>;
|
||||
private get handle();
|
||||
private updateState;
|
||||
private onSizeChange;
|
||||
private onContainerSizeChange;
|
||||
private onPresent;
|
||||
private onFooterLayout;
|
||||
private onContentLayout;
|
||||
private onDismiss;
|
||||
private onMount;
|
||||
private onDragBegin;
|
||||
private onDragChange;
|
||||
private onDragEnd;
|
||||
/**
|
||||
* Present the sheet. Optionally accepts a size `index`.
|
||||
* See `sizes` prop
|
||||
*/
|
||||
present(index?: number): Promise<void>;
|
||||
/**
|
||||
* Resizes the Sheet programmatically by `index`.
|
||||
* This is an alias of the `present(index)` method.
|
||||
*/
|
||||
resize(index: number): Promise<void>;
|
||||
/**
|
||||
* Dismisses the Sheet
|
||||
*/
|
||||
dismiss(): Promise<void>;
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(): void;
|
||||
render(): ReactNode;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=TrueSheet.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheet.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC3F,OAAO,EAOL,KAAK,oBAAoB,EAI1B,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EACV,cAAc,EAMf,MAAM,mBAAmB,CAAA;AAY1B,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;IAAE,KAAK,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OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,iBAAiB,IAAI,IAAI;IAUzB,kBAAkB,IAAI,IAAI;IAI1B,MAAM,IAAI,SAAS;CA8EpB"}
|
||||
241
lib/typescript/commonjs/src/TrueSheet.types.d.ts
vendored
241
lib/typescript/commonjs/src/TrueSheet.types.d.ts
vendored
@ -1,241 +0,0 @@
|
||||
import type { Component, ComponentType, ReactElement, RefObject } from 'react';
|
||||
import type { ColorValue, NativeSyntheticEvent, StyleProp, ViewProps, ViewStyle } from 'react-native';
|
||||
import type { TrueSheetGrabberProps } from './TrueSheetGrabber';
|
||||
export interface SizeInfo {
|
||||
index: number;
|
||||
value: number;
|
||||
}
|
||||
export type SizeChangeEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
export type PresentEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
export type DragBeginEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
export type DragChangeEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
export type DragEndEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
/**
|
||||
* Blur style mapped to native values in IOS.
|
||||
*
|
||||
* @platform ios
|
||||
*/
|
||||
export type BlurTint = 'light' | 'dark' | 'default' | 'extraLight' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark';
|
||||
/**
|
||||
* Supported Sheet size.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
export type SheetSize =
|
||||
/**
|
||||
* Auto resize based on content height
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 16+
|
||||
*/
|
||||
'auto'
|
||||
/**
|
||||
* Fixed height
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 16+
|
||||
*/
|
||||
| number
|
||||
/**
|
||||
* Fixed height in %
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 16+
|
||||
*/
|
||||
| `${number}%`
|
||||
/**
|
||||
* Translates to 25%
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 16+
|
||||
*/
|
||||
| 'small'
|
||||
/**
|
||||
* Translates to 50%
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
| 'medium'
|
||||
/**
|
||||
* Translates to 100%
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
| 'large';
|
||||
export interface TrueSheetProps extends ViewProps {
|
||||
/**
|
||||
* The name to reference this sheet. It has to be unique.
|
||||
* You can then present this sheet globally using its `name`.
|
||||
*
|
||||
* Example:
|
||||
* ```ts
|
||||
* <TrueSheet name="my-awesome-sheet">
|
||||
* <MyComponent />
|
||||
* </TrueSheet>
|
||||
* ```
|
||||
* ```ts
|
||||
* TrueSheet.present('my-awesome-sheet')
|
||||
* ```
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The sizes you want the Sheet to support.
|
||||
* Maximum of 3 sizes only; collapsed, half-expanded, expanded.
|
||||
*
|
||||
* Example:
|
||||
* ```ts
|
||||
* size={['auto', '60%', 'large']}
|
||||
* ```
|
||||
*
|
||||
* @default ['medium', 'large']
|
||||
*/
|
||||
sizes?: SheetSize[];
|
||||
/**
|
||||
* Specify whether the sheet background is dimmed.
|
||||
* Set to `false` to allow interaction with the background components.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
* @default true
|
||||
*/
|
||||
dimmed?: boolean;
|
||||
/**
|
||||
* Initially present the sheet, after mounting, at a given size index.
|
||||
*
|
||||
* @note This property is only used during the initial mount.
|
||||
* @default -1
|
||||
*/
|
||||
initialIndex?: number;
|
||||
/**
|
||||
* Specify whether the sheet should animate after mounting.
|
||||
* Used with `initialIndex`.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
initialIndexAnimated?: boolean;
|
||||
/**
|
||||
* The size index that the sheet should start to dim the background.
|
||||
* This is ignored if `dimmed` is set to `false`.
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
dimmedIndex?: number;
|
||||
/**
|
||||
* Prevents interactive dismissal of the Sheet.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
dismissible?: boolean;
|
||||
/**
|
||||
* Main sheet background color.
|
||||
|
||||
* @default white
|
||||
*/
|
||||
backgroundColor?: ColorValue;
|
||||
/**
|
||||
* The sheet corner radius.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
cornerRadius?: number;
|
||||
/**
|
||||
* Shows native grabber (or handle) on IOS.
|
||||
*
|
||||
* @platform ios
|
||||
* @default true
|
||||
*/
|
||||
grabber?: boolean;
|
||||
/**
|
||||
* Grabber props to be used for android grabber or handle.
|
||||
*
|
||||
* @platform android
|
||||
*/
|
||||
grabberProps?: TrueSheetGrabberProps;
|
||||
/**
|
||||
* The blur effect style on iOS.
|
||||
* Overrides `backgroundColor` if set.
|
||||
*
|
||||
* @platform ios
|
||||
*/
|
||||
blurTint?: BlurTint;
|
||||
/**
|
||||
* Optional content container styles.
|
||||
*/
|
||||
contentContainerStyle?: StyleProp<ViewStyle>;
|
||||
/**
|
||||
* The main scrollable ref that Sheet should handle on IOS.
|
||||
*
|
||||
* @platform ios
|
||||
*/
|
||||
scrollRef?: RefObject<Component<unknown>>;
|
||||
/**
|
||||
* Overrides `large` or `100%` height.
|
||||
*/
|
||||
maxHeight?: number;
|
||||
/**
|
||||
* A component that floats at the bottom of the Sheet.
|
||||
*/
|
||||
FooterComponent?: ComponentType<unknown> | ReactElement;
|
||||
/**
|
||||
* Determines how the software keyboard will impact the layout of the sheet.
|
||||
* Set to `pan` if you're working with `FlatList` with a `TextInput`.
|
||||
*
|
||||
* @platform android
|
||||
* @default resize
|
||||
*/
|
||||
keyboardMode?: 'resize' | 'pan';
|
||||
/**
|
||||
* Supports edge-to-edge on Android.
|
||||
* Turn this on if your app has it enabled.
|
||||
*
|
||||
* @platform android
|
||||
*/
|
||||
edgeToEdge?: boolean;
|
||||
/**
|
||||
* This is called when the sheet is ready to present.
|
||||
*/
|
||||
onMount?: () => void;
|
||||
/**
|
||||
* Called when the Sheet has been presented.
|
||||
* Comes with the size info.
|
||||
*/
|
||||
onPresent?: (event: PresentEvent) => void;
|
||||
/**
|
||||
* Called when the Sheet has been dismissed
|
||||
*/
|
||||
onDismiss?: () => void;
|
||||
/**
|
||||
* Called when the size of the sheet has changed.
|
||||
* Either by dragging or programatically.
|
||||
*/
|
||||
onSizeChange?: (event: SizeChangeEvent) => void;
|
||||
/**
|
||||
* Called when the sheet has began dragging.
|
||||
* Comes with the size info.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
onDragBegin?: (event: DragBeginEvent) => void;
|
||||
/**
|
||||
* Called when the sheet is being dragged.
|
||||
* Comes with the size info.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
onDragChange?: (event: DragChangeEvent) => void;
|
||||
/**
|
||||
* Called when the sheet dragging has ended.
|
||||
* Comes with the size info.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
onDragEnd?: (event: DragEndEvent) => void;
|
||||
}
|
||||
//# sourceMappingURL=TrueSheet.types.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheet.types.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC9E,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EA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AE7C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAE/C;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;CAC1C"}
|
||||
@ -1,7 +0,0 @@
|
||||
import type { TrueSheetProps } from './TrueSheet.types';
|
||||
interface TrueSheetFooterProps {
|
||||
Component?: TrueSheetProps['FooterComponent'];
|
||||
}
|
||||
export declare const TrueSheetFooter: (props: TrueSheetFooterProps) => import("react/jsx-runtime").JSX.Element | null;
|
||||
export {};
|
||||
//# sourceMappingURL=TrueSheetFooter.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheetFooter.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,eAAe,UAAW,oBAAoB,mDAU1D,CAAA"}
|
||||
@ -1,39 +0,0 @@
|
||||
import { type ColorValue, type ViewStyle, type StyleProp } from 'react-native';
|
||||
export interface TrueSheetGrabberProps {
|
||||
/**
|
||||
* Is grabber visible.
|
||||
* @default true
|
||||
*/
|
||||
visible?: boolean;
|
||||
/**
|
||||
* Optional style that overrides the default style.
|
||||
*/
|
||||
style?: StyleProp<ViewStyle>;
|
||||
/**
|
||||
* Grabber color according to M3 specs.
|
||||
* @default rgba(73,69,79,0.4)
|
||||
*/
|
||||
color?: ColorValue;
|
||||
/**
|
||||
* Grabber height according to M3 specs.
|
||||
* @default 4
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Grabber top position offset.
|
||||
*
|
||||
* @default 6
|
||||
*/
|
||||
topOffset?: number;
|
||||
/**
|
||||
* Grabber width according to M3 specs.
|
||||
* @default 32
|
||||
*/
|
||||
width?: number;
|
||||
}
|
||||
/**
|
||||
* Grabber component.
|
||||
* Used by defualt for Android but feel free to re-use.
|
||||
*/
|
||||
export declare const TrueSheetGrabber: (props: TrueSheetGrabberProps) => import("react/jsx-runtime").JSX.Element | null;
|
||||
//# sourceMappingURL=TrueSheetGrabber.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheetGrabber.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetGrabber.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAQpF,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,mDAiB5D,CAAA"}
|
||||
@ -1,2 +0,0 @@
|
||||
export declare const TrueSheetModule: any;
|
||||
//# sourceMappingURL=TrueSheetModule.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheetModule.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetModule.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,KASvB,CAAA"}
|
||||
@ -1 +0,0 @@
|
||||
//# sourceMappingURL=index.test.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/index.test.tsx"],"names":[],"mappings":""}
|
||||
4
lib/typescript/commonjs/src/index.d.ts
vendored
4
lib/typescript/commonjs/src/index.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
export * from './TrueSheet';
|
||||
export * from './TrueSheet.types';
|
||||
export * from './TrueSheetGrabber';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
|
||||
@ -1 +0,0 @@
|
||||
{"type":"module"}
|
||||
70
lib/typescript/module/src/TrueSheet.d.ts
vendored
70
lib/typescript/module/src/TrueSheet.d.ts
vendored
@ -1,70 +0,0 @@
|
||||
import { PureComponent, type ReactNode } from 'react';
|
||||
import { type NativeSyntheticEvent } from 'react-native';
|
||||
import type { TrueSheetProps } from './TrueSheet.types';
|
||||
export type ContainerSizeChangeEvent = NativeSyntheticEvent<{
|
||||
width: number;
|
||||
height: number;
|
||||
}>;
|
||||
interface TrueSheetState {
|
||||
containerWidth?: number;
|
||||
containerHeight?: number;
|
||||
contentHeight?: number;
|
||||
footerHeight?: number;
|
||||
scrollableHandle: number | null;
|
||||
}
|
||||
export declare class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
||||
displayName: string;
|
||||
private readonly ref;
|
||||
/**
|
||||
* Map of sheet names against their handle.
|
||||
*/
|
||||
private static readonly handles;
|
||||
constructor(props: TrueSheetProps);
|
||||
private static getHandle;
|
||||
/**
|
||||
* Present the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static present(name: string, index?: number): Promise<void>;
|
||||
/**
|
||||
* Dismiss the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static dismiss(name: string): Promise<void>;
|
||||
/**
|
||||
* Resize the sheet by given `name`.
|
||||
* See `name` prop.
|
||||
*/
|
||||
static resize(name: string, index: number): Promise<void>;
|
||||
private get handle();
|
||||
private updateState;
|
||||
private onSizeChange;
|
||||
private onContainerSizeChange;
|
||||
private onPresent;
|
||||
private onFooterLayout;
|
||||
private onContentLayout;
|
||||
private onDismiss;
|
||||
private onMount;
|
||||
private onDragBegin;
|
||||
private onDragChange;
|
||||
private onDragEnd;
|
||||
/**
|
||||
* Present the sheet. Optionally accepts a size `index`.
|
||||
* See `sizes` prop
|
||||
*/
|
||||
present(index?: number): Promise<void>;
|
||||
/**
|
||||
* Resizes the Sheet programmatically by `index`.
|
||||
* This is an alias of the `present(index)` method.
|
||||
*/
|
||||
resize(index: number): Promise<void>;
|
||||
/**
|
||||
* Dismisses the Sheet
|
||||
*/
|
||||
dismiss(): Promise<void>;
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(): void;
|
||||
render(): ReactNode;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=TrueSheet.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheet.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC3F,OAAO,EAOL,KAAK,oBAAoB,EAI1B,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EACV,cAAc,EAMf,MAAM,mBAAmB,CAAA;AAY1B,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAY9F,UAAU,cAAc;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;CAChC;AAQD,qBAAa,SAAU,SAAQ,aAAa,CAAC,cAAc,EAAE,cAAc,CAAC;IAC1E,WAAW,SAAc;IAEzB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAsB;IAE1C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAiC;gBAEpD,KAAK,EAAE,cAAc;IAyBjC,OAAO,CAAC,MAAM,CAAC,SAAS;IAUxB;;;OAGG;WACiB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU;IAO3D;;;OAGG;WACiB,OAAO,CAAC,IAAI,EAAE,MAAM;IAOxC;;;OAGG;WACiB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAItD,OAAO,KAAK,MAAM,GAOjB;IAED,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,SAAS;IAIjB;;;OAGG;IACU,OAAO,CAAC,KAAK,GAAE,MAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD;;;OAGG;IACU,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,iBAAiB,IAAI,IAAI;IAUzB,kBAAkB,IAAI,IAAI;IAI1B,MAAM,IAAI,SAAS;CA8EpB"}
|
||||
241
lib/typescript/module/src/TrueSheet.types.d.ts
vendored
241
lib/typescript/module/src/TrueSheet.types.d.ts
vendored
@ -1,241 +0,0 @@
|
||||
import type { Component, ComponentType, ReactElement, RefObject } from 'react';
|
||||
import type { ColorValue, NativeSyntheticEvent, StyleProp, ViewProps, ViewStyle } from 'react-native';
|
||||
import type { TrueSheetGrabberProps } from './TrueSheetGrabber';
|
||||
export interface SizeInfo {
|
||||
index: number;
|
||||
value: number;
|
||||
}
|
||||
export type SizeChangeEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
export type PresentEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
export type DragBeginEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
export type DragChangeEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
export type DragEndEvent = NativeSyntheticEvent<SizeInfo>;
|
||||
/**
|
||||
* Blur style mapped to native values in IOS.
|
||||
*
|
||||
* @platform ios
|
||||
*/
|
||||
export type BlurTint = 'light' | 'dark' | 'default' | 'extraLight' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark';
|
||||
/**
|
||||
* Supported Sheet size.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
export type SheetSize =
|
||||
/**
|
||||
* Auto resize based on content height
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 16+
|
||||
*/
|
||||
'auto'
|
||||
/**
|
||||
* Fixed height
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 16+
|
||||
*/
|
||||
| number
|
||||
/**
|
||||
* Fixed height in %
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 16+
|
||||
*/
|
||||
| `${number}%`
|
||||
/**
|
||||
* Translates to 25%
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 16+
|
||||
*/
|
||||
| 'small'
|
||||
/**
|
||||
* Translates to 50%
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
| 'medium'
|
||||
/**
|
||||
* Translates to 100%
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
| 'large';
|
||||
export interface TrueSheetProps extends ViewProps {
|
||||
/**
|
||||
* The name to reference this sheet. It has to be unique.
|
||||
* You can then present this sheet globally using its `name`.
|
||||
*
|
||||
* Example:
|
||||
* ```ts
|
||||
* <TrueSheet name="my-awesome-sheet">
|
||||
* <MyComponent />
|
||||
* </TrueSheet>
|
||||
* ```
|
||||
* ```ts
|
||||
* TrueSheet.present('my-awesome-sheet')
|
||||
* ```
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The sizes you want the Sheet to support.
|
||||
* Maximum of 3 sizes only; collapsed, half-expanded, expanded.
|
||||
*
|
||||
* Example:
|
||||
* ```ts
|
||||
* size={['auto', '60%', 'large']}
|
||||
* ```
|
||||
*
|
||||
* @default ['medium', 'large']
|
||||
*/
|
||||
sizes?: SheetSize[];
|
||||
/**
|
||||
* Specify whether the sheet background is dimmed.
|
||||
* Set to `false` to allow interaction with the background components.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
* @default true
|
||||
*/
|
||||
dimmed?: boolean;
|
||||
/**
|
||||
* Initially present the sheet, after mounting, at a given size index.
|
||||
*
|
||||
* @note This property is only used during the initial mount.
|
||||
* @default -1
|
||||
*/
|
||||
initialIndex?: number;
|
||||
/**
|
||||
* Specify whether the sheet should animate after mounting.
|
||||
* Used with `initialIndex`.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
initialIndexAnimated?: boolean;
|
||||
/**
|
||||
* The size index that the sheet should start to dim the background.
|
||||
* This is ignored if `dimmed` is set to `false`.
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
dimmedIndex?: number;
|
||||
/**
|
||||
* Prevents interactive dismissal of the Sheet.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
dismissible?: boolean;
|
||||
/**
|
||||
* Main sheet background color.
|
||||
|
||||
* @default white
|
||||
*/
|
||||
backgroundColor?: ColorValue;
|
||||
/**
|
||||
* The sheet corner radius.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
cornerRadius?: number;
|
||||
/**
|
||||
* Shows native grabber (or handle) on IOS.
|
||||
*
|
||||
* @platform ios
|
||||
* @default true
|
||||
*/
|
||||
grabber?: boolean;
|
||||
/**
|
||||
* Grabber props to be used for android grabber or handle.
|
||||
*
|
||||
* @platform android
|
||||
*/
|
||||
grabberProps?: TrueSheetGrabberProps;
|
||||
/**
|
||||
* The blur effect style on iOS.
|
||||
* Overrides `backgroundColor` if set.
|
||||
*
|
||||
* @platform ios
|
||||
*/
|
||||
blurTint?: BlurTint;
|
||||
/**
|
||||
* Optional content container styles.
|
||||
*/
|
||||
contentContainerStyle?: StyleProp<ViewStyle>;
|
||||
/**
|
||||
* The main scrollable ref that Sheet should handle on IOS.
|
||||
*
|
||||
* @platform ios
|
||||
*/
|
||||
scrollRef?: RefObject<Component<unknown>>;
|
||||
/**
|
||||
* Overrides `large` or `100%` height.
|
||||
*/
|
||||
maxHeight?: number;
|
||||
/**
|
||||
* A component that floats at the bottom of the Sheet.
|
||||
*/
|
||||
FooterComponent?: ComponentType<unknown> | ReactElement;
|
||||
/**
|
||||
* Determines how the software keyboard will impact the layout of the sheet.
|
||||
* Set to `pan` if you're working with `FlatList` with a `TextInput`.
|
||||
*
|
||||
* @platform android
|
||||
* @default resize
|
||||
*/
|
||||
keyboardMode?: 'resize' | 'pan';
|
||||
/**
|
||||
* Supports edge-to-edge on Android.
|
||||
* Turn this on if your app has it enabled.
|
||||
*
|
||||
* @platform android
|
||||
*/
|
||||
edgeToEdge?: boolean;
|
||||
/**
|
||||
* This is called when the sheet is ready to present.
|
||||
*/
|
||||
onMount?: () => void;
|
||||
/**
|
||||
* Called when the Sheet has been presented.
|
||||
* Comes with the size info.
|
||||
*/
|
||||
onPresent?: (event: PresentEvent) => void;
|
||||
/**
|
||||
* Called when the Sheet has been dismissed
|
||||
*/
|
||||
onDismiss?: () => void;
|
||||
/**
|
||||
* Called when the size of the sheet has changed.
|
||||
* Either by dragging or programatically.
|
||||
*/
|
||||
onSizeChange?: (event: SizeChangeEvent) => void;
|
||||
/**
|
||||
* Called when the sheet has began dragging.
|
||||
* Comes with the size info.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
onDragBegin?: (event: DragBeginEvent) => void;
|
||||
/**
|
||||
* Called when the sheet is being dragged.
|
||||
* Comes with the size info.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
onDragChange?: (event: DragChangeEvent) => void;
|
||||
/**
|
||||
* Called when the sheet dragging has ended.
|
||||
* Comes with the size info.
|
||||
*
|
||||
* @platform android
|
||||
* @platform ios 15+
|
||||
*/
|
||||
onDragEnd?: (event: DragEndEvent) => void;
|
||||
}
|
||||
//# sourceMappingURL=TrueSheet.types.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheet.types.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC9E,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE/D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAA;AAC5D,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAA;AACzD,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAAC,QAAQ,CAAC,C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;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAA;IAEpC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAE5C;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAEzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,YAAY,CAAA;IAEvD;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IAE/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;IAEzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IAEtB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAE/C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAA;IAE7C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAE/C;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;CAC1C"}
|
||||
@ -1,7 +0,0 @@
|
||||
import type { TrueSheetProps } from './TrueSheet.types';
|
||||
interface TrueSheetFooterProps {
|
||||
Component?: TrueSheetProps['FooterComponent'];
|
||||
}
|
||||
export declare const TrueSheetFooter: (props: TrueSheetFooterProps) => import("react/jsx-runtime").JSX.Element | null;
|
||||
export {};
|
||||
//# sourceMappingURL=TrueSheetFooter.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheetFooter.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,eAAe,UAAW,oBAAoB,mDAU1D,CAAA"}
|
||||
39
lib/typescript/module/src/TrueSheetGrabber.d.ts
vendored
39
lib/typescript/module/src/TrueSheetGrabber.d.ts
vendored
@ -1,39 +0,0 @@
|
||||
import { type ColorValue, type ViewStyle, type StyleProp } from 'react-native';
|
||||
export interface TrueSheetGrabberProps {
|
||||
/**
|
||||
* Is grabber visible.
|
||||
* @default true
|
||||
*/
|
||||
visible?: boolean;
|
||||
/**
|
||||
* Optional style that overrides the default style.
|
||||
*/
|
||||
style?: StyleProp<ViewStyle>;
|
||||
/**
|
||||
* Grabber color according to M3 specs.
|
||||
* @default rgba(73,69,79,0.4)
|
||||
*/
|
||||
color?: ColorValue;
|
||||
/**
|
||||
* Grabber height according to M3 specs.
|
||||
* @default 4
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Grabber top position offset.
|
||||
*
|
||||
* @default 6
|
||||
*/
|
||||
topOffset?: number;
|
||||
/**
|
||||
* Grabber width according to M3 specs.
|
||||
* @default 32
|
||||
*/
|
||||
width?: number;
|
||||
}
|
||||
/**
|
||||
* Grabber component.
|
||||
* Used by defualt for Android but feel free to re-use.
|
||||
*/
|
||||
export declare const TrueSheetGrabber: (props: TrueSheetGrabberProps) => import("react/jsx-runtime").JSX.Element | null;
|
||||
//# sourceMappingURL=TrueSheetGrabber.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheetGrabber.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetGrabber.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAQpF,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,mDAiB5D,CAAA"}
|
||||
@ -1,2 +0,0 @@
|
||||
export declare const TrueSheetModule: any;
|
||||
//# sourceMappingURL=TrueSheetModule.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"TrueSheetModule.d.ts","sourceRoot":"","sources":["../../../../src/TrueSheetModule.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,KASvB,CAAA"}
|
||||
@ -1 +0,0 @@
|
||||
//# sourceMappingURL=index.test.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/index.test.tsx"],"names":[],"mappings":""}
|
||||
4
lib/typescript/module/src/index.d.ts
vendored
4
lib/typescript/module/src/index.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
export * from './TrueSheet';
|
||||
export * from './TrueSheet.types';
|
||||
export * from './TrueSheetGrabber';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
|
||||
Loading…
Reference in New Issue
Block a user