@btst/stack 2.6.0 → 2.6.1

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 (153) 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/blog/client/components/forms/markdown-editor-with-overrides.cjs +23 -0
  46. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.mjs +21 -0
  47. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.cjs +11 -12
  48. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.mjs +11 -12
  49. package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.cjs +2 -2
  50. package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.mjs +2 -2
  51. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.cjs +0 -3
  52. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.mjs +1 -1
  53. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.cjs +0 -3
  54. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.mjs +1 -1
  55. package/dist/packages/ui/src/components/auto-form/index.cjs +12 -2
  56. package/dist/packages/ui/src/components/auto-form/index.mjs +9 -2
  57. package/dist/packages/ui/src/components/auto-form/stepped-auto-form.cjs +2 -2
  58. package/dist/packages/ui/src/components/empty.cjs +28 -0
  59. package/dist/packages/ui/src/components/empty.mjs +27 -1
  60. package/dist/packages/ui/src/components/form-builder/components/index.mjs +2 -2
  61. package/dist/packages/ui/src/components/form-builder/edit-field-dialog.cjs +1 -1
  62. package/dist/packages/ui/src/components/form-builder/index.mjs +2 -2
  63. package/dist/packages/ui/src/components/form.mjs +1 -1
  64. package/dist/packages/ui/src/components/kanban.mjs +1 -1
  65. package/dist/packages/ui/src/components/multi-select.mjs +2 -2
  66. package/dist/packages/ui/src/components/ui-builder/internal/config-panel.cjs +1 -1
  67. package/dist/packages/ui/src/components/ui-builder/internal/props-panel.cjs +1 -1
  68. package/dist/plugins/blog/api/index.d.cts +2 -2
  69. package/dist/plugins/blog/api/index.d.mts +2 -2
  70. package/dist/plugins/blog/api/index.d.ts +2 -2
  71. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  72. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  73. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  74. package/dist/plugins/blog/client/index.d.cts +2 -2
  75. package/dist/plugins/blog/client/index.d.mts +2 -2
  76. package/dist/plugins/blog/client/index.d.ts +2 -2
  77. package/dist/plugins/blog/query-keys.d.cts +2 -2
  78. package/dist/plugins/blog/query-keys.d.mts +2 -2
  79. package/dist/plugins/blog/query-keys.d.ts +2 -2
  80. package/dist/plugins/cms/client/index.d.cts +1 -1
  81. package/dist/plugins/cms/client/index.d.mts +1 -1
  82. package/dist/plugins/cms/client/index.d.ts +1 -1
  83. package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
  84. package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
  85. package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
  86. package/dist/plugins/form-builder/client/index.d.cts +1 -1
  87. package/dist/plugins/form-builder/client/index.d.mts +1 -1
  88. package/dist/plugins/form-builder/client/index.d.ts +1 -1
  89. package/dist/plugins/kanban/api/index.d.cts +1 -1
  90. package/dist/plugins/kanban/api/index.d.mts +1 -1
  91. package/dist/plugins/kanban/api/index.d.ts +1 -1
  92. package/dist/plugins/kanban/query-keys.d.cts +1 -1
  93. package/dist/plugins/kanban/query-keys.d.mts +1 -1
  94. package/dist/plugins/kanban/query-keys.d.ts +1 -1
  95. package/dist/plugins/ui-builder/client/components/index.d.cts +2 -2
  96. package/dist/plugins/ui-builder/client/components/index.d.mts +2 -2
  97. package/dist/plugins/ui-builder/client/components/index.d.ts +2 -2
  98. package/dist/plugins/ui-builder/client/hooks/index.d.cts +3 -3
  99. package/dist/plugins/ui-builder/client/hooks/index.d.mts +3 -3
  100. package/dist/plugins/ui-builder/client/hooks/index.d.ts +3 -3
  101. package/dist/plugins/ui-builder/client/index.d.cts +3 -3
  102. package/dist/plugins/ui-builder/client/index.d.mts +3 -3
  103. package/dist/plugins/ui-builder/client/index.d.ts +3 -3
  104. package/dist/plugins/ui-builder/index.d.cts +3 -3
  105. package/dist/plugins/ui-builder/index.d.mts +3 -3
  106. package/dist/plugins/ui-builder/index.d.ts +3 -3
  107. package/dist/shared/{stack.B2DwzF3r.d.ts → stack.ASwEoINr.d.ts} +1 -1
  108. package/dist/shared/{stack.C5ZSOJGJ.d.cts → stack.B1srlBud.d.mts} +1 -1
  109. package/dist/shared/{stack.CQAZwXhV.d.cts → stack.B8vT-Yt4.d.mts} +3 -3
  110. package/dist/shared/{stack.D3BsrpAz.d.ts → stack.BAT540yW.d.ts} +3 -3
  111. package/dist/shared/{stack.D0QupDcQ.d.ts → stack.BK9Z2dcL.d.ts} +1 -1
  112. package/dist/shared/{stack.CNLHlv7r.d.mts → stack.BwA7trxA.d.cts} +3 -3
  113. package/dist/shared/{stack.Cl7ok_cY.d.cts → stack.CFECM0ew.d.cts} +1 -1
  114. package/dist/shared/stack.CZMWR72v.d.cts +10 -0
  115. package/dist/shared/stack.CZMWR72v.d.mts +10 -0
  116. package/dist/shared/stack.CZMWR72v.d.ts +10 -0
  117. package/dist/shared/{stack.VMmQdbsJ.d.mts → stack.DVtk5CNw.d.mts} +1 -1
  118. package/dist/shared/{stack.B8_74ror.d.ts → stack.DXnclTG7.d.ts} +4 -4
  119. package/dist/shared/{stack.CL4mKxe7.d.mts → stack.DaZM10cp.d.cts} +4 -4
  120. package/dist/shared/{stack.Dq4qVr1F.d.mts → stack.DmpPDPxA.d.cts} +1 -1
  121. package/dist/shared/{stack.C21-LFX8.d.cts → stack.cfCkioTe.d.mts} +4 -4
  122. package/dist/shared/stack.fdi94T4S.d.cts +291 -0
  123. package/dist/shared/stack.fdi94T4S.d.mts +291 -0
  124. package/dist/shared/stack.fdi94T4S.d.ts +291 -0
  125. package/package.json +97 -3
  126. package/src/components/auto-form/index.ts +12 -0
  127. package/src/components/empty/index.ts +8 -0
  128. package/src/components/form-builder/index.ts +23 -0
  129. package/src/components/kanban/index.ts +9 -0
  130. package/src/components/markdown/index.ts +5 -0
  131. package/src/components/markdown/style.css +3 -0
  132. package/src/components/minimal-tiptap/index.ts +5 -0
  133. package/src/components/minimal-tiptap/style.css +1 -0
  134. package/src/components/multi-select/index.ts +5 -0
  135. package/src/components/search-select/index.ts +1 -0
  136. package/src/components/stepped-auto-form/index.ts +5 -0
  137. package/src/components/ui-builder/index.ts +50 -0
  138. package/src/components/ui-builder/style.css +5 -0
  139. package/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.tsx +29 -0
  140. package/src/plugins/blog/client/components/forms/markdown-editor.tsx +24 -21
  141. package/src/plugins/blog/client/components/forms/post-forms.tsx +2 -2
  142. package/src/plugins/blog/client/components/shared/posts-list.tsx +1 -1
  143. package/src/plugins/blog/client/components/shared/search-input.tsx +0 -2
  144. package/src/plugins/blog/client/components/shared/search-modal.tsx +0 -2
  145. package/dist/shared/stack.8nldKomx.d.cts +0 -114
  146. package/dist/shared/stack.8nldKomx.d.mts +0 -114
  147. package/dist/shared/stack.8nldKomx.d.ts +0 -114
  148. package/dist/shared/{stack.Ba_Ks8qi.d.mts → stack.B8D4r97Z.d.mts} +12 -12
  149. package/dist/shared/{stack.BWp0hcm9.d.cts → stack.BQmuNl5p.d.cts} +3 -3
  150. package/dist/shared/{stack.BWp0hcm9.d.mts → stack.BQmuNl5p.d.mts} +3 -3
  151. package/dist/shared/{stack.BWp0hcm9.d.ts → stack.BQmuNl5p.d.ts} +3 -3
  152. package/dist/shared/{stack.DMobugrZ.d.ts → stack.DgKOwl20.d.ts} +12 -12
  153. package/dist/shared/{stack.CFqqZUes.d.cts → stack.uWSqCWAb.d.cts} +12 -12
