@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
|
@@ -9,7 +9,7 @@ interface ComponentLayer<TProps extends Record<string, PropValue> = Record<strin
|
|
|
9
9
|
name?: string;
|
|
10
10
|
type: string;
|
|
11
11
|
props: ComponentProps<TProps>;
|
|
12
|
-
children: ComponentLayer[] | string;
|
|
12
|
+
children: ComponentLayer[] | string | VariableReference;
|
|
13
13
|
}
|
|
14
14
|
type VariableValueType = 'string' | 'number' | 'boolean';
|
|
15
15
|
type VariableValue<T extends VariableValueType> = T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : never;
|
|
@@ -32,9 +32,15 @@ interface RegistryEntry<T extends ComponentType<any>> {
|
|
|
32
32
|
schema: ZodObject<any> | ZodSchema<any>;
|
|
33
33
|
from?: string;
|
|
34
34
|
isFromDefaultExport?: boolean;
|
|
35
|
-
defaultChildren?: ComponentLayer[] | string;
|
|
35
|
+
defaultChildren?: ComponentLayer[] | string | VariableReference;
|
|
36
36
|
defaultVariableBindings?: DefaultVariableBinding[];
|
|
37
37
|
fieldOverrides?: Record<string, FieldConfigFunction>;
|
|
38
|
+
/**
|
|
39
|
+
* If defined, this component can only be added as a child of the specified parent types.
|
|
40
|
+
* Used to filter component options in the add popover and validate drag-and-drop.
|
|
41
|
+
* Example: TabsTrigger has childOf: ["TabsList"]
|
|
42
|
+
*/
|
|
43
|
+
childOf?: string[];
|
|
38
44
|
}
|
|
39
45
|
type FieldConfigFunction = (layer: ComponentLayer, allowVariableBinding?: boolean) => FieldConfigItem;
|
|
40
46
|
type ComponentRegistry = Record<string, RegistryEntry<ComponentType<any>>>;
|
|
@@ -9,7 +9,7 @@ interface ComponentLayer<TProps extends Record<string, PropValue> = Record<strin
|
|
|
9
9
|
name?: string;
|
|
10
10
|
type: string;
|
|
11
11
|
props: ComponentProps<TProps>;
|
|
12
|
-
children: ComponentLayer[] | string;
|
|
12
|
+
children: ComponentLayer[] | string | VariableReference;
|
|
13
13
|
}
|
|
14
14
|
type VariableValueType = 'string' | 'number' | 'boolean';
|
|
15
15
|
type VariableValue<T extends VariableValueType> = T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : never;
|
|
@@ -32,9 +32,15 @@ interface RegistryEntry<T extends ComponentType<any>> {
|
|
|
32
32
|
schema: ZodObject<any> | ZodSchema<any>;
|
|
33
33
|
from?: string;
|
|
34
34
|
isFromDefaultExport?: boolean;
|
|
35
|
-
defaultChildren?: ComponentLayer[] | string;
|
|
35
|
+
defaultChildren?: ComponentLayer[] | string | VariableReference;
|
|
36
36
|
defaultVariableBindings?: DefaultVariableBinding[];
|
|
37
37
|
fieldOverrides?: Record<string, FieldConfigFunction>;
|
|
38
|
+
/**
|
|
39
|
+
* If defined, this component can only be added as a child of the specified parent types.
|
|
40
|
+
* Used to filter component options in the add popover and validate drag-and-drop.
|
|
41
|
+
* Example: TabsTrigger has childOf: ["TabsList"]
|
|
42
|
+
*/
|
|
43
|
+
childOf?: string[];
|
|
38
44
|
}
|
|
39
45
|
type FieldConfigFunction = (layer: ComponentLayer, allowVariableBinding?: boolean) => FieldConfigItem;
|
|
40
46
|
type ComponentRegistry = Record<string, RegistryEntry<ComponentType<any>>>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Priority levels for tasks
|
|
3
|
+
*/
|
|
4
|
+
type Priority = "LOW" | "MEDIUM" | "HIGH" | "URGENT";
|
|
5
|
+
/**
|
|
6
|
+
* Kanban Board
|
|
7
|
+
*/
|
|
8
|
+
type Board = {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
ownerId?: string;
|
|
14
|
+
organizationId?: string;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Kanban Column
|
|
20
|
+
*/
|
|
21
|
+
type Column = {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
order: number;
|
|
25
|
+
boardId: string;
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt: Date;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Kanban Task
|
|
31
|
+
*/
|
|
32
|
+
type Task = {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
priority: Priority;
|
|
37
|
+
order: number;
|
|
38
|
+
columnId: string;
|
|
39
|
+
assigneeId?: string;
|
|
40
|
+
completedAt?: Date;
|
|
41
|
+
isArchived: boolean;
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
updatedAt: Date;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Column with its tasks
|
|
47
|
+
*/
|
|
48
|
+
type ColumnWithTasks = Column & {
|
|
49
|
+
tasks: Task[];
|
|
50
|
+
};
|
|
51
|
+
interface SerializedTask extends Omit<Task, "createdAt" | "updatedAt" | "completedAt"> {
|
|
52
|
+
completedAt?: string;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt: string;
|
|
55
|
+
}
|
|
56
|
+
interface SerializedColumn extends Omit<Column, "createdAt" | "updatedAt"> {
|
|
57
|
+
createdAt: string;
|
|
58
|
+
updatedAt: string;
|
|
59
|
+
tasks?: SerializedTask[];
|
|
60
|
+
}
|
|
61
|
+
interface SerializedBoard extends Omit<Board, "createdAt" | "updatedAt"> {
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
columns?: SerializedColumn[];
|
|
65
|
+
}
|
|
66
|
+
interface SerializedBoardWithColumns extends SerializedBoard {
|
|
67
|
+
columns: SerializedColumn[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type { Board as B, Column as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedBoard as a, SerializedColumn as b, SerializedTask as c, ColumnWithTasks as d };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Priority levels for tasks
|
|
3
|
+
*/
|
|
4
|
+
type Priority = "LOW" | "MEDIUM" | "HIGH" | "URGENT";
|
|
5
|
+
/**
|
|
6
|
+
* Kanban Board
|
|
7
|
+
*/
|
|
8
|
+
type Board = {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
ownerId?: string;
|
|
14
|
+
organizationId?: string;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Kanban Column
|
|
20
|
+
*/
|
|
21
|
+
type Column = {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
order: number;
|
|
25
|
+
boardId: string;
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt: Date;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Kanban Task
|
|
31
|
+
*/
|
|
32
|
+
type Task = {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
priority: Priority;
|
|
37
|
+
order: number;
|
|
38
|
+
columnId: string;
|
|
39
|
+
assigneeId?: string;
|
|
40
|
+
completedAt?: Date;
|
|
41
|
+
isArchived: boolean;
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
updatedAt: Date;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Column with its tasks
|
|
47
|
+
*/
|
|
48
|
+
type ColumnWithTasks = Column & {
|
|
49
|
+
tasks: Task[];
|
|
50
|
+
};
|
|
51
|
+
interface SerializedTask extends Omit<Task, "createdAt" | "updatedAt" | "completedAt"> {
|
|
52
|
+
completedAt?: string;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt: string;
|
|
55
|
+
}
|
|
56
|
+
interface SerializedColumn extends Omit<Column, "createdAt" | "updatedAt"> {
|
|
57
|
+
createdAt: string;
|
|
58
|
+
updatedAt: string;
|
|
59
|
+
tasks?: SerializedTask[];
|
|
60
|
+
}
|
|
61
|
+
interface SerializedBoard extends Omit<Board, "createdAt" | "updatedAt"> {
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
columns?: SerializedColumn[];
|
|
65
|
+
}
|
|
66
|
+
interface SerializedBoardWithColumns extends SerializedBoard {
|
|
67
|
+
columns: SerializedColumn[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type { Board as B, Column as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedBoard as a, SerializedColumn as b, SerializedTask as c, ColumnWithTasks as d };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Priority levels for tasks
|
|
3
|
+
*/
|
|
4
|
+
type Priority = "LOW" | "MEDIUM" | "HIGH" | "URGENT";
|
|
5
|
+
/**
|
|
6
|
+
* Kanban Board
|
|
7
|
+
*/
|
|
8
|
+
type Board = {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
ownerId?: string;
|
|
14
|
+
organizationId?: string;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Kanban Column
|
|
20
|
+
*/
|
|
21
|
+
type Column = {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
order: number;
|
|
25
|
+
boardId: string;
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt: Date;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Kanban Task
|
|
31
|
+
*/
|
|
32
|
+
type Task = {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
priority: Priority;
|
|
37
|
+
order: number;
|
|
38
|
+
columnId: string;
|
|
39
|
+
assigneeId?: string;
|
|
40
|
+
completedAt?: Date;
|
|
41
|
+
isArchived: boolean;
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
updatedAt: Date;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Column with its tasks
|
|
47
|
+
*/
|
|
48
|
+
type ColumnWithTasks = Column & {
|
|
49
|
+
tasks: Task[];
|
|
50
|
+
};
|
|
51
|
+
interface SerializedTask extends Omit<Task, "createdAt" | "updatedAt" | "completedAt"> {
|
|
52
|
+
completedAt?: string;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt: string;
|
|
55
|
+
}
|
|
56
|
+
interface SerializedColumn extends Omit<Column, "createdAt" | "updatedAt"> {
|
|
57
|
+
createdAt: string;
|
|
58
|
+
updatedAt: string;
|
|
59
|
+
tasks?: SerializedTask[];
|
|
60
|
+
}
|
|
61
|
+
interface SerializedBoard extends Omit<Board, "createdAt" | "updatedAt"> {
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
columns?: SerializedColumn[];
|
|
65
|
+
}
|
|
66
|
+
interface SerializedBoardWithColumns extends SerializedBoard {
|
|
67
|
+
columns: SerializedColumn[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type { Board as B, Column as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedBoard as a, SerializedColumn as b, SerializedTask as c, ColumnWithTasks as d };
|
|
@@ -9,7 +9,7 @@ interface ComponentLayer<TProps extends Record<string, PropValue> = Record<strin
|
|
|
9
9
|
name?: string;
|
|
10
10
|
type: string;
|
|
11
11
|
props: ComponentProps<TProps>;
|
|
12
|
-
children: ComponentLayer[] | string;
|
|
12
|
+
children: ComponentLayer[] | string | VariableReference;
|
|
13
13
|
}
|
|
14
14
|
type VariableValueType = 'string' | 'number' | 'boolean';
|
|
15
15
|
type VariableValue<T extends VariableValueType> = T extends 'string' ? string : T extends 'number' ? number : T extends 'boolean' ? boolean : never;
|
|
@@ -32,9 +32,15 @@ interface RegistryEntry<T extends ComponentType<any>> {
|
|
|
32
32
|
schema: ZodObject<any> | ZodSchema<any>;
|
|
33
33
|
from?: string;
|
|
34
34
|
isFromDefaultExport?: boolean;
|
|
35
|
-
defaultChildren?: ComponentLayer[] | string;
|
|
35
|
+
defaultChildren?: ComponentLayer[] | string | VariableReference;
|
|
36
36
|
defaultVariableBindings?: DefaultVariableBinding[];
|
|
37
37
|
fieldOverrides?: Record<string, FieldConfigFunction>;
|
|
38
|
+
/**
|
|
39
|
+
* If defined, this component can only be added as a child of the specified parent types.
|
|
40
|
+
* Used to filter component options in the add popover and validate drag-and-drop.
|
|
41
|
+
* Example: TabsTrigger has childOf: ["TabsList"]
|
|
42
|
+
*/
|
|
43
|
+
childOf?: string[];
|
|
38
44
|
}
|
|
39
45
|
type FieldConfigFunction = (layer: ComponentLayer, allowVariableBinding?: boolean) => FieldConfigItem;
|
|
40
46
|
type ComponentRegistry = Record<string, RegistryEntry<ComponentType<any>>>;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
interface KanbanCommonLocalization {
|
|
4
|
+
backToBoards: string;
|
|
5
|
+
actions: string;
|
|
6
|
+
create: string;
|
|
7
|
+
edit: string;
|
|
8
|
+
delete: string;
|
|
9
|
+
cancel: string;
|
|
10
|
+
save: string;
|
|
11
|
+
loading: string;
|
|
12
|
+
saving: string;
|
|
13
|
+
deleting: string;
|
|
14
|
+
board: string;
|
|
15
|
+
boards: string;
|
|
16
|
+
column: string;
|
|
17
|
+
columns: string;
|
|
18
|
+
task: string;
|
|
19
|
+
tasks: string;
|
|
20
|
+
priorityLow: string;
|
|
21
|
+
priorityMedium: string;
|
|
22
|
+
priorityHigh: string;
|
|
23
|
+
priorityUrgent: string;
|
|
24
|
+
noBoards: string;
|
|
25
|
+
noColumns: string;
|
|
26
|
+
noTasks: string;
|
|
27
|
+
errorGeneric: string;
|
|
28
|
+
errorNotFound: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface KanbanFormsLocalization {
|
|
32
|
+
boardName: string;
|
|
33
|
+
boardNamePlaceholder: string;
|
|
34
|
+
boardDescription: string;
|
|
35
|
+
boardDescriptionPlaceholder: string;
|
|
36
|
+
createBoard: string;
|
|
37
|
+
updateBoard: string;
|
|
38
|
+
deleteBoard: string;
|
|
39
|
+
deleteBoardConfirm: string;
|
|
40
|
+
columnTitle: string;
|
|
41
|
+
columnTitlePlaceholder: string;
|
|
42
|
+
createColumn: string;
|
|
43
|
+
updateColumn: string;
|
|
44
|
+
deleteColumn: string;
|
|
45
|
+
deleteColumnConfirm: string;
|
|
46
|
+
taskTitle: string;
|
|
47
|
+
taskTitlePlaceholder: string;
|
|
48
|
+
taskDescription: string;
|
|
49
|
+
taskDescriptionPlaceholder: string;
|
|
50
|
+
taskPriority: string;
|
|
51
|
+
taskColumn: string;
|
|
52
|
+
taskAssignee: string;
|
|
53
|
+
createTask: string;
|
|
54
|
+
updateTask: string;
|
|
55
|
+
deleteTask: string;
|
|
56
|
+
deleteTaskConfirm: string;
|
|
57
|
+
nameRequired: string;
|
|
58
|
+
titleRequired: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface KanbanListLocalization {
|
|
62
|
+
kanbanBoards: string;
|
|
63
|
+
manageProjects: string;
|
|
64
|
+
createNewBoard: string;
|
|
65
|
+
boardDetails: string;
|
|
66
|
+
newBoard: string;
|
|
67
|
+
addColumn: string;
|
|
68
|
+
addTask: string;
|
|
69
|
+
columnsCount: string;
|
|
70
|
+
noBoardsDescription: string;
|
|
71
|
+
noColumnsDescription: string;
|
|
72
|
+
noTasksDescription: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type KanbanLocalization = Partial<KanbanCommonLocalization & KanbanFormsLocalization & KanbanListLocalization>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* User information for assignee display/selection
|
|
79
|
+
* Framework-agnostic - consumers map their auth system to this shape
|
|
80
|
+
*/
|
|
81
|
+
interface KanbanUser {
|
|
82
|
+
id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
avatarUrl?: string;
|
|
85
|
+
email?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Context passed to lifecycle hooks
|
|
89
|
+
*/
|
|
90
|
+
interface RouteContext {
|
|
91
|
+
/** Current route path */
|
|
92
|
+
path: string;
|
|
93
|
+
/** Route parameters (e.g., { boardId: "abc123" }) */
|
|
94
|
+
params?: Record<string, string>;
|
|
95
|
+
/** Whether rendering on server (true) or client (false) */
|
|
96
|
+
isSSR: boolean;
|
|
97
|
+
/** Additional context properties */
|
|
98
|
+
[key: string]: unknown;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Overridable components and functions for the Kanban plugin
|
|
102
|
+
*
|
|
103
|
+
* External consumers can provide their own implementations of these
|
|
104
|
+
* to customize the behavior for their framework (Next.js, React Router, etc.)
|
|
105
|
+
*/
|
|
106
|
+
interface KanbanPluginOverrides {
|
|
107
|
+
/**
|
|
108
|
+
* Link component for navigation
|
|
109
|
+
*/
|
|
110
|
+
Link?: ComponentType<React.ComponentProps<"a"> & Record<string, unknown>>;
|
|
111
|
+
/**
|
|
112
|
+
* Navigation function for programmatic navigation
|
|
113
|
+
*/
|
|
114
|
+
navigate: (path: string) => void | Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Refresh function to invalidate server-side cache (e.g., Next.js router.refresh())
|
|
117
|
+
*/
|
|
118
|
+
refresh?: () => void | Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Image component for displaying images
|
|
121
|
+
*/
|
|
122
|
+
Image?: ComponentType<React.ImgHTMLAttributes<HTMLImageElement> & Record<string, unknown>>;
|
|
123
|
+
/**
|
|
124
|
+
* Localization object for the kanban plugin
|
|
125
|
+
*/
|
|
126
|
+
localization?: KanbanLocalization;
|
|
127
|
+
/**
|
|
128
|
+
* API base URL
|
|
129
|
+
*/
|
|
130
|
+
apiBaseURL: string;
|
|
131
|
+
/**
|
|
132
|
+
* API base path
|
|
133
|
+
*/
|
|
134
|
+
apiBasePath: string;
|
|
135
|
+
/**
|
|
136
|
+
* Whether to show the attribution
|
|
137
|
+
*/
|
|
138
|
+
showAttribution?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Optional headers to pass with API requests (e.g., for SSR auth)
|
|
141
|
+
*/
|
|
142
|
+
headers?: HeadersInit;
|
|
143
|
+
/**
|
|
144
|
+
* Resolve user info from an assigneeId
|
|
145
|
+
* Called when rendering task cards/forms that have an assignee
|
|
146
|
+
* Return null for unknown users (will show fallback UI)
|
|
147
|
+
*/
|
|
148
|
+
resolveUser: (userId: string) => Promise<KanbanUser | null> | KanbanUser | null;
|
|
149
|
+
/**
|
|
150
|
+
* Search/list users available for assignment
|
|
151
|
+
* Called when user opens the assignee picker
|
|
152
|
+
* @param query - Search query (empty string for initial load)
|
|
153
|
+
* @param boardId - Optional board context for scoped user lists
|
|
154
|
+
*/
|
|
155
|
+
searchUsers: (query: string, boardId?: string) => Promise<KanbanUser[]> | KanbanUser[];
|
|
156
|
+
/**
|
|
157
|
+
* Called when a route is rendered
|
|
158
|
+
* @param routeName - Name of the route (e.g., 'boards', 'board', 'newBoard')
|
|
159
|
+
* @param context - Route context with path, params, etc.
|
|
160
|
+
*/
|
|
161
|
+
onRouteRender?: (routeName: string, context: RouteContext) => void | Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Called when a route encounters an error
|
|
164
|
+
* @param routeName - Name of the route
|
|
165
|
+
* @param error - The error that occurred
|
|
166
|
+
* @param context - Route context
|
|
167
|
+
*/
|
|
168
|
+
onRouteError?: (routeName: string, error: Error, context: RouteContext) => void | Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* Called before the boards list page is rendered
|
|
171
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
172
|
+
* @param context - Route context
|
|
173
|
+
*/
|
|
174
|
+
onBeforeBoardsPageRendered?: (context: RouteContext) => boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Called before a single board page is rendered
|
|
177
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
178
|
+
* @param boardId - The board ID
|
|
179
|
+
* @param context - Route context
|
|
180
|
+
*/
|
|
181
|
+
onBeforeBoardPageRendered?: (boardId: string, context: RouteContext) => boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Called before the new board page is rendered
|
|
184
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
185
|
+
* @param context - Route context
|
|
186
|
+
*/
|
|
187
|
+
onBeforeNewBoardPageRendered?: (context: RouteContext) => boolean;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type { KanbanPluginOverrides as K, KanbanUser as a };
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
interface KanbanCommonLocalization {
|
|
4
|
+
backToBoards: string;
|
|
5
|
+
actions: string;
|
|
6
|
+
create: string;
|
|
7
|
+
edit: string;
|
|
8
|
+
delete: string;
|
|
9
|
+
cancel: string;
|
|
10
|
+
save: string;
|
|
11
|
+
loading: string;
|
|
12
|
+
saving: string;
|
|
13
|
+
deleting: string;
|
|
14
|
+
board: string;
|
|
15
|
+
boards: string;
|
|
16
|
+
column: string;
|
|
17
|
+
columns: string;
|
|
18
|
+
task: string;
|
|
19
|
+
tasks: string;
|
|
20
|
+
priorityLow: string;
|
|
21
|
+
priorityMedium: string;
|
|
22
|
+
priorityHigh: string;
|
|
23
|
+
priorityUrgent: string;
|
|
24
|
+
noBoards: string;
|
|
25
|
+
noColumns: string;
|
|
26
|
+
noTasks: string;
|
|
27
|
+
errorGeneric: string;
|
|
28
|
+
errorNotFound: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface KanbanFormsLocalization {
|
|
32
|
+
boardName: string;
|
|
33
|
+
boardNamePlaceholder: string;
|
|
34
|
+
boardDescription: string;
|
|
35
|
+
boardDescriptionPlaceholder: string;
|
|
36
|
+
createBoard: string;
|
|
37
|
+
updateBoard: string;
|
|
38
|
+
deleteBoard: string;
|
|
39
|
+
deleteBoardConfirm: string;
|
|
40
|
+
columnTitle: string;
|
|
41
|
+
columnTitlePlaceholder: string;
|
|
42
|
+
createColumn: string;
|
|
43
|
+
updateColumn: string;
|
|
44
|
+
deleteColumn: string;
|
|
45
|
+
deleteColumnConfirm: string;
|
|
46
|
+
taskTitle: string;
|
|
47
|
+
taskTitlePlaceholder: string;
|
|
48
|
+
taskDescription: string;
|
|
49
|
+
taskDescriptionPlaceholder: string;
|
|
50
|
+
taskPriority: string;
|
|
51
|
+
taskColumn: string;
|
|
52
|
+
taskAssignee: string;
|
|
53
|
+
createTask: string;
|
|
54
|
+
updateTask: string;
|
|
55
|
+
deleteTask: string;
|
|
56
|
+
deleteTaskConfirm: string;
|
|
57
|
+
nameRequired: string;
|
|
58
|
+
titleRequired: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface KanbanListLocalization {
|
|
62
|
+
kanbanBoards: string;
|
|
63
|
+
manageProjects: string;
|
|
64
|
+
createNewBoard: string;
|
|
65
|
+
boardDetails: string;
|
|
66
|
+
newBoard: string;
|
|
67
|
+
addColumn: string;
|
|
68
|
+
addTask: string;
|
|
69
|
+
columnsCount: string;
|
|
70
|
+
noBoardsDescription: string;
|
|
71
|
+
noColumnsDescription: string;
|
|
72
|
+
noTasksDescription: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type KanbanLocalization = Partial<KanbanCommonLocalization & KanbanFormsLocalization & KanbanListLocalization>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* User information for assignee display/selection
|
|
79
|
+
* Framework-agnostic - consumers map their auth system to this shape
|
|
80
|
+
*/
|
|
81
|
+
interface KanbanUser {
|
|
82
|
+
id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
avatarUrl?: string;
|
|
85
|
+
email?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Context passed to lifecycle hooks
|
|
89
|
+
*/
|
|
90
|
+
interface RouteContext {
|
|
91
|
+
/** Current route path */
|
|
92
|
+
path: string;
|
|
93
|
+
/** Route parameters (e.g., { boardId: "abc123" }) */
|
|
94
|
+
params?: Record<string, string>;
|
|
95
|
+
/** Whether rendering on server (true) or client (false) */
|
|
96
|
+
isSSR: boolean;
|
|
97
|
+
/** Additional context properties */
|
|
98
|
+
[key: string]: unknown;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Overridable components and functions for the Kanban plugin
|
|
102
|
+
*
|
|
103
|
+
* External consumers can provide their own implementations of these
|
|
104
|
+
* to customize the behavior for their framework (Next.js, React Router, etc.)
|
|
105
|
+
*/
|
|
106
|
+
interface KanbanPluginOverrides {
|
|
107
|
+
/**
|
|
108
|
+
* Link component for navigation
|
|
109
|
+
*/
|
|
110
|
+
Link?: ComponentType<React.ComponentProps<"a"> & Record<string, unknown>>;
|
|
111
|
+
/**
|
|
112
|
+
* Navigation function for programmatic navigation
|
|
113
|
+
*/
|
|
114
|
+
navigate: (path: string) => void | Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Refresh function to invalidate server-side cache (e.g., Next.js router.refresh())
|
|
117
|
+
*/
|
|
118
|
+
refresh?: () => void | Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Image component for displaying images
|
|
121
|
+
*/
|
|
122
|
+
Image?: ComponentType<React.ImgHTMLAttributes<HTMLImageElement> & Record<string, unknown>>;
|
|
123
|
+
/**
|
|
124
|
+
* Localization object for the kanban plugin
|
|
125
|
+
*/
|
|
126
|
+
localization?: KanbanLocalization;
|
|
127
|
+
/**
|
|
128
|
+
* API base URL
|
|
129
|
+
*/
|
|
130
|
+
apiBaseURL: string;
|
|
131
|
+
/**
|
|
132
|
+
* API base path
|
|
133
|
+
*/
|
|
134
|
+
apiBasePath: string;
|
|
135
|
+
/**
|
|
136
|
+
* Whether to show the attribution
|
|
137
|
+
*/
|
|
138
|
+
showAttribution?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Optional headers to pass with API requests (e.g., for SSR auth)
|
|
141
|
+
*/
|
|
142
|
+
headers?: HeadersInit;
|
|
143
|
+
/**
|
|
144
|
+
* Resolve user info from an assigneeId
|
|
145
|
+
* Called when rendering task cards/forms that have an assignee
|
|
146
|
+
* Return null for unknown users (will show fallback UI)
|
|
147
|
+
*/
|
|
148
|
+
resolveUser: (userId: string) => Promise<KanbanUser | null> | KanbanUser | null;
|
|
149
|
+
/**
|
|
150
|
+
* Search/list users available for assignment
|
|
151
|
+
* Called when user opens the assignee picker
|
|
152
|
+
* @param query - Search query (empty string for initial load)
|
|
153
|
+
* @param boardId - Optional board context for scoped user lists
|
|
154
|
+
*/
|
|
155
|
+
searchUsers: (query: string, boardId?: string) => Promise<KanbanUser[]> | KanbanUser[];
|
|
156
|
+
/**
|
|
157
|
+
* Called when a route is rendered
|
|
158
|
+
* @param routeName - Name of the route (e.g., 'boards', 'board', 'newBoard')
|
|
159
|
+
* @param context - Route context with path, params, etc.
|
|
160
|
+
*/
|
|
161
|
+
onRouteRender?: (routeName: string, context: RouteContext) => void | Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Called when a route encounters an error
|
|
164
|
+
* @param routeName - Name of the route
|
|
165
|
+
* @param error - The error that occurred
|
|
166
|
+
* @param context - Route context
|
|
167
|
+
*/
|
|
168
|
+
onRouteError?: (routeName: string, error: Error, context: RouteContext) => void | Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* Called before the boards list page is rendered
|
|
171
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
172
|
+
* @param context - Route context
|
|
173
|
+
*/
|
|
174
|
+
onBeforeBoardsPageRendered?: (context: RouteContext) => boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Called before a single board page is rendered
|
|
177
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
178
|
+
* @param boardId - The board ID
|
|
179
|
+
* @param context - Route context
|
|
180
|
+
*/
|
|
181
|
+
onBeforeBoardPageRendered?: (boardId: string, context: RouteContext) => boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Called before the new board page is rendered
|
|
184
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
185
|
+
* @param context - Route context
|
|
186
|
+
*/
|
|
187
|
+
onBeforeNewBoardPageRendered?: (context: RouteContext) => boolean;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type { KanbanPluginOverrides as K, KanbanUser as a };
|