react-native-bottom-sheet-stack 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/lib/commonjs/BottomSheet.context.js +1 -2
- package/lib/commonjs/BottomSheet.context.js.map +1 -1
- package/lib/commonjs/BottomSheetBackdrop.js +23 -32
- package/lib/commonjs/BottomSheetBackdrop.js.map +1 -1
- package/lib/commonjs/BottomSheetHost.js +17 -254
- package/lib/commonjs/BottomSheetHost.js.map +1 -1
- package/lib/commonjs/BottomSheetManaged.js +87 -54
- package/lib/commonjs/BottomSheetManaged.js.map +1 -1
- package/lib/commonjs/BottomSheetPersistent.js +113 -0
- package/lib/commonjs/BottomSheetPersistent.js.map +1 -0
- package/lib/commonjs/BottomSheetPortal.js +4 -3
- package/lib/commonjs/BottomSheetPortal.js.map +1 -1
- package/lib/commonjs/BottomSheetRef.context.js +17 -0
- package/lib/commonjs/BottomSheetRef.context.js.map +1 -0
- package/lib/commonjs/QueueItem.js +167 -0
- package/lib/commonjs/QueueItem.js.map +1 -0
- package/lib/commonjs/animatedRegistry.js +9 -0
- package/lib/commonjs/animatedRegistry.js.map +1 -1
- package/lib/commonjs/bottomSheet.store.js +11 -133
- package/lib/commonjs/bottomSheet.store.js.map +1 -1
- package/lib/commonjs/bottomSheetCoordinator.js +9 -10
- package/lib/commonjs/bottomSheetCoordinator.js.map +1 -1
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/portalSessionRegistry.js +32 -0
- package/lib/commonjs/portalSessionRegistry.js.map +1 -0
- package/lib/commonjs/refsMap.js +9 -0
- package/lib/commonjs/refsMap.js.map +1 -1
- package/lib/commonjs/store/helpers.js +59 -0
- package/lib/commonjs/store/helpers.js.map +1 -0
- package/lib/commonjs/store/hooks.js +176 -0
- package/lib/commonjs/store/hooks.js.map +1 -0
- package/lib/commonjs/store/index.js +52 -0
- package/lib/commonjs/store/index.js.map +1 -0
- package/lib/commonjs/store/store.js +140 -0
- package/lib/commonjs/store/store.js.map +1 -0
- package/lib/commonjs/store/types.js +6 -0
- package/lib/commonjs/store/types.js.map +1 -0
- package/lib/commonjs/useBottomSheetContext.js +24 -42
- package/lib/commonjs/useBottomSheetContext.js.map +1 -1
- package/lib/commonjs/useBottomSheetControl.js +8 -14
- package/lib/commonjs/useBottomSheetControl.js.map +1 -1
- package/lib/commonjs/useBottomSheetManager.js +3 -13
- package/lib/commonjs/useBottomSheetManager.js.map +1 -1
- package/lib/commonjs/useBottomSheetStatus.js +9 -17
- package/lib/commonjs/useBottomSheetStatus.js.map +1 -1
- package/lib/commonjs/useEvent.js +39 -0
- package/lib/commonjs/useEvent.js.map +1 -0
- package/lib/commonjs/useScaleAnimation.js +53 -30
- package/lib/commonjs/useScaleAnimation.js.map +1 -1
- package/lib/commonjs/useSheetRenderData.js +62 -0
- package/lib/commonjs/useSheetRenderData.js.map +1 -0
- package/lib/typescript/example/src/App.d.ts.map +1 -1
- package/lib/typescript/example/src/screens/HomeScreen.d.ts.map +1 -1
- package/lib/typescript/example/src/sheets/NavigationSheets.d.ts.map +1 -1
- package/lib/typescript/example/src/sheets/ScannerNestedSheets.d.ts +4 -0
- package/lib/typescript/example/src/sheets/ScannerNestedSheets.d.ts.map +1 -0
- package/lib/typescript/example/src/sheets/ScannerSheet.d.ts +3 -0
- package/lib/typescript/example/src/sheets/ScannerSheet.d.ts.map +1 -0
- package/lib/typescript/example/src/sheets/index.d.ts +1 -0
- package/lib/typescript/example/src/sheets/index.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheet.context.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheetBackdrop.d.ts +0 -5
- package/lib/typescript/src/BottomSheetBackdrop.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheetHost.d.ts +1 -3
- package/lib/typescript/src/BottomSheetHost.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheetManaged.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheetPersistent.d.ts +9 -0
- package/lib/typescript/src/BottomSheetPersistent.d.ts.map +1 -0
- package/lib/typescript/src/BottomSheetPortal.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheetRef.context.d.ts +11 -0
- package/lib/typescript/src/BottomSheetRef.context.d.ts.map +1 -0
- package/lib/typescript/src/QueueItem.d.ts +8 -0
- package/lib/typescript/src/QueueItem.d.ts.map +1 -0
- package/lib/typescript/src/animatedRegistry.d.ts +5 -0
- package/lib/typescript/src/animatedRegistry.d.ts.map +1 -1
- package/lib/typescript/src/bottomSheet.store.d.ts +1 -37
- package/lib/typescript/src/bottomSheet.store.d.ts.map +1 -1
- package/lib/typescript/src/bottomSheetCoordinator.d.ts +2 -1
- package/lib/typescript/src/bottomSheetCoordinator.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +5 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/portalSessionRegistry.d.ts +8 -0
- package/lib/typescript/src/portalSessionRegistry.d.ts.map +1 -0
- package/lib/typescript/src/refsMap.d.ts +5 -0
- package/lib/typescript/src/refsMap.d.ts.map +1 -1
- package/lib/typescript/src/store/helpers.d.ts +11 -0
- package/lib/typescript/src/store/helpers.d.ts.map +1 -0
- package/lib/typescript/src/store/hooks.d.ts +16 -0
- package/lib/typescript/src/store/hooks.d.ts.map +1 -0
- package/lib/typescript/src/store/index.d.ts +5 -0
- package/lib/typescript/src/store/index.d.ts.map +1 -0
- package/lib/typescript/src/store/store.d.ts +11 -0
- package/lib/typescript/src/store/store.d.ts.map +1 -0
- package/lib/typescript/src/store/types.d.ts +37 -0
- package/lib/typescript/src/store/types.d.ts.map +1 -0
- package/lib/typescript/src/useBottomSheetContext.d.ts.map +1 -1
- package/lib/typescript/src/useBottomSheetControl.d.ts.map +1 -1
- package/lib/typescript/src/useBottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/src/useBottomSheetStatus.d.ts +1 -2
- package/lib/typescript/src/useBottomSheetStatus.d.ts.map +1 -1
- package/lib/typescript/src/useEvent.d.ts +4 -0
- package/lib/typescript/src/useEvent.d.ts.map +1 -0
- package/lib/typescript/src/useScaleAnimation.d.ts +10 -13
- package/lib/typescript/src/useScaleAnimation.d.ts.map +1 -1
- package/lib/typescript/src/useSheetRenderData.d.ts +17 -0
- package/lib/typescript/src/useSheetRenderData.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/BottomSheet.context.ts +1 -3
- package/src/BottomSheetBackdrop.tsx +10 -19
- package/src/BottomSheetHost.tsx +13 -99
- package/src/BottomSheetManaged.tsx +24 -2
- package/src/BottomSheetPersistent.tsx +57 -0
- package/src/BottomSheetPortal.tsx +5 -7
- package/src/BottomSheetRef.context.ts +14 -0
- package/src/QueueItem.tsx +83 -0
- package/src/animatedRegistry.ts +8 -0
- package/src/bottomSheet.store.ts +1 -173
- package/src/bottomSheetCoordinator.ts +10 -8
- package/src/index.tsx +7 -1
- package/src/portalSessionRegistry.ts +25 -0
- package/src/refsMap.ts +8 -0
- package/src/store/helpers.ts +65 -0
- package/src/store/hooks.ts +50 -0
- package/src/store/index.ts +4 -0
- package/src/store/store.ts +168 -0
- package/src/store/types.ts +42 -0
- package/src/useBottomSheetContext.ts +6 -15
- package/src/useBottomSheetControl.ts +16 -7
- package/src/useBottomSheetManager.tsx +9 -10
- package/src/useBottomSheetStatus.ts +4 -14
- package/src/useEvent.ts +17 -0
- package/src/useScaleAnimation.ts +67 -35
- package/src/useSheetRenderData.ts +74 -0
|
@@ -3,137 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...state.sheetsById
|
|
18
|
-
};
|
|
19
|
-
const topId = state.stackOrder[state.stackOrder.length - 1];
|
|
20
|
-
if (mode === 'switch' && topId && newSheetsById[topId]) {
|
|
21
|
-
newSheetsById[topId] = {
|
|
22
|
-
...newSheetsById[topId],
|
|
23
|
-
status: 'hidden'
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
if (mode === 'replace' && topId && newSheetsById[topId]) {
|
|
27
|
-
newSheetsById[topId] = {
|
|
28
|
-
...newSheetsById[topId],
|
|
29
|
-
status: 'closing'
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
newSheetsById[sheet.id] = {
|
|
33
|
-
...sheet,
|
|
34
|
-
status: 'opening'
|
|
35
|
-
};
|
|
36
|
-
return {
|
|
37
|
-
sheetsById: newSheetsById,
|
|
38
|
-
stackOrder: [...state.stackOrder, sheet.id]
|
|
39
|
-
};
|
|
40
|
-
}),
|
|
41
|
-
markOpen: id => set(state => {
|
|
42
|
-
const sheet = state.sheetsById[id];
|
|
43
|
-
if (!sheet) {
|
|
44
|
-
return state;
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
sheetsById: {
|
|
48
|
-
...state.sheetsById,
|
|
49
|
-
[id]: {
|
|
50
|
-
...sheet,
|
|
51
|
-
status: 'open'
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}),
|
|
56
|
-
startClosing: id => set(state => {
|
|
57
|
-
const sheet = state.sheetsById[id];
|
|
58
|
-
if (!sheet || sheet.status === 'hidden') {
|
|
59
|
-
return state;
|
|
60
|
-
}
|
|
61
|
-
const newSheetsById = {
|
|
62
|
-
...state.sheetsById
|
|
63
|
-
};
|
|
64
|
-
newSheetsById[id] = {
|
|
65
|
-
...sheet,
|
|
66
|
-
status: 'closing'
|
|
67
|
-
};
|
|
68
|
-
const index = state.stackOrder.indexOf(id);
|
|
69
|
-
const belowId = state.stackOrder[index - 1];
|
|
70
|
-
const belowSheet = belowId ? newSheetsById[belowId] : undefined;
|
|
71
|
-
if (belowId && belowSheet && belowSheet.status === 'hidden') {
|
|
72
|
-
newSheetsById[belowId] = {
|
|
73
|
-
...belowSheet,
|
|
74
|
-
status: 'opening'
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
sheetsById: newSheetsById
|
|
79
|
-
};
|
|
80
|
-
}),
|
|
81
|
-
finishClosing: id => set(state => {
|
|
82
|
-
if (!state.sheetsById[id]) {
|
|
83
|
-
return state;
|
|
84
|
-
}
|
|
85
|
-
const newSheetsById = {
|
|
86
|
-
...state.sheetsById
|
|
87
|
-
};
|
|
88
|
-
delete newSheetsById[id];
|
|
89
|
-
const newStackOrder = state.stackOrder.filter(sheetId => sheetId !== id);
|
|
90
|
-
const topId = newStackOrder[newStackOrder.length - 1];
|
|
91
|
-
const topSheet = topId ? newSheetsById[topId] : undefined;
|
|
92
|
-
if (topId && topSheet && topSheet.status === 'hidden') {
|
|
93
|
-
newSheetsById[topId] = {
|
|
94
|
-
...topSheet,
|
|
95
|
-
status: 'opening'
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
sheetsById: newSheetsById,
|
|
100
|
-
stackOrder: newStackOrder
|
|
101
|
-
};
|
|
102
|
-
}),
|
|
103
|
-
updateParams: (id, params) => set(state => {
|
|
104
|
-
const sheet = state.sheetsById[id];
|
|
105
|
-
if (!sheet) {
|
|
106
|
-
return state;
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
sheetsById: {
|
|
110
|
-
...state.sheetsById,
|
|
111
|
-
[id]: {
|
|
112
|
-
...sheet,
|
|
113
|
-
params
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
}),
|
|
118
|
-
clearGroup: groupId => set(state => {
|
|
119
|
-
const idsToRemove = new Set(state.stackOrder.filter(id => state.sheetsById[id]?.groupId === groupId));
|
|
120
|
-
if (idsToRemove.size === 0) {
|
|
121
|
-
return state;
|
|
122
|
-
}
|
|
123
|
-
const newSheetsById = {
|
|
124
|
-
...state.sheetsById
|
|
125
|
-
};
|
|
126
|
-
idsToRemove.forEach(id => {
|
|
127
|
-
delete newSheetsById[id];
|
|
128
|
-
});
|
|
129
|
-
return {
|
|
130
|
-
sheetsById: newSheetsById,
|
|
131
|
-
stackOrder: state.stackOrder.filter(id => !idsToRemove.has(id))
|
|
132
|
-
};
|
|
133
|
-
}),
|
|
134
|
-
clearAll: () => set(() => ({
|
|
135
|
-
sheetsById: {},
|
|
136
|
-
stackOrder: []
|
|
137
|
-
}))
|
|
138
|
-
})));
|
|
6
|
+
var _store = require("./store");
|
|
7
|
+
Object.keys(_store).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _store[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _store[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
139
17
|
//# sourceMappingURL=bottomSheet.store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_store","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../src","sources":["bottomSheet.store.ts"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -48,19 +48,17 @@ function createSheetEventHandlers(sheetId) {
|
|
|
48
48
|
finishClosing,
|
|
49
49
|
markOpen
|
|
50
50
|
} = _bottomSheet.useBottomSheetStore.getState();
|
|
51
|
-
const handleAnimate = (
|
|
51
|
+
const handleAnimate = (_fromIndex, toIndex) => {
|
|
52
52
|
const state = _bottomSheet.useBottomSheetStore.getState();
|
|
53
53
|
const currentStatus = state.sheetsById[sheetId]?.status;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (toIndex === -1) {
|
|
57
|
-
if (currentStatus === 'open' || currentStatus === 'opening') {
|
|
58
|
-
startClosing(sheetId);
|
|
59
|
-
}
|
|
54
|
+
if (toIndex === -1 && currentStatus === 'open') {
|
|
55
|
+
startClosing(sheetId);
|
|
60
56
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
};
|
|
58
|
+
const handleChange = index => {
|
|
59
|
+
const state = _bottomSheet.useBottomSheetStore.getState();
|
|
60
|
+
const currentStatus = state.sheetsById[sheetId]?.status;
|
|
61
|
+
if (index >= 0 && currentStatus === 'opening') {
|
|
64
62
|
markOpen(sheetId);
|
|
65
63
|
}
|
|
66
64
|
};
|
|
@@ -73,6 +71,7 @@ function createSheetEventHandlers(sheetId) {
|
|
|
73
71
|
};
|
|
74
72
|
return {
|
|
75
73
|
handleAnimate,
|
|
74
|
+
handleChange,
|
|
76
75
|
handleClose
|
|
77
76
|
};
|
|
78
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bottomSheet","require","_refsMap","initBottomSheetCoordinator","groupId","useBottomSheetStore","subscribe","s","stackOrder","filter","id","sheetsById","map","status","next","prev","forEach","prevStatus","find","p","ref","getSheetRef","current","requestAnimationFrame","expand","close","createSheetEventHandlers","sheetId","startClosing","finishClosing","markOpen","getState","handleAnimate","
|
|
1
|
+
{"version":3,"names":["_bottomSheet","require","_refsMap","initBottomSheetCoordinator","groupId","useBottomSheetStore","subscribe","s","stackOrder","filter","id","sheetsById","map","status","next","prev","forEach","prevStatus","find","p","ref","getSheetRef","current","requestAnimationFrame","expand","close","createSheetEventHandlers","sheetId","startClosing","finishClosing","markOpen","getState","handleAnimate","_fromIndex","toIndex","state","currentStatus","handleChange","index","handleClose"],"sourceRoot":"../../src","sources":["bottomSheetCoordinator.ts"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,SAASE,0BAA0BA,CAACC,OAAe,EAAE;EAC1D,OAAOC,gCAAmB,CAACC,SAAS,CACjCC,CAAC,IACAA,CAAC,CAACC,UAAU,CACTC,MAAM,CAAEC,EAAE,IAAKH,CAAC,CAACI,UAAU,CAACD,EAAE,CAAC,EAAEN,OAAO,KAAKA,OAAO,CAAC,CACrDQ,GAAG,CAAEF,EAAE,KAAM;IAAEA,EAAE;IAAEG,MAAM,EAAEN,CAAC,CAACI,UAAU,CAACD,EAAE,CAAC,EAAEG;EAAO,CAAC,CAAC,CAAC,EAC5D,CAACC,IAAI,EAAEC,IAAI,KAAK;IACdD,IAAI,CAACE,OAAO,CAAC,CAAC;MAAEN,EAAE;MAAEG;IAAO,CAAC,KAAK;MAC/B,MAAMI,UAAU,GAAGF,IAAI,CAACG,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACT,EAAE,KAAKA,EAAE,CAAC,EAAEG,MAAM;MAExD,IAAII,UAAU,KAAKJ,MAAM,EAAE;QACzB;MACF;MAEA,MAAMO,GAAG,GAAG,IAAAC,oBAAW,EAACX,EAAE,CAAC,EAAEY,OAAO;MAEpC,QAAQT,MAAM;QACZ,KAAK,SAAS;UACZU,qBAAqB,CAAC,MAAM;YAC1B,IAAAF,oBAAW,EAACX,EAAE,CAAC,EAAEY,OAAO,EAAEE,MAAM,CAAC,CAAC;UACpC,CAAC,CAAC;UACF;QACF,KAAK,QAAQ;UACX,IAAIJ,GAAG,EAAEA,GAAG,CAACK,KAAK,CAAC,CAAC;UACpB;QACF,KAAK,SAAS;UACZ,IAAIL,GAAG,EAAEA,GAAG,CAACK,KAAK,CAAC,CAAC;UACpB;MACJ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SheetManagerProvider", {
|
|
|
21
21
|
return _BottomSheetManager.BottomSheetManagerProvider;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "BottomSheetPersistent", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _BottomSheetPersistent.BottomSheetPersistent;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "BottomSheetPortal", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function () {
|
|
@@ -33,6 +39,24 @@ Object.defineProperty(exports, "BottomSheetScaleView", {
|
|
|
33
39
|
return _BottomSheetScaleView.BottomSheetScaleView;
|
|
34
40
|
}
|
|
35
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "__resetAnimatedIndexes", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _animatedRegistry.__resetAnimatedIndexes;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "__resetPortalSessions", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _portalSessionRegistry.__resetPortalSessions;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "__resetSheetRefs", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _refsMap.__resetSheetRefs;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
36
60
|
Object.defineProperty(exports, "useBottomSheetContext", {
|
|
37
61
|
enumerable: true,
|
|
38
62
|
get: function () {
|
|
@@ -68,8 +92,12 @@ var _BottomSheetHost = require("./BottomSheetHost");
|
|
|
68
92
|
var _BottomSheetScaleView = require("./BottomSheetScaleView");
|
|
69
93
|
var _BottomSheetManaged = require("./BottomSheetManaged");
|
|
70
94
|
var _BottomSheetPortal = require("./BottomSheetPortal");
|
|
95
|
+
var _BottomSheetPersistent = require("./BottomSheetPersistent");
|
|
71
96
|
var _useBottomSheetManager = require("./useBottomSheetManager");
|
|
72
97
|
var _useBottomSheetControl = require("./useBottomSheetControl");
|
|
73
98
|
var _useBottomSheetContext = require("./useBottomSheetContext");
|
|
74
99
|
var _useBottomSheetStatus = require("./useBottomSheetStatus");
|
|
100
|
+
var _refsMap = require("./refsMap");
|
|
101
|
+
var _animatedRegistry = require("./animatedRegistry");
|
|
102
|
+
var _portalSessionRegistry = require("./portalSessionRegistry");
|
|
75
103
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_BottomSheetManager","require","_BottomSheetHost","_BottomSheetScaleView","_BottomSheetManaged","_BottomSheetPortal","_useBottomSheetManager","_useBottomSheetControl","_useBottomSheetContext","_useBottomSheetStatus"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_BottomSheetManager","require","_BottomSheetHost","_BottomSheetScaleView","_BottomSheetManaged","_BottomSheetPortal","_BottomSheetPersistent","_useBottomSheetManager","_useBottomSheetControl","_useBottomSheetContext","_useBottomSheetStatus","_refsMap","_animatedRegistry","_portalSessionRegistry"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA;AAGA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAP,OAAA;AAIA,IAAAQ,sBAAA,GAAAR,OAAA;AAKA,IAAAS,qBAAA,GAAAT,OAAA;AAmBA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,iBAAA,GAAAX,OAAA;AACA,IAAAY,sBAAA,GAAAZ,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.__resetPortalSessions = __resetPortalSessions;
|
|
7
|
+
exports.getCurrentPortalSession = getCurrentPortalSession;
|
|
8
|
+
exports.getNextPortalSession = getNextPortalSession;
|
|
9
|
+
/**
|
|
10
|
+
* Registry for portal session counters per sheet.
|
|
11
|
+
* This persists across sheet deletions to ensure unique Portal/PortalHost names
|
|
12
|
+
* and work around react-native-teleport connection issues after replace flows.
|
|
13
|
+
*/
|
|
14
|
+
const portalSessionRegistry = new Map();
|
|
15
|
+
function getNextPortalSession(sheetId) {
|
|
16
|
+
const current = portalSessionRegistry.get(sheetId) ?? 0;
|
|
17
|
+
const next = current + 1;
|
|
18
|
+
portalSessionRegistry.set(sheetId, next);
|
|
19
|
+
return next;
|
|
20
|
+
}
|
|
21
|
+
function getCurrentPortalSession(sheetId) {
|
|
22
|
+
return portalSessionRegistry.get(sheetId);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Reset all portal sessions. Useful for testing.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
function __resetPortalSessions() {
|
|
30
|
+
portalSessionRegistry.clear();
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=portalSessionRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["portalSessionRegistry","Map","getNextPortalSession","sheetId","current","get","next","set","getCurrentPortalSession","__resetPortalSessions","clear"],"sourceRoot":"../../src","sources":["portalSessionRegistry.ts"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,MAAMA,qBAAqB,GAAG,IAAIC,GAAG,CAAiB,CAAC;AAEhD,SAASC,oBAAoBA,CAACC,OAAe,EAAU;EAC5D,MAAMC,OAAO,GAAGJ,qBAAqB,CAACK,GAAG,CAACF,OAAO,CAAC,IAAI,CAAC;EACvD,MAAMG,IAAI,GAAGF,OAAO,GAAG,CAAC;EACxBJ,qBAAqB,CAACO,GAAG,CAACJ,OAAO,EAAEG,IAAI,CAAC;EACxC,OAAOA,IAAI;AACb;AAEO,SAASE,uBAAuBA,CAACL,OAAe,EAAsB;EAC3E,OAAOH,qBAAqB,CAACK,GAAG,CAACF,OAAO,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACO,SAASM,qBAAqBA,CAAA,EAAS;EAC5CT,qBAAqB,CAACU,KAAK,CAAC,CAAC;AAC/B","ignoreList":[]}
|
package/lib/commonjs/refsMap.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.__resetSheetRefs = __resetSheetRefs;
|
|
6
7
|
exports.cleanupSheetRef = cleanupSheetRef;
|
|
7
8
|
exports.getSheetRef = getSheetRef;
|
|
8
9
|
exports.setSheetRef = setSheetRef;
|
|
@@ -16,4 +17,12 @@ function setSheetRef(sheetId, ref) {
|
|
|
16
17
|
function cleanupSheetRef(sheetId) {
|
|
17
18
|
sheetRefsMap.delete(sheetId);
|
|
18
19
|
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Reset all sheet refs. Useful for testing.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
function __resetSheetRefs() {
|
|
26
|
+
sheetRefsMap.clear();
|
|
27
|
+
}
|
|
19
28
|
//# sourceMappingURL=refsMap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sheetRefsMap","Map","getSheetRef","sheetId","get","setSheetRef","ref","set","cleanupSheetRef","delete"],"sourceRoot":"../../src","sources":["refsMap.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["sheetRefsMap","Map","getSheetRef","sheetId","get","setSheetRef","ref","set","cleanupSheetRef","delete","__resetSheetRefs","clear"],"sourceRoot":"../../src","sources":["refsMap.ts"],"mappings":";;;;;;;;;AAKA,MAAMA,YAAY,GAAG,IAAIC,GAAG,CAAmB,CAAC;AAEzC,SAASC,WAAWA,CAACC,OAAe,EAAwB;EACjE,OAAOH,YAAY,CAACI,GAAG,CAACD,OAAO,CAAC;AAClC;AAEO,SAASE,WAAWA,CAACF,OAAe,EAAEG,GAAa,EAAQ;EAChEN,YAAY,CAACO,GAAG,CAACJ,OAAO,EAAEG,GAAG,CAAC;AAChC;AAEO,SAASE,eAAeA,CAACL,OAAe,EAAQ;EACrDH,YAAY,CAACS,MAAM,CAACN,OAAO,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACO,SAASO,gBAAgBA,CAAA,EAAS;EACvCV,YAAY,CAACW,KAAK,CAAC,CAAC;AACtB","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MODE_STATUS_MAP = void 0;
|
|
7
|
+
exports.applyModeToTopSheet = applyModeToTopSheet;
|
|
8
|
+
exports.getSheetBelowId = getSheetBelowId;
|
|
9
|
+
exports.getTopSheetId = getTopSheetId;
|
|
10
|
+
exports.isActivatableKeepMounted = isActivatableKeepMounted;
|
|
11
|
+
exports.isHidden = isHidden;
|
|
12
|
+
exports.isOpening = isOpening;
|
|
13
|
+
exports.removeFromStack = removeFromStack;
|
|
14
|
+
exports.updateSheet = updateSheet;
|
|
15
|
+
const MODE_STATUS_MAP = exports.MODE_STATUS_MAP = {
|
|
16
|
+
push: null,
|
|
17
|
+
switch: 'hidden',
|
|
18
|
+
replace: 'closing'
|
|
19
|
+
};
|
|
20
|
+
function isActivatableKeepMounted(sheet) {
|
|
21
|
+
return Boolean(sheet?.keepMounted && sheet.status === 'hidden');
|
|
22
|
+
}
|
|
23
|
+
function isHidden(sheet) {
|
|
24
|
+
return sheet?.status === 'hidden';
|
|
25
|
+
}
|
|
26
|
+
function isOpening(sheet) {
|
|
27
|
+
return sheet?.status === 'opening';
|
|
28
|
+
}
|
|
29
|
+
function updateSheet(sheetsById, id, update) {
|
|
30
|
+
const sheet = sheetsById[id];
|
|
31
|
+
if (!sheet) return sheetsById;
|
|
32
|
+
return {
|
|
33
|
+
...sheetsById,
|
|
34
|
+
[id]: {
|
|
35
|
+
...sheet,
|
|
36
|
+
...update
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function applyModeToTopSheet(sheetsById, stackOrder, mode) {
|
|
41
|
+
const targetStatus = MODE_STATUS_MAP[mode];
|
|
42
|
+
if (!targetStatus) return sheetsById;
|
|
43
|
+
const topId = stackOrder[stackOrder.length - 1];
|
|
44
|
+
if (!topId || !sheetsById[topId]) return sheetsById;
|
|
45
|
+
return updateSheet(sheetsById, topId, {
|
|
46
|
+
status: targetStatus
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function removeFromStack(stackOrder, id) {
|
|
50
|
+
return stackOrder.filter(sheetId => sheetId !== id);
|
|
51
|
+
}
|
|
52
|
+
function getTopSheetId(stackOrder) {
|
|
53
|
+
return stackOrder[stackOrder.length - 1];
|
|
54
|
+
}
|
|
55
|
+
function getSheetBelowId(stackOrder, id) {
|
|
56
|
+
const index = stackOrder.indexOf(id);
|
|
57
|
+
return index > 0 ? stackOrder[index - 1] : undefined;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MODE_STATUS_MAP","exports","push","switch","replace","isActivatableKeepMounted","sheet","Boolean","keepMounted","status","isHidden","isOpening","updateSheet","sheetsById","id","update","applyModeToTopSheet","stackOrder","mode","targetStatus","topId","length","removeFromStack","filter","sheetId","getTopSheetId","getSheetBelowId","index","indexOf","undefined"],"s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EH,EAAU,EAAY;EAC1E,OAAOG,UAAU,CAACM,MAAM,CAAEC,OAAO,IAAKA,OAAO,KAAKV,EAAE,CAAC;AACvD;AAEO,SAASW,aAAaA,CAACR,UAAoB,EAAsB;EACtE,OAAOA,UAAU,CAACA,UAAU,CAACI,MAAM,GAAG,CAAC,CAAC;AAC1C;AAEO,SAASK,eAAeA,CAC7BT,UAAoB,EACpBH,EAAU,EACU;EACpB,MAAMa,KAAK,GAAGV,UAAU,CAACW,OAAO,CAACd,EAAE,CAAC;EACpC,OAAOa,KAAK,GAAG,CAAC,GAAGV,UAAU,CAACU,KAAK,GAAG,CAAC,CAAC,GAAGE,SAAS;AACtD","ignoreList":[]}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useUpdateParams = exports.useUnmount = exports.useStartClosing = exports.useSheetUsePortal = exports.useSheetStatus = exports.useSheetPortalSession = exports.useSheetParams = exports.useSheetKeepMounted = exports.useSheetExists = exports.useSheetContent = exports.useSheet = exports.useOpen = exports.useMount = exports.useIsSheetOpen = exports.useClearGroup = void 0;
|
|
7
|
+
var _compilerRuntime = require("react/compiler-runtime");
|
|
8
|
+
var _shallow = require("zustand/shallow");
|
|
9
|
+
var _store = require("./store");
|
|
10
|
+
// State hooks
|
|
11
|
+
|
|
12
|
+
const useSheet = id => {
|
|
13
|
+
const $ = (0, _compilerRuntime.c)(2);
|
|
14
|
+
let t0;
|
|
15
|
+
if ($[0] !== id) {
|
|
16
|
+
t0 = state => state.sheetsById[id];
|
|
17
|
+
$[0] = id;
|
|
18
|
+
$[1] = t0;
|
|
19
|
+
} else {
|
|
20
|
+
t0 = $[1];
|
|
21
|
+
}
|
|
22
|
+
return (0, _store.useBottomSheetStore)(t0, _shallow.shallow);
|
|
23
|
+
};
|
|
24
|
+
exports.useSheet = useSheet;
|
|
25
|
+
const useSheetStatus = id => {
|
|
26
|
+
const $ = (0, _compilerRuntime.c)(2);
|
|
27
|
+
let t0;
|
|
28
|
+
if ($[0] !== id) {
|
|
29
|
+
t0 = state => state.sheetsById[id]?.status;
|
|
30
|
+
$[0] = id;
|
|
31
|
+
$[1] = t0;
|
|
32
|
+
} else {
|
|
33
|
+
t0 = $[1];
|
|
34
|
+
}
|
|
35
|
+
return (0, _store.useBottomSheetStore)(t0, _shallow.shallow);
|
|
36
|
+
};
|
|
37
|
+
exports.useSheetStatus = useSheetStatus;
|
|
38
|
+
const useSheetParams = id => {
|
|
39
|
+
const $ = (0, _compilerRuntime.c)(2);
|
|
40
|
+
let t0;
|
|
41
|
+
if ($[0] !== id) {
|
|
42
|
+
t0 = state => state.sheetsById[id]?.params;
|
|
43
|
+
$[0] = id;
|
|
44
|
+
$[1] = t0;
|
|
45
|
+
} else {
|
|
46
|
+
t0 = $[1];
|
|
47
|
+
}
|
|
48
|
+
return (0, _store.useBottomSheetStore)(t0, _shallow.shallow);
|
|
49
|
+
};
|
|
50
|
+
exports.useSheetParams = useSheetParams;
|
|
51
|
+
const useSheetContent = id => {
|
|
52
|
+
const $ = (0, _compilerRuntime.c)(2);
|
|
53
|
+
let t0;
|
|
54
|
+
if ($[0] !== id) {
|
|
55
|
+
t0 = state => state.sheetsById[id]?.content;
|
|
56
|
+
$[0] = id;
|
|
57
|
+
$[1] = t0;
|
|
58
|
+
} else {
|
|
59
|
+
t0 = $[1];
|
|
60
|
+
}
|
|
61
|
+
return (0, _store.useBottomSheetStore)(t0, _shallow.shallow);
|
|
62
|
+
};
|
|
63
|
+
exports.useSheetContent = useSheetContent;
|
|
64
|
+
const useSheetUsePortal = id => {
|
|
65
|
+
const $ = (0, _compilerRuntime.c)(2);
|
|
66
|
+
let t0;
|
|
67
|
+
if ($[0] !== id) {
|
|
68
|
+
t0 = state => state.sheetsById[id]?.usePortal;
|
|
69
|
+
$[0] = id;
|
|
70
|
+
$[1] = t0;
|
|
71
|
+
} else {
|
|
72
|
+
t0 = $[1];
|
|
73
|
+
}
|
|
74
|
+
return (0, _store.useBottomSheetStore)(t0, _shallow.shallow);
|
|
75
|
+
};
|
|
76
|
+
exports.useSheetUsePortal = useSheetUsePortal;
|
|
77
|
+
const useSheetKeepMounted = id => {
|
|
78
|
+
const $ = (0, _compilerRuntime.c)(2);
|
|
79
|
+
let t0;
|
|
80
|
+
if ($[0] !== id) {
|
|
81
|
+
t0 = state => state.sheetsById[id]?.keepMounted;
|
|
82
|
+
$[0] = id;
|
|
83
|
+
$[1] = t0;
|
|
84
|
+
} else {
|
|
85
|
+
t0 = $[1];
|
|
86
|
+
}
|
|
87
|
+
return (0, _store.useBottomSheetStore)(t0, _shallow.shallow);
|
|
88
|
+
};
|
|
89
|
+
exports.useSheetKeepMounted = useSheetKeepMounted;
|
|
90
|
+
const useSheetPortalSession = id => {
|
|
91
|
+
const $ = (0, _compilerRuntime.c)(2);
|
|
92
|
+
let t0;
|
|
93
|
+
if ($[0] !== id) {
|
|
94
|
+
t0 = state => state.sheetsById[id]?.portalSession;
|
|
95
|
+
$[0] = id;
|
|
96
|
+
$[1] = t0;
|
|
97
|
+
} else {
|
|
98
|
+
t0 = $[1];
|
|
99
|
+
}
|
|
100
|
+
return (0, _store.useBottomSheetStore)(t0, _shallow.shallow);
|
|
101
|
+
};
|
|
102
|
+
exports.useSheetPortalSession = useSheetPortalSession;
|
|
103
|
+
const useSheetExists = id => {
|
|
104
|
+
const $ = (0, _compilerRuntime.c)(2);
|
|
105
|
+
let t0;
|
|
106
|
+
if ($[0] !== id) {
|
|
107
|
+
t0 = state => !!state.sheetsById[id];
|
|
108
|
+
$[0] = id;
|
|
109
|
+
$[1] = t0;
|
|
110
|
+
} else {
|
|
111
|
+
t0 = $[1];
|
|
112
|
+
}
|
|
113
|
+
return (0, _store.useBottomSheetStore)(t0, _shallow.shallow);
|
|
114
|
+
};
|
|
115
|
+
exports.useSheetExists = useSheetExists;
|
|
116
|
+
const useIsSheetOpen = id => {
|
|
117
|
+
const $ = (0, _compilerRuntime.c)(2);
|
|
118
|
+
let t0;
|
|
119
|
+
if ($[0] !== id) {
|
|
120
|
+
t0 = state => {
|
|
121
|
+
const status = state.sheetsById[id]?.status;
|
|
122
|
+
return status === "open" || status === "opening";
|
|
123
|
+
};
|
|
124
|
+
$[0] = id;
|
|
125
|
+
$[1] = t0;
|
|
126
|
+
} else {
|
|
127
|
+
t0 = $[1];
|
|
128
|
+
}
|
|
129
|
+
return (0, _store.useBottomSheetStore)(t0, _shallow.shallow);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// Action hooks
|
|
133
|
+
exports.useIsSheetOpen = useIsSheetOpen;
|
|
134
|
+
const useOpen = () => {
|
|
135
|
+
return (0, _store.useBottomSheetStore)(_temp);
|
|
136
|
+
};
|
|
137
|
+
exports.useOpen = useOpen;
|
|
138
|
+
const useStartClosing = () => {
|
|
139
|
+
return (0, _store.useBottomSheetStore)(_temp2);
|
|
140
|
+
};
|
|
141
|
+
exports.useStartClosing = useStartClosing;
|
|
142
|
+
const useUpdateParams = () => {
|
|
143
|
+
return (0, _store.useBottomSheetStore)(_temp3);
|
|
144
|
+
};
|
|
145
|
+
exports.useUpdateParams = useUpdateParams;
|
|
146
|
+
const useClearGroup = () => {
|
|
147
|
+
return (0, _store.useBottomSheetStore)(_temp4);
|
|
148
|
+
};
|
|
149
|
+
exports.useClearGroup = useClearGroup;
|
|
150
|
+
const useMount = () => {
|
|
151
|
+
return (0, _store.useBottomSheetStore)(_temp5);
|
|
152
|
+
};
|
|
153
|
+
exports.useMount = useMount;
|
|
154
|
+
const useUnmount = () => {
|
|
155
|
+
return (0, _store.useBottomSheetStore)(_temp6);
|
|
156
|
+
};
|
|
157
|
+
exports.useUnmount = useUnmount;
|
|
158
|
+
function _temp(state) {
|
|
159
|
+
return state.open;
|
|
160
|
+
}
|
|
161
|
+
function _temp2(state) {
|
|
162
|
+
return state.startClosing;
|
|
163
|
+
}
|
|
164
|
+
function _temp3(state) {
|
|
165
|
+
return state.updateParams;
|
|
166
|
+
}
|
|
167
|
+
function _temp4(state) {
|
|
168
|
+
return state.clearGroup;
|
|
169
|
+
}
|
|
170
|
+
function _temp5(state) {
|
|
171
|
+
return state.mount;
|
|
172
|
+
}
|
|
173
|
+
function _temp6(state) {
|
|
174
|
+
return state.unmount;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_shallow","require","_store","useSheet","id","$","_compilerRuntime","c","t0","state","sheetsById","useBottomSheetStore","shallow","exports","useSheetStatus","status","useSheetParams","params","useSheetContent","content","useSheetUsePortal","usePortal","useSheetKeepMounted","keepMounted","useSheetPortalSession","portalSession","useSheetExists","useIsSheetOpen","useOpen","_temp","useStartClosing","_temp2","useUpdateParams","_temp3","useClearGroup","_temp4","useMount","_temp5","useUnmount","_temp6","open","startClosing","updateParams","clearGroup","mount","unmount"],"sourceRoot":"../../../src","sources":["store/hooks.ts"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA;;AAEO,MAAME,QAAQ,GAAGC,EAAA;EAAA,MAAAC,CAAA,OAAAC,gBAAA,CAAAC,CAAA;EAAA,IAAAC,EAAA;EAAA,IAAAH,CAAA,QAAAD,EAAA;IACFI,EAAA,GAAAC,KAAA,IAAWA,KAAK,CAAAC,UAAW,CAACN,EAAE,CAAC;IAAAC,CAAA,MAAAD,EAAA;IAAAC,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAAA,OAAnD,IAAAM,0BAAmB,EAACH,EAA+B,EAAEI,gBAAO,CAAC;AAAA;AAACC,OAAA,CAAAV,QAAA,GAAAA,QAAA;AAEzD,MAAMW,cAAc,GAAGV,EAAA;EAAA,MAAAC,CAAA,OAAAC,gBAAA,CAAAC,CAAA;EAAA,IAAAC,EAAA;EAAA,IAAAH,CA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E9C,MAAME,aAAa,GAAGA,CAAA;EAAA,OAC3B,IAAAvB,0BAAmB,EAACwB,MAA2B,CAAC;AAAA;AAACtB,OAAA,CAAAqB,aAAA,GAAAA,aAAA;AAE5C,MAAME,QAAQ,GAAGA,CAAA;EAAA,OAAM,IAAAzB,0BAAmB,EAAC0B,MAAsB,CAAC;AAAA;AAACxB,OAAA,CAAAuB,QAAA,GAAAA,QAAA;AAEnE,MAAME,UAAU,GAAGA,CAAA;EAAA,OAAM,IAAA3B,0BAAmB,EAAC4B,MAAwB,CAAC;AAAA;AAAC1B,OAAA,CAAAyB,UAAA,GAAAA,UAAA;AAbvD,SAAAT,MAAApB,KAAA;EAAA,OAAqCA,KAAK,CAAA+B,IAAK;AAAA;AAEvC,SAAAT,OAAAtB,KAAA;EAAA,OACEA,KAAK,CAAAgC,YAAa;AAAA;AAEpB,SAAAR,OAAAxB,KAAA;EAAA,OACEA,KAAK,CAAAiC,YAAa;AAAA;AAEtB,SAAAP,OAAA1B,KAAA;EAAA,OACIA,KAAK,CAAAkC,UAAW;AAAA;AAEzB,SAAAN,OAAA5B,KAAA;EAAA,OAAqCA,KAAK,CAAAmC,KAAM;AAAA;AAE9C,SAAAL,OAAA9B,KAAA;EAAA,OAAqCA,KAAK,CAAAoC,OAAQ;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
getTopSheetId: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "getTopSheetId", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _helpers.getTopSheetId;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var _types = require("./types");
|
|
16
|
+
Object.keys(_types).forEach(function (key) {
|
|
17
|
+
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
20
|
+
Object.defineProperty(exports, key, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return _types[key];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
var _store = require("./store");
|
|
28
|
+
Object.keys(_store).forEach(function (key) {
|
|
29
|
+
if (key === "default" || key === "__esModule") return;
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
|
+
if (key in exports && exports[key] === _store[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _store[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _hooks = require("./hooks");
|
|
40
|
+
Object.keys(_hooks).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
43
|
+
if (key in exports && exports[key] === _hooks[key]) return;
|
|
44
|
+
Object.defineProperty(exports, key, {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return _hooks[key];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
var _helpers = require("./helpers");
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_types","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_store","_hooks","_helpers"],"sourceRoot":"../../../src","sources":["store/index.ts"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA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