@@ -0,0 +1,291 @@
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
+ * Input props for string-backed fields (text, email, password, url, phone, textarea).
47
+ */
48
+ interface StringInputProps extends BaseInputProps {
49
+ /** Placeholder text */
50
+ placeholder?: string;
51
+ /** HTML input type (text, email, password, tel, url) */
52
+ type?: "text" | "email" | "password" | "tel" | "url" | string;
53
+ /** Default value */
54
+ defaultValue?: string;
55
+ /** Minimum length */
56
+ minLength?: number;
57
+ /** Maximum length */
58
+ maxLength?: number;
59
+ /** Regex pattern for validation */
60
+ pattern?: string;
61
+ /** Autocomplete hint */
62
+ autoComplete?: string;
63
+ }
64
+ /**
65
+ * Input props for number-backed fields.
66
+ */
67
+ interface NumberInputProps extends BaseInputProps {
68
+ /** Placeholder text */
69
+ placeholder?: string;
70
+ /** Default value */
71
+ defaultValue?: number;
72
+ /** Minimum value */
73
+ min?: number;
74
+ /** Maximum value */
75
+ max?: number;
76
+ /** Step value for increment/decrement */
77
+ step?: number;
78
+ }
79
+ /**
80
+ * Input props for boolean-backed fields (checkbox, switch).
81
+ */
82
+ interface BooleanInputProps extends BaseInputProps {
83
+ /** Default value */
84
+ defaultValue?: boolean;
85
+ }
86
+ /**
87
+ * Input props for date-backed fields.
88
+ */
89
+ interface DateInputProps extends BaseInputProps {
90
+ /** Default value as ISO string or Date */
91
+ defaultValue?: string | Date;
92
+ /** Minimum date as ISO string */
93
+ min?: string;
94
+ /** Maximum date as ISO string */
95
+ max?: string;
96
+ }
97
+ /**
98
+ * Input props for enum-backed fields (select, radio).
99
+ */
100
+ interface EnumInputProps extends BaseInputProps {
101
+ /** Placeholder text (for select) */
102
+ placeholder?: string;
103
+ /** Default value (must match one of the enum options) */
104
+ defaultValue?: string;
105
+ }
106
+ /**
107
+ * Generic input props that accept any field type.
108
+ * Use this when the backing type is not known at compile time.
109
+ *
110
+ * This is the catch-all type used for runtime flexibility.
111
+ */
112
+ interface SerializableInputProps extends BaseInputProps {
113
+ placeholder?: string;
114
+ type?: string;
115
+ defaultValue?: unknown;
116
+ min?: number | string;
117
+ max?: number | string;
118
+ step?: number | string;
119
+ minLength?: number;
120
+ maxLength?: number;
121
+ pattern?: string;
122
+ autoComplete?: string;
123
+ /** Allow additional props for extensibility */
124
+ [key: string]: unknown;
125
+ }
126
+ /**
127
+ * Maps backing Zod types to their corresponding input props type.
128
+ */
129
+ interface InputPropsByBackingType {
130
+ string: StringInputProps;
131
+ number: NumberInputProps;
132
+ boolean: BooleanInputProps;
133
+ date: DateInputProps;
134
+ enum: EnumInputProps;
135
+ }
136
+ /**
137
+ * Built-in field types supported by auto-form.
138
+ */
139
+ type AutoFormBuiltinFieldType = keyof typeof INPUT_COMPONENTS;
140
+ /**
141
+ * Field types that can be specified in JSON Schema.
142
+ * Either a built-in type name or a custom component.
143
+ */
144
+ type FieldType = AutoFormBuiltinFieldType | (string & {});
145
+ /**
146
+ * JSON Schema property with form-builder and auto-form metadata.
147
+ *
148
+ * This is the intermediate format used when:
149
+ * - form-builder serializes field configurations
150
+ * - auto-form parses JSON Schema to build field configs
151
+ */
152
+ interface JSONSchemaPropertyBase {
153
+ /** JSON Schema type */
154
+ type?: "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
155
+ /** Human-readable title (JSON Schema standard) */
156
+ title?: string;
157
+ /** Description text */
158
+ description?: string;
159
+ /** Default value */
160
+ default?: unknown;
161
+ /** Enum values for select/radio fields */
162
+ enum?: (string | number | boolean | null)[];
163
+ /** Minimum value for numbers */
164
+ minimum?: number;
165
+ /** Maximum value for numbers */
166
+ maximum?: number;
167
+ /** Exclusive minimum for numbers */
168
+ exclusiveMinimum?: number;
169
+ /** Exclusive maximum for numbers */
170
+ exclusiveMaximum?: number;
171
+ /** Minimum length for strings */
172
+ minLength?: number;
173
+ /** Maximum length for strings */
174
+ maxLength?: number;
175
+ /** Regex pattern for strings */
176
+ pattern?: string;
177
+ /** Format hint (email, uri, date-time, etc.) */
178
+ format?: string;
179
+ /** Multiple of constraint for numbers */
180
+ multipleOf?: number;
181
+ /** Properties for object types */
182
+ properties?: Record<string, JSONSchemaPropertyBase>;
183
+ /** Required fields for object types */
184
+ required?: string[];
185
+ /** Additional properties allowed for objects */
186
+ additionalProperties?: boolean;
187
+ /** Item schema for array types */
188
+ items?: JSONSchemaPropertyBase;
189
+ /** Display label (form-builder/auto-form) */
190
+ label?: string;
191
+ /** Field type override (checkbox, date, select, radio, switch, textarea, etc.) */
192
+ fieldType?: FieldType;
193
+ /** Placeholder text */
194
+ placeholder?: string;
195
+ /** HTML input type (text, email, password, tel, etc.) */
196
+ inputType?: string;
197
+ /** Additional input props */
198
+ inputProps?: SerializableInputProps;
199
+ /** Display order */
200
+ order?: number;
201
+ /** Minimum date as ISO string */
202
+ formatMinimum?: string;
203
+ /** Maximum date as ISO string */
204
+ formatMaximum?: string;
205
+ }
206
+
207
+ /**
208
+ * Input props for form fields.
209
+ *
210
+ * This is the runtime type that accepts any input props.
211
+ * For type-safe props, use the discriminated types:
212
+ * - StringInputProps for text inputs
213
+ * - NumberInputProps for number inputs
214
+ * - BooleanInputProps for checkboxes/switches
215
+ * - DateInputProps for date pickers
216
+ * - EnumInputProps for selects/radios
217
+ */
218
+ type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof SerializableInputProps> & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof SerializableInputProps>;
219
+ /**
220
+ * Configuration for a single field in AutoForm.
221
+ *
222
+ * Note: This type is designed to align with form-builder's FormBuilderFieldProps
223
+ * so that JSON Schema properties can be easily converted to field configs.
224
+ */
225
+ type FieldConfigItem = {
226
+ /** Description text or React node */
227
+ description?: React.ReactNode;
228
+ /** Input props passed to the field component */
229
+ inputProps?: FieldInputProps;
230
+ /** Display label */
231
+ label?: string;
232
+ /** Field type override - built-in type or custom component */
233
+ fieldType?: keyof typeof INPUT_COMPONENTS | React.FC<AutoFormInputComponentProps>;
234
+ /** Wrapper component for custom field layout */
235
+ renderParent?: (props: {
236
+ children: React.ReactNode;
237
+ }) => React.ReactElement | null;
238
+ /** Display order for field ordering */
239
+ order?: number;
240
+ };
241
+ /**
242
+ * FieldConfig for nested objects - allows both FieldConfigItem properties
243
+ * AND nested field configs for child properties.
244
+ */
245
+ type FieldConfigObject = FieldConfigItem & {
246
+ [key: string]: FieldConfigItem | FieldConfigObject | undefined;
247
+ };
248
+ /**
249
+ * For object fields, allow both FieldConfigItem properties (label, description, etc.)
250
+ * AND nested field configs for the object's properties.
251
+ */
252
+ type FieldConfig<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = {
253
+ [Key in keyof SchemaType]?: FieldConfigItem | FieldConfigObject;
254
+ };
255
+ declare enum DependencyType {
256
+ DISABLES = 0,
257
+ REQUIRES = 1,
258
+ HIDES = 2,
259
+ SETS_OPTIONS = 3
260
+ }
261
+ type BaseDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = {
262
+ sourceField: keyof SchemaType;
263
+ type: DependencyType;
264
+ targetField: keyof SchemaType;
265
+ when: (sourceFieldValue: any, targetFieldValue: any) => boolean;
266
+ };
267
+ type ValueDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = BaseDependency<SchemaType> & {
268
+ type: DependencyType.DISABLES | DependencyType.REQUIRES | DependencyType.HIDES;
269
+ };
270
+ type EnumValues = readonly [string, ...string[]];
271
+ type OptionsDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = BaseDependency<SchemaType> & {
272
+ type: DependencyType.SETS_OPTIONS;
273
+ options: EnumValues;
274
+ };
275
+ type Dependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = ValueDependency<SchemaType> | OptionsDependency<SchemaType>;
276
+ /**
277
+ * A FormInput component can handle a specific Zod type (e.g. "ZodBoolean")
278
+ */
279
+ type AutoFormInputComponentProps = {
280
+ zodInputProps: React.InputHTMLAttributes<HTMLInputElement>;
281
+ field: ControllerRenderProps<FieldValues, any>;
282
+ fieldConfigItem: FieldConfigItem;
283
+ label: string;
284
+ isRequired: boolean;
285
+ fieldProps: any;
286
+ zodItem: zod.ZodType;
287
+ className?: string;
288
+ };
289
+
290
+ export { DependencyType as b };
291
+ export type { AutoFormInputComponentProps as A, Dependency as D, FieldConfigItem as F, InputPropsByBackingType as I, JSONSchemaPropertyBase as J, SerializableInputProps as S, FieldConfig as a, FieldType as c };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btst/stack",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "A composable, plugin-based library for building full-stack applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,11 +21,12 @@
21
21
  "access": "public"
