@dxos/storybook-utils 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77
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/lib/browser/index.mjs +86 -69
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +86 -69
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/CardContainers/ExtrinsicCardContainer.d.ts +12 -0
- package/dist/types/src/components/CardContainers/ExtrinsicCardContainer.d.ts.map +1 -0
- package/dist/types/src/components/CardContainers/IntrinsicCardContainer.d.ts +9 -0
- package/dist/types/src/components/CardContainers/IntrinsicCardContainer.d.ts.map +1 -0
- package/dist/types/src/components/CardContainers/PopoverCardContainer.d.ts +5 -0
- package/dist/types/src/components/CardContainers/PopoverCardContainer.d.ts.map +1 -0
- package/dist/types/src/components/CardContainers/index.d.ts +4 -0
- package/dist/types/src/components/CardContainers/index.d.ts.map +1 -0
- package/dist/types/src/components/ThemeEditor.d.ts +1 -1
- package/dist/types/src/components/ThemeEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/decorators/index.d.ts +0 -2
- package/dist/types/src/decorators/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/stories/test/Test.stories.d.ts +18 -5
- package/dist/types/src/stories/test/Test.stories.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -16
- package/src/components/CardContainers/ExtrinsicCardContainer.tsx +72 -0
- package/src/components/CardContainers/IntrinsicCardContainer.tsx +48 -0
- package/src/components/CardContainers/PopoverCardContainer.tsx +24 -0
- package/src/components/CardContainers/index.ts +7 -0
- package/src/components/index.ts +1 -0
- package/src/decorators/index.ts +0 -2
- package/src/decorators/withThemeEditor.tsx +1 -1
- package/src/index.ts +0 -2
- package/src/stories/test/Test.stories.tsx +7 -8
- package/src/stories/test/Test.test.tsx +2 -12
- package/src/stories/test/{index.mdx → index.mdx__} +3 -0
- package/src/util.tsx +5 -2
- package/dist/types/src/decorators/withLayout.d.ts +0 -21
- package/dist/types/src/decorators/withLayout.d.ts.map +0 -1
- package/dist/types/src/decorators/withTheme.d.ts +0 -6
- package/dist/types/src/decorators/withTheme.d.ts.map +0 -1
- package/src/decorators/withLayout.tsx +0 -82
- package/src/decorators/withTheme.tsx +0 -30
|
@@ -13,95 +13,112 @@ var DxThemeEditor = createComponent({
|
|
|
13
13
|
});
|
|
14
14
|
var ThemeEditor = /* @__PURE__ */ memo(DxThemeEditor);
|
|
15
15
|
|
|
16
|
-
// src/
|
|
17
|
-
import
|
|
16
|
+
// src/components/CardContainers/ExtrinsicCardContainer.tsx
|
|
17
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
18
18
|
import React2 from "react";
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fullscreen
|
|
36
|
-
}, /* @__PURE__ */ React2.createElement(Story, null));
|
|
37
|
-
const options = defaultsDeep({}, providedOptions, defaultOptions);
|
|
38
|
-
return providers.reduceRight((acc, provider) => provider(acc, options), children);
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
var layoutCentered = "bg-deckSurface justify-center overflow-y-auto";
|
|
42
|
-
var DefaultContainer = ({ children, classNames }) => {
|
|
43
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
44
|
-
role: "none",
|
|
45
|
-
className: mx(classNames)
|
|
46
|
-
}, children);
|
|
47
|
-
};
|
|
48
|
-
var FullscreenContainer = ({ children, classNames }) => {
|
|
19
|
+
import { ResizeHandle, resizeAttributes, sizeStyle } from "@dxos/react-ui-dnd";
|
|
20
|
+
var DEFAULT_INLINE_SIZE = 24;
|
|
21
|
+
var MIN_INLINE_SIZE = 8;
|
|
22
|
+
var DEFAULT_BLOCK_SIZE = 24;
|
|
23
|
+
var MIN_BLOCK_SIZE = 8;
|
|
24
|
+
var ExtrinsicCardContainer = ({ children, defaultInlineSize, inlineSize: propInlineSize, defaultBlockSize, blockSize: propBlockSize, onInlineSizeChange, onBlockSizeChange }) => {
|
|
25
|
+
const [inlineSize = DEFAULT_INLINE_SIZE, setInlineSize] = useControllableState({
|
|
26
|
+
prop: propInlineSize,
|
|
27
|
+
defaultProp: defaultInlineSize,
|
|
28
|
+
onChange: onInlineSizeChange
|
|
29
|
+
});
|
|
30
|
+
const [blockSize = DEFAULT_BLOCK_SIZE, setBlockSize] = useControllableState({
|
|
31
|
+
prop: propBlockSize,
|
|
32
|
+
defaultProp: defaultBlockSize,
|
|
33
|
+
onChange: onBlockSizeChange
|
|
34
|
+
});
|
|
49
35
|
return /* @__PURE__ */ React2.createElement("div", {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
className: "grid relative border border-dashed border-subduedSeparator p-4 rounded-lg overflow-hidden contain-layout",
|
|
37
|
+
style: {
|
|
38
|
+
...sizeStyle(inlineSize, "horizontal"),
|
|
39
|
+
...sizeStyle(blockSize, "vertical")
|
|
40
|
+
},
|
|
41
|
+
...resizeAttributes
|
|
42
|
+
}, children, /* @__PURE__ */ React2.createElement(ResizeHandle, {
|
|
43
|
+
side: "inline-end",
|
|
44
|
+
fallbackSize: DEFAULT_INLINE_SIZE,
|
|
45
|
+
minSize: MIN_INLINE_SIZE,
|
|
46
|
+
size: inlineSize,
|
|
47
|
+
onSizeChange: setInlineSize
|
|
48
|
+
}), /* @__PURE__ */ React2.createElement(ResizeHandle, {
|
|
49
|
+
side: "block-end",
|
|
50
|
+
fallbackSize: DEFAULT_BLOCK_SIZE,
|
|
51
|
+
minSize: MIN_BLOCK_SIZE,
|
|
52
|
+
size: blockSize,
|
|
53
|
+
onSizeChange: setBlockSize
|
|
54
|
+
}));
|
|
53
55
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
|
|
57
|
+
// src/components/CardContainers/IntrinsicCardContainer.tsx
|
|
58
|
+
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
59
|
+
import React3 from "react";
|
|
60
|
+
import { ResizeHandle as ResizeHandle2, resizeAttributes as resizeAttributes2, sizeStyle as sizeStyle2 } from "@dxos/react-ui-dnd";
|
|
61
|
+
var DEFAULT_SIZE = 24;
|
|
62
|
+
var MIN_SIZE = 8;
|
|
63
|
+
var IntrinsicCardContainer = ({ children, defaultSize, size: propSize, onSizeChange }) => {
|
|
64
|
+
const [size = DEFAULT_SIZE, setSize] = useControllableState2({
|
|
65
|
+
prop: propSize,
|
|
66
|
+
defaultProp: defaultSize,
|
|
67
|
+
onChange: onSizeChange
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ React3.createElement("div", {
|
|
70
|
+
className: "relative border border-dashed border-subduedSeparator p-4 rounded-lg",
|
|
71
|
+
style: sizeStyle2(size, "horizontal"),
|
|
72
|
+
...resizeAttributes2
|
|
73
|
+
}, children, /* @__PURE__ */ React3.createElement(ResizeHandle2, {
|
|
74
|
+
side: "inline-end",
|
|
75
|
+
fallbackSize: DEFAULT_SIZE,
|
|
76
|
+
minSize: MIN_SIZE,
|
|
77
|
+
size,
|
|
78
|
+
onSizeChange: setSize
|
|
79
|
+
}));
|
|
62
80
|
};
|
|
63
81
|
|
|
64
|
-
// src/
|
|
65
|
-
import
|
|
66
|
-
import {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, /* @__PURE__ */ React3.createElement(Tooltip.Provider, null, /* @__PURE__ */ React3.createElement(MemoizedStory, null)));
|
|
82
|
+
// src/components/CardContainers/PopoverCardContainer.tsx
|
|
83
|
+
import React4 from "react";
|
|
84
|
+
import { Icon, Popover } from "@dxos/react-ui";
|
|
85
|
+
var PopoverCardContainer = ({ children, icon = "ph--placeholder--regular" }) => {
|
|
86
|
+
return /* @__PURE__ */ React4.createElement(Popover.Root, {
|
|
87
|
+
open: true
|
|
88
|
+
}, /* @__PURE__ */ React4.createElement(Popover.Content, {
|
|
89
|
+
onOpenAutoFocus: (event) => event.preventDefault()
|
|
90
|
+
}, /* @__PURE__ */ React4.createElement(Popover.Viewport, null, children), /* @__PURE__ */ React4.createElement(Popover.Arrow, null)), /* @__PURE__ */ React4.createElement(Popover.Trigger, null, /* @__PURE__ */ React4.createElement(Icon, {
|
|
91
|
+
icon,
|
|
92
|
+
size: 5
|
|
93
|
+
})));
|
|
77
94
|
};
|
|
78
95
|
|
|
79
96
|
// src/decorators/withThemeEditor.tsx
|
|
80
|
-
import
|
|
97
|
+
import React5, { memo as memo2 } from "react";
|
|
81
98
|
var withThemeEditor = (Story, context) => {
|
|
82
|
-
const MemoizedStory = /* @__PURE__ */
|
|
83
|
-
return /* @__PURE__ */
|
|
99
|
+
const MemoizedStory = /* @__PURE__ */ memo2(Story);
|
|
100
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(MemoizedStory, null), /* @__PURE__ */ React5.createElement("div", {
|
|
84
101
|
className: "absolute top-4 bottom-4 right-4 z-10"
|
|
85
|
-
}, /* @__PURE__ */
|
|
102
|
+
}, /* @__PURE__ */ React5.createElement("div", {
|
|
86
103
|
className: "h-full is-[35rem] overflow-auto bg-baseSurface border border-separator rounded"
|
|
87
|
-
}, /* @__PURE__ */
|
|
104
|
+
}, /* @__PURE__ */ React5.createElement(ThemeEditor, null))));
|
|
88
105
|
};
|
|
89
106
|
|
|
90
107
|
// src/util.tsx
|
|
91
|
-
import
|
|
92
|
-
var render = (
|
|
108
|
+
import React6 from "react";
|
|
109
|
+
var render = (Story) => (args) => {
|
|
110
|
+
const result = /* @__PURE__ */ React6.createElement(Story, args);
|
|
111
|
+
return result ?? /* @__PURE__ */ React6.createElement("div", null);
|
|
112
|
+
};
|
|
93
113
|
|
|
94
114
|
// src/index.ts
|
|
95
115
|
registerSignalsRuntime();
|
|
96
116
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
117
|
+
ExtrinsicCardContainer,
|
|
118
|
+
IntrinsicCardContainer,
|
|
119
|
+
PopoverCardContainer,
|
|
100
120
|
ThemeEditor,
|
|
101
|
-
layoutCentered,
|
|
102
121
|
render,
|
|
103
|
-
withLayout,
|
|
104
|
-
withTheme,
|
|
105
122
|
withThemeEditor
|
|
106
123
|
};
|
|
107
124
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/index.ts", "../../../src/components/ThemeEditor.tsx", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\n\nexport
|
|
5
|
-
"mappings": ";AAIA,SAASA,8BAA8B;;;ACAvC,OAAOC,SAASC,YAAY;AAE5B,SAASC,iBAAiBC,4BAA4B;AACtD,SAASC,uBAAuB;AAEhC,OAAO;AAEP,IAAMC,gBAAgBC,gBAAgB;EACpCC,SAAS;EACTC,cAAcC;EACdC,OAAOC;AACT,CAAA;AAEO,IAAMC,cAAcC,qBAAKR,aAAAA;;;
|
|
6
|
-
"names": ["registerSignalsRuntime", "React", "memo", "DxThemeEditor", "NaturalDxThemeEditor", "createComponent", "DxThemeEditor", "createComponent", "tagName", "elementClass", "NaturalDxThemeEditor", "react", "React", "ThemeEditor", "memo", "
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/components/ThemeEditor.tsx", "../../../src/components/CardContainers/ExtrinsicCardContainer.tsx", "../../../src/components/CardContainers/IntrinsicCardContainer.tsx", "../../../src/components/CardContainers/PopoverCardContainer.tsx", "../../../src/decorators/withThemeEditor.tsx", "../../../src/util.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\n\nexport * from './components';\nexport * from './decorators';\nexport * from './util';\n\nregisterSignalsRuntime();\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { memo } from 'react';\n\nimport { DxThemeEditor as NaturalDxThemeEditor } from '@dxos/lit-theme-editor';\nimport { createComponent } from '@dxos/lit-ui/react';\n\nimport '@dxos/lit-theme-editor/dx-theme-editor.pcss';\n\nconst DxThemeEditor = createComponent({\n tagName: 'dx-theme-editor',\n elementClass: NaturalDxThemeEditor,\n react: React,\n});\n\nexport const ThemeEditor = memo(DxThemeEditor);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\n\n// Default size in rem\nconst DEFAULT_INLINE_SIZE = 24;\nconst MIN_INLINE_SIZE = 8;\nconst DEFAULT_BLOCK_SIZE = 24;\nconst MIN_BLOCK_SIZE = 8;\n\nexport type ExtrinsicCardContainerProps = PropsWithChildren<{\n defaultInlineSize?: Size;\n inlineSize?: Size;\n defaultBlockSize?: Size;\n blockSize?: Size;\n onInlineSizeChange?: (size: Size, commit?: boolean) => void;\n onBlockSizeChange?: (size: Size, commit?: boolean) => void;\n}>;\n\nexport const ExtrinsicCardContainer = ({\n children,\n defaultInlineSize,\n inlineSize: propInlineSize,\n defaultBlockSize,\n blockSize: propBlockSize,\n onInlineSizeChange,\n onBlockSizeChange,\n}: ExtrinsicCardContainerProps) => {\n const [inlineSize = DEFAULT_INLINE_SIZE, setInlineSize] = useControllableState<Size>({\n prop: propInlineSize,\n defaultProp: defaultInlineSize,\n onChange: onInlineSizeChange,\n });\n\n const [blockSize = DEFAULT_BLOCK_SIZE, setBlockSize] = useControllableState<Size>({\n prop: propBlockSize,\n defaultProp: defaultBlockSize,\n onChange: onBlockSizeChange,\n });\n\n return (\n <div\n className='grid relative border border-dashed border-subduedSeparator p-4 rounded-lg overflow-hidden contain-layout'\n style={{\n ...sizeStyle(inlineSize, 'horizontal'),\n ...sizeStyle(blockSize, 'vertical'),\n }}\n {...resizeAttributes}\n >\n {children}\n <ResizeHandle\n side='inline-end'\n fallbackSize={DEFAULT_INLINE_SIZE}\n minSize={MIN_INLINE_SIZE}\n size={inlineSize}\n onSizeChange={setInlineSize}\n />\n <ResizeHandle\n side='block-end'\n fallbackSize={DEFAULT_BLOCK_SIZE}\n minSize={MIN_BLOCK_SIZE}\n size={blockSize}\n onSizeChange={setBlockSize}\n />\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\n\n// Default size in rem\nconst DEFAULT_SIZE = 24;\nconst MIN_SIZE = 8;\n\nexport type IntrinsicCardContainerProps = PropsWithChildren<{\n defaultSize?: Size;\n size?: Size;\n onSizeChange?: (size: Size, commit?: boolean) => void;\n}>;\n\nexport const IntrinsicCardContainer = ({\n children,\n defaultSize,\n size: propSize,\n onSizeChange,\n}: IntrinsicCardContainerProps) => {\n const [size = DEFAULT_SIZE, setSize] = useControllableState<Size>({\n prop: propSize,\n defaultProp: defaultSize,\n onChange: onSizeChange,\n });\n\n return (\n <div\n className='relative border border-dashed border-subduedSeparator p-4 rounded-lg'\n style={sizeStyle(size, 'horizontal')}\n {...resizeAttributes}\n >\n {children}\n <ResizeHandle\n side='inline-end'\n fallbackSize={DEFAULT_SIZE}\n minSize={MIN_SIZE}\n size={size}\n onSizeChange={setSize}\n />\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Icon, Popover } from '@dxos/react-ui';\n\nexport const PopoverCardContainer = ({\n children,\n icon = 'ph--placeholder--regular',\n}: PropsWithChildren<{ icon: string }>) => {\n return (\n <Popover.Root open>\n <Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>\n <Popover.Viewport>{children}</Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n <Popover.Trigger>\n <Icon icon={icon} size={5} />\n </Popover.Trigger>\n </Popover.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { memo } from 'react';\n\nimport { ThemeEditor } from '../components/ThemeEditor';\n\n/**\n * Show theme editor.\n */\n// TODO(burdon): Ideally move to storybook-addon-theme, but this has a build issue since the addon would depend on the vite theme plugin.\nexport const withThemeEditor: Decorator = (Story, context) => {\n // Prevent re-rendering of the story.\n const MemoizedStory = memo(Story);\n\n return (\n <>\n <MemoizedStory />\n <div className='absolute top-4 bottom-4 right-4 z-10'>\n <div className='h-full is-[35rem] overflow-auto bg-baseSurface border border-separator rounded'>\n <ThemeEditor />\n </div>\n </div>\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\n/**\n * Story renderer wrapper.\n */\nexport const render =\n <T extends Record<string, any>>(Story: FC<T>) =>\n (args: unknown) => {\n const result = <Story {...(args as T)} />;\n return result ?? <div />;\n };\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,8BAA8B;;;ACAvC,OAAOC,SAASC,YAAY;AAE5B,SAASC,iBAAiBC,4BAA4B;AACtD,SAASC,uBAAuB;AAEhC,O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MC,SAAS,gBAAAC,OAAA,cAACH,OAAWC,IAAAA;AAC3B,SAAOC,UAAU,gBAAAC,OAAA,cAACC,OAAAA,IAAAA;AACpB;;;ANJFC,uBAAAA;",
|
|
6
|
+
"names": ["registerSignalsRuntime", "React", "memo", "DxThemeEditor", "NaturalDxThemeEditor", "createComponent", "DxThemeEditor", "createComponent", "tagName", "elementClass", "NaturalDxThemeEditor", "react", "React", "ThemeEditor", "memo", "useControllableState", "React", "ResizeHandle", "resizeAttributes", "sizeStyle", "DEFAULT_INLINE_SIZE", "MIN_INLINE_SIZE", "DEFAULT_BLOCK_SIZE", "MIN_BLOCK_SIZE", "ExtrinsicCardContainer", "children", "defaultInlineSize", "inlineSize", "propInlineSize", "defaultBlockSize", "blockSize", "propBlockSize", "onInlineSizeChange", "onBlockSizeChange", "setInlineSize", "useControllableState", "prop", "defaultProp", "onChange", "setBlockSize", "React", "div", "className", "style", "sizeStyle", "resizeAttributes", "ResizeHandle", "side", "fallbackSize", "minSize", "size", "onSizeChange", "useControllableState", "React", "ResizeHandle", "resizeAttributes", "sizeStyle", "DEFAULT_SIZE", "MIN_SIZE", "IntrinsicCardContainer", "children", "defaultSize", "size", "propSize", "onSizeChange", "setSize", "useControllableState", "prop", "defaultProp", "onChange", "React", "div", "className", "style", "sizeStyle", "resizeAttributes", "ResizeHandle", "side", "fallbackSize", "minSize", "React", "Icon", "Popover", "PopoverCardContainer", "children", "icon", "React", "Popover", "Root", "open", "Content", "onOpenAutoFocus", "event", "preventDefault", "Viewport", "Arrow", "Trigger", "Icon", "size", "React", "memo", "withThemeEditor", "Story", "context", "MemoizedStory", "memo", "React", "div", "className", "ThemeEditor", "React", "render", "Story", "args", "result", "React", "div", "registerSignalsRuntime"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/components/ThemeEditor.tsx":{"bytes":1828,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor","kind":"import-statement","external":true},{"path":"@dxos/lit-ui/react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor/dx-theme-editor.pcss","kind":"import-statement","external":true}],"format":"esm"},"src/components/
|
|
1
|
+
{"inputs":{"src/components/ThemeEditor.tsx":{"bytes":1828,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor","kind":"import-statement","external":true},{"path":"@dxos/lit-ui/react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor/dx-theme-editor.pcss","kind":"import-statement","external":true}],"format":"esm"},"src/components/CardContainers/ExtrinsicCardContainer.tsx":{"bytes":6610,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true}],"format":"esm"},"src/components/CardContainers/IntrinsicCardContainer.tsx":{"bytes":4021,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true}],"format":"esm"},"src/components/CardContainers/PopoverCardContainer.tsx":{"bytes":2566,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/components/CardContainers/index.ts":{"bytes":764,"imports":[{"path":"src/components/CardContainers/ExtrinsicCardContainer.tsx","kind":"import-statement","original":"./ExtrinsicCardContainer"},{"path":"src/components/CardContainers/IntrinsicCardContainer.tsx","kind":"import-statement","original":"./IntrinsicCardContainer"},{"path":"src/components/CardContainers/PopoverCardContainer.tsx","kind":"import-statement","original":"./PopoverCardContainer"}],"format":"esm"},"src/components/index.ts":{"bytes":686,"imports":[{"path":"src/components/ThemeEditor.tsx","kind":"import-statement","original":"./ThemeEditor"},{"path":"src/components/CardContainers/index.ts","kind":"import-statement","original":"./CardContainers"}],"format":"esm"},"src/decorators/withThemeEditor.tsx":{"bytes":2741,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/ThemeEditor.tsx","kind":"import-statement","original":"../components/ThemeEditor"}],"format":"esm"},"src/decorators/index.ts":{"bytes":488,"imports":[{"path":"src/decorators/withThemeEditor.tsx","kind":"import-statement","original":"./withThemeEditor"}],"format":"esm"},"src/util.tsx":{"bytes":1228,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":943,"imports":[{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/decorators/index.ts","kind":"import-statement","original":"./decorators"},{"path":"src/util.tsx","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10161},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor","kind":"import-statement","external":true},{"path":"@dxos/lit-ui/react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor/dx-theme-editor.pcss","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["ExtrinsicCardContainer","IntrinsicCardContainer","PopoverCardContainer","ThemeEditor","render","withThemeEditor"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":93},"src/components/ThemeEditor.tsx":{"bytesInOutput":405},"src/components/index.ts":{"bytesInOutput":0},"src/components/CardContainers/ExtrinsicCardContainer.tsx":{"bytesInOutput":1572},"src/components/CardContainers/index.ts":{"bytesInOutput":0},"src/components/CardContainers/IntrinsicCardContainer.tsx":{"bytesInOutput":949},"src/components/CardContainers/PopoverCardContainer.tsx":{"bytesInOutput":626},"src/decorators/withThemeEditor.tsx":{"bytesInOutput":588},"src/decorators/index.ts":{"bytesInOutput":0},"src/util.tsx":{"bytesInOutput":205}},"bytes":4909}}}
|
|
@@ -15,95 +15,112 @@ var DxThemeEditor = createComponent({
|
|
|
15
15
|
});
|
|
16
16
|
var ThemeEditor = /* @__PURE__ */ memo(DxThemeEditor);
|
|
17
17
|
|
|
18
|
-
// src/
|
|
19
|
-
import
|
|
18
|
+
// src/components/CardContainers/ExtrinsicCardContainer.tsx
|
|
19
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
20
20
|
import React2 from "react";
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fullscreen
|
|
38
|
-
}, /* @__PURE__ */ React2.createElement(Story, null));
|
|
39
|
-
const options = defaultsDeep({}, providedOptions, defaultOptions);
|
|
40
|
-
return providers.reduceRight((acc, provider) => provider(acc, options), children);
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
var layoutCentered = "bg-deckSurface justify-center overflow-y-auto";
|
|
44
|
-
var DefaultContainer = ({ children, classNames }) => {
|
|
45
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
46
|
-
role: "none",
|
|
47
|
-
className: mx(classNames)
|
|
48
|
-
}, children);
|
|
49
|
-
};
|
|
50
|
-
var FullscreenContainer = ({ children, classNames }) => {
|
|
21
|
+
import { ResizeHandle, resizeAttributes, sizeStyle } from "@dxos/react-ui-dnd";
|
|
22
|
+
var DEFAULT_INLINE_SIZE = 24;
|
|
23
|
+
var MIN_INLINE_SIZE = 8;
|
|
24
|
+
var DEFAULT_BLOCK_SIZE = 24;
|
|
25
|
+
var MIN_BLOCK_SIZE = 8;
|
|
26
|
+
var ExtrinsicCardContainer = ({ children, defaultInlineSize, inlineSize: propInlineSize, defaultBlockSize, blockSize: propBlockSize, onInlineSizeChange, onBlockSizeChange }) => {
|
|
27
|
+
const [inlineSize = DEFAULT_INLINE_SIZE, setInlineSize] = useControllableState({
|
|
28
|
+
prop: propInlineSize,
|
|
29
|
+
defaultProp: defaultInlineSize,
|
|
30
|
+
onChange: onInlineSizeChange
|
|
31
|
+
});
|
|
32
|
+
const [blockSize = DEFAULT_BLOCK_SIZE, setBlockSize] = useControllableState({
|
|
33
|
+
prop: propBlockSize,
|
|
34
|
+
defaultProp: defaultBlockSize,
|
|
35
|
+
onChange: onBlockSizeChange
|
|
36
|
+
});
|
|
51
37
|
return /* @__PURE__ */ React2.createElement("div", {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
className: "grid relative border border-dashed border-subduedSeparator p-4 rounded-lg overflow-hidden contain-layout",
|
|
39
|
+
style: {
|
|
40
|
+
...sizeStyle(inlineSize, "horizontal"),
|
|
41
|
+
...sizeStyle(blockSize, "vertical")
|
|
42
|
+
},
|
|
43
|
+
...resizeAttributes
|
|
44
|
+
}, children, /* @__PURE__ */ React2.createElement(ResizeHandle, {
|
|
45
|
+
side: "inline-end",
|
|
46
|
+
fallbackSize: DEFAULT_INLINE_SIZE,
|
|
47
|
+
minSize: MIN_INLINE_SIZE,
|
|
48
|
+
size: inlineSize,
|
|
49
|
+
onSizeChange: setInlineSize
|
|
50
|
+
}), /* @__PURE__ */ React2.createElement(ResizeHandle, {
|
|
51
|
+
side: "block-end",
|
|
52
|
+
fallbackSize: DEFAULT_BLOCK_SIZE,
|
|
53
|
+
minSize: MIN_BLOCK_SIZE,
|
|
54
|
+
size: blockSize,
|
|
55
|
+
onSizeChange: setBlockSize
|
|
56
|
+
}));
|
|
55
57
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
|
|
59
|
+
// src/components/CardContainers/IntrinsicCardContainer.tsx
|
|
60
|
+
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
61
|
+
import React3 from "react";
|
|
62
|
+
import { ResizeHandle as ResizeHandle2, resizeAttributes as resizeAttributes2, sizeStyle as sizeStyle2 } from "@dxos/react-ui-dnd";
|
|
63
|
+
var DEFAULT_SIZE = 24;
|
|
64
|
+
var MIN_SIZE = 8;
|
|
65
|
+
var IntrinsicCardContainer = ({ children, defaultSize, size: propSize, onSizeChange }) => {
|
|
66
|
+
const [size = DEFAULT_SIZE, setSize] = useControllableState2({
|
|
67
|
+
prop: propSize,
|
|
68
|
+
defaultProp: defaultSize,
|
|
69
|
+
onChange: onSizeChange
|
|
70
|
+
});
|
|
71
|
+
return /* @__PURE__ */ React3.createElement("div", {
|
|
72
|
+
className: "relative border border-dashed border-subduedSeparator p-4 rounded-lg",
|
|
73
|
+
style: sizeStyle2(size, "horizontal"),
|
|
74
|
+
...resizeAttributes2
|
|
75
|
+
}, children, /* @__PURE__ */ React3.createElement(ResizeHandle2, {
|
|
76
|
+
side: "inline-end",
|
|
77
|
+
fallbackSize: DEFAULT_SIZE,
|
|
78
|
+
minSize: MIN_SIZE,
|
|
79
|
+
size,
|
|
80
|
+
onSizeChange: setSize
|
|
81
|
+
}));
|
|
64
82
|
};
|
|
65
83
|
|
|
66
|
-
// src/
|
|
67
|
-
import
|
|
68
|
-
import {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}, /* @__PURE__ */ React3.createElement(Tooltip.Provider, null, /* @__PURE__ */ React3.createElement(MemoizedStory, null)));
|
|
84
|
+
// src/components/CardContainers/PopoverCardContainer.tsx
|
|
85
|
+
import React4 from "react";
|
|
86
|
+
import { Icon, Popover } from "@dxos/react-ui";
|
|
87
|
+
var PopoverCardContainer = ({ children, icon = "ph--placeholder--regular" }) => {
|
|
88
|
+
return /* @__PURE__ */ React4.createElement(Popover.Root, {
|
|
89
|
+
open: true
|
|
90
|
+
}, /* @__PURE__ */ React4.createElement(Popover.Content, {
|
|
91
|
+
onOpenAutoFocus: (event) => event.preventDefault()
|
|
92
|
+
}, /* @__PURE__ */ React4.createElement(Popover.Viewport, null, children), /* @__PURE__ */ React4.createElement(Popover.Arrow, null)), /* @__PURE__ */ React4.createElement(Popover.Trigger, null, /* @__PURE__ */ React4.createElement(Icon, {
|
|
93
|
+
icon,
|
|
94
|
+
size: 5
|
|
95
|
+
})));
|
|
79
96
|
};
|
|
80
97
|
|
|
81
98
|
// src/decorators/withThemeEditor.tsx
|
|
82
|
-
import
|
|
99
|
+
import React5, { memo as memo2 } from "react";
|
|
83
100
|
var withThemeEditor = (Story, context) => {
|
|
84
|
-
const MemoizedStory = /* @__PURE__ */
|
|
85
|
-
return /* @__PURE__ */
|
|
101
|
+
const MemoizedStory = /* @__PURE__ */ memo2(Story);
|
|
102
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(MemoizedStory, null), /* @__PURE__ */ React5.createElement("div", {
|
|
86
103
|
className: "absolute top-4 bottom-4 right-4 z-10"
|
|
87
|
-
}, /* @__PURE__ */
|
|
104
|
+
}, /* @__PURE__ */ React5.createElement("div", {
|
|
88
105
|
className: "h-full is-[35rem] overflow-auto bg-baseSurface border border-separator rounded"
|
|
89
|
-
}, /* @__PURE__ */
|
|
106
|
+
}, /* @__PURE__ */ React5.createElement(ThemeEditor, null))));
|
|
90
107
|
};
|
|
91
108
|
|
|
92
109
|
// src/util.tsx
|
|
93
|
-
import
|
|
94
|
-
var render = (
|
|
110
|
+
import React6 from "react";
|
|
111
|
+
var render = (Story) => (args) => {
|
|
112
|
+
const result = /* @__PURE__ */ React6.createElement(Story, args);
|
|
113
|
+
return result ?? /* @__PURE__ */ React6.createElement("div", null);
|
|
114
|
+
};
|
|
95
115
|
|
|
96
116
|
// src/index.ts
|
|
97
117
|
registerSignalsRuntime();
|
|
98
118
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
119
|
+
ExtrinsicCardContainer,
|
|
120
|
+
IntrinsicCardContainer,
|
|
121
|
+
PopoverCardContainer,
|
|
102
122
|
ThemeEditor,
|
|
103
|
-
layoutCentered,
|
|
104
123
|
render,
|
|
105
|
-
withLayout,
|
|
106
|
-
withTheme,
|
|
107
124
|
withThemeEditor
|
|
108
125
|
};
|
|
109
126
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/index.ts", "../../../src/components/ThemeEditor.tsx", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\n\nexport
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,8BAA8B;;;ACAvC,OAAOC,SAASC,YAAY;AAE5B,SAASC,iBAAiBC,4BAA4B;AACtD,SAASC,uBAAuB;AAEhC,OAAO;AAEP,IAAMC,gBAAgBC,gBAAgB;EACpCC,SAAS;EACTC,cAAcC;EACdC,OAAOC;AACT,CAAA;AAEO,IAAMC,cAAcC,qBAAKR,aAAAA;;;
|
|
6
|
-
"names": ["registerSignalsRuntime", "React", "memo", "DxThemeEditor", "NaturalDxThemeEditor", "createComponent", "DxThemeEditor", "createComponent", "tagName", "elementClass", "NaturalDxThemeEditor", "react", "React", "ThemeEditor", "memo", "
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/components/ThemeEditor.tsx", "../../../src/components/CardContainers/ExtrinsicCardContainer.tsx", "../../../src/components/CardContainers/IntrinsicCardContainer.tsx", "../../../src/components/CardContainers/PopoverCardContainer.tsx", "../../../src/decorators/withThemeEditor.tsx", "../../../src/util.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\n\nexport * from './components';\nexport * from './decorators';\nexport * from './util';\n\nregisterSignalsRuntime();\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { memo } from 'react';\n\nimport { DxThemeEditor as NaturalDxThemeEditor } from '@dxos/lit-theme-editor';\nimport { createComponent } from '@dxos/lit-ui/react';\n\nimport '@dxos/lit-theme-editor/dx-theme-editor.pcss';\n\nconst DxThemeEditor = createComponent({\n tagName: 'dx-theme-editor',\n elementClass: NaturalDxThemeEditor,\n react: React,\n});\n\nexport const ThemeEditor = memo(DxThemeEditor);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\n\n// Default size in rem\nconst DEFAULT_INLINE_SIZE = 24;\nconst MIN_INLINE_SIZE = 8;\nconst DEFAULT_BLOCK_SIZE = 24;\nconst MIN_BLOCK_SIZE = 8;\n\nexport type ExtrinsicCardContainerProps = PropsWithChildren<{\n defaultInlineSize?: Size;\n inlineSize?: Size;\n defaultBlockSize?: Size;\n blockSize?: Size;\n onInlineSizeChange?: (size: Size, commit?: boolean) => void;\n onBlockSizeChange?: (size: Size, commit?: boolean) => void;\n}>;\n\nexport const ExtrinsicCardContainer = ({\n children,\n defaultInlineSize,\n inlineSize: propInlineSize,\n defaultBlockSize,\n blockSize: propBlockSize,\n onInlineSizeChange,\n onBlockSizeChange,\n}: ExtrinsicCardContainerProps) => {\n const [inlineSize = DEFAULT_INLINE_SIZE, setInlineSize] = useControllableState<Size>({\n prop: propInlineSize,\n defaultProp: defaultInlineSize,\n onChange: onInlineSizeChange,\n });\n\n const [blockSize = DEFAULT_BLOCK_SIZE, setBlockSize] = useControllableState<Size>({\n prop: propBlockSize,\n defaultProp: defaultBlockSize,\n onChange: onBlockSizeChange,\n });\n\n return (\n <div\n className='grid relative border border-dashed border-subduedSeparator p-4 rounded-lg overflow-hidden contain-layout'\n style={{\n ...sizeStyle(inlineSize, 'horizontal'),\n ...sizeStyle(blockSize, 'vertical'),\n }}\n {...resizeAttributes}\n >\n {children}\n <ResizeHandle\n side='inline-end'\n fallbackSize={DEFAULT_INLINE_SIZE}\n minSize={MIN_INLINE_SIZE}\n size={inlineSize}\n onSizeChange={setInlineSize}\n />\n <ResizeHandle\n side='block-end'\n fallbackSize={DEFAULT_BLOCK_SIZE}\n minSize={MIN_BLOCK_SIZE}\n size={blockSize}\n onSizeChange={setBlockSize}\n />\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\n\n// Default size in rem\nconst DEFAULT_SIZE = 24;\nconst MIN_SIZE = 8;\n\nexport type IntrinsicCardContainerProps = PropsWithChildren<{\n defaultSize?: Size;\n size?: Size;\n onSizeChange?: (size: Size, commit?: boolean) => void;\n}>;\n\nexport const IntrinsicCardContainer = ({\n children,\n defaultSize,\n size: propSize,\n onSizeChange,\n}: IntrinsicCardContainerProps) => {\n const [size = DEFAULT_SIZE, setSize] = useControllableState<Size>({\n prop: propSize,\n defaultProp: defaultSize,\n onChange: onSizeChange,\n });\n\n return (\n <div\n className='relative border border-dashed border-subduedSeparator p-4 rounded-lg'\n style={sizeStyle(size, 'horizontal')}\n {...resizeAttributes}\n >\n {children}\n <ResizeHandle\n side='inline-end'\n fallbackSize={DEFAULT_SIZE}\n minSize={MIN_SIZE}\n size={size}\n onSizeChange={setSize}\n />\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Icon, Popover } from '@dxos/react-ui';\n\nexport const PopoverCardContainer = ({\n children,\n icon = 'ph--placeholder--regular',\n}: PropsWithChildren<{ icon: string }>) => {\n return (\n <Popover.Root open>\n <Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>\n <Popover.Viewport>{children}</Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n <Popover.Trigger>\n <Icon icon={icon} size={5} />\n </Popover.Trigger>\n </Popover.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { memo } from 'react';\n\nimport { ThemeEditor } from '../components/ThemeEditor';\n\n/**\n * Show theme editor.\n */\n// TODO(burdon): Ideally move to storybook-addon-theme, but this has a build issue since the addon would depend on the vite theme plugin.\nexport const withThemeEditor: Decorator = (Story, context) => {\n // Prevent re-rendering of the story.\n const MemoizedStory = memo(Story);\n\n return (\n <>\n <MemoizedStory />\n <div className='absolute top-4 bottom-4 right-4 z-10'>\n <div className='h-full is-[35rem] overflow-auto bg-baseSurface border border-separator rounded'>\n <ThemeEditor />\n </div>\n </div>\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\n/**\n * Story renderer wrapper.\n */\nexport const render =\n <T extends Record<string, any>>(Story: FC<T>) =>\n (args: unknown) => {\n const result = <Story {...(args as T)} />;\n return result ?? <div />;\n };\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,8BAA8B;;;ACAvC,OAAOC,SAASC,YAAY;AAE5B,SAASC,iBAAiBC,4BAA4B;AACtD,SAASC,uBAAuB;AAEhC,OAAO;AAEP,IAAMC,gBAAgBC,gBAAgB;EACpCC,SAAS;EACTC,cAAcC;EACdC,OAAOC;AACT,CAAA;AAEO,IAAMC,cAAcC,qBAAKR,aAAAA;;;ACbhC,SAASS,4BAA4B;AACrC,OAAOC,YAAuC;AAE9C,SAASC,cAAyBC,kBAAkBC,i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ent", "DxThemeEditor", "createComponent", "tagName", "elementClass", "NaturalDxThemeEditor", "react", "React", "ThemeEditor", "memo", "useControllableState", "React", "ResizeHandle", "resizeAttributes", "sizeStyle", "DEFAULT_INLINE_SIZE", "MIN_INLINE_SIZE", "DEFAULT_BLOCK_SIZE", "MIN_BLOCK_SIZE", "ExtrinsicCardContainer", "children", "defaultInlineSize", "inlineSize", "propInlineSize", "defaultBlockSize", "blockSize", "propBlockSize", "onInlineSizeChange", "onBlockSizeChange", "setInlineSize", "useControllableState", "prop", "defaultProp", "onChange", "setBlockSize", "React", "div", "className", "style", "sizeStyle", "resizeAttributes", "ResizeHandle", "side", "fallbackSize", "minSize", "size", "onSizeChange", "useControllableState", "React", "ResizeHandle", "resizeAttributes", "sizeStyle", "DEFAULT_SIZE", "MIN_SIZE", "IntrinsicCardContainer", "children", "defaultSize", "size", "propSize", "onSizeChange", "setSize", "useControllableState", "prop", "defaultProp", "onChange", "React", "div", "className", "style", "sizeStyle", "resizeAttributes", "ResizeHandle", "side", "fallbackSize", "minSize", "React", "Icon", "Popover", "PopoverCardContainer", "children", "icon", "React", "Popover", "Root", "open", "Content", "onOpenAutoFocus", "event", "preventDefault", "Viewport", "Arrow", "Trigger", "Icon", "size", "React", "memo", "withThemeEditor", "Story", "context", "MemoizedStory", "memo", "React", "div", "className", "ThemeEditor", "React", "render", "Story", "args", "result", "React", "div", "registerSignalsRuntime"]
|
|
7
7
|
}
|