@chaibuilder/sdk 1.1.18 → 1.2.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/AddBlocks-57-vroWk.cjs +1 -0
- package/dist/AddBlocks-QvCc-oag.js +225 -0
- package/dist/BrandingOptions-arKT1zCy.cjs +1 -0
- package/dist/{BrandingOptions-zFJ28xmJ.js → BrandingOptions-mZXO7thQ.js} +27 -25
- package/dist/{CanvasArea-vTV3O27-.js → CanvasArea-59Gm0EZx.js} +581 -598
- package/dist/CanvasArea-jRg53jrS.cjs +59 -0
- package/dist/CurrentPage-MLObvs0K.cjs +1 -0
- package/dist/{CurrentPage-Ay7X9h9y.js → CurrentPage-YPI5QTjk.js} +17 -14
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/{Layers-CWnzKXMo.js → Layers-no2keK4N.js} +149 -146
- package/dist/Layers-x_mWeT_q.cjs +1 -0
- package/dist/MODIFIERS-2FeVfZQ9.cjs +1 -0
- package/dist/{MODIFIERS-MLfpKQY1.js → MODIFIERS-RiXS5Mn1.js} +7 -13
- package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-uhj0kGZo.js → MarkAsGlobalBlock-SPWd6Flk.js} +9 -7
- package/dist/{PagesPanel-ALbBHaO3.js → PagesPanel-Q08uN4X3.js} +12 -9
- package/dist/PagesPanel-pOIuFPOA.cjs +1 -0
- package/dist/ProjectPanel-4bN_GyNm.cjs +1 -0
- package/dist/{ProjectPanel-tIDarI9R.js → ProjectPanel-zzYV9yrV.js} +25 -22
- package/dist/{Settings-5uDMY9SU.js → Settings-28A7R61i.js} +334 -331
- package/dist/Settings-KlTtgu3w.cjs +1 -0
- package/dist/{SidePanels-D6U95ur1.js → SidePanels--ZK6Iqou.js} +80 -77
- package/dist/SidePanels-eJBA_cUu.cjs +1 -0
- package/dist/{Topbar-_-1HX-EE.js → Topbar-ks1ckGLz.js} +15 -13
- package/dist/Topbar-u5XKdWgQ.cjs +1 -0
- package/dist/{UnsplashImages-mqK09h8E.js → UnsplashImages-8vJPuqrF.js} +25 -23
- package/dist/UnsplashImages-V8oKEHfi.cjs +1 -0
- package/dist/{UploadImages-IDkkRuhx.js → UploadImages-6N6UrjLo.js} +26 -24
- package/dist/UploadImages-eHYxwWAp.cjs +1 -0
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/{add-page-modal-C1UGoRkw.js → add-page-modal-EHIYTW4T.js} +27 -24
- package/dist/add-page-modal-OvNXLGf0.cjs +1 -0
- package/dist/{confirm-alert-ea5xpncD.js → confirm-alert-biqvaLT-.js} +9 -7
- package/dist/confirm-alert-f3DYO5Hj.cjs +1 -0
- package/dist/controls-Dy1qa8Dc.cjs +1 -0
- package/dist/controls-XPXGHKht.js +182 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +10 -1
- package/dist/core.js +60 -57
- package/dist/delete-page-modal-U4yiuhx0.cjs +1 -0
- package/dist/{delete-page-modal-0GxR128b.js → delete-page-modal-qZJCk_JH.js} +15 -12
- package/dist/email-blocks.cjs +1 -0
- package/dist/email-blocks.d.ts +3 -0
- package/dist/email-blocks.js +35 -0
- package/dist/{form-irY39wvJ.js → form-Moz_psOw.js} +16 -16
- package/dist/form-lJhy9DEC.cjs +1 -0
- package/dist/functions-Ox_svtKm.cjs +1 -0
- package/dist/functions-xIebp8Aw.js +23 -0
- package/dist/html-to-json-dfALTAdG.cjs +1 -0
- package/dist/{html-to-json-wmbV9eZP.js → html-to-json-xKBERAI1.js} +47 -46
- package/dist/index-IIJ_o44s.cjs +1 -0
- package/dist/{index-qEix1meh.js → index-QEchoZ98.js} +8 -8
- package/dist/{index-0OqmBgqo.js → index-_OgCuSUz.js} +528 -533
- package/dist/{index-npVo1wi3.cjs → index-hMoPNZVn.cjs} +2 -2
- package/dist/{jsx-runtime-NV737rRe.js → jsx-runtime-WbnYoNE9.js} +1 -1
- package/dist/{jsx-runtime-WUGKV8jN.cjs → jsx-runtime-Z_BpKhVy.cjs} +7 -7
- package/dist/lib.cjs +2 -2
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +47 -44
- package/dist/page-viewer-WhM1FSU0.cjs +1 -0
- package/dist/{page-viewer-mgnZt6nO.js → page-viewer-zFLkUu2I.js} +17 -14
- package/dist/{project-general-setting-M52W-vUp.js → project-general-setting-MWGOOurD.js} +16 -13
- package/dist/project-general-setting-y8daY7V9.cjs +1 -0
- package/dist/project-seo-setting-9JGBPzcA.cjs +1 -0
- package/dist/{project-seo-setting-EhqUcTKy.js → project-seo-setting-dXclexQW.js} +15 -13
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.js +50 -49
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +11 -11
- package/dist/single-page-detail--xPv74bX.cjs +1 -0
- package/dist/{single-page-detail-61UDUgWG.js → single-page-detail-C48IPzbd.js} +77 -74
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +11 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +144 -142
- package/dist/useAddBlockByDrop-_nd8yZBa.cjs +1 -0
- package/dist/useAddBlockByDrop-uPXvrg4G.js +20 -0
- package/dist/{utils-XsPKXMVo.js → utils-AvyFzbPC.js} +26 -35
- package/dist/utils-PTxFk6qT.cjs +1 -0
- package/dist/web-blocks.cjs +9 -0
- package/dist/web-blocks.d.ts +3 -0
- package/dist/web-blocks.js +1033 -0
- package/package.json +5 -2
- package/dist/AddBlocks-sKF4ti68.js +0 -222
- package/dist/AddBlocks-yPovJXtD.cjs +0 -1
- package/dist/BrandingOptions-TRVyCvVq.cjs +0 -1
- package/dist/CanvasArea-xxqOiENt.cjs +0 -59
- package/dist/CurrentPage-ju6otPNk.cjs +0 -1
- package/dist/Layers-d9OU0HRE.cjs +0 -1
- package/dist/MODIFIERS-WFzDQfiT.cjs +0 -1
- package/dist/MarkAsGlobalBlock-CDmEHNx7.cjs +0 -1
- package/dist/PagesPanel-F9Cdi4Pf.cjs +0 -1
- package/dist/ProjectPanel-T49RUDyt.cjs +0 -1
- package/dist/Settings-eZnusNbR.cjs +0 -1
- package/dist/SidePanels-BVM5JwGC.cjs +0 -1
- package/dist/Topbar-gQxbcPtG.cjs +0 -1
- package/dist/UnsplashImages-PNp5fYCc.cjs +0 -1
- package/dist/UploadImages-BoSSsLtD.cjs +0 -1
- package/dist/add-page-modal-HP1yv9yJ.cjs +0 -1
- package/dist/confirm-alert-dHRDZrA1.cjs +0 -1
- package/dist/controls-QnyBNkXG.cjs +0 -36
- package/dist/controls-kEuiMMDf.js +0 -4600
- package/dist/delete-page-modal-yOgfPcHr.cjs +0 -1
- package/dist/form-6qGAOYI3.cjs +0 -1
- package/dist/functions-86L6n983.js +0 -23
- package/dist/functions-Jr7gX_RX.cjs +0 -1
- package/dist/html-to-json-AqLy6ye-.cjs +0 -1
- package/dist/index-d55M5MRz.cjs +0 -1
- package/dist/lodash-2us0VT8I.cjs +0 -36
- package/dist/lodash-3gkdNK5u.js +0 -4538
- package/dist/page-viewer-G2YIKVSt.cjs +0 -1
- package/dist/project-general-setting-sinIiBKe.cjs +0 -1
- package/dist/project-seo-setting-N0OnBCvh.cjs +0 -1
- package/dist/single-page-detail-oa-yTXhQ.cjs +0 -1
- package/dist/useAddBlockByDrop-5QW86HjG.js +0 -20
- package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +0 -1
- package/dist/utils-37UXq2O5.cjs +0 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { get as t, omit as e } from "lodash-es";
|
|
2
|
+
const a = "#styles:";
|
|
3
|
+
const r = (i) => ({
|
|
4
|
+
type: "singular",
|
|
5
|
+
default: i.default || "",
|
|
6
|
+
binding: t(i, "binding", !0),
|
|
7
|
+
i18n: i.i18n || !1,
|
|
8
|
+
dataType: "string",
|
|
9
|
+
required: i.required || !1,
|
|
10
|
+
schema: {
|
|
11
|
+
type: "string",
|
|
12
|
+
...e(i, ["i18n", "required"])
|
|
13
|
+
},
|
|
14
|
+
uiSchema: {
|
|
15
|
+
"ui:placeholder": i.placeholder || "Enter here"
|
|
16
|
+
}
|
|
17
|
+
}), u = (i) => ({
|
|
18
|
+
type: "singular",
|
|
19
|
+
default: i.default || "",
|
|
20
|
+
binding: t(i, "binding", !0),
|
|
21
|
+
dataType: "string",
|
|
22
|
+
i18n: i.i18n || !1,
|
|
23
|
+
required: i.required || !1,
|
|
24
|
+
schema: {
|
|
25
|
+
type: "string",
|
|
26
|
+
...e(i, ["i18n", "required", "rows"])
|
|
27
|
+
},
|
|
28
|
+
uiSchema: {
|
|
29
|
+
"ui:widget": "textarea",
|
|
30
|
+
"ui:placeholder": i.placeholder || "Enter here",
|
|
31
|
+
"ui:options": {
|
|
32
|
+
rows: i.rows || 4
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}), l = (i) => ({
|
|
36
|
+
type: "singular",
|
|
37
|
+
i18n: i.i18n || !1,
|
|
38
|
+
default: i.default || !1,
|
|
39
|
+
dataType: "boolean",
|
|
40
|
+
binding: t(i, "binding", !0),
|
|
41
|
+
schema: {
|
|
42
|
+
type: "boolean",
|
|
43
|
+
...e(i, ["i18n", "required"])
|
|
44
|
+
},
|
|
45
|
+
uiSchema: {
|
|
46
|
+
"ui:title": i.title || "Select Item",
|
|
47
|
+
"ui:description": ""
|
|
48
|
+
}
|
|
49
|
+
}), g = (i) => ({
|
|
50
|
+
type: "singular",
|
|
51
|
+
default: i.default || "",
|
|
52
|
+
binding: t(i, "binding", !0),
|
|
53
|
+
dataType: "number",
|
|
54
|
+
i18n: i.i18n || !1,
|
|
55
|
+
required: i.required || !1,
|
|
56
|
+
schema: {
|
|
57
|
+
type: "number",
|
|
58
|
+
...e(i, ["i18n", "required"])
|
|
59
|
+
},
|
|
60
|
+
uiSchema: {}
|
|
61
|
+
}), s = (i) => ({
|
|
62
|
+
type: "singular",
|
|
63
|
+
default: i.default || "",
|
|
64
|
+
binding: t(i, "binding", !0),
|
|
65
|
+
i18n: i.i18n || !1,
|
|
66
|
+
required: i.required || !1,
|
|
67
|
+
dataType: "string",
|
|
68
|
+
schema: {
|
|
69
|
+
type: "string",
|
|
70
|
+
...e(i, ["i18n", "required", "options", "binding"]),
|
|
71
|
+
oneOf: i.options.map((n) => ({ const: n.value, title: n.title }))
|
|
72
|
+
},
|
|
73
|
+
uiSchema: {
|
|
74
|
+
"ui:widget": "select"
|
|
75
|
+
}
|
|
76
|
+
}), p = (i) => ({
|
|
77
|
+
type: "singular",
|
|
78
|
+
i18n: i.i18n || !1,
|
|
79
|
+
default: i.default || "",
|
|
80
|
+
binding: t(i, "binding", !0),
|
|
81
|
+
dataType: "string",
|
|
82
|
+
schema: {
|
|
83
|
+
type: "string",
|
|
84
|
+
...e(i, ["i18n", "required"])
|
|
85
|
+
},
|
|
86
|
+
uiSchema: {
|
|
87
|
+
"ui:widget": "color"
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const y = (i) => ({
|
|
91
|
+
type: "singular",
|
|
92
|
+
default: i.default || "",
|
|
93
|
+
i18n: i.i18n || !1,
|
|
94
|
+
binding: t(i, "binding", !0),
|
|
95
|
+
dataType: "string",
|
|
96
|
+
schema: {
|
|
97
|
+
type: "string",
|
|
98
|
+
...e(i, ["i18n", "required"])
|
|
99
|
+
},
|
|
100
|
+
uiSchema: {
|
|
101
|
+
"ui:widget": "richtext"
|
|
102
|
+
}
|
|
103
|
+
}), m = (i) => ({
|
|
104
|
+
type: "model",
|
|
105
|
+
title: i.title,
|
|
106
|
+
dataType: "object",
|
|
107
|
+
default: i.default || {},
|
|
108
|
+
binding: t(i, "binding", !0),
|
|
109
|
+
properties: i.properties
|
|
110
|
+
}), o = (i) => ({
|
|
111
|
+
type: "list",
|
|
112
|
+
itemProperties: i.itemProperties,
|
|
113
|
+
binding: t(i, "binding", !0),
|
|
114
|
+
title: i.title,
|
|
115
|
+
dataType: "array",
|
|
116
|
+
default: i.default || [],
|
|
117
|
+
itemTitle: i.getItemLabel ? i.getItemLabel({}) : () => ""
|
|
118
|
+
}), c = (i) => ({
|
|
119
|
+
type: "styles",
|
|
120
|
+
binding: !1,
|
|
121
|
+
default: `${a},${i.default || ""}`
|
|
122
|
+
}), b = (i) => ({
|
|
123
|
+
default: i.default || "",
|
|
124
|
+
binding: t(i, "binding", !0),
|
|
125
|
+
type: "singular",
|
|
126
|
+
i18n: i.i18n || !1,
|
|
127
|
+
dataType: "string",
|
|
128
|
+
schema: {
|
|
129
|
+
type: "string",
|
|
130
|
+
title: "Icon",
|
|
131
|
+
default: i.default || ""
|
|
132
|
+
},
|
|
133
|
+
uiSchema: {
|
|
134
|
+
"ui:widget": "icon"
|
|
135
|
+
}
|
|
136
|
+
}), f = (i) => ({
|
|
137
|
+
default: i.default,
|
|
138
|
+
type: "singular",
|
|
139
|
+
binding: t(i, "binding", !0),
|
|
140
|
+
dataType: "object",
|
|
141
|
+
i18n: i.i18n || !1,
|
|
142
|
+
schema: {
|
|
143
|
+
type: "object",
|
|
144
|
+
...i || {},
|
|
145
|
+
properties: {
|
|
146
|
+
type: { type: "string" },
|
|
147
|
+
href: { type: "string" },
|
|
148
|
+
target: { type: "string" }
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
uiSchema: {
|
|
152
|
+
"ui:field": "link"
|
|
153
|
+
}
|
|
154
|
+
}), h = (i) => ({
|
|
155
|
+
type: "singular",
|
|
156
|
+
default: i.default || "",
|
|
157
|
+
binding: t(i, "binding", !0),
|
|
158
|
+
dataType: "string",
|
|
159
|
+
i18n: i.i18n || !1,
|
|
160
|
+
schema: {
|
|
161
|
+
type: "string",
|
|
162
|
+
...e(i, ["i18n", "required"])
|
|
163
|
+
},
|
|
164
|
+
uiSchema: {
|
|
165
|
+
"ui:widget": "image"
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
export {
|
|
169
|
+
c as S,
|
|
170
|
+
b as T,
|
|
171
|
+
m as b,
|
|
172
|
+
g as c,
|
|
173
|
+
s as f,
|
|
174
|
+
u as g,
|
|
175
|
+
o as h,
|
|
176
|
+
y as m,
|
|
177
|
+
h as o,
|
|
178
|
+
f as q,
|
|
179
|
+
l as r,
|
|
180
|
+
r as u,
|
|
181
|
+
p as y
|
|
182
|
+
};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-hMoPNZVn.cjs"),e=require("./index-IIJ_o44s.cjs"),u=require("react-i18next");require("i18next");require("./jsx-runtime-Z_BpKhVy.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("react-textarea-autosize");require("jotai");require("flagged");require("react-dnd");require("lodash-es");require("@minoru/react-dnd-treeview");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@radix-ui/react-icons");require("sonner");require("./html-to-json-dfALTAdG.cjs");require("himalaya");require("./MODIFIERS-2FeVfZQ9.cjs");require("lodash");require("lucide-react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");exports.ChaiBuilderEditor=s.ChaiBuilderEditor;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.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;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;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.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.useProject=e.useProject;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;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>u.useTranslation});
|
package/dist/core.d.ts
CHANGED
|
@@ -14,6 +14,14 @@ declare interface Block {
|
|
|
14
14
|
[key: string]: any;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
declare type Breakpoint = {
|
|
18
|
+
title: string;
|
|
19
|
+
content: string;
|
|
20
|
+
breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
21
|
+
icon: React_2.ReactNode | Element;
|
|
22
|
+
width: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
17
25
|
declare type CanvasHistory = {
|
|
18
26
|
redoCount: number;
|
|
19
27
|
undoCount: number;
|
|
@@ -25,10 +33,10 @@ declare type CanvasHistory = {
|
|
|
25
33
|
|
|
26
34
|
export declare type ChaiBlock = {
|
|
27
35
|
_id: string;
|
|
36
|
+
_type: string;
|
|
28
37
|
_name?: string;
|
|
29
38
|
_parent?: string | null | undefined;
|
|
30
39
|
_bindings?: Record<string, string>;
|
|
31
|
-
readonly _type: string;
|
|
32
40
|
} & Record<string, any>;
|
|
33
41
|
|
|
34
42
|
/**
|
|
@@ -39,6 +47,7 @@ export declare type ChaiBlock = {
|
|
|
39
47
|
export declare const ChaiBuilderEditor: (props: ChaiBuilderEditorProps) => JSX_2.Element;
|
|
40
48
|
|
|
41
49
|
export declare interface ChaiBuilderEditorProps {
|
|
50
|
+
breakpoints?: Breakpoint[];
|
|
42
51
|
blocks?: ChaiBlock[];
|
|
43
52
|
editable?: boolean;
|
|
44
53
|
locale?: string;
|
package/dist/core.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { k as
|
|
2
|
-
import { N as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { k as J } from "./index-QEchoZ98.js";
|
|
2
|
+
import { N as ss, af as es, O as as, ah as os, P as ts, ae as rs, x as is, i as ps, y as ls, Q as ms, p as us, R as cs, U as ds, k as Bs, V as ks, n as ns, W as Ss, X as Cs, m as Ps, L as vs, Y as gs, Z as ys, _ as As, $ as Ms, a0 as hs, o as Ds, h as Is, a1 as Rs, M as fs, l as xs, a3 as Ts, ag as Us, a6 as bs, a5 as js, a4 as ws, j as Hs, ad as Os, ai as Fs, aj as Gs, w as Ls, a7 as Ws, a9 as Zs, a2 as Es, aa as Ns, a8 as Qs, ab as Vs, ac as Xs } from "./index-_OgCuSUz.js";
|
|
3
|
+
import { useTranslation as _s } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
5
|
-
import "./jsx-runtime-
|
|
6
|
-
import "./
|
|
5
|
+
import "./jsx-runtime-WbnYoNE9.js";
|
|
6
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "react-dom";
|
|
@@ -13,19 +13,22 @@ import "react-textarea-autosize";
|
|
|
13
13
|
import "jotai";
|
|
14
14
|
import "flagged";
|
|
15
15
|
import "react-dnd";
|
|
16
|
-
import "
|
|
16
|
+
import "lodash-es";
|
|
17
17
|
import "@minoru/react-dnd-treeview";
|
|
18
|
-
import "./
|
|
18
|
+
import "./Functions-7jnEwJyw.js";
|
|
19
19
|
import "tailwind-merge";
|
|
20
20
|
import "react-hotkeys-hook";
|
|
21
21
|
import "@chaibuilder/runtime";
|
|
22
22
|
import "@radix-ui/react-icons";
|
|
23
23
|
import "sonner";
|
|
24
|
-
import "./html-to-json-
|
|
24
|
+
import "./html-to-json-xKBERAI1.js";
|
|
25
25
|
import "himalaya";
|
|
26
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
27
|
+
import "lodash";
|
|
26
28
|
import "lucide-react";
|
|
27
29
|
import "@radix-ui/react-toggle";
|
|
28
30
|
import "class-variance-authority";
|
|
31
|
+
import "./utils-AvyFzbPC.js";
|
|
29
32
|
import "@radix-ui/react-switch";
|
|
30
33
|
import "@radix-ui/react-slot";
|
|
31
34
|
import "@radix-ui/react-accordion";
|
|
@@ -49,53 +52,53 @@ import "flat-to-nested";
|
|
|
49
52
|
import "redux-undo";
|
|
50
53
|
import "@react-hookz/web";
|
|
51
54
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
55
|
+
J as ChaiBuilderEditor,
|
|
56
|
+
ss as useActiveModal,
|
|
57
|
+
es as useActivePanel,
|
|
58
|
+
as as useAddBlock,
|
|
59
|
+
os as useAddBlockParent,
|
|
60
|
+
ts as useAddClassesToBlocks,
|
|
61
|
+
rs as useAllBlocks,
|
|
62
|
+
is as useBrandingOptions,
|
|
63
|
+
ps as useBuilderProp,
|
|
64
|
+
ls as useBuilderReset,
|
|
65
|
+
ms as useBuildingBlocks,
|
|
66
|
+
us as useCanvasHistory,
|
|
67
|
+
cs as useCanvasWidth,
|
|
68
|
+
ds as useCanvasZoom,
|
|
69
|
+
Bs as useCopyBlockIds,
|
|
70
|
+
ks as useCurrentPage,
|
|
71
|
+
ns as useCutBlockIds,
|
|
72
|
+
Ss as useDarkMode,
|
|
73
|
+
Cs as useDeveloperPreviewMode,
|
|
74
|
+
Ps as useDuplicateBlocks,
|
|
75
|
+
vs as useFeatureSupport,
|
|
76
|
+
gs as useGetPageData,
|
|
77
|
+
ys as useHiddenBlockIds,
|
|
78
|
+
As as useHighlightBlockId,
|
|
79
|
+
Ms as useMarkAsGlobalBlock,
|
|
80
|
+
hs as useMoveBlocks,
|
|
81
|
+
Ds as usePasteBlocks,
|
|
82
|
+
Is as usePreviewMode,
|
|
83
|
+
Rs as useProject,
|
|
84
|
+
fs as useReadOnlyMode,
|
|
85
|
+
xs as useRemoveBlocks,
|
|
86
|
+
Ts as useRemoveClassesFromBlocks,
|
|
87
|
+
Us as useSavePage,
|
|
88
|
+
bs as useSelectedBlock,
|
|
89
|
+
js as useSelectedBlockAllClasses,
|
|
90
|
+
ws as useSelectedBlockCurrentClasses,
|
|
91
|
+
Hs as useSelectedBlockIds,
|
|
92
|
+
Os as useSelectedBlocksDisplayChild,
|
|
93
|
+
Fs as useSelectedBreakpoints,
|
|
94
|
+
Gs as useSelectedStylingBlocks,
|
|
95
|
+
Ls as useSetAllBlocks,
|
|
96
|
+
Ws as useStylingBreakpoint,
|
|
97
|
+
Zs as useStylingState,
|
|
98
|
+
_s as useTranslation,
|
|
99
|
+
Es as useTranslations,
|
|
100
|
+
Ns as useTreeData,
|
|
101
|
+
Qs as useUILibraryBlocks,
|
|
102
|
+
Vs as useUpdateBlocksProps,
|
|
103
|
+
Xs as useUpdateBlocksPropsRealtime
|
|
101
104
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-IIJ_o44s.cjs"),l=require("./index-hMoPNZVn.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-dfALTAdG.cjs");require("himalaya");require("lodash");require("lucide-react");const d=({pageData:i,projectData:t})=>{const n={},u=l.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,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 ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(q.TrashIcon,{})})}),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.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:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { D as
|
|
3
|
-
import { j as x } from "./index-
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { D as s, E as l, F as n, H as d, I as a, K as c, B as u } from "./index-_OgCuSUz.js";
|
|
3
|
+
import { j as x } from "./index-QEchoZ98.js";
|
|
4
4
|
import { TrashIcon as h } from "@radix-ui/react-icons";
|
|
5
|
-
import "./
|
|
5
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "@radix-ui/react-toggle";
|
|
8
8
|
import "class-variance-authority";
|
|
9
|
-
import "./utils-
|
|
10
|
-
import "
|
|
9
|
+
import "./utils-AvyFzbPC.js";
|
|
10
|
+
import "lodash-es";
|
|
11
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
11
12
|
import "clsx";
|
|
12
13
|
import "tailwind-merge";
|
|
13
14
|
import "@radix-ui/react-switch";
|
|
@@ -33,6 +34,7 @@ import "react-dom";
|
|
|
33
34
|
import "react-quill";
|
|
34
35
|
import "jotai";
|
|
35
36
|
import "flat-to-nested";
|
|
37
|
+
import "./Functions-7jnEwJyw.js";
|
|
36
38
|
import "redux-undo";
|
|
37
39
|
import "@chaibuilder/runtime";
|
|
38
40
|
import "@react-hookz/web";
|
|
@@ -45,18 +47,19 @@ import "react-dnd";
|
|
|
45
47
|
import "@minoru/react-dnd-treeview";
|
|
46
48
|
import "react-hotkeys-hook";
|
|
47
49
|
import "sonner";
|
|
48
|
-
import "./html-to-json-
|
|
50
|
+
import "./html-to-json-xKBERAI1.js";
|
|
49
51
|
import "himalaya";
|
|
52
|
+
import "lodash";
|
|
50
53
|
import "lucide-react";
|
|
51
|
-
const
|
|
52
|
-
const m = {}, t = x(), o = r.uuid === i.homepage,
|
|
54
|
+
const he = ({ pageData: r, projectData: i }) => {
|
|
55
|
+
const m = {}, t = x(), o = r.uuid === i.homepage, p = () => {
|
|
53
56
|
t.mutate(r, {
|
|
54
57
|
onSuccess: () => {
|
|
55
58
|
m({ uuid: i.homepage, slug: "/home" });
|
|
56
59
|
}
|
|
57
60
|
});
|
|
58
61
|
};
|
|
59
|
-
return /* @__PURE__ */ e.jsxs(
|
|
62
|
+
return /* @__PURE__ */ e.jsxs(s, { children: [
|
|
60
63
|
/* @__PURE__ */ e.jsx(l, { disabled: o, children: /* @__PURE__ */ e.jsx(
|
|
61
64
|
"div",
|
|
62
65
|
{
|
|
@@ -73,11 +76,11 @@ const ce = ({ pageData: r, projectData: i }) => {
|
|
|
73
76
|
/* @__PURE__ */ e.jsx(a, { children: "This action cannot be undone. This will permanently delete your page." }),
|
|
74
77
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
75
78
|
/* @__PURE__ */ e.jsx(c, { disabled: t.isPending, children: "Cancel" }),
|
|
76
|
-
/* @__PURE__ */ e.jsx(u, { variant: "destructive", onClick:
|
|
79
|
+
/* @__PURE__ */ e.jsx(u, { variant: "destructive", onClick: p, disabled: t.isPending, children: "Yes, Delete" })
|
|
77
80
|
] })
|
|
78
81
|
] })
|
|
79
82
|
] });
|
|
80
83
|
};
|
|
81
84
|
export {
|
|
82
|
-
|
|
85
|
+
he as default
|
|
83
86
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("@react-email/components"),s=require("@chaibuilder/runtime"),c=require("./controls-Dy1qa8Dc.cjs"),i=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");const l=({blockProps:o,styles:t,children:n})=>e.jsxRuntimeExports.jsxs(r.Container,{...o,...t,children:[e.jsxRuntimeExports.jsx("h1",{children:"Hello"}),e.jsxRuntimeExports.jsx(r.Button,{href:"https://example.com",className:"c-bg-red-500 c-px-4 c-py-1 c-border c-rounded-md c-inline-block c-text-white c-font-bold",children:"Click me"}),e.jsxRuntimeExports.jsx(r.Hr,{}),e.jsxRuntimeExports.jsx(r.CodeInline,{children:"@react-email/code-inline"}),";",n]});s.registerChaiBlock(l,{type:"Container",label:"Container",group:"basic",category:"core",props:{styles:c.S({default:""})}});const u=i.noop;exports.loadWebBlocks=u;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { Container as i, Button as c, Hr as n, CodeInline as l } from "@react-email/components";
|
|
3
|
+
import { registerChaiBlock as s } from "@chaibuilder/runtime";
|
|
4
|
+
import { S as m } from "./controls-XPXGHKht.js";
|
|
5
|
+
import { noop as p } from "lodash-es";
|
|
6
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
|
+
import "react";
|
|
8
|
+
const a = ({ blockProps: e, styles: r, children: t }) => /* @__PURE__ */ o.jsxs(i, { ...e, ...r, children: [
|
|
9
|
+
/* @__PURE__ */ o.jsx("h1", { children: "Hello" }),
|
|
10
|
+
/* @__PURE__ */ o.jsx(
|
|
11
|
+
c,
|
|
12
|
+
{
|
|
13
|
+
href: "https://example.com",
|
|
14
|
+
className: "c-bg-red-500 c-px-4 c-py-1 c-border c-rounded-md c-inline-block c-text-white c-font-bold",
|
|
15
|
+
children: "Click me"
|
|
16
|
+
}
|
|
17
|
+
),
|
|
18
|
+
/* @__PURE__ */ o.jsx(n, {}),
|
|
19
|
+
/* @__PURE__ */ o.jsx(l, { children: "@react-email/code-inline" }),
|
|
20
|
+
";",
|
|
21
|
+
t
|
|
22
|
+
] });
|
|
23
|
+
s(a, {
|
|
24
|
+
type: "Container",
|
|
25
|
+
label: "Container",
|
|
26
|
+
group: "basic",
|
|
27
|
+
category: "core",
|
|
28
|
+
props: {
|
|
29
|
+
styles: m({ default: "" })
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const u = p;
|
|
33
|
+
export {
|
|
34
|
+
u as loadWebBlocks
|
|
35
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { j as u } from "./jsx-runtime-
|
|
1
|
+
import { j as u } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import b from "@rjsf/core";
|
|
3
3
|
import x from "@rjsf/validator-ajv8";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { includes as h, get as a, set as $, first as F } from "lodash-es";
|
|
5
|
+
import { bc as P, bd as E, be as O, bf as S } from "./index-_OgCuSUz.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|
|
9
9
|
return i.uiSchema;
|
|
10
10
|
case "model":
|
|
11
|
-
const { properties: p } = i,
|
|
11
|
+
const { properties: p } = i, m = {};
|
|
12
12
|
return Object.keys(p).forEach((r) => {
|
|
13
13
|
const e = p[r];
|
|
14
14
|
if (h(["slot", "styles"], e.type))
|
|
15
15
|
return;
|
|
16
|
-
const o =
|
|
17
|
-
|
|
18
|
-
}),
|
|
16
|
+
const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
|
|
17
|
+
m[o] = d(e, l);
|
|
18
|
+
}), m;
|
|
19
19
|
case "list":
|
|
20
20
|
const { itemProperties: n } = i, c = {
|
|
21
21
|
items: {}
|
|
@@ -24,7 +24,7 @@ const d = (i, l = "") => {
|
|
|
24
24
|
const e = n[r];
|
|
25
25
|
if (h(["slot", "styles"], e.type))
|
|
26
26
|
return;
|
|
27
|
-
const o =
|
|
27
|
+
const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
|
|
28
28
|
c.items[o] = d(e, l);
|
|
29
29
|
}), c;
|
|
30
30
|
default:
|
|
@@ -35,8 +35,8 @@ const d = (i, l = "") => {
|
|
|
35
35
|
case "singular":
|
|
36
36
|
return i.schema;
|
|
37
37
|
case "model":
|
|
38
|
-
const { properties: p, title:
|
|
39
|
-
title:
|
|
38
|
+
const { properties: p, title: m } = i, n = {
|
|
39
|
+
title: m,
|
|
40
40
|
type: "object",
|
|
41
41
|
properties: {}
|
|
42
42
|
};
|
|
@@ -44,7 +44,7 @@ const d = (i, l = "") => {
|
|
|
44
44
|
const t = p[o];
|
|
45
45
|
if (h(["slot", "styles"], t.type))
|
|
46
46
|
return;
|
|
47
|
-
const s =
|
|
47
|
+
const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
|
|
48
48
|
n.properties[s] = y(t, l);
|
|
49
49
|
}), n;
|
|
50
50
|
case "list":
|
|
@@ -60,8 +60,8 @@ const d = (i, l = "") => {
|
|
|
60
60
|
const t = c[o];
|
|
61
61
|
if (h(["slot", "styles"], t.type))
|
|
62
62
|
return;
|
|
63
|
-
const s =
|
|
64
|
-
e.items.properties[s] = y(t, l), $(e.items, "title",
|
|
63
|
+
const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
|
|
64
|
+
e.items.properties[s] = y(t, l), $(e.items, "title", a(t, "itemTitle", `${r} item`));
|
|
65
65
|
}), e;
|
|
66
66
|
default:
|
|
67
67
|
return {};
|
|
@@ -70,7 +70,7 @@ const d = (i, l = "") => {
|
|
|
70
70
|
title: i,
|
|
71
71
|
properties: l = {},
|
|
72
72
|
formData: p,
|
|
73
|
-
onChange:
|
|
73
|
+
onChange: m,
|
|
74
74
|
disabled: n = !1,
|
|
75
75
|
activeLang: c = ""
|
|
76
76
|
}) => {
|
|
@@ -82,7 +82,7 @@ const d = (i, l = "") => {
|
|
|
82
82
|
const s = l[t];
|
|
83
83
|
if (h(["slot", "styles"], s.type))
|
|
84
84
|
return;
|
|
85
|
-
const f =
|
|
85
|
+
const f = a(s, "i18n", !1) ? `${t}-${c}` : t;
|
|
86
86
|
r.properties[f] = y(s, c), e[f] = d(s, c);
|
|
87
87
|
});
|
|
88
88
|
const o = ({ ...t }, s) => {
|
|
@@ -90,7 +90,7 @@ const d = (i, l = "") => {
|
|
|
90
90
|
if (!s || !f)
|
|
91
91
|
return;
|
|
92
92
|
const j = F(f.split("."));
|
|
93
|
-
s && j &&
|
|
93
|
+
s && j && m({ ...t }, j);
|
|
94
94
|
};
|
|
95
95
|
return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
96
96
|
i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./index-IIJ_o44s.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,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}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,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}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,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}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,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}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[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:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),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=$;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("lodash-es"),d=require("./MODIFIERS-2FeVfZQ9.cjs"),g=(a,s="c-")=>{const n=e.get(a,"bodyTextLightColor","#64748b"),o=e.get(a,"bodyTextDarkColor","#94a3b8"),l=e.get(a,"bodyBgLightColor","#FFFFFF"),c=e.get(a,"bodyBgDarkColor","#0f172a");return`${s}font-body ${s}antialiased ${s}text-[${n}] ${s}bg-[${l}] dark:${s}text-[${o}] dark:${s}bg-[${c}]`},u=(a,s="c-")=>{const o=a.replace(d.STYLES_KEY,"").split(",").map(l=>l.split(" ").map(t=>{if(t==="")return"";if(e.includes(t,"hs-")||e.includes(t,"[--")||e.includes(t,"paddle"))return t;if(t.includes(":")){const r=t.split(":");return r[r.length-1]=s+e.last(r),r.join(":")}return`${s}${t}`}).join(" "));return`${d.STYLES_KEY}${o.join(" , ")}`};exports.addPrefixToClasses=u;exports.getBrandingClasses=g;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { get as r, includes as n, last as g } from "lodash-es";
|
|
2
|
+
import { a as d } from "./MODIFIERS-RiXS5Mn1.js";
|
|
3
|
+
const C = (a, s = "c-") => {
|
|
4
|
+
const c = r(a, "bodyTextLightColor", "#64748b"), l = r(a, "bodyTextDarkColor", "#94a3b8"), e = r(a, "bodyBgLightColor", "#FFFFFF"), $ = r(a, "bodyBgDarkColor", "#0f172a");
|
|
5
|
+
return `${s}font-body ${s}antialiased ${s}text-[${c}] ${s}bg-[${e}] dark:${s}text-[${l}] dark:${s}bg-[${$}]`;
|
|
6
|
+
}, h = (a, s = "c-") => {
|
|
7
|
+
const l = a.replace(d, "").split(",").map((e) => e.split(" ").map((t) => {
|
|
8
|
+
if (t === "")
|
|
9
|
+
return "";
|
|
10
|
+
if (n(t, "hs-") || n(t, "[--") || n(t, "paddle"))
|
|
11
|
+
return t;
|
|
12
|
+
if (t.includes(":")) {
|
|
13
|
+
const o = t.split(":");
|
|
14
|
+
return o[o.length - 1] = s + g(o), o.join(":");
|
|
15
|
+
}
|
|
16
|
+
return `${s}${t}`;
|
|
17
|
+
}).join(" "));
|
|
18
|
+
return `${d}${l.join(" , ")}`;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
h as a,
|
|
22
|
+
C as g
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("himalaya"),p=require("./Functions-N3yhPYKY.cjs"),e=require("lodash-es"),u=require("./MODIFIERS-2FeVfZQ9.cjs"),T=require("lodash"),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),h=t=>t.map(r=>r.type==="text"?e.get(r,"content",""):e.isEmpty(r.children)?"":h(r.children)).join(""),g=t=>t===null?!0:t,y=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],g(c))}else e.includes(["style","class","srcset"],l)||e.set(r,`styles_attrs.${l}`,g(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},`}},x=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"canvas":return{_type:"Canvas"};case"video":case"iframe":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)}}},m=(t,r=null)=>e.flatMapDeep(t,s=>{var c;if(s.type==="comment")return[];let a={_id:p.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,...x(s),...y(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"||s.tagName==="iframe")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"}),f=e.get(i,"value")?`[${e.get(i,"value")}px]`:"24px",_=e.get(n,"value")?`[${e.get(n,"value")}px]`:"24px",d=e.get(e.find(s.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${u.STYLES_KEY}, ${p.cn(`w-${_} h-${f}`,d)}`.trim(),s.attributes=e.filter(s.attributes,b=>!e.includes(["style","width","height","class"],b.key)),a.icon=o.stringify([s]),e.set(a,"styles_attrs",T.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:h(s.children),...y(s)}),[]}const l=m(s.children,{block:a,node:s});return[a,...l]}),L=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()},S=t=>{const r=o.parse(L(t));return e.isEmpty(t)?[]:e.flatten(m(r))};exports.getBlocksFromHTML=S;
|