22
22
  },
23
23
  "scripts": {
24
- "build": "unbuild --clean && node ./scripts/postbuild.cjs",
25
- "build:analyze": "ANALYZE=1 unbuild --clean && node ./scripts/postbuild.cjs",
24
+ "build": "NODE_OPTIONS='--max-old-space-size=8192' unbuild --clean && node ./scripts/postbuild.cjs",
25
+ "build:analyze": "NODE_OPTIONS='--max-old-space-size=8192' ANALYZE=1 unbuild --clean && node ./scripts/postbuild.cjs",
26
26
  "stub": "unbuild --stub",
27
27
  "test": "vitest",
28
28
  "typecheck": "tsc --project tsconfig.json",
29
+ "knip": "knip --strict",
29
30
  "build-registry": "tsx scripts/build-registry.ts",
30
31
  "test-registry": "bash scripts/test-registry.sh",
31
32
  "host-registry": "npx http-server registry -p 8766 -c-1"
@@ -373,6 +374,77 @@
373
374
  }
374
375
  },
375
376
  "./plugins/route-docs/css": "./dist/plugins/route-docs/style.css",
377
+ "./components/markdown": {
378
+ "import": {
379
+ "types": "./dist/components/markdown/index.d.ts",
380
+ "default": "./dist/components/markdown/index.mjs"
381
+ },
382
+ "require": {
383
+ "types": "./dist/components/markdown/index.d.cts",
384
+ "default": "./dist/components/markdown/index.cjs"
385
+ }
386
+ },
387
+ "./components/markdown/css": "./dist/components/markdown/style.css",
388
+ "./components/auto-form": {
389
+ "import": {
390
+ "types": "./dist/components/auto-form/index.d.ts",
391
+ "default": "./dist/components/auto-form/index.mjs"
392
+ },
393
+ "require": {
394
+ "types": "./dist/components/auto-form/index.d.cts",
395
+ "default": "./dist/components/auto-form/index.cjs"
396
+ }
397
+ },
398
+ "./components/stepped-auto-form": {
399
+ "import": {
400
+ "types": "./dist/components/stepped-auto-form/index.d.ts",
401
+ "default": "./dist/components/stepped-auto-form/index.mjs"
402
+ },
403
+ "require": {
404
+ "types": "./dist/components/stepped-auto-form/index.d.cts",
405
+ "default": "./dist/components/stepped-auto-form/index.cjs"
406
+ }
407
+ },
408
+ "./components/form-builder": {
409
+ "import": {
410
+ "types": "./dist/components/form-builder/index.d.ts",
411
+ "default": "./dist/components/form-builder/index.mjs"
412
+ },
413
+ "require": {
414
+ "types": "./dist/components/form-builder/index.d.cts",
415
+ "default": "./dist/components/form-builder/index.cjs"
416
+ }
417
+ },
418
+ "./components/multi-select": {
419
+ "import": {
420
+ "types": "./dist/components/multi-select/index.d.ts",
421
+ "default": "./dist/components/multi-select/index.mjs"
422
+ },
423
+ "require": {
424
+ "types": "./dist/components/multi-select/index.d.cts",
425
+ "default": "./dist/components/multi-select/index.cjs"
426
+ }
427
+ },
428
+ "./components/search-select": {
429
+ "import": {
430
+ "types": "./dist/components/search-select/index.d.ts",
431
+ "default": "./dist/components/search-select/index.mjs"
432
+ },
433
+ "require": {
434
+ "types": "./dist/components/search-select/index.d.cts",
435
+ "default": "./dist/components/search-select/index.cjs"
436
+ }
437
+ },
438
+ "./components/empty": {
439
+ "import": {
440
+ "types": "./dist/components/empty/index.d.ts",
441
+ "default": "./dist/components/empty/index.mjs"
442
+ },
443
+ "require": {
444
+ "types": "./dist/components/empty/index.d.cts",
445
+ "default": "./dist/components/empty/index.cjs"
446
+ }
447
+ },
376
448
  "./dist/*": "./dist/*",
