@btst/stack 2.6.0 → 2.6.2

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.
Files changed (165) hide show
  1. package/dist/components/auto-form/index.cjs +8 -0
  2. package/dist/components/auto-form/index.d.cts +26 -0
  3. package/dist/components/auto-form/index.d.mts +26 -0
  4. package/dist/components/auto-form/index.d.ts +26 -0
  5. package/dist/components/auto-form/index.mjs +1 -0
  6. package/dist/components/empty/index.cjs +12 -0
  7. package/dist/components/empty/index.d.cts +15 -0
  8. package/dist/components/empty/index.d.mts +15 -0
  9. package/dist/components/empty/index.d.ts +15 -0
  10. package/dist/components/empty/index.mjs +1 -0
  11. package/dist/components/form-builder/index.cjs +16 -0
  12. package/dist/components/form-builder/index.d.cts +385 -0
  13. package/dist/components/form-builder/index.d.mts +385 -0
  14. package/dist/components/form-builder/index.d.ts +385 -0
  15. package/dist/components/form-builder/index.mjs +4 -0
  16. package/dist/components/markdown/index.cjs +9 -0
  17. package/dist/components/markdown/index.d.cts +30 -0
  18. package/dist/components/markdown/index.d.mts +30 -0
  19. package/dist/components/markdown/index.d.ts +30 -0
  20. package/dist/components/markdown/index.mjs +2 -0
  21. package/dist/components/markdown/style.css +394 -0
  22. package/dist/components/minimal-tiptap/style.css +548 -0
  23. package/dist/components/multi-select/index.cjs +7 -0
  24. package/dist/components/multi-select/index.d.cts +78 -0
  25. package/dist/components/multi-select/index.d.mts +78 -0
  26. package/dist/components/multi-select/index.d.ts +78 -0
  27. package/dist/components/multi-select/index.mjs +1 -0
  28. package/dist/components/search-select/index.cjs +7 -0
  29. package/dist/components/search-select/index.d.cts +15 -0
  30. package/dist/components/search-select/index.d.mts +15 -0
  31. package/dist/components/search-select/index.d.ts +15 -0
  32. package/dist/components/search-select/index.mjs +1 -0
  33. package/dist/components/stepped-auto-form/index.cjs +7 -0
  34. package/dist/components/stepped-auto-form/index.d.cts +37 -0
  35. package/dist/components/stepped-auto-form/index.d.mts +37 -0
  36. package/dist/components/stepped-auto-form/index.d.ts +37 -0
  37. package/dist/components/stepped-auto-form/index.mjs +1 -0
  38. package/dist/components/ui-builder/style.css +552 -0
  39. 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
  40. 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
  41. 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 +2 -2
  42. package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +1 -1
  43. package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +3 -3
  44. package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +1 -1
  45. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-layout.cjs +20 -2
  46. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-layout.mjs +20 -2
  47. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.cjs +23 -0
  48. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.mjs +21 -0
  49. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.cjs +11 -12
  50. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.mjs +11 -12
  51. package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.cjs +2 -2
  52. package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.mjs +2 -2
  53. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.cjs +0 -3
  54. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.mjs +1 -1
  55. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.cjs +0 -3
  56. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.mjs +1 -1
  57. package/dist/packages/ui/src/components/auto-form/index.cjs +12 -2
  58. package/dist/packages/ui/src/components/auto-form/index.mjs +9 -2
  59. package/dist/packages/ui/src/components/auto-form/stepped-auto-form.cjs +2 -2
  60. package/dist/packages/ui/src/components/empty.cjs +28 -0
  61. package/dist/packages/ui/src/components/empty.mjs +27 -1
  62. package/dist/packages/ui/src/components/form-builder/components/index.mjs +2 -2
  63. package/dist/packages/ui/src/components/form-builder/edit-field-dialog.cjs +1 -1
  64. package/dist/packages/ui/src/components/form-builder/index.mjs +2 -2
  65. package/dist/packages/ui/src/components/form.mjs +1 -1
  66. package/dist/packages/ui/src/components/kanban.mjs +1 -1
  67. package/dist/packages/ui/src/components/multi-select.mjs +2 -2
  68. package/dist/packages/ui/src/components/ui-builder/internal/config-panel.cjs +1 -1
  69. package/dist/packages/ui/src/components/ui-builder/internal/props-panel.cjs +1 -1
  70. package/dist/plugins/ai-chat/client/components/index.d.cts +1 -1
  71. package/dist/plugins/ai-chat/client/components/index.d.mts +1 -1
  72. package/dist/plugins/ai-chat/client/components/index.d.ts +1 -1
  73. package/dist/plugins/ai-chat/client/index.d.cts +2 -2
  74. package/dist/plugins/ai-chat/client/index.d.mts +2 -2
  75. package/dist/plugins/ai-chat/client/index.d.ts +2 -2
  76. package/dist/plugins/blog/api/index.d.cts +2 -2
  77. package/dist/plugins/blog/api/index.d.mts +2 -2
  78. package/dist/plugins/blog/api/index.d.ts +2 -2
  79. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  80. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  81. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  82. package/dist/plugins/blog/client/index.d.cts +2 -2
  83. package/dist/plugins/blog/client/index.d.mts +2 -2
  84. package/dist/plugins/blog/client/index.d.ts +2 -2
  85. package/dist/plugins/blog/query-keys.d.cts +2 -2
  86. package/dist/plugins/blog/query-keys.d.mts +2 -2
  87. package/dist/plugins/blog/query-keys.d.ts +2 -2
  88. package/dist/plugins/cms/client/index.d.cts +1 -1
  89. package/dist/plugins/cms/client/index.d.mts +1 -1
  90. package/dist/plugins/cms/client/index.d.ts +1 -1
  91. package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
  92. package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
  93. package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
  94. package/dist/plugins/form-builder/client/index.d.cts +1 -1
  95. package/dist/plugins/form-builder/client/index.d.mts +1 -1
  96. package/dist/plugins/form-builder/client/index.d.ts +1 -1
  97. package/dist/plugins/kanban/api/index.d.cts +1 -1
  98. package/dist/plugins/kanban/api/index.d.mts +1 -1
  99. package/dist/plugins/kanban/api/index.d.ts +1 -1
  100. package/dist/plugins/kanban/query-keys.d.cts +1 -1
  101. package/dist/plugins/kanban/query-keys.d.mts +1 -1
  102. package/dist/plugins/kanban/query-keys.d.ts +1 -1
  103. package/dist/plugins/ui-builder/client/components/index.d.cts +2 -2
  104. package/dist/plugins/ui-builder/client/components/index.d.mts +2 -2
  105. package/dist/plugins/ui-builder/client/components/index.d.ts +2 -2
  106. package/dist/plugins/ui-builder/client/hooks/index.d.cts +3 -3
  107. package/dist/plugins/ui-builder/client/hooks/index.d.mts +3 -3
  108. package/dist/plugins/ui-builder/client/hooks/index.d.ts +3 -3
  109. package/dist/plugins/ui-builder/client/index.d.cts +3 -3
  110. package/dist/plugins/ui-builder/client/index.d.mts +3 -3
  111. package/dist/plugins/ui-builder/client/index.d.ts +3 -3
  112. package/dist/plugins/ui-builder/index.d.cts +3 -3
  113. package/dist/plugins/ui-builder/index.d.mts +3 -3
  114. package/dist/plugins/ui-builder/index.d.ts +3 -3
  115. package/dist/shared/{stack.B2DwzF3r.d.ts → stack.ASwEoINr.d.ts} +1 -1
  116. package/dist/shared/{stack.C5ZSOJGJ.d.cts → stack.B1srlBud.d.mts} +1 -1
  117. package/dist/shared/{stack.CQAZwXhV.d.cts → stack.B8vT-Yt4.d.mts} +3 -3
  118. package/dist/shared/{stack.D3BsrpAz.d.ts → stack.BAT540yW.d.ts} +3 -3
  119. package/dist/shared/{stack.D0QupDcQ.d.ts → stack.BK9Z2dcL.d.ts} +1 -1
  120. package/dist/shared/{stack.CNLHlv7r.d.mts → stack.BwA7trxA.d.cts} +3 -3
  121. package/dist/shared/{stack.Cl7ok_cY.d.cts → stack.CFECM0ew.d.cts} +1 -1
  122. package/dist/shared/stack.CZMWR72v.d.cts +10 -0
  123. package/dist/shared/stack.CZMWR72v.d.mts +10 -0
  124. package/dist/shared/stack.CZMWR72v.d.ts +10 -0
  125. package/dist/shared/{stack.VMmQdbsJ.d.mts → stack.DVtk5CNw.d.mts} +1 -1
  126. package/dist/shared/{stack.B8_74ror.d.ts → stack.DXnclTG7.d.ts} +4 -4
  127. package/dist/shared/{stack.CL4mKxe7.d.mts → stack.DaZM10cp.d.cts} +4 -4
  128. package/dist/shared/{stack.Dq4qVr1F.d.mts → stack.DmpPDPxA.d.cts} +1 -1
  129. package/dist/shared/{stack.C21-LFX8.d.cts → stack.cfCkioTe.d.mts} +4 -4
  130. package/dist/shared/stack.fdi94T4S.d.cts +291 -0
  131. package/dist/shared/stack.fdi94T4S.d.mts +291 -0
  132. package/dist/shared/stack.fdi94T4S.d.ts +291 -0
  133. package/dist/shared/{stack.BV9hnvu4.d.cts → stack.sba323Ml.d.cts} +2 -0
  134. package/dist/shared/{stack.BV9hnvu4.d.mts → stack.sba323Ml.d.mts} +2 -0
  135. package/dist/shared/{stack.BV9hnvu4.d.ts → stack.sba323Ml.d.ts} +2 -0
  136. package/package.json +97 -3
  137. package/src/components/auto-form/index.ts +12 -0
  138. package/src/components/empty/index.ts +8 -0
  139. package/src/components/form-builder/index.ts +23 -0
  140. package/src/components/kanban/index.ts +9 -0
  141. package/src/components/markdown/index.ts +5 -0
  142. package/src/components/markdown/style.css +3 -0
  143. package/src/components/minimal-tiptap/index.ts +5 -0
  144. package/src/components/minimal-tiptap/style.css +1 -0
  145. package/src/components/multi-select/index.ts +5 -0
  146. package/src/components/search-select/index.ts +1 -0
  147. package/src/components/stepped-auto-form/index.ts +5 -0
  148. package/src/components/ui-builder/index.ts +50 -0
  149. package/src/components/ui-builder/style.css +5 -0
  150. package/src/plugins/ai-chat/client/components/chat-layout.tsx +22 -1
  151. package/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.tsx +29 -0
  152. package/src/plugins/blog/client/components/forms/markdown-editor.tsx +24 -21
  153. package/src/plugins/blog/client/components/forms/post-forms.tsx +2 -2
  154. package/src/plugins/blog/client/components/shared/posts-list.tsx +1 -1
  155. package/src/plugins/blog/client/components/shared/search-input.tsx +0 -2
  156. package/src/plugins/blog/client/components/shared/search-modal.tsx +0 -2
  157. package/dist/shared/stack.8nldKomx.d.cts +0 -114
  158. package/dist/shared/stack.8nldKomx.d.mts +0 -114
  159. package/dist/shared/stack.8nldKomx.d.ts +0 -114
  160. package/dist/shared/{stack.BWp0hcm9.d.cts → stack.BQmuNl5p.d.cts} +3 -3
  161. package/dist/shared/{stack.BWp0hcm9.d.mts → stack.BQmuNl5p.d.mts} +3 -3
  162. package/dist/shared/{stack.BWp0hcm9.d.ts → stack.BQmuNl5p.d.ts} +3 -3
  163. package/dist/shared/{stack.Ba_Ks8qi.d.mts → stack.CxaFNQCV.d.mts} +9 -9
  164. package/dist/shared/{stack.DMobugrZ.d.ts → stack.j75TpKh2.d.ts} +9 -9
  165. package/dist/shared/{stack.CFqqZUes.d.cts → stack.n1_i1p2B.d.cts} +9 -9
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { usePluginOverrides } from "@btst/stack/context";
3
+ import type { BlogPluginOverrides } from "../../overrides";
4
+ import { BLOG_LOCALIZATION } from "../../localization";
5
+ import { MarkdownEditor, type MarkdownEditorProps } from "./markdown-editor";
6
+
7
+ type MarkdownEditorWithOverridesProps = Omit<
8
+ MarkdownEditorProps,
9
+ "uploadImage" | "placeholder"
10
+ >;
11
+
12
+ export function MarkdownEditorWithOverrides(
13
+ props: MarkdownEditorWithOverridesProps,
14
+ ) {
15
+ const { uploadImage, localization } = usePluginOverrides<
16
+ BlogPluginOverrides,
17
+ Partial<BlogPluginOverrides>
18
+ >("blog", {
19
+ localization: BLOG_LOCALIZATION,
20
+ });
21
+
22
+ return (
23
+ <MarkdownEditor
24
+ {...props}
25
+ uploadImage={uploadImage}
26
+ placeholder={localization?.BLOG_FORMS_EDITOR_PLACEHOLDER}
27
+ />
28
+ );
29
+ }
@@ -9,25 +9,24 @@ import { listener, listenerCtx } from "@milkdown/kit/plugin/listener";
9
9
  import { Slice } from "@milkdown/kit/prose/model";
