@chaibuilder/sdk 1.2.9 → 1.2.11
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/README.md +10 -12
- package/dist/AddBlocks-TSt8uJY4.js +218 -0
- package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
- package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
- package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
- package/dist/CanvasArea-5erOZYLy.cjs +60 -0
- package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-NzmJloN7.cjs +1 -0
- package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
- package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
- package/dist/Layers-xDG7oltg.cjs +1 -0
- package/dist/PagesPanel-72nzYB1k.cjs +1 -0
- package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
- package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
- package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
- package/dist/Settings-5EuwaVb3.cjs +1 -0
- package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
- package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
- package/dist/SidePanels-uNCxnGte.cjs +1 -0
- package/dist/Topbar-JqW89xI5.cjs +1 -0
- package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
- package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
- package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
- package/dist/UploadImages-PzHdEKHT.cjs +1 -0
- package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
- package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
- package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
- package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
- package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +13 -58
- package/dist/core.js +47 -58
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
- package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
- package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
- package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
- package/dist/index-aiHDvS5v.cjs +1 -0
- package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
- package/dist/index-pNYv0oAF.js +2994 -0
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-Sh99FGYk.cjs +1 -0
- package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
- package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
- package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
- package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
- package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
- package/dist/single-page-detail-6L38HJC4.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -15
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +149 -151
- package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
- package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
- package/dist/web-blocks.cjs +1 -9
- package/dist/web-blocks.js +431 -442
- package/package.json +8 -2
- package/dist/AddBlocks-tMxKPoen.js +0 -225
- package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
- package/dist/CanvasArea-xs4wM64L.cjs +0 -60
- package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
- package/dist/Layers-eaHy5PK9.cjs +0 -1
- package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
- package/dist/PagesPanel-gGKCV394.cjs +0 -1
- package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
- package/dist/Settings-7wlLcvoh.cjs +0 -1
- package/dist/SidePanels-5H4j0mIs.cjs +0 -1
- package/dist/Topbar-V8xCetWF.cjs +0 -1
- package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
- package/dist/UploadImages-DnQ95_NW.cjs +0 -1
- package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
- package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-H6vIwGfD.cjs +0 -1
- package/dist/index-niHREMmR.js +0 -2938
- package/dist/page-viewer-SLt8XgYv.cjs +0 -1
- package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
- package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
- package/dist/single-page-detail-IPod1o5P.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
package/dist/email.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { C as m } from "./index-Fj3ead-J.js";
|
|
3
|
+
import { MobileIcon as i } from "@radix-ui/react-icons";
|
|
4
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "i18next";
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import "./index-pNYv0oAF.js";
|
|
9
|
+
import "lodash-es";
|
|
10
|
+
import "./Functions-7jnEwJyw.js";
|
|
11
|
+
import "clsx";
|
|
12
|
+
import "tailwind-merge";
|
|
13
|
+
import "@chaibuilder/runtime";
|
|
14
|
+
import "jotai";
|
|
15
|
+
import "flat-to-nested";
|
|
16
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
17
|
+
import "@react-hookz/web";
|
|
18
|
+
import "@radix-ui/react-toggle";
|
|
19
|
+
import "class-variance-authority";
|
|
20
|
+
import "./Class-17XFhL48.js";
|
|
21
|
+
import "@radix-ui/react-switch";
|
|
22
|
+
import "@radix-ui/react-slot";
|
|
23
|
+
import "@radix-ui/react-accordion";
|
|
24
|
+
import "@radix-ui/react-alert-dialog";
|
|
25
|
+
import "@radix-ui/react-dialog";
|
|
26
|
+
import "@radix-ui/react-label";
|
|
27
|
+
import "@radix-ui/react-scroll-area";
|
|
28
|
+
import "@radix-ui/react-tabs";
|
|
29
|
+
import "@radix-ui/react-tooltip";
|
|
30
|
+
import "@radix-ui/react-popover";
|
|
31
|
+
import "@radix-ui/react-menubar";
|
|
32
|
+
import "@radix-ui/react-hover-card";
|
|
33
|
+
import "@radix-ui/react-select";
|
|
34
|
+
import "@radix-ui/react-dropdown-menu";
|
|
35
|
+
import "@radix-ui/react-separator";
|
|
36
|
+
import "@radix-ui/react-toast";
|
|
37
|
+
import "cmdk";
|
|
38
|
+
import "@radix-ui/react-context-menu";
|
|
39
|
+
import "react-icons-picker";
|
|
40
|
+
import "react-dom";
|
|
41
|
+
import "react-quill";
|
|
42
|
+
import "@floating-ui/react-dom";
|
|
43
|
+
import "react-textarea-autosize";
|
|
44
|
+
import "flagged";
|
|
45
|
+
import "react-dnd";
|
|
46
|
+
import "@minoru/react-dnd-treeview";
|
|
47
|
+
import "react-hotkeys-hook";
|
|
48
|
+
import "sonner";
|
|
49
|
+
import "./html-to-json-57841sEK.js";
|
|
50
|
+
import "himalaya";
|
|
51
|
+
import "lucide-react";
|
|
52
|
+
import "./web-blocks.js";
|
|
53
|
+
import "./empty-slot-MWycClTb.js";
|
|
54
|
+
const p = [
|
|
55
|
+
{
|
|
56
|
+
title: "Mobile",
|
|
57
|
+
content: "Mobile email client",
|
|
58
|
+
breakpoint: "xs",
|
|
59
|
+
icon: /* @__PURE__ */ t.jsx(i, {}),
|
|
60
|
+
width: 400
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
title: "Email Client",
|
|
64
|
+
content: "Content as seen inside an email client",
|
|
65
|
+
breakpoint: "sm",
|
|
66
|
+
icon: /* @__PURE__ */ t.jsx(i, { className: "rotate-90" }),
|
|
67
|
+
width: 800
|
|
68
|
+
}
|
|
69
|
+
], pt = (o) => {
|
|
70
|
+
const r = {
|
|
71
|
+
...o,
|
|
72
|
+
importHTMLSupport: !1,
|
|
73
|
+
breakpoints: p
|
|
74
|
+
};
|
|
75
|
+
return /* @__PURE__ */ t.jsx(m, { ...r });
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
pt as ChaiBuilderEmail
|
|
79
|
+
};
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { get as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { get as e, omit as t } from "lodash-es";
|
|
2
|
+
import { j as a } from "./jsx-runtime-WbnYoNE9.js";
|
|
3
|
+
import { c as d } from "./Functions-7jnEwJyw.js";
|
|
4
|
+
const l = "#styles:";
|
|
5
|
+
const p = (i) => ({
|
|
4
6
|
type: "singular",
|
|
5
7
|
default: i.default || "",
|
|
6
|
-
binding:
|
|
8
|
+
binding: e(i, "binding", !0),
|
|
7
9
|
i18n: i.i18n || !1,
|
|
8
10
|
dataType: "string",
|
|
9
11
|
required: i.required || !1,
|
|
10
12
|
schema: {
|
|
11
13
|
type: "string",
|
|
12
|
-
...
|
|
14
|
+
...t(i, ["i18n", "required"])
|
|
13
15
|
},
|
|
14
16
|
uiSchema: {
|
|
15
17
|
"ui:placeholder": i.placeholder || "Enter here"
|
|
16
18
|
}
|
|
17
|
-
}),
|
|
19
|
+
}), o = (i) => ({
|
|
18
20
|
type: "singular",
|
|
19
21
|
default: i.default || "",
|
|
20
|
-
binding:
|
|
22
|
+
binding: e(i, "binding", !0),
|
|
21
23
|
dataType: "string",
|
|
22
24
|
i18n: i.i18n || !1,
|
|
23
25
|
required: i.required || !1,
|
|
24
26
|
schema: {
|
|
25
27
|
type: "string",
|
|
26
|
-
...
|
|
28
|
+
...t(i, ["i18n", "required", "rows"])
|
|
27
29
|
},
|
|
28
30
|
uiSchema: {
|
|
29
31
|
"ui:widget": "textarea",
|
|
@@ -32,96 +34,96 @@ const r = (i) => ({
|
|
|
32
34
|
rows: i.rows || 4
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
}),
|
|
37
|
+
}), y = (i) => ({
|
|
36
38
|
type: "singular",
|
|
37
39
|
i18n: i.i18n || !1,
|
|
38
40
|
default: i.default || !1,
|
|
39
41
|
dataType: "boolean",
|
|
40
|
-
binding:
|
|
42
|
+
binding: e(i, "binding", !0),
|
|
41
43
|
schema: {
|
|
42
44
|
type: "boolean",
|
|
43
|
-
...
|
|
45
|
+
...t(i, ["i18n", "required"])
|
|
44
46
|
},
|
|
45
47
|
uiSchema: {
|
|
46
48
|
"ui:title": i.title || "Select Item",
|
|
47
49
|
"ui:description": ""
|
|
48
50
|
}
|
|
49
|
-
}),
|
|
51
|
+
}), c = (i) => ({
|
|
50
52
|
type: "singular",
|
|
51
53
|
default: i.default || "",
|
|
52
|
-
binding:
|
|
54
|
+
binding: e(i, "binding", !0),
|
|
53
55
|
dataType: "number",
|
|
54
56
|
i18n: i.i18n || !1,
|
|
55
57
|
required: i.required || !1,
|
|
56
58
|
schema: {
|
|
57
59
|
type: "number",
|
|
58
|
-
...
|
|
60
|
+
...t(i, ["i18n", "required"])
|
|
59
61
|
},
|
|
60
62
|
uiSchema: {}
|
|
61
|
-
}),
|
|
63
|
+
}), m = (i) => ({
|
|
62
64
|
type: "singular",
|
|
63
65
|
default: i.default || "",
|
|
64
|
-
binding:
|
|
66
|
+
binding: e(i, "binding", !0),
|
|
65
67
|
i18n: i.i18n || !1,
|
|
66
68
|
required: i.required || !1,
|
|
67
69
|
dataType: "string",
|
|
68
70
|
schema: {
|
|
69
71
|
type: "string",
|
|
70
|
-
...
|
|
72
|
+
...t(i, ["i18n", "required", "options", "binding"]),
|
|
71
73
|
oneOf: i.options.map((n) => ({ const: n.value, title: n.title }))
|
|
72
74
|
},
|
|
73
75
|
uiSchema: {
|
|
74
76
|
"ui:widget": "select"
|
|
75
77
|
}
|
|
76
|
-
}),
|
|
78
|
+
}), f = (i) => ({
|
|
77
79
|
type: "singular",
|
|
78
80
|
i18n: i.i18n || !1,
|
|
79
81
|
default: i.default || "",
|
|
80
|
-
binding:
|
|
82
|
+
binding: e(i, "binding", !0),
|
|
81
83
|
dataType: "string",
|
|
82
84
|
schema: {
|
|
83
85
|
type: "string",
|
|
84
|
-
...
|
|
86
|
+
...t(i, ["i18n", "required"])
|
|
85
87
|
},
|
|
86
88
|
uiSchema: {
|
|
87
89
|
"ui:widget": "color"
|
|
88
90
|
}
|
|
89
91
|
});
|
|
90
|
-
const
|
|
92
|
+
const b = (i) => ({
|
|
91
93
|
type: "singular",
|
|
92
94
|
default: i.default || "",
|
|
93
95
|
i18n: i.i18n || !1,
|
|
94
|
-
binding:
|
|
96
|
+
binding: e(i, "binding", !0),
|
|
95
97
|
dataType: "string",
|
|
96
98
|
schema: {
|
|
97
99
|
type: "string",
|
|
98
|
-
...
|
|
100
|
+
...t(i, ["i18n", "required"])
|
|
99
101
|
},
|
|
100
102
|
uiSchema: {
|
|
101
103
|
"ui:widget": "richtext"
|
|
102
104
|
}
|
|
103
|
-
}),
|
|
105
|
+
}), h = (i) => ({
|
|
104
106
|
type: "model",
|
|
105
107
|
title: i.title,
|
|
106
108
|
dataType: "object",
|
|
107
109
|
default: i.default || {},
|
|
108
|
-
binding:
|
|
110
|
+
binding: e(i, "binding", !0),
|
|
109
111
|
properties: i.properties
|
|
110
|
-
}),
|
|
112
|
+
}), q = (i) => ({
|
|
111
113
|
type: "list",
|
|
112
114
|
itemProperties: i.itemProperties,
|
|
113
|
-
binding:
|
|
115
|
+
binding: e(i, "binding", !0),
|
|
114
116
|
title: i.title,
|
|
115
117
|
dataType: "array",
|
|
116
118
|
default: i.default || [],
|
|
117
119
|
itemTitle: i.getItemLabel ? i.getItemLabel({}) : () => ""
|
|
118
|
-
}),
|
|
120
|
+
}), x = (i) => ({
|
|
119
121
|
type: "styles",
|
|
120
122
|
binding: !1,
|
|
121
|
-
default: `${
|
|
122
|
-
}),
|
|
123
|
+
default: `${l},${i.default || ""}`
|
|
124
|
+
}), S = (i) => ({
|
|
123
125
|
default: i.default || "",
|
|
124
|
-
binding:
|
|
126
|
+
binding: e(i, "binding", !0),
|
|
125
127
|
type: "singular",
|
|
126
128
|
i18n: i.i18n || !1,
|
|
127
129
|
dataType: "string",
|
|
@@ -133,10 +135,10 @@ const y = (i) => ({
|
|
|
133
135
|
uiSchema: {
|
|
134
136
|
"ui:widget": "icon"
|
|
135
137
|
}
|
|
136
|
-
}),
|
|
138
|
+
}), T = (i) => ({
|
|
137
139
|
default: i.default,
|
|
138
140
|
type: "singular",
|
|
139
|
-
binding:
|
|
141
|
+
binding: e(i, "binding", !0),
|
|
140
142
|
dataType: "object",
|
|
141
143
|
i18n: i.i18n || !1,
|
|
142
144
|
schema: {
|
|
@@ -151,32 +153,41 @@ const y = (i) => ({
|
|
|
151
153
|
uiSchema: {
|
|
152
154
|
"ui:field": "link"
|
|
153
155
|
}
|
|
154
|
-
}),
|
|
156
|
+
}), j = (i) => ({
|
|
155
157
|
type: "singular",
|
|
156
158
|
default: i.default || "",
|
|
157
|
-
binding:
|
|
159
|
+
binding: e(i, "binding", !0),
|
|
158
160
|
dataType: "string",
|
|
159
161
|
i18n: i.i18n || !1,
|
|
160
162
|
schema: {
|
|
161
163
|
type: "string",
|
|
162
|
-
...
|
|
164
|
+
...t(i, ["i18n", "required"])
|
|
163
165
|
},
|
|
164
166
|
uiSchema: {
|
|
165
167
|
"ui:widget": "image"
|
|
166
168
|
}
|
|
167
|
-
})
|
|
169
|
+
}), w = ({ blockProps: i, className: n = "", styles: r = {} }) => /* @__PURE__ */ a.jsx(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
...i,
|
|
173
|
+
className: d("flex h-20 flex-col items-center justify-center", n),
|
|
174
|
+
...t(r, ["className"]),
|
|
175
|
+
children: /* @__PURE__ */ a.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300", children: /* @__PURE__ */ a.jsx("span", { className: "opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400" }) })
|
|
176
|
+
}
|
|
177
|
+
);
|
|
168
178
|
export {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
o as
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
p as
|
|
179
|
+
w as E,
|
|
180
|
+
x as S,
|
|
181
|
+
S as T,
|
|
182
|
+
h as b,
|
|
183
|
+
c,
|
|
184
|
+
m as f,
|
|
185
|
+
o as g,
|
|
186
|
+
q as h,
|
|
187
|
+
b as m,
|
|
188
|
+
j as o,
|
|
189
|
+
T as q,
|
|
190
|
+
y as r,
|
|
191
|
+
p as u,
|
|
192
|
+
f as y
|
|
182
193
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("lodash-es"),n=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./Functions-N3yhPYKY.cjs"),d="#styles:";const u=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,dataType:"string",required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:placeholder":i.placeholder||"Enter here"}}),l=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required","rows"])},uiSchema:{"ui:widget":"textarea","ui:placeholder":i.placeholder||"Enter here","ui:options":{rows:i.rows||4}}}),s=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||!1,dataType:"boolean",binding:t.get(i,"binding",!0),schema:{type:"boolean",...t.omit(i,["i18n","required"])},uiSchema:{"ui:title":i.title||"Select Item","ui:description":""}}),g=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"number",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"number",...t.omit(i,["i18n","required"])},uiSchema:{}}),p=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,required:i.required||!1,dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required","options","binding"]),oneOf:i.options.map(e=>({const:e.value,title:e.title}))},uiSchema:{"ui:widget":"select"}}),o=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"color"}});const m=i=>({type:"singular",default:i.default||"",i18n:i.i18n||!1,binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"richtext"}}),c=i=>({type:"model",title:i.title,dataType:"object",default:i.default||{},binding:t.get(i,"binding",!0),properties:i.properties}),y=i=>({type:"list",itemProperties:i.itemProperties,binding:t.get(i,"binding",!0),title:i.title,dataType:"array",default:i.default||[],itemTitle:i.getItemLabel?i.getItemLabel({}):()=>""}),f=i=>({type:"styles",binding:!1,default:`${d},${i.default||""}`}),b=i=>({default:i.default||"",binding:t.get(i,"binding",!0),type:"singular",i18n:i.i18n||!1,dataType:"string",schema:{type:"string",title:"Icon",default:i.default||""},uiSchema:{"ui:widget":"icon"}}),h=i=>({default:i.default,type:"singular",binding:t.get(i,"binding",!0),dataType:"object",i18n:i.i18n||!1,schema:{type:"object",...i||{},properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}}},uiSchema:{"ui:field":"link"}}),q=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",i18n:i.i18n||!1,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"image"}}),x=({blockProps:i,className:e="",styles:a={}})=>n.jsxRuntimeExports.jsx("div",{...i,className:r.cn("flex h-20 flex-col items-center justify-center",e),...t.omit(a,["className"]),children:n.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300",children:n.jsxRuntimeExports.jsx("span",{className:"opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400"})})});exports.EmptySlot=x;exports.S=f;exports.T=b;exports.b=c;exports.c=g;exports.f=p;exports.g=l;exports.h=y;exports.m=m;exports.o=q;exports.q=h;exports.r=s;exports.u=u;exports.y=o;
|
|
@@ -1 +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-
|
|
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-aiHDvS5v.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=$;
|
|
@@ -2,22 +2,22 @@ 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
4
|
import { includes as h, get as a, set as $, first as F } from "lodash-es";
|
|
5
|
-
import {
|
|
5
|
+
import { b3 as P, b4 as E, b5 as O, b6 as S } from "./index-pNYv0oAF.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:
|
|
12
|
-
return Object.keys(
|
|
13
|
-
const e =
|
|
11
|
+
const { properties: c } = i, m = {};
|
|
12
|
+
return Object.keys(c).forEach((r) => {
|
|
13
|
+
const e = c[r];
|
|
14
14
|
if (h(["slot", "styles"], e.type))
|
|
15
15
|
return;
|
|
16
16
|
const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
|
|
17
17
|
m[o] = d(e, l);
|
|
18
18
|
}), m;
|
|
19
19
|
case "list":
|
|
20
|
-
const { itemProperties: n } = i,
|
|
20
|
+
const { itemProperties: n } = i, p = {
|
|
21
21
|
items: {}
|
|
22
22
|
};
|
|
23
23
|
return Object.keys(n).forEach((r) => {
|
|
@@ -25,8 +25,8 @@ const d = (i, l = "") => {
|
|
|
25
25
|
if (h(["slot", "styles"], e.type))
|
|
26
26
|
return;
|
|
27
27
|
const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
|
|
28
|
-
|
|
29
|
-
}),
|
|
28
|
+
p.items[o] = d(e, l);
|
|
29
|
+
}), p;
|
|
30
30
|
default:
|
|
31
31
|
return {};
|
|
32
32
|
}
|
|
@@ -35,20 +35,20 @@ const d = (i, l = "") => {
|
|
|
35
35
|
case "singular":
|
|
36
36
|
return i.schema;
|
|
37
37
|
case "model":
|
|
38
|
-
const { properties:
|
|
38
|
+
const { properties: c, title: m } = i, n = {
|
|
39
39
|
title: m,
|
|
40
40
|
type: "object",
|
|
41
41
|
properties: {}
|
|
42
42
|
};
|
|
43
|
-
return Object.keys(
|
|
44
|
-
const t =
|
|
43
|
+
return Object.keys(c).forEach((o) => {
|
|
44
|
+
const t = c[o];
|
|
45
45
|
if (h(["slot", "styles"], t.type))
|
|
46
46
|
return;
|
|
47
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":
|
|
51
|
-
const { itemProperties:
|
|
51
|
+
const { itemProperties: p, title: r } = i, e = {
|
|
52
52
|
title: r,
|
|
53
53
|
type: "array",
|
|
54
54
|
items: {
|
|
@@ -56,8 +56,8 @@ const d = (i, l = "") => {
|
|
|
56
56
|
properties: {}
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
return Object.keys(
|
|
60
|
-
const t =
|
|
59
|
+
return Object.keys(p).forEach((o) => {
|
|
60
|
+
const t = p[o];
|
|
61
61
|
if (h(["slot", "styles"], t.type))
|
|
62
62
|
return;
|
|
63
63
|
const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
|
|
@@ -69,10 +69,10 @@ const d = (i, l = "") => {
|
|
|
69
69
|
}, C = ({
|
|
70
70
|
title: i,
|
|
71
71
|
properties: l = {},
|
|
72
|
-
formData:
|
|
72
|
+
formData: c,
|
|
73
73
|
onChange: m,
|
|
74
74
|
disabled: n = !1,
|
|
75
|
-
activeLang:
|
|
75
|
+
activeLang: p = ""
|
|
76
76
|
}) => {
|
|
77
77
|
const r = {
|
|
78
78
|
type: "object",
|
|
@@ -82,8 +82,8 @@ const d = (i, l = "") => {
|
|
|
82
82
|
const s = l[t];
|
|
83
83
|
if (h(["slot", "styles"], s.type))
|
|
84
84
|
return;
|
|
85
|
-
const f = a(s, "i18n", !1) ? `${t}-${
|
|
86
|
-
r.properties[f] = y(s,
|
|
85
|
+
const f = a(s, "i18n", !1) ? `${t}-${p}` : t;
|
|
86
|
+
r.properties[f] = y(s, p), e[f] = d(s, p);
|
|
87
87
|
});
|
|
88
88
|
const o = ({ ...t }, s) => {
|
|
89
89
|
const f = s == null ? void 0 : s.replace("root.", "").split("/").pop();
|
|
@@ -112,7 +112,7 @@ const d = (i, l = "") => {
|
|
|
112
112
|
liveValidate: !0,
|
|
113
113
|
uiSchema: e,
|
|
114
114
|
schema: r,
|
|
115
|
-
formData:
|
|
115
|
+
formData: c,
|
|
116
116
|
validator: x,
|
|
117
117
|
onChange: o,
|
|
118
118
|
disabled: n
|