one 1.23.0 → 1.24.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/dist/cjs/headless/__tests__/useStack.test.cjs +79 -0
- package/dist/cjs/headless/__tests__/useStack.test.native.js +85 -0
- package/dist/cjs/headless/__tests__/useStack.test.native.js.map +1 -0
- package/dist/cjs/headless/useStack.cjs +2 -1
- package/dist/cjs/headless/useStack.native.js +2 -1
- package/dist/cjs/headless/useStack.native.js.map +1 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/Stack.cjs +12 -9
- package/dist/cjs/layouts/Stack.native.js +13 -10
- package/dist/cjs/layouts/Stack.native.js.map +1 -1
- package/dist/cjs/layouts/stack-utils/StackScreen.cjs +6 -3
- package/dist/cjs/layouts/stack-utils/StackScreen.native.js +7 -4
- package/dist/cjs/layouts/stack-utils/StackScreen.native.js.map +1 -1
- package/dist/cjs/layouts/stack-utils/StackToolbar.cjs +124 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.native.js +129 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.shared.cjs +57 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.shared.native.js +61 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.shared.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.types.cjs +18 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.types.native.js +21 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.types.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackToolbarImplementation.cjs +39 -0
- package/dist/cjs/layouts/stack-utils/StackToolbarImplementation.native.js +41 -0
- package/dist/cjs/layouts/stack-utils/StackToolbarImplementation.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/__tests__/StackToolbar.test.cjs +66 -0
- package/dist/cjs/layouts/stack-utils/__tests__/StackToolbar.test.native.js +99 -0
- package/dist/cjs/layouts/stack-utils/__tests__/StackToolbar.test.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/index.cjs +2 -0
- package/dist/cjs/layouts/stack-utils/index.native.js +2 -0
- package/dist/cjs/layouts/stack-utils/index.native.js.map +1 -1
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.cjs +9 -3
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.native.js +9 -4
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.native.js.map +1 -1
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.test.cjs +84 -0
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.test.native.js +91 -0
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.test.native.js.map +1 -0
- package/dist/cjs/router/router.native.js.map +1 -1
- package/dist/cjs/router/useInitializeOneRouter.cjs +2 -2
- package/dist/cjs/router/useInitializeOneRouter.native.js +2 -2
- package/dist/cjs/router/useInitializeOneRouter.native.js.map +1 -1
- package/dist/cjs/router/useInitializeOneRouter.preview-lifecycle.test.cjs +1 -1
- package/dist/cjs/router/useInitializeOneRouter.preview-lifecycle.test.native.js +1 -1
- package/dist/cjs/router/useInitializeOneRouter.preview-lifecycle.test.native.js.map +1 -1
- package/dist/cjs/stack-toolbar-implementation.cjs +30 -0
- package/dist/cjs/stack-toolbar-implementation.native.js +33 -0
- package/dist/cjs/stack-toolbar-implementation.native.js.map +1 -0
- package/dist/esm/headless/__tests__/useStack.test.mjs +56 -0
- package/dist/esm/headless/__tests__/useStack.test.mjs.map +1 -0
- package/dist/esm/headless/__tests__/useStack.test.native.js +59 -0
- package/dist/esm/headless/__tests__/useStack.test.native.js.map +1 -0
- package/dist/esm/headless/useStack.mjs +2 -1
- package/dist/esm/headless/useStack.mjs.map +1 -1
- package/dist/esm/headless/useStack.native.js +2 -1
- package/dist/esm/headless/useStack.native.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/Stack.mjs +13 -10
- package/dist/esm/layouts/Stack.mjs.map +1 -1
- package/dist/esm/layouts/Stack.native.js +14 -11
- package/dist/esm/layouts/Stack.native.js.map +1 -1
- package/dist/esm/layouts/stack-utils/StackScreen.mjs +6 -3
- package/dist/esm/layouts/stack-utils/StackScreen.mjs.map +1 -1
- package/dist/esm/layouts/stack-utils/StackScreen.native.js +7 -4
- package/dist/esm/layouts/stack-utils/StackScreen.native.js.map +1 -1
- package/dist/esm/layouts/stack-utils/StackToolbar.mjs +89 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.native.js +92 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.shared.mjs +31 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.shared.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.shared.native.js +32 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.shared.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.types.mjs +2 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.types.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.types.native.js +2 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.types.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbarImplementation.mjs +12 -0
- package/dist/esm/layouts/stack-utils/StackToolbarImplementation.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbarImplementation.native.js +12 -0
- package/dist/esm/layouts/stack-utils/StackToolbarImplementation.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/__tests__/StackToolbar.test.mjs +67 -0
- package/dist/esm/layouts/stack-utils/__tests__/StackToolbar.test.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/__tests__/StackToolbar.test.native.js +73 -0
- package/dist/esm/layouts/stack-utils/__tests__/StackToolbar.test.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/index.mjs +2 -1
- package/dist/esm/layouts/stack-utils/index.mjs.map +1 -1
- package/dist/esm/layouts/stack-utils/index.native.js +2 -1
- package/dist/esm/layouts/stack-utils/index.native.js.map +1 -1
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.mjs +9 -3
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.mjs.map +1 -1
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.native.js +9 -4
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.native.js.map +1 -1
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.test.mjs +61 -0
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.test.mjs.map +1 -0
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.test.native.js +65 -0
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.test.native.js.map +1 -0
- package/dist/esm/router/useInitializeOneRouter.mjs +1 -1
- package/dist/esm/router/useInitializeOneRouter.mjs.map +1 -1
- package/dist/esm/router/useInitializeOneRouter.native.js +1 -1
- package/dist/esm/router/useInitializeOneRouter.preview-lifecycle.test.mjs +1 -1
- package/dist/esm/router/useInitializeOneRouter.preview-lifecycle.test.mjs.map +1 -1
- package/dist/esm/router/useInitializeOneRouter.preview-lifecycle.test.native.js +1 -1
- package/dist/esm/router/useInitializeOneRouter.preview-lifecycle.test.native.js.map +1 -1
- package/dist/esm/stack-toolbar-implementation.mjs +3 -0
- package/dist/esm/stack-toolbar-implementation.mjs.map +1 -0
- package/dist/esm/stack-toolbar-implementation.native.js +3 -0
- package/dist/esm/stack-toolbar-implementation.native.js.map +1 -0
- package/package.json +26 -20
- package/src/headless/__tests__/useStack.test.tsx +54 -0
- package/src/headless/types.ts +2 -1
- package/src/headless/useStack.ts +2 -1
- package/src/index.ts +12 -0
- package/src/layouts/Stack.tsx +33 -8
- package/src/layouts/stack-utils/README.md +1 -0
- package/src/layouts/stack-utils/StackScreen.tsx +26 -5
- package/src/layouts/stack-utils/StackToolbar.shared.ts +44 -0
- package/src/layouts/stack-utils/StackToolbar.tsx +134 -0
- package/src/layouts/stack-utils/StackToolbar.types.ts +100 -0
- package/src/layouts/stack-utils/StackToolbarImplementation.tsx +39 -0
- package/src/layouts/stack-utils/__tests__/StackToolbar.test.tsx +70 -0
- package/src/layouts/stack-utils/index.tsx +17 -0
- package/src/metro-config/buildOneMetroResolverOverrides.test.ts +88 -0
- package/src/metro-config/buildOneMetroResolverOverrides.ts +20 -8
- package/src/router/router.ts +5 -5
- package/src/router/useInitializeOneRouter.preview-lifecycle.test.ts +1 -1
- package/src/router/useInitializeOneRouter.ts +2 -2
- package/src/stack-toolbar-implementation.ts +8 -0
- package/types/fork/useLinking.native.d.ts +4 -4
- package/types/headless/types.d.ts +4 -1
- package/types/headless/types.d.ts.map +1 -1
- package/types/headless/useStack.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/layouts/Drawer.d.ts +54 -54
- package/types/layouts/Stack.d.ts +58 -46
- package/types/layouts/Stack.d.ts.map +1 -1
- package/types/layouts/Tabs.d.ts +46 -46
- package/types/layouts/stack-utils/StackScreen.d.ts +2 -1
- package/types/layouts/stack-utils/StackScreen.d.ts.map +1 -1
- package/types/layouts/stack-utils/StackToolbar.d.ts +28 -0
- package/types/layouts/stack-utils/StackToolbar.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackToolbar.shared.d.ts +5 -0
- package/types/layouts/stack-utils/StackToolbar.shared.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackToolbar.types.d.ts +83 -0
- package/types/layouts/stack-utils/StackToolbar.types.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackToolbarImplementation.d.ts +12 -0
- package/types/layouts/stack-utils/StackToolbarImplementation.d.ts.map +1 -0
- package/types/layouts/stack-utils/index.d.ts +3 -1
- package/types/layouts/stack-utils/index.d.ts.map +1 -1
- package/types/metro-config/buildOneMetroResolverOverrides.d.ts +2 -1
- package/types/metro-config/buildOneMetroResolverOverrides.d.ts.map +1 -1
- package/types/metro-config/buildOneMetroResolverOverrides.test.d.ts +2 -0
- package/types/metro-config/buildOneMetroResolverOverrides.test.d.ts.map +1 -0
- package/types/router/router.d.ts +1 -1
- package/types/router/router.d.ts.map +1 -1
- package/types/stack-toolbar-implementation.d.ts +3 -0
- package/types/stack-toolbar-implementation.d.ts.map +1 -0
- package/types/ui/TabContext.d.ts +15 -23
- package/types/ui/TabContext.d.ts.map +1 -1
- package/types/ui/TabRouter.d.ts +5 -5
- package/types/ui/Tabs.shared.d.ts +22 -22
- package/types/ui/Tabs.shared.d.ts.map +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var StackToolbar_exports = {};
|
|
26
|
+
__export(StackToolbar_exports, {
|
|
27
|
+
StackToolbar: () => StackToolbar,
|
|
28
|
+
StackToolbarBadge: () => StackToolbarBadge,
|
|
29
|
+
StackToolbarButton: () => StackToolbarButton,
|
|
30
|
+
StackToolbarIcon: () => StackToolbarIcon,
|
|
31
|
+
StackToolbarLabel: () => StackToolbarLabel,
|
|
32
|
+
StackToolbarMenu: () => StackToolbarMenu,
|
|
33
|
+
StackToolbarMenuAction: () => StackToolbarMenuAction,
|
|
34
|
+
StackToolbarSearchBarSlot: () => StackToolbarSearchBarSlot,
|
|
35
|
+
StackToolbarSpacer: () => StackToolbarSpacer,
|
|
36
|
+
StackToolbarView: () => StackToolbarView,
|
|
37
|
+
appendStackToolbarPropsToOptions: () => appendStackToolbarPropsToOptions
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(StackToolbar_exports);
|
|
40
|
+
var import_react = require("react");
|
|
41
|
+
var import_use_isomorphic_layout_effect = require("@vxrn/use-isomorphic-layout-effect");
|
|
42
|
+
var import_children = require("../../headless/children.cjs");
|
|
43
|
+
var import_useNavigation = require("../../router/useNavigation.cjs");
|
|
44
|
+
var import_StackToolbarImplementation = require("./StackToolbarImplementation.cjs");
|
|
45
|
+
var import_StackToolbar = require("./StackToolbar.shared");
|
|
46
|
+
function appendStackToolbarPropsToOptions(options, props, implementation) {
|
|
47
|
+
const optionsWithConfig = (0, import_StackToolbar.appendStackToolbarConfig)(options, props);
|
|
48
|
+
return implementation ? implementation.appendPropsToOptions(optionsWithConfig, props) : optionsWithConfig;
|
|
49
|
+
}
|
|
50
|
+
function StackToolbarComponent(props) {
|
|
51
|
+
const navigation = (0, import_useNavigation.useNavigation)();
|
|
52
|
+
const implementation = (0, import_StackToolbarImplementation.getStackToolbarImplementation)();
|
|
53
|
+
const options = (0, import_react.useMemo)(() => appendStackToolbarPropsToOptions({}, props, implementation), [implementation, props.placement, props.asChild, props.children, props.disableImePadding, props.tintColor, props.backgroundColor]);
|
|
54
|
+
(0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(() => {
|
|
55
|
+
navigation.setOptions(options);
|
|
56
|
+
}, [navigation, options]);
|
|
57
|
+
return implementation?.render(props) ?? null;
|
|
58
|
+
}
|
|
59
|
+
function StackToolbarButton(_props) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
function StackToolbarMenu(_props) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
function StackToolbarMenuAction(_props) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
function StackToolbarSpacer(_props) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
function StackToolbarSearchBarSlot(_props) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
function StackToolbarView(_props) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
function StackToolbarLabel(_props) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
function StackToolbarIcon(_props) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
function StackToolbarBadge(_props) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
Object.assign(StackToolbarButton, {
|
|
87
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "button"
|
|
88
|
+
});
|
|
89
|
+
Object.assign(StackToolbarMenu, {
|
|
90
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "menu"
|
|
91
|
+
});
|
|
92
|
+
Object.assign(StackToolbarMenuAction, {
|
|
93
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "menuAction"
|
|
94
|
+
});
|
|
95
|
+
Object.assign(StackToolbarSpacer, {
|
|
96
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "spacer"
|
|
97
|
+
});
|
|
98
|
+
Object.assign(StackToolbarSearchBarSlot, {
|
|
99
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "searchBarSlot"
|
|
100
|
+
});
|
|
101
|
+
Object.assign(StackToolbarView, {
|
|
102
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "view"
|
|
103
|
+
});
|
|
104
|
+
Object.assign(StackToolbarLabel, {
|
|
105
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "label"
|
|
106
|
+
});
|
|
107
|
+
Object.assign(StackToolbarIcon, {
|
|
108
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "icon"
|
|
109
|
+
});
|
|
110
|
+
Object.assign(StackToolbarBadge, {
|
|
111
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "badge"
|
|
112
|
+
});
|
|
113
|
+
const StackToolbar = Object.assign(StackToolbarComponent, {
|
|
114
|
+
[import_children.NAVIGATOR_CONFIG]: true,
|
|
115
|
+
Button: StackToolbarButton,
|
|
116
|
+
Menu: StackToolbarMenu,
|
|
117
|
+
MenuAction: StackToolbarMenuAction,
|
|
118
|
+
Spacer: StackToolbarSpacer,
|
|
119
|
+
SearchBarSlot: StackToolbarSearchBarSlot,
|
|
120
|
+
View: StackToolbarView,
|
|
121
|
+
Label: StackToolbarLabel,
|
|
122
|
+
Icon: StackToolbarIcon,
|
|
123
|
+
Badge: StackToolbarBadge
|
|
124
|
+
});
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
24
|
+
value: true
|
|
25
|
+
}), mod);
|
|
26
|
+
var StackToolbar_exports = {};
|
|
27
|
+
__export(StackToolbar_exports, {
|
|
28
|
+
StackToolbar: () => StackToolbar,
|
|
29
|
+
StackToolbarBadge: () => StackToolbarBadge,
|
|
30
|
+
StackToolbarButton: () => StackToolbarButton,
|
|
31
|
+
StackToolbarIcon: () => StackToolbarIcon,
|
|
32
|
+
StackToolbarLabel: () => StackToolbarLabel,
|
|
33
|
+
StackToolbarMenu: () => StackToolbarMenu,
|
|
34
|
+
StackToolbarMenuAction: () => StackToolbarMenuAction,
|
|
35
|
+
StackToolbarSearchBarSlot: () => StackToolbarSearchBarSlot,
|
|
36
|
+
StackToolbarSpacer: () => StackToolbarSpacer,
|
|
37
|
+
StackToolbarView: () => StackToolbarView,
|
|
38
|
+
appendStackToolbarPropsToOptions: () => appendStackToolbarPropsToOptions
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(StackToolbar_exports);
|
|
41
|
+
var import_react = require("react");
|
|
42
|
+
var import_use_isomorphic_layout_effect = require("@vxrn/use-isomorphic-layout-effect");
|
|
43
|
+
var import_children = require("../../headless/children.native.js");
|
|
44
|
+
var import_useNavigation = require("../../router/useNavigation.native.js");
|
|
45
|
+
var import_StackToolbarImplementation = require("./StackToolbarImplementation.native.js");
|
|
46
|
+
var import_StackToolbar = require("./StackToolbar.shared");
|
|
47
|
+
function appendStackToolbarPropsToOptions(options, props, implementation) {
|
|
48
|
+
var optionsWithConfig = (0, import_StackToolbar.appendStackToolbarConfig)(options, props);
|
|
49
|
+
return implementation ? implementation.appendPropsToOptions(optionsWithConfig, props) : optionsWithConfig;
|
|
50
|
+
}
|
|
51
|
+
function StackToolbarComponent(props) {
|
|
52
|
+
var _ref;
|
|
53
|
+
var navigation = (0, import_useNavigation.useNavigation)();
|
|
54
|
+
var implementation = (0, import_StackToolbarImplementation.getStackToolbarImplementation)();
|
|
55
|
+
var options = (0, import_react.useMemo)(function () {
|
|
56
|
+
return appendStackToolbarPropsToOptions({}, props, implementation);
|
|
57
|
+
}, [implementation, props.placement, props.asChild, props.children, props.disableImePadding, props.tintColor, props.backgroundColor]);
|
|
58
|
+
(0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(function () {
|
|
59
|
+
navigation.setOptions(options);
|
|
60
|
+
}, [navigation, options]);
|
|
61
|
+
return (_ref = implementation === null || implementation === void 0 ? void 0 : implementation.render(props)) !== null && _ref !== void 0 ? _ref : null;
|
|
62
|
+
}
|
|
63
|
+
function StackToolbarButton(_props) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
function StackToolbarMenu(_props) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
function StackToolbarMenuAction(_props) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
function StackToolbarSpacer(_props) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
function StackToolbarSearchBarSlot(_props) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
function StackToolbarView(_props) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
function StackToolbarLabel(_props) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
function StackToolbarIcon(_props) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
function StackToolbarBadge(_props) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
Object.assign(StackToolbarButton, {
|
|
91
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "button"
|
|
92
|
+
});
|
|
93
|
+
Object.assign(StackToolbarMenu, {
|
|
94
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "menu"
|
|
95
|
+
});
|
|
96
|
+
Object.assign(StackToolbarMenuAction, {
|
|
97
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "menuAction"
|
|
98
|
+
});
|
|
99
|
+
Object.assign(StackToolbarSpacer, {
|
|
100
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "spacer"
|
|
101
|
+
});
|
|
102
|
+
Object.assign(StackToolbarSearchBarSlot, {
|
|
103
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "searchBarSlot"
|
|
104
|
+
});
|
|
105
|
+
Object.assign(StackToolbarView, {
|
|
106
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "view"
|
|
107
|
+
});
|
|
108
|
+
Object.assign(StackToolbarLabel, {
|
|
109
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "label"
|
|
110
|
+
});
|
|
111
|
+
Object.assign(StackToolbarIcon, {
|
|
112
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "icon"
|
|
113
|
+
});
|
|
114
|
+
Object.assign(StackToolbarBadge, {
|
|
115
|
+
[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "badge"
|
|
116
|
+
});
|
|
117
|
+
var StackToolbar = Object.assign(StackToolbarComponent, {
|
|
118
|
+
[import_children.NAVIGATOR_CONFIG]: true,
|
|
119
|
+
Button: StackToolbarButton,
|
|
120
|
+
Menu: StackToolbarMenu,
|
|
121
|
+
MenuAction: StackToolbarMenuAction,
|
|
122
|
+
Spacer: StackToolbarSpacer,
|
|
123
|
+
SearchBarSlot: StackToolbarSearchBarSlot,
|
|
124
|
+
View: StackToolbarView,
|
|
125
|
+
Label: StackToolbarLabel,
|
|
126
|
+
Icon: StackToolbarIcon,
|
|
127
|
+
Badge: StackToolbarBadge
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=StackToolbar.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","StackToolbar_exports","__export","StackToolbar","StackToolbarBadge","StackToolbarButton","StackToolbarIcon","StackToolbarLabel","StackToolbarMenu","StackToolbarMenuAction","StackToolbarSearchBarSlot","StackToolbarSpacer","StackToolbarView","appendStackToolbarPropsToOptions","module","exports","import_react","require","import_use_isomorphic_layout_effect","import_children","import_useNavigation","import_StackToolbarImplementation","import_StackToolbar","options","props","implementation","optionsWithConfig","appendStackToolbarConfig","appendPropsToOptions","StackToolbarComponent","_ref","navigation","useNavigation","getStackToolbarImplementation","useMemo","placement","asChild","children","disableImePadding","tintColor","backgroundColor","useIsomorphicLayoutEffect","setOptions","render","_props","Object","assign","STACK_TOOLBAR_CHILD"],"sources":["../../../../src/layouts/stack-utils/StackToolbar.tsx"],"sourcesContent":[null],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var StackToolbar_shared_exports = {};
|
|
24
|
+
__export(StackToolbar_shared_exports, {
|
|
25
|
+
appendStackToolbarConfig: () => appendStackToolbarConfig,
|
|
26
|
+
exposeStackToolbarConfig: () => exposeStackToolbarConfig
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(StackToolbar_shared_exports);
|
|
29
|
+
const optionKeys = {
|
|
30
|
+
left: "__oneStackToolbarLeft",
|
|
31
|
+
right: "__oneStackToolbarRight",
|
|
32
|
+
bottom: "__oneStackToolbarBottom"
|
|
33
|
+
};
|
|
34
|
+
function appendStackToolbarConfig(options, props) {
|
|
35
|
+
return {
|
|
36
|
+
...options,
|
|
37
|
+
[optionKeys[props.placement ?? "bottom"]]: props
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function exposeStackToolbarConfig(options) {
|
|
41
|
+
const toolbar = {
|
|
42
|
+
left: options[optionKeys.left],
|
|
43
|
+
right: options[optionKeys.right],
|
|
44
|
+
bottom: options[optionKeys.bottom]
|
|
45
|
+
};
|
|
46
|
+
if (!toolbar.left && !toolbar.right && !toolbar.bottom) return options;
|
|
47
|
+
const {
|
|
48
|
+
[optionKeys.left]: _left,
|
|
49
|
+
[optionKeys.right]: _right,
|
|
50
|
+
[optionKeys.bottom]: _bottom,
|
|
51
|
+
...publicOptions
|
|
52
|
+
} = options;
|
|
53
|
+
return {
|
|
54
|
+
...publicOptions,
|
|
55
|
+
toolbar
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var StackToolbar_shared_exports = {};
|
|
26
|
+
__export(StackToolbar_shared_exports, {
|
|
27
|
+
appendStackToolbarConfig: () => appendStackToolbarConfig,
|
|
28
|
+
exposeStackToolbarConfig: () => exposeStackToolbarConfig
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(StackToolbar_shared_exports);
|
|
31
|
+
var optionKeys = {
|
|
32
|
+
left: "__oneStackToolbarLeft",
|
|
33
|
+
right: "__oneStackToolbarRight",
|
|
34
|
+
bottom: "__oneStackToolbarBottom"
|
|
35
|
+
};
|
|
36
|
+
function appendStackToolbarConfig(options, props) {
|
|
37
|
+
var _props_placement;
|
|
38
|
+
return {
|
|
39
|
+
...options,
|
|
40
|
+
[optionKeys[(_props_placement = props.placement) !== null && _props_placement !== void 0 ? _props_placement : "bottom"]]: props
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function exposeStackToolbarConfig(options) {
|
|
44
|
+
var toolbar = {
|
|
45
|
+
left: options[optionKeys.left],
|
|
46
|
+
right: options[optionKeys.right],
|
|
47
|
+
bottom: options[optionKeys.bottom]
|
|
48
|
+
};
|
|
49
|
+
if (!toolbar.left && !toolbar.right && !toolbar.bottom) return options;
|
|
50
|
+
var {
|
|
51
|
+
[optionKeys.left]: _left,
|
|
52
|
+
[optionKeys.right]: _right,
|
|
53
|
+
[optionKeys.bottom]: _bottom,
|
|
54
|
+
...publicOptions
|
|
55
|
+
} = options;
|
|
56
|
+
return {
|
|
57
|
+
...publicOptions,
|
|
58
|
+
toolbar
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=StackToolbar.shared.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","StackToolbar_shared_exports","__export","appendStackToolbarConfig","exposeStackToolbarConfig","module","exports","optionKeys","left","right","bottom","options","props","_props_placement","placement","toolbar","_left","_right","_bottom","publicOptions"],"sources":["../../../../src/layouts/stack-utils/StackToolbar.shared.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,2BAAA;AAAAC,QAAA,CAAAD,2BAAA;EAAAE,wBAAA,EAAAA,CAAA,KAAAA,wBAAA;EAAAC,wBAAA,EAAAA,CAAA,KAAAA;AAAA;AAQAC,MAAM,CAAAC,OAAA,GAAAV,YAAa,CAAAK,2BAAA;AAAA,IACjBM,UAAM;EACNC,IAAA,yBAAO;EACPC,KAAA,0BAAQ;EACVC,MAAA;AAEO;AAIL,SAAOP,yBAAAQ,OAAA,EAAAC,KAAA;EAAA,IACLC,gBAAG;EAAA,OACF;IACH,GAAAF,OAAA;IACF,CAAAJ,UAAA,EAAAM,gBAAA,GAAAD,KAAA,CAAAE,SAAA,cAAAD,gBAAA,cAAAA,gBAAA,eAAAD;EAEO;AAGL;AAAoC,SAClCR,wBAA6BA,CAAAO,OAAA;EAAA,IAC7BI,OAAO;IACPP,IAAA,EAAAG,OAAQ,CAAAJ,UAAQ,CAAAC,IAAW;IAC7BC,KAAA,EAAAE,OAAA,CAAAJ,UAAA,CAAAE,KAAA;IAEAC,MAAK,EAAAC,OAAQ,CAAAJ,UAAS,CAAAG,MAAQ;EAE9B;EAAM,IACH,CAAAK,OAAA,CAAAP,IAAW,IAAO,CAAAO,OAAA,CAAAN,KAAA,KAAAM,OAAA,CAAAL,MAAA,SAAAC,OAAA;EAAA,IAClB;IAAA,CAAAJ,UAAW,CAAAC,IAAQ,GAAAQ,KAAA;IAAA,CAAAT,UAAA,CAAAE,KAAA,GAAAQ,MAAA;IAAA,CAAAV,UAAA,CAAAG,MAAA,GAAAQ,OAAA;IAAA,GAAAC;EAAA,IAAAR,OAAA;EAAA,OACnB;IACD,GAAGQ,aAAA;IACLJ;EAEA;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
8
|
+
get: () => from[key],
|
|
9
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
}), mod);
|
|
17
|
+
var StackToolbar_types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(StackToolbar_types_exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
}), mod);
|
|
19
|
+
var StackToolbar_types_exports = {};
|
|
20
|
+
module.exports = __toCommonJS(StackToolbar_types_exports);
|
|
21
|
+
//# sourceMappingURL=StackToolbar.types.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","StackToolbar_types_exports"],"sources":["../../../../src/layouts/stack-utils/StackToolbar.types.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,0BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var StackToolbarImplementation_exports = {};
|
|
26
|
+
__export(StackToolbarImplementation_exports, {
|
|
27
|
+
STACK_TOOLBAR_CHILD: () => STACK_TOOLBAR_CHILD,
|
|
28
|
+
getStackToolbarImplementation: () => getStackToolbarImplementation,
|
|
29
|
+
registerStackToolbarImplementation: () => registerStackToolbarImplementation
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(StackToolbarImplementation_exports);
|
|
32
|
+
const STACK_TOOLBAR_CHILD = /* @__PURE__ */Symbol.for("one.stack-toolbar.child");
|
|
33
|
+
let stackToolbarImplementation = null;
|
|
34
|
+
function registerStackToolbarImplementation(implementation) {
|
|
35
|
+
stackToolbarImplementation = implementation;
|
|
36
|
+
}
|
|
37
|
+
function getStackToolbarImplementation() {
|
|
38
|
+
return stackToolbarImplementation;
|
|
39
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
24
|
+
value: true
|
|
25
|
+
}), mod);
|
|
26
|
+
var StackToolbarImplementation_exports = {};
|
|
27
|
+
__export(StackToolbarImplementation_exports, {
|
|
28
|
+
STACK_TOOLBAR_CHILD: () => STACK_TOOLBAR_CHILD,
|
|
29
|
+
getStackToolbarImplementation: () => getStackToolbarImplementation,
|
|
30
|
+
registerStackToolbarImplementation: () => registerStackToolbarImplementation
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(StackToolbarImplementation_exports);
|
|
33
|
+
var STACK_TOOLBAR_CHILD = /* @__PURE__ */Symbol.for("one.stack-toolbar.child");
|
|
34
|
+
var stackToolbarImplementation = null;
|
|
35
|
+
function registerStackToolbarImplementation(implementation) {
|
|
36
|
+
stackToolbarImplementation = implementation;
|
|
37
|
+
}
|
|
38
|
+
function getStackToolbarImplementation() {
|
|
39
|
+
return stackToolbarImplementation;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=StackToolbarImplementation.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","StackToolbarImplementation_exports","__export","STACK_TOOLBAR_CHILD","getStackToolbarImplementation","registerStackToolbarImplementation","module","exports","Symbol","for","stackToolbarImplementation","implementation"],"sources":["../../../../src/layouts/stack-utils/StackToolbarImplementation.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,kCAAA;AAAAC,QAAA,CAAAD,kCAAA;EAAAE,mBAAA,EAAAA,CAAA,KAAAA,mBAAA;EAAAC,6BAAA,EAAAA,CAAA,KAAAA,6BAAA;EAAAC,kCAAA,EAAAA,CAAA,KAAAA;AAAA;AAOOC,MAAM,CAAAC,OAAA,GAAAX,YAAsB,CAAAK,kCAAW;AAqB9C,IAAIE,mBAAA,kBAAgEK,MAAA,CAAAC,GAAA;AAE7D,IAAAC,0BAAS;AAGd,SAAAL,kCAA6BA,CAAAM,cAAA;EAC/BD,0BAAA,GAAAC,cAAA;AAEO;AACL,SAAOP,8BAAA;EACT,OAAAM,0BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var import_vitest = require("vitest");
|
|
2
|
+
var import_StackToolbar = require("../StackToolbar.cjs");
|
|
3
|
+
var import_StackToolbarImplementation = require("../StackToolbarImplementation.cjs");
|
|
4
|
+
var import_StackToolbar2 = require("../StackToolbar.shared");
|
|
5
|
+
var import_StackScreen = require("../StackScreen.cjs");
|
|
6
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
(0, import_vitest.describe)("Stack.Toolbar headless config", () => {
|
|
8
|
+
(0, import_vitest.it)("marks declaration children for installed implementations", () => {
|
|
9
|
+
(0, import_vitest.expect)(import_StackToolbar.StackToolbar.Button[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]).toBe("button");
|
|
10
|
+
(0, import_vitest.expect)(import_StackToolbar.StackToolbar.MenuAction[import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]).toBe("menuAction");
|
|
11
|
+
});
|
|
12
|
+
(0, import_vitest.it)("preserves every placement for the headless stack implementation", () => {
|
|
13
|
+
const options = (0, import_StackScreen.appendScreenStackPropsToOptions)({
|
|
14
|
+
title: "Inbox"
|
|
15
|
+
}, {
|
|
16
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackToolbar.StackToolbar, {
|
|
17
|
+
placement: "left",
|
|
18
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackToolbar.StackToolbar.Button, {
|
|
19
|
+
icon: "sidebar.left"
|
|
20
|
+
})
|
|
21
|
+
}, "left"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackToolbar.StackToolbar, {
|
|
22
|
+
placement: "right",
|
|
23
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackToolbar.StackToolbar.Button, {
|
|
24
|
+
icon: "square.and.arrow.up"
|
|
25
|
+
})
|
|
26
|
+
}, "right")]
|
|
27
|
+
});
|
|
28
|
+
(0, import_vitest.expect)((0, import_StackToolbar2.exposeStackToolbarConfig)(options)).toMatchObject({
|
|
29
|
+
title: "Inbox",
|
|
30
|
+
toolbar: {
|
|
31
|
+
left: {
|
|
32
|
+
placement: "left"
|
|
33
|
+
},
|
|
34
|
+
right: {
|
|
35
|
+
placement: "right"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
(0, import_vitest.it)("hands toolbar declarations to an installed implementation", () => {
|
|
41
|
+
const appendPropsToOptions = import_vitest.vi.fn(options2 => ({
|
|
42
|
+
...options2,
|
|
43
|
+
headerShown: true
|
|
44
|
+
}));
|
|
45
|
+
const implementation = {
|
|
46
|
+
appendPropsToOptions,
|
|
47
|
+
render: () => null
|
|
48
|
+
};
|
|
49
|
+
const toolbar = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackToolbar.StackToolbar, {
|
|
50
|
+
placement: "right",
|
|
51
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StackToolbar.StackToolbar.Button, {
|
|
52
|
+
icon: "square.and.arrow.up",
|
|
53
|
+
children: "Share"
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
const options = (0, import_StackScreen.appendScreenStackPropsToOptions)({
|
|
57
|
+
title: "Inbox"
|
|
58
|
+
}, {
|
|
59
|
+
children: toolbar
|
|
60
|
+
}, implementation);
|
|
61
|
+
(0, import_vitest.expect)(options.headerShown).toBe(true);
|
|
62
|
+
(0, import_vitest.expect)(appendPropsToOptions).toHaveBeenCalledOnce();
|
|
63
|
+
(0, import_vitest.expect)(appendPropsToOptions.mock.calls[0]?.[1]).toBe(toolbar.props);
|
|
64
|
+
(0, import_vitest.expect)((0, import_StackToolbar2.exposeStackToolbarConfig)(options).toolbar.right).toBe(toolbar.props);
|
|
65
|
+
});
|
|
66
|
+
});
|