10
10
  import { Selection } from "@milkdown/kit/prose/state";
11
11
  import { useLayoutEffect, useRef, useState } from "react";
12
- import { usePluginOverrides } from "@btst/stack/context";
13
- import type { BlogPluginOverrides } from "../../overrides";
14
- import { BLOG_LOCALIZATION } from "../../localization";
12
+
13
+ export interface MarkdownEditorProps {
14
+ value?: string;
15
+ onChange?: (markdown: string) => void;
16
+ className?: string;
17
+ /** Optional image upload handler. When provided, enables image upload in the editor. */
18
+ uploadImage?: (file: File) => Promise<string>;
19
+ /** Placeholder text shown when the editor is empty. */
20
+ placeholder?: string;
21
+ }
15
22
 
16
23
  export function MarkdownEditor({
17
24
  value,
18
25
  onChange,
19
26
  className,
20
- }: {
21
- value?: string;
22
- onChange?: (markdown: string) => void;
23
- className?: string;
24
- }) {
25
- const { uploadImage, localization } = usePluginOverrides<
26
- BlogPluginOverrides,
27
- Partial<BlogPluginOverrides>
28
- >("blog", {
29
- localization: BLOG_LOCALIZATION,
30
- });
27
+ uploadImage,
28
+ placeholder = "Write something...",
29
+ }: MarkdownEditorProps) {
31
30
  const containerRef = useRef<HTMLDivElement | null>(null);
32
31
  const crepeRef = useRef<Crepe | null>(null);
33
32
  const isReadyRef = useRef(false);
@@ -52,14 +51,18 @@ export function MarkdownEditor({
52
51
  defaultValue: initialValueRef.current,
53
52
  featureConfigs: {
54
53
  [CrepeFeature.Placeholder]: {
55
- text: localization.BLOG_FORMS_EDITOR_PLACEHOLDER,
56
- },
57
- [CrepeFeature.ImageBlock]: {
58
- onUpload: async (file) => {
59
- const url = await uploadImage(file);
60
- return url;
61
- },
54
+ text: placeholder,
62
55
  },
56
+ ...(uploadImage
57
+ ? {
58
+ [CrepeFeature.ImageBlock]: {
59
+ onUpload: async (file: File) => {
60
+ const url = await uploadImage(file);
61
+ return url;
62
+ },
63
+ },
64
+ }
65
+ : {}),
63
66
  },
64
67
  });
65
68
 
@@ -52,8 +52,8 @@ import { z } from "zod";
52
52
  import { FeaturedImageField } from "./image-field";
53
53
 
54
54
  const MarkdownEditor = lazy(() =>
55
- import("./markdown-editor").then((module) => ({
56
- default: module.MarkdownEditor,
55
+ import("./markdown-editor-with-overrides").then((module) => ({
56
+ default: module.MarkdownEditorWithOverrides,
57
57
  })),
58
58
  );
59
59
  import { BLOG_LOCALIZATION } from "../../localization";
@@ -2,7 +2,7 @@ import { usePluginOverrides } from "@btst/stack/context";
2
2
  import type { SerializedPost } from "../../../types";
3
3
  import { Button } from "@workspace/ui/components/button";
4
4
  import { EmptyList } from "./empty-list";
5
- import SearchInput from "./search-input";
5
+ import { SearchInput } from "./search-input";
6
6
  import type { BlogPluginOverrides } from "../../overrides";
7
7
  import { PostCard as DefaultPostCard } from "./post-card";
8
8
  import { BLOG_LOCALIZATION } from "../../localization";
@@ -142,5 +142,3 @@ export function SearchInput({
142
142
  />
143
143
  );
144
144
  }
145
-
146
- export default SearchInput;
@@ -158,5 +158,3 @@ export function SearchModal<T extends SearchResult>({
158
158
  </>
159
159
  );
160
160
  }
161
-
162
- export default SearchModal;
@@ -1,114 +0,0 @@
1
- import { ControllerRenderProps, FieldValues } from 'react-hook-form';
2
- import * as zod from 'zod';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
-
5
- declare function AutoFormCheckbox({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
6
-
7
- declare function AutoFormDate({ label, isRequired, field, fieldConfigItem, fieldProps, zodItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
8
-
9
- declare function AutoFormEnum({ label, isRequired, field, fieldConfigItem, zodItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
10
-
11
- declare function AutoFormInput({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
12
-
13
- declare function AutoFormNumber({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
14
-
15
- declare function AutoFormRadioGroup({ label, isRequired, field, zodItem, fieldProps, fieldConfigItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
16
-
17
- declare function AutoFormSwitch({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
18
-
19
- declare function AutoFormTextarea({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
20
-
21
- declare const INPUT_COMPONENTS: {
22
- checkbox: typeof AutoFormCheckbox;
23
- date: typeof AutoFormDate;
24
- select: typeof AutoFormEnum;
25
- radio: typeof AutoFormRadioGroup;
26
- switch: typeof AutoFormSwitch;
27
- textarea: typeof AutoFormTextarea;
28
- number: typeof AutoFormNumber;
29
- fallback: typeof AutoFormInput;
30
- };
31
-
32
- /**
33
- * Common input props shared by all field types.
34
- */
35
- interface BaseInputProps {
36
- /** Whether the field is disabled */
37
- disabled?: boolean;
38
- /** Whether the field is read-only */
39
- readOnly?: boolean;
40
- /** Whether the field is required */
41
- required?: boolean;
42
- /** Whether to show the label (auto-form specific) */
43
- showLabel?: boolean;
44
- }
45
- /**
46
- * Generic input props that accept any field type.
47
- * Use this when the backing type is not known at compile time.
48
- *
49
- * This is the catch-all type used for runtime flexibility.
50
- */
51
- interface SerializableInputProps extends BaseInputProps {
52
- placeholder?: string;
53
- type?: string;
54
- defaultValue?: unknown;
55
- min?: number | string;
56
- max?: number | string;
57
- step?: number | string;
58
- minLength?: number;
59
- maxLength?: number;
60
- pattern?: string;
61
- autoComplete?: string;
62
- /** Allow additional props for extensibility */
63
- [key: string]: unknown;
64
- }
65
-
66
- /**
67
- * Input props for form fields.
68
- *
69
- * This is the runtime type that accepts any input props.
70
- * For type-safe props, use the discriminated types:
71
- * - StringInputProps for text inputs
72
- * - NumberInputProps for number inputs
73
- * - BooleanInputProps for checkboxes/switches
74
- * - DateInputProps for date pickers
75
- * - EnumInputProps for selects/radios
76
- */
77
- type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof SerializableInputProps> & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof SerializableInputProps>;
78
- /**
79
- * Configuration for a single field in AutoForm.
80
- *
81
- * Note: This type is designed to align with form-builder's FormBuilderFieldProps
82
- * so that JSON Schema properties can be easily converted to field configs.
83
- */
84
- type FieldConfigItem = {
85
- /** Description text or React node */
86
- description?: React.ReactNode;
87
- /** Input props passed to the field component */
88
- inputProps?: FieldInputProps;
89
- /** Display label */
90
- label?: string;
91
- /** Field type override - built-in type or custom component */
92
- fieldType?: keyof typeof INPUT_COMPONENTS | React.FC<AutoFormInputComponentProps>;
93
- /** Wrapper component for custom field layout */
94
- renderParent?: (props: {
95
- children: React.ReactNode;
96
- }) => React.ReactElement | null;
97
- /** Display order for field ordering */
98
- order?: number;
99
- };
100
- /**
101
- * A FormInput component can handle a specific Zod type (e.g. "ZodBoolean")
102
- */
103
- type AutoFormInputComponentProps = {
104
- zodInputProps: React.InputHTMLAttributes<HTMLInputElement>;
105
- field: ControllerRenderProps<FieldValues, any>;
106
- fieldConfigItem: FieldConfigItem;
107
- label: string;
108
- isRequired: boolean;
109
- fieldProps: any;
110
- zodItem: zod.ZodType;
111
- className?: string;
112
- };
113
-
114
- export type { AutoFormInputComponentProps as A, FieldConfigItem as F };
@@ -1,114 +0,0 @@
1
- import { ControllerRenderProps, FieldValues } from 'react-hook-form';
2
- import * as zod from 'zod';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
-
5
- declare function AutoFormCheckbox({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
6
-
7
- declare function AutoFormDate({ label, isRequired, field, fieldConfigItem, fieldProps, zodItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
8
-
9
- declare function AutoFormEnum({ label, isRequired, field, fieldConfigItem, zodItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
10
-
11
- declare function AutoFormInput({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
12
-
13
- declare function AutoFormNumber({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
14
-
15
- declare function AutoFormRadioGroup({ label, isRequired, field, zodItem, fieldProps, fieldConfigItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
16
-
17
- declare function AutoFormSwitch({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
18
-
19
- declare function AutoFormTextarea({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
20
-
21
- declare const INPUT_COMPONENTS: {
22
- checkbox: typeof AutoFormCheckbox;
23
- date: typeof AutoFormDate;
24
- select: typeof AutoFormEnum;
25
- radio: typeof AutoFormRadioGroup;
26
- switch: typeof AutoFormSwitch;
27
- textarea: typeof AutoFormTextarea;
28
- number: typeof AutoFormNumber;
29
- fallback: typeof AutoFormInput;
30
- };
31
-
32
- /**
33
- * Common input props shared by all field types.
34
- */
35
- interface BaseInputProps {
36
- /** Whether the field is disabled */
37
- disabled?: boolean;
38
- /** Whether the field is read-only */
39
- readOnly?: boolean;
40
- /** Whether the field is required */
41
- required?: boolean;
42
- /** Whether to show the label (auto-form specific) */
43
- showLabel?: boolean;
44
- }
45
- /**
46
- * Generic input props that accept any field type.
47
- * Use this when the backing type is not known at compile time.
48
- *
49
- * This is the catch-all type used for runtime flexibility.
50
- */
51
- interface SerializableInputProps extends BaseInputProps {
52
- placeholder?: string;
53
- type?: string;
54
- defaultValue?: unknown;
55
- min?: number | string;
56
- max?: number | string;
57
- step?: number | string;
58
- minLength?: number;
59
- maxLength?: number;
60
- pattern?: string;
61
- autoComplete?: string;
62
- /** Allow additional props for extensibility */
63
- [key: string]: unknown;
64
- }
65
-
66
- /**
67
- * Input props for form fields.
68
- *
69
- * This is the runtime type that accepts any input props.
70
- * For type-safe props, use the discriminated types:
71
- * - StringInputProps for text inputs
72
- * - NumberInputProps for number inputs
73
- * - BooleanInputProps for checkboxes/switches
74
- * - DateInputProps for date pickers
75
- * - EnumInputProps for selects/radios
76
- */
77
- type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof SerializableInputProps> & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof SerializableInputProps>;
78
- /**
79
- * Configuration for a single field in AutoForm.
80
- *
81
- * Note: This type is designed to align with form-builder's FormBuilderFieldProps
82
- * so that JSON Schema properties can be easily converted to field configs.
83
- */
84
- type FieldConfigItem = {
85
- /** Description text or React node */
86
- description?: React.ReactNode;
87
- /** Input props passed to the field component */
88
- inputProps?: FieldInputProps;
89
- /** Display label */
90
- label?: string;
91
- /** Field type override - built-in type or custom component */
92
- fieldType?: keyof typeof INPUT_COMPONENTS | React.FC<AutoFormInputComponentProps>;
93
- /** Wrapper component for custom field layout */
94
- renderParent?: (props: {
95
- children: React.ReactNode;
96
- }) => React.ReactElement | null;
97
- /** Display order for field ordering */
98
- order?: number;
99
- };
100
- /**
101
- * A FormInput component can handle a specific Zod type (e.g. "ZodBoolean")
102
- */
103
- type AutoFormInputComponentProps = {
104
- zodInputProps: React.InputHTMLAttributes<HTMLInputElement>;
105
- field: ControllerRenderProps<FieldValues, any>;
106
- fieldConfigItem: FieldConfigItem;
107
- label: string;
108
- isRequired: boolean;
109
- fieldProps: any;
110
- zodItem: zod.ZodType;
111
- className?: string;
112
- };
113
-
114
- export type { AutoFormInputComponentProps as A, FieldConfigItem as F };
@@ -1,114 +0,0 @@
1
- import { ControllerRenderProps, FieldValues } from 'react-hook-form';
2
- import * as zod from 'zod';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
-
5
- declare function AutoFormCheckbox({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
6
-
7
- declare function AutoFormDate({ label, isRequired, field, fieldConfigItem, fieldProps, zodItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
8
-
9
- declare function AutoFormEnum({ label, isRequired, field, fieldConfigItem, zodItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
10
-
11
- declare function AutoFormInput({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
12
-
13
- declare function AutoFormNumber({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
14
-
15
- declare function AutoFormRadioGroup({ label, isRequired, field, zodItem, fieldProps, fieldConfigItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
16
-
17
- declare function AutoFormSwitch({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
18
-
19
- declare function AutoFormTextarea({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
20
-
21
- declare const INPUT_COMPONENTS: {
22
- checkbox: typeof AutoFormCheckbox;
23
- date: typeof AutoFormDate;
24
- select: typeof AutoFormEnum;
25
- radio: typeof AutoFormRadioGroup;
26
- switch: typeof AutoFormSwitch;
27
- textarea: typeof AutoFormTextarea;
28
- number: typeof AutoFormNumber;
29
- fallback: typeof AutoFormInput;
30
- };
31
-
32
- /**
33
- * Common input props shared by all field types.
34
- */
35
- interface BaseInputProps {
36
- /** Whether the field is disabled */
37
- disabled?: boolean;
38
- /** Whether the field is read-only */
39
- readOnly?: boolean;
40
- /** Whether the field is required */
41
- required?: boolean;
42
- /** Whether to show the label (auto-form specific) */
43
- showLabel?: boolean;
44
- }
45
- /**
46
- * Generic input props that accept any field type.
47
- * Use this when the backing type is not known at compile time.
48
- *
49
- * This is the catch-all type used for runtime flexibility.
50
- */
51
- interface SerializableInputProps extends BaseInputProps {
52
- placeholder?: string;
53
- type?: string;
54
- defaultValue?: unknown;
55
- min?: number | string;
56
- max?: number | string;
57
- step?: number | string;
58
- minLength?: number;
59
- maxLength?: number;
60
- pattern?: string;
61
- autoComplete?: string;
62
- /** Allow additional props for extensibility */
63
- [key: string]: unknown;
64
- }
65
-
66
- /**
67
- * Input props for form fields.
68
- *
69
- * This is the runtime type that accepts any input props.
70
- * For type-safe props, use the discriminated types:
71
- * - StringInputProps for text inputs
72
- * - NumberInputProps for number inputs
73
- * - BooleanInputProps for checkboxes/switches
74
- * - DateInputProps for date pickers
75
- * - EnumInputProps for selects/radios
76
- */
77
- type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof SerializableInputProps> & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof SerializableInputProps>;
78
- /**
79
- * Configuration for a single field in AutoForm.
80
- *
81
- * Note: This type is designed to align with form-builder's FormBuilderFieldProps
82
- * so that JSON Schema properties can be easily converted to field configs.
83
- */
84
- type FieldConfigItem = {
85
- /** Description text or React node */
86
- description?: React.ReactNode;
87
- /** Input props passed to the field component */
88
- inputProps?: FieldInputProps;
89
- /** Display label */
90
- label?: string;
91
- /** Field type override - built-in type or custom component */
92
- fieldType?: keyof typeof INPUT_COMPONENTS | React.FC<AutoFormInputComponentProps>;
93
- /** Wrapper component for custom field layout */
94
- renderParent?: (props: {
95
- children: React.ReactNode;
96
- }) => React.ReactElement | null;
97
- /** Display order for field ordering */
98
- order?: number;
99
- };
100
- /**
101
- * A FormInput component can handle a specific Zod type (e.g. "ZodBoolean")
102
- */
103
- type AutoFormInputComponentProps = {
104
- zodInputProps: React.InputHTMLAttributes<HTMLInputElement>;
105
- field: ControllerRenderProps<FieldValues, any>;
106
- fieldConfigItem: FieldConfigItem;
107
- label: string;
108
- isRequired: boolean;
109
- fieldProps: any;
110
- zodItem: zod.ZodType;
111
- className?: string;
112
- };
113
-
114
- export type { AutoFormInputComponentProps as A, FieldConfigItem as F };
@@ -42,15 +42,15 @@ declare const createPostSchema: z.ZodObject<{
42
42
  name: z.ZodString;
43
43
  slug: z.ZodString;
44
44
  }, z.core.$strip>]>>>>;
45
+ title: z.ZodString;
45
46
  slug: z.ZodOptional<z.ZodString>;
46
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
47
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
48
47
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
49
48
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
50
- title: z.ZodString;
49
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
51
50
  content: z.ZodString;
52
51
  excerpt: z.ZodString;
53
52
  image: z.ZodOptional<z.ZodString>;
53
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
54
54
  }, z.core.$strip>;
55
55
  declare const updatePostSchema: z.ZodObject<{
56
56
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -42,15 +42,15 @@ declare const createPostSchema: z.ZodObject<{
42
42
  name: z.ZodString;
43
43
  slug: z.ZodString;
44
44
  }, z.core.$strip>]>>>>;
45
+ title: z.ZodString;
45
46
  slug: z.ZodOptional<z.ZodString>;
46
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
47
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
48
47
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
49
48
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
50
- title: z.ZodString;
49
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
51
50
  content: z.ZodString;
52
51
  excerpt: z.ZodString;
53
52
  image: z.ZodOptional<z.ZodString>;
53
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
54
54
  }, z.core.$strip>;
55
55
  declare const updatePostSchema: z.ZodObject<{
56
56
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -42,15 +42,15 @@ declare const createPostSchema: z.ZodObject<{
42
42
  name: z.ZodString;
43
43
  slug: z.ZodString;
44
44
  }, z.core.$strip>]>>>>;
45
+ title: z.ZodString;
45
46
  slug: z.ZodOptional<z.ZodString>;
46
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
47
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
48
47
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
49
48
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
50
- title: z.ZodString;
49
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
51
50
  content: z.ZodString;
52
51
  excerpt: z.ZodString;
53
52
  image: z.ZodOptional<z.ZodString>;
53
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
54
54
  }, z.core.$strip>;
55
55
  declare const updatePostSchema: z.ZodObject<{
56
56
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -8,11 +8,11 @@ import { QueryClient } from '@tanstack/react-query';
8
8
  declare const createBoardSchema: z.ZodObject<{
9
9
  description: z.ZodOptional<z.ZodString>;
10
10
  name: z.ZodString;
11
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
12
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
13
11
  slug: z.ZodOptional<z.ZodString>;
14
12
  ownerId: z.ZodOptional<z.ZodString>;
15
13
  organizationId: z.ZodOptional<z.ZodString>;
14
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
15
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
16
16
  }, z.core.$strip>;
17
17
  declare const updateBoardSchema: z.ZodObject<{
18
18
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -28,8 +28,8 @@ declare const createColumnSchema: z.ZodObject<{
28
28
  title: z.ZodString;
29
29
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
30
30
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
31
- boardId: z.ZodString;
32
31
  order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
32
+ boardId: z.ZodString;
33
33
  }, z.core.$strip>;
34
34
  declare const updateColumnSchema: z.ZodObject<{
35
35
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -324,11 +324,11 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
324
324
  body: z.ZodObject<{
325
325
  description: z.ZodOptional<z.ZodString>;
326
326
  name: z.ZodString;
327
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
328
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
329
327
  slug: z.ZodOptional<z.ZodString>;
330
328
  ownerId: z.ZodOptional<z.ZodString>;
331
329
  organizationId: z.ZodOptional<z.ZodString>;
330
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
331
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
332
332
  }, z.core.$strip>;
333
333
  }, {
334
334
  columns: ColumnWithTasks[];
@@ -346,11 +346,11 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
346
346
  body: z.ZodObject<{
347
347
  description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
348
348
  name: z.ZodOptional<z.ZodString>;
349
- createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
350
- updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
351
349
  slug: z.ZodOptional<z.ZodString>;
352
350
  ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
353
351
  organizationId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
352
+ createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
353
+ updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
354
354
  }, z.core.$strip>;
355
355
  }, Board>;
356
356
  readonly deleteBoard: better_call.StrictEndpoint<"/boards/:id", {
@@ -364,8 +364,8 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
364
364
  title: z.ZodString;
365
365
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
366
366
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
367
- boardId: z.ZodString;
368
367
  order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
368
+ boardId: z.ZodString;
369
369
  }, z.core.$strip>;
370
370
  }, Column>;
371
371
  readonly updateColumn: better_call.StrictEndpoint<"/columns/:id", {
@@ -374,8 +374,8 @@ declare const kanbanBackendPlugin: (hooks?: KanbanBackendHooks) => _btst_stack_p
374
374
  title: z.ZodOptional<z.ZodString>;
375
375
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
376
376
  updatedAt: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
377
- boardId: z.ZodOptional<z.ZodString>;
378
377
  order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNumber>>>;
378
+ boardId: z.ZodOptional<z.ZodString>;
379
379
  }, z.core.$strip>;
380
380
  }, Column>;
381
381
  readonly deleteColumn: better_call.StrictEndpoint<"/columns/:id", {