@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
|
@@ -14,7 +14,7 @@ const visitLayer = (layer, parentLayer, visitor) => {
|
|
|
14
14
|
return updatedLayer;
|
|
15
15
|
};
|
|
16
16
|
const countLayers = (layers) => {
|
|
17
|
-
if (typeof layers === "string") {
|
|
17
|
+
if (typeof layers === "string" || !Array.isArray(layers)) {
|
|
18
18
|
return 0;
|
|
19
19
|
}
|
|
20
20
|
return layers.reduce((count, layer) => {
|
|
@@ -244,7 +244,7 @@ const createComponentLayer = (layerType, componentRegistry, options = {}) => {
|
|
|
244
244
|
const schema = componentDef.schema;
|
|
245
245
|
const defaultProps = "shape" in schema && schema.shape ? schemaUtils.getDefaultProps(schema) : {};
|
|
246
246
|
const defaultChildrenRaw = componentDef.defaultChildren;
|
|
247
|
-
const defaultChildren = typeof defaultChildrenRaw === "string" ? defaultChildrenRaw : defaultChildrenRaw
|
|
247
|
+
const defaultChildren = typeof defaultChildrenRaw === "string" ? defaultChildrenRaw : Array.isArray(defaultChildrenRaw) ? defaultChildrenRaw.map((child) => duplicateWithNewIdsAndName(child, false)) : defaultChildrenRaw ?? [];
|
|
248
248
|
const initialProps = Object.entries(defaultProps).reduce((acc, [key, propDef]) => {
|
|
249
249
|
if (key !== "children") {
|
|
250
250
|
acc[key] = propDef;
|
|
@@ -274,11 +274,12 @@ const moveLayer = (layers, sourceLayerId, targetParentId, targetPosition) => {
|
|
|
274
274
|
const findLayerAndParent = (layers2, parentId = null) => {
|
|
275
275
|
for (let i = 0; i < layers2.length; i++) {
|
|
276
276
|
const layer = layers2[i];
|
|
277
|
+
if (!layer) continue;
|
|
277
278
|
if (layer.id === sourceLayerId) {
|
|
278
279
|
layerToMove = layer;
|
|
279
280
|
return true;
|
|
280
281
|
}
|
|
281
|
-
if (hasLayerChildren(layer)) {
|
|
282
|
+
if (hasLayerChildren(layer) && layer.children) {
|
|
282
283
|
if (findLayerAndParent(layer.children, layer.id)) {
|
|
283
284
|
return true;
|
|
284
285
|
}
|
|
@@ -12,7 +12,7 @@ const visitLayer = (layer, parentLayer, visitor) => {
|
|
|
12
12
|
return updatedLayer;
|
|
13
13
|
};
|
|
14
14
|
const countLayers = (layers) => {
|
|
15
|
-
if (typeof layers === "string") {
|
|
15
|
+
if (typeof layers === "string" || !Array.isArray(layers)) {
|
|
16
16
|
return 0;
|
|
17
17
|
}
|
|
18
18
|
return layers.reduce((count, layer) => {
|
|
@@ -242,7 +242,7 @@ const createComponentLayer = (layerType, componentRegistry, options = {}) => {
|
|
|
242
242
|
const schema = componentDef.schema;
|
|
243
243
|
const defaultProps = "shape" in schema && schema.shape ? getDefaultProps(schema) : {};
|
|
244
244
|
const defaultChildrenRaw = componentDef.defaultChildren;
|
|
245
|
-
const defaultChildren = typeof defaultChildrenRaw === "string" ? defaultChildrenRaw : defaultChildrenRaw
|
|
245
|
+
const defaultChildren = typeof defaultChildrenRaw === "string" ? defaultChildrenRaw : Array.isArray(defaultChildrenRaw) ? defaultChildrenRaw.map((child) => duplicateWithNewIdsAndName(child, false)) : defaultChildrenRaw ?? [];
|
|
246
246
|
const initialProps = Object.entries(defaultProps).reduce((acc, [key, propDef]) => {
|
|
247
247
|
if (key !== "children") {
|
|
248
248
|
acc[key] = propDef;
|
|
@@ -272,11 +272,12 @@ const moveLayer = (layers, sourceLayerId, targetParentId, targetPosition) => {
|
|
|
272
272
|
const findLayerAndParent = (layers2, parentId = null) => {
|
|
273
273
|
for (let i = 0; i < layers2.length; i++) {
|
|
274
274
|
const layer = layers2[i];
|
|
275
|
+
if (!layer) continue;
|
|
275
276
|
if (layer.id === sourceLayerId) {
|
|
276
277
|
layerToMove = layer;
|
|
277
278
|
return true;
|
|
278
279
|
}
|
|
279
|
-
if (hasLayerChildren(layer)) {
|
|
280
|
+
if (hasLayerChildren(layer) && layer.children) {
|
|
280
281
|
if (findLayerAndParent(layer.children, layer.id)) {
|
|
281
282
|
return true;
|
|
282
283
|
}
|
|
@@ -7,6 +7,17 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
7
7
|
|
|
8
8
|
const React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
9
9
|
|
|
10
|
+
function resolveChildrenVariableReference(children, variables, variableValues) {
|
|
11
|
+
if (types.isVariableReference(children)) {
|
|
12
|
+
const variable = variables.find((v) => v.id === children.__variableRef);
|
|
13
|
+
if (variable) {
|
|
14
|
+
const resolvedValue = variableValues?.[variable.id] ?? variable.defaultValue;
|
|
15
|
+
return String(resolvedValue);
|
|
16
|
+
}
|
|
17
|
+
return "";
|
|
18
|
+
}
|
|
19
|
+
return children;
|
|
20
|
+
}
|
|
10
21
|
function resolveVariableReferences(props, variables, variableValues) {
|
|
11
22
|
const resolved = {};
|
|
12
23
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -27,4 +38,5 @@ function resolveVariableReferences(props, variables, variableValues) {
|
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
exports.isVariableReference = types.isVariableReference;
|
|
41
|
+
exports.resolveChildrenVariableReference = resolveChildrenVariableReference;
|
|
30
42
|
exports.resolveVariableReferences = resolveVariableReferences;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { isVariableReference } from '../../../components/ui-builder/types.mjs';
|
|
3
3
|
|
|
4
|
+
function resolveChildrenVariableReference(children, variables, variableValues) {
|
|
5
|
+
if (isVariableReference(children)) {
|
|
6
|
+
const variable = variables.find((v) => v.id === children.__variableRef);
|
|
7
|
+
if (variable) {
|
|
8
|
+
const resolvedValue = variableValues?.[variable.id] ?? variable.defaultValue;
|
|
9
|
+
return String(resolvedValue);
|
|
10
|
+
}
|
|
11
|
+
return "";
|
|
12
|
+
}
|
|
13
|
+
return children;
|
|
14
|
+
}
|
|
4
15
|
function resolveVariableReferences(props, variables, variableValues) {
|
|
5
16
|
const resolved = {};
|
|
6
17
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -20,4 +31,4 @@ function resolveVariableReferences(props, variables, variableValues) {
|
|
|
20
31
|
return resolved;
|
|
21
32
|
}
|
|
22
33
|
|
|
23
|
-
export { isVariableReference, resolveVariableReferences };
|
|
34
|
+
export { isVariableReference, resolveChildrenVariableReference, resolveVariableReferences };
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.CcI4sYJP.cjs';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.CcI4sYJP.mjs';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.CcI4sYJP.js';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CcI4sYJP.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
title: string;
|
|
132
131
|
published: boolean;
|
|
132
|
+
title: string;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CcI4sYJP.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
title: string;
|
|
132
131
|
published: boolean;
|
|
132
|
+
title: string;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CcI4sYJP.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
title: string;
|
|
132
131
|
published: boolean;
|
|
132
|
+
title: string;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.CcI4sYJP.cjs';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.cjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.CcI4sYJP.mjs';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.mjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.CcI4sYJP.js';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.js';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CcI4sYJP.cjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
-
title: z.ZodString;
|
|
148
147
|
slug: z.ZodOptional<z.ZodString>;
|
|
149
148
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
150
149
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
+
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CcI4sYJP.mjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
-
title: z.ZodString;
|
|
148
147
|
slug: z.ZodOptional<z.ZodString>;
|
|
149
148
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
150
149
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
+
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CcI4sYJP.js';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
-
title: z.ZodString;
|
|
148
147
|
slug: z.ZodOptional<z.ZodString>;
|
|
149
148
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
150
149
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
+
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|