@btst/stack 1.10.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.cjs +1 -1
- package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +1 -1
- package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.cjs +77 -0
- package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs +79 -3
- package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react_850cfbef1935a6e49a6ad6c93c7ca70d/node_modules/@radix-ui/react-avatar/dist/index.cjs +140 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react_850cfbef1935a6e49a6ad6c93c7ca70d/node_modules/@radix-ui/react-avatar/dist/index.mjs +119 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.cjs +80 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.mjs +64 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs +18 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs +16 -0
- package/dist/packages/better-stack/src/plugins/kanban/api/plugin.cjs +846 -0
- package/dist/packages/better-stack/src/plugins/kanban/api/plugin.mjs +844 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/board-form.cjs +85 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/board-form.mjs +83 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/column-form.cjs +72 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/column-form.mjs +70 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/task-form.cjs +200 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/task-form.mjs +198 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/loading/board-skeleton.cjs +47 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/loading/board-skeleton.mjs +45 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/loading/boards-list-skeleton.cjs +30 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/loading/boards-list-skeleton.mjs +28 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/404-page.cjs +27 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/404-page.mjs +25 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/board-page.cjs +31 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/board-page.internal.cjs +458 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/board-page.internal.mjs +456 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/board-page.mjs +29 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/boards-list-page.cjs +30 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/boards-list-page.internal.cjs +72 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/boards-list-page.internal.mjs +70 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/boards-list-page.mjs +28 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/new-board-page.cjs +30 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/new-board-page.internal.cjs +51 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/new-board-page.internal.mjs +49 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/new-board-page.mjs +28 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/column-content.cjs +76 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/column-content.mjs +74 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/default-error.cjs +27 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/default-error.mjs +25 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/empty-state.cjs +32 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/empty-state.mjs +30 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/kanban-board.cjs +78 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/kanban-board.mjs +76 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/page-wrapper.cjs +15 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/page-wrapper.mjs +13 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/task-card.cjs +68 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/task-card.mjs +66 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/user-avatar.cjs +32 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/user-avatar.mjs +30 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/hooks/kanban-hooks.cjs +391 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/hooks/kanban-hooks.mjs +381 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/plugin.cjs +290 -0
- package/dist/packages/better-stack/src/plugins/kanban/client/plugin.mjs +288 -0
- package/dist/packages/better-stack/src/plugins/kanban/db.cjs +125 -0
- package/dist/packages/better-stack/src/plugins/kanban/db.mjs +123 -0
- package/dist/packages/better-stack/src/plugins/kanban/schemas.cjs +117 -0
- package/dist/packages/better-stack/src/plugins/kanban/schemas.mjs +102 -0
- package/dist/packages/better-stack/src/plugins/kanban/utils.cjs +49 -0
- package/dist/packages/better-stack/src/plugins/kanban/utils.mjs +45 -0
- package/dist/packages/ui/src/components/avatar.cjs +58 -0
- package/dist/packages/ui/src/components/avatar.mjs +54 -0
- package/dist/packages/ui/src/components/command.cjs +3 -3
- package/dist/packages/ui/src/components/command.mjs +3 -3
- package/dist/packages/ui/src/components/form-builder/index.mjs +2 -2
- package/dist/packages/ui/src/components/kanban.cjs +835 -0
- package/dist/packages/ui/src/components/kanban.mjs +805 -0
- package/dist/packages/ui/src/components/minimal-tiptap/utils.cjs +15 -11
- package/dist/packages/ui/src/components/minimal-tiptap/utils.mjs +15 -11
- package/dist/packages/ui/src/components/popover.cjs +8 -3
- package/dist/packages/ui/src/components/popover.mjs +9 -4
- package/dist/packages/ui/src/components/search-select.cjs +75 -0
- package/dist/packages/ui/src/components/search-select.mjs +73 -0
- package/dist/packages/ui/src/components/ui-builder/index.cjs +9 -7
- package/dist/packages/ui/src/components/ui-builder/index.mjs +9 -7
- package/dist/packages/ui/src/components/ui-builder/internal/canvas/auto-frame.cjs +6 -3
- package/dist/packages/ui/src/components/ui-builder/internal/canvas/auto-frame.mjs +6 -3
- package/dist/packages/ui/src/components/ui-builder/internal/components/add-component-popover.cjs +228 -48
- package/dist/packages/ui/src/components/ui-builder/internal/components/add-component-popover.mjs +228 -48
- package/dist/packages/ui/src/components/ui-builder/internal/components/element-selector.cjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/components/element-selector.mjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/components/error-fallback.cjs +4 -2
- package/dist/packages/ui/src/components/ui-builder/internal/components/error-fallback.mjs +4 -2
- package/dist/packages/ui/src/components/ui-builder/internal/components/multi-select.cjs +6 -3
- package/dist/packages/ui/src/components/ui-builder/internal/components/multi-select.mjs +6 -3
- package/dist/packages/ui/src/components/ui-builder/internal/dnd/draggable-new-component.cjs +67 -0
- package/dist/packages/ui/src/components/ui-builder/internal/dnd/draggable-new-component.mjs +62 -0
- package/dist/packages/ui/src/components/ui-builder/internal/dnd/drop-zone.cjs +181 -37
- package/dist/packages/ui/src/components/ui-builder/internal/dnd/drop-zone.mjs +181 -38
- package/dist/packages/ui/src/components/ui-builder/internal/editor-panel.cjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/editor-panel.mjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/classname-control/classname-group-control.cjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/classname-control/classname-group-control.mjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/classname-control/classname-item-control.cjs +9 -2
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/classname-control/classname-item-control.mjs +9 -2
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/iconname-field.cjs +3 -2
- package/dist/packages/ui/src/components/ui-builder/internal/form-fields/iconname-field.mjs +3 -2
- package/dist/packages/ui/src/components/ui-builder/internal/layers-panel.cjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/layers-panel.mjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/props-panel.cjs +17 -5
- package/dist/packages/ui/src/components/ui-builder/internal/props-panel.mjs +17 -5
- package/dist/packages/ui/src/components/ui-builder/internal/utils/render-utils.cjs +70 -16
- package/dist/packages/ui/src/components/ui-builder/internal/utils/render-utils.mjs +73 -20
- package/dist/packages/ui/src/lib/compose-refs.cjs +56 -0
- package/dist/packages/ui/src/lib/compose-refs.mjs +39 -0
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-context-colission-utils.cjs +14 -9
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-context-colission-utils.mjs +14 -9
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-context.cjs +38 -10
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-context.mjs +35 -11
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-contexts.cjs +1 -0
- package/dist/packages/ui/src/lib/ui-builder/context/dnd-contexts.mjs +1 -0
- package/dist/packages/ui/src/lib/ui-builder/context/drag-overlay.cjs +7 -4
- package/dist/packages/ui/src/lib/ui-builder/context/drag-overlay.mjs +7 -4
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-auto-scroll.cjs +4 -4
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-auto-scroll.mjs +4 -4
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-dnd-event-handlers.cjs +53 -16
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-dnd-event-handlers.mjs +53 -16
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-drop-validation.cjs +23 -7
- package/dist/packages/ui/src/lib/ui-builder/hooks/use-drop-validation.mjs +23 -7
- package/dist/packages/ui/src/lib/ui-builder/registry/form-field-overrides.cjs +110 -11
- package/dist/packages/ui/src/lib/ui-builder/registry/form-field-overrides.mjs +111 -13
- package/dist/packages/ui/src/lib/ui-builder/store/editor-store.cjs +3 -2
- package/dist/packages/ui/src/lib/ui-builder/store/editor-store.mjs +3 -2
- package/dist/packages/ui/src/lib/ui-builder/store/layer-store.cjs +53 -7
- package/dist/packages/ui/src/lib/ui-builder/store/layer-store.mjs +54 -8
- package/dist/packages/ui/src/lib/ui-builder/store/layer-utils.cjs +4 -3
- package/dist/packages/ui/src/lib/ui-builder/store/layer-utils.mjs +4 -3
- package/dist/packages/ui/src/lib/ui-builder/utils/variable-resolver.cjs +12 -0
- package/dist/packages/ui/src/lib/ui-builder/utils/variable-resolver.mjs +12 -1
- package/dist/plugins/blog/api/index.d.cts +1 -1
- package/dist/plugins/blog/api/index.d.mts +1 -1
- package/dist/plugins/blog/api/index.d.ts +1 -1
- package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
- package/dist/plugins/blog/client/index.d.cts +1 -1
- package/dist/plugins/blog/client/index.d.mts +1 -1
- package/dist/plugins/blog/client/index.d.ts +1 -1
- package/dist/plugins/blog/query-keys.d.cts +2 -2
- package/dist/plugins/blog/query-keys.d.mts +2 -2
- package/dist/plugins/blog/query-keys.d.ts +2 -2
- package/dist/plugins/kanban/api/index.cjs +7 -0
- package/dist/plugins/kanban/api/index.d.cts +403 -0
- package/dist/plugins/kanban/api/index.d.mts +403 -0
- package/dist/plugins/kanban/api/index.d.ts +403 -0
- package/dist/plugins/kanban/api/index.mjs +1 -0
- package/dist/plugins/kanban/client/components/index.cjs +35 -0
- package/dist/plugins/kanban/client/components/index.d.cts +102 -0
- package/dist/plugins/kanban/client/components/index.d.mts +102 -0
- package/dist/plugins/kanban/client/components/index.d.ts +102 -0
- package/dist/plugins/kanban/client/components/index.mjs +15 -0
- package/dist/plugins/kanban/client/hooks/index.cjs +15 -0
- package/dist/plugins/kanban/client/hooks/index.d.cts +143 -0
- package/dist/plugins/kanban/client/hooks/index.d.mts +143 -0
- package/dist/plugins/kanban/client/hooks/index.d.ts +143 -0
- package/dist/plugins/kanban/client/hooks/index.mjs +1 -0
- package/dist/plugins/kanban/client/index.cjs +7 -0
- package/dist/plugins/kanban/client/index.d.cts +196 -0
- package/dist/plugins/kanban/client/index.d.mts +196 -0
- package/dist/plugins/kanban/client/index.d.ts +196 -0
- package/dist/plugins/kanban/client/index.mjs +1 -0
- package/dist/plugins/kanban/client.css +68 -0
- package/dist/plugins/kanban/query-keys.cjs +105 -0
- package/dist/plugins/kanban/query-keys.d.cts +59 -0
- package/dist/plugins/kanban/query-keys.d.mts +59 -0
- package/dist/plugins/kanban/query-keys.d.ts +59 -0
- package/dist/plugins/kanban/query-keys.mjs +103 -0
- package/dist/plugins/kanban/style.css +7 -0
- package/dist/plugins/ui-builder/client/components/index.d.cts +1 -1
- package/dist/plugins/ui-builder/client/components/index.d.mts +1 -1
- package/dist/plugins/ui-builder/client/components/index.d.ts +1 -1
- package/dist/plugins/ui-builder/client/hooks/index.d.cts +2 -2
- package/dist/plugins/ui-builder/client/hooks/index.d.mts +2 -2
- package/dist/plugins/ui-builder/client/hooks/index.d.ts +2 -2
- package/dist/plugins/ui-builder/client/index.d.cts +17 -7
- package/dist/plugins/ui-builder/client/index.d.mts +17 -7
- package/dist/plugins/ui-builder/client/index.d.ts +17 -7
- package/dist/plugins/ui-builder/index.d.cts +2 -2
- package/dist/plugins/ui-builder/index.d.mts +2 -2
- package/dist/plugins/ui-builder/index.d.ts +2 -2
- package/dist/plugins/ui-builder/style.css +6 -0
- package/dist/shared/{stack.BSM2cgoq.d.cts → stack.BYysGdHl.d.cts} +1 -1
- package/dist/shared/{stack.CqfZWfjJ.d.cts → stack.BdJFrdyt.d.cts} +8 -2
- package/dist/shared/{stack.e1FN86dE.d.mts → stack.ChVuHi5e.d.mts} +8 -2
- package/dist/shared/stack.DKDMI-QO.d.cts +70 -0
- package/dist/shared/stack.DKDMI-QO.d.mts +70 -0
- package/dist/shared/stack.DKDMI-QO.d.ts +70 -0
- package/dist/shared/{stack.CLtOoAqF.d.mts → stack.DYCFcnkL.d.mts} +1 -1
- package/dist/shared/{stack.MMntCVZZ.d.ts → stack.EhM4pmtN.d.ts} +8 -2
- package/dist/shared/stack.FeaWkglm.d.cts +190 -0
- package/dist/shared/stack.FeaWkglm.d.mts +190 -0
- package/dist/shared/stack.FeaWkglm.d.ts +190 -0
- package/dist/shared/{stack.BD1m-4yB.d.ts → stack.kFbDspnF.d.ts} +1 -1
- package/package.json +56 -2
- package/src/plugins/kanban/api/index.ts +6 -0
- package/src/plugins/kanban/api/plugin.ts +1245 -0
- package/src/plugins/kanban/client/components/forms/board-form.tsx +108 -0
- package/src/plugins/kanban/client/components/forms/column-form.tsx +97 -0
- package/src/plugins/kanban/client/components/forms/task-form.tsx +274 -0
- package/src/plugins/kanban/client/components/index.tsx +21 -0
- package/src/plugins/kanban/client/components/loading/board-skeleton.tsx +49 -0
- package/src/plugins/kanban/client/components/loading/boards-list-skeleton.tsx +34 -0
- package/src/plugins/kanban/client/components/loading/index.tsx +2 -0
- package/src/plugins/kanban/client/components/pages/404-page.tsx +28 -0
- package/src/plugins/kanban/client/components/pages/board-page.internal.tsx +575 -0
- package/src/plugins/kanban/client/components/pages/board-page.tsx +31 -0
- package/src/plugins/kanban/client/components/pages/boards-list-page.internal.tsx +101 -0
- package/src/plugins/kanban/client/components/pages/boards-list-page.tsx +26 -0
- package/src/plugins/kanban/client/components/pages/new-board-page.internal.tsx +65 -0
- package/src/plugins/kanban/client/components/pages/new-board-page.tsx +26 -0
- package/src/plugins/kanban/client/components/shared/column-content.tsx +108 -0
- package/src/plugins/kanban/client/components/shared/default-error.tsx +32 -0
- package/src/plugins/kanban/client/components/shared/empty-state.tsx +37 -0
- package/src/plugins/kanban/client/components/shared/kanban-board.tsx +87 -0
- package/src/plugins/kanban/client/components/shared/page-wrapper.tsx +20 -0
- package/src/plugins/kanban/client/components/shared/task-card.tsx +79 -0
- package/src/plugins/kanban/client/components/shared/user-avatar.tsx +63 -0
- package/src/plugins/kanban/client/hooks/index.tsx +11 -0
- package/src/plugins/kanban/client/hooks/kanban-hooks.tsx +560 -0
- package/src/plugins/kanban/client/index.ts +8 -0
- package/src/plugins/kanban/client/localization/index.ts +28 -0
- package/src/plugins/kanban/client/localization/kanban-common.ts +69 -0
- package/src/plugins/kanban/client/localization/kanban-forms.ts +70 -0
- package/src/plugins/kanban/client/localization/kanban-list.ts +36 -0
- package/src/plugins/kanban/client/overrides.ts +145 -0
- package/src/plugins/kanban/client/plugin.tsx +463 -0
- package/src/plugins/kanban/client.css +68 -0
- package/src/plugins/kanban/db.ts +125 -0
- package/src/plugins/kanban/query-keys.ts +154 -0
- package/src/plugins/kanban/schemas.ts +143 -0
- package/src/plugins/kanban/style.css +7 -0
- package/src/plugins/kanban/types.ts +106 -0
- package/src/plugins/kanban/utils.ts +107 -0
- package/src/plugins/ui-builder/style.css +6 -0
- package/dist/shared/{stack.DLhzx1-D.d.mts → stack.CcI4sYJP.d.cts} +1 -1
- package/dist/shared/{stack.DLhzx1-D.d.ts → stack.CcI4sYJP.d.mts} +1 -1
- package/dist/shared/{stack.DLhzx1-D.d.cts → stack.CcI4sYJP.d.ts} +1 -1
|
@@ -93,23 +93,27 @@ const validateFileOrBase64 = (input, options, originalFile, validFiles, errors)
|
|
|
93
93
|
};
|
|
94
94
|
const checkTypeAndSize = (input, { allowedMimeTypes, maxFileSize }) => {
|
|
95
95
|
const mimeType = input instanceof File ? input.type : base64MimeType(input);
|
|
96
|
-
|
|
96
|
+
let size;
|
|
97
|
+
if (input instanceof File) {
|
|
98
|
+
size = input.size;
|
|
99
|
+
} else {
|
|
100
|
+
const base64Data = input.split(",")[1];
|
|
101
|
+
if (!base64Data || base64Data.trim() === "") {
|
|
102
|
+
return { isValidType: true, isValidSize: false };
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
size = atob(base64Data).length;
|
|
106
|
+
} catch {
|
|
107
|
+
return { isValidType: true, isValidSize: false };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
97
110
|
const isValidType = allowedMimeTypes.length === 0 || allowedMimeTypes.includes(mimeType) || allowedMimeTypes.includes(`${mimeType.split("/")[0]}/*`);
|
|
98
111
|
const isValidSize = !maxFileSize || size <= maxFileSize;
|
|
99
112
|
return { isValidType, isValidSize };
|
|
100
113
|
};
|
|
101
|
-
const getBase64Size = (input) => {
|
|
102
|
-
if (input.includes(",")) {
|
|
103
|
-
const base64Part = input.split(",")[1];
|
|
104
|
-
if (base64Part) {
|
|
105
|
-
return atob(base64Part).length;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return atob(input).length;
|
|
109
|
-
};
|
|
110
114
|
const base64MimeType = (encoded) => {
|
|
111
115
|
const result = encoded.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);
|
|
112
|
-
return result && result.length > 1 ? result[1] : "unknown";
|
|
116
|
+
return result && result.length > 1 ? result[1] ?? "unknown" : "unknown";
|
|
113
117
|
};
|
|
114
118
|
const isBase64 = (str) => {
|
|
115
119
|
if (str.startsWith("data:")) {
|
|
@@ -91,23 +91,27 @@ const validateFileOrBase64 = (input, options, originalFile, validFiles, errors)
|
|
|
91
91
|
};
|
|
92
92
|
const checkTypeAndSize = (input, { allowedMimeTypes, maxFileSize }) => {
|
|
93
93
|
const mimeType = input instanceof File ? input.type : base64MimeType(input);
|
|
94
|
-
|
|
94
|
+
let size;
|
|
95
|
+
if (input instanceof File) {
|
|
96
|
+
size = input.size;
|
|
97
|
+
} else {
|
|
98
|
+
const base64Data = input.split(",")[1];
|
|
99
|
+
if (!base64Data || base64Data.trim() === "") {
|
|
100
|
+
return { isValidType: true, isValidSize: false };
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
size = atob(base64Data).length;
|
|
104
|
+
} catch {
|
|
105
|
+
return { isValidType: true, isValidSize: false };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
95
108
|
const isValidType = allowedMimeTypes.length === 0 || allowedMimeTypes.includes(mimeType) || allowedMimeTypes.includes(`${mimeType.split("/")[0]}/*`);
|
|
96
109
|
const isValidSize = !maxFileSize || size <= maxFileSize;
|
|
97
110
|
return { isValidType, isValidSize };
|
|
98
111
|
};
|
|
99
|
-
const getBase64Size = (input) => {
|
|
100
|
-
if (input.includes(",")) {
|
|
101
|
-
const base64Part = input.split(",")[1];
|
|
102
|
-
if (base64Part) {
|
|
103
|
-
return atob(base64Part).length;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return atob(input).length;
|
|
107
|
-
};
|
|
108
112
|
const base64MimeType = (encoded) => {
|
|
109
113
|
const result = encoded.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);
|
|
110
|
-
return result && result.length > 1 ? result[1] : "unknown";
|
|
114
|
+
return result && result.length > 1 ? result[1] ?? "unknown" : "unknown";
|
|
111
115
|
};
|
|
112
116
|
const isBase64 = (str) => {
|
|
113
117
|
if (str.startsWith("data:")) {
|
|
@@ -19,21 +19,26 @@ function PopoverContent({
|
|
|
19
19
|
className,
|
|
20
20
|
align = "center",
|
|
21
21
|
sideOffset = 4,
|
|
22
|
+
usePortal = true,
|
|
22
23
|
...props
|
|
23
24
|
}) {
|
|
24
|
-
|
|
25
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
26
|
index.Content,
|
|
26
27
|
{
|
|
27
28
|
"data-slot": "popover-content",
|
|
28
29
|
align,
|
|
29
30
|
sideOffset,
|
|
30
31
|
className: utils.cn(
|
|
31
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
32
|
+
"bg-popover text-popover-foreground pointer-events-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
32
33
|
className
|
|
33
34
|
),
|
|
34
35
|
...props
|
|
35
36
|
}
|
|
36
|
-
)
|
|
37
|
+
);
|
|
38
|
+
if (!usePortal) {
|
|
39
|
+
return content;
|
|
40
|
+
}
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Portal, { children: content });
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
exports.Popover = Popover;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Root as Root2, Trigger,
|
|
3
|
+
import { Root as Root2, Trigger, Content as Content2, Portal } from '../../../../node_modules/.pnpm/@radix-ui_react-popover@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_5c5a3ca63b34dfe7d9d23f1e8cee675c/node_modules/@radix-ui/react-popover/dist/index.mjs';
|
|
4
4
|
import { cn } from '../lib/utils.mjs';
|
|
5
5
|
|
|
6
6
|
function Popover({
|
|
@@ -17,21 +17,26 @@ function PopoverContent({
|
|
|
17
17
|
className,
|
|
18
18
|
align = "center",
|
|
19
19
|
sideOffset = 4,
|
|
20
|
+
usePortal = true,
|
|
20
21
|
...props
|
|
21
22
|
}) {
|
|
22
|
-
|
|
23
|
+
const content = /* @__PURE__ */ jsx(
|
|
23
24
|
Content2,
|
|
24
25
|
{
|
|
25
26
|
"data-slot": "popover-content",
|
|
26
27
|
align,
|
|
27
28
|
sideOffset,
|
|
28
29
|
className: cn(
|
|
29
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
30
|
+
"bg-popover text-popover-foreground pointer-events-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
30
31
|
className
|
|
31
32
|
),
|
|
32
33
|
...props
|
|
33
34
|
}
|
|
34
|
-
)
|
|
35
|
+
);
|
|
36
|
+
if (!usePortal) {
|
|
37
|
+
return content;
|
|
38
|
+
}
|
|
39
|
+
return /* @__PURE__ */ jsx(Portal, { children: content });
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
export { Popover, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
const React = require('react');
|
|
6
|
+
const LucideIcons = require('lucide-react');
|
|
7
|
+
const utils = require('../lib/utils.cjs');
|
|
8
|
+
const button = require('./button.cjs');
|
|
9
|
+
const command = require('./command.cjs');
|
|
10
|
+
const popover = require('./popover.cjs');
|
|
11
|
+
|
|
12
|
+
function SearchSelect({
|
|
13
|
+
options,
|
|
14
|
+
value,
|
|
15
|
+
onChange,
|
|
16
|
+
placeholder = "Select option",
|
|
17
|
+
emptyMessage = "No option found."
|
|
18
|
+
}) {
|
|
19
|
+
const id = React.useId();
|
|
20
|
+
const [open, setOpen] = React.useState(false);
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(popover.Popover, { open, onOpenChange: setOpen, modal: false, children: [
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx(popover.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23
|
+
button.Button,
|
|
24
|
+
{
|
|
25
|
+
id,
|
|
26
|
+
variant: "outline",
|
|
27
|
+
role: "combobox",
|
|
28
|
+
"aria-expanded": open,
|
|
29
|
+
className: "bg-background hover:bg-background border-input w-full justify-between px-3 font-normal outline-offset-0 outline-none focus-visible:outline-[3px]",
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: utils.cn("truncate", !value && "text-muted-foreground"), children: value ? options.find((option) => option.value === value)?.label : placeholder }),
|
|
32
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
+
LucideIcons.ChevronDownIcon,
|
|
34
|
+
{
|
|
35
|
+
size: 16,
|
|
36
|
+
className: "text-muted-foreground/80 shrink-0",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
) }),
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
44
|
+
popover.PopoverContent,
|
|
45
|
+
{
|
|
46
|
+
className: "border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 z-[9999]",
|
|
47
|
+
align: "start",
|
|
48
|
+
usePortal: false,
|
|
49
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(command.Command, { children: [
|
|
50
|
+
/* @__PURE__ */ jsxRuntime.jsx(command.CommandInput, { placeholder: "Search options..." }),
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsxs(command.CommandList, { children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(command.CommandEmpty, { children: emptyMessage }),
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx(command.CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
54
|
+
command.CommandItem,
|
|
55
|
+
{
|
|
56
|
+
value: option.value,
|
|
57
|
+
onSelect: (currentValue) => {
|
|
58
|
+
onChange(currentValue === value ? "" : currentValue);
|
|
59
|
+
setOpen(false);
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
option.label,
|
|
63
|
+
value === option.value && /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.CheckIcon, { size: 16, className: "ml-auto" })
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
option.value
|
|
67
|
+
)) })
|
|
68
|
+
] })
|
|
69
|
+
] })
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] });
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
module.exports = SearchSelect;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useId, useState } from 'react';
|
|
4
|
+
import { ChevronDownIcon, CheckIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../lib/utils.mjs';
|
|
6
|
+
import { Button } from './button.mjs';
|
|
7
|
+
import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from './command.mjs';
|
|
8
|
+
import { Popover, PopoverTrigger, PopoverContent } from './popover.mjs';
|
|
9
|
+
|
|
10
|
+
function SearchSelect({
|
|
11
|
+
options,
|
|
12
|
+
value,
|
|
13
|
+
onChange,
|
|
14
|
+
placeholder = "Select option",
|
|
15
|
+
emptyMessage = "No option found."
|
|
16
|
+
}) {
|
|
17
|
+
const id = useId();
|
|
18
|
+
const [open, setOpen] = useState(false);
|
|
19
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, modal: false, children: [
|
|
20
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
21
|
+
Button,
|
|
22
|
+
{
|
|
23
|
+
id,
|
|
24
|
+
variant: "outline",
|
|
25
|
+
role: "combobox",
|
|
26
|
+
"aria-expanded": open,
|
|
27
|
+
className: "bg-background hover:bg-background border-input w-full justify-between px-3 font-normal outline-offset-0 outline-none focus-visible:outline-[3px]",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: cn("truncate", !value && "text-muted-foreground"), children: value ? options.find((option) => option.value === value)?.label : placeholder }),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
ChevronDownIcon,
|
|
32
|
+
{
|
|
33
|
+
size: 16,
|
|
34
|
+
className: "text-muted-foreground/80 shrink-0",
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
) }),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
PopoverContent,
|
|
43
|
+
{
|
|
44
|
+
className: "border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 z-[9999]",
|
|
45
|
+
align: "start",
|
|
46
|
+
usePortal: false,
|
|
47
|
+
children: /* @__PURE__ */ jsxs(Command, { children: [
|
|
48
|
+
/* @__PURE__ */ jsx(CommandInput, { placeholder: "Search options..." }),
|
|
49
|
+
/* @__PURE__ */ jsxs(CommandList, { children: [
|
|
50
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: emptyMessage }),
|
|
51
|
+
/* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
52
|
+
CommandItem,
|
|
53
|
+
{
|
|
54
|
+
value: option.value,
|
|
55
|
+
onSelect: (currentValue) => {
|
|
56
|
+
onChange(currentValue === value ? "" : currentValue);
|
|
57
|
+
setOpen(false);
|
|
58
|
+
},
|
|
59
|
+
children: [
|
|
60
|
+
option.label,
|
|
61
|
+
value === option.value && /* @__PURE__ */ jsx(CheckIcon, { size: 16, className: "ml-auto" })
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
option.value
|
|
65
|
+
)) })
|
|
66
|
+
] })
|
|
67
|
+
] })
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { SearchSelect as default };
|
|
@@ -38,7 +38,8 @@ const UIBuilder = ({
|
|
|
38
38
|
allowPagesDeletion = true,
|
|
39
39
|
navLeftChildren,
|
|
40
40
|
navRightChildren,
|
|
41
|
-
showExport = true
|
|
41
|
+
showExport = true,
|
|
42
|
+
blocks
|
|
42
43
|
}) => {
|
|
43
44
|
const layerStore$1 = useStore.useStore(layerStore.useLayerStore, (state) => state);
|
|
44
45
|
const editorStore$1 = useStore.useStore(editorStore.useEditorStore, (state) => state);
|
|
@@ -57,7 +58,7 @@ const UIBuilder = ({
|
|
|
57
58
|
}, [userPanelConfig, memoizedDefaultTabsContent, navLeftChildren, navRightChildren, showExport]);
|
|
58
59
|
React.useEffect(() => {
|
|
59
60
|
if (editorStore$1 && componentRegistry && !editorStoreInitialized) {
|
|
60
|
-
editorStore$1.initialize(componentRegistry, persistLayerStore, allowPagesCreation, allowPagesDeletion, allowVariableEditing);
|
|
61
|
+
editorStore$1.initialize(componentRegistry, persistLayerStore, allowPagesCreation, allowPagesDeletion, allowVariableEditing, blocks);
|
|
61
62
|
setEditorStoreInitialized(true);
|
|
62
63
|
}
|
|
63
64
|
}, [
|
|
@@ -67,7 +68,8 @@ const UIBuilder = ({
|
|
|
67
68
|
persistLayerStore,
|
|
68
69
|
allowPagesCreation,
|
|
69
70
|
allowPagesDeletion,
|
|
70
|
-
allowVariableEditing
|
|
71
|
+
allowVariableEditing,
|
|
72
|
+
blocks
|
|
71
73
|
]);
|
|
72
74
|
React.useEffect(() => {
|
|
73
75
|
if (layerStore$1 && editorStore$1) {
|
|
@@ -144,11 +146,11 @@ function MainLayout({ panelConfig }) {
|
|
|
144
146
|
});
|
|
145
147
|
React.useEffect(() => {
|
|
146
148
|
const editorPanel = mainPanels.find((panel) => panel.title === "UI Editor");
|
|
147
|
-
const currentPanel = mainPanels.find((panel) => panel.title === selectedPanel
|
|
149
|
+
const currentPanel = mainPanels.find((panel) => panel.title === selectedPanel?.title);
|
|
148
150
|
if (!currentPanel) {
|
|
149
151
|
setSelectedPanel(editorPanel || mainPanels[0]);
|
|
150
152
|
}
|
|
151
|
-
}, [mainPanels, selectedPanel
|
|
153
|
+
}, [mainPanels, selectedPanel?.title]);
|
|
152
154
|
const handlePanelClickById = React.useCallback((e) => {
|
|
153
155
|
const panelIndex = parseInt(e.currentTarget.dataset.panelIndex || "0");
|
|
154
156
|
setSelectedPanel(mainPanels[panelIndex]);
|
|
@@ -180,11 +182,11 @@ function MainLayout({ panelConfig }) {
|
|
|
180
182
|
}
|
|
181
183
|
) }),
|
|
182
184
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex size-full flex-col md:hidden overflow-hidden ", children: [
|
|
183
|
-
selectedPanel
|
|
185
|
+
selectedPanel?.content,
|
|
184
186
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-4 left-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center rounded-full bg-primary p-2 shadow-lg", children: mainPanels.map((panel, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
185
187
|
button.Button,
|
|
186
188
|
{
|
|
187
|
-
variant: selectedPanel
|
|
189
|
+
variant: selectedPanel?.title !== panel.title ? "default" : "secondary",
|
|
188
190
|
size: "sm",
|
|
189
191
|
className: "flex-1",
|
|
190
192
|
"data-panel-index": index,
|
|
@@ -30,7 +30,8 @@ const UIBuilder = ({
|
|
|
30
30
|
allowPagesDeletion = true,
|
|
31
31
|
navLeftChildren,
|
|
32
32
|
navRightChildren,
|
|
33
|
-
showExport = true
|
|
33
|
+
showExport = true,
|
|
34
|
+
blocks
|
|
34
35
|
}) => {
|
|
35
36
|
const layerStore = useStore(useLayerStore, (state) => state);
|
|
36
37
|
const editorStore = useStore(useEditorStore, (state) => state);
|
|
@@ -49,7 +50,7 @@ const UIBuilder = ({
|
|
|
49
50
|
}, [userPanelConfig, memoizedDefaultTabsContent, navLeftChildren, navRightChildren, showExport]);
|
|
50
51
|
useEffect(() => {
|
|
51
52
|
if (editorStore && componentRegistry && !editorStoreInitialized) {
|
|
52
|
-
editorStore.initialize(componentRegistry, persistLayerStore, allowPagesCreation, allowPagesDeletion, allowVariableEditing);
|
|
53
|
+
editorStore.initialize(componentRegistry, persistLayerStore, allowPagesCreation, allowPagesDeletion, allowVariableEditing, blocks);
|
|
53
54
|
setEditorStoreInitialized(true);
|
|
54
55
|
}
|
|
55
56
|
}, [
|
|
@@ -59,7 +60,8 @@ const UIBuilder = ({
|
|
|
59
60
|
persistLayerStore,
|
|
60
61
|
allowPagesCreation,
|
|
61
62
|
allowPagesDeletion,
|
|
62
|
-
allowVariableEditing
|
|
63
|
+
allowVariableEditing,
|
|
64
|
+
blocks
|
|
63
65
|
]);
|
|
64
66
|
useEffect(() => {
|
|
65
67
|
if (layerStore && editorStore) {
|
|
@@ -136,11 +138,11 @@ function MainLayout({ panelConfig }) {
|
|
|
136
138
|
});
|
|
137
139
|
useEffect(() => {
|
|
138
140
|
const editorPanel = mainPanels.find((panel) => panel.title === "UI Editor");
|
|
139
|
-
const currentPanel = mainPanels.find((panel) => panel.title === selectedPanel
|
|
141
|
+
const currentPanel = mainPanels.find((panel) => panel.title === selectedPanel?.title);
|
|
140
142
|
if (!currentPanel) {
|
|
141
143
|
setSelectedPanel(editorPanel || mainPanels[0]);
|
|
142
144
|
}
|
|
143
|
-
}, [mainPanels, selectedPanel
|
|
145
|
+
}, [mainPanels, selectedPanel?.title]);
|
|
144
146
|
const handlePanelClickById = useCallback((e) => {
|
|
145
147
|
const panelIndex = parseInt(e.currentTarget.dataset.panelIndex || "0");
|
|
146
148
|
setSelectedPanel(mainPanels[panelIndex]);
|
|
@@ -172,11 +174,11 @@ function MainLayout({ panelConfig }) {
|
|
|
172
174
|
}
|
|
173
175
|
) }),
|
|
174
176
|
/* @__PURE__ */ jsxs("div", { className: "flex size-full flex-col md:hidden overflow-hidden ", children: [
|
|
175
|
-
selectedPanel
|
|
177
|
+
selectedPanel?.content,
|
|
176
178
|
/* @__PURE__ */ jsx("div", { className: "absolute bottom-4 left-4 right-4 z-50", children: /* @__PURE__ */ jsx("div", { className: "flex justify-center rounded-full bg-primary p-2 shadow-lg", children: mainPanels.map((panel, index) => /* @__PURE__ */ jsx(
|
|
177
179
|
Button,
|
|
178
180
|
{
|
|
179
|
-
variant: selectedPanel
|
|
181
|
+
variant: selectedPanel?.title !== panel.title ? "default" : "secondary",
|
|
180
182
|
size: "sm",
|
|
181
183
|
className: "flex-1",
|
|
182
184
|
"data-panel-index": index,
|
|
@@ -97,7 +97,10 @@ const CopyHostStyles = ({
|
|
|
97
97
|
console.log(
|
|
98
98
|
`Tried to add an element that was already mirrored. Updating instead...`
|
|
99
99
|
);
|
|
100
|
-
elements[index$1]
|
|
100
|
+
const element = elements[index$1];
|
|
101
|
+
if (element?.mirror) {
|
|
102
|
+
element.mirror.innerText = el.innerText;
|
|
103
|
+
}
|
|
101
104
|
return;
|
|
102
105
|
}
|
|
103
106
|
const mirror = await mirrorEl(el);
|
|
@@ -165,13 +168,13 @@ const CopyHostStyles = ({
|
|
|
165
168
|
const parentComputedStyle = win.parent.getComputedStyle(parentHtml);
|
|
166
169
|
for (let i = 0; i < parentComputedStyle.length; i++) {
|
|
167
170
|
const property = parentComputedStyle[i];
|
|
168
|
-
if (property
|
|
171
|
+
if (property?.startsWith("--")) {
|
|
169
172
|
const value = parentComputedStyle.getPropertyValue(property);
|
|
170
173
|
doc.documentElement.style.setProperty(property, value);
|
|
171
174
|
doc.body.style.setProperty(property, value);
|
|
172
175
|
}
|
|
173
176
|
}
|
|
174
|
-
parentBody
|
|
177
|
+
parentBody?.classList.forEach((className) => {
|
|
175
178
|
if (className.includes("font-") || className === "antialiased" || className.includes("__variable")) {
|
|
176
179
|
doc.body.classList.add(className);
|
|
177
180
|
}
|
|
@@ -93,7 +93,10 @@ const CopyHostStyles = ({
|
|
|
93
93
|
console.log(
|
|
94
94
|
`Tried to add an element that was already mirrored. Updating instead...`
|
|
95
95
|
);
|
|
96
|
-
elements[index]
|
|
96
|
+
const element = elements[index];
|
|
97
|
+
if (element?.mirror) {
|
|
98
|
+
element.mirror.innerText = el.innerText;
|
|
99
|
+
}
|
|
97
100
|
return;
|
|
98
101
|
}
|
|
99
102
|
const mirror = await mirrorEl(el);
|
|
@@ -161,13 +164,13 @@ const CopyHostStyles = ({
|
|
|
161
164
|
const parentComputedStyle = win.parent.getComputedStyle(parentHtml);
|
|
162
165
|
for (let i = 0; i < parentComputedStyle.length; i++) {
|
|
163
166
|
const property = parentComputedStyle[i];
|
|
164
|
-
if (property
|
|
167
|
+
if (property?.startsWith("--")) {
|
|
165
168
|
const value = parentComputedStyle.getPropertyValue(property);
|
|
166
169
|
doc.documentElement.style.setProperty(property, value);
|
|
167
170
|
doc.body.style.setProperty(property, value);
|
|
168
171
|
}
|
|
169
172
|
}
|
|
170
|
-
parentBody
|
|
173
|
+
parentBody?.classList.forEach((className) => {
|
|
171
174
|
if (className.includes("font-") || className === "antialiased" || className.includes("__variable")) {
|
|
172
175
|
doc.body.classList.add(className);
|
|
173
176
|
}
|