@btst/stack 1.5.2 → 1.7.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/api/index.cjs +7 -1
- package/dist/api/index.d.cts +2 -2
- package/dist/api/index.d.mts +2 -2
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.mjs +7 -1
- package/dist/client/index.d.cts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- 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/better-stack/src/plugins/open-api/api/generator.cjs +300 -0
- package/dist/packages/better-stack/src/plugins/open-api/api/generator.mjs +284 -0
- package/dist/packages/better-stack/src/plugins/open-api/api/plugin.cjs +115 -0
- package/dist/packages/better-stack/src/plugins/open-api/api/plugin.mjs +113 -0
- package/dist/packages/better-stack/src/plugins/open-api/db.cjs +7 -0
- package/dist/packages/better-stack/src/plugins/open-api/db.mjs +5 -0
- package/dist/packages/better-stack/src/plugins/open-api/logo.cjs +8 -0
- package/dist/packages/better-stack/src/plugins/open-api/logo.mjs +6 -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/api/index.d.cts +2 -2
- package/dist/plugins/api/index.d.mts +2 -2
- package/dist/plugins/api/index.d.ts +2 -2
- 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/client/index.d.cts +2 -2
- package/dist/plugins/client/index.d.mts +2 -2
- package/dist/plugins/client/index.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/plugins/open-api/api/index.cjs +9 -0
- package/dist/plugins/open-api/api/index.d.cts +95 -0
- package/dist/plugins/open-api/api/index.d.mts +95 -0
- package/dist/plugins/open-api/api/index.d.ts +95 -0
- package/dist/plugins/open-api/api/index.mjs +2 -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.ByOugz9d.d.cts → stack.CSce37mX.d.cts} +15 -2
- package/dist/shared/{stack.ByOugz9d.d.mts → stack.CSce37mX.d.mts} +15 -2
- package/dist/shared/{stack.ByOugz9d.d.ts → stack.CSce37mX.d.ts} +15 -2
- 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 +67 -1
- package/src/api/index.ts +14 -2
- 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/src/plugins/open-api/api/generator.ts +433 -0
- package/src/plugins/open-api/api/index.ts +8 -0
- package/src/plugins/open-api/api/plugin.ts +243 -0
- package/src/plugins/open-api/db.ts +7 -0
- package/src/plugins/open-api/logo.ts +7 -0
- package/src/types.ts +15 -1
- package/dist/shared/{stack.DLhzx1-D.d.mts → stack.CcI4sYJP.d.cts} +1 -1
- package/dist/shared/{stack.DLhzx1-D.d.ts → stack.CcI4sYJP.d.mts} +1 -1
- package/dist/shared/{stack.DLhzx1-D.d.cts → stack.CcI4sYJP.d.ts} +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./form-builder-hooks";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { formBuilderClientPlugin } from "./plugin";
|
|
2
|
+
export type {
|
|
3
|
+
FormBuilderClientConfig,
|
|
4
|
+
FormBuilderClientHooks,
|
|
5
|
+
LoaderContext,
|
|
6
|
+
} from "./plugin";
|
|
7
|
+
export type { FormBuilderPluginOverrides, RouteContext } from "./overrides";
|
|
8
|
+
export type { FormBuilderLocalization } from "./localization";
|
|
9
|
+
|
|
10
|
+
// Re-export AutoFormInputComponentProps for custom field components
|
|
11
|
+
export type { AutoFormInputComponentProps } from "@workspace/ui/components/auto-form/types";
|
|
12
|
+
|
|
13
|
+
// Re-export schema converter utilities
|
|
14
|
+
export {
|
|
15
|
+
zodToFormSchema,
|
|
16
|
+
formSchemaToZod,
|
|
17
|
+
hasSteps,
|
|
18
|
+
getSteps,
|
|
19
|
+
getStepGroupMap,
|
|
20
|
+
type FormStep,
|
|
21
|
+
type FormSchemaMetadata,
|
|
22
|
+
} from "@workspace/ui/lib/schema-converter";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const FORM_BUILDER_COMMON = {
|
|
2
|
+
// Buttons
|
|
3
|
+
FORM_BUILDER_BUTTON_SAVE: "Save",
|
|
4
|
+
FORM_BUILDER_BUTTON_CANCEL: "Cancel",
|
|
5
|
+
FORM_BUILDER_BUTTON_DELETE: "Delete",
|
|
6
|
+
FORM_BUILDER_BUTTON_CREATE: "Create",
|
|
7
|
+
FORM_BUILDER_BUTTON_BACK: "Back",
|
|
8
|
+
FORM_BUILDER_BUTTON_NEW_FORM: "New Form",
|
|
9
|
+
FORM_BUILDER_BUTTON_SUBMIT: "Submit",
|
|
10
|
+
|
|
11
|
+
// Labels
|
|
12
|
+
FORM_BUILDER_LABEL_NAME: "Name",
|
|
13
|
+
FORM_BUILDER_LABEL_SLUG: "Slug",
|
|
14
|
+
FORM_BUILDER_LABEL_SLUG_DESCRIPTION: "URL-friendly identifier for this form",
|
|
15
|
+
FORM_BUILDER_LABEL_DESCRIPTION: "Description",
|
|
16
|
+
FORM_BUILDER_LABEL_STATUS: "Status",
|
|
17
|
+
FORM_BUILDER_LABEL_CREATED_AT: "Created",
|
|
18
|
+
FORM_BUILDER_LABEL_UPDATED_AT: "Last Updated",
|
|
19
|
+
FORM_BUILDER_LABEL_ACTIONS: "Actions",
|
|
20
|
+
|
|
21
|
+
// Status
|
|
22
|
+
FORM_BUILDER_STATUS_LOADING: "Loading...",
|
|
23
|
+
FORM_BUILDER_STATUS_SAVING: "Saving...",
|
|
24
|
+
FORM_BUILDER_STATUS_DELETING: "Deleting...",
|
|
25
|
+
FORM_BUILDER_STATUS_ACTIVE: "Active",
|
|
26
|
+
FORM_BUILDER_STATUS_INACTIVE: "Inactive",
|
|
27
|
+
FORM_BUILDER_STATUS_ARCHIVED: "Archived",
|
|
28
|
+
|
|
29
|
+
// Errors
|
|
30
|
+
FORM_BUILDER_ERROR_GENERIC: "Something went wrong",
|
|
31
|
+
FORM_BUILDER_ERROR_NOT_FOUND: "Not found",
|
|
32
|
+
FORM_BUILDER_ERROR_VALIDATION: "Please fix the errors above",
|
|
33
|
+
|
|
34
|
+
// Attribution
|
|
35
|
+
FORM_BUILDER_ATTRIBUTION: "Powered by Better Stack",
|
|
36
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const FORM_BUILDER_EDITOR = {
|
|
2
|
+
FORM_BUILDER_EDITOR_TITLE_NEW: "New Form",
|
|
3
|
+
FORM_BUILDER_EDITOR_TITLE_EDIT: "Edit Form",
|
|
4
|
+
FORM_BUILDER_EDITOR_SLUG_AUTO: "Auto-generated from name",
|
|
5
|
+
FORM_BUILDER_EDITOR_SLUG_MANUAL: "Manually set",
|
|
6
|
+
FORM_BUILDER_EDITOR_DELETE_CONFIRM:
|
|
7
|
+
"Are you sure you want to delete this form? All submissions will also be deleted.",
|
|
8
|
+
FORM_BUILDER_EDITOR_UNSAVED_CHANGES: "You have unsaved changes",
|
|
9
|
+
FORM_BUILDER_EDITOR_NAME_PLACEHOLDER: "Enter form name",
|
|
10
|
+
FORM_BUILDER_EDITOR_SLUG_PLACEHOLDER: "enter-form-slug",
|
|
11
|
+
FORM_BUILDER_EDITOR_DESCRIPTION_PLACEHOLDER:
|
|
12
|
+
"Optional description for this form",
|
|
13
|
+
FORM_BUILDER_EDITOR_SUCCESS_MESSAGE_LABEL: "Success Message",
|
|
14
|
+
FORM_BUILDER_EDITOR_SUCCESS_MESSAGE_PLACEHOLDER:
|
|
15
|
+
"Thank you for your submission!",
|
|
16
|
+
FORM_BUILDER_EDITOR_REDIRECT_URL_LABEL: "Redirect URL (optional)",
|
|
17
|
+
FORM_BUILDER_EDITOR_REDIRECT_URL_PLACEHOLDER: "https://example.com/thank-you",
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const FORM_BUILDER_LIST = {
|
|
2
|
+
FORM_BUILDER_LIST_TITLE: "Forms",
|
|
3
|
+
FORM_BUILDER_LIST_SUBTITLE: "Manage your forms",
|
|
4
|
+
FORM_BUILDER_LIST_EMPTY: "No forms yet",
|
|
5
|
+
FORM_BUILDER_LIST_EMPTY_DESCRIPTION: "Create your first form to get started.",
|
|
6
|
+
FORM_BUILDER_LIST_COLUMN_NAME: "Name",
|
|
7
|
+
FORM_BUILDER_LIST_COLUMN_SLUG: "Slug",
|
|
8
|
+
FORM_BUILDER_LIST_COLUMN_STATUS: "Status",
|
|
9
|
+
FORM_BUILDER_LIST_COLUMN_CREATED: "Created",
|
|
10
|
+
FORM_BUILDER_LIST_COLUMN_ACTIONS: "Actions",
|
|
11
|
+
FORM_BUILDER_LIST_ACTION_EDIT: "Edit",
|
|
12
|
+
FORM_BUILDER_LIST_ACTION_DELETE: "Delete",
|
|
13
|
+
FORM_BUILDER_LIST_ACTION_SUBMISSIONS: "Submissions",
|
|
14
|
+
FORM_BUILDER_LIST_PAGINATION_SHOWING: "Showing {from}-{to} of {total}",
|
|
15
|
+
FORM_BUILDER_LIST_PAGINATION_PREVIOUS: "Previous",
|
|
16
|
+
FORM_BUILDER_LIST_PAGINATION_NEXT: "Next",
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const FORM_BUILDER_SUBMISSIONS = {
|
|
2
|
+
FORM_BUILDER_SUBMISSIONS_TITLE: "Submissions",
|
|
3
|
+
FORM_BUILDER_SUBMISSIONS_SUBTITLE: "View form submissions",
|
|
4
|
+
FORM_BUILDER_SUBMISSIONS_EMPTY: "No submissions yet",
|
|
5
|
+
FORM_BUILDER_SUBMISSIONS_EMPTY_DESCRIPTION:
|
|
6
|
+
"Submissions will appear here when users submit this form.",
|
|
7
|
+
FORM_BUILDER_SUBMISSIONS_COLUMN_ID: "ID",
|
|
8
|
+
FORM_BUILDER_SUBMISSIONS_COLUMN_DATA: "Data",
|
|
9
|
+
FORM_BUILDER_SUBMISSIONS_COLUMN_SUBMITTED_AT: "Submitted",
|
|
10
|
+
FORM_BUILDER_SUBMISSIONS_COLUMN_IP_ADDRESS: "IP Address",
|
|
11
|
+
FORM_BUILDER_SUBMISSIONS_COLUMN_ACTIONS: "Actions",
|
|
12
|
+
FORM_BUILDER_SUBMISSIONS_ACTION_VIEW: "View",
|
|
13
|
+
FORM_BUILDER_SUBMISSIONS_ACTION_DELETE: "Delete",
|
|
14
|
+
FORM_BUILDER_SUBMISSIONS_DELETE_CONFIRM:
|
|
15
|
+
"Are you sure you want to delete this submission?",
|
|
16
|
+
FORM_BUILDER_SUBMISSIONS_BACK_TO_FORM: "Back to Form",
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const FORM_BUILDER_TOASTS = {
|
|
2
|
+
FORM_BUILDER_TOAST_CREATE_SUCCESS: "Form created successfully",
|
|
3
|
+
FORM_BUILDER_TOAST_UPDATE_SUCCESS: "Form updated successfully",
|
|
4
|
+
FORM_BUILDER_TOAST_DELETE_SUCCESS: "Form deleted successfully",
|
|
5
|
+
FORM_BUILDER_TOAST_SUBMIT_SUCCESS: "Form submitted successfully",
|
|
6
|
+
FORM_BUILDER_TOAST_ERROR: "An error occurred. Please try again.",
|
|
7
|
+
FORM_BUILDER_TOAST_VALIDATION_ERROR: "Please fix the validation errors",
|
|
8
|
+
FORM_BUILDER_TOAST_DUPLICATE_SLUG: "A form with this slug already exists",
|
|
9
|
+
FORM_BUILDER_TOAST_SUBMISSION_DELETED: "Submission deleted successfully",
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FORM_BUILDER_COMMON } from "./form-builder-common";
|
|
2
|
+
import { FORM_BUILDER_TOASTS } from "./form-builder-toasts";
|
|
3
|
+
import { FORM_BUILDER_LIST } from "./form-builder-list";
|
|
4
|
+
import { FORM_BUILDER_EDITOR } from "./form-builder-editor";
|
|
5
|
+
import { FORM_BUILDER_SUBMISSIONS } from "./form-builder-submissions";
|
|
6
|
+
|
|
7
|
+
export const FORM_BUILDER_LOCALIZATION = {
|
|
8
|
+
...FORM_BUILDER_COMMON,
|
|
9
|
+
...FORM_BUILDER_TOASTS,
|
|
10
|
+
...FORM_BUILDER_LIST,
|
|
11
|
+
...FORM_BUILDER_EDITOR,
|
|
12
|
+
...FORM_BUILDER_SUBMISSIONS,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type FormBuilderLocalization = typeof FORM_BUILDER_LOCALIZATION;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import type { FormBuilderLocalization } from "./localization";
|
|
3
|
+
import type { AutoFormInputComponentProps } from "@workspace/ui/components/auto-form/types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Context passed to lifecycle hooks
|
|
7
|
+
*/
|
|
8
|
+
export interface RouteContext {
|
|
9
|
+
/** Current route path */
|
|
10
|
+
path: string;
|
|
11
|
+
/** Route parameters (e.g., { id: "123" }) */
|
|
12
|
+
params?: Record<string, string>;
|
|
13
|
+
/** Whether rendering on server (true) or client (false) */
|
|
14
|
+
isSSR: boolean;
|
|
15
|
+
/** Additional context properties */
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Overridable components and functions for the Form Builder plugin
|
|
21
|
+
*
|
|
22
|
+
* External consumers can provide their own implementations of these
|
|
23
|
+
* to customize the behavior for their framework (Next.js, React Router, etc.)
|
|
24
|
+
*/
|
|
25
|
+
export interface FormBuilderPluginOverrides {
|
|
26
|
+
/**
|
|
27
|
+
* Link component for navigation
|
|
28
|
+
*/
|
|
29
|
+
Link?: ComponentType<React.ComponentProps<"a"> & Record<string, unknown>>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Navigation function for programmatic navigation
|
|
33
|
+
*/
|
|
34
|
+
navigate: (path: string) => void | Promise<void>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Refresh function to invalidate server-side cache (e.g., Next.js router.refresh())
|
|
38
|
+
*/
|
|
39
|
+
refresh?: () => void | Promise<void>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Custom field components for AutoForm fields.
|
|
43
|
+
*
|
|
44
|
+
* These map field type names to React components. Use these to:
|
|
45
|
+
* - Override built-in field types (checkbox, date, select, radio, switch, textarea, file, number, fallback)
|
|
46
|
+
* - Add custom field types for your forms
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* fieldComponents: {
|
|
51
|
+
* // Override the file type with custom S3 upload
|
|
52
|
+
* file: ({ field, label, isRequired }) => (
|
|
53
|
+
* <MyS3Upload
|
|
54
|
+
* value={field.value}
|
|
55
|
+
* onChange={field.onChange}
|
|
56
|
+
* label={label}
|
|
57
|
+
* required={isRequired}
|
|
58
|
+
* />
|
|
59
|
+
* ),
|
|
60
|
+
* // Add a custom rich text editor
|
|
61
|
+
* richText: ({ field, label }) => (
|
|
62
|
+
* <MyRichTextEditor value={field.value} onChange={field.onChange} />
|
|
63
|
+
* ),
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
fieldComponents?: Record<string, ComponentType<AutoFormInputComponentProps>>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Localization object for the Form Builder plugin
|
|
71
|
+
*/
|
|
72
|
+
localization?: FormBuilderLocalization;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* API base URL
|
|
76
|
+
*/
|
|
77
|
+
apiBaseURL: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* API base path
|
|
81
|
+
*/
|
|
82
|
+
apiBasePath: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Whether to show the attribution
|
|
86
|
+
*/
|
|
87
|
+
showAttribution?: boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Optional headers to pass with API requests (e.g., for SSR auth)
|
|
91
|
+
*/
|
|
92
|
+
headers?: HeadersInit;
|
|
93
|
+
|
|
94
|
+
// Lifecycle Hooks (optional)
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Called when a route is rendered
|
|
98
|
+
* @param routeName - Name of the route (e.g., 'formList', 'formBuilder', 'submissions')
|
|
99
|
+
* @param context - Route context with path, params, etc.
|
|
100
|
+
*/
|
|
101
|
+
onRouteRender?: (
|
|
102
|
+
routeName: string,
|
|
103
|
+
context: RouteContext,
|
|
104
|
+
) => void | Promise<void>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Called when a route encounters an error
|
|
108
|
+
* @param routeName - Name of the route
|
|
109
|
+
* @param error - The error that occurred
|
|
110
|
+
* @param context - Route context
|
|
111
|
+
*/
|
|
112
|
+
onRouteError?: (
|
|
113
|
+
routeName: string,
|
|
114
|
+
error: Error,
|
|
115
|
+
context: RouteContext,
|
|
116
|
+
) => void | Promise<void>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Called before the form list page is rendered
|
|
120
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
121
|
+
* @param context - Route context
|
|
122
|
+
*/
|
|
123
|
+
onBeforeFormListRendered?: (context: RouteContext) => boolean;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Called before the form builder page is rendered
|
|
127
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
128
|
+
* @param id - The form ID (null for new forms)
|
|
129
|
+
* @param context - Route context
|
|
130
|
+
*/
|
|
131
|
+
onBeforeFormBuilderRendered?: (
|
|
132
|
+
id: string | null,
|
|
133
|
+
context: RouteContext,
|
|
134
|
+
) => boolean;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Called before the submissions page is rendered
|
|
138
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
139
|
+
* @param formId - The form ID
|
|
140
|
+
* @param context - Route context
|
|
141
|
+
*/
|
|
142
|
+
onBeforeSubmissionsRendered?: (
|
|
143
|
+
formId: string,
|
|
144
|
+
context: RouteContext,
|
|
145
|
+
) => boolean;
|
|
146
|
+
}
|