@chaibuilder/sdk 0.1.1 → 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-0916e841.cjs +3 -0
- package/dist/AddBlocks-c195f577.js +258 -0
- package/dist/{BrandingOptions-77957074.cjs → BrandingOptions-742992b6.cjs} +1 -1
- package/dist/{BrandingOptions-86dc389a.js → BrandingOptions-766c19c6.js} +27 -27
- package/dist/{CanvasArea-29d479f2.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-6595528d.js → ImagesPanel-8ccab6d9.js} +1 -1
- package/dist/{ImagesPanel-5cde797f.cjs → ImagesPanel-addb2bf9.cjs} +1 -1
- package/dist/{Layers-3a270af5.cjs → Layers-a2169d0b.cjs} +1 -1
- package/dist/{Layers-81832d92.js → Layers-f7e792f6.js} +3 -3
- package/dist/{MarkAsGlobalBlock-f2186631.cjs → MarkAsGlobalBlock-6187e6fd.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-a1b5646c.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-a8cea8ee.js → Settings-b214f859.js} +25 -24
- package/dist/Settings-bee21026.cjs +1 -0
- package/dist/{SidePanels-1dcabe54.js → SidePanels-03fa10e8.js} +20 -18
- package/dist/SidePanels-934159a4.cjs +1 -0
- package/dist/{Topbar-ce65bdce.js → Topbar-9bc8c9cf.js} +2 -2
- package/dist/{Topbar-00cfceeb.cjs → Topbar-c083cc2a.cjs} +1 -1
- package/dist/UnsplashImages-68492dc9.cjs +1 -0
- package/dist/{UnsplashImages-43ec34a9.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-fecbbe16.js → html-to-json-9304dbda.js} +47 -47
- package/dist/html-to-json-9c9961da.cjs +1 -0
- 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-0bfd8606.js → link-f80a947d.js} +52 -68
- 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/AddBlocks-52d9b4d7.cjs +0 -3
- package/dist/AddBlocks-e047b93d.js +0 -260
- package/dist/CanvasArea-9ce217a4.cjs +0 -60
- package/dist/Class-0801d193.cjs +0 -1
- package/dist/Settings-6a3f0f70.cjs +0 -1
- package/dist/SidePanels-7fe6bebe.cjs +0 -1
- package/dist/UnsplashImages-1b2310ad.cjs +0 -1
- package/dist/dropdown-menu-a9b096f9.cjs +0 -1
- package/dist/dropdown-menu-d912a52e.js +0 -223
- package/dist/html-to-json-d8ac554d.cjs +0 -1
- package/dist/index-32d7b6e5.js +0 -2657
- package/dist/index-506fb888.cjs +0 -2
- package/dist/link-158970ee.cjs +0 -1
|
@@ -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,42 +1,42 @@
|
|
|
1
|
-
import { parse as k, stringify as
|
|
2
|
-
import { g as x } from "./Class-
|
|
3
|
-
import { isEmpty as
|
|
1
|
+
import { parse as k, stringify as h } from "himalaya";
|
|
2
|
+
import { g as x } from "./Class-e34b2337.js";
|
|
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";
|
|
6
6
|
const A = {
|
|
7
|
-
img: { alt: "
|
|
7
|
+
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
8
8
|
video: {
|
|
9
|
-
src: "
|
|
10
|
-
autoplay: "
|
|
11
|
-
muted: "
|
|
12
|
-
loop: "
|
|
13
|
-
controls: "
|
|
9
|
+
src: "url",
|
|
10
|
+
autoplay: "controls.autoPlay",
|
|
11
|
+
muted: "controls.muted",
|
|
12
|
+
loop: "controls.loop",
|
|
13
|
+
controls: "controls.widgets"
|
|
14
14
|
},
|
|
15
15
|
a: {
|
|
16
|
-
href: "
|
|
17
|
-
target: "
|
|
16
|
+
href: "link.href",
|
|
17
|
+
target: "link.target",
|
|
18
18
|
type: ""
|
|
19
19
|
// @TODO: Detect here what to url, email, phone, elementId
|
|
20
20
|
},
|
|
21
21
|
input: {
|
|
22
|
-
placeholder: "
|
|
23
|
-
required: "
|
|
24
|
-
type: "
|
|
25
|
-
name: "
|
|
22
|
+
placeholder: "placeholder",
|
|
23
|
+
required: "required",
|
|
24
|
+
type: "inputType",
|
|
25
|
+
name: "fieldName"
|
|
26
26
|
},
|
|
27
27
|
textarea: {
|
|
28
|
-
placeholder: "
|
|
29
|
-
required: "
|
|
30
|
-
type: "
|
|
31
|
-
name: "
|
|
28
|
+
placeholder: "placeholder",
|
|
29
|
+
required: "required",
|
|
30
|
+
type: "inputType",
|
|
31
|
+
name: "fieldName"
|
|
32
32
|
},
|
|
33
33
|
select: {
|
|
34
|
-
placeholder: "
|
|
35
|
-
required: "
|
|
36
|
-
multiple: "
|
|
37
|
-
name: "
|
|
34
|
+
placeholder: "placeholder",
|
|
35
|
+
required: "required",
|
|
36
|
+
multiple: "multiple",
|
|
37
|
+
name: "fieldName"
|
|
38
38
|
}
|
|
39
|
-
}, H = (t, e) => t.children.length === 1 &&
|
|
39
|
+
}, H = (t, e) => t.children.length === 1 && g(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), _ = (t) => t.map((e) => e.type === "text" ? c(e, "content", "") : y(e.children) ? "" : _(e.children)).join(""), m = (t) => t === null ? !0 : t, f = (t) => {
|
|
40
40
|
const e = {}, r = A[t.tagName] || {}, a = t.attributes;
|
|
41
41
|
return C(a, ({ key: i, value: l }) => {
|
|
42
42
|
if (r[i]) {
|
|
@@ -44,11 +44,11 @@ const A = {
|
|
|
44
44
|
const s = u(t.attributes, { key: "width" }), n = u(t.attributes, { key: "height" });
|
|
45
45
|
s && n ? l = `https://via.placeholder.com/${s == null ? void 0 : s.value}x${n == null ? void 0 : n.value}` : l = "https://via.placeholder.com/150x150";
|
|
46
46
|
}
|
|
47
|
-
o(e, r[i],
|
|
47
|
+
o(e, r[i], m(l));
|
|
48
48
|
} else
|
|
49
|
-
|
|
49
|
+
g(["style", "class", "srcset"], i) || o(e, `styles_attrs.${i}`, m(l));
|
|
50
50
|
}), delete e.class, e;
|
|
51
|
-
}, q = (t, e = "
|
|
51
|
+
}, q = (t, e = "styles") => {
|
|
52
52
|
if (!t.attributes)
|
|
53
53
|
return { [e]: `${p},` };
|
|
54
54
|
const r = u(t.attributes, { key: "class" });
|
|
@@ -62,13 +62,13 @@ const A = {
|
|
|
62
62
|
case "img":
|
|
63
63
|
return { _type: "Image" };
|
|
64
64
|
case "input":
|
|
65
|
-
return { _type: "Input",
|
|
65
|
+
return { _type: "Input", showLabel: !1 };
|
|
66
66
|
case "hr":
|
|
67
67
|
return { _type: "Divider" };
|
|
68
68
|
case "br":
|
|
69
69
|
return { _type: "LineBreak" };
|
|
70
70
|
case "textarea":
|
|
71
|
-
return { _type: "TextArea",
|
|
71
|
+
return { _type: "TextArea", showLabel: !1 };
|
|
72
72
|
case "audio":
|
|
73
73
|
return { _type: "Audio" };
|
|
74
74
|
case "iframe":
|
|
@@ -80,7 +80,7 @@ const A = {
|
|
|
80
80
|
case "svg":
|
|
81
81
|
return { _type: "Icon" };
|
|
82
82
|
case "select":
|
|
83
|
-
return { _type: "Select",
|
|
83
|
+
return { _type: "Select", options: [] };
|
|
84
84
|
case "option":
|
|
85
85
|
return { _type: "Option" };
|
|
86
86
|
case "ul":
|
|
@@ -88,18 +88,18 @@ const A = {
|
|
|
88
88
|
case "dl":
|
|
89
89
|
return {
|
|
90
90
|
_type: "List",
|
|
91
|
-
|
|
91
|
+
tag: t.tagName,
|
|
92
92
|
_listType: t.tagName === "ol" ? "list-decimal" : "list-none"
|
|
93
93
|
};
|
|
94
94
|
case "li":
|
|
95
95
|
case "dt":
|
|
96
|
-
return { _type: "ListItem",
|
|
96
|
+
return { _type: "ListItem", tag: t.tagName };
|
|
97
97
|
case "span":
|
|
98
98
|
case "figcaption":
|
|
99
99
|
case "legend":
|
|
100
|
-
return { _type: "Span",
|
|
100
|
+
return { _type: "Span", tag: t.tagName };
|
|
101
101
|
case "p":
|
|
102
|
-
return { _type: "Paragraph",
|
|
102
|
+
return { _type: "Paragraph", content: "" };
|
|
103
103
|
case "a":
|
|
104
104
|
return { _type: "Link" };
|
|
105
105
|
case "form":
|
|
@@ -116,14 +116,14 @@ const A = {
|
|
|
116
116
|
case "h4":
|
|
117
117
|
case "h5":
|
|
118
118
|
case "h6":
|
|
119
|
-
return { _type: "Heading",
|
|
119
|
+
return { _type: "Heading", tag: t.tagName };
|
|
120
120
|
case "table":
|
|
121
121
|
return { _type: "Table" };
|
|
122
122
|
case "tr":
|
|
123
123
|
return { _type: "TableRow" };
|
|
124
124
|
case "td":
|
|
125
125
|
case "th":
|
|
126
|
-
return { _type: "TableCell",
|
|
126
|
+
return { _type: "TableCell", tag: t.tagName };
|
|
127
127
|
case "thead":
|
|
128
128
|
return { _type: "TableHead" };
|
|
129
129
|
case "tbody":
|
|
@@ -132,9 +132,9 @@ const A = {
|
|
|
132
132
|
return { _type: "TableFooter" };
|
|
133
133
|
default:
|
|
134
134
|
return {
|
|
135
|
-
_tag: t.tagName,
|
|
136
135
|
_type: "Box",
|
|
137
|
-
|
|
136
|
+
tag: t.tagName,
|
|
137
|
+
name: t.tagName === "div" ? "Box" : B(t.tagName)
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
}, b = (t, e = null) => $(t, (r) => {
|
|
@@ -143,25 +143,25 @@ const A = {
|
|
|
143
143
|
return [];
|
|
144
144
|
let a = { _id: x() };
|
|
145
145
|
if (e && (a._parent = e.block._id), r.type === "text")
|
|
146
|
-
return
|
|
146
|
+
return y(c(r, "content", "")) ? [] : e && H(e.node, e.block) ? (o(e, "block.content", c(r, "content", "")), []) : { ...a, _type: "Text", content: c(r, "content", "") };
|
|
147
147
|
if (a = {
|
|
148
148
|
...a,
|
|
149
149
|
...E(r),
|
|
150
|
-
...
|
|
150
|
+
...f(r),
|
|
151
151
|
...q(r)
|
|
152
152
|
}, a._type === "Input") {
|
|
153
|
-
const s = a.
|
|
153
|
+
const s = a.inputType || "text";
|
|
154
154
|
s === "checkbox" ? o(a, "_type", "Checkbox") : s === "radio" && o(a, "_type", "Radio");
|
|
155
155
|
} else {
|
|
156
156
|
if (r.tagName === "video")
|
|
157
|
-
return a.
|
|
157
|
+
return a.content = h([r]), [a];
|
|
158
158
|
if (r.tagName === "svg") {
|
|
159
159
|
const s = u(r.attributes, { key: "height" }), n = u(r.attributes, { key: "width" }), d = c(s, "value") ? `[${c(s, "value")}px]` : "full", T = c(n, "value") ? `[${c(n, "value")}px]` : "full", v = c(u(r.attributes, { key: "class" }), "value");
|
|
160
|
-
return a.
|
|
160
|
+
return a.styles = `${p}, ${I(`w-${T} h-${d}`, v)}`.trim(), r.attributes = w(r.attributes, (N) => !g(["style", "width", "height", "class"], N.key)), a._icon = h([r]), o(a, "styles_attrs", S(c(a, "styles_attrs") || {}, ["height", "width", "style", "class"])), [a];
|
|
161
161
|
} else if (r.tagName == "option" && e && ((l = e.block) == null ? void 0 : l._type) === "Select")
|
|
162
|
-
return e.block.
|
|
163
|
-
label:
|
|
164
|
-
...
|
|
162
|
+
return e.block.options.push({
|
|
163
|
+
label: _(r.children),
|
|
164
|
+
...f(r)
|
|
165
165
|
}), [];
|
|
166
166
|
}
|
|
167
167
|
const i = b(r.children, { block: a, node: r });
|
|
@@ -171,7 +171,7 @@ const A = {
|
|
|
171
171
|
return (e && e.length > 0 ? e[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : t).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
|
|
172
172
|
}, U = (t) => {
|
|
173
173
|
const e = k(M(t));
|
|
174
|
-
return
|
|
174
|
+
return y(t) ? [] : L(b(e));
|
|
175
175
|
};
|
|
176
176
|
export {
|
|
177
177
|
U as g
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var z=(a,t,e)=>{if(!t.has(a))throw TypeError("Cannot "+e)};var r=(a,t,e)=>(z(a,t,"read from private field"),e?e.call(a):t.get(a)),m=(a,t,e)=>{if(t.has(a))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(a):t.set(a,e)},p=(a,t,e,s)=>(z(a,t,"write to private field"),s?s.call(a,e):t.set(a,e),e);var v=(a,t,e)=>(z(a,t,"access private method"),e);const f=require("react"),b=require("./index-ebd86d7f.cjs");require("react-dom");function R(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const x=R(f);var g,n,l,u,y,k,w,E,C,j=(C=class extends b.Subscribable{constructor(t,e){super();m(this,y);m(this,w);m(this,g,void 0);m(this,n,void 0);m(this,l,void 0);m(this,u,void 0);p(this,n,void 0),p(this,g,t),this.setOptions(e),this.bindMethods(),v(this,y,k).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const e=this.options;this.options=r(this,g).defaultMutationOptions(t),b.shallowEqualObjects(e,this.options)||r(this,g).getMutationCache().notify({type:"observerOptionsUpdated",mutation:r(this,l),observer:this}),(s=r(this,l))==null||s.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=r(this,l))==null||t.removeObserver(this)}onMutationUpdate(t){v(this,y,k).call(this),v(this,w,E).call(this,t)}getCurrentResult(){return r(this,n)}reset(){p(this,l,void 0),v(this,y,k).call(this),v(this,w,E).call(this)}mutate(t,e){var s;return p(this,u,e),(s=r(this,l))==null||s.removeObserver(this),p(this,l,r(this,g).getMutationCache().build(r(this,g),this.options)),r(this,l).addObserver(this),r(this,l).execute(t)}},g=new WeakMap,n=new WeakMap,l=new WeakMap,u=new WeakMap,y=new WeakSet,k=function(){var e;const t=((e=r(this,l))==null?void 0:e.state)??b.getDefaultState();p(this,n,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},w=new WeakSet,E=function(t){b.notifyManager.batch(()=>{var e,s,o,i,d,c,O,M;r(this,u)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((s=(e=r(this,u)).onSuccess)==null||s.call(e,t.data,r(this,n).variables,r(this,n).context),(i=(o=r(this,u)).onSettled)==null||i.call(o,t.data,null,r(this,n).variables,r(this,n).context)):(t==null?void 0:t.type)==="error"&&((c=(d=r(this,u)).onError)==null||c.call(d,t.error,r(this,n).variables,r(this,n).context),(M=(O=r(this,u)).onSettled)==null||M.call(O,void 0,t.error,r(this,n).variables,r(this,n).context))),this.listeners.forEach(Y=>{Y(r(this,n))})})},C);function A(a,t){const e=b.useQueryClient(t),[s]=x.useState(()=>new j(e,a));x.useEffect(()=>{s.setOptions(a)},[s,a]);const o=x.useSyncExternalStore(x.useCallback(d=>s.subscribe(b.notifyManager.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),i=x.useCallback((d,c)=>{s.mutate(d,c).catch(N)},[s]);if(o.error&&b.shouldThrowError(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}function N(){}function T(a,{insertAt:t}={}){if(!a||typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s),s.styleSheet?s.styleSheet.cssText=a:s.appendChild(document.createTextNode(a))}T(`html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}[data-sonner-toaster][data-x-position=right]{right:max(var(--offset),env(safe-area-inset-right))}[data-sonner-toaster][data-x-position=left]{left:max(var(--offset),env(safe-area-inset-left))}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:max(var(--offset),env(safe-area-inset-top))}[data-sonner-toaster][data-y-position=bottom]{bottom:max(var(--offset),env(safe-area-inset-bottom))}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;will-change:transform,opacity,height;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast] [data-description]{font-weight:400;line-height:1.4;color:inherit}[data-sonner-toast] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast] [data-icon]>*{flex-shrink:0}[data-sonner-toast] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toast][data-theme=dark] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;opacity:0;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]{opacity:1}[data-sonner-toast]:focus [data-close-button]{opacity:1}[data-sonner-toast]:focus-within [data-close-button]{opacity:1}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:0;right:0;height:100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - 32px)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
2
|
+
`);Array(12).fill(0);f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"}));f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"}));f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"}));f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}));var S=1,B=class{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{let t=this.subscribers.indexOf(a);this.subscribers.splice(t,1)}),this.publish=a=>{this.subscribers.forEach(t=>t(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var t;let{message:e,...s}=a,o=typeof(a==null?void 0:a.id)=="number"||((t=a.id)==null?void 0:t.length)>0?a.id:S++,i=this.toasts.find(c=>c.id===o),d=a.dismissible===void 0?!0:a.dismissible;return i?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...a,id:o,title:e}),{...c,...a,id:o,dismissible:d,title:e}):c):this.addToast({title:e,...s,dismissible:d,id:o}),o},this.dismiss=a=>(a||this.toasts.forEach(t=>{this.subscribers.forEach(e=>e({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:a,dismiss:!0})),a),this.message=(a,t)=>this.create({...t,message:a}),this.error=(a,t)=>this.create({...t,message:a,type:"error"}),this.success=(a,t)=>this.create({...t,type:"success",message:a}),this.info=(a,t)=>this.create({...t,type:"info",message:a}),this.warning=(a,t)=>this.create({...t,type:"warning",message:a}),this.loading=(a,t)=>this.create({...t,type:"loading",message:a}),this.promise=(a,t)=>{if(!t)return;let e;t.loading!==void 0&&(e=this.create({...t,promise:a,type:"loading",message:t.loading}));let s=a instanceof Promise?a:a(),o=e!==void 0;return s.then(i=>{if(t.success!==void 0){o=!1;let d=typeof t.success=="function"?t.success(i):t.success;this.create({id:e,type:"success",message:d})}}).catch(i=>{if(t.error!==void 0){o=!1;let d=typeof t.error=="function"?t.error(i):t.error;this.create({id:e,type:"error",message:d})}}).finally(()=>{var i;o&&(this.dismiss(e),e=void 0),(i=t.finally)==null||i.call(t)}),e},this.custom=(a,t)=>{let e=(t==null?void 0:t.id)||S++;return this.create({jsx:a(e),id:e,...t}),e},this.subscribers=[],this.toasts=[]}},h=new B,U=(a,t)=>{let e=(t==null?void 0:t.id)||S++;return h.addToast({title:a,...t,id:e}),e},q=U,H=Object.assign(q,{success:h.success,info:h.info,warning:h.warning,error:h.error,custom:h.custom,message:h.message,promise:h.promise,dismiss:h.dismiss,loading:h.loading});exports.Nt=H;exports.useMutation=A;
|