@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,211 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const React = require('react');
|
|
5
|
+
const index$6 = require('../../../../../@radix-ui_primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.cjs');
|
|
6
|
+
const index$2 = require('../../../../../@radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.cjs');
|
|
7
|
+
const index$5 = require('../../../../../@radix-ui_react-roving-focus@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_fe1151d1f393bbc1072b24a86dff3a23/node_modules/@radix-ui/react-roving-focus/dist/index.cjs');
|
|
8
|
+
const index$7 = require('../../../../../@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.cjs');
|
|
9
|
+
const index$4 = require('../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596/node_modules/@radix-ui/react-primitive/dist/index.cjs');
|
|
10
|
+
const index = require('../../../../../@radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.cjs');
|
|
11
|
+
const index$1 = require('../../../../../@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs');
|
|
12
|
+
const index$3 = require('../../../../../@radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-id/dist/index.cjs');
|
|
13
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
14
|
+
|
|
15
|
+
function _interopNamespaceCompat(e) {
|
|
16
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
17
|
+
const n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
for (const k in e) {
|
|
20
|
+
n[k] = e[k];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
28
|
+
|
|
29
|
+
var TABS_NAME = "Tabs";
|
|
30
|
+
var [createTabsContext] = index$2.createContextScope(TABS_NAME, [
|
|
31
|
+
index$5.createRovingFocusGroupScope
|
|
32
|
+
]);
|
|
33
|
+
var useRovingFocusGroupScope = index$5.createRovingFocusGroupScope();
|
|
34
|
+
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
|
35
|
+
var Tabs = React__namespace.forwardRef(
|
|
36
|
+
(props, forwardedRef) => {
|
|
37
|
+
const {
|
|
38
|
+
__scopeTabs,
|
|
39
|
+
value: valueProp,
|
|
40
|
+
onValueChange,
|
|
41
|
+
defaultValue,
|
|
42
|
+
orientation = "horizontal",
|
|
43
|
+
dir,
|
|
44
|
+
activationMode = "automatic",
|
|
45
|
+
...tabsProps
|
|
46
|
+
} = props;
|
|
47
|
+
const direction = index.useDirection(dir);
|
|
48
|
+
const [value, setValue] = index$1.useControllableState({
|
|
49
|
+
prop: valueProp,
|
|
50
|
+
onChange: onValueChange,
|
|
51
|
+
defaultProp: defaultValue ?? "",
|
|
52
|
+
caller: TABS_NAME
|
|
53
|
+
});
|
|
54
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
+
TabsProvider,
|
|
56
|
+
{
|
|
57
|
+
scope: __scopeTabs,
|
|
58
|
+
baseId: index$3.useId(),
|
|
59
|
+
value,
|
|
60
|
+
onValueChange: setValue,
|
|
61
|
+
orientation,
|
|
62
|
+
dir: direction,
|
|
63
|
+
activationMode,
|
|
64
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
index$4.Primitive.div,
|
|
66
|
+
{
|
|
67
|
+
dir: direction,
|
|
68
|
+
"data-orientation": orientation,
|
|
69
|
+
...tabsProps,
|
|
70
|
+
ref: forwardedRef
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
Tabs.displayName = TABS_NAME;
|
|
78
|
+
var TAB_LIST_NAME = "TabsList";
|
|
79
|
+
var TabsList = React__namespace.forwardRef(
|
|
80
|
+
(props, forwardedRef) => {
|
|
81
|
+
const { __scopeTabs, loop = true, ...listProps } = props;
|
|
82
|
+
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
83
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
84
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
+
index$5.Root,
|
|
86
|
+
{
|
|
87
|
+
asChild: true,
|
|
88
|
+
...rovingFocusGroupScope,
|
|
89
|
+
orientation: context.orientation,
|
|
90
|
+
dir: context.dir,
|
|
91
|
+
loop,
|
|
92
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
93
|
+
index$4.Primitive.div,
|
|
94
|
+
{
|
|
95
|
+
role: "tablist",
|
|
96
|
+
"aria-orientation": context.orientation,
|
|
97
|
+
...listProps,
|
|
98
|
+
ref: forwardedRef
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
TabsList.displayName = TAB_LIST_NAME;
|
|
106
|
+
var TRIGGER_NAME = "TabsTrigger";
|
|
107
|
+
var TabsTrigger = React__namespace.forwardRef(
|
|
108
|
+
(props, forwardedRef) => {
|
|
109
|
+
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
|
110
|
+
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
|
111
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
112
|
+
const triggerId = makeTriggerId(context.baseId, value);
|
|
113
|
+
const contentId = makeContentId(context.baseId, value);
|
|
114
|
+
const isSelected = value === context.value;
|
|
115
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
+
index$5.Item,
|
|
117
|
+
{
|
|
118
|
+
asChild: true,
|
|
119
|
+
...rovingFocusGroupScope,
|
|
120
|
+
focusable: !disabled,
|
|
121
|
+
active: isSelected,
|
|
122
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
123
|
+
index$4.Primitive.button,
|
|
124
|
+
{
|
|
125
|
+
type: "button",
|
|
126
|
+
role: "tab",
|
|
127
|
+
"aria-selected": isSelected,
|
|
128
|
+
"aria-controls": contentId,
|
|
129
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
130
|
+
"data-disabled": disabled ? "" : void 0,
|
|
131
|
+
disabled,
|
|
132
|
+
id: triggerId,
|
|
133
|
+
...triggerProps,
|
|
134
|
+
ref: forwardedRef,
|
|
135
|
+
onMouseDown: index$6.composeEventHandlers(props.onMouseDown, (event) => {
|
|
136
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
137
|
+
context.onValueChange(value);
|
|
138
|
+
} else {
|
|
139
|
+
event.preventDefault();
|
|
140
|
+
}
|
|
141
|
+
}),
|
|
142
|
+
onKeyDown: index$6.composeEventHandlers(props.onKeyDown, (event) => {
|
|
143
|
+
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
144
|
+
}),
|
|
145
|
+
onFocus: index$6.composeEventHandlers(props.onFocus, () => {
|
|
146
|
+
const isAutomaticActivation = context.activationMode !== "manual";
|
|
147
|
+
if (!isSelected && !disabled && isAutomaticActivation) {
|
|
148
|
+
context.onValueChange(value);
|
|
149
|
+
}
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
TabsTrigger.displayName = TRIGGER_NAME;
|
|
158
|
+
var CONTENT_NAME = "TabsContent";
|
|
159
|
+
var TabsContent = React__namespace.forwardRef(
|
|
160
|
+
(props, forwardedRef) => {
|
|
161
|
+
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
|
162
|
+
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
|
163
|
+
const triggerId = makeTriggerId(context.baseId, value);
|
|
164
|
+
const contentId = makeContentId(context.baseId, value);
|
|
165
|
+
const isSelected = value === context.value;
|
|
166
|
+
const isMountAnimationPreventedRef = React__namespace.useRef(isSelected);
|
|
167
|
+
React__namespace.useEffect(() => {
|
|
168
|
+
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
169
|
+
return () => cancelAnimationFrame(rAF);
|
|
170
|
+
}, []);
|
|
171
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$7.Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
172
|
+
index$4.Primitive.div,
|
|
173
|
+
{
|
|
174
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
175
|
+
"data-orientation": context.orientation,
|
|
176
|
+
role: "tabpanel",
|
|
177
|
+
"aria-labelledby": triggerId,
|
|
178
|
+
hidden: !present,
|
|
179
|
+
id: contentId,
|
|
180
|
+
tabIndex: 0,
|
|
181
|
+
...contentProps,
|
|
182
|
+
ref: forwardedRef,
|
|
183
|
+
style: {
|
|
184
|
+
...props.style,
|
|
185
|
+
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
|
186
|
+
},
|
|
187
|
+
children: present && children
|
|
188
|
+
}
|
|
189
|
+
) });
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
TabsContent.displayName = CONTENT_NAME;
|
|
193
|
+
function makeTriggerId(baseId, value) {
|
|
194
|
+
return `${baseId}-trigger-${value}`;
|
|
195
|
+
}
|
|
196
|
+
function makeContentId(baseId, value) {
|
|
197
|
+
return `${baseId}-content-${value}`;
|
|
198
|
+
}
|
|
199
|
+
var Root2 = Tabs;
|
|
200
|
+
var List = TabsList;
|
|
201
|
+
var Trigger = TabsTrigger;
|
|
202
|
+
var Content = TabsContent;
|
|
203
|
+
|
|
204
|
+
exports.Content = Content;
|
|
205
|
+
exports.List = List;
|
|
206
|
+
exports.Root = Root2;
|
|
207
|
+
exports.Tabs = Tabs;
|
|
208
|
+
exports.TabsContent = TabsContent;
|
|
209
|
+
exports.TabsList = TabsList;
|
|
210
|
+
exports.TabsTrigger = TabsTrigger;
|
|
211
|
+
exports.Trigger = Trigger;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { composeEventHandlers } from '../../../../../@radix-ui_primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.mjs';
|
|
4
|
+
import { createContextScope } from '../../../../../@radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.mjs';
|
|
5
|
+
import { createRovingFocusGroupScope, Root, Item } from '../../../../../@radix-ui_react-roving-focus@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_fe1151d1f393bbc1072b24a86dff3a23/node_modules/@radix-ui/react-roving-focus/dist/index.mjs';
|
|
6
|
+
import { Presence } from '../../../../../@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.mjs';
|
|
7
|
+
import { Primitive } from '../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596/node_modules/@radix-ui/react-primitive/dist/index.mjs';
|
|
8
|
+
import { useDirection } from '../../../../../@radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs';
|
|
9
|
+
import { useControllableState } from '../../../../../@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs';
|
|
10
|
+
import { useId } from '../../../../../@radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-id/dist/index.mjs';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
var TABS_NAME = "Tabs";
|
|
14
|
+
var [createTabsContext] = createContextScope(TABS_NAME, [
|
|
15
|
+
createRovingFocusGroupScope
|
|
16
|
+
]);
|
|
17
|
+
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
18
|
+
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
|
19
|
+
var Tabs = React.forwardRef(
|
|
20
|
+
(props, forwardedRef) => {
|
|
21
|
+
const {
|
|
22
|
+
__scopeTabs,
|
|
23
|
+
value: valueProp,
|
|
24
|
+
onValueChange,
|
|
25
|
+
defaultValue,
|
|
26
|
+
orientation = "horizontal",
|
|
27
|
+
dir,
|
|
28
|
+
activationMode = "automatic",
|
|
29
|
+
...tabsProps
|
|
30
|
+
} = props;
|
|
31
|
+
const direction = useDirection(dir);
|
|
32
|
+
const [value, setValue] = useControllableState({
|
|
33
|
+
prop: valueProp,
|
|
34
|
+
onChange: onValueChange,
|
|
35
|
+
defaultProp: defaultValue ?? "",
|
|
36
|
+
caller: TABS_NAME
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
TabsProvider,
|
|
40
|
+
{
|
|
41
|
+
scope: __scopeTabs,
|
|
42
|
+
baseId: useId(),
|
|
43
|
+
value,
|
|
44
|
+
onValueChange: setValue,
|
|
45
|
+
orientation,
|
|
46
|
+
dir: direction,
|
|
47
|
+
activationMode,
|
|
48
|
+
children: /* @__PURE__ */ jsx(
|
|
49
|
+
Primitive.div,
|
|
50
|
+
{
|
|
51
|
+
dir: direction,
|
|
52
|
+
"data-orientation": orientation,
|
|
53
|
+
...tabsProps,
|
|
54
|
+
ref: forwardedRef
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
Tabs.displayName = TABS_NAME;
|
|
62
|
+
var TAB_LIST_NAME = "TabsList";
|
|
63
|
+
var TabsList = React.forwardRef(
|
|
64
|
+
(props, forwardedRef) => {
|
|
65
|
+
const { __scopeTabs, loop = true, ...listProps } = props;
|
|
66
|
+
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
67
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
Root,
|
|
70
|
+
{
|
|
71
|
+
asChild: true,
|
|
72
|
+
...rovingFocusGroupScope,
|
|
73
|
+
orientation: context.orientation,
|
|
74
|
+
dir: context.dir,
|
|
75
|
+
loop,
|
|
76
|
+
children: /* @__PURE__ */ jsx(
|
|
77
|
+
Primitive.div,
|
|
78
|
+
{
|
|
79
|
+
role: "tablist",
|
|
80
|
+
"aria-orientation": context.orientation,
|
|
81
|
+
...listProps,
|
|
82
|
+
ref: forwardedRef
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
TabsList.displayName = TAB_LIST_NAME;
|
|
90
|
+
var TRIGGER_NAME = "TabsTrigger";
|
|
91
|
+
var TabsTrigger = React.forwardRef(
|
|
92
|
+
(props, forwardedRef) => {
|
|
93
|
+
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
|
94
|
+
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
|
95
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
96
|
+
const triggerId = makeTriggerId(context.baseId, value);
|
|
97
|
+
const contentId = makeContentId(context.baseId, value);
|
|
98
|
+
const isSelected = value === context.value;
|
|
99
|
+
return /* @__PURE__ */ jsx(
|
|
100
|
+
Item,
|
|
101
|
+
{
|
|
102
|
+
asChild: true,
|
|
103
|
+
...rovingFocusGroupScope,
|
|
104
|
+
focusable: !disabled,
|
|
105
|
+
active: isSelected,
|
|
106
|
+
children: /* @__PURE__ */ jsx(
|
|
107
|
+
Primitive.button,
|
|
108
|
+
{
|
|
109
|
+
type: "button",
|
|
110
|
+
role: "tab",
|
|
111
|
+
"aria-selected": isSelected,
|
|
112
|
+
"aria-controls": contentId,
|
|
113
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
114
|
+
"data-disabled": disabled ? "" : void 0,
|
|
115
|
+
disabled,
|
|
116
|
+
id: triggerId,
|
|
117
|
+
...triggerProps,
|
|
118
|
+
ref: forwardedRef,
|
|
119
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
120
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
121
|
+
context.onValueChange(value);
|
|
122
|
+
} else {
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
}
|
|
125
|
+
}),
|
|
126
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
127
|
+
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
128
|
+
}),
|
|
129
|
+
onFocus: composeEventHandlers(props.onFocus, () => {
|
|
130
|
+
const isAutomaticActivation = context.activationMode !== "manual";
|
|
131
|
+
if (!isSelected && !disabled && isAutomaticActivation) {
|
|
132
|
+
context.onValueChange(value);
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
TabsTrigger.displayName = TRIGGER_NAME;
|
|
142
|
+
var CONTENT_NAME = "TabsContent";
|
|
143
|
+
var TabsContent = React.forwardRef(
|
|
144
|
+
(props, forwardedRef) => {
|
|
145
|
+
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
|
146
|
+
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
|
147
|
+
const triggerId = makeTriggerId(context.baseId, value);
|
|
148
|
+
const contentId = makeContentId(context.baseId, value);
|
|
149
|
+
const isSelected = value === context.value;
|
|
150
|
+
const isMountAnimationPreventedRef = React.useRef(isSelected);
|
|
151
|
+
React.useEffect(() => {
|
|
152
|
+
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
153
|
+
return () => cancelAnimationFrame(rAF);
|
|
154
|
+
}, []);
|
|
155
|
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx(
|
|
156
|
+
Primitive.div,
|
|
157
|
+
{
|
|
158
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
159
|
+
"data-orientation": context.orientation,
|
|
160
|
+
role: "tabpanel",
|
|
161
|
+
"aria-labelledby": triggerId,
|
|
162
|
+
hidden: !present,
|
|
163
|
+
id: contentId,
|
|
164
|
+
tabIndex: 0,
|
|
165
|
+
...contentProps,
|
|
166
|
+
ref: forwardedRef,
|
|
167
|
+
style: {
|
|
168
|
+
...props.style,
|
|
169
|
+
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
|
170
|
+
},
|
|
171
|
+
children: present && children
|
|
172
|
+
}
|
|
173
|
+
) });
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
TabsContent.displayName = CONTENT_NAME;
|
|
177
|
+
function makeTriggerId(baseId, value) {
|
|
178
|
+
return `${baseId}-trigger-${value}`;
|
|
179
|
+
}
|
|
180
|
+
function makeContentId(baseId, value) {
|
|
181
|
+
return `${baseId}-content-${value}`;
|
|
182
|
+
}
|
|
183
|
+
var Root2 = Tabs;
|
|
184
|
+
var List = TabsList;
|
|
185
|
+
var Trigger = TabsTrigger;
|
|
186
|
+
var Content = TabsContent;
|
|
187
|
+
|
|
188
|
+
export { Content, List, Root2 as Root, Tabs, TabsContent, TabsList, TabsTrigger, Trigger };
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const api = require('@btst/stack/plugins/api');
|
|
4
4
|
const z = require('zod');
|
|
5
|
+
const schemaConverter = require('../../../../../ui/src/lib/schema-converter.cjs');
|
|
5
6
|
const db = require('../db.cjs');
|
|
6
7
|
const schemas = require('../schemas.cjs');
|
|
7
8
|
const utils = require('../utils.cjs');
|
|
@@ -55,7 +56,7 @@ function serializeContentItemWithType(item) {
|
|
|
55
56
|
}
|
|
56
57
|
async function syncContentTypes(adapter, config) {
|
|
57
58
|
for (const ct of config.contentTypes) {
|
|
58
|
-
const jsonSchema = JSON.stringify(
|
|
59
|
+
const jsonSchema = JSON.stringify(schemaConverter.zodToFormSchema(ct.schema));
|
|
59
60
|
const existing = await adapter.findOne({
|
|
60
61
|
model: "contentType",
|
|
61
62
|
where: [{ field: "slug", value: ct.slug, operator: "eq" }]
|
|
@@ -108,7 +109,7 @@ async function syncContentTypes(adapter, config) {
|
|
|
108
109
|
}
|
|
109
110
|
function getContentTypeZodSchema(contentType) {
|
|
110
111
|
const jsonSchema = JSON.parse(contentType.jsonSchema);
|
|
111
|
-
return
|
|
112
|
+
return schemaConverter.formSchemaToZod(jsonSchema);
|
|
112
113
|
}
|
|
113
114
|
const cmsBackendPlugin = (config) => api.defineBackendPlugin({
|
|
114
115
|
name: "cms",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineBackendPlugin, createEndpoint } from '@btst/stack/plugins/api';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { formSchemaToZod, zodToFormSchema } from '../../../../../ui/src/lib/schema-converter.mjs';
|
|
3
4
|
import { cmsSchema } from '../db.mjs';
|
|
4
5
|
import { listContentQuerySchema } from '../schemas.mjs';
|
|
5
6
|
import { slugify } from '../utils.mjs';
|
|
@@ -53,7 +54,7 @@ function serializeContentItemWithType(item) {
|
|
|
53
54
|
}
|
|
54
55
|
async function syncContentTypes(adapter, config) {
|
|
55
56
|
for (const ct of config.contentTypes) {
|
|
56
|
-
const jsonSchema = JSON.stringify(
|
|
57
|
+
const jsonSchema = JSON.stringify(zodToFormSchema(ct.schema));
|
|
57
58
|
const existing = await adapter.findOne({
|
|
58
59
|
model: "contentType",
|
|
59
60
|
where: [{ field: "slug", value: ct.slug, operator: "eq" }]
|
|
@@ -106,7 +107,7 @@ async function syncContentTypes(adapter, config) {
|
|
|
106
107
|
}
|
|
107
108
|
function getContentTypeZodSchema(contentType) {
|
|
108
109
|
const jsonSchema = JSON.parse(contentType.jsonSchema);
|
|
109
|
-
return
|
|
110
|
+
return formSchemaToZod(jsonSchema);
|
|
110
111
|
}
|
|
111
112
|
const cmsBackendPlugin = (config) => defineBackendPlugin({
|
|
112
113
|
name: "cms",
|
|
@@ -5,8 +5,9 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
const React = require('react');
|
|
6
6
|
const z = require('zod');
|
|
7
7
|
const sonner = require('sonner');
|
|
8
|
-
const
|
|
8
|
+
const steppedAutoForm = require('../../../../../../../ui/src/components/auto-form/stepped-auto-form.cjs');
|
|
9
9
|
const utils = require('../../../../../../../ui/src/components/auto-form/utils.cjs');
|
|
10
|
+
const schemaConverter = require('../../../../../../../ui/src/lib/schema-converter.cjs');
|
|
10
11
|
const input = require('../../../../../../../ui/src/components/input.cjs');
|
|
11
12
|
const label = require('../../../../../../../ui/src/components/label.cjs');
|
|
12
13
|
const badge = require('../../../../../../../ui/src/components/badge.cjs');
|
|
@@ -93,7 +94,7 @@ function ContentForm({
|
|
|
93
94
|
}, [contentType.jsonSchema]);
|
|
94
95
|
const zodSchema = React.useMemo(() => {
|
|
95
96
|
try {
|
|
96
|
-
return
|
|
97
|
+
return schemaConverter.formSchemaToZod(jsonSchema);
|
|
97
98
|
} catch {
|
|
98
99
|
return z.z.object({});
|
|
99
100
|
}
|
|
@@ -157,25 +158,24 @@ function ContentForm({
|
|
|
157
158
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: localization.CMS_LABEL_SLUG_DESCRIPTION })
|
|
158
159
|
] }),
|
|
159
160
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
160
|
-
|
|
161
|
+
steppedAutoForm.default,
|
|
161
162
|
{
|
|
162
163
|
formSchema: zodSchema,
|
|
163
164
|
values: formData,
|
|
164
165
|
onValuesChange: handleValuesChange,
|
|
165
166
|
onSubmit: handleSubmit,
|
|
166
167
|
fieldConfig,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
] })
|
|
168
|
+
isSubmitting,
|
|
169
|
+
submitButtonText: isSubmitting ? localization.CMS_STATUS_SAVING : localization.CMS_BUTTON_SAVE,
|
|
170
|
+
children: onCancel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
171
|
+
"button",
|
|
172
|
+
{
|
|
173
|
+
type: "button",
|
|
174
|
+
onClick: onCancel,
|
|
175
|
+
className: "px-4 py-2 text-sm text-muted-foreground hover:text-foreground",
|
|
176
|
+
children: localization.CMS_BUTTON_CANCEL
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
] });
|
|
@@ -3,8 +3,9 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useState, useEffect, useMemo } from 'react';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { toast } from 'sonner';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
6
|
+
import SteppedAutoForm from '../../../../../../../ui/src/components/auto-form/stepped-auto-form.mjs';
|
|
7
|
+
import { buildFieldConfigFromJsonSchema as buildFieldConfigFromJsonSchema$1 } from '../../../../../../../ui/src/components/auto-form/utils.mjs';
|
|
8
|
+
import { formSchemaToZod } from '../../../../../../../ui/src/lib/schema-converter.mjs';
|
|
8
9
|
import { Input } from '../../../../../../../ui/src/components/input.mjs';
|
|
9
10
|
import { Label } from '../../../../../../../ui/src/components/label.mjs';
|
|
10
11
|
import { Badge } from '../../../../../../../ui/src/components/badge.mjs';
|
|
@@ -91,7 +92,7 @@ function ContentForm({
|
|
|
91
92
|
}, [contentType.jsonSchema]);
|
|
92
93
|
const zodSchema = useMemo(() => {
|
|
93
94
|
try {
|
|
94
|
-
return
|
|
95
|
+
return formSchemaToZod(jsonSchema);
|
|
95
96
|
} catch {
|
|
96
97
|
return z.object({});
|
|
97
98
|
}
|
|
@@ -155,25 +156,24 @@ function ContentForm({
|
|
|
155
156
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: localization.CMS_LABEL_SLUG_DESCRIPTION })
|
|
156
157
|
] }),
|
|
157
158
|
/* @__PURE__ */ jsx(
|
|
158
|
-
|
|
159
|
+
SteppedAutoForm,
|
|
159
160
|
{
|
|
160
161
|
formSchema: zodSchema,
|
|
161
162
|
values: formData,
|
|
162
163
|
onValuesChange: handleValuesChange,
|
|
163
164
|
onSubmit: handleSubmit,
|
|
164
165
|
fieldConfig,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
] })
|
|
166
|
+
isSubmitting,
|
|
167
|
+
submitButtonText: isSubmitting ? localization.CMS_STATUS_SAVING : localization.CMS_BUTTON_SAVE,
|
|
168
|
+
children: onCancel && /* @__PURE__ */ jsx(
|
|
169
|
+
"button",
|
|
170
|
+
{
|
|
171
|
+
type: "button",
|
|
172
|
+
onClick: onCancel,
|
|
173
|
+
className: "px-4 py-2 text-sm text-muted-foreground hover:text-foreground",
|
|
174
|
+
children: localization.CMS_BUTTON_CANCEL
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
177
|
}
|
|
178
178
|
)
|
|
179
179
|
] });
|