@chaibuilder/sdk 0.1.2 → 0.1.3
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/{AddBlocks-e23baf9a.cjs → AddBlocks-0916e841.cjs} +1 -1
- package/dist/{AddBlocks-b5f37f2f.js → AddBlocks-c195f577.js} +19 -19
- package/dist/{BrandingOptions-3d1bd24a.cjs → BrandingOptions-742992b6.cjs} +1 -1
- package/dist/{BrandingOptions-cfd1b740.js → BrandingOptions-766c19c6.js} +27 -27
- package/dist/{CanvasArea-a065a586.js → CanvasArea-25800a3e.js} +19 -18
- package/dist/CanvasArea-e855c4a2.cjs +60 -0
- package/dist/Class-7d6aadbc.cjs +1 -0
- package/dist/{Class-e6b07b79.js → Class-e34b2337.js} +9 -9
- package/dist/{ImagesPanel-eccf9a56.js → ImagesPanel-8ccab6d9.js} +1 -1
- package/dist/{ImagesPanel-cc136c92.cjs → ImagesPanel-addb2bf9.cjs} +1 -1
- package/dist/{Layers-f002ba1a.cjs → Layers-a2169d0b.cjs} +1 -1
- package/dist/{Layers-f935e07b.js → Layers-f7e792f6.js} +3 -3
- package/dist/{MarkAsGlobalBlock-5f435dd5.cjs → MarkAsGlobalBlock-6187e6fd.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-613bfdab.js → MarkAsGlobalBlock-6bac1842.js} +2 -2
- package/dist/PagesPanel-0827c264.js +46 -0
- package/dist/PagesPanel-5698953d.cjs +1 -0
- package/dist/ProjectPanel-a3cb7396.cjs +1 -0
- package/dist/ProjectPanel-e577029a.js +66 -0
- package/dist/{Settings-a19fbb69.js → Settings-b214f859.js} +25 -24
- package/dist/Settings-bee21026.cjs +1 -0
- package/dist/{SidePanels-67ebbcb4.js → SidePanels-03fa10e8.js} +3 -3
- package/dist/{SidePanels-af222189.cjs → SidePanels-934159a4.cjs} +1 -1
- package/dist/{Topbar-fcb01371.js → Topbar-9bc8c9cf.js} +2 -2
- package/dist/{Topbar-e92351cc.cjs → Topbar-c083cc2a.cjs} +1 -1
- package/dist/UnsplashImages-68492dc9.cjs +1 -0
- package/dist/{UnsplashImages-fda2f29a.js → UnsplashImages-afaa7706.js} +19 -28
- package/dist/add-page-modal-63858244.js +92 -0
- package/dist/add-page-modal-cb367c9d.cjs +1 -0
- package/dist/alert-dialog-4ce6ed22.cjs +1 -0
- package/dist/alert-dialog-ee98f47e.js +64 -0
- package/dist/confirm-alert-4f50caa7.cjs +1 -0
- package/dist/confirm-alert-f2a47cc7.js +36 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +20 -12
- package/dist/core.js +53 -52
- package/dist/delete-page-modal-1e3914e3.cjs +1 -0
- package/dist/delete-page-modal-def9012d.js +64 -0
- package/dist/dropdown-menu-84b2439e.cjs +1 -0
- package/dist/dropdown-menu-ae3ed09b.js +164 -0
- package/dist/form-5d5c5c9e.js +125 -0
- package/dist/form-6eac0287.cjs +1 -0
- package/dist/{html-to-json-7510f587.js → html-to-json-9304dbda.js} +1 -1
- package/dist/{html-to-json-7eba915f.cjs → html-to-json-9c9961da.cjs} +1 -1
- package/dist/index-207f2cbf.cjs +2 -0
- package/dist/index-390f7bef.js +4749 -0
- package/dist/index-824a7bd0.js +188 -0
- package/dist/index-ebd86d7f.cjs +2 -0
- package/dist/input-42acea7e.cjs +1 -0
- package/dist/input-a0ea2bc7.js +19 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +3 -3
- package/dist/link-86c532b5.cjs +1 -0
- package/dist/{link-e406254f.js → link-f80a947d.js} +44 -60
- package/dist/mockServiceWorker.js +292 -0
- package/dist/page-viewer-41cbb548.js +88 -0
- package/dist/page-viewer-83ce2c70.cjs +1 -0
- package/dist/project-general-setting-0262fe62.js +65 -0
- package/dist/project-general-setting-2c8bed74.cjs +1 -0
- package/dist/project-seo-setting-01536592.js +67 -0
- package/dist/project-seo-setting-e3924578.cjs +1 -0
- package/dist/single-page-detail-924d57fc.js +206 -0
- package/dist/single-page-detail-cfeae896.cjs +1 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +124 -122
- package/dist/usePageActions-3bed2330.cjs +1 -0
- package/dist/usePageActions-f86f6f65.js +36 -0
- package/dist/useProjectActions-1de05f63.js +17 -0
- package/dist/useProjectActions-5092ed79.cjs +1 -0
- package/package.json +14 -1
- package/dist/CanvasArea-c4554d61.cjs +0 -60
- package/dist/Class-0801d193.cjs +0 -1
- package/dist/Settings-05b9b5fe.cjs +0 -1
- package/dist/UnsplashImages-cca34e45.cjs +0 -1
- package/dist/dropdown-menu-a9b096f9.cjs +0 -1
- package/dist/dropdown-menu-d912a52e.js +0 -223
- package/dist/index-73cf645f.cjs +0 -2
- package/dist/index-7e212fbc.js +0 -2657
- package/dist/link-1ee70bca.cjs +0 -1
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ebd86d7f.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),u=require("react-i18next");require("./jsx-runtime-5c3ac4f7.cjs");require("react");require("i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("jotai");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-7d6aadbc.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("@radix-ui/react-icons");require("./CONTROLS-031e1de3.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiBuilderStudio=e.ChaiBuilderStudio;exports.enableStyling=e.enableStyling;exports.setBlockProps=e.setBlockProps;exports.useActiveLanguage=e.useActiveLanguage;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlockContentByLanguage=e.useBlockContentByLanguage;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderReset=e.useBuilderReset;exports.useBuildingBlocks=e.useBuildingBlocks;exports.useCanvasHistory=e.useCanvasHistory;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCurrentPage=e.useCurrentPage$1;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDeveloperPreviewMode=e.useDeveloperPreviewMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useFeatureSupport=e.useFeatureSupport;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useLanguages=e.useLanguages;exports.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.usePrimaryLanguage=e.usePrimaryLanguage;exports.useProject=e.useProject$1;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSetAllBlocks=e.useSetAllBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTranslations=e.useTranslations;exports.useTreeData=e.useTreeData;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;exports.useBuilderProp=s.useBuilderProp;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>u.useTranslation});
|
package/dist/core.d.ts
CHANGED
|
@@ -38,13 +38,13 @@ export declare type ChaiBlock = {
|
|
|
38
38
|
} & Record<string, string>;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* ChaiBuilder is the main entry point for the Chai Builder Studio.
|
|
42
42
|
* @param props
|
|
43
43
|
* @constructor
|
|
44
44
|
*/
|
|
45
|
-
export declare const
|
|
45
|
+
export declare const ChaiBuilderEditor: (props: ChaiBuilderEditorProps) => JSX_2.Element;
|
|
46
46
|
|
|
47
|
-
export declare interface
|
|
47
|
+
export declare interface ChaiBuilderEditorProps {
|
|
48
48
|
apiKey?: string;
|
|
49
49
|
blocks?: ChaiBlock[];
|
|
50
50
|
brandingOptions?: Record<string, string>;
|
|
@@ -87,6 +87,14 @@ export declare interface ChaiBuilderStudioProps {
|
|
|
87
87
|
getPages?: () => Promise<ChaiPage[]>;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
export declare const ChaiBuilderStudio: (props: ChaiBuilderStudioProps) => JSX_2.Element;
|
|
91
|
+
|
|
92
|
+
declare type ChaiBuilderStudioProps = {
|
|
93
|
+
apiBaseUrl?: string;
|
|
94
|
+
logo?: string | React_2.FC<any>;
|
|
95
|
+
darkModeSupport?: boolean;
|
|
96
|
+
};
|
|
97
|
+
|
|
90
98
|
declare type ChaiPage = {
|
|
91
99
|
uuid?: string;
|
|
92
100
|
page_name?: string;
|
|
@@ -171,15 +179,15 @@ export declare const useBlockContentByLanguage: (prop: string, block: ChaiBlock)
|
|
|
171
179
|
* Wrapper around useAtom
|
|
172
180
|
*/
|
|
173
181
|
export declare const useBrandingOptions: () => readonly [{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
bodyFont: string;
|
|
183
|
+
headingFont: string;
|
|
184
|
+
roundedCorners: number;
|
|
185
|
+
primaryColor: string;
|
|
186
|
+
secondaryColor: string;
|
|
187
|
+
bodyBgDarkColor: string;
|
|
188
|
+
bodyBgLightColor: string;
|
|
189
|
+
bodyTextDarkColor: string;
|
|
190
|
+
bodyTextLightColor: string;
|
|
183
191
|
}, (...args: unknown[]) => unknown];
|
|
184
192
|
|
|
185
193
|
export declare const useBuilderProp: (propKey: string, defaultValue?: any) => any;
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a6 as I, ap as M, a5 as L, a4 as f, D as R, a8 as T, ak as b, Q as x, al as H, H as j, y as w, ao as U, w as F, a3 as G, a9 as O, c as W, e as q, k as E, n as J, aa as K, m as Q, d as Z, ab as z, l as N, j as V, ac as X, P as Y, x as _, an as $, W as ss, ad as es, o as as, p as os, am as ts, ae as us, a7 as ls, q as rs, I as is, u as ps, A as cs, ag as ds, K as Bs, h as ms, L as ks, f as ns, i as gs, g as Cs, ah as Ss, J as Ps, af as vs, ai as ys, T as As, aj as hs, C as Ds } from "./index-390f7bef.js";
|
|
2
2
|
import { u as Ms } from "./useBuilderProp-81a14920.js";
|
|
3
|
-
import { useTranslation as
|
|
3
|
+
import { useTranslation as fs } from "react-i18next";
|
|
4
4
|
import "./jsx-runtime-944c88e2.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "i18next";
|
|
@@ -14,70 +14,71 @@ import "clsx";
|
|
|
14
14
|
import "tailwind-merge";
|
|
15
15
|
import "react-hotkeys-hook";
|
|
16
16
|
import "flat-to-nested";
|
|
17
|
-
import "./Class-
|
|
17
|
+
import "./Class-e34b2337.js";
|
|
18
18
|
import "redux-undo";
|
|
19
19
|
import "@react-hookz/web";
|
|
20
20
|
import "@chaibuilder/blocks";
|
|
21
|
+
import "@radix-ui/react-icons";
|
|
21
22
|
import "./CONTROLS-442caee5.js";
|
|
22
23
|
import "@radix-ui/react-slot";
|
|
23
24
|
import "class-variance-authority";
|
|
24
25
|
import "@radix-ui/react-tooltip";
|
|
25
|
-
import "@radix-ui/react-icons";
|
|
26
26
|
import "@radix-ui/react-toast";
|
|
27
27
|
export {
|
|
28
|
+
I as ChaiBuilderEditor,
|
|
28
29
|
M as ChaiBuilderStudio,
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
L as enableStyling,
|
|
31
|
+
f as setBlockProps,
|
|
31
32
|
R as useActiveLanguage,
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
T as useActiveModal,
|
|
34
|
+
b as useActivePanel,
|
|
34
35
|
x as useAddBlock,
|
|
35
36
|
H as useAddBlockParent,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
j as useAddClassesToBlocks,
|
|
38
|
+
w as useAllBlocks,
|
|
39
|
+
U as useBlockContentByLanguage,
|
|
40
|
+
F as useBrandingOptions,
|
|
40
41
|
Ms as useBuilderProp,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
42
|
+
G as useBuilderReset,
|
|
43
|
+
O as useBuildingBlocks,
|
|
44
|
+
W as useCanvasHistory,
|
|
45
|
+
q as useCanvasWidth,
|
|
46
|
+
E as useCanvasZoom,
|
|
47
|
+
J as useCopyBlockIds,
|
|
48
|
+
K as useCurrentPage,
|
|
49
|
+
Q as useCutBlockIds,
|
|
50
|
+
Z as useDarkMode,
|
|
51
|
+
z as useDeveloperPreviewMode,
|
|
52
|
+
N as useDuplicateBlocks,
|
|
53
|
+
V as useFeatureSupport,
|
|
54
|
+
X as useGetPageData,
|
|
55
|
+
Y as useHiddenBlockIds,
|
|
56
|
+
_ as useHighlightBlockId,
|
|
57
|
+
$ as useLanguages,
|
|
58
|
+
ss as useMarkAsGlobalBlock,
|
|
59
|
+
es as useMoveBlocks,
|
|
60
|
+
as as usePasteBlocks,
|
|
61
|
+
os as usePreviewMode,
|
|
62
|
+
ts as usePrimaryLanguage,
|
|
63
|
+
us as useProject,
|
|
64
|
+
ls as useReadOnlyMode,
|
|
65
|
+
rs as useRemoveBlocks,
|
|
66
|
+
is as useRemoveClassesFromBlocks,
|
|
67
|
+
ps as useSavePage,
|
|
68
|
+
cs as useSelectedBlock,
|
|
69
|
+
ds as useSelectedBlockAllClasses,
|
|
70
|
+
Bs as useSelectedBlockCurrentClasses,
|
|
71
|
+
ms as useSelectedBlockIds,
|
|
72
|
+
ks as useSelectedBlocksDisplayChild,
|
|
73
|
+
ns as useSelectedBreakpoints,
|
|
74
|
+
gs as useSelectedStylingBlocks,
|
|
75
|
+
Cs as useSetAllBlocks,
|
|
75
76
|
Ss as useStylingBreakpoint,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
Ps as useStylingState,
|
|
78
|
+
fs as useTranslation,
|
|
79
|
+
vs as useTranslations,
|
|
80
|
+
ys as useTreeData,
|
|
81
|
+
As as useUILibraryBlocks,
|
|
82
|
+
hs as useUpdateBlocksProps,
|
|
82
83
|
Ds as useUpdateBlocksPropsRealtime
|
|
83
84
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),l=require("./useBuilderProp-5e57d0c8.cjs"),r=require("./alert-dialog-4ce6ed22.cjs"),d=require("./usePageActions-3bed2330.cjs");require("react");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-alert-dialog");require("./index-ebd86d7f.cjs");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-7d6aadbc.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("./CONTROLS-031e1de3.cjs");require("./index-207f2cbf.cjs");require("react-dom");const x=({pageData:i,projectData:s})=>{const n={},t=d.useDeletePage(),u=i.uuid===s.homepage,o=()=>{t.mutate(i,{onSuccess:()=>{n({uuid:s.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:u,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${u?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx("div",{children:"Del"})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.page_name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:t.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(l.Button,{variant:"destructive",onClick:o,disabled:t.isPending,children:"Yes, Delete"})]})]})]})};exports.default=x;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import { B as m } from "./useBuilderProp-81a14920.js";
|
|
3
|
+
import { A as n, a as d, b as a, e as p, f as c, h as u } from "./alert-dialog-ee98f47e.js";
|
|
4
|
+
import { a as h } from "./usePageActions-f86f6f65.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "@radix-ui/react-slot";
|
|
7
|
+
import "class-variance-authority";
|
|
8
|
+
import "./utils-ac68b2c8.js";
|
|
9
|
+
import "clsx";
|
|
10
|
+
import "tailwind-merge";
|
|
11
|
+
import "@radix-ui/react-tooltip";
|
|
12
|
+
import "@radix-ui/react-icons";
|
|
13
|
+
import "@radix-ui/react-toast";
|
|
14
|
+
import "jotai";
|
|
15
|
+
import "lodash";
|
|
16
|
+
import "@radix-ui/react-alert-dialog";
|
|
17
|
+
import "./index-390f7bef.js";
|
|
18
|
+
import "i18next";
|
|
19
|
+
import "react-i18next";
|
|
20
|
+
import "flagged";
|
|
21
|
+
import "react-dnd";
|
|
22
|
+
import "@minoru/react-dnd-treeview";
|
|
23
|
+
import "react-hotkeys-hook";
|
|
24
|
+
import "flat-to-nested";
|
|
25
|
+
import "./Class-e34b2337.js";
|
|
26
|
+
import "redux-undo";
|
|
27
|
+
import "@react-hookz/web";
|
|
28
|
+
import "@chaibuilder/blocks";
|
|
29
|
+
import "./CONTROLS-442caee5.js";
|
|
30
|
+
import "./index-824a7bd0.js";
|
|
31
|
+
import "react-dom";
|
|
32
|
+
const M = ({ pageData: r, projectData: i }) => {
|
|
33
|
+
const s = {}, t = h(), o = r.uuid === i.homepage, l = () => {
|
|
34
|
+
t.mutate(r, {
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
s({ uuid: i.homepage, slug: "/home" });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ e.jsxs(n, { children: [
|
|
41
|
+
/* @__PURE__ */ e.jsx(d, { disabled: o, children: /* @__PURE__ */ e.jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: `flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${o ? "cursor-not-allowed border-red-200 text-red-200" : "cursor-pointer border-red-400 text-red-400"}`,
|
|
45
|
+
children: /* @__PURE__ */ e.jsx("div", { children: "Del" })
|
|
46
|
+
}
|
|
47
|
+
) }),
|
|
48
|
+
/* @__PURE__ */ e.jsxs(a, { children: [
|
|
49
|
+
/* @__PURE__ */ e.jsxs(p, { children: [
|
|
50
|
+
"Are you sure you want to delete ",
|
|
51
|
+
/* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.page_name }),
|
|
52
|
+
" page?"
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ e.jsx(c, { children: "This action cannot be undone. This will permanently delete your page." }),
|
|
55
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
56
|
+
/* @__PURE__ */ e.jsx(u, { disabled: t.isPending, children: "Cancel" }),
|
|
57
|
+
/* @__PURE__ */ e.jsx(m, { variant: "destructive", onClick: l, disabled: t.isPending, children: "Yes, Delete" })
|
|
58
|
+
] })
|
|
59
|
+
] })
|
|
60
|
+
] });
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
M as default
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./jsx-runtime-5c3ac4f7.cjs"),y=require("@radix-ui/react-switch"),D=require("react"),r=require("./utils-3c452dd0.cjs"),M=require("@radix-ui/react-hover-card"),C=require("@radix-ui/react-dropdown-menu"),p=require("@radix-ui/react-icons");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=c(y),d=c(D),l=c(M),o=c(C),m=d.forwardRef(({className:e,...t},n)=>a.jsxRuntimeExports.jsx(u.Root,{className:r.cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:n,children:a.jsxRuntimeExports.jsx(u.Thumb,{className:r.cn("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));m.displayName=u.Root.displayName;const S=l.Root,k=l.Trigger,f=d.forwardRef(({className:e,align:t="center",sideOffset:n=4,...s},i)=>a.jsxRuntimeExports.jsx(l.Content,{ref:i,align:t,sideOffset:n,className:r.cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));f.displayName=l.Content.displayName;const E=o.Root,I=o.Trigger,P=o.Group,T=o.Portal,z=o.Sub,_=o.RadioGroup,x=d.forwardRef(({className:e,inset:t,children:n,...s},i)=>a.jsxRuntimeExports.jsxs(o.SubTrigger,{ref:i,className:r.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...s,children:[n,a.jsxRuntimeExports.jsx(p.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));x.displayName=o.SubTrigger.displayName;const b=d.forwardRef(({className:e,...t},n)=>a.jsxRuntimeExports.jsx(o.SubContent,{ref:n,className:r.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));b.displayName=o.SubContent.displayName;const w=d.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsxRuntimeExports.jsx(o.Portal,{children:a.jsxRuntimeExports.jsx(o.Content,{ref:s,sideOffset:t,className:r.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));w.displayName=o.Content.displayName;const g=d.forwardRef(({className:e,inset:t,...n},s)=>a.jsxRuntimeExports.jsx(o.Item,{ref:s,className:r.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));g.displayName=o.Item.displayName;const h=d.forwardRef(({className:e,children:t,checked:n,...s},i)=>a.jsxRuntimeExports.jsxs(o.CheckboxItem,{ref:i,className:r.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...s,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(o.ItemIndicator,{children:a.jsxRuntimeExports.jsx(p.CheckIcon,{className:"h-4 w-4"})})}),t]}));h.displayName=o.CheckboxItem.displayName;const j=d.forwardRef(({className:e,children:t,...n},s)=>a.jsxRuntimeExports.jsxs(o.RadioItem,{ref:s,className:r.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(o.ItemIndicator,{children:a.jsxRuntimeExports.jsx(p.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));j.displayName=o.RadioItem.displayName;const R=d.forwardRef(({className:e,inset:t,...n},s)=>a.jsxRuntimeExports.jsx(o.Label,{ref:s,className:r.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));R.displayName=o.Label.displayName;const N=d.forwardRef(({className:e,...t},n)=>a.jsxRuntimeExports.jsx(o.Separator,{ref:n,className:r.cn("-mx-1 my-1 h-px bg-muted",e),...t}));N.displayName=o.Separator.displayName;const v=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:r.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});v.displayName="DropdownMenuShortcut";exports.DropdownMenu=E;exports.DropdownMenuCheckboxItem=h;exports.DropdownMenuContent=w;exports.DropdownMenuGroup=P;exports.DropdownMenuItem=g;exports.DropdownMenuLabel=R;exports.DropdownMenuPortal=T;exports.DropdownMenuRadioGroup=_;exports.DropdownMenuRadioItem=j;exports.DropdownMenuSeparator=N;exports.DropdownMenuShortcut=v;exports.DropdownMenuSub=z;exports.DropdownMenuSubContent=b;exports.DropdownMenuSubTrigger=x;exports.DropdownMenuTrigger=I;exports.HoverCard=S;exports.HoverCardContent=f;exports.HoverCardTrigger=k;exports.Switch=m;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import * as c from "@radix-ui/react-switch";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { c as d } from "./utils-ac68b2c8.js";
|
|
5
|
+
import * as l from "@radix-ui/react-hover-card";
|
|
6
|
+
import * as e from "@radix-ui/react-dropdown-menu";
|
|
7
|
+
import { ChevronRightIcon as m, CheckIcon as p, DotFilledIcon as f } from "@radix-ui/react-icons";
|
|
8
|
+
const u = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o.jsx(
|
|
9
|
+
c.Root,
|
|
10
|
+
{
|
|
11
|
+
className: d(
|
|
12
|
+
"peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",
|
|
13
|
+
t
|
|
14
|
+
),
|
|
15
|
+
...a,
|
|
16
|
+
ref: s,
|
|
17
|
+
children: /* @__PURE__ */ o.jsx(
|
|
18
|
+
c.Thumb,
|
|
19
|
+
{
|
|
20
|
+
className: d(
|
|
21
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950"
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
));
|
|
27
|
+
u.displayName = c.Root.displayName;
|
|
28
|
+
const M = l.Root, I = l.Trigger, b = r.forwardRef(({ className: t, align: a = "center", sideOffset: s = 4, ...n }, i) => /* @__PURE__ */ o.jsx(
|
|
29
|
+
l.Content,
|
|
30
|
+
{
|
|
31
|
+
ref: i,
|
|
32
|
+
align: a,
|
|
33
|
+
sideOffset: s,
|
|
34
|
+
className: d(
|
|
35
|
+
"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
36
|
+
t
|
|
37
|
+
),
|
|
38
|
+
...n
|
|
39
|
+
}
|
|
40
|
+
));
|
|
41
|
+
b.displayName = l.Content.displayName;
|
|
42
|
+
const S = e.Root, z = e.Trigger, T = e.Group, P = e.Portal, H = e.Sub, G = e.RadioGroup, x = r.forwardRef(({ className: t, inset: a, children: s, ...n }, i) => /* @__PURE__ */ o.jsxs(
|
|
43
|
+
e.SubTrigger,
|
|
44
|
+
{
|
|
45
|
+
ref: i,
|
|
46
|
+
className: d(
|
|
47
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
48
|
+
a && "pl-8",
|
|
49
|
+
t
|
|
50
|
+
),
|
|
51
|
+
...n,
|
|
52
|
+
children: [
|
|
53
|
+
s,
|
|
54
|
+
/* @__PURE__ */ o.jsx(m, { className: "ml-auto h-4 w-4" })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
));
|
|
58
|
+
x.displayName = e.SubTrigger.displayName;
|
|
59
|
+
const g = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o.jsx(
|
|
60
|
+
e.SubContent,
|
|
61
|
+
{
|
|
62
|
+
ref: s,
|
|
63
|
+
className: d(
|
|
64
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
65
|
+
t
|
|
66
|
+
),
|
|
67
|
+
...a
|
|
68
|
+
}
|
|
69
|
+
));
|
|
70
|
+
g.displayName = e.SubContent.displayName;
|
|
71
|
+
const h = r.forwardRef(({ className: t, sideOffset: a = 4, ...s }, n) => /* @__PURE__ */ o.jsx(e.Portal, { children: /* @__PURE__ */ o.jsx(
|
|
72
|
+
e.Content,
|
|
73
|
+
{
|
|
74
|
+
ref: n,
|
|
75
|
+
sideOffset: a,
|
|
76
|
+
className: d(
|
|
77
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
78
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
79
|
+
t
|
|
80
|
+
),
|
|
81
|
+
...s
|
|
82
|
+
}
|
|
83
|
+
) }));
|
|
84
|
+
h.displayName = e.Content.displayName;
|
|
85
|
+
const w = r.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ o.jsx(
|
|
86
|
+
e.Item,
|
|
87
|
+
{
|
|
88
|
+
ref: n,
|
|
89
|
+
className: d(
|
|
90
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
91
|
+
a && "pl-8",
|
|
92
|
+
t
|
|
93
|
+
),
|
|
94
|
+
...s
|
|
95
|
+
}
|
|
96
|
+
));
|
|
97
|
+
w.displayName = e.Item.displayName;
|
|
98
|
+
const N = r.forwardRef(({ className: t, children: a, checked: s, ...n }, i) => /* @__PURE__ */ o.jsxs(
|
|
99
|
+
e.CheckboxItem,
|
|
100
|
+
{
|
|
101
|
+
ref: i,
|
|
102
|
+
className: d(
|
|
103
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
104
|
+
t
|
|
105
|
+
),
|
|
106
|
+
checked: s,
|
|
107
|
+
...n,
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(e.ItemIndicator, { children: /* @__PURE__ */ o.jsx(p, { className: "h-4 w-4" }) }) }),
|
|
110
|
+
a
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
));
|
|
114
|
+
N.displayName = e.CheckboxItem.displayName;
|
|
115
|
+
const y = r.forwardRef(({ className: t, children: a, ...s }, n) => /* @__PURE__ */ o.jsxs(
|
|
116
|
+
e.RadioItem,
|
|
117
|
+
{
|
|
118
|
+
ref: n,
|
|
119
|
+
className: d(
|
|
120
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
121
|
+
t
|
|
122
|
+
),
|
|
123
|
+
...s,
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(e.ItemIndicator, { children: /* @__PURE__ */ o.jsx(f, { className: "h-4 w-4 fill-current" }) }) }),
|
|
126
|
+
a
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
));
|
|
130
|
+
y.displayName = e.RadioItem.displayName;
|
|
131
|
+
const v = r.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ o.jsx(
|
|
132
|
+
e.Label,
|
|
133
|
+
{
|
|
134
|
+
ref: n,
|
|
135
|
+
className: d("px-2 py-1.5 text-sm font-semibold", a && "pl-8", t),
|
|
136
|
+
...s
|
|
137
|
+
}
|
|
138
|
+
));
|
|
139
|
+
v.displayName = e.Label.displayName;
|
|
140
|
+
const j = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o.jsx(e.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", t), ...a }));
|
|
141
|
+
j.displayName = e.Separator.displayName;
|
|
142
|
+
const R = ({ className: t, ...a }) => /* @__PURE__ */ o.jsx("span", { className: d("ml-auto text-xs tracking-widest opacity-60", t), ...a });
|
|
143
|
+
R.displayName = "DropdownMenuShortcut";
|
|
144
|
+
export {
|
|
145
|
+
S as D,
|
|
146
|
+
M as H,
|
|
147
|
+
u as S,
|
|
148
|
+
I as a,
|
|
149
|
+
b,
|
|
150
|
+
z as c,
|
|
151
|
+
h as d,
|
|
152
|
+
w as e,
|
|
153
|
+
N as f,
|
|
154
|
+
y as g,
|
|
155
|
+
v as h,
|
|
156
|
+
j as i,
|
|
157
|
+
R as j,
|
|
158
|
+
T as k,
|
|
159
|
+
P as l,
|
|
160
|
+
H as m,
|
|
161
|
+
g as n,
|
|
162
|
+
x as o,
|
|
163
|
+
G as p
|
|
164
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { j as u } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import x from "@rjsf/core";
|
|
3
|
+
import $ from "@rjsf/validator-ajv8";
|
|
4
|
+
import { includes as h, get as a, set as F, first as P } from "lodash";
|
|
5
|
+
import { R as b, I as E, a as O, L as S } from "./link-f80a947d.js";
|
|
6
|
+
const d = (i, l = "") => {
|
|
7
|
+
switch (i.type) {
|
|
8
|
+
case "singular":
|
|
9
|
+
return i.uiSchema;
|
|
10
|
+
case "model":
|
|
11
|
+
const { properties: c } = i, m = {};
|
|
12
|
+
return Object.keys(c).forEach((r) => {
|
|
13
|
+
const e = c[r];
|
|
14
|
+
if (h(["slot", "styles"], e.type))
|
|
15
|
+
return;
|
|
16
|
+
const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
|
|
17
|
+
m[o] = d(e, l);
|
|
18
|
+
}), m;
|
|
19
|
+
case "list":
|
|
20
|
+
const { itemProperties: n } = i, p = {
|
|
21
|
+
items: {}
|
|
22
|
+
};
|
|
23
|
+
return Object.keys(n).forEach((r) => {
|
|
24
|
+
const e = n[r];
|
|
25
|
+
if (h(["slot", "styles"], e.type))
|
|
26
|
+
return;
|
|
27
|
+
const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
|
|
28
|
+
p.items[o] = d(e, l);
|
|
29
|
+
}), p;
|
|
30
|
+
default:
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
}, y = (i, l = "") => {
|
|
34
|
+
switch (i.type) {
|
|
35
|
+
case "singular":
|
|
36
|
+
return i.schema;
|
|
37
|
+
case "model":
|
|
38
|
+
const { properties: c, title: m } = i, n = {
|
|
39
|
+
title: m,
|
|
40
|
+
type: "object",
|
|
41
|
+
properties: {}
|
|
42
|
+
};
|
|
43
|
+
return Object.keys(c).forEach((o) => {
|
|
44
|
+
const t = c[o];
|
|
45
|
+
if (h(["slot", "styles"], t.type))
|
|
46
|
+
return;
|
|
47
|
+
const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
|
|
48
|
+
n.properties[s] = y(t, l);
|
|
49
|
+
}), n;
|
|
50
|
+
case "list":
|
|
51
|
+
const { itemProperties: p, title: r } = i, e = {
|
|
52
|
+
title: r,
|
|
53
|
+
type: "array",
|
|
54
|
+
items: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return Object.keys(p).forEach((o) => {
|
|
60
|
+
const t = p[o];
|
|
61
|
+
if (h(["slot", "styles"], t.type))
|
|
62
|
+
return;
|
|
63
|
+
const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
|
|
64
|
+
e.items.properties[s] = y(t, l), F(e.items, "title", a(t, "itemTitle", `${r} item`));
|
|
65
|
+
}), e;
|
|
66
|
+
default:
|
|
67
|
+
return {};
|
|
68
|
+
}
|
|
69
|
+
}, w = ({
|
|
70
|
+
title: i,
|
|
71
|
+
properties: l = {},
|
|
72
|
+
formData: c,
|
|
73
|
+
onChange: m,
|
|
74
|
+
disabled: n = !1,
|
|
75
|
+
activeLang: p = ""
|
|
76
|
+
}) => {
|
|
77
|
+
const r = {
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: {}
|
|
80
|
+
}, e = {};
|
|
81
|
+
Object.keys(l).forEach((t) => {
|
|
82
|
+
const s = l[t];
|
|
83
|
+
if (h(["slot", "styles"], s.type))
|
|
84
|
+
return;
|
|
85
|
+
const f = a(s, "i18n", !1) ? `${t}-${p}` : t;
|
|
86
|
+
r.properties[f] = y(s, p), e[f] = d(s, p);
|
|
87
|
+
});
|
|
88
|
+
const o = ({ ...t }, s) => {
|
|
89
|
+
const f = s == null ? void 0 : s.replace("root.", "").split("/").pop();
|
|
90
|
+
if (!s || !f)
|
|
91
|
+
return;
|
|
92
|
+
const j = P(f.split("."));
|
|
93
|
+
s && j && m({ ...t }, j);
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
96
|
+
i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
|
|
97
|
+
/* @__PURE__ */ u.jsx("div", { className: "-mx-3", children: /* @__PURE__ */ u.jsx(
|
|
98
|
+
x,
|
|
99
|
+
{
|
|
100
|
+
widgets: {
|
|
101
|
+
richtext: b,
|
|
102
|
+
icon: E,
|
|
103
|
+
image: O
|
|
104
|
+
},
|
|
105
|
+
fields: {
|
|
106
|
+
link: S
|
|
107
|
+
},
|
|
108
|
+
idSeparator: ".",
|
|
109
|
+
autoComplete: "off",
|
|
110
|
+
omitExtraData: !0,
|
|
111
|
+
liveOmit: !0,
|
|
112
|
+
liveValidate: !0,
|
|
113
|
+
uiSchema: e,
|
|
114
|
+
schema: r,
|
|
115
|
+
formData: c,
|
|
116
|
+
validator: $,
|
|
117
|
+
onChange: o,
|
|
118
|
+
disabled: n
|
|
119
|
+
}
|
|
120
|
+
) })
|
|
121
|
+
] });
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
w as F
|
|
125
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("./jsx-runtime-5c3ac4f7.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash"),d=require("./link-86c532b5.cjs"),h=(n,c="")=>{switch(n.type){case"singular":return n.uiSchema;case"model":const{properties:p}=n,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${c}`:r;u[o]=h(e,c)}),u;case"list":const{itemProperties:m}=n,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${c}`:r;l.items[o]=h(e,c)}),l;default:return{}}},x=(n,c="")=>{switch(n.type){case"singular":return n.schema;case"model":const{properties:p,title:u}=n,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${c}`:o;m.properties[s]=x(t,c)}),m;case"list":const{itemProperties:l,title:r}=n,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${c}`:o;e.items.properties[s]=x(t,c),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:n,properties:c={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(c).forEach(t=>{const s=c[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[n&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:n}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parse as k, stringify as h } from "himalaya";
|
|
2
|
-
import { g as x } from "./Class-
|
|
2
|
+
import { g as x } from "./Class-e34b2337.js";
|
|
3
3
|
import { isEmpty as y, flatten as L, flatMapDeep as $, get as c, set as o, find as u, filter as w, includes as g, omit as S, forEach as C, capitalize as B } from "lodash";
|
|
4
4
|
import { c as I } from "./utils-ac68b2c8.js";
|
|
5
5
|
import { S as p } from "./CONTROLS-442caee5.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("himalaya"),b=require("./Class-
|
|
1
|
+
"use strict";const o=require("himalaya"),b=require("./Class-7d6aadbc.cjs"),e=require("lodash"),T=require("./utils-3c452dd0.cjs"),u=require("./CONTROLS-031e1de3.cjs"),v={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},N=(t,r)=>t.children.length===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],r._type),y=t=>t.map(r=>r.type==="text"?e.get(r,"content",""):e.isEmpty(r.children)?"":y(r.children)).join(""),p=t=>t===null?!0:t,g=t=>{const r={},s=v[t.tagName]||{},a=t.attributes;return e.forEach(a,({key:l,value:c})=>{if(s[l]){if(t.tagName==="img"&&l==="src"&&!c.startsWith("http")){const i=e.find(t.attributes,{key:"width"}),n=e.find(t.attributes,{key:"height"});i&&n?c=`https://via.placeholder.com/${i==null?void 0:i.value}x${n==null?void 0:n.value}`:c="https://via.placeholder.com/150x150"}e.set(r,s[l],p(c))}else e.includes(["style","class","srcset"],l)||e.set(r,`styles_attrs.${l}`,p(c))}),delete r.class,r},k=(t,r="styles")=>{if(!t.attributes)return{[r]:`${u.STYLES_KEY},`};const s=e.find(t.attributes,{key:"class"});if(s){const a=s.value;return{[r]:`${u.STYLES_KEY},${a}`}}return{[r]:`${u.STYLES_KEY},`}},L=t=>{switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"iframe":return{_type:"Iframe"};case"canvas":return{_type:"Canvas"};case"video":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:return{_type:"Box",tag:t.tagName,name:t.tagName==="div"?"Box":e.capitalize(t.tagName)}}},h=(t,r=null)=>e.flatMapDeep(t,s=>{var c;if(s.type==="comment")return[];let a={_id:b.generateUUID()};if(r&&(a._parent=r.block._id),s.type==="text")return e.isEmpty(e.get(s,"content",""))?[]:r&&N(r.node,r.block)?(e.set(r,"block.content",e.get(s,"content","")),[]):{...a,_type:"Text",content:e.get(s,"content","")};if(a={...a,...L(s),...g(s),...k(s)},a._type==="Input"){const i=a.inputType||"text";i==="checkbox"?e.set(a,"_type","Checkbox"):i==="radio"&&e.set(a,"_type","Radio")}else{if(s.tagName==="video")return a.content=o.stringify([s]),[a];if(s.tagName==="svg"){const i=e.find(s.attributes,{key:"height"}),n=e.find(s.attributes,{key:"width"}),m=e.get(i,"value")?`[${e.get(i,"value")}px]`:"full",f=e.get(n,"value")?`[${e.get(n,"value")}px]`:"full",_=e.get(e.find(s.attributes,{key:"class"}),"value");return a.styles=`${u.STYLES_KEY}, ${T.cn(`w-${f} h-${m}`,_)}`.trim(),s.attributes=e.filter(s.attributes,d=>!e.includes(["style","width","height","class"],d.key)),a._icon=o.stringify([s]),e.set(a,"styles_attrs",e.omit(e.get(a,"styles_attrs")||{},["height","width","style","class"])),[a]}else if(s.tagName=="option"&&r&&((c=r.block)==null?void 0:c._type)==="Select")return r.block.options.push({label:y(s.children),...g(s)}),[]}const l=h(s.children,{block:a,node:s});return[a,...l]}),S=t=>{const r=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(r&&r.length>0?r[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},x=t=>{const r=o.parse(S(t));return e.isEmpty(t)?[]:e.flatten(h(r))};exports.getBlocksFromHTML=x;
|