@btst/stack 1.5.2 → 1.6.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_accessibility@3.1.1_react@19.2.0/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.cjs +68 -0
- package/dist/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@19.2.0/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.mjs +60 -0
- 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 +3937 -0
- 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 +3907 -0
- package/dist/node_modules/.pnpm/@dnd-kit_modifiers@9.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/modifiers/dist/modifiers.esm.cjs +30 -0
- package/dist/node_modules/.pnpm/@dnd-kit_modifiers@9.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/modifiers/dist/modifiers.esm.mjs +28 -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.cjs +675 -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 +661 -0
- package/dist/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.cjs +358 -0
- package/dist/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.mjs +332 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.13_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_865f042350eb43f3338b0fffb33f6246/node_modules/@radix-ui/react-tabs/dist/index.cjs +211 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.13_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_865f042350eb43f3338b0fffb33f6246/node_modules/@radix-ui/react-tabs/dist/index.mjs +188 -0
- package/dist/packages/better-stack/src/plugins/cms/api/plugin.cjs +3 -2
- package/dist/packages/better-stack/src/plugins/cms/api/plugin.mjs +3 -2
- package/dist/packages/better-stack/src/plugins/cms/client/components/forms/content-form.cjs +15 -15
- package/dist/packages/better-stack/src/plugins/cms/client/components/forms/content-form.mjs +16 -16
- package/dist/packages/better-stack/src/plugins/form-builder/api/plugin.cjs +588 -0
- package/dist/packages/better-stack/src/plugins/form-builder/api/plugin.mjs +586 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/forms/form-renderer.cjs +131 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/forms/form-renderer.mjs +129 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/form-builder-skeleton.cjs +32 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/form-builder-skeleton.mjs +30 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/form-list-skeleton.cjs +21 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/form-list-skeleton.mjs +19 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/submissions-skeleton.cjs +34 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/submissions-skeleton.mjs +32 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/404-page.cjs +20 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/404-page.mjs +18 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-builder-page.cjs +19 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-builder-page.internal.cjs +186 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-builder-page.internal.mjs +184 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-builder-page.mjs +17 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-list-page.cjs +19 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-list-page.internal.cjs +165 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-list-page.internal.mjs +163 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-list-page.mjs +17 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/submissions-page.cjs +19 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.cjs +177 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.mjs +175 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/submissions-page.mjs +17 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/default-error.cjs +17 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/default-error.mjs +15 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/empty-state.cjs +16 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/empty-state.mjs +14 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/page-wrapper.cjs +27 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/page-wrapper.mjs +25 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/pagination.cjs +39 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/pagination.mjs +37 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/hooks/form-builder-hooks.cjs +551 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/hooks/form-builder-hooks.mjs +537 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-common.cjs +36 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-common.mjs +34 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-editor.cjs +19 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-editor.mjs +17 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-list.cjs +21 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-list.mjs +19 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-submissions.cjs +19 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-submissions.mjs +17 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-toasts.cjs +14 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-toasts.mjs +12 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/index.cjs +17 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/localization/index.mjs +15 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/plugin.cjs +278 -0
- package/dist/packages/better-stack/src/plugins/form-builder/client/plugin.mjs +276 -0
- package/dist/packages/better-stack/src/plugins/form-builder/db.cjs +99 -0
- package/dist/packages/better-stack/src/plugins/form-builder/db.mjs +97 -0
- package/dist/packages/better-stack/src/plugins/form-builder/schemas.cjs +82 -0
- package/dist/packages/better-stack/src/plugins/form-builder/schemas.mjs +74 -0
- package/dist/packages/better-stack/src/plugins/form-builder/utils.cjs +37 -0
- package/dist/packages/better-stack/src/plugins/form-builder/utils.mjs +29 -0
- package/dist/packages/ui/src/components/auto-form/index.cjs +2 -12
- package/dist/packages/ui/src/components/auto-form/index.mjs +2 -9
- package/dist/packages/ui/src/components/auto-form/stepped-auto-form.cjs +377 -0
- package/dist/packages/ui/src/components/auto-form/stepped-auto-form.mjs +368 -0
- package/dist/packages/ui/src/components/auto-form/utils.cjs +1 -56
- package/dist/packages/ui/src/components/auto-form/utils.mjs +2 -56
- package/dist/packages/ui/src/components/form-builder/canvas.cjs +111 -0
- package/dist/packages/ui/src/components/form-builder/canvas.mjs +109 -0
- package/dist/packages/ui/src/components/form-builder/components/index.cjs +570 -0
- package/dist/packages/ui/src/components/form-builder/components/index.mjs +553 -0
- package/dist/packages/ui/src/components/form-builder/edit-field-dialog.cjs +131 -0
- package/dist/packages/ui/src/components/form-builder/edit-field-dialog.mjs +129 -0
- package/dist/packages/ui/src/components/form-builder/form-preview.cjs +73 -0
- package/dist/packages/ui/src/components/form-builder/form-preview.mjs +71 -0
- package/dist/packages/ui/src/components/form-builder/index.cjs +353 -0
- package/dist/packages/ui/src/components/form-builder/index.mjs +344 -0
- package/dist/packages/ui/src/components/form-builder/nested-field-editor-dialog.cjs +263 -0
- package/dist/packages/ui/src/components/form-builder/nested-field-editor-dialog.mjs +261 -0
- package/dist/packages/ui/src/components/form-builder/palette.cjs +52 -0
- package/dist/packages/ui/src/components/form-builder/palette.mjs +49 -0
- package/dist/packages/ui/src/components/form-builder/schema-utils.cjs +120 -0
- package/dist/packages/ui/src/components/form-builder/schema-utils.mjs +114 -0
- package/dist/packages/ui/src/components/form-builder/sortable-field.cjs +151 -0
- package/dist/packages/ui/src/components/form-builder/sortable-field.mjs +148 -0
- package/dist/packages/ui/src/components/form-builder/step-tabs.cjs +180 -0
- package/dist/packages/ui/src/components/form-builder/step-tabs.mjs +178 -0
- package/dist/packages/ui/src/components/form-builder/types.cjs +7 -0
- package/dist/packages/ui/src/components/form-builder/types.mjs +5 -0
- package/dist/packages/ui/src/components/form-builder/validation-schemas.cjs +67 -0
- package/dist/packages/ui/src/components/form-builder/validation-schemas.mjs +56 -0
- package/dist/packages/ui/src/components/tabs.cjs +70 -0
- package/dist/packages/ui/src/components/tabs.mjs +65 -0
- package/dist/packages/ui/src/lib/schema-converter.cjs +130 -0
- package/dist/packages/ui/src/lib/schema-converter.mjs +124 -0
- 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/cms/client/index.cjs +6 -0
- package/dist/plugins/cms/client/index.d.cts +6 -113
- package/dist/plugins/cms/client/index.d.mts +6 -113
- package/dist/plugins/cms/client/index.d.ts +6 -113
- package/dist/plugins/cms/client/index.mjs +1 -0
- package/dist/plugins/form-builder/api/index.cjs +7 -0
- package/dist/plugins/form-builder/api/index.d.cts +141 -0
- package/dist/plugins/form-builder/api/index.d.mts +141 -0
- package/dist/plugins/form-builder/api/index.d.ts +141 -0
- package/dist/plugins/form-builder/api/index.mjs +1 -0
- package/dist/plugins/form-builder/client/components/index.cjs +29 -0
- package/dist/plugins/form-builder/client/components/index.d.cts +93 -0
- package/dist/plugins/form-builder/client/components/index.d.mts +93 -0
- package/dist/plugins/form-builder/client/components/index.d.ts +93 -0
- package/dist/plugins/form-builder/client/components/index.mjs +18 -0
- package/dist/plugins/form-builder/client/hooks/index.cjs +19 -0
- package/dist/plugins/form-builder/client/hooks/index.d.cts +154 -0
- package/dist/plugins/form-builder/client/hooks/index.d.mts +154 -0
- package/dist/plugins/form-builder/client/hooks/index.d.ts +154 -0
- package/dist/plugins/form-builder/client/hooks/index.mjs +1 -0
- package/dist/plugins/form-builder/client/index.cjs +13 -0
- package/dist/plugins/form-builder/client/index.d.cts +381 -0
- package/dist/plugins/form-builder/client/index.d.mts +381 -0
- package/dist/plugins/form-builder/client/index.d.ts +381 -0
- package/dist/plugins/form-builder/client/index.mjs +2 -0
- package/dist/plugins/form-builder/client.css +3 -0
- package/dist/plugins/form-builder/query-keys.cjs +143 -0
- package/dist/plugins/form-builder/query-keys.d.cts +74 -0
- package/dist/plugins/form-builder/query-keys.d.mts +74 -0
- package/dist/plugins/form-builder/query-keys.d.ts +74 -0
- package/dist/plugins/form-builder/query-keys.mjs +141 -0
- package/dist/plugins/form-builder/style.css +19 -0
- package/dist/shared/stack.AX5nZ6A3.d.cts +86 -0
- package/dist/shared/stack.AX5nZ6A3.d.mts +86 -0
- package/dist/shared/stack.AX5nZ6A3.d.ts +86 -0
- package/dist/shared/stack.BIh2AXaW.d.cts +123 -0
- package/dist/shared/stack.BIh2AXaW.d.mts +123 -0
- package/dist/shared/stack.BIh2AXaW.d.ts +123 -0
- package/dist/shared/stack.DzH_wcvr.d.cts +195 -0
- package/dist/shared/stack.DzH_wcvr.d.mts +195 -0
- package/dist/shared/stack.DzH_wcvr.d.ts +195 -0
- package/package.json +54 -1
- package/src/plugins/cms/api/plugin.ts +9 -4
- package/src/plugins/cms/client/components/forms/content-form.tsx +23 -25
- package/src/plugins/cms/client/index.ts +11 -0
- package/src/plugins/form-builder/api/index.ts +1 -0
- package/src/plugins/form-builder/api/plugin.ts +776 -0
- package/src/plugins/form-builder/client/components/forms/form-renderer.tsx +253 -0
- package/src/plugins/form-builder/client/components/index.tsx +24 -0
- package/src/plugins/form-builder/client/components/loading/form-builder-skeleton.tsx +42 -0
- package/src/plugins/form-builder/client/components/loading/form-list-skeleton.tsx +25 -0
- package/src/plugins/form-builder/client/components/loading/index.tsx +3 -0
- package/src/plugins/form-builder/client/components/loading/submissions-skeleton.tsx +40 -0
- package/src/plugins/form-builder/client/components/pages/404-page.tsx +28 -0
- package/src/plugins/form-builder/client/components/pages/form-builder-page.internal.tsx +253 -0
- package/src/plugins/form-builder/client/components/pages/form-builder-page.tsx +26 -0
- package/src/plugins/form-builder/client/components/pages/form-list-page.internal.tsx +231 -0
- package/src/plugins/form-builder/client/components/pages/form-list-page.tsx +22 -0
- package/src/plugins/form-builder/client/components/pages/submissions-page.internal.tsx +268 -0
- package/src/plugins/form-builder/client/components/pages/submissions-page.tsx +26 -0
- package/src/plugins/form-builder/client/components/shared/default-error.tsx +30 -0
- package/src/plugins/form-builder/client/components/shared/empty-state.tsx +26 -0
- package/src/plugins/form-builder/client/components/shared/page-wrapper.tsx +32 -0
- package/src/plugins/form-builder/client/components/shared/pagination.tsx +52 -0
- package/src/plugins/form-builder/client/hooks/form-builder-hooks.tsx +799 -0
- package/src/plugins/form-builder/client/hooks/index.tsx +1 -0
- package/src/plugins/form-builder/client/index.ts +22 -0
- package/src/plugins/form-builder/client/localization/form-builder-common.ts +36 -0
- package/src/plugins/form-builder/client/localization/form-builder-editor.ts +18 -0
- package/src/plugins/form-builder/client/localization/form-builder-list.ts +17 -0
- package/src/plugins/form-builder/client/localization/form-builder-submissions.ts +17 -0
- package/src/plugins/form-builder/client/localization/form-builder-toasts.ts +10 -0
- package/src/plugins/form-builder/client/localization/index.ts +15 -0
- package/src/plugins/form-builder/client/overrides.ts +146 -0
- package/src/plugins/form-builder/client/plugin.tsx +488 -0
- package/src/plugins/form-builder/client.css +3 -0
- package/src/plugins/form-builder/db.ts +99 -0
- package/src/plugins/form-builder/query-keys.ts +198 -0
- package/src/plugins/form-builder/schemas.ts +122 -0
- package/src/plugins/form-builder/style.css +19 -0
- package/src/plugins/form-builder/types.ts +317 -0
- package/src/plugins/form-builder/utils.ts +63 -0
- package/dist/shared/{stack.DLhzx1-D.d.cts → stack.CcI4sYJP.d.cts} +1 -1
- package/dist/shared/{stack.DLhzx1-D.d.mts → stack.CcI4sYJP.d.mts} +1 -1
- package/dist/shared/{stack.DLhzx1-D.d.ts → stack.CcI4sYJP.d.ts} +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const z = require('zod');
|
|
4
|
+
|
|
5
|
+
const baseMetaSchema = z.z.object({
|
|
6
|
+
label: z.z.string().min(1).meta({ label: "Label" }),
|
|
7
|
+
description: z.z.string().optional().meta({ label: "Description" }),
|
|
8
|
+
required: z.z.boolean().default(false).meta({ label: "Required", fieldType: "switch" })
|
|
9
|
+
});
|
|
10
|
+
const baseMetaSchemaWithPlaceholder = baseMetaSchema.merge(
|
|
11
|
+
z.z.object({
|
|
12
|
+
placeholder: z.z.string().optional().meta({ label: "Placeholder" })
|
|
13
|
+
})
|
|
14
|
+
);
|
|
15
|
+
const DEFAULT_VALUE_SCHEMAS = {
|
|
16
|
+
string: z.z.string().optional().meta({ label: "Default Value" }),
|
|
17
|
+
number: z.z.number().optional().meta({ label: "Default Value" }),
|
|
18
|
+
boolean: z.z.boolean().default(false).meta({ label: "Default Value", fieldType: "switch" }),
|
|
19
|
+
date: z.z.date().optional().meta({ label: "Default Date", fieldType: "date" }),
|
|
20
|
+
enum: z.z.string().optional().meta({
|
|
21
|
+
label: "Default Value",
|
|
22
|
+
description: "Must match one of the options"
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
const stringValidationSchema = z.z.object({
|
|
26
|
+
minLength: z.z.number().int().min(0).optional().meta({ label: "Min Length" }),
|
|
27
|
+
maxLength: z.z.number().int().min(1).optional().meta({ label: "Max Length" })
|
|
28
|
+
// Note: pattern/regex is serializable but requires careful UX for input
|
|
29
|
+
// Uncomment to enable:
|
|
30
|
+
// pattern: z.string().optional().meta({ label: "Pattern (Regex)" }),
|
|
31
|
+
});
|
|
32
|
+
const numberValidationSchema = z.z.object({
|
|
33
|
+
min: z.z.number().optional().meta({ label: "Minimum" }),
|
|
34
|
+
max: z.z.number().optional().meta({ label: "Maximum" })
|
|
35
|
+
// Note: multipleOf is serializable but less commonly used
|
|
36
|
+
// Uncomment to enable:
|
|
37
|
+
// multipleOf: z.number().optional().meta({ label: "Multiple Of" }),
|
|
38
|
+
});
|
|
39
|
+
const booleanValidationSchema = z.z.object({});
|
|
40
|
+
const dateValidationSchema = z.z.object({
|
|
41
|
+
// Date min/max can be added when the date serialization is refined
|
|
42
|
+
// minDate: z.date().optional().meta({ label: "Minimum Date", fieldType: "date" }),
|
|
43
|
+
// maxDate: z.date().optional().meta({ label: "Maximum Date", fieldType: "date" }),
|
|
44
|
+
});
|
|
45
|
+
const enumOptionsSchema = z.z.object({
|
|
46
|
+
options: z.z.string().meta({
|
|
47
|
+
label: "Options (one per line)",
|
|
48
|
+
fieldType: "textarea",
|
|
49
|
+
description: "Enter each option on a new line"
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
const objectValidationSchema = z.z.object({});
|
|
53
|
+
const arrayValidationSchema = z.z.object({
|
|
54
|
+
minItems: z.z.number().int().min(0).optional().meta({ label: "Min Items" }),
|
|
55
|
+
maxItems: z.z.number().int().min(1).optional().meta({ label: "Max Items" })
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
exports.DEFAULT_VALUE_SCHEMAS = DEFAULT_VALUE_SCHEMAS;
|
|
59
|
+
exports.arrayValidationSchema = arrayValidationSchema;
|
|
60
|
+
exports.baseMetaSchema = baseMetaSchema;
|
|
61
|
+
exports.baseMetaSchemaWithPlaceholder = baseMetaSchemaWithPlaceholder;
|
|
62
|
+
exports.booleanValidationSchema = booleanValidationSchema;
|
|
63
|
+
exports.dateValidationSchema = dateValidationSchema;
|
|
64
|
+
exports.enumOptionsSchema = enumOptionsSchema;
|
|
65
|
+
exports.numberValidationSchema = numberValidationSchema;
|
|
66
|
+
exports.objectValidationSchema = objectValidationSchema;
|
|
67
|
+
exports.stringValidationSchema = stringValidationSchema;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const baseMetaSchema = z.object({
|
|
4
|
+
label: z.string().min(1).meta({ label: "Label" }),
|
|
5
|
+
description: z.string().optional().meta({ label: "Description" }),
|
|
6
|
+
required: z.boolean().default(false).meta({ label: "Required", fieldType: "switch" })
|
|
7
|
+
});
|
|
8
|
+
const baseMetaSchemaWithPlaceholder = baseMetaSchema.merge(
|
|
9
|
+
z.object({
|
|
10
|
+
placeholder: z.string().optional().meta({ label: "Placeholder" })
|
|
11
|
+
})
|
|
12
|
+
);
|
|
13
|
+
const DEFAULT_VALUE_SCHEMAS = {
|
|
14
|
+
string: z.string().optional().meta({ label: "Default Value" }),
|
|
15
|
+
number: z.number().optional().meta({ label: "Default Value" }),
|
|
16
|
+
boolean: z.boolean().default(false).meta({ label: "Default Value", fieldType: "switch" }),
|
|
17
|
+
date: z.date().optional().meta({ label: "Default Date", fieldType: "date" }),
|
|
18
|
+
enum: z.string().optional().meta({
|
|
19
|
+
label: "Default Value",
|
|
20
|
+
description: "Must match one of the options"
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
const stringValidationSchema = z.object({
|
|
24
|
+
minLength: z.number().int().min(0).optional().meta({ label: "Min Length" }),
|
|
25
|
+
maxLength: z.number().int().min(1).optional().meta({ label: "Max Length" })
|
|
26
|
+
// Note: pattern/regex is serializable but requires careful UX for input
|
|
27
|
+
// Uncomment to enable:
|
|
28
|
+
// pattern: z.string().optional().meta({ label: "Pattern (Regex)" }),
|
|
29
|
+
});
|
|
30
|
+
const numberValidationSchema = z.object({
|
|
31
|
+
min: z.number().optional().meta({ label: "Minimum" }),
|
|
32
|
+
max: z.number().optional().meta({ label: "Maximum" })
|
|
33
|
+
// Note: multipleOf is serializable but less commonly used
|
|
34
|
+
// Uncomment to enable:
|
|
35
|
+
// multipleOf: z.number().optional().meta({ label: "Multiple Of" }),
|
|
36
|
+
});
|
|
37
|
+
const booleanValidationSchema = z.object({});
|
|
38
|
+
const dateValidationSchema = z.object({
|
|
39
|
+
// Date min/max can be added when the date serialization is refined
|
|
40
|
+
// minDate: z.date().optional().meta({ label: "Minimum Date", fieldType: "date" }),
|
|
41
|
+
// maxDate: z.date().optional().meta({ label: "Maximum Date", fieldType: "date" }),
|
|
42
|
+
});
|
|
43
|
+
const enumOptionsSchema = z.object({
|
|
44
|
+
options: z.string().meta({
|
|
45
|
+
label: "Options (one per line)",
|
|
46
|
+
fieldType: "textarea",
|
|
47
|
+
description: "Enter each option on a new line"
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
const objectValidationSchema = z.object({});
|
|
51
|
+
const arrayValidationSchema = z.object({
|
|
52
|
+
minItems: z.number().int().min(0).optional().meta({ label: "Min Items" }),
|
|
53
|
+
maxItems: z.number().int().min(1).optional().meta({ label: "Max Items" })
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export { DEFAULT_VALUE_SCHEMAS, arrayValidationSchema, baseMetaSchema, baseMetaSchemaWithPlaceholder, booleanValidationSchema, dateValidationSchema, enumOptionsSchema, numberValidationSchema, objectValidationSchema, stringValidationSchema };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
const index = require('../../../../node_modules/.pnpm/@radix-ui_react-tabs@1.1.13_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_865f042350eb43f3338b0fffb33f6246/node_modules/@radix-ui/react-tabs/dist/index.cjs');
|
|
6
|
+
const utils = require('../lib/utils.cjs');
|
|
7
|
+
|
|
8
|
+
function Tabs({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
|
+
index.Root,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "tabs",
|
|
16
|
+
className: utils.cn("flex flex-col gap-2", className),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function TabsList({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26
|
+
index.List,
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "tabs-list",
|
|
29
|
+
className: utils.cn(
|
|
30
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function TabsTrigger({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}) {
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
index.Trigger,
|
|
43
|
+
{
|
|
44
|
+
"data-slot": "tabs-trigger",
|
|
45
|
+
className: utils.cn(
|
|
46
|
+
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
...props
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function TabsContent({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}) {
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
+
index.Content,
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "tabs-content",
|
|
61
|
+
className: utils.cn("flex-1 outline-none", className),
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
exports.Tabs = Tabs;
|
|
68
|
+
exports.TabsContent = TabsContent;
|
|
69
|
+
exports.TabsList = TabsList;
|
|
70
|
+
exports.TabsTrigger = TabsTrigger;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Root as Root2, List, Trigger, Content } from '../../../../node_modules/.pnpm/@radix-ui_react-tabs@1.1.13_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_865f042350eb43f3338b0fffb33f6246/node_modules/@radix-ui/react-tabs/dist/index.mjs';
|
|
4
|
+
import { cn } from '../lib/utils.mjs';
|
|
5
|
+
|
|
6
|
+
function Tabs({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Root2,
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "tabs",
|
|
14
|
+
className: cn("flex flex-col gap-2", className),
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function TabsList({
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
List,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "tabs-list",
|
|
27
|
+
className: cn(
|
|
28
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function TabsTrigger({
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
Trigger,
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "tabs-trigger",
|
|
43
|
+
className: cn(
|
|
44
|
+
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
45
|
+
className
|
|
46
|
+
),
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function TabsContent({
|
|
52
|
+
className,
|
|
53
|
+
...props
|
|
54
|
+
}) {
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
Content,
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "tabs-content",
|
|
59
|
+
className: cn("flex-1 outline-none", className),
|
|
60
|
+
...props
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const z = require('zod');
|
|
4
|
+
|
|
5
|
+
function zodToFormSchema(schema, metadata) {
|
|
6
|
+
const jsonSchema = z.z.toJSONSchema(schema, {
|
|
7
|
+
unrepresentable: "any",
|
|
8
|
+
override: (ctx) => {
|
|
9
|
+
const def = ctx.zodSchema?._zod?.def;
|
|
10
|
+
if (def?.type === "date") {
|
|
11
|
+
ctx.jsonSchema.type = "string";
|
|
12
|
+
ctx.jsonSchema.format = "date-time";
|
|
13
|
+
const zodSchema = ctx.zodSchema;
|
|
14
|
+
if (zodSchema.minDate) {
|
|
15
|
+
ctx.jsonSchema.formatMinimum = zodSchema.minDate;
|
|
16
|
+
}
|
|
17
|
+
if (zodSchema.maxDate) {
|
|
18
|
+
ctx.jsonSchema.formatMaximum = zodSchema.maxDate;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
if (metadata?.steps) {
|
|
24
|
+
jsonSchema.steps = metadata.steps;
|
|
25
|
+
}
|
|
26
|
+
if (metadata?.stepGroupMap) {
|
|
27
|
+
jsonSchema.stepGroupMap = metadata.stepGroupMap;
|
|
28
|
+
}
|
|
29
|
+
return jsonSchema;
|
|
30
|
+
}
|
|
31
|
+
function extractStepGroupMap(jsonSchema) {
|
|
32
|
+
const stepGroupMap = {};
|
|
33
|
+
const properties = jsonSchema.properties;
|
|
34
|
+
if (!properties) return stepGroupMap;
|
|
35
|
+
for (const [fieldName, fieldSchema] of Object.entries(properties)) {
|
|
36
|
+
if (typeof fieldSchema.stepGroup === "number") {
|
|
37
|
+
stepGroupMap[fieldName] = fieldSchema.stepGroup;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return stepGroupMap;
|
|
41
|
+
}
|
|
42
|
+
function findDateFieldsWithConstraints(jsonSchema) {
|
|
43
|
+
const dateFields = {};
|
|
44
|
+
const properties = jsonSchema.properties;
|
|
45
|
+
if (!properties) return dateFields;
|
|
46
|
+
for (const [key, prop] of Object.entries(properties)) {
|
|
47
|
+
if (prop.type === "string" && prop.format === "date-time") {
|
|
48
|
+
if (prop.formatMinimum || prop.formatMaximum) {
|
|
49
|
+
dateFields[key] = {
|
|
50
|
+
min: prop.formatMinimum,
|
|
51
|
+
max: prop.formatMaximum
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return dateFields;
|
|
57
|
+
}
|
|
58
|
+
function addDateValidations(schema, dateFieldsWithConstraints) {
|
|
59
|
+
if (Object.keys(dateFieldsWithConstraints).length === 0) {
|
|
60
|
+
return schema;
|
|
61
|
+
}
|
|
62
|
+
return schema.superRefine((data, ctx) => {
|
|
63
|
+
for (const [key, constraints] of Object.entries(dateFieldsWithConstraints)) {
|
|
64
|
+
const value = data[key];
|
|
65
|
+
if (value === void 0 || value === null || value === "") continue;
|
|
66
|
+
const dateValue = new Date(value);
|
|
67
|
+
if (isNaN(dateValue.getTime())) {
|
|
68
|
+
ctx.addIssue({
|
|
69
|
+
code: z.z.ZodIssueCode.custom,
|
|
70
|
+
message: "Invalid date",
|
|
71
|
+
path: [key]
|
|
72
|
+
});
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (constraints.min) {
|
|
76
|
+
const minDate = new Date(constraints.min);
|
|
77
|
+
if (dateValue < minDate) {
|
|
78
|
+
ctx.addIssue({
|
|
79
|
+
code: z.z.ZodIssueCode.custom,
|
|
80
|
+
message: `Date must be after ${minDate.toLocaleDateString()}`,
|
|
81
|
+
path: [key]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (constraints.max) {
|
|
86
|
+
const maxDate = new Date(constraints.max);
|
|
87
|
+
if (dateValue > maxDate) {
|
|
88
|
+
ctx.addIssue({
|
|
89
|
+
code: z.z.ZodIssueCode.custom,
|
|
90
|
+
message: `Date must be before ${maxDate.toLocaleDateString()}`,
|
|
91
|
+
path: [key]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function attachStepsMetadata(schema, jsonSchema) {
|
|
99
|
+
const steps = jsonSchema.steps;
|
|
100
|
+
if (!steps || steps.length === 0) {
|
|
101
|
+
return schema;
|
|
102
|
+
}
|
|
103
|
+
const stepGroupMap = jsonSchema.stepGroupMap ?? extractStepGroupMap(jsonSchema);
|
|
104
|
+
return schema.meta({
|
|
105
|
+
steps,
|
|
106
|
+
stepGroupMap
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function formSchemaToZod(jsonSchema) {
|
|
110
|
+
let schema = z.z.fromJSONSchema(jsonSchema);
|
|
111
|
+
const dateFieldsWithConstraints = findDateFieldsWithConstraints(jsonSchema);
|
|
112
|
+
schema = addDateValidations(schema, dateFieldsWithConstraints);
|
|
113
|
+
schema = attachStepsMetadata(schema, jsonSchema);
|
|
114
|
+
return schema;
|
|
115
|
+
}
|
|
116
|
+
function hasSteps(jsonSchema) {
|
|
117
|
+
return Array.isArray(jsonSchema.steps) && jsonSchema.steps.length > 0;
|
|
118
|
+
}
|
|
119
|
+
function getSteps(jsonSchema) {
|
|
120
|
+
return jsonSchema.steps ?? [];
|
|
121
|
+
}
|
|
122
|
+
function getStepGroupMap(jsonSchema) {
|
|
123
|
+
return jsonSchema.stepGroupMap ?? extractStepGroupMap(jsonSchema);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
exports.formSchemaToZod = formSchemaToZod;
|
|
127
|
+
exports.getStepGroupMap = getStepGroupMap;
|
|
128
|
+
exports.getSteps = getSteps;
|
|
129
|
+
exports.hasSteps = hasSteps;
|
|
130
|
+
exports.zodToFormSchema = zodToFormSchema;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
function zodToFormSchema(schema, metadata) {
|
|
4
|
+
const jsonSchema = z.toJSONSchema(schema, {
|
|
5
|
+
unrepresentable: "any",
|
|
6
|
+
override: (ctx) => {
|
|
7
|
+
const def = ctx.zodSchema?._zod?.def;
|
|
8
|
+
if (def?.type === "date") {
|
|
9
|
+
ctx.jsonSchema.type = "string";
|
|
10
|
+
ctx.jsonSchema.format = "date-time";
|
|
11
|
+
const zodSchema = ctx.zodSchema;
|
|
12
|
+
if (zodSchema.minDate) {
|
|
13
|
+
ctx.jsonSchema.formatMinimum = zodSchema.minDate;
|
|
14
|
+
}
|
|
15
|
+
if (zodSchema.maxDate) {
|
|
16
|
+
ctx.jsonSchema.formatMaximum = zodSchema.maxDate;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
if (metadata?.steps) {
|
|
22
|
+
jsonSchema.steps = metadata.steps;
|
|
23
|
+
}
|
|
24
|
+
if (metadata?.stepGroupMap) {
|
|
25
|
+
jsonSchema.stepGroupMap = metadata.stepGroupMap;
|
|
26
|
+
}
|
|
27
|
+
return jsonSchema;
|
|
28
|
+
}
|
|
29
|
+
function extractStepGroupMap(jsonSchema) {
|
|
30
|
+
const stepGroupMap = {};
|
|
31
|
+
const properties = jsonSchema.properties;
|
|
32
|
+
if (!properties) return stepGroupMap;
|
|
33
|
+
for (const [fieldName, fieldSchema] of Object.entries(properties)) {
|
|
34
|
+
if (typeof fieldSchema.stepGroup === "number") {
|
|
35
|
+
stepGroupMap[fieldName] = fieldSchema.stepGroup;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return stepGroupMap;
|
|
39
|
+
}
|
|
40
|
+
function findDateFieldsWithConstraints(jsonSchema) {
|
|
41
|
+
const dateFields = {};
|
|
42
|
+
const properties = jsonSchema.properties;
|
|
43
|
+
if (!properties) return dateFields;
|
|
44
|
+
for (const [key, prop] of Object.entries(properties)) {
|
|
45
|
+
if (prop.type === "string" && prop.format === "date-time") {
|
|
46
|
+
if (prop.formatMinimum || prop.formatMaximum) {
|
|
47
|
+
dateFields[key] = {
|
|
48
|
+
min: prop.formatMinimum,
|
|
49
|
+
max: prop.formatMaximum
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return dateFields;
|
|
55
|
+
}
|
|
56
|
+
function addDateValidations(schema, dateFieldsWithConstraints) {
|
|
57
|
+
if (Object.keys(dateFieldsWithConstraints).length === 0) {
|
|
58
|
+
return schema;
|
|
59
|
+
}
|
|
60
|
+
return schema.superRefine((data, ctx) => {
|
|
61
|
+
for (const [key, constraints] of Object.entries(dateFieldsWithConstraints)) {
|
|
62
|
+
const value = data[key];
|
|
63
|
+
if (value === void 0 || value === null || value === "") continue;
|
|
64
|
+
const dateValue = new Date(value);
|
|
65
|
+
if (isNaN(dateValue.getTime())) {
|
|
66
|
+
ctx.addIssue({
|
|
67
|
+
code: z.ZodIssueCode.custom,
|
|
68
|
+
message: "Invalid date",
|
|
69
|
+
path: [key]
|
|
70
|
+
});
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (constraints.min) {
|
|
74
|
+
const minDate = new Date(constraints.min);
|
|
75
|
+
if (dateValue < minDate) {
|
|
76
|
+
ctx.addIssue({
|
|
77
|
+
code: z.ZodIssueCode.custom,
|
|
78
|
+
message: `Date must be after ${minDate.toLocaleDateString()}`,
|
|
79
|
+
path: [key]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (constraints.max) {
|
|
84
|
+
const maxDate = new Date(constraints.max);
|
|
85
|
+
if (dateValue > maxDate) {
|
|
86
|
+
ctx.addIssue({
|
|
87
|
+
code: z.ZodIssueCode.custom,
|
|
88
|
+
message: `Date must be before ${maxDate.toLocaleDateString()}`,
|
|
89
|
+
path: [key]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function attachStepsMetadata(schema, jsonSchema) {
|
|
97
|
+
const steps = jsonSchema.steps;
|
|
98
|
+
if (!steps || steps.length === 0) {
|
|
99
|
+
return schema;
|
|
100
|
+
}
|
|
101
|
+
const stepGroupMap = jsonSchema.stepGroupMap ?? extractStepGroupMap(jsonSchema);
|
|
102
|
+
return schema.meta({
|
|
103
|
+
steps,
|
|
104
|
+
stepGroupMap
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function formSchemaToZod(jsonSchema) {
|
|
108
|
+
let schema = z.fromJSONSchema(jsonSchema);
|
|
109
|
+
const dateFieldsWithConstraints = findDateFieldsWithConstraints(jsonSchema);
|
|
110
|
+
schema = addDateValidations(schema, dateFieldsWithConstraints);
|
|
111
|
+
schema = attachStepsMetadata(schema, jsonSchema);
|
|
112
|
+
return schema;
|
|
113
|
+
}
|
|
114
|
+
function hasSteps(jsonSchema) {
|
|
115
|
+
return Array.isArray(jsonSchema.steps) && jsonSchema.steps.length > 0;
|
|
116
|
+
}
|
|
117
|
+
function getSteps(jsonSchema) {
|
|
118
|
+
return jsonSchema.steps ?? [];
|
|
119
|
+
}
|
|
120
|
+
function getStepGroupMap(jsonSchema) {
|
|
121
|
+
return jsonSchema.stepGroupMap ?? extractStepGroupMap(jsonSchema);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { formSchemaToZod, getStepGroupMap, getSteps, hasSteps, zodToFormSchema };
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.CcI4sYJP.cjs';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.CcI4sYJP.mjs';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.CcI4sYJP.js';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CcI4sYJP.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
title: string;
|
|
132
131
|
published: boolean;
|
|
132
|
+
title: string;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CcI4sYJP.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
title: string;
|
|
132
131
|
published: boolean;
|
|
132
|
+
title: string;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CcI4sYJP.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
title: string;
|
|
132
131
|
published: boolean;
|
|
132
|
+
title: string;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.CcI4sYJP.cjs';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.cjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.CcI4sYJP.mjs';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.mjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.CcI4sYJP.js';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.js';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CcI4sYJP.cjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
-
title: z.ZodString;
|
|
148
147
|
slug: z.ZodOptional<z.ZodString>;
|
|
149
148
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
150
149
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
+
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CcI4sYJP.mjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
-
title: z.ZodString;
|
|
148
147
|
slug: z.ZodOptional<z.ZodString>;
|
|
149
148
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
150
149
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
+
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|