@storybook/react-native 6.5.5-alpha.0 → 6.5.5-alpha.1
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/hooks.d.ts +3 -4
- package/dist/hooks.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/preview/View.d.ts +2 -3
- package/dist/preview/View.js +7 -34
- package/dist/preview/components/OnDeviceUI/OnDeviceUI.d.ts +1 -1
- package/dist/preview/components/OnDeviceUI/OnDeviceUI.js +9 -24
- package/dist/preview/components/OnDeviceUI/Panel.d.ts +1 -1
- package/dist/preview/components/OnDeviceUI/Panel.js +2 -1
- package/dist/preview/components/OnDeviceUI/absolute-positioned-keyboard-aware-view.d.ts +1 -1
- package/dist/preview/components/OnDeviceUI/absolute-positioned-keyboard-aware-view.js +3 -3
- package/dist/preview/components/OnDeviceUI/addons/Addons.d.ts +1 -1
- package/dist/preview/components/OnDeviceUI/addons/Addons.js +4 -7
- package/dist/preview/components/OnDeviceUI/addons/AddonsSkeleton.js +7 -16
- package/dist/preview/components/OnDeviceUI/addons/List.d.ts +1 -1
- package/dist/preview/components/OnDeviceUI/addons/List.js +6 -5
- package/dist/preview/components/OnDeviceUI/addons/Wrapper.d.ts +1 -1
- package/dist/preview/components/OnDeviceUI/addons/Wrapper.js +3 -3
- package/dist/preview/components/OnDeviceUI/navigation/Navigation.d.ts +1 -1
- package/dist/preview/components/OnDeviceUI/navigation/Navigation.js +4 -8
- package/dist/preview/components/OnDeviceUI/navigation/NavigationBar.d.ts +1 -1
- package/dist/preview/components/OnDeviceUI/navigation/NavigationBar.js +2 -4
- package/dist/preview/components/OnDeviceUI/navigation/NavigationButton.d.ts +2 -3
- package/dist/preview/components/OnDeviceUI/navigation/NavigationButton.js +4 -10
- package/dist/preview/components/Shared/icons.d.ts +19 -4
- package/dist/preview/components/Shared/icons.js +9 -5
- package/dist/preview/components/Shared/layout.d.ts +15 -1
- package/dist/preview/components/Shared/layout.js +4 -24
- package/dist/preview/components/Shared/tabs.d.ts +2 -2
- package/dist/preview/components/Shared/tabs.js +6 -7
- package/dist/preview/components/StoryListView/StoryListView.d.ts +1 -1
- package/dist/preview/components/StoryListView/StoryListView.js +31 -44
- package/dist/preview/components/StoryView/StoryView.d.ts +1 -1
- package/dist/preview/components/StoryView/StoryView.js +3 -3
- package/dist/preview/start.js +2 -2
- package/package.json +6 -6
- package/dist/preview/components/Shared/theme.d.ts +0 -189
- package/dist/preview/components/Shared/theme.js +0 -321
package/dist/hooks.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { StoryContext } from '@storybook/csf';
|
|
2
|
-
import type { Theme } from './preview/components/Shared/theme';
|
|
3
2
|
import type { ReactNativeFramework } from './types/types-6.0';
|
|
4
3
|
import { StoryIndexEntry } from '@storybook/client-api';
|
|
5
4
|
/**
|
|
6
5
|
* Hook that returns a function to set the current story context.
|
|
7
6
|
*/
|
|
8
|
-
export declare function useSetStoryContext(): (args_0: StoryContext<ReactNativeFramework
|
|
7
|
+
export declare function useSetStoryContext(): (args_0: StoryContext<ReactNativeFramework> | ((prev: StoryContext<ReactNativeFramework>) => StoryContext<ReactNativeFramework>)) => void;
|
|
9
8
|
/**
|
|
10
9
|
* Hook to read the current story context.
|
|
11
10
|
*/
|
|
12
|
-
export declare function useStoryContext(): StoryContext<ReactNativeFramework
|
|
11
|
+
export declare function useStoryContext(): StoryContext<ReactNativeFramework>;
|
|
13
12
|
/**
|
|
14
13
|
* Hook that reads the value of a specific story context parameter.
|
|
15
14
|
*/
|
|
@@ -30,7 +29,7 @@ export declare function useUpdateOnStoryChanged(): void;
|
|
|
30
29
|
/**
|
|
31
30
|
* Hook that gets the current theme values.
|
|
32
31
|
*/
|
|
33
|
-
export declare function useTheme(): Theme;
|
|
32
|
+
export declare function useTheme(): import("@emotion/react").Theme;
|
|
34
33
|
/**
|
|
35
34
|
* A boolean atom creator for an atom that can only be toggled between
|
|
36
35
|
* true/false.
|
package/dist/hooks.js
CHANGED
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.useSelectedAddon = exports.syncExternalUI = exports.useIsSplitPanelVisible = exports.useIsUIVisible = exports.atomWithToggle = exports.useTheme = exports.useUpdateOnStoryChanged = exports.useIsChildSelected = exports.useIsStorySectionSelected = exports.useIsStorySelected = exports.useStoryContextParam = exports.useStoryContext = exports.useSetStoryContext = void 0;
|
|
27
27
|
var react_1 = __importStar(require("react"));
|
|
28
28
|
var jotai_1 = require("jotai");
|
|
29
|
-
var
|
|
29
|
+
var react_2 = require("@emotion/react");
|
|
30
30
|
var storyContextAtom = (0, jotai_1.atom)(null);
|
|
31
31
|
/**
|
|
32
32
|
* Hook that returns a function to set the current story context.
|
|
@@ -95,7 +95,7 @@ exports.useUpdateOnStoryChanged = useUpdateOnStoryChanged;
|
|
|
95
95
|
* Hook that gets the current theme values.
|
|
96
96
|
*/
|
|
97
97
|
function useTheme() {
|
|
98
|
-
return (0,
|
|
98
|
+
return (0, react_2.useTheme)();
|
|
99
99
|
}
|
|
100
100
|
exports.useTheme = useTheme;
|
|
101
101
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ export declare const clearDecorators: C['clearDecorators'];
|
|
|
16
16
|
export declare const getStorybook: C['getStorybook'];
|
|
17
17
|
export declare const raw: C['raw'];
|
|
18
18
|
export declare const storiesOf: (kind: string, _module: NodeModule) => StoryApi<ReactNode>;
|
|
19
|
-
export declare const getStorybookUI: (params?: Partial<import("./preview/View").Params>) => () => JSX.Element;
|
|
19
|
+
export declare const getStorybookUI: (params?: Partial<import("./preview/View").Params>) => () => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export * from './types/types-6.0';
|
|
21
|
-
export { theme, darkTheme } from '
|
|
21
|
+
export { theme, darkTheme, Theme } from '@storybook/react-native-theming';
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,6 @@ __exportStar(require("./types/types-6.0"), exports);
|
|
|
40
40
|
global.__STORYBOOK_STORY_STORE__ = {
|
|
41
41
|
initializationPromise: (_a = clientApi.storyStore) === null || _a === void 0 ? void 0 : _a.initializationPromise,
|
|
42
42
|
};
|
|
43
|
-
var
|
|
44
|
-
Object.defineProperty(exports, "theme", { enumerable: true, get: function () { return
|
|
45
|
-
Object.defineProperty(exports, "darkTheme", { enumerable: true, get: function () { return
|
|
43
|
+
var react_native_theming_1 = require("@storybook/react-native-theming");
|
|
44
|
+
Object.defineProperty(exports, "theme", { enumerable: true, get: function () { return react_native_theming_1.theme; } });
|
|
45
|
+
Object.defineProperty(exports, "darkTheme", { enumerable: true, get: function () { return react_native_theming_1.darkTheme; } });
|
package/dist/preview/View.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { StoryIndex, SelectionSpecifier } from '@storybook/store';
|
|
3
2
|
import { StoryContext } from '@storybook/csf';
|
|
4
|
-
import { Theme } from '
|
|
3
|
+
import { Theme } from '@storybook/react-native-theming';
|
|
5
4
|
import type { ReactNativeFramework } from '../types/types-6.0';
|
|
6
5
|
import { PreviewWeb } from '@storybook/preview-web';
|
|
7
6
|
type StoryKind = string;
|
|
@@ -46,6 +45,6 @@ export declare class View {
|
|
|
46
45
|
constructor(preview: PreviewWeb<ReactNativeFramework>);
|
|
47
46
|
_getInitialStory: ({ initialSelection, shouldPersistSelection, }?: Partial<Params>) => Promise<SelectionSpecifier>;
|
|
48
47
|
_getServerChannel: (params?: Partial<Params>) => import("@storybook/channels").Channel;
|
|
49
|
-
getStorybookUI: (params?: Partial<Params>) => () => JSX.Element;
|
|
48
|
+
getStorybookUI: (params?: Partial<Params>) => () => import("react/jsx-runtime").JSX.Element;
|
|
50
49
|
}
|
|
51
50
|
export {};
|
package/dist/preview/View.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -63,15 +40,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
63
40
|
};
|
|
64
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
42
|
exports.View = void 0;
|
|
66
|
-
var
|
|
43
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
44
|
+
var react_1 = require("react");
|
|
67
45
|
var async_storage_1 = __importDefault(require("@react-native-async-storage/async-storage"));
|
|
68
46
|
var csf_1 = require("@storybook/csf");
|
|
69
47
|
var addons_1 = require("@storybook/addons");
|
|
70
|
-
var
|
|
48
|
+
var react_2 = require("@emotion/react");
|
|
71
49
|
var react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
72
50
|
var hooks_1 = require("../hooks");
|
|
73
51
|
var OnDeviceUI_1 = __importDefault(require("./components/OnDeviceUI"));
|
|
74
|
-
var
|
|
52
|
+
var react_native_theming_1 = require("@storybook/react-native-theming");
|
|
75
53
|
var StoryView_1 = __importDefault(require("./components/StoryView"));
|
|
76
54
|
var channel_websocket_1 = __importDefault(require("@storybook/channel-websocket"));
|
|
77
55
|
var rn_host_detect_1 = __importDefault(require("./rn-host-detect"));
|
|
@@ -173,10 +151,7 @@ var View = /** @class */ (function () {
|
|
|
173
151
|
var setContext = (0, hooks_1.useSetStoryContext)();
|
|
174
152
|
var colorScheme = (0, react_native_1.useColorScheme)();
|
|
175
153
|
var _a = (0, react_1.useReducer)(function (x) { return x + 1; }, 0), forceUpdate = _a[1];
|
|
176
|
-
var appliedTheme = (0, react_1.useMemo)(function () {
|
|
177
|
-
var _a;
|
|
178
|
-
return (0, deepmerge_1.default)(colorScheme === 'dark' ? theme_1.darkTheme : theme_1.theme, (_a = params.theme) !== null && _a !== void 0 ? _a : {});
|
|
179
|
-
}, [colorScheme]);
|
|
154
|
+
var appliedTheme = (0, react_1.useMemo)(function () { var _a; return (0, deepmerge_1.default)(colorScheme === 'dark' ? react_native_theming_1.darkTheme : react_native_theming_1.theme, (_a = params.theme) !== null && _a !== void 0 ? _a : {}); }, [colorScheme]);
|
|
180
155
|
(0, react_1.useEffect)(function () {
|
|
181
156
|
self._setStory = function (newStory) {
|
|
182
157
|
setContext(newStory);
|
|
@@ -194,12 +169,10 @@ var View = /** @class */ (function () {
|
|
|
194
169
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
195
170
|
}, []);
|
|
196
171
|
if (onDeviceUI) {
|
|
197
|
-
return (
|
|
198
|
-
react_1.default.createElement(emotion_theming_1.ThemeProvider, { theme: appliedTheme },
|
|
199
|
-
react_1.default.createElement(OnDeviceUI_1.default, { storyIndex: self._storyIndex, tabOpen: params.tabOpen, shouldDisableKeyboardAvoidingView: params.shouldDisableKeyboardAvoidingView, keyboardAvoidingViewVerticalOffset: params.keyboardAvoidingViewVerticalOffset }))));
|
|
172
|
+
return ((0, jsx_runtime_1.jsx)(react_native_safe_area_context_1.SafeAreaProvider, { children: (0, jsx_runtime_1.jsx)(react_2.ThemeProvider, { theme: appliedTheme, children: (0, jsx_runtime_1.jsx)(OnDeviceUI_1.default, { storyIndex: self._storyIndex, tabOpen: params.tabOpen, shouldDisableKeyboardAvoidingView: params.shouldDisableKeyboardAvoidingView, keyboardAvoidingViewVerticalOffset: params.keyboardAvoidingViewVerticalOffset }) }) }));
|
|
200
173
|
}
|
|
201
174
|
else {
|
|
202
|
-
return
|
|
175
|
+
return (0, jsx_runtime_1.jsx)(StoryView_1.default, {});
|
|
203
176
|
}
|
|
204
177
|
};
|
|
205
178
|
};
|
|
@@ -8,5 +8,5 @@ interface OnDeviceUIProps {
|
|
|
8
8
|
shouldDisableKeyboardAvoidingView?: boolean;
|
|
9
9
|
keyboardAvoidingViewVerticalOffset?: number;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: React.MemoExoticComponent<({ storyIndex, shouldDisableKeyboardAvoidingView, keyboardAvoidingViewVerticalOffset, tabOpen: initialTabOpen, }: OnDeviceUIProps) => JSX.Element>;
|
|
11
|
+
declare const _default: React.MemoExoticComponent<({ storyIndex, shouldDisableKeyboardAvoidingView, keyboardAvoidingViewVerticalOffset, tabOpen: initialTabOpen, }: OnDeviceUIProps) => import("react/jsx-runtime").JSX.Element>;
|
|
12
12
|
export default _default;
|
|
@@ -38,6 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.IS_EXPO = void 0;
|
|
41
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
42
|
var native_1 = __importDefault(require("@emotion/native"));
|
|
42
43
|
var react_1 = __importStar(require("react"));
|
|
43
44
|
var react_native_1 = require("react-native");
|
|
@@ -68,8 +69,7 @@ function Preview(_a) {
|
|
|
68
69
|
var animatedValue = _a.animatedValue, style = _a.style, children = _a.children;
|
|
69
70
|
var theme = (0, hooks_1.useTheme)();
|
|
70
71
|
var containerStyle = __assign({ backgroundColor: theme.preview.backgroundColor }, (0, animation_1.getPreviewShadowStyle)(animatedValue));
|
|
71
|
-
return (
|
|
72
|
-
react_1.default.createElement(react_native_1.View, { style: [flex, style] }, children)));
|
|
72
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [flex, containerStyle], children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [flex, style], children: children }) }));
|
|
73
73
|
}
|
|
74
74
|
var styles = react_native_1.StyleSheet.create({
|
|
75
75
|
expoAndroidContainer: { paddingTop: react_native_1.StatusBar.currentHeight },
|
|
@@ -152,27 +152,12 @@ var OnDeviceUI = function (_a) {
|
|
|
152
152
|
var keyboardVerticalOffset = -panelSafeAreaMargins.paddingBottom + (keyboardAvoidingViewVerticalOffset !== null && keyboardAvoidingViewVerticalOffset !== void 0 ? keyboardAvoidingViewVerticalOffset : 0);
|
|
153
153
|
var isSplitPanelVisible = (0, hooks_1.useIsSplitPanelVisible)()[0];
|
|
154
154
|
var isPreviewInactive = tabOpen !== constants_2.CANVAS;
|
|
155
|
-
return (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
isSplitPanelVisible ? (react_1.default.createElement(Panel_1.default, { edge: "top", style: { flex: 1 } },
|
|
163
|
-
react_1.default.createElement(Addons_1.default, { active: true }),
|
|
164
|
-
react_1.default.createElement(AddonsSkeleton_1.AddonsSkeleton, { visible: isPreviewInactive }))) : null),
|
|
165
|
-
isPreviewInactive ? (react_1.default.createElement(react_native_1.TouchableOpacity, { style: react_native_1.StyleSheet.absoluteFillObject, onPress: function () { return handleToggleTab(constants_2.CANVAS); } })) : null),
|
|
166
|
-
react_1.default.createElement(Panel_1.default, { edge: "right", style: [
|
|
167
|
-
(0, animation_1.getSidebarPanelPosition)(animatedValue.current, previewDimensions.width, wide),
|
|
168
|
-
panelSafeAreaMargins,
|
|
169
|
-
] },
|
|
170
|
-
react_1.default.createElement(StoryListView_1.default, { storyIndex: storyIndex })),
|
|
171
|
-
react_1.default.createElement(Panel_1.default, { edge: "left", style: [
|
|
172
|
-
(0, animation_1.getAddonPanelPosition)(animatedValue.current, previewDimensions.width, wide),
|
|
173
|
-
panelSafeAreaMargins,
|
|
174
|
-
] },
|
|
175
|
-
react_1.default.createElement(Addons_1.default, { active: tabOpen === constants_2.ADDONS })))),
|
|
176
|
-
react_1.default.createElement(navigation_1.default, { onLayout: measureNavigation, tabOpen: tabOpen, onChangeTab: handleToggleTab }))));
|
|
155
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(Container, { children: [(0, jsx_runtime_1.jsx)(react_native_1.KeyboardAvoidingView, { enabled: !shouldDisableKeyboardAvoidingView || isPreviewInactive, behavior: IS_IOS ? 'padding' : null, keyboardVerticalOffset: keyboardVerticalOffset, style: flex, children: (0, jsx_runtime_1.jsxs)(absolute_positioned_keyboard_aware_view_1.default, { onLayout: setPreviewDimensions, previewDimensions: previewDimensions, children: [(0, jsx_runtime_1.jsxs)(react_native_1.Animated.View, { style: previewWrapperStyles, children: [(0, jsx_runtime_1.jsxs)(Preview, { style: safeAreaMargins, animatedValue: animatedValue.current, children: [(0, jsx_runtime_1.jsx)(StoryView_1.default, {}), isSplitPanelVisible ? ((0, jsx_runtime_1.jsxs)(Panel_1.default, { edge: "top", style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)(Addons_1.default, { active: true }), (0, jsx_runtime_1.jsx)(AddonsSkeleton_1.AddonsSkeleton, { visible: isPreviewInactive })] })) : null] }), isPreviewInactive ? ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: react_native_1.StyleSheet.absoluteFillObject, onPress: function () { return handleToggleTab(constants_2.CANVAS); } })) : null] }), (0, jsx_runtime_1.jsx)(Panel_1.default, { edge: "right", style: [
|
|
156
|
+
(0, animation_1.getSidebarPanelPosition)(animatedValue.current, previewDimensions.width, wide),
|
|
157
|
+
panelSafeAreaMargins,
|
|
158
|
+
], children: (0, jsx_runtime_1.jsx)(StoryListView_1.default, { storyIndex: storyIndex }) }), (0, jsx_runtime_1.jsx)(Panel_1.default, { edge: "left", style: [
|
|
159
|
+
(0, animation_1.getAddonPanelPosition)(animatedValue.current, previewDimensions.width, wide),
|
|
160
|
+
panelSafeAreaMargins,
|
|
161
|
+
], children: (0, jsx_runtime_1.jsx)(Addons_1.default, { active: tabOpen === constants_2.ADDONS }) })] }) }), (0, jsx_runtime_1.jsx)(navigation_1.default, { onLayout: measureNavigation, tabOpen: tabOpen, onChangeTab: handleToggleTab })] }) }));
|
|
177
162
|
};
|
|
178
163
|
exports.default = react_1.default.memo(OnDeviceUI);
|
|
@@ -5,5 +5,5 @@ interface PanelProps {
|
|
|
5
5
|
style: StyleProp<Animated.AnimatedProps<ViewStyle>>;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ edge, children, style }: PanelProps) => JSX.Element>;
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ edge, children, style }: PanelProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
9
|
export default _default;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
var react_1 = __importDefault(require("react"));
|
|
7
8
|
var react_native_1 = require("react-native");
|
|
8
9
|
var native_1 = __importDefault(require("@emotion/native"));
|
|
@@ -22,6 +23,6 @@ var Panel = function (_a) {
|
|
|
22
23
|
edge === 'top' ? undefined : react_native_1.StyleSheet.absoluteFillObject,
|
|
23
24
|
style,
|
|
24
25
|
]);
|
|
25
|
-
return (
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(Container, { edge: edge, style: containerStyle, children: children }));
|
|
26
27
|
};
|
|
27
28
|
exports.default = react_1.default.memo(Panel);
|
|
@@ -8,5 +8,5 @@ type Props = {
|
|
|
8
8
|
previewDimensions: PreviewDimens;
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
};
|
|
11
|
-
declare const _default: React.MemoExoticComponent<({ onLayout, previewDimensions: { width, height }, children, }: Props) => JSX.Element>;
|
|
11
|
+
declare const _default: React.MemoExoticComponent<({ onLayout, previewDimensions: { width, height }, children, }: Props) => import("react/jsx-runtime").JSX.Element>;
|
|
12
12
|
export default _default;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
var react_1 = __importDefault(require("react"));
|
|
7
8
|
var react_native_1 = require("react-native");
|
|
8
9
|
// Android changes screen size when keyboard opens.
|
|
@@ -19,10 +20,9 @@ var AbsolutePositionedKeyboardAwareView = function (_a) {
|
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
|
-
return (
|
|
23
|
-
react_1.default.createElement(react_native_1.View, { style: width === 0
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.container, onLayout: onLayoutHandler, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: width === 0
|
|
24
24
|
? styles.container
|
|
25
|
-
: [styles.absolute, { position: 'absolute', width: width, height: height }]
|
|
25
|
+
: [styles.absolute, { position: 'absolute', width: width, height: height }], children: children }) }));
|
|
26
26
|
};
|
|
27
27
|
var styles = react_native_1.StyleSheet.create({
|
|
28
28
|
absolute: { position: 'absolute' },
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
interface AddonsProps {
|
|
3
3
|
active: boolean;
|
|
4
4
|
}
|
|
5
|
-
declare const _default: React.MemoExoticComponent<({ active }: AddonsProps) => JSX.Element>;
|
|
5
|
+
declare const _default: React.MemoExoticComponent<({ active }: AddonsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
6
6
|
export default _default;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
var react_1 = __importDefault(require("react"));
|
|
7
8
|
var addons_1 = require("@storybook/addons");
|
|
8
9
|
var hooks_1 = require("../../../../hooks");
|
|
@@ -23,15 +24,11 @@ var Addons = function (_a) {
|
|
|
23
24
|
var context = (0, hooks_1.useStoryContext)();
|
|
24
25
|
var id = context === null || context === void 0 ? void 0 : context.id;
|
|
25
26
|
if (!id) {
|
|
26
|
-
return (
|
|
27
|
-
react_1.default.createElement(Text, null, "No Story Selected")));
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(layout_1.Box, { alignItems: "center", justifyContent: "center", children: (0, jsx_runtime_1.jsx)(Text, { children: "No Story Selected" }) }));
|
|
28
28
|
}
|
|
29
29
|
if (Object.keys(panels).length === 0) {
|
|
30
|
-
return (
|
|
31
|
-
react_1.default.createElement(Text, null, "No addons loaded.")));
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(layout_1.Box, { alignItems: "center", justifyContent: "center", children: (0, jsx_runtime_1.jsx)(Text, { children: "No addons loaded." }) }));
|
|
32
31
|
}
|
|
33
|
-
return (
|
|
34
|
-
react_1.default.createElement(List_1.default, { onPressAddon: setAddonSelected, panels: panels, addonSelected: active ? addonSelected : null }),
|
|
35
|
-
react_1.default.createElement(Wrapper_1.default, { addonSelected: active ? addonSelected : null, panels: panels })));
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(layout_1.Box, { flex: true, children: [(0, jsx_runtime_1.jsx)(List_1.default, { onPressAddon: setAddonSelected, panels: panels, addonSelected: active ? addonSelected : null }), (0, jsx_runtime_1.jsx)(Wrapper_1.default, { addonSelected: active ? addonSelected : null, panels: panels })] }));
|
|
36
33
|
};
|
|
37
34
|
exports.default = react_1.default.memo(Addons);
|
|
@@ -15,6 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.AddonsSkeleton = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
19
|
var react_1 = __importDefault(require("react"));
|
|
19
20
|
var native_1 = __importDefault(require("@emotion/native"));
|
|
20
21
|
var react_native_1 = require("react-native");
|
|
@@ -38,9 +39,7 @@ exports.AddonsSkeleton = react_1.default.memo(function AddonsSkeleton(_a) {
|
|
|
38
39
|
easing: react_native_1.Easing.inOut(react_native_1.Easing.cubic),
|
|
39
40
|
}).start();
|
|
40
41
|
}, [visible]);
|
|
41
|
-
return (
|
|
42
|
-
react_1.default.createElement(TabsSkeleton, null),
|
|
43
|
-
react_1.default.createElement(AddonsContentSkeleton, null)));
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(AddonsSkeletonContainer, { pointerEvents: "none", style: { opacity: progress.current }, children: [(0, jsx_runtime_1.jsx)(TabsSkeleton, {}), (0, jsx_runtime_1.jsx)(AddonsContentSkeleton, {})] }));
|
|
44
43
|
});
|
|
45
44
|
var TabSkeleton = native_1.default.View(function (_a) {
|
|
46
45
|
var theme = _a.theme, active = _a.active;
|
|
@@ -54,32 +53,24 @@ var TabSkeleton = native_1.default.View(function (_a) {
|
|
|
54
53
|
});
|
|
55
54
|
});
|
|
56
55
|
var BoxSkeleton = native_1.default.View(function (_a) {
|
|
57
|
-
var theme = _a.theme, width = _a.width, height = _a.height;
|
|
56
|
+
var theme = _a.theme, width = _a.width, height = _a.height, marginBottom = _a.marginBottom;
|
|
58
57
|
return ({
|
|
59
58
|
backgroundColor: theme.tokens.color.blue200,
|
|
60
59
|
borderRadius: theme.tokens.borderRadius.large,
|
|
61
60
|
height: height,
|
|
61
|
+
marginBottom: marginBottom,
|
|
62
62
|
width: width,
|
|
63
63
|
});
|
|
64
64
|
});
|
|
65
65
|
function AddonsFieldSkeleton(_a) {
|
|
66
66
|
var _b = _a.long, long = _b === void 0 ? false : _b;
|
|
67
|
-
return (
|
|
68
|
-
react_1.default.createElement(BoxSkeleton, { width: 75, height: 10, marginBottom: 12 }),
|
|
69
|
-
react_1.default.createElement(BoxSkeleton, { width: long ? 200 : 120, height: 15 })));
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { marginBottom: 32 }, children: [(0, jsx_runtime_1.jsx)(BoxSkeleton, { width: 75, height: 10, marginBottom: 12 }), (0, jsx_runtime_1.jsx)(BoxSkeleton, { width: long ? 200 : 120, height: 15 })] }));
|
|
70
68
|
}
|
|
71
69
|
function AddonsContentSkeleton() {
|
|
72
|
-
return (
|
|
73
|
-
react_1.default.createElement(AddonsFieldSkeleton, { long: true }),
|
|
74
|
-
react_1.default.createElement(AddonsFieldSkeleton, { long: true }),
|
|
75
|
-
react_1.default.createElement(AddonsFieldSkeleton, null),
|
|
76
|
-
react_1.default.createElement(AddonsFieldSkeleton, null)));
|
|
70
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AddonsFieldSkeleton, { long: true }), (0, jsx_runtime_1.jsx)(AddonsFieldSkeleton, { long: true }), (0, jsx_runtime_1.jsx)(AddonsFieldSkeleton, {}), (0, jsx_runtime_1.jsx)(AddonsFieldSkeleton, {})] }));
|
|
77
71
|
}
|
|
78
72
|
function TabsSkeleton() {
|
|
79
|
-
return (
|
|
80
|
-
react_1.default.createElement(TabSkeleton, null),
|
|
81
|
-
react_1.default.createElement(TabSkeleton, { active: true }),
|
|
82
|
-
react_1.default.createElement(TabSkeleton, null)));
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexDirection: 'row', marginBottom: 16 }, children: [(0, jsx_runtime_1.jsx)(TabSkeleton, {}), (0, jsx_runtime_1.jsx)(TabSkeleton, { active: true }), (0, jsx_runtime_1.jsx)(TabSkeleton, {})] }));
|
|
83
74
|
}
|
|
84
75
|
var AddonsSkeletonContainer = (0, native_1.default)(react_native_1.Animated.View)(function (_a) {
|
|
85
76
|
var theme = _a.theme;
|
|
@@ -5,5 +5,5 @@ export interface Props {
|
|
|
5
5
|
addonSelected: string;
|
|
6
6
|
onPressAddon: (id: string) => void;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ panels, addonSelected, onPressAddon }: Props) => JSX.Element>;
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ panels, addonSelected, onPressAddon }: Props) => import("react/jsx-runtime").JSX.Element>;
|
|
9
9
|
export default _default;
|
|
@@ -3,15 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
var react_1 = __importDefault(require("react"));
|
|
7
8
|
var tabs_1 = require("../../Shared/tabs");
|
|
8
9
|
var AddonList = function (_a) {
|
|
9
10
|
var panels = _a.panels, addonSelected = _a.addonSelected, onPressAddon = _a.onPressAddon;
|
|
10
11
|
var addonKeys = Object.keys(panels);
|
|
11
|
-
return (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(tabs_1.TabBar, { scrollable: true, children: addonKeys.map(function (id) {
|
|
13
|
+
var title = panels[id].title;
|
|
14
|
+
var resolvedTitle = typeof title === 'function' ? title() : title;
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(tabs_1.TabButton, { active: id === addonSelected, id: id, onPress: function () { return onPressAddon(id); }, children: resolvedTitle.toUpperCase() }, id));
|
|
16
|
+
}) }));
|
|
16
17
|
};
|
|
17
18
|
exports.default = react_1.default.memo(AddonList);
|
|
@@ -4,5 +4,5 @@ export interface Props {
|
|
|
4
4
|
panels: Collection;
|
|
5
5
|
addonSelected: string;
|
|
6
6
|
}
|
|
7
|
-
declare const _default: React.MemoExoticComponent<({ panels, addonSelected }: Props) => JSX.Element>;
|
|
7
|
+
declare const _default: React.MemoExoticComponent<({ panels, addonSelected }: Props) => import("react/jsx-runtime").JSX.Element>;
|
|
8
8
|
export default _default;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
var react_1 = __importDefault(require("react"));
|
|
7
8
|
var react_native_1 = require("react-native");
|
|
8
9
|
var native_1 = __importDefault(require("@emotion/native"));
|
|
@@ -23,9 +24,8 @@ var Wrapper = function (_a) {
|
|
|
23
24
|
var addonKeys = Object.keys(panels);
|
|
24
25
|
var content = addonKeys.map(function (id) {
|
|
25
26
|
var selected = addonSelected === id;
|
|
26
|
-
return (
|
|
27
|
-
react_1.default.createElement(react_native_1.ScrollView, { contentContainerStyle: { padding: theme.panel.paddingHorizontal } }, panels[id].render({ active: selected, key: id }))));
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(Container, { selected: selected, children: (0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { contentContainerStyle: { padding: theme.panel.paddingHorizontal }, children: panels[id].render({ active: selected, key: id }) }) }, id));
|
|
28
28
|
});
|
|
29
|
-
return
|
|
29
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: content });
|
|
30
30
|
};
|
|
31
31
|
exports.default = react_1.default.memo(Wrapper);
|
|
@@ -5,5 +5,5 @@ interface NavigationProps {
|
|
|
5
5
|
onChangeTab: (index: number) => void;
|
|
6
6
|
onLayout: ViewProps['onLayout'];
|
|
7
7
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ tabOpen, onChangeTab, onLayout }: NavigationProps) => JSX.Element>;
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ tabOpen, onChangeTab, onLayout }: NavigationProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
9
|
export default _default;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
var react_1 = __importDefault(require("react"));
|
|
7
8
|
var react_native_1 = require("react-native");
|
|
8
9
|
var react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
@@ -34,18 +35,13 @@ var Navigation = function (_a) {
|
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
37
|
var isUIVisible = (0, hooks_1.useIsUIVisible)()[0];
|
|
37
|
-
return (
|
|
38
|
-
react_1.default.createElement(react_native_1.View, null, isUIVisible && (react_1.default.createElement(react_native_swipe_gestures_1.default, { onSwipeLeft: handleSwipeLeft, onSwipeRight: handleSwipeRight, config: SWIPE_CONFIG },
|
|
39
|
-
react_1.default.createElement(NavigationBar_1.NavigationBar, { index: tabOpen, onPress: onChangeTab, style: { paddingBottom: insets.bottom } })))),
|
|
40
|
-
react_1.default.createElement(NavigationShortcuts, null,
|
|
41
|
-
react_1.default.createElement(NavigationButton_1.VisibilityButton, null),
|
|
42
|
-
react_1.default.createElement(NavigationButton_1.AddonsSplitButton, null))));
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: navStyle, onLayout: onLayout, children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { children: isUIVisible && ((0, jsx_runtime_1.jsx)(react_native_swipe_gestures_1.default, { onSwipeLeft: handleSwipeLeft, onSwipeRight: handleSwipeRight, config: SWIPE_CONFIG, children: (0, jsx_runtime_1.jsx)(NavigationBar_1.NavigationBar, { index: tabOpen, onPress: onChangeTab, style: { paddingBottom: insets.bottom } }) })) }), (0, jsx_runtime_1.jsxs)(NavigationShortcuts, { children: [(0, jsx_runtime_1.jsx)(NavigationButton_1.VisibilityButton, {}), (0, jsx_runtime_1.jsx)(NavigationButton_1.AddonsSplitButton, {})] })] }));
|
|
43
39
|
};
|
|
44
40
|
exports.default = react_1.default.memo(Navigation);
|
|
45
41
|
function NavigationShortcuts(_a) {
|
|
46
42
|
var children = _a.children;
|
|
47
43
|
var insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
48
|
-
return (
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
49
45
|
zIndex: 100,
|
|
50
46
|
alignSelf: 'center',
|
|
51
47
|
justifyContent: 'center',
|
|
@@ -54,5 +50,5 @@ function NavigationShortcuts(_a) {
|
|
|
54
50
|
position: 'absolute',
|
|
55
51
|
bottom: insets.bottom + 14,
|
|
56
52
|
right: 8,
|
|
57
|
-
}
|
|
53
|
+
}, children: children }));
|
|
58
54
|
}
|
|
@@ -5,4 +5,4 @@ export interface NavigationBarProps {
|
|
|
5
5
|
onPress: (id: number) => void;
|
|
6
6
|
style?: StyleProp<ViewStyle>;
|
|
7
7
|
}
|
|
8
|
-
export declare const NavigationBar: React.MemoExoticComponent<({ index, onPress, style }: NavigationBarProps) => JSX.Element>;
|
|
8
|
+
export declare const NavigationBar: React.MemoExoticComponent<({ index, onPress, style }: NavigationBarProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.NavigationBar = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
8
|
var react_1 = __importDefault(require("react"));
|
|
8
9
|
var native_1 = __importDefault(require("@emotion/native"));
|
|
9
10
|
var constants_1 = require("./constants");
|
|
@@ -19,8 +20,5 @@ var NavigationTabBar = (0, native_1.default)(tabs_1.TabBar)(function (_a) {
|
|
|
19
20
|
});
|
|
20
21
|
exports.NavigationBar = react_1.default.memo(function (_a) {
|
|
21
22
|
var index = _a.index, onPress = _a.onPress, style = _a.style;
|
|
22
|
-
return (
|
|
23
|
-
react_1.default.createElement(tabs_1.TabButton, { onPress: onPress, testID: "BottomMenu.Sidebar", id: constants_1.SIDEBAR, active: index === constants_1.SIDEBAR }, "SIDEBAR"),
|
|
24
|
-
react_1.default.createElement(tabs_1.TabButton, { onPress: onPress, testID: "BottomMenu.Canvas", id: constants_1.CANVAS, active: index === constants_1.CANVAS }, "CANVAS"),
|
|
25
|
-
react_1.default.createElement(tabs_1.TabButton, { onPress: onPress, testID: "BottomMenu.Addons", id: constants_1.ADDONS, active: index === constants_1.ADDONS }, "ADDONS")));
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(NavigationTabBar, { style: style, children: [(0, jsx_runtime_1.jsx)(tabs_1.TabButton, { onPress: onPress, testID: "BottomMenu.Sidebar", id: constants_1.SIDEBAR, active: index === constants_1.SIDEBAR, children: "SIDEBAR" }), (0, jsx_runtime_1.jsx)(tabs_1.TabButton, { onPress: onPress, testID: "BottomMenu.Canvas", id: constants_1.CANVAS, active: index === constants_1.CANVAS, children: "CANVAS" }), (0, jsx_runtime_1.jsx)(tabs_1.TabButton, { onPress: onPress, testID: "BottomMenu.Addons", id: constants_1.ADDONS, active: index === constants_1.ADDONS, children: "ADDONS" })] }));
|
|
26
24
|
});
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function AddonsSplitButton(): JSX.Element;
|
|
1
|
+
export declare function VisibilityButton(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function AddonsSplitButton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.AddonsSplitButton = exports.VisibilityButton = void 0;
|
|
7
|
-
var
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
5
|
var react_native_1 = require("react-native");
|
|
9
6
|
var hooks_1 = require("../../../../hooks");
|
|
10
7
|
var icons_1 = require("../../Shared/icons");
|
|
@@ -12,18 +9,15 @@ var layout_1 = require("../../Shared/layout");
|
|
|
12
9
|
var hitSlop = { top: 5, left: 5, right: 5, bottom: 5 };
|
|
13
10
|
function NavigationButton(_a) {
|
|
14
11
|
var iconName = _a.iconName, inverseIconName = _a.inverseIconName, active = _a.active, toggle = _a.toggle;
|
|
15
|
-
return (
|
|
16
|
-
react_1.default.createElement(layout_1.Box, { marginHorizontal: 8 },
|
|
17
|
-
react_1.default.createElement(icons_1.Icon, { flex: 1, background: true, name: inverseIconName, opacity: 0.8, pointerEvents: "none" },
|
|
18
|
-
react_1.default.createElement(icons_1.Icon, { name: iconName, opacity: active ? 0.6 : 0.25 })))));
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableWithoutFeedback, { onPress: toggle, hitSlop: hitSlop, children: (0, jsx_runtime_1.jsx)(layout_1.Box, { marginHorizontal: 8, children: (0, jsx_runtime_1.jsx)(icons_1.BackgroundIcon, { flex: 1, name: inverseIconName, opacity: 0.8, children: (0, jsx_runtime_1.jsx)(icons_1.Icon, { name: iconName, opacity: active ? 0.6 : 0.25 }) }) }) }));
|
|
19
13
|
}
|
|
20
14
|
function VisibilityButton() {
|
|
21
15
|
var _a = (0, hooks_1.useIsUIVisible)(), active = _a[0], toggle = _a[1];
|
|
22
|
-
return (
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(NavigationButton, { iconName: "layout-bottom", inverseIconName: "layout-bottom-inverse", active: active, toggle: function () { return toggle(); } }));
|
|
23
17
|
}
|
|
24
18
|
exports.VisibilityButton = VisibilityButton;
|
|
25
19
|
function AddonsSplitButton() {
|
|
26
20
|
var _a = (0, hooks_1.useIsSplitPanelVisible)(), active = _a[0], toggle = _a[1];
|
|
27
|
-
return (
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(NavigationButton, { iconName: "layout-split", inverseIconName: "layout-split-inverse", active: active, toggle: function () { return toggle(); } }));
|
|
28
22
|
}
|
|
29
23
|
exports.AddonsSplitButton = AddonsSplitButton;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Image, ImageBackground, ImageBackgroundProps, ImageStyle } from 'react-native';
|
|
2
3
|
declare const iconSources: {
|
|
3
4
|
grid: {
|
|
4
5
|
uri: string;
|
|
@@ -29,10 +30,24 @@ declare const iconSources: {
|
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
export type IconName = keyof typeof iconSources;
|
|
32
|
-
declare const StyledImage:
|
|
33
|
-
|
|
33
|
+
declare const StyledImage: import("@emotion/native").StyledComponent<import("react-native").ImageProps & {
|
|
34
|
+
theme?: import("@emotion/react").Theme;
|
|
35
|
+
as?: React.ElementType<any>;
|
|
36
|
+
} & ImageStyle & ImageBackgroundProps, {}, {
|
|
37
|
+
ref?: React.Ref<Image>;
|
|
38
|
+
}>;
|
|
39
|
+
declare const StyledImageBackground: import("@emotion/native").StyledComponent<ImageBackgroundProps & {
|
|
40
|
+
theme?: import("@emotion/react").Theme;
|
|
41
|
+
as?: React.ElementType<any>;
|
|
42
|
+
} & ImageStyle, {}, {
|
|
43
|
+
ref?: React.Ref<ImageBackground>;
|
|
44
|
+
}>;
|
|
45
|
+
interface IconProps extends Omit<React.ComponentProps<typeof StyledImage>, 'source'> {
|
|
34
46
|
name: IconName;
|
|
35
|
-
background?: boolean;
|
|
36
47
|
}
|
|
37
|
-
export declare function Icon({ name,
|
|
48
|
+
export declare function Icon({ name, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
interface BackgroungIconProps extends Omit<React.ComponentProps<typeof StyledImageBackground>, 'source'> {
|
|
50
|
+
name: IconName;
|
|
51
|
+
}
|
|
52
|
+
export declare function BackgroundIcon({ name, ...props }: BackgroungIconProps): import("react/jsx-runtime").JSX.Element;
|
|
38
53
|
export {};
|