@storybook/react-native-ui 8.5.2-alpha.1 → 8.5.2-alpha.3
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/index.js +428 -354
- package/package.json +5 -5
- package/src/Layout.tsx +147 -87
- package/src/MobileAddonsPanel.tsx +96 -49
- package/src/MobileMenuDrawer.tsx +25 -13
- package/src/Search.tsx +3 -1
- package/src/StorybookLogo.tsx +5 -2
- package/src/TreeNode.tsx +17 -12
- package/src/icon/CloseFullscreenIcon.tsx +6 -8
- package/src/icon/CollapseAllIcon.tsx +6 -1
- package/src/icon/ExpandAllIcon.tsx +7 -1
- package/src/icon/FullscreenIcon.tsx +6 -1
- package/src/util/status.tsx +7 -7
- package/src/util/useStyle.ts +28 -0
package/dist/index.js
CHANGED
|
@@ -3087,17 +3087,13 @@ var GroupNode = import_react.default.memo(function GroupNode2({
|
|
|
3087
3087
|
...props
|
|
3088
3088
|
}) {
|
|
3089
3089
|
const theme = (0, import_react_native_theming2.useTheme)();
|
|
3090
|
+
const color = (0, import_react.useMemo)(() => {
|
|
3091
|
+
return theme.base === "dark" ? theme.color.primary : theme.color.ultraviolet;
|
|
3092
|
+
}, [theme.base, theme.color.primary, theme.color.ultraviolet]);
|
|
3090
3093
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(BranchNode, { isExpandable, ...props, children: [
|
|
3091
3094
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Wrapper, { children: [
|
|
3092
3095
|
isExpandable && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CollapseIcon, { isExpanded }),
|
|
3093
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3094
|
-
GroupIcon,
|
|
3095
|
-
{
|
|
3096
|
-
width: "14",
|
|
3097
|
-
height: "14",
|
|
3098
|
-
color: theme.base === "dark" ? theme.color.primary : theme.color.ultraviolet
|
|
3099
|
-
}
|
|
3100
|
-
)
|
|
3096
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GroupIcon, { width: 14, height: 14, color })
|
|
3101
3097
|
] }),
|
|
3102
3098
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BranchNodeText, { children })
|
|
3103
3099
|
] });
|
|
@@ -3105,10 +3101,13 @@ var GroupNode = import_react.default.memo(function GroupNode2({
|
|
|
3105
3101
|
var ComponentNode = import_react.default.memo(
|
|
3106
3102
|
function ComponentNode2({ children, isExpanded, isExpandable, ...props }) {
|
|
3107
3103
|
const theme = (0, import_react_native_theming2.useTheme)();
|
|
3104
|
+
const color = (0, import_react.useMemo)(() => {
|
|
3105
|
+
return theme.color.secondary;
|
|
3106
|
+
}, [theme.color.secondary]);
|
|
3108
3107
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(BranchNode, { isExpandable, ...props, children: [
|
|
3109
3108
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Wrapper, { children: [
|
|
3110
3109
|
isExpandable && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CollapseIcon, { isExpanded }),
|
|
3111
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ComponentIcon, { width: 12, height: 12, color
|
|
3110
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ComponentIcon, { width: 12, height: 12, color })
|
|
3112
3111
|
] }),
|
|
3113
3112
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BranchNodeText, { children })
|
|
3114
3113
|
] });
|
|
@@ -3119,22 +3118,18 @@ var StoryNode = import_react.default.memo(function StoryNode2({
|
|
|
3119
3118
|
...props
|
|
3120
3119
|
}) {
|
|
3121
3120
|
const theme = (0, import_react_native_theming2.useTheme)();
|
|
3121
|
+
const color = (0, import_react.useMemo)(() => {
|
|
3122
|
+
return props.selected ? theme.color.lightest : theme.color.seafoam;
|
|
3123
|
+
}, [props.selected, theme.color.lightest, theme.color.seafoam]);
|
|
3122
3124
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(LeafNode, { ...props, children: [
|
|
3123
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3124
|
-
StoryIcon,
|
|
3125
|
-
{
|
|
3126
|
-
width: 14,
|
|
3127
|
-
height: 14,
|
|
3128
|
-
color: props.selected ? theme.color.lightest : theme.color.seafoam
|
|
3129
|
-
}
|
|
3130
|
-
) }),
|
|
3125
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StoryIcon, { width: 14, height: 14, color }) }),
|
|
3131
3126
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LeafNodeText, { selected: props.selected, children })
|
|
3132
3127
|
] });
|
|
3133
3128
|
});
|
|
3134
3129
|
|
|
3135
3130
|
// src/Tree.tsx
|
|
3136
3131
|
var import_react_native_theming7 = require("@storybook/react-native-theming");
|
|
3137
|
-
var
|
|
3132
|
+
var import_react8 = __toESM(require("react"));
|
|
3138
3133
|
|
|
3139
3134
|
// src/Button.tsx
|
|
3140
3135
|
var import_react_native_theming3 = require("@storybook/react-native-theming");
|
|
@@ -3294,6 +3289,7 @@ IconButton.displayName = "IconButton";
|
|
|
3294
3289
|
// src/icon/CollapseAllIcon.tsx
|
|
3295
3290
|
var import_react_native_svg5 = require("react-native-svg");
|
|
3296
3291
|
var import_react_native_theming4 = require("@storybook/react-native-theming");
|
|
3292
|
+
var import_react4 = require("react");
|
|
3297
3293
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3298
3294
|
var CollapseAllIcon = ({
|
|
3299
3295
|
color,
|
|
@@ -3303,11 +3299,14 @@ var CollapseAllIcon = ({
|
|
|
3303
3299
|
...props
|
|
3304
3300
|
}) => {
|
|
3305
3301
|
const theme = (0, import_react_native_theming4.useTheme)();
|
|
3302
|
+
const fillColor = (0, import_react4.useMemo)(() => {
|
|
3303
|
+
return color ?? theme.color.defaultText;
|
|
3304
|
+
}, [color, theme.color.defaultText]);
|
|
3306
3305
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native_svg5.Svg, { width, height, viewBox: "0 0 14 14", fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3307
3306
|
import_react_native_svg5.Path,
|
|
3308
3307
|
{
|
|
3309
3308
|
d: "M3.354.146a.5.5 0 10-.708.708l4 4a.5.5 0 00.708 0l4-4a.5.5 0 00-.708-.708L7 3.793 3.354.146zM6.646 9.146a.5.5 0 01.708 0l4 4a.5.5 0 01-.708.708L7 10.207l-3.646 3.647a.5.5 0 01-.708-.708l4-4z",
|
|
3310
|
-
fill:
|
|
3309
|
+
fill: fillColor
|
|
3311
3310
|
}
|
|
3312
3311
|
) });
|
|
3313
3312
|
};
|
|
@@ -3315,6 +3314,7 @@ var CollapseAllIcon = ({
|
|
|
3315
3314
|
// src/icon/ExpandAllIcon.tsx
|
|
3316
3315
|
var import_react_native_svg6 = require("react-native-svg");
|
|
3317
3316
|
var import_react_native_theming5 = require("@storybook/react-native-theming");
|
|
3317
|
+
var import_react5 = require("react");
|
|
3318
3318
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3319
3319
|
var ExpandAllIcon = ({
|
|
3320
3320
|
color,
|
|
@@ -3324,17 +3324,20 @@ var ExpandAllIcon = ({
|
|
|
3324
3324
|
...props
|
|
3325
3325
|
}) => {
|
|
3326
3326
|
const theme = (0, import_react_native_theming5.useTheme)();
|
|
3327
|
+
const fillColor = (0, import_react5.useMemo)(() => {
|
|
3328
|
+
return color ?? theme.color.defaultText;
|
|
3329
|
+
}, [color, theme.color.defaultText]);
|
|
3327
3330
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native_svg6.Svg, { width, height, viewBox: "0 0 14 14", fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3328
3331
|
import_react_native_svg6.Path,
|
|
3329
3332
|
{
|
|
3330
3333
|
d: "M7.354.146l4 4a.5.5 0 01-.708.708L7 1.207 3.354 4.854a.5.5 0 11-.708-.708l4-4a.5.5 0 01.708 0zM11.354 9.146a.5.5 0 010 .708l-4 4a.5.5 0 01-.708 0l-4-4a.5.5 0 11.708-.708L7 12.793l3.646-3.647a.5.5 0 01.708 0z",
|
|
3331
|
-
fill:
|
|
3334
|
+
fill: fillColor
|
|
3332
3335
|
}
|
|
3333
3336
|
) });
|
|
3334
3337
|
};
|
|
3335
3338
|
|
|
3336
3339
|
// src/hooks/useExpanded.ts
|
|
3337
|
-
var
|
|
3340
|
+
var import_react6 = require("react");
|
|
3338
3341
|
|
|
3339
3342
|
// src/util/tree.ts
|
|
3340
3343
|
var import_memoizerific = __toESM(require("memoizerific"));
|
|
@@ -3415,21 +3418,22 @@ var useExpanded = ({
|
|
|
3415
3418
|
rootIds,
|
|
3416
3419
|
selectedStoryId
|
|
3417
3420
|
}) => {
|
|
3418
|
-
const [expanded, setExpanded] = (0,
|
|
3421
|
+
const [expanded, setExpanded] = (0, import_react6.useReducer)(
|
|
3419
3422
|
(state, { ids, value }) => ids.reduce((acc, id) => Object.assign(acc, { [id]: value }), { ...state }),
|
|
3420
3423
|
{ refId, data, rootIds, initialExpanded },
|
|
3421
3424
|
initializeExpanded
|
|
3422
3425
|
);
|
|
3423
|
-
const updateExpanded = (0,
|
|
3426
|
+
const updateExpanded = (0, import_react6.useCallback)(({ ids, value }) => {
|
|
3424
3427
|
setExpanded({ ids, value });
|
|
3425
3428
|
}, []);
|
|
3426
|
-
(0,
|
|
3429
|
+
(0, import_react6.useEffect)(() => {
|
|
3427
3430
|
setExpanded({ ids: getAncestorIds(data, selectedStoryId), value: true });
|
|
3428
3431
|
}, [data, selectedStoryId]);
|
|
3429
3432
|
return [expanded, updateExpanded];
|
|
3430
3433
|
};
|
|
3431
3434
|
|
|
3432
3435
|
// src/util/status.tsx
|
|
3436
|
+
var import_react7 = require("react");
|
|
3433
3437
|
var import_react_native_theming6 = require("@storybook/react-native-theming");
|
|
3434
3438
|
var import_react_native_svg7 = __toESM(require("react-native-svg"));
|
|
3435
3439
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
@@ -3441,13 +3445,10 @@ function SmallIcons(props) {
|
|
|
3441
3445
|
}
|
|
3442
3446
|
function LoadingIcons(props) {
|
|
3443
3447
|
const theme = (0, import_react_native_theming6.useTheme)();
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
...props
|
|
3449
|
-
}
|
|
3450
|
-
);
|
|
3448
|
+
const color = (0, import_react7.useMemo)(() => {
|
|
3449
|
+
return theme.base === "light" ? theme.color.mediumdark : theme.color.darker;
|
|
3450
|
+
}, [theme.base, theme.color.darker, theme.color.mediumdark]);
|
|
3451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SmallIcons, { color, ...props });
|
|
3451
3452
|
}
|
|
3452
3453
|
var statusPriority = ["unknown", "pending", "success", "warn", "error"];
|
|
3453
3454
|
var statusMapping = {
|
|
@@ -3483,7 +3484,7 @@ var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
|
3483
3484
|
var TextItem = import_react_native_theming7.styled.Text(({ theme }) => ({
|
|
3484
3485
|
color: theme.color.defaultText
|
|
3485
3486
|
}));
|
|
3486
|
-
var Node =
|
|
3487
|
+
var Node = import_react8.default.memo(function Node2({
|
|
3487
3488
|
item,
|
|
3488
3489
|
refId,
|
|
3489
3490
|
isOrphan,
|
|
@@ -3611,9 +3612,9 @@ var CollapseButton = import_react_native_theming7.styled.TouchableOpacity(({}) =
|
|
|
3611
3612
|
cursor: "pointer",
|
|
3612
3613
|
height: 28
|
|
3613
3614
|
}));
|
|
3614
|
-
var Tree =
|
|
3615
|
-
const containerRef = (0,
|
|
3616
|
-
const [rootIds, orphanIds, initialExpanded] = (0,
|
|
3615
|
+
var Tree = import_react8.default.memo(function Tree2({ isMain, refId, data, status, docsMode, selectedStoryId, onSelectStoryId }) {
|
|
3616
|
+
const containerRef = (0, import_react8.useRef)(null);
|
|
3617
|
+
const [rootIds, orphanIds, initialExpanded] = (0, import_react8.useMemo)(
|
|
3617
3618
|
() => Object.keys(data).reduce(
|
|
3618
3619
|
(acc, id) => {
|
|
3619
3620
|
const item = data[id];
|
|
@@ -3629,7 +3630,7 @@ var Tree = import_react5.default.memo(function Tree2({ isMain, refId, data, stat
|
|
|
3629
3630
|
),
|
|
3630
3631
|
[data]
|
|
3631
3632
|
);
|
|
3632
|
-
const { expandableDescendants } = (0,
|
|
3633
|
+
const { expandableDescendants } = (0, import_react8.useMemo)(() => {
|
|
3633
3634
|
return [...orphanIds, ...rootIds].reduce(
|
|
3634
3635
|
(acc, nodeId) => {
|
|
3635
3636
|
acc.expandableDescendants[nodeId] = getDescendantIds(data, nodeId, false).filter(
|
|
@@ -3640,7 +3641,7 @@ var Tree = import_react5.default.memo(function Tree2({ isMain, refId, data, stat
|
|
|
3640
3641
|
{ orphansFirst: [], expandableDescendants: {} }
|
|
3641
3642
|
);
|
|
3642
3643
|
}, [data, rootIds, orphanIds]);
|
|
3643
|
-
const singleStoryComponentIds = (0,
|
|
3644
|
+
const singleStoryComponentIds = (0, import_react8.useMemo)(() => {
|
|
3644
3645
|
return Object.keys(data).filter((id) => {
|
|
3645
3646
|
const entry = data[id];
|
|
3646
3647
|
if (entry.type !== "component")
|
|
@@ -3656,12 +3657,12 @@ var Tree = import_react5.default.memo(function Tree2({ isMain, refId, data, stat
|
|
|
3656
3657
|
return false;
|
|
3657
3658
|
});
|
|
3658
3659
|
}, [data]);
|
|
3659
|
-
const collapsedItems = (0,
|
|
3660
|
+
const collapsedItems = (0, import_react8.useMemo)(
|
|
3660
3661
|
() => Object.keys(data).filter((id) => !singleStoryComponentIds.includes(id)),
|
|
3661
3662
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3662
3663
|
[singleStoryComponentIds]
|
|
3663
3664
|
);
|
|
3664
|
-
const collapsedData = (0,
|
|
3665
|
+
const collapsedData = (0, import_react8.useMemo)(() => {
|
|
3665
3666
|
return singleStoryComponentIds.reduce(
|
|
3666
3667
|
(acc, id) => {
|
|
3667
3668
|
const { children, parent, name } = data[id];
|
|
@@ -3682,7 +3683,7 @@ var Tree = import_react5.default.memo(function Tree2({ isMain, refId, data, stat
|
|
|
3682
3683
|
{ ...data }
|
|
3683
3684
|
);
|
|
3684
3685
|
}, [data]);
|
|
3685
|
-
const ancestry = (0,
|
|
3686
|
+
const ancestry = (0, import_react8.useMemo)(() => {
|
|
3686
3687
|
return collapsedItems.reduce(
|
|
3687
3688
|
(acc, id) => Object.assign(acc, { [id]: getAncestorIds(collapsedData, id) }),
|
|
3688
3689
|
{}
|
|
@@ -3696,8 +3697,8 @@ var Tree = import_react5.default.memo(function Tree2({ isMain, refId, data, stat
|
|
|
3696
3697
|
selectedStoryId,
|
|
3697
3698
|
onSelectStoryId
|
|
3698
3699
|
});
|
|
3699
|
-
const groupStatus = (0,
|
|
3700
|
-
const treeItems = (0,
|
|
3700
|
+
const groupStatus = (0, import_react8.useMemo)(() => getGroupStatus(collapsedData, status), [collapsedData, status]);
|
|
3701
|
+
const treeItems = (0, import_react8.useMemo)(() => {
|
|
3701
3702
|
return collapsedItems.map((itemId) => {
|
|
3702
3703
|
const item = collapsedData[itemId];
|
|
3703
3704
|
const id = createId(itemId, refId);
|
|
@@ -3765,13 +3766,13 @@ var Container = import_react_native_theming7.styled.View((props) => ({
|
|
|
3765
3766
|
marginTop: props.hasOrphans ? 20 : 0,
|
|
3766
3767
|
marginBottom: 20
|
|
3767
3768
|
}));
|
|
3768
|
-
var Root =
|
|
3769
|
+
var Root = import_react8.default.memo(function Root2({
|
|
3769
3770
|
setExpanded,
|
|
3770
3771
|
isFullyExpanded,
|
|
3771
3772
|
expandableDescendants,
|
|
3772
3773
|
...props
|
|
3773
3774
|
}) {
|
|
3774
|
-
const setFullyExpanded = (0,
|
|
3775
|
+
const setFullyExpanded = (0, import_react8.useCallback)(
|
|
3775
3776
|
() => setExpanded({ ids: expandableDescendants, value: !isFullyExpanded }),
|
|
3776
3777
|
[setExpanded, isFullyExpanded, expandableDescendants]
|
|
3777
3778
|
);
|
|
@@ -3787,10 +3788,10 @@ var Root = import_react5.default.memo(function Root2({
|
|
|
3787
3788
|
});
|
|
3788
3789
|
|
|
3789
3790
|
// src/LayoutProvider.tsx
|
|
3790
|
-
var
|
|
3791
|
+
var import_react9 = require("react");
|
|
3791
3792
|
var import_react_native = require("react-native");
|
|
3792
3793
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3793
|
-
var LayoutContext = (0,
|
|
3794
|
+
var LayoutContext = (0, import_react9.createContext)({
|
|
3794
3795
|
isDesktop: false,
|
|
3795
3796
|
isMobile: true
|
|
3796
3797
|
});
|
|
@@ -3798,7 +3799,7 @@ var LayoutProvider = ({ children }) => {
|
|
|
3798
3799
|
const { width } = (0, import_react_native.useWindowDimensions)();
|
|
3799
3800
|
const isDesktop = width >= BREAKPOINT;
|
|
3800
3801
|
const isMobile = !isDesktop;
|
|
3801
|
-
const contextValue = (0,
|
|
3802
|
+
const contextValue = (0, import_react9.useMemo)(
|
|
3802
3803
|
() => ({
|
|
3803
3804
|
isDesktop,
|
|
3804
3805
|
isMobile
|
|
@@ -3807,19 +3808,19 @@ var LayoutProvider = ({ children }) => {
|
|
|
3807
3808
|
);
|
|
3808
3809
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LayoutContext.Provider, { value: contextValue, children });
|
|
3809
3810
|
};
|
|
3810
|
-
var useLayout = () => (0,
|
|
3811
|
+
var useLayout = () => (0, import_react9.useContext)(LayoutContext);
|
|
3811
3812
|
|
|
3812
3813
|
// src/Explorer.tsx
|
|
3813
|
-
var
|
|
3814
|
+
var import_react11 = __toESM(require("react"));
|
|
3814
3815
|
|
|
3815
3816
|
// src/Refs.tsx
|
|
3816
|
-
var
|
|
3817
|
+
var import_react10 = __toESM(require("react"));
|
|
3817
3818
|
var import_react_native_theming8 = require("@storybook/react-native-theming");
|
|
3818
3819
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3819
3820
|
var Wrapper2 = import_react_native_theming8.styled.View(({}) => ({
|
|
3820
3821
|
position: "relative"
|
|
3821
3822
|
}));
|
|
3822
|
-
var Ref =
|
|
3823
|
+
var Ref = import_react10.default.memo(function Ref2(props) {
|
|
3823
3824
|
const {
|
|
3824
3825
|
index,
|
|
3825
3826
|
id: refId,
|
|
@@ -3834,20 +3835,20 @@ var Ref = import_react7.default.memo(function Ref2(props) {
|
|
|
3834
3835
|
previewInitialized,
|
|
3835
3836
|
setSelection
|
|
3836
3837
|
} = props;
|
|
3837
|
-
const length = (0,
|
|
3838
|
+
const length = (0, import_react10.useMemo)(() => index ? Object.keys(index).length : 0, [index]);
|
|
3838
3839
|
const isLoadingInjected = type === "auto-inject" && !previewInitialized || type === "server-checked";
|
|
3839
3840
|
const isLoading = isLoadingMain || isLoadingInjected || type === "unknown";
|
|
3840
3841
|
const isError = !!indexError;
|
|
3841
3842
|
const isEmpty = !isLoading && length === 0;
|
|
3842
3843
|
const isAuthRequired = !!loginUrl && length === 0;
|
|
3843
3844
|
const state = getStateType(isLoading, isAuthRequired, isError, isEmpty);
|
|
3844
|
-
const [isExpanded, setExpanded] = (0,
|
|
3845
|
-
(0,
|
|
3845
|
+
const [isExpanded, setExpanded] = (0, import_react10.useState)(expanded);
|
|
3846
|
+
(0, import_react10.useEffect)(() => {
|
|
3846
3847
|
if (index && selectedStoryId && index[selectedStoryId]) {
|
|
3847
3848
|
setExpanded(true);
|
|
3848
3849
|
}
|
|
3849
3850
|
}, [setExpanded, index, selectedStoryId]);
|
|
3850
|
-
const onSelectStoryId = (0,
|
|
3851
|
+
const onSelectStoryId = (0, import_react10.useCallback)(
|
|
3851
3852
|
(storyId) => {
|
|
3852
3853
|
setSelection({ refId, storyId });
|
|
3853
3854
|
},
|
|
@@ -3871,16 +3872,16 @@ var Ref = import_react7.default.memo(function Ref2(props) {
|
|
|
3871
3872
|
// src/Explorer.tsx
|
|
3872
3873
|
var import_react_native2 = require("react-native");
|
|
3873
3874
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3874
|
-
var
|
|
3875
|
-
var Explorer =
|
|
3875
|
+
var import_react12 = require("react");
|
|
3876
|
+
var Explorer = import_react11.default.memo(function Explorer2({
|
|
3876
3877
|
isLoading,
|
|
3877
3878
|
isBrowsing,
|
|
3878
3879
|
dataset,
|
|
3879
3880
|
selected,
|
|
3880
3881
|
setSelection
|
|
3881
3882
|
}) {
|
|
3882
|
-
const containerRef = (0,
|
|
3883
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native2.View, { ref: containerRef, id: "storybook-explorer-tree", children: dataset.entries.map(([refId, ref]) => /* @__PURE__ */ (0,
|
|
3883
|
+
const containerRef = (0, import_react11.useRef)(null);
|
|
3884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native2.View, { ref: containerRef, id: "storybook-explorer-tree", children: dataset.entries.map(([refId, ref]) => /* @__PURE__ */ (0, import_react12.createElement)(
|
|
3884
3885
|
Ref,
|
|
3885
3886
|
{
|
|
3886
3887
|
...ref,
|
|
@@ -3894,14 +3895,14 @@ var Explorer = import_react8.default.memo(function Explorer2({
|
|
|
3894
3895
|
});
|
|
3895
3896
|
|
|
3896
3897
|
// src/Sidebar.tsx
|
|
3897
|
-
var
|
|
3898
|
+
var import_react17 = __toESM(require("react"));
|
|
3898
3899
|
var import_react_native_theming11 = require("@storybook/react-native-theming");
|
|
3899
3900
|
|
|
3900
3901
|
// src/Search.tsx
|
|
3901
3902
|
var import_bottom_sheet = require("@gorhom/bottom-sheet");
|
|
3902
3903
|
var import_react_native_theming9 = require("@storybook/react-native-theming");
|
|
3903
3904
|
var import_fuse = __toESM(require("fuse.js"));
|
|
3904
|
-
var
|
|
3905
|
+
var import_react13 = __toESM(require("react"));
|
|
3905
3906
|
var import_react_native3 = require("react-native");
|
|
3906
3907
|
|
|
3907
3908
|
// src/icon/CloseIcon.tsx
|
|
@@ -3998,6 +3999,8 @@ var BottomSheetInput = (0, import_react_native_theming9.styled)(import_bottom_sh
|
|
|
3998
3999
|
height: 32,
|
|
3999
4000
|
paddingLeft: 28,
|
|
4000
4001
|
paddingRight: 28,
|
|
4002
|
+
paddingTop: import_react_native3.Platform.OS === "android" ? 0 : void 0,
|
|
4003
|
+
paddingBottom: import_react_native3.Platform.OS === "android" ? 0 : void 0,
|
|
4001
4004
|
borderWidth: 1,
|
|
4002
4005
|
borderColor: theme.appBorderColor,
|
|
4003
4006
|
backgroundColor: "transparent",
|
|
@@ -4031,13 +4034,13 @@ var ClearIcon = import_react_native_theming9.styled.TouchableOpacity(({ theme })
|
|
|
4031
4034
|
justifyContent: "center",
|
|
4032
4035
|
height: "100%"
|
|
4033
4036
|
}));
|
|
4034
|
-
var Search =
|
|
4035
|
-
const inputRef = (0,
|
|
4036
|
-
const [inputValue, setInputValue] = (0,
|
|
4037
|
-
const [isOpen, setIsOpen] = (0,
|
|
4038
|
-
const [allComponents, showAllComponents] = (0,
|
|
4037
|
+
var Search = import_react13.default.memo(function Search2({ children, dataset, setSelection, getLastViewed, initialQuery = "" }) {
|
|
4038
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
4039
|
+
const [inputValue, setInputValue] = (0, import_react13.useState)(initialQuery);
|
|
4040
|
+
const [isOpen, setIsOpen] = (0, import_react13.useState)(false);
|
|
4041
|
+
const [allComponents, showAllComponents] = (0, import_react13.useState)(false);
|
|
4039
4042
|
const { isMobile } = useLayout();
|
|
4040
|
-
const selectStory = (0,
|
|
4043
|
+
const selectStory = (0, import_react13.useCallback)(
|
|
4041
4044
|
(id, refId) => {
|
|
4042
4045
|
setSelection({ storyId: id, refId });
|
|
4043
4046
|
inputRef.current?.blur();
|
|
@@ -4046,7 +4049,7 @@ var Search = import_react10.default.memo(function Search2({ children, dataset, s
|
|
|
4046
4049
|
},
|
|
4047
4050
|
[setSelection]
|
|
4048
4051
|
);
|
|
4049
|
-
const getItemProps = (0,
|
|
4052
|
+
const getItemProps = (0, import_react13.useCallback)(
|
|
4050
4053
|
({ item: result }) => {
|
|
4051
4054
|
return {
|
|
4052
4055
|
icon: result?.item?.type === "component" ? "component" : "story",
|
|
@@ -4069,7 +4072,7 @@ var Search = import_react10.default.memo(function Search2({ children, dataset, s
|
|
|
4069
4072
|
},
|
|
4070
4073
|
[selectStory]
|
|
4071
4074
|
);
|
|
4072
|
-
const makeFuse = (0,
|
|
4075
|
+
const makeFuse = (0, import_react13.useCallback)(() => {
|
|
4073
4076
|
const list = dataset.entries.reduce((acc, [refId, { index, status }]) => {
|
|
4074
4077
|
const groupStatus = getGroupStatus(index || {}, status);
|
|
4075
4078
|
if (index) {
|
|
@@ -4087,7 +4090,7 @@ var Search = import_react10.default.memo(function Search2({ children, dataset, s
|
|
|
4087
4090
|
}, []);
|
|
4088
4091
|
return new import_fuse.default(list, options);
|
|
4089
4092
|
}, [dataset]);
|
|
4090
|
-
const getResults = (0,
|
|
4093
|
+
const getResults = (0, import_react13.useCallback)(
|
|
4091
4094
|
(input2) => {
|
|
4092
4095
|
const fuse = makeFuse();
|
|
4093
4096
|
if (!input2)
|
|
@@ -4129,7 +4132,7 @@ var Search = import_react10.default.memo(function Search2({ children, dataset, s
|
|
|
4129
4132
|
},
|
|
4130
4133
|
[allComponents, dataset.hash, getLastViewed, makeFuse]
|
|
4131
4134
|
);
|
|
4132
|
-
const deferredQuery = (0,
|
|
4135
|
+
const deferredQuery = (0, import_react13.useDeferredValue)(inputValue);
|
|
4133
4136
|
const input = deferredQuery ? deferredQuery.trim() : "";
|
|
4134
4137
|
const results = input ? getResults(input) : [];
|
|
4135
4138
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native3.View, { style: { flex: 1 }, children: [
|
|
@@ -4169,11 +4172,11 @@ var Search = import_react10.default.memo(function Search2({ children, dataset, s
|
|
|
4169
4172
|
|
|
4170
4173
|
// src/SearchResults.tsx
|
|
4171
4174
|
var import_react_native_theming10 = require("@storybook/react-native-theming");
|
|
4172
|
-
var
|
|
4175
|
+
var import_react14 = __toESM(require("react"));
|
|
4173
4176
|
var import_polished2 = require("polished");
|
|
4174
4177
|
var import_react_native4 = require("react-native");
|
|
4175
4178
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
4176
|
-
var
|
|
4179
|
+
var import_react15 = require("react");
|
|
4177
4180
|
var ResultsList = import_react_native_theming10.styled.View({
|
|
4178
4181
|
margin: 0,
|
|
4179
4182
|
padding: 0,
|
|
@@ -4239,7 +4242,7 @@ var RecentlyOpenedTitle = import_react_native_theming10.styled.View(({ theme })
|
|
|
4239
4242
|
marginBottom: 4,
|
|
4240
4243
|
alignItems: "center"
|
|
4241
4244
|
}));
|
|
4242
|
-
var Highlight =
|
|
4245
|
+
var Highlight = import_react14.default.memo(
|
|
4243
4246
|
function Highlight2({ children, match }) {
|
|
4244
4247
|
if (!match)
|
|
4245
4248
|
return children;
|
|
@@ -4274,14 +4277,14 @@ var PathText = import_react_native_theming10.styled.Text(({ theme }) => ({
|
|
|
4274
4277
|
fontSize: theme.typography.size.s1 - 1,
|
|
4275
4278
|
color: theme.textMutedColor
|
|
4276
4279
|
}));
|
|
4277
|
-
var Result =
|
|
4280
|
+
var Result = import_react14.default.memo(function Result2({
|
|
4278
4281
|
item,
|
|
4279
4282
|
matches,
|
|
4280
4283
|
icon: _icon,
|
|
4281
4284
|
onPress,
|
|
4282
4285
|
...props
|
|
4283
4286
|
}) {
|
|
4284
|
-
const press = (0,
|
|
4287
|
+
const press = (0, import_react14.useCallback)(
|
|
4285
4288
|
(event) => {
|
|
4286
4289
|
event.preventDefault();
|
|
4287
4290
|
onPress?.(event);
|
|
@@ -4315,7 +4318,7 @@ var Result = import_react11.default.memo(function Result2({
|
|
|
4315
4318
|
var Text = import_react_native_theming10.styled.Text(({ theme }) => ({
|
|
4316
4319
|
color: theme.color.defaultText
|
|
4317
4320
|
}));
|
|
4318
|
-
var SearchResults =
|
|
4321
|
+
var SearchResults = import_react14.default.memo(function SearchResults2({
|
|
4319
4322
|
query,
|
|
4320
4323
|
results,
|
|
4321
4324
|
closeMenu,
|
|
@@ -4350,7 +4353,7 @@ var SearchResults = import_react11.default.memo(function SearchResults2({
|
|
|
4350
4353
|
}
|
|
4351
4354
|
const { item } = result;
|
|
4352
4355
|
const key = `${item.refId}::${item.id}`;
|
|
4353
|
-
return /* @__PURE__ */ (0,
|
|
4356
|
+
return /* @__PURE__ */ (0, import_react15.createElement)(
|
|
4354
4357
|
Result,
|
|
4355
4358
|
{
|
|
4356
4359
|
...result,
|
|
@@ -4365,11 +4368,11 @@ var SearchResults = import_react11.default.memo(function SearchResults2({
|
|
|
4365
4368
|
|
|
4366
4369
|
// src/hooks/useLastViewed.ts
|
|
4367
4370
|
var import_debounce = __toESM(require_debounce());
|
|
4368
|
-
var
|
|
4371
|
+
var import_react16 = require("react");
|
|
4369
4372
|
var import_store2 = __toESM(require("store2"));
|
|
4370
4373
|
var save = (0, import_debounce.default)((value) => import_store2.default.set("lastViewedStoryIds", value), 1e3);
|
|
4371
4374
|
var useLastViewed = (selection) => {
|
|
4372
|
-
const initialLastViewedStoryIds = (0,
|
|
4375
|
+
const initialLastViewedStoryIds = (0, import_react16.useMemo)(() => {
|
|
4373
4376
|
const items = import_store2.default.get("lastViewedStoryIds");
|
|
4374
4377
|
if (!items || !Array.isArray(items))
|
|
4375
4378
|
return [];
|
|
@@ -4377,8 +4380,8 @@ var useLastViewed = (selection) => {
|
|
|
4377
4380
|
return [];
|
|
4378
4381
|
return items;
|
|
4379
4382
|
}, []);
|
|
4380
|
-
const lastViewedRef = (0,
|
|
4381
|
-
const updateLastViewed = (0,
|
|
4383
|
+
const lastViewedRef = (0, import_react16.useRef)(initialLastViewedStoryIds);
|
|
4384
|
+
const updateLastViewed = (0, import_react16.useCallback)(
|
|
4382
4385
|
(story) => {
|
|
4383
4386
|
const items = lastViewedRef.current;
|
|
4384
4387
|
const index = items.findIndex(
|
|
@@ -4395,13 +4398,13 @@ var useLastViewed = (selection) => {
|
|
|
4395
4398
|
},
|
|
4396
4399
|
[lastViewedRef]
|
|
4397
4400
|
);
|
|
4398
|
-
(0,
|
|
4401
|
+
(0, import_react16.useEffect)(() => {
|
|
4399
4402
|
if (selection)
|
|
4400
4403
|
updateLastViewed(selection);
|
|
4401
4404
|
}, [selection]);
|
|
4402
4405
|
return {
|
|
4403
|
-
getLastViewed: (0,
|
|
4404
|
-
clearLastViewed: (0,
|
|
4406
|
+
getLastViewed: (0, import_react16.useCallback)(() => lastViewedRef.current, [lastViewedRef]),
|
|
4407
|
+
clearLastViewed: (0, import_react16.useCallback)(() => {
|
|
4405
4408
|
lastViewedRef.current = lastViewedRef.current.slice(0, 1);
|
|
4406
4409
|
save(lastViewedRef.current);
|
|
4407
4410
|
}, [lastViewedRef])
|
|
@@ -4425,18 +4428,18 @@ var Top = import_react_native_theming11.styled.View({
|
|
|
4425
4428
|
flex: 1,
|
|
4426
4429
|
flexDirection: "row"
|
|
4427
4430
|
});
|
|
4428
|
-
var Swap =
|
|
4431
|
+
var Swap = import_react17.default.memo(function Swap2({
|
|
4429
4432
|
children,
|
|
4430
4433
|
condition
|
|
4431
4434
|
}) {
|
|
4432
|
-
const [a, b] =
|
|
4435
|
+
const [a, b] = import_react17.default.Children.toArray(children);
|
|
4433
4436
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
4434
4437
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native5.View, { style: { display: condition ? "flex" : "none" }, children: a }),
|
|
4435
4438
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native5.View, { style: { display: condition ? "none" : "flex" }, children: b })
|
|
4436
4439
|
] });
|
|
4437
4440
|
});
|
|
4438
4441
|
var useCombination = (index, indexError, previewInitialized, status, refs) => {
|
|
4439
|
-
const hash = (0,
|
|
4442
|
+
const hash = (0, import_react17.useMemo)(
|
|
4440
4443
|
() => ({
|
|
4441
4444
|
[DEFAULT_REF_ID]: {
|
|
4442
4445
|
index,
|
|
@@ -4451,9 +4454,9 @@ var useCombination = (index, indexError, previewInitialized, status, refs) => {
|
|
|
4451
4454
|
}),
|
|
4452
4455
|
[refs, index, indexError, previewInitialized, status]
|
|
4453
4456
|
);
|
|
4454
|
-
return (0,
|
|
4457
|
+
return (0, import_react17.useMemo)(() => ({ hash, entries: Object.entries(hash) }), [hash]);
|
|
4455
4458
|
};
|
|
4456
|
-
var Sidebar =
|
|
4459
|
+
var Sidebar = import_react17.default.memo(function Sidebar2({
|
|
4457
4460
|
storyId = null,
|
|
4458
4461
|
refId = DEFAULT_REF_ID,
|
|
4459
4462
|
index,
|
|
@@ -4463,7 +4466,7 @@ var Sidebar = import_react14.default.memo(function Sidebar2({
|
|
|
4463
4466
|
refs = {},
|
|
4464
4467
|
setSelection
|
|
4465
4468
|
}) {
|
|
4466
|
-
const selected = (0,
|
|
4469
|
+
const selected = (0, import_react17.useMemo)(() => storyId && { storyId, refId }, [storyId, refId]);
|
|
4467
4470
|
const dataset = useCombination(index, indexError, previewInitialized, status, refs);
|
|
4468
4471
|
const lastViewedProps = useLastViewed(selected);
|
|
4469
4472
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Container2, { style: { paddingHorizontal: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Top, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Search, { dataset, setSelection, ...lastViewedProps, children: ({ query, results, isBrowsing, closeMenu, getItemProps, highlightedIndex }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Swap, { condition: isBrowsing, children: [
|
|
@@ -4496,7 +4499,7 @@ var Sidebar = import_react14.default.memo(function Sidebar2({
|
|
|
4496
4499
|
var import_core_events = require("@storybook/core/core-events");
|
|
4497
4500
|
var import_manager_api2 = require("@storybook/core/manager-api");
|
|
4498
4501
|
var import_react_native_theming17 = require("@storybook/react-native-theming");
|
|
4499
|
-
var
|
|
4502
|
+
var import_react26 = require("react");
|
|
4500
4503
|
var import_react_native9 = require("react-native");
|
|
4501
4504
|
var import_react_native_safe_area_context3 = require("react-native-safe-area-context");
|
|
4502
4505
|
|
|
@@ -4505,22 +4508,37 @@ var import_bottom_sheet2 = require("@gorhom/bottom-sheet");
|
|
|
4505
4508
|
var import_manager_api = require("@storybook/core/manager-api");
|
|
4506
4509
|
var import_react_native_theming12 = require("@storybook/react-native-theming");
|
|
4507
4510
|
var import_types3 = require("@storybook/core/types");
|
|
4508
|
-
var
|
|
4511
|
+
var import_react19 = require("react");
|
|
4509
4512
|
var import_react_native6 = require("react-native");
|
|
4510
4513
|
var import_react_native_gesture_handler = require("react-native-gesture-handler");
|
|
4511
4514
|
var import_react_native_reanimated = __toESM(require("react-native-reanimated"));
|
|
4512
4515
|
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
4513
4516
|
var import_react_native_theming13 = require("@storybook/react-native-theming");
|
|
4517
|
+
|
|
4518
|
+
// src/util/useStyle.ts
|
|
4519
|
+
var import_react18 = require("react");
|
|
4520
|
+
var useStyle = (styleFactory, deps) => (
|
|
4521
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4522
|
+
(0, import_react18.useMemo)(styleFactory, deps)
|
|
4523
|
+
);
|
|
4524
|
+
|
|
4525
|
+
// src/MobileAddonsPanel.tsx
|
|
4514
4526
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4515
|
-
var
|
|
4527
|
+
var bottomSheetStyle = {
|
|
4528
|
+
paddingTop: 8
|
|
4529
|
+
};
|
|
4530
|
+
var contentStyle = {
|
|
4531
|
+
flex: 1
|
|
4532
|
+
};
|
|
4533
|
+
var MobileAddonsPanel = (0, import_react19.forwardRef)(
|
|
4516
4534
|
({ storyId }, ref) => {
|
|
4517
4535
|
const theme = (0, import_react_native_theming13.useTheme)();
|
|
4518
4536
|
const reducedMotion = (0, import_react_native_reanimated.useReducedMotion)();
|
|
4519
|
-
const addonsPanelBottomSheetRef = (0,
|
|
4537
|
+
const addonsPanelBottomSheetRef = (0, import_react19.useRef)(null);
|
|
4520
4538
|
const insets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
4521
4539
|
const animatedPosition = (0, import_react_native_reanimated.useSharedValue)(0);
|
|
4522
4540
|
(0, import_react_native_reanimated.useAnimatedKeyboard)();
|
|
4523
|
-
(0,
|
|
4541
|
+
(0, import_react19.useImperativeHandle)(ref, () => ({
|
|
4524
4542
|
setAddonsPanelOpen: (open) => {
|
|
4525
4543
|
if (open) {
|
|
4526
4544
|
addonsPanelBottomSheetRef.current?.present();
|
|
@@ -4536,6 +4554,19 @@ var MobileAddonsPanel = (0, import_react15.forwardRef)(
|
|
|
4536
4554
|
maxHeight: height - animatedPosition.value - insets.bottom - extraPadding
|
|
4537
4555
|
};
|
|
4538
4556
|
}, [animatedPosition, height, insets.bottom]);
|
|
4557
|
+
const backgroundStyle = useStyle(() => {
|
|
4558
|
+
return {
|
|
4559
|
+
borderRadius: 0,
|
|
4560
|
+
borderTopColor: theme.appBorderColor,
|
|
4561
|
+
borderTopWidth: 1,
|
|
4562
|
+
backgroundColor: theme.background.content
|
|
4563
|
+
};
|
|
4564
|
+
});
|
|
4565
|
+
const handleIndicatorStyle = useStyle(() => {
|
|
4566
|
+
return {
|
|
4567
|
+
backgroundColor: theme.textMutedColor
|
|
4568
|
+
};
|
|
4569
|
+
});
|
|
4539
4570
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4540
4571
|
import_bottom_sheet2.BottomSheetModal,
|
|
4541
4572
|
{
|
|
@@ -4543,24 +4574,16 @@ var MobileAddonsPanel = (0, import_react15.forwardRef)(
|
|
|
4543
4574
|
index: 1,
|
|
4544
4575
|
animateOnMount: !reducedMotion,
|
|
4545
4576
|
snapPoints: ["25%", "50%", "75%"],
|
|
4546
|
-
style:
|
|
4547
|
-
paddingTop: 8
|
|
4548
|
-
},
|
|
4577
|
+
style: bottomSheetStyle,
|
|
4549
4578
|
animatedPosition,
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
borderRadius: 0,
|
|
4553
|
-
borderTopColor: theme.appBorderColor,
|
|
4554
|
-
borderTopWidth: 1,
|
|
4555
|
-
backgroundColor: theme.background.content
|
|
4556
|
-
},
|
|
4557
|
-
handleIndicatorStyle: { backgroundColor: theme.textMutedColor },
|
|
4579
|
+
backgroundStyle,
|
|
4580
|
+
handleIndicatorStyle,
|
|
4558
4581
|
keyboardBehavior: "extend",
|
|
4559
4582
|
enableDismissOnClose: true,
|
|
4560
4583
|
enableHandlePanningGesture: true,
|
|
4561
4584
|
stackBehavior: "replace",
|
|
4562
4585
|
enableDynamicSizing: false,
|
|
4563
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native_reanimated.default.View, { style: [
|
|
4586
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native_reanimated.default.View, { style: [contentStyle, adjustedBottomSheetSize], children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4564
4587
|
AddonsTabs,
|
|
4565
4588
|
{
|
|
4566
4589
|
onClose: () => {
|
|
@@ -4573,20 +4596,57 @@ var MobileAddonsPanel = (0, import_react15.forwardRef)(
|
|
|
4573
4596
|
);
|
|
4574
4597
|
}
|
|
4575
4598
|
);
|
|
4599
|
+
var addonsTabsContainerStyle = {
|
|
4600
|
+
flex: 1
|
|
4601
|
+
};
|
|
4602
|
+
var addonsTabsStyle = {
|
|
4603
|
+
flexDirection: "row",
|
|
4604
|
+
borderBottomWidth: 1,
|
|
4605
|
+
borderBottomColor: "lightgrey"
|
|
4606
|
+
};
|
|
4607
|
+
var addonsTabsContentContainerStyle = {
|
|
4608
|
+
justifyContent: "center"
|
|
4609
|
+
};
|
|
4610
|
+
var closeIconStyle = {
|
|
4611
|
+
marginRight: 4,
|
|
4612
|
+
marginBottom: 4,
|
|
4613
|
+
alignItems: "center",
|
|
4614
|
+
justifyContent: "center"
|
|
4615
|
+
};
|
|
4616
|
+
var addonsScrollStyle = {
|
|
4617
|
+
flex: 1
|
|
4618
|
+
};
|
|
4619
|
+
var centeredStyle = {
|
|
4620
|
+
alignItems: "center",
|
|
4621
|
+
justifyContent: "center"
|
|
4622
|
+
};
|
|
4623
|
+
var hitSlop = { top: 10, right: 10, bottom: 10, left: 10 };
|
|
4576
4624
|
var AddonsTabs = ({ onClose, storyId }) => {
|
|
4577
4625
|
const panels = import_manager_api.addons.getElements(import_types3.Addon_TypesEnum.PANEL);
|
|
4578
|
-
const [addonSelected, setAddonSelected] = (0,
|
|
4626
|
+
const [addonSelected, setAddonSelected] = (0, import_react19.useState)(Object.keys(panels)[0]);
|
|
4579
4627
|
const insets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
4580
|
-
|
|
4581
|
-
|
|
4628
|
+
const scrollContentContainerStyle = useStyle(() => {
|
|
4629
|
+
return {
|
|
4630
|
+
paddingBottom: insets.bottom + 16
|
|
4631
|
+
};
|
|
4632
|
+
});
|
|
4633
|
+
const panel = (0, import_react19.useMemo)(() => {
|
|
4634
|
+
if (!storyId) {
|
|
4635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native6.View, { style: centeredStyle, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native6.Text, { children: "No Story Selected" }) });
|
|
4636
|
+
}
|
|
4637
|
+
if (Object.keys(panels).length === 0) {
|
|
4638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native6.View, { style: centeredStyle, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native6.Text, { children: "No addons loaded." }) });
|
|
4639
|
+
}
|
|
4640
|
+
return panels[addonSelected].render({ active: true });
|
|
4641
|
+
}, [addonSelected, panels, storyId]);
|
|
4642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native6.View, { style: addonsTabsContainerStyle, children: [
|
|
4643
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native6.View, { style: addonsTabsStyle, children: [
|
|
4582
4644
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4583
4645
|
import_react_native_gesture_handler.ScrollView,
|
|
4584
4646
|
{
|
|
4585
4647
|
horizontal: true,
|
|
4586
4648
|
showsHorizontalScrollIndicator: false,
|
|
4587
|
-
contentContainerStyle:
|
|
4588
|
-
justifyContent: "center"
|
|
4589
|
-
},
|
|
4649
|
+
contentContainerStyle: addonsTabsContentContainerStyle,
|
|
4590
4650
|
children: Object.values(panels).map(({ id, title }) => {
|
|
4591
4651
|
const resolvedTitle = typeof title === "function" ? title({}) : title;
|
|
4592
4652
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -4604,13 +4664,8 @@ var AddonsTabs = ({ onClose, storyId }) => {
|
|
|
4604
4664
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4605
4665
|
IconButton,
|
|
4606
4666
|
{
|
|
4607
|
-
style:
|
|
4608
|
-
|
|
4609
|
-
marginBottom: 4,
|
|
4610
|
-
alignItems: "center",
|
|
4611
|
-
justifyContent: "center"
|
|
4612
|
-
},
|
|
4613
|
-
hitSlop: { top: 10, right: 10, bottom: 10, left: 10 },
|
|
4667
|
+
style: closeIconStyle,
|
|
4668
|
+
hitSlop,
|
|
4614
4669
|
Icon: CloseIcon,
|
|
4615
4670
|
onPress: () => onClose?.()
|
|
4616
4671
|
}
|
|
@@ -4619,19 +4674,9 @@ var AddonsTabs = ({ onClose, storyId }) => {
|
|
|
4619
4674
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4620
4675
|
import_react_native_gesture_handler.ScrollView,
|
|
4621
4676
|
{
|
|
4622
|
-
style:
|
|
4623
|
-
contentContainerStyle:
|
|
4624
|
-
|
|
4625
|
-
},
|
|
4626
|
-
children: (() => {
|
|
4627
|
-
if (!storyId) {
|
|
4628
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native6.View, { style: { alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native6.Text, { children: "No Story Selected" }) });
|
|
4629
|
-
}
|
|
4630
|
-
if (Object.keys(panels).length === 0) {
|
|
4631
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native6.View, { style: { alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native6.Text, { children: "No addons loaded." }) });
|
|
4632
|
-
}
|
|
4633
|
-
return panels[addonSelected].render({ active: true });
|
|
4634
|
-
})()
|
|
4677
|
+
style: addonsScrollStyle,
|
|
4678
|
+
contentContainerStyle: scrollContentContainerStyle,
|
|
4679
|
+
children: panel
|
|
4635
4680
|
}
|
|
4636
4681
|
)
|
|
4637
4682
|
] });
|
|
@@ -4657,7 +4702,7 @@ var TabText = import_react_native_theming12.styled.Text(({ theme, active }) => (
|
|
|
4657
4702
|
|
|
4658
4703
|
// src/MobileMenuDrawer.tsx
|
|
4659
4704
|
var import_bottom_sheet3 = __toESM(require("@gorhom/bottom-sheet"));
|
|
4660
|
-
var
|
|
4705
|
+
var import_react20 = require("react");
|
|
4661
4706
|
var import_react_native7 = require("react-native");
|
|
4662
4707
|
var import_react_native_reanimated2 = require("react-native-reanimated");
|
|
4663
4708
|
var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
|
|
@@ -4673,54 +4718,63 @@ var BottomSheetBackdropComponent = (backdropComponentProps) => /* @__PURE__ */ (
|
|
|
4673
4718
|
style: [backdropComponentProps.style, { backgroundColor: "rgba(0,0,0,0.5)" }]
|
|
4674
4719
|
}
|
|
4675
4720
|
);
|
|
4676
|
-
var
|
|
4677
|
-
|
|
4721
|
+
var snapPoints = ["50%", "75%"];
|
|
4722
|
+
var MobileMenuDrawer = (0, import_react20.memo)(
|
|
4723
|
+
(0, import_react20.forwardRef)(({ children }, ref) => {
|
|
4678
4724
|
const reducedMotion = (0, import_react_native_reanimated2.useReducedMotion)();
|
|
4679
4725
|
const insets = (0, import_react_native_safe_area_context2.useSafeAreaInsets)();
|
|
4680
4726
|
const theme = (0, import_react_native_theming14.useTheme)();
|
|
4681
|
-
const menuBottomSheetRef = (0,
|
|
4682
|
-
(0,
|
|
4727
|
+
const menuBottomSheetRef = (0, import_react20.useRef)(null);
|
|
4728
|
+
(0, import_react20.useImperativeHandle)(ref, () => ({
|
|
4683
4729
|
setMobileMenuOpen: (open) => {
|
|
4684
4730
|
if (open) {
|
|
4685
|
-
menuBottomSheetRef.current?.
|
|
4731
|
+
menuBottomSheetRef.current?.snapToIndex(1);
|
|
4686
4732
|
} else {
|
|
4687
4733
|
import_react_native7.Keyboard.dismiss();
|
|
4688
4734
|
menuBottomSheetRef.current?.close();
|
|
4689
4735
|
}
|
|
4690
4736
|
}
|
|
4691
4737
|
}));
|
|
4738
|
+
const bgColorStyle = (0, import_react20.useMemo)(() => {
|
|
4739
|
+
return { backgroundColor: theme.background.content };
|
|
4740
|
+
}, [theme.background.content]);
|
|
4741
|
+
const handleIndicatorStyle = (0, import_react20.useMemo)(() => {
|
|
4742
|
+
return { backgroundColor: theme.textMutedColor };
|
|
4743
|
+
}, [theme.textMutedColor]);
|
|
4744
|
+
const contentContainerStyle = (0, import_react20.useMemo)(() => {
|
|
4745
|
+
return { paddingBottom: insets.bottom };
|
|
4746
|
+
}, [insets.bottom]);
|
|
4692
4747
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4693
4748
|
import_bottom_sheet3.default,
|
|
4694
4749
|
{
|
|
4695
4750
|
ref: menuBottomSheetRef,
|
|
4696
4751
|
index: -1,
|
|
4697
4752
|
animateOnMount: !reducedMotion,
|
|
4698
|
-
snapPoints
|
|
4753
|
+
snapPoints,
|
|
4699
4754
|
enableHandlePanningGesture: true,
|
|
4700
4755
|
enableContentPanningGesture: true,
|
|
4701
4756
|
enableDynamicSizing: false,
|
|
4702
4757
|
keyboardBehavior: "extend",
|
|
4703
4758
|
keyboardBlurBehavior: "restore",
|
|
4759
|
+
enablePanDownToClose: true,
|
|
4704
4760
|
backdropComponent: BottomSheetBackdropComponent,
|
|
4705
|
-
backgroundStyle:
|
|
4706
|
-
handleIndicatorStyle
|
|
4761
|
+
backgroundStyle: bgColorStyle,
|
|
4762
|
+
handleIndicatorStyle,
|
|
4707
4763
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4708
4764
|
import_bottom_sheet3.BottomSheetScrollView,
|
|
4709
4765
|
{
|
|
4710
4766
|
keyboardShouldPersistTaps: "handled",
|
|
4711
|
-
contentContainerStyle
|
|
4712
|
-
paddingBottom: insets.bottom
|
|
4713
|
-
},
|
|
4767
|
+
contentContainerStyle,
|
|
4714
4768
|
children
|
|
4715
4769
|
}
|
|
4716
4770
|
)
|
|
4717
4771
|
}
|
|
4718
4772
|
);
|
|
4719
|
-
}
|
|
4773
|
+
})
|
|
4720
4774
|
);
|
|
4721
4775
|
|
|
4722
4776
|
// src/StorybookLogo.tsx
|
|
4723
|
-
var
|
|
4777
|
+
var import_react21 = require("react");
|
|
4724
4778
|
var import_react_native8 = require("react-native");
|
|
4725
4779
|
|
|
4726
4780
|
// src/icon/DarkLogo.tsx
|
|
@@ -4861,11 +4915,11 @@ var WIDTH = 125;
|
|
|
4861
4915
|
var HEIGHT = 25;
|
|
4862
4916
|
var NoBrandLogo = ({ theme }) => theme.base === "light" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Logo, { height: HEIGHT, width: WIDTH }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DarkLogo, { height: HEIGHT, width: WIDTH });
|
|
4863
4917
|
function isElement(value) {
|
|
4864
|
-
return (0,
|
|
4918
|
+
return (0, import_react21.isValidElement)(value);
|
|
4865
4919
|
}
|
|
4866
4920
|
var BrandLogo = ({ theme }) => {
|
|
4867
4921
|
const imageHasNoWidthOrHeight = typeof theme.brand.image === "object" && typeof theme.brand.image === "object" && "uri" in theme.brand.image && (!("height" in theme.brand.image) || !("width" in theme.brand.image));
|
|
4868
|
-
(0,
|
|
4922
|
+
(0, import_react21.useEffect)(() => {
|
|
4869
4923
|
if (imageHasNoWidthOrHeight) {
|
|
4870
4924
|
console.warn(
|
|
4871
4925
|
"STORYBOOK: When using a remote image as the brand logo, you must also set the width and height.\nFor example: brand: { image: { uri: 'https://sb.com/img.png', height: 25, width: 25}}"
|
|
@@ -4902,7 +4956,7 @@ var BrandLogo = ({ theme }) => {
|
|
|
4902
4956
|
}
|
|
4903
4957
|
};
|
|
4904
4958
|
var BrandTitle = ({ theme }) => {
|
|
4905
|
-
const brandTitleStyle = (0,
|
|
4959
|
+
const brandTitleStyle = (0, import_react21.useMemo)(() => {
|
|
4906
4960
|
return {
|
|
4907
4961
|
width: WIDTH,
|
|
4908
4962
|
height: HEIGHT,
|
|
@@ -4927,9 +4981,11 @@ var BrandTitle = ({ theme }) => {
|
|
|
4927
4981
|
}
|
|
4928
4982
|
};
|
|
4929
4983
|
var StorybookLogo = ({ theme }) => {
|
|
4930
|
-
|
|
4984
|
+
const image = (0, import_react21.useMemo)(() => theme.brand?.image, [theme.brand?.image]);
|
|
4985
|
+
const title = (0, import_react21.useMemo)(() => theme.brand?.title, [theme.brand?.title]);
|
|
4986
|
+
if (image) {
|
|
4931
4987
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(BrandLogo, { theme });
|
|
4932
|
-
} else if (
|
|
4988
|
+
} else if (title) {
|
|
4933
4989
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(BrandTitle, { theme });
|
|
4934
4990
|
} else {
|
|
4935
4991
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(NoBrandLogo, { theme });
|
|
@@ -4937,12 +4993,12 @@ var StorybookLogo = ({ theme }) => {
|
|
|
4937
4993
|
};
|
|
4938
4994
|
|
|
4939
4995
|
// src/hooks/useStoreState.ts
|
|
4940
|
-
var
|
|
4996
|
+
var import_react23 = require("react");
|
|
4941
4997
|
|
|
4942
4998
|
// src/StorageProvider.tsx
|
|
4943
|
-
var
|
|
4999
|
+
var import_react22 = require("react");
|
|
4944
5000
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4945
|
-
var StorageContext = (0,
|
|
5001
|
+
var StorageContext = (0, import_react22.createContext)({
|
|
4946
5002
|
getItem: async () => null,
|
|
4947
5003
|
setItem: async () => {
|
|
4948
5004
|
}
|
|
@@ -4953,13 +5009,13 @@ var StorageProvider = ({
|
|
|
4953
5009
|
}) => {
|
|
4954
5010
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(StorageContext.Provider, { value: storage, children });
|
|
4955
5011
|
};
|
|
4956
|
-
var useStorage = () => (0,
|
|
5012
|
+
var useStorage = () => (0, import_react22.useContext)(StorageContext);
|
|
4957
5013
|
|
|
4958
5014
|
// src/hooks/useStoreState.ts
|
|
4959
5015
|
var useStoreBooleanState = (key, defaultValue) => {
|
|
4960
5016
|
const storage = useStorage();
|
|
4961
|
-
const [val, setVal] = (0,
|
|
4962
|
-
(0,
|
|
5017
|
+
const [val, setVal] = (0, import_react23.useState)(defaultValue);
|
|
5018
|
+
(0, import_react23.useEffect)(() => {
|
|
4963
5019
|
storage.getItem(key).then((newVal) => {
|
|
4964
5020
|
if (newVal === null || newVal === void 0) {
|
|
4965
5021
|
setVal(defaultValue);
|
|
@@ -4968,7 +5024,7 @@ var useStoreBooleanState = (key, defaultValue) => {
|
|
|
4968
5024
|
}
|
|
4969
5025
|
});
|
|
4970
5026
|
}, [key, storage, defaultValue]);
|
|
4971
|
-
(0,
|
|
5027
|
+
(0, import_react23.useEffect)(() => {
|
|
4972
5028
|
storage.setItem(key, val.toString());
|
|
4973
5029
|
}, [key, storage, val]);
|
|
4974
5030
|
return [val, setVal];
|
|
@@ -5004,35 +5060,33 @@ var BottomBarToggleIcon = ({
|
|
|
5004
5060
|
};
|
|
5005
5061
|
|
|
5006
5062
|
// src/icon/CloseFullscreenIcon.tsx
|
|
5063
|
+
var import_react24 = require("react");
|
|
5007
5064
|
var import_react_native_svg13 = __toESM(require("react-native-svg"));
|
|
5008
5065
|
var import_react_native_theming15 = require("@storybook/react-native-theming");
|
|
5009
5066
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
5010
5067
|
function CloseFullscreenIcon({ color, width = 14, height = 14, ...props }) {
|
|
5011
5068
|
const theme = (0, import_react_native_theming15.useTheme)();
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
height,
|
|
5017
|
-
viewBox: "0 0 16 16",
|
|
5018
|
-
width,
|
|
5019
|
-
...props,
|
|
5020
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_native_svg13.Path, { d: "M5.5 0a.5.5 0 01.5.5v4A1.5 1.5 0 014.5 6h-4a.5.5 0 010-1h4a.5.5 0 00.5-.5v-4a.5.5 0 01.5-.5zm5 0a.5.5 0 01.5.5v4a.5.5 0 00.5.5h4a.5.5 0 010 1h-4A1.5 1.5 0 0110 4.5v-4a.5.5 0 01.5-.5zM0 10.5a.5.5 0 01.5-.5h4A1.5 1.5 0 016 11.5v4a.5.5 0 01-1 0v-4a.5.5 0 00-.5-.5h-4a.5.5 0 01-.5-.5zm10 1a1.5 1.5 0 011.5-1.5h4a.5.5 0 010 1h-4a.5.5 0 00-.5.5v4a.5.5 0 01-1 0v-4z" })
|
|
5021
|
-
}
|
|
5022
|
-
);
|
|
5069
|
+
const fillColor = (0, import_react24.useMemo)(() => {
|
|
5070
|
+
return color ?? theme.color.defaultText;
|
|
5071
|
+
}, [color, theme.color.defaultText]);
|
|
5072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_native_svg13.default, { fill: fillColor, height, viewBox: "0 0 16 16", width, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_native_svg13.Path, { d: "M5.5 0a.5.5 0 01.5.5v4A1.5 1.5 0 014.5 6h-4a.5.5 0 010-1h4a.5.5 0 00.5-.5v-4a.5.5 0 01.5-.5zm5 0a.5.5 0 01.5.5v4a.5.5 0 00.5.5h4a.5.5 0 010 1h-4A1.5 1.5 0 0110 4.5v-4a.5.5 0 01.5-.5zM0 10.5a.5.5 0 01.5-.5h4A1.5 1.5 0 016 11.5v4a.5.5 0 01-1 0v-4a.5.5 0 00-.5-.5h-4a.5.5 0 01-.5-.5zm10 1a1.5 1.5 0 011.5-1.5h4a.5.5 0 010 1h-4a.5.5 0 00-.5.5v4a.5.5 0 01-1 0v-4z" }) });
|
|
5023
5073
|
}
|
|
5024
5074
|
|
|
5025
5075
|
// src/icon/FullscreenIcon.tsx
|
|
5026
5076
|
var import_react_native_svg14 = __toESM(require("react-native-svg"));
|
|
5027
5077
|
var import_react_native_theming16 = require("@storybook/react-native-theming");
|
|
5078
|
+
var import_react25 = require("react");
|
|
5028
5079
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5029
5080
|
function FullscreenIcon({ color, width = 14, height = 14, ...props }) {
|
|
5030
5081
|
const theme = (0, import_react_native_theming16.useTheme)();
|
|
5082
|
+
const fillColor = (0, import_react25.useMemo)(() => {
|
|
5083
|
+
return color ?? theme.color.defaultText;
|
|
5084
|
+
}, [color, theme.color.defaultText]);
|
|
5031
5085
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_native_svg14.default, { width, height, viewBox: "0 0 14 14", fill: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5032
5086
|
import_react_native_svg14.Path,
|
|
5033
5087
|
{
|
|
5034
5088
|
d: "M1.5 1h2a.5.5 0 010 1h-.793l3.147 3.146a.5.5 0 11-.708.708L2 2.707V3.5a.5.5 0 01-1 0v-2a.5.5 0 01.5-.5zm8.5.5a.5.5 0 01.5-.5h2a.5.5 0 01.5.5v2a.5.5 0 01-1 0v-.793L8.854 5.854a.5.5 0 11-.708-.708L11.293 2H10.5a.5.5 0 01-.5-.5zm2.5 8.5a.5.5 0 01.5.5v2a.5.5 0 01-.5.5h-2a.5.5 0 010-1h.793L8.146 8.854a.5.5 0 11.708-.708L12 11.293V10.5a.5.5 0 01.5-.5zM2 11.293V10.5a.5.5 0 00-1 0v2a.5.5 0 00.5.5h2a.5.5 0 000-1h-.793l3.147-3.146a.5.5 0 10-.708-.708L2 11.293z",
|
|
5035
|
-
fill:
|
|
5089
|
+
fill: fillColor
|
|
5036
5090
|
}
|
|
5037
5091
|
) });
|
|
5038
5092
|
}
|
|
@@ -5057,14 +5111,36 @@ var MenuIcon = ({
|
|
|
5057
5111
|
|
|
5058
5112
|
// src/Layout.tsx
|
|
5059
5113
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5114
|
+
var desktopLogoContainer = {
|
|
5115
|
+
flexDirection: "row",
|
|
5116
|
+
alignItems: "center",
|
|
5117
|
+
paddingTop: 10,
|
|
5118
|
+
paddingLeft: 16,
|
|
5119
|
+
paddingBottom: 4,
|
|
5120
|
+
paddingRight: 10,
|
|
5121
|
+
justifyContent: "space-between"
|
|
5122
|
+
};
|
|
5123
|
+
var desktopContentContainerStyle = { flex: 1 };
|
|
5124
|
+
var desktopContentStyle = { flex: 1, overflow: "hidden" };
|
|
5125
|
+
var mobileContentStyle = { flex: 1, overflow: "hidden" };
|
|
5126
|
+
var placeholderObject = {};
|
|
5127
|
+
var placeholderArray = [];
|
|
5128
|
+
var iconFloatRightStyle = { marginLeft: "auto" };
|
|
5129
|
+
var navButtonStyle = { flexShrink: 1 };
|
|
5130
|
+
var navButtonHitSlop = { bottom: 10, left: 10, right: 10, top: 10 };
|
|
5131
|
+
var mobileMenuDrawerContentStyle = {
|
|
5132
|
+
paddingLeft: 16,
|
|
5133
|
+
paddingTop: 4,
|
|
5134
|
+
paddingBottom: 4
|
|
5135
|
+
};
|
|
5060
5136
|
var Layout = ({
|
|
5061
5137
|
storyHash,
|
|
5062
5138
|
story,
|
|
5063
5139
|
children
|
|
5064
5140
|
}) => {
|
|
5065
5141
|
const theme = (0, import_react_native_theming17.useTheme)();
|
|
5066
|
-
const mobileMenuDrawerRef = (0,
|
|
5067
|
-
const addonPanelRef = (0,
|
|
5142
|
+
const mobileMenuDrawerRef = (0, import_react26.useRef)(null);
|
|
5143
|
+
const addonPanelRef = (0, import_react26.useRef)(null);
|
|
5068
5144
|
const insets = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
|
|
5069
5145
|
const { isDesktop } = useLayout();
|
|
5070
5146
|
const [desktopSidebarOpen, setDesktopSidebarOpen] = useStoreBooleanState(
|
|
@@ -5075,184 +5151,182 @@ var Layout = ({
|
|
|
5075
5151
|
"desktopPanelState",
|
|
5076
5152
|
true
|
|
5077
5153
|
);
|
|
5078
|
-
const [uiHidden, setUiHidden] = (0,
|
|
5154
|
+
const [uiHidden, setUiHidden] = (0, import_react26.useState)(false);
|
|
5155
|
+
const desktopContainerStyle = useStyle(
|
|
5156
|
+
() => ({
|
|
5157
|
+
flex: 1,
|
|
5158
|
+
paddingTop: insets.top,
|
|
5159
|
+
backgroundColor: theme.background.content,
|
|
5160
|
+
flexDirection: "row"
|
|
5161
|
+
}),
|
|
5162
|
+
[theme.background.content, insets.top]
|
|
5163
|
+
);
|
|
5164
|
+
const desktopSidebarStyle = useStyle(
|
|
5165
|
+
() => ({
|
|
5166
|
+
width: desktopSidebarOpen ? 240 : void 0,
|
|
5167
|
+
padding: desktopSidebarOpen ? 0 : 10,
|
|
5168
|
+
borderColor: theme.appBorderColor,
|
|
5169
|
+
borderRightWidth: 1
|
|
5170
|
+
}),
|
|
5171
|
+
[desktopSidebarOpen, theme.appBorderColor]
|
|
5172
|
+
);
|
|
5173
|
+
const desktopScrollViewContentContainerStyle = useStyle(
|
|
5174
|
+
() => ({
|
|
5175
|
+
paddingBottom: insets.bottom
|
|
5176
|
+
}),
|
|
5177
|
+
[insets.bottom]
|
|
5178
|
+
);
|
|
5179
|
+
const desktopAddonsPanelStyle = useStyle(
|
|
5180
|
+
() => ({
|
|
5181
|
+
height: desktopAddonsPanelOpen ? 300 : void 0,
|
|
5182
|
+
borderTopWidth: 1,
|
|
5183
|
+
borderColor: theme.appBorderColor,
|
|
5184
|
+
paddingTop: desktopAddonsPanelOpen ? 4 : 0,
|
|
5185
|
+
padding: desktopAddonsPanelOpen ? 0 : 10
|
|
5186
|
+
}),
|
|
5187
|
+
[desktopAddonsPanelOpen, theme.appBorderColor]
|
|
5188
|
+
);
|
|
5189
|
+
const mobileContainerStyle = useStyle(
|
|
5190
|
+
() => ({
|
|
5191
|
+
flex: 1,
|
|
5192
|
+
paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top,
|
|
5193
|
+
backgroundColor: theme.background.content
|
|
5194
|
+
}),
|
|
5195
|
+
[theme.background.content, insets.top, story?.parameters?.noSafeArea]
|
|
5196
|
+
);
|
|
5197
|
+
const fullScreenButtonStyle = useStyle(
|
|
5198
|
+
() => ({
|
|
5199
|
+
position: "absolute",
|
|
5200
|
+
bottom: uiHidden ? 56 + insets.bottom : 16,
|
|
5201
|
+
right: 16,
|
|
5202
|
+
backgroundColor: theme.background.content,
|
|
5203
|
+
padding: 4,
|
|
5204
|
+
borderRadius: 4,
|
|
5205
|
+
borderWidth: 1,
|
|
5206
|
+
borderColor: theme.appBorderColor
|
|
5207
|
+
}),
|
|
5208
|
+
[uiHidden, insets.bottom, theme.background.content, theme.appBorderColor]
|
|
5209
|
+
);
|
|
5210
|
+
const containerStyle = useStyle(
|
|
5211
|
+
() => ({
|
|
5212
|
+
marginBottom: insets.bottom
|
|
5213
|
+
}),
|
|
5214
|
+
[insets.bottom]
|
|
5215
|
+
);
|
|
5216
|
+
const navButtonTextStyle = useStyle(
|
|
5217
|
+
() => ({
|
|
5218
|
+
flexShrink: 1,
|
|
5219
|
+
color: theme.color.defaultText
|
|
5220
|
+
}),
|
|
5221
|
+
[theme.color.defaultText]
|
|
5222
|
+
);
|
|
5223
|
+
const openMobileMenu = (0, import_react26.useCallback)(() => {
|
|
5224
|
+
mobileMenuDrawerRef.current.setMobileMenuOpen(true);
|
|
5225
|
+
}, [mobileMenuDrawerRef]);
|
|
5226
|
+
const setSelection = (0, import_react26.useCallback)(({ storyId: newStoryId }) => {
|
|
5227
|
+
const channel = import_manager_api2.addons.getChannel();
|
|
5228
|
+
channel.emit(import_core_events.SET_CURRENT_STORY, { storyId: newStoryId });
|
|
5229
|
+
}, []);
|
|
5079
5230
|
if (isDesktop) {
|
|
5080
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5081
|
-
import_react_native9.View,
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
import_react_native9.View,
|
|
5092
|
-
{
|
|
5093
|
-
style: {
|
|
5094
|
-
width: desktopSidebarOpen ? 240 : void 0,
|
|
5095
|
-
padding: desktopSidebarOpen ? 0 : 10,
|
|
5096
|
-
borderColor: theme.appBorderColor,
|
|
5097
|
-
borderRightWidth: 1
|
|
5098
|
-
},
|
|
5099
|
-
children: desktopSidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5100
|
-
import_react_native9.ScrollView,
|
|
5101
|
-
{
|
|
5102
|
-
keyboardShouldPersistTaps: "handled",
|
|
5103
|
-
contentContainerStyle: {
|
|
5104
|
-
paddingBottom: insets.bottom
|
|
5105
|
-
},
|
|
5106
|
-
children: [
|
|
5107
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5108
|
-
import_react_native9.View,
|
|
5109
|
-
{
|
|
5110
|
-
style: {
|
|
5111
|
-
flexDirection: "row",
|
|
5112
|
-
alignItems: "center",
|
|
5113
|
-
paddingTop: 10,
|
|
5114
|
-
paddingLeft: 16,
|
|
5115
|
-
paddingBottom: 4,
|
|
5116
|
-
paddingRight: 10,
|
|
5117
|
-
justifyContent: "space-between"
|
|
5118
|
-
},
|
|
5119
|
-
children: [
|
|
5120
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(StorybookLogo, { theme }),
|
|
5121
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IconButton, { onPress: () => setDesktopSidebarOpen(false), Icon: MenuIcon })
|
|
5122
|
-
]
|
|
5123
|
-
}
|
|
5124
|
-
),
|
|
5125
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5126
|
-
Sidebar,
|
|
5127
|
-
{
|
|
5128
|
-
extra: [],
|
|
5129
|
-
previewInitialized: true,
|
|
5130
|
-
indexError: void 0,
|
|
5131
|
-
refs: {},
|
|
5132
|
-
setSelection: ({ storyId: newStoryId }) => {
|
|
5133
|
-
const channel = import_manager_api2.addons.getChannel();
|
|
5134
|
-
channel.emit(import_core_events.SET_CURRENT_STORY, { storyId: newStoryId });
|
|
5135
|
-
},
|
|
5136
|
-
status: {},
|
|
5137
|
-
index: storyHash,
|
|
5138
|
-
storyId: story?.id,
|
|
5139
|
-
refId: DEFAULT_REF_ID
|
|
5140
|
-
}
|
|
5141
|
-
)
|
|
5142
|
-
]
|
|
5143
|
-
}
|
|
5144
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IconButton, { onPress: () => setDesktopSidebarOpen(true), Icon: MenuIcon })
|
|
5145
|
-
}
|
|
5146
|
-
),
|
|
5147
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_native9.View, { style: { flex: 1 }, children: [
|
|
5148
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_native9.View, { style: { flex: 1, overflow: "hidden" }, children }),
|
|
5231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_native9.View, { style: desktopContainerStyle, children: [
|
|
5232
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_native9.View, { style: desktopSidebarStyle, children: desktopSidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5233
|
+
import_react_native9.ScrollView,
|
|
5234
|
+
{
|
|
5235
|
+
keyboardShouldPersistTaps: "handled",
|
|
5236
|
+
contentContainerStyle: desktopScrollViewContentContainerStyle,
|
|
5237
|
+
children: [
|
|
5238
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_native9.View, { style: desktopLogoContainer, children: [
|
|
5239
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(StorybookLogo, { theme }),
|
|
5240
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IconButton, { onPress: () => setDesktopSidebarOpen(false), Icon: MenuIcon })
|
|
5241
|
+
] }),
|
|
5149
5242
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5150
|
-
|
|
5243
|
+
Sidebar,
|
|
5151
5244
|
{
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
{
|
|
5162
|
-
style: { marginLeft: "auto" },
|
|
5163
|
-
onPress: () => setDesktopAddonsPanelOpen(true),
|
|
5164
|
-
Icon: BottomBarToggleIcon
|
|
5165
|
-
}
|
|
5166
|
-
)
|
|
5245
|
+
extra: placeholderArray,
|
|
5246
|
+
previewInitialized: true,
|
|
5247
|
+
indexError: void 0,
|
|
5248
|
+
refs: placeholderObject,
|
|
5249
|
+
setSelection,
|
|
5250
|
+
status: placeholderObject,
|
|
5251
|
+
index: storyHash,
|
|
5252
|
+
storyId: story?.id,
|
|
5253
|
+
refId: DEFAULT_REF_ID
|
|
5167
5254
|
}
|
|
5168
5255
|
)
|
|
5169
|
-
]
|
|
5170
|
-
|
|
5171
|
-
}
|
|
5172
|
-
|
|
5256
|
+
]
|
|
5257
|
+
}
|
|
5258
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IconButton, { onPress: () => setDesktopSidebarOpen(true), Icon: MenuIcon }) }),
|
|
5259
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_native9.View, { style: desktopContentContainerStyle, children: [
|
|
5260
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_native9.View, { style: desktopContentStyle, children }),
|
|
5261
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_native9.View, { style: desktopAddonsPanelStyle, children: desktopAddonsPanelOpen ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonsTabs, { storyId: story?.id, onClose: () => setDesktopAddonsPanelOpen(false) }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5262
|
+
IconButton,
|
|
5263
|
+
{
|
|
5264
|
+
style: iconFloatRightStyle,
|
|
5265
|
+
onPress: () => setDesktopAddonsPanelOpen(true),
|
|
5266
|
+
Icon: BottomBarToggleIcon
|
|
5267
|
+
}
|
|
5268
|
+
) })
|
|
5269
|
+
] })
|
|
5270
|
+
] });
|
|
5173
5271
|
}
|
|
5174
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5175
|
-
import_react_native9.View,
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
}
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(MobileMenuDrawer, { ref: mobileMenuDrawerRef, children: [
|
|
5233
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_native9.View, { style: { paddingLeft: 16, paddingTop: 4, paddingBottom: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(StorybookLogo, { theme }) }),
|
|
5234
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5235
|
-
Sidebar,
|
|
5236
|
-
{
|
|
5237
|
-
extra: [],
|
|
5238
|
-
previewInitialized: true,
|
|
5239
|
-
indexError: void 0,
|
|
5240
|
-
refs: {},
|
|
5241
|
-
setSelection: ({ storyId: newStoryId }) => {
|
|
5242
|
-
const channel = import_manager_api2.addons.getChannel();
|
|
5243
|
-
channel.emit(import_core_events.SET_CURRENT_STORY, { storyId: newStoryId });
|
|
5244
|
-
},
|
|
5245
|
-
status: {},
|
|
5246
|
-
index: storyHash,
|
|
5247
|
-
storyId: story?.id,
|
|
5248
|
-
refId: DEFAULT_REF_ID
|
|
5249
|
-
}
|
|
5250
|
-
)
|
|
5251
|
-
] }),
|
|
5252
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MobileAddonsPanel, { ref: addonPanelRef, storyId: story?.id })
|
|
5253
|
-
]
|
|
5254
|
-
}
|
|
5255
|
-
);
|
|
5272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_native9.View, { style: mobileContainerStyle, children: [
|
|
5273
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_native9.View, { style: mobileContentStyle, children: [
|
|
5274
|
+
children,
|
|
5275
|
+
story?.parameters?.hideFullScreenButton ? null : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5276
|
+
import_react_native9.TouchableOpacity,
|
|
5277
|
+
{
|
|
5278
|
+
style: fullScreenButtonStyle,
|
|
5279
|
+
onPress: () => setUiHidden((prev) => !prev),
|
|
5280
|
+
children: uiHidden ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CloseFullscreenIcon, { color: theme.color.mediumdark }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FullscreenIcon, { color: theme.color.mediumdark })
|
|
5281
|
+
}
|
|
5282
|
+
)
|
|
5283
|
+
] }),
|
|
5284
|
+
!uiHidden ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Container3, { style: containerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Nav, { children: [
|
|
5285
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5286
|
+
Button2,
|
|
5287
|
+
{
|
|
5288
|
+
testID: "mobile-menu-button",
|
|
5289
|
+
style: navButtonStyle,
|
|
5290
|
+
hitSlop: navButtonHitSlop,
|
|
5291
|
+
onPress: openMobileMenu,
|
|
5292
|
+
children: [
|
|
5293
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MenuIcon, { color: theme.color.mediumdark }),
|
|
5294
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_native9.Text, { style: navButtonTextStyle, numberOfLines: 1, children: [
|
|
5295
|
+
story?.title,
|
|
5296
|
+
"/",
|
|
5297
|
+
story?.name
|
|
5298
|
+
] })
|
|
5299
|
+
]
|
|
5300
|
+
}
|
|
5301
|
+
),
|
|
5302
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5303
|
+
IconButton,
|
|
5304
|
+
{
|
|
5305
|
+
testID: "mobile-addons-button",
|
|
5306
|
+
onPress: () => addonPanelRef.current.setAddonsPanelOpen(true),
|
|
5307
|
+
Icon: BottomBarToggleIcon
|
|
5308
|
+
}
|
|
5309
|
+
)
|
|
5310
|
+
] }) }) : null,
|
|
5311
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(MobileMenuDrawer, { ref: mobileMenuDrawerRef, children: [
|
|
5312
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_native9.View, { style: mobileMenuDrawerContentStyle, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(StorybookLogo, { theme }) }),
|
|
5313
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5314
|
+
Sidebar,
|
|
5315
|
+
{
|
|
5316
|
+
extra: placeholderArray,
|
|
5317
|
+
previewInitialized: true,
|
|
5318
|
+
indexError: void 0,
|
|
5319
|
+
refs: placeholderObject,
|
|
5320
|
+
setSelection,
|
|
5321
|
+
status: placeholderObject,
|
|
5322
|
+
index: storyHash,
|
|
5323
|
+
storyId: story?.id,
|
|
5324
|
+
refId: DEFAULT_REF_ID
|
|
5325
|
+
}
|
|
5326
|
+
)
|
|
5327
|
+
] }),
|
|
5328
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MobileAddonsPanel, { ref: addonPanelRef, storyId: story?.id })
|
|
5329
|
+
] });
|
|
5256
5330
|
};
|
|
5257
5331
|
var Nav = import_react_native_theming17.styled.View({
|
|
5258
5332
|
display: "flex",
|
|
@@ -5288,29 +5362,29 @@ var B = Object.getOwnPropertyDescriptor;
|
|
|
5288
5362
|
var F = Object.getOwnPropertyNames;
|
|
5289
5363
|
var h = Object.getPrototypeOf;
|
|
5290
5364
|
var w = Object.prototype.hasOwnProperty;
|
|
5291
|
-
var
|
|
5292
|
-
var
|
|
5365
|
+
var E = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
|
|
5366
|
+
var v = (r, e, n, t) => {
|
|
5293
5367
|
if (e && typeof e == "object" || typeof e == "function")
|
|
5294
5368
|
for (let a of F(e))
|
|
5295
5369
|
!w.call(r, a) && a !== n && u(r, a, { get: () => e[a], enumerable: !(t = B(e, a)) || t.enumerable });
|
|
5296
5370
|
return r;
|
|
5297
5371
|
};
|
|
5298
|
-
var I = (r, e, n) => (n = r != null ? C(h(r)) : {},
|
|
5299
|
-
var x =
|
|
5372
|
+
var I = (r, e, n) => (n = r != null ? C(h(r)) : {}, v(e || !r || !r.__esModule ? u(n, "default", { value: r, enumerable: true }) : n, r));
|
|
5373
|
+
var x = E((T) => {
|
|
5300
5374
|
Object.defineProperty(T, "__esModule", { value: true }), T.isEqual = function() {
|
|
5301
5375
|
var r = Object.prototype.toString, e = Object.getPrototypeOf, n = Object.getOwnPropertySymbols ? function(t) {
|
|
5302
5376
|
return Object.keys(t).concat(Object.getOwnPropertySymbols(t));
|
|
5303
5377
|
} : Object.keys;
|
|
5304
5378
|
return function(t, a) {
|
|
5305
5379
|
return function i(o, s, p) {
|
|
5306
|
-
var
|
|
5380
|
+
var g, y, d, c = r.call(o), b = r.call(s);
|
|
5307
5381
|
if (o === s)
|
|
5308
5382
|
return true;
|
|
5309
5383
|
if (o == null || s == null)
|
|
5310
5384
|
return false;
|
|
5311
5385
|
if (p.indexOf(o) > -1 && p.indexOf(s) > -1)
|
|
5312
5386
|
return true;
|
|
5313
|
-
if (p.push(o, s), c != b || (
|
|
5387
|
+
if (p.push(o, s), c != b || (g = n(o), y = n(s), g.length != y.length || g.some(function(A) {
|
|
5314
5388
|
return !i(o[A], s[A], p);
|
|
5315
5389
|
})))
|
|
5316
5390
|
return false;
|
|
@@ -5327,9 +5401,9 @@ var x = v((T) => {
|
|
|
5327
5401
|
return "" + o == "" + s;
|
|
5328
5402
|
case "Set":
|
|
5329
5403
|
case "Map":
|
|
5330
|
-
|
|
5404
|
+
g = o.entries(), y = s.entries();
|
|
5331
5405
|
do
|
|
5332
|
-
if (!i((d =
|
|
5406
|
+
if (!i((d = g.next()).value, y.next().value, p))
|
|
5333
5407
|
return false;
|
|
5334
5408
|
while (!d.done);
|
|
5335
5409
|
return true;
|