377
449
  "./ui/css": "./dist/ui/components.css",
378
450
  "./package.json": "./package.json"
@@ -474,6 +546,27 @@
474
546
  ],
475
547
  "plugins/route-docs/client": [
476
548
  "./dist/plugins/route-docs/client/index.d.ts"
549
+ ],
550
+ "components/markdown": [
551
+ "./dist/components/markdown/index.d.ts"
552
+ ],
553
+ "components/auto-form": [
554
+ "./dist/components/auto-form/index.d.ts"
555
+ ],
556
+ "components/stepped-auto-form": [
557
+ "./dist/components/stepped-auto-form/index.d.ts"
558
+ ],
559
+ "components/form-builder": [
560
+ "./dist/components/form-builder/index.d.ts"
561
+ ],
562
+ "components/multi-select": [
563
+ "./dist/components/multi-select/index.d.ts"
564
+ ],
565
+ "components/search-select": [
566
+ "./dist/components/search-select/index.d.ts"
567
+ ],
568
+ "components/empty": [
569
+ "./dist/components/empty/index.d.ts"
477
570
  ]
478
571
  }
479
572
  },
@@ -533,6 +626,7 @@
533
626
  "react": "^19.1.1",
534
627
  "react-dom": "^19.1.1",
535
628
  "react-error-boundary": "^4.1.2",
629
+ "knip": "^5.61.2",
536
630
  "rollup-plugin-preserve-directives": "0.4.0",
537
631
  "rollup-plugin-visualizer": "^5.12.0",
538
632
  "typescript": "catalog:",
@@ -0,0 +1,12 @@
1
+ export {
2
+ default as AutoForm,
3
+ AutoFormSubmit,
4
+ } from "@workspace/ui/components/auto-form";
5
+ export type {
6
+ FieldConfig,
7
+ FieldConfigItem,
8
+ Dependency,
9
+ DependencyType,
10
+ AutoFormInputComponentProps,
11
+ } from "@workspace/ui/components/auto-form/types";
12
+ export type { ZodObjectOrWrapped } from "@workspace/ui/components/auto-form/helpers";
@@ -0,0 +1,8 @@
1
+ export {
2
+ Empty,
3
+ EmptyHeader,
4
+ EmptyTitle,
5
+ EmptyDescription,
6
+ EmptyContent,
7
+ EmptyMedia,
8
+ } from "@workspace/ui/components/empty";
@@ -0,0 +1,23 @@
1
+ export {
2
+ FormBuilder,
3
+ defaultComponents,
4
+ objectFieldDefinition,
5
+ arrayFieldDefinition,
6
+ defineComponent,
7
+ baseMetaSchema,
8
+ baseMetaSchemaWithPlaceholder,
9
+ } from "@workspace/ui/components/form-builder";
10
+ export type {
11
+ FormBuilderComponentDefinition,
12
+ FormBuilderField,
13
+ FormBuilderFieldProps,
14
+ JSONSchema,
15
+ JSONSchemaProperty,
16
+ StringFieldProps,
17
+ } from "@workspace/ui/components/form-builder";
18
+ export type {
19
+ FormStep,
20
+ BackingType,
21
+ ComponentType,
22
+ TypedFieldProps,
23
+ } from "@workspace/ui/components/form-builder/types";
@@ -0,0 +1,9 @@
1
+ export {
2
+ Kanban,
3
+ KanbanBoard,
4
+ KanbanColumn,
5
+ KanbanColumnHandle,
6
+ KanbanItem,
7
+ KanbanItemHandle,
8
+ KanbanOverlay,
9
+ } from "@workspace/ui/components/kanban";
@@ -0,0 +1,5 @@
1
+ export { MarkdownContent } from "@workspace/ui/components/markdown-content";
2
+ export type { MarkdownContentProps } from "@workspace/ui/components/markdown-content";
3
+
4
+ export { MarkdownEditor } from "../../plugins/blog/client/components/forms/markdown-editor";
5
+ export type { MarkdownEditorProps } from "../../plugins/blog/client/components/forms/markdown-editor";
@@ -0,0 +1,3 @@
1
+ @import "@workspace/ui/markdown-content.css";
2
+ @import "@milkdown/crepe/theme/common/style.css";
3
+ @import "../../plugins/blog/client/components/forms/markdown-editor-styles.css";
@@ -0,0 +1,5 @@
1
+ export {
2
+ MinimalTiptapEditor,
3
+ MainMinimalTiptapEditor,
4
+ } from "@workspace/ui/components/minimal-tiptap";
5
+ export type { MinimalTiptapProps } from "@workspace/ui/components/minimal-tiptap";
@@ -0,0 +1 @@
1
+ @import "@workspace/ui/components/minimal-tiptap/styles.css";
@@ -0,0 +1,5 @@
1
+ export { default as MultipleSelector } from "@workspace/ui/components/multi-select";
2
+ export type {
3
+ Option,
4
+ MultipleSelectorRef,
5
+ } from "@workspace/ui/components/multi-select";
@@ -0,0 +1 @@
1
+ export { default as SearchSelect } from "@workspace/ui/components/search-select";
@@ -0,0 +1,5 @@
1
+ export { SteppedAutoForm } from "@workspace/ui/components/auto-form/stepped-auto-form";
2
+ export type {
3
+ SteppedAutoFormProps,
4
+ StepperComponentProps,
5
+ } from "@workspace/ui/components/auto-form/stepped-auto-form";
@@ -0,0 +1,50 @@
1
+ // Editor component
2
+ export {
3
+ default as UIBuilder,
4
+ PageConfigPanel,
5
+ defaultConfigTabsContent,
6
+ LoadingSkeleton,
7
+ getDefaultPanelConfigValues,
8
+ } from "@workspace/ui/components/ui-builder";
9
+ export type { TabsContentConfig } from "@workspace/ui/components/ui-builder";
10
+
11
+ // Page renderers
12
+ export { default as LayerRenderer } from "@workspace/ui/components/ui-builder/layer-renderer";
13
+ export { ServerLayerRenderer } from "@workspace/ui/components/ui-builder/server-layer-renderer";
14
+ export type { ServerLayerRendererProps } from "@workspace/ui/components/ui-builder/server-layer-renderer";
15
+
16
+ // Types
17
+ export type {
18
+ ComponentLayer,
19
+ ComponentRegistry,
20
+ Variable,
21
+ VariableReference,
22
+ FunctionRegistry,
23
+ BlockRegistry,
24
+ LayerChangeHandler,
25
+ VariableChangeHandler,
26
+ RegistryEntry,
27
+ PropValue,
28
+ BlockDefinition,
29
+ FunctionDefinition,
30
+ } from "@workspace/ui/components/ui-builder/types";
31
+ export {
32
+ isVariableReference,
33
+ createVariable,
34
+ } from "@workspace/ui/components/ui-builder/types";
35
+
36
+ // Registry utilities and field override helpers
37
+ export {
38
+ createComponentRegistry,
39
+ defaultComponentRegistry,
40
+ primitiveComponentDefinitions,
41
+ complexComponentDefinitions,
42
+ } from "../../plugins/ui-builder/client/registry";
43
+ export {
44
+ classNameFieldOverrides,
45
+ childrenFieldOverrides,
46
+ iconNameFieldOverrides,
47
+ commonFieldOverrides,
48
+ childrenAsTipTapFieldOverrides,
49
+ childrenAsTextareaFieldOverrides,
50
+ } from "@workspace/ui/lib/ui-builder/registry/form-field-overrides";
@@ -0,0 +1,5 @@
1
+ /* Import minimal-tiptap styles for rich text editor in form field overrides */
2
+ @import "@workspace/ui/components/minimal-tiptap/styles.css";
3
+
4
+ /* Load Tailwind Typography plugin for prose classes used by Markdown component */
5
+ @plugin "@tailwindcss/typography";
@@ -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