@chaibuilder/sdk 4.0.0-beta.1 → 4.0.0-beta.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/README.md +27 -20
- package/dist/2SSKDMRQ-BnsZi3K3.cjs +1 -0
- package/dist/2SSKDMRQ-CnSDkQcy.js +42 -0
- package/dist/AP7HFJJL-B31839PG.cjs +1228 -0
- package/dist/AP7HFJJL-CymCmW14.js +9214 -0
- package/dist/IconPicker-B1rWC-Ex.js +59 -0
- package/dist/IconPicker-DREyo007.cjs +1 -0
- package/dist/WDYDFRGG-BUVnbAci.js +33 -0
- package/dist/WDYDFRGG-BxhOCHc3.cjs +1 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
- package/dist/actions-registery-CZ1w0NKa.js +15545 -0
- package/dist/actions-registery-YnFmU21O.cjs +418 -0
- package/dist/actions.cjs +1 -0
- package/dist/actions.d.ts +3202 -0
- package/dist/actions.js +216 -0
- package/dist/active-in-another-tab-B47YjQGN.cjs +1 -0
- package/dist/active-in-another-tab-CyjngVA6.js +34 -0
- package/dist/add-new-language-page-88xzrUy8.cjs +1 -0
- package/dist/add-new-language-page-WmlCnytQ.js +401 -0
- package/dist/add-new-page-VW2wAYZp.js +31 -0
- package/dist/add-new-page-soZ8GAkN.cjs +1 -0
- package/dist/ai-panel-content-7zCil042.cjs +1 -0
- package/dist/ai-panel-content-D_o7Q_A-.js +61 -0
- package/dist/ai-panel-default-lang-COYaxNwn.cjs +3 -0
- package/dist/ai-panel-default-lang-DnElspF0.js +341 -0
- package/dist/ai-panel-other-lang-CkynNlAU.cjs +1 -0
- package/dist/ai-panel-other-lang-Dp0E9_Hx.js +162 -0
- package/dist/ai-prompt-input-Bhc0ds7X.js +655 -0
- package/dist/ai-prompt-input-CThbVp0_.cjs +1 -0
- package/dist/ai-translation-prompt-C2kJQFDX.cjs +1 -0
- package/dist/ai-translation-prompt-CZ55HQmo.js +28 -0
- package/dist/apply-binding-6iwlED02.js +833 -0
- package/dist/apply-binding-KKp5PnpZ.cjs +1 -0
- package/dist/code-display-BnqzqzoP.cjs +1 -0
- package/dist/{code-display-337R7Dev.js → code-display-DhD_RBcg.js} +1 -1
- package/dist/code-editor-DRIAnNbb.js +50 -0
- package/dist/code-editor-o3___nu2.cjs +1 -0
- package/dist/common-functions-B3a4xKt_.cjs +1 -0
- package/dist/common-functions-D2lMFR6K.js +13 -0
- package/dist/continue-editing-in-this-client-CS2aQ7yY.js +24 -0
- package/dist/continue-editing-in-this-client-CtMYsk-A.cjs +1 -0
- package/dist/core-BoRDjj4h.cjs +1 -0
- package/dist/core-yvI6kCyw.js +56 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +51 -383
- package/dist/core.js +39 -106
- package/dist/{css-import-modal-DA2L6kwP.js → css-import-modal-Byg6wV0O.js} +36 -36
- package/dist/css-import-modal-CyqkXWCO.cjs +13 -0
- package/dist/delete-design-token-BRZZiWtQ.js +40 -0
- package/dist/delete-design-token-DkVs1oBf.cjs +1 -0
- package/dist/delete-page-BzyX9TN-.js +70 -0
- package/dist/delete-page-DxX7PFIE.cjs +1 -0
- package/dist/design-token-usage-CAHzEGgJ.cjs +1 -0
- package/dist/design-token-usage-xQs6SlaJ.js +113 -0
- package/dist/digital-asset-manager--uO8Agia.cjs +1 -0
- package/dist/digital-asset-manager-DbtwzxRz.js +876 -0
- package/dist/duplicate-page-BR7Dlo9d.js +133 -0
- package/dist/duplicate-page-CaNAbXwV.cjs +1 -0
- package/dist/dynamic-page-selector-Cb5r_W8s.js +85 -0
- package/dist/dynamic-page-selector-Cxk_gjni.cjs +1 -0
- package/dist/fonts-B-Xt29pe.cjs +1 -0
- package/dist/fonts-DRly3Wzd.js +78 -0
- package/dist/{get-chai-builder-tailwind-config-C6MHaUM0.cjs → get-chai-builder-tailwind-config-B9rCyiQo.cjs} +1 -1
- package/dist/{get-chai-builder-tailwind-config-BqaIvg8p.js → get-chai-builder-tailwind-config-DjoVOuAf.js} +13 -10
- package/dist/{get-chai-builder-theme-D0IsUvK4.js → get-chai-builder-theme-BYtp20KD.js} +4 -4
- package/dist/get-chai-builder-theme-Dl72X7cz.cjs +1 -0
- package/dist/get-seo-defaults-9zHebckY.js +65 -0
- package/dist/get-seo-defaults-Cw7vFt-B.cjs +1 -0
- package/dist/image-compression-DZ9WMmyn.cjs +1 -0
- package/dist/image-compression-DsZ1oqpb.js +37 -0
- package/dist/image-editor-DV8kUKhl.js +108 -0
- package/dist/image-editor-G-K28aTS.cjs +1 -0
- package/dist/index-B-rSiAp_.cjs +1 -0
- package/dist/index-Ct7ElCGK.js +19069 -0
- package/dist/index-DF5DEvqb.cjs +160 -0
- package/dist/index-Dxfyt4d4.js +39 -0
- package/dist/index-WQwzsC7A.cjs +5 -0
- package/dist/index-ZuacEL1j.js +4732 -0
- package/dist/json-diff-viewer-D7z4zNvv.cjs +8 -0
- package/dist/json-diff-viewer-krslPepD.js +258 -0
- package/dist/lang-panel-BwIewMyw.js +215 -0
- package/dist/lang-panel-DT96k1xg.cjs +1 -0
- package/dist/manage-design-tokens-Caz_20VK.js +240 -0
- package/dist/manage-design-tokens-CrmLe7UT.cjs +1 -0
- package/dist/mark-as-template-D295ZQtU.js +156 -0
- package/dist/mark-as-template-W3LmpiqN.cjs +1 -0
- package/dist/models-5gOsRC56.cjs +1 -0
- package/dist/models-D95ZYr_x.js +70 -0
- package/dist/nested-path-selector-content-CKYYK-C5.js +87 -0
- package/dist/nested-path-selector-content-CoS_d3dc.cjs +1 -0
- package/dist/no-language-page-content-BvqRBP6y.js +42 -0
- package/dist/no-language-page-content-DkfeMl90.cjs +1 -0
- package/dist/no-language-page-dialog-BcEoqyQB.cjs +1 -0
- package/dist/no-language-page-dialog-PjNqTUpl.js +10 -0
- package/dist/page-creator-C4gc5NSC.cjs +1 -0
- package/dist/page-creator-DiOITEMw.js +795 -0
- package/dist/page-lock-BdYmCks0.cjs +1 -0
- package/dist/page-lock-Bfbs6RgL.js +30 -0
- package/dist/page-locked-dialog-B1FAtK92.cjs +1 -0
- package/dist/page-locked-dialog-B6MKTRfY.js +133 -0
- package/dist/page-manager-new-CHDueBDk.cjs +1 -0
- package/dist/page-manager-new-CzX22g2n.js +394 -0
- package/dist/page-manager-search-and-filter-CM0UMb6U.js +201 -0
- package/dist/page-manager-search-and-filter-DkkRIH86.cjs +1 -0
- package/dist/page-revisions-content-ChY-4f2V.cjs +1 -0
- package/dist/page-revisions-content-NH9JK4Ey.js +445 -0
- package/dist/pages.cjs +1 -0
- package/dist/pages.d.ts +491 -0
- package/dist/pages.js +27 -0
- package/dist/plugin-3ZKK6RXm.js +245 -0
- package/dist/plugin-C6rgJDNQ.cjs +22 -0
- package/dist/publish-pages-content-D9aixMN5.js +178 -0
- package/dist/publish-pages-content-x-JuSFJ9.cjs +1 -0
- package/dist/register-partial-type-BjtdfKHE.js +36 -0
- package/dist/register-partial-type-ig9fUWIJ.cjs +1 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +26 -13
- package/dist/render.js +130 -124
- package/dist/rte-widget-modal-BaHIuEjF.cjs +1 -0
- package/dist/rte-widget-modal-DOJEXLIf.js +38 -0
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +306 -7
- package/dist/runtime.js +44 -1
- package/dist/save-to-lib-Cgpxw8-g.cjs +1 -0
- package/dist/save-to-lib-eiOc_SSN.js +422 -0
- package/dist/sdk.css +1 -1
- package/dist/selected-block-display-BgRY82CT.cjs +16 -0
- package/dist/selected-block-display-CBFePS19.js +319 -0
- package/dist/seo-panel-C1-iMOR1.js +798 -0
- package/dist/seo-panel-DfAb8U7W.cjs +2 -0
- package/dist/shared-json-ld-B4PxAM_0.js +565 -0
- package/dist/shared-json-ld-DzG398hr.cjs +1 -0
- package/dist/slug-input-AwNJs9im.js +86 -0
- package/dist/slug-input-C_ijLQ_X.cjs +1 -0
- package/dist/supabase-actions.cjs +1 -0
- package/dist/supabase-actions.d.ts +284 -0
- package/dist/supabase-actions.js +524 -0
- package/dist/take-over-request-BNxcjY2j.cjs +1 -0
- package/dist/take-over-request-C4FeDtN_.js +63 -0
- package/dist/theme-panel-footer-Cq9pljro.cjs +1 -0
- package/dist/theme-panel-footer-uBQqSJXm.js +25 -0
- package/dist/translation-warning-modal-B64YqlbI.js +26 -0
- package/dist/translation-warning-modal-BZAcwM2_.cjs +1 -0
- package/dist/unmark-as-template-CZ9sQp_P.js +39 -0
- package/dist/unmark-as-template-EVvk0vmp.cjs +1 -0
- package/dist/unpublish-page-D4VwOlxc.js +27 -0
- package/dist/unpublish-page-bdSmwAVQ.cjs +1 -0
- package/dist/use-page-expand-manager-B6XTvk0E.cjs +1 -0
- package/dist/use-page-expand-manager-Cf4MUEJw.js +85 -0
- package/dist/{tailwind.cjs → utils.cjs} +1 -1
- package/dist/{tailwind.d.ts → utils.d.ts} +12 -11
- package/dist/utils.js +7 -0
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.d.ts +0 -6
- package/dist/web-blocks.js +248 -241
- package/dist/web-preview-Cio70gk5.cjs +1 -0
- package/dist/web-preview-Djy6WIyj.js +73 -0
- package/package.json +175 -105
- package/dist/IconPicker-CGWn9C4u.cjs +0 -1
- package/dist/IconPicker-QvxJ-4Ez.js +0 -64
- package/dist/apply-binding-DCno1xQL.js +0 -711
- package/dist/apply-binding-DvHNFLQD.cjs +0 -1
- package/dist/code-display-BZ1x7SqI.cjs +0 -1
- package/dist/code-editor-B28LoECM.cjs +0 -1
- package/dist/code-editor-CfG2FhJ-.js +0 -58
- package/dist/common-functions-BGzDsf1z.js +0 -14
- package/dist/common-functions-BZmyleS1.cjs +0 -1
- package/dist/css-import-modal-CENUYvcl.cjs +0 -13
- package/dist/get-chai-builder-theme-Ck_Z4Q-M.cjs +0 -1
- package/dist/index-CaGNHF7f.js +0 -12209
- package/dist/index-Gn6pJt2v.cjs +0 -166
- package/dist/mockServiceWorker.js +0 -307
- package/dist/plugin-B5627hMN.js +0 -195
- package/dist/plugin-UxTRfDum.cjs +0 -22
- package/dist/rte-widget-modal-DL739qeQ.cjs +0 -1
- package/dist/rte-widget-modal-Dte0od04.js +0 -41
- package/dist/tailwind.js +0 -7
- package/dist/tooltip-A4qGk781.cjs +0 -1
- package/dist/tooltip-tLiIOgjq.js +0 -1067
- package/dist/ui.cjs +0 -1
- package/dist/ui.d.ts +0 -415
- package/dist/ui.js +0 -129
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { uniqBy as s, get as b, flatten as v, keys as B } from "lodash-es";
|
|
2
|
+
import { a as _ } from "./fonts-DRly3Wzd.js";
|
|
3
|
+
import { g as h } from "./_commonjsHelpers-C6fGbg64.js";
|
|
4
|
+
const x = {
|
|
5
|
+
fontFamily: {
|
|
6
|
+
"font-heading": "Inter",
|
|
7
|
+
"font-body": "Inter"
|
|
8
|
+
},
|
|
9
|
+
borderRadius: "10px",
|
|
10
|
+
colors: [
|
|
11
|
+
{
|
|
12
|
+
group: "Body",
|
|
13
|
+
items: {
|
|
14
|
+
background: ["#FFFFFF", "#121212"],
|
|
15
|
+
foreground: ["#121212", "#FFFFFF"]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
group: "Primary",
|
|
20
|
+
items: {
|
|
21
|
+
primary: ["#2563EB", "#3B82F6"],
|
|
22
|
+
"primary-foreground": ["#FFFFFF", "#FFFFFF"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
group: "Secondary",
|
|
27
|
+
items: {
|
|
28
|
+
secondary: ["#F3F4F6", "#374151"],
|
|
29
|
+
"secondary-foreground": ["#1F2937", "#F9FAFB"]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
group: "Border, Input & Ring",
|
|
34
|
+
items: {
|
|
35
|
+
border: ["#E5E7EB", "#374151"],
|
|
36
|
+
input: ["#E5E7EB", "#374151"],
|
|
37
|
+
ring: ["#2563EB", "#3B82F6"]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
group: "Card",
|
|
42
|
+
items: {
|
|
43
|
+
card: ["#FFFFFF", "#1F2937"],
|
|
44
|
+
"card-foreground": ["#121212", "#FFFFFF"]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
group: "Popover",
|
|
49
|
+
items: {
|
|
50
|
+
popover: ["#FFFFFF", "#1F2937"],
|
|
51
|
+
"popover-foreground": ["#121212", "#FFFFFF"]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
group: "Muted",
|
|
56
|
+
items: {
|
|
57
|
+
muted: ["#F3F4F6", "#374151"],
|
|
58
|
+
"muted-foreground": ["#6B7280", "#9CA3AF"]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
group: "Accent",
|
|
63
|
+
items: {
|
|
64
|
+
accent: ["#F3F4F6", "#374151"],
|
|
65
|
+
"accent-foreground": ["#1F2937", "#FFFFFF"]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
group: "Destructive",
|
|
70
|
+
items: {
|
|
71
|
+
destructive: ["#DC2626", "#EF4444"],
|
|
72
|
+
"destructive-foreground": ["#FFFFFF", "#FFFFFF"]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}, I = {
|
|
77
|
+
fontFamily: {
|
|
78
|
+
heading: "Inter",
|
|
79
|
+
body: "Inter"
|
|
80
|
+
},
|
|
81
|
+
borderRadius: "6px",
|
|
82
|
+
colors: {
|
|
83
|
+
background: ["#FFFFFF", "#09090B"],
|
|
84
|
+
foreground: ["#09090B", "#FFFFFF"],
|
|
85
|
+
primary: ["#2563EB", "#3B82F6"],
|
|
86
|
+
"primary-foreground": ["#FFFFFF", "#FFFFFF"],
|
|
87
|
+
secondary: ["#F4F4F5", "#27272A"],
|
|
88
|
+
"secondary-foreground": ["#09090B", "#FFFFFF"],
|
|
89
|
+
muted: ["#F4F4F5", "#27272A"],
|
|
90
|
+
"muted-foreground": ["#71717A", "#A1A1AA"],
|
|
91
|
+
accent: ["#F4F4F5", "#27272A"],
|
|
92
|
+
"accent-foreground": ["#09090B", "#FFFFFF"],
|
|
93
|
+
destructive: ["#EF4444", "#7F1D1D"],
|
|
94
|
+
"destructive-foreground": ["#FFFFFF", "#FFFFFF"],
|
|
95
|
+
border: ["#E4E4E7", "#27272A"],
|
|
96
|
+
input: ["#E4E4E7", "#27272A"],
|
|
97
|
+
ring: ["#2563EB", "#3B82F6"],
|
|
98
|
+
card: ["#FFFFFF", "#09090B"],
|
|
99
|
+
"card-foreground": ["#09090B", "#FFFFFF"],
|
|
100
|
+
popover: ["#FFFFFF", "#09090B"],
|
|
101
|
+
"popover-foreground": ["#09090B", "#FFFFFF"]
|
|
102
|
+
}
|
|
103
|
+
}, q = (r) => ({
|
|
104
|
+
fontFamily: r.fontFamily ? B(r.fontFamily).reduce(
|
|
105
|
+
(e, n) => ({
|
|
106
|
+
...e,
|
|
107
|
+
[n.replace("font-", "")]: `var(--${n})`
|
|
108
|
+
}),
|
|
109
|
+
{}
|
|
110
|
+
) : {},
|
|
111
|
+
borderRadius: r.borderRadius ? {
|
|
112
|
+
lg: "var(--radius)",
|
|
113
|
+
md: "calc(var(--radius) - 2px)",
|
|
114
|
+
sm: "calc(var(--radius) - 4px)"
|
|
115
|
+
} : {},
|
|
116
|
+
colors: r.colors ? v(r.colors.map((e) => Object.entries(e.items))).reduce(
|
|
117
|
+
(e, [n]) => ({ ...e, [n]: `hsl(var(--${n}))` }),
|
|
118
|
+
{}
|
|
119
|
+
) : {}
|
|
120
|
+
});
|
|
121
|
+
function m(r) {
|
|
122
|
+
const t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);
|
|
123
|
+
let e = parseInt(t[1], 16), n = parseInt(t[2], 16), F = parseInt(t[3], 16);
|
|
124
|
+
e /= 255, n /= 255, F /= 255;
|
|
125
|
+
const o = Math.max(e, n, F), u = Math.min(e, n, F);
|
|
126
|
+
let a, d;
|
|
127
|
+
const g = (o + u) / 2;
|
|
128
|
+
if (o == u)
|
|
129
|
+
a = d = 0;
|
|
130
|
+
else {
|
|
131
|
+
const i = o - u;
|
|
132
|
+
switch (d = g > 0.5 ? i / (2 - o - u) : i / (o + u), o) {
|
|
133
|
+
case e:
|
|
134
|
+
a = (n - F) / i + (n < F ? 6 : 0);
|
|
135
|
+
break;
|
|
136
|
+
case n:
|
|
137
|
+
a = (F - e) / i + 2;
|
|
138
|
+
break;
|
|
139
|
+
case F:
|
|
140
|
+
a = (e - n) / i + 4;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
a /= 6;
|
|
144
|
+
}
|
|
145
|
+
return `${Math.round(a * 360)} ${Math.round(d * 100)}% ${Math.round(g * 100)}%`;
|
|
146
|
+
}
|
|
147
|
+
const E = (r) => {
|
|
148
|
+
const e = _().find((n) => n.family === r);
|
|
149
|
+
return `"${r}", ${b(e, "fallback", "")}`;
|
|
150
|
+
}, O = (r) => `:root {
|
|
151
|
+
${r.fontFamily && Object.entries(r.fontFamily).map(([t, e]) => `--font-${t}: ${E(e)};`).join(`
|
|
152
|
+
`)}
|
|
153
|
+
${r.borderRadius && `--radius: ${r.borderRadius};`}
|
|
154
|
+
${r.colors && Object.entries(r.colors).map(([t, e]) => `--${t}: ${m(e[0])};`).join(`
|
|
155
|
+
`)}
|
|
156
|
+
}
|
|
157
|
+
.dark {
|
|
158
|
+
${r.colors && Object.entries(r.colors).map(([t, e]) => `--${t}: ${m(e[1])};`).join(`
|
|
159
|
+
`)}
|
|
160
|
+
}`, S = (r) => !r || r.length === 0 ? "" : s(r, "family").map((t) => `<link rel="stylesheet" href="${t.url}" />`).join(`
|
|
161
|
+
`), D = (r) => !r || r.length === 0 ? [] : s(r, "family").map((t) => t.url), w = (r) => !r || r.length === 0 ? "" : s(r, "family").map((t) => `@import url("${t.url}");`).join(`
|
|
162
|
+
`), L = (r) => !r || r.length === 0 ? "" : s(r, "family").map(
|
|
163
|
+
(t) => t.src.map(
|
|
164
|
+
(e) => `@font-face {
|
|
165
|
+
font-family: "${t.family}";
|
|
166
|
+
src: url("${e.url}") format("${e.format}");
|
|
167
|
+
font-display: swap;
|
|
168
|
+
${e.fontWeight ? `font-weight: ${e.fontWeight};` : ""}
|
|
169
|
+
${e.fontStyle ? `font-style: ${e.fontStyle};` : ""}
|
|
170
|
+
${e.fontStretch ? `font-stretch: ${e.fontStretch};` : ""}
|
|
171
|
+
}`
|
|
172
|
+
).join(`
|
|
173
|
+
`)
|
|
174
|
+
).join(`
|
|
175
|
+
`);
|
|
176
|
+
var l = {}, c = {}, p;
|
|
177
|
+
function P() {
|
|
178
|
+
return p || (p = 1, (function(r) {
|
|
179
|
+
Object.defineProperty(r, "__esModule", {
|
|
180
|
+
value: !0
|
|
181
|
+
}), Object.defineProperty(r, "default", {
|
|
182
|
+
enumerable: !0,
|
|
183
|
+
get: function() {
|
|
184
|
+
return e;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
function t(n, F) {
|
|
188
|
+
return {
|
|
189
|
+
handler: n,
|
|
190
|
+
config: F
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
t.withOptions = function(n, F = () => ({})) {
|
|
194
|
+
const o = function(u) {
|
|
195
|
+
return {
|
|
196
|
+
__options: u,
|
|
197
|
+
handler: n(u),
|
|
198
|
+
config: F(u)
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
return o.__isOptionsFunction = !0, o.__pluginFunction = n, o.__configFunction = F, o;
|
|
202
|
+
};
|
|
203
|
+
const e = t;
|
|
204
|
+
})(c)), c;
|
|
205
|
+
}
|
|
206
|
+
var y;
|
|
207
|
+
function A() {
|
|
208
|
+
return y || (y = 1, (function(r) {
|
|
209
|
+
Object.defineProperty(r, "__esModule", {
|
|
210
|
+
value: !0
|
|
211
|
+
}), Object.defineProperty(r, "default", {
|
|
212
|
+
enumerable: !0,
|
|
213
|
+
get: function() {
|
|
214
|
+
return n;
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
const t = /* @__PURE__ */ e(P());
|
|
218
|
+
function e(F) {
|
|
219
|
+
return F && F.__esModule ? F : {
|
|
220
|
+
default: F
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const n = t.default;
|
|
224
|
+
})(l)), l;
|
|
225
|
+
}
|
|
226
|
+
var f, $;
|
|
227
|
+
function j() {
|
|
228
|
+
if ($) return f;
|
|
229
|
+
$ = 1;
|
|
230
|
+
let r = A();
|
|
231
|
+
return f = (r.__esModule ? r : { default: r }).default, f;
|
|
232
|
+
}
|
|
233
|
+
var C = j();
|
|
234
|
+
const V = /* @__PURE__ */ h(C);
|
|
235
|
+
export {
|
|
236
|
+
O as a,
|
|
237
|
+
w as b,
|
|
238
|
+
S as c,
|
|
239
|
+
x as d,
|
|
240
|
+
I as e,
|
|
241
|
+
D as f,
|
|
242
|
+
q as g,
|
|
243
|
+
L as h,
|
|
244
|
+
V as p
|
|
245
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";const a=require("lodash-es"),h=require("./fonts-B-Xt29pe.cjs"),b=require("./_commonjsHelpers-DwGv2jUC.cjs"),B={fontFamily:{"font-heading":"Inter","font-body":"Inter"},borderRadius:"10px",colors:[{group:"Body",items:{background:["#FFFFFF","#121212"],foreground:["#121212","#FFFFFF"]}},{group:"Primary",items:{primary:["#2563EB","#3B82F6"],"primary-foreground":["#FFFFFF","#FFFFFF"]}},{group:"Secondary",items:{secondary:["#F3F4F6","#374151"],"secondary-foreground":["#1F2937","#F9FAFB"]}},{group:"Border, Input & Ring",items:{border:["#E5E7EB","#374151"],input:["#E5E7EB","#374151"],ring:["#2563EB","#3B82F6"]}},{group:"Card",items:{card:["#FFFFFF","#1F2937"],"card-foreground":["#121212","#FFFFFF"]}},{group:"Popover",items:{popover:["#FFFFFF","#1F2937"],"popover-foreground":["#121212","#FFFFFF"]}},{group:"Muted",items:{muted:["#F3F4F6","#374151"],"muted-foreground":["#6B7280","#9CA3AF"]}},{group:"Accent",items:{accent:["#F3F4F6","#374151"],"accent-foreground":["#1F2937","#FFFFFF"]}},{group:"Destructive",items:{destructive:["#DC2626","#EF4444"],"destructive-foreground":["#FFFFFF","#FFFFFF"]}}]},v={fontFamily:{heading:"Inter",body:"Inter"},borderRadius:"6px",colors:{background:["#FFFFFF","#09090B"],foreground:["#09090B","#FFFFFF"],primary:["#2563EB","#3B82F6"],"primary-foreground":["#FFFFFF","#FFFFFF"],secondary:["#F4F4F5","#27272A"],"secondary-foreground":["#09090B","#FFFFFF"],muted:["#F4F4F5","#27272A"],"muted-foreground":["#71717A","#A1A1AA"],accent:["#F4F4F5","#27272A"],"accent-foreground":["#09090B","#FFFFFF"],destructive:["#EF4444","#7F1D1D"],"destructive-foreground":["#FFFFFF","#FFFFFF"],border:["#E4E4E7","#27272A"],input:["#E4E4E7","#27272A"],ring:["#2563EB","#3B82F6"],card:["#FFFFFF","#09090B"],"card-foreground":["#09090B","#FFFFFF"],popover:["#FFFFFF","#09090B"],"popover-foreground":["#09090B","#FFFFFF"]}},_=e=>({fontFamily:e.fontFamily?a.keys(e.fontFamily).reduce((r,n)=>({...r,[n.replace("font-","")]:`var(--${n})`}),{}):{},borderRadius:e.borderRadius?{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"}:{},colors:e.colors?a.flatten(e.colors.map(r=>Object.entries(r.items))).reduce((r,[n])=>({...r,[n]:`hsl(var(--${n}))`}),{}):{}});function m(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let r=parseInt(t[1],16),n=parseInt(t[2],16),F=parseInt(t[3],16);r/=255,n/=255,F/=255;const o=Math.max(r,n,F),u=Math.min(r,n,F);let i,l;const g=(o+u)/2;if(o==u)i=l=0;else{const s=o-u;switch(l=g>.5?s/(2-o-u):s/(o+u),o){case r:i=(n-F)/s+(n<F?6:0);break;case n:i=(F-r)/s+2;break;case F:i=(r-n)/s+4;break}i/=6}return`${Math.round(i*360)} ${Math.round(l*100)}% ${Math.round(g*100)}%`}const E=e=>{const r=h.getAllRegisteredFonts().find(n=>n.family===e);return`"${e}", ${a.get(r,"fallback","")}`},C=e=>`:root {
|
|
2
|
+
${e.fontFamily&&Object.entries(e.fontFamily).map(([t,r])=>`--font-${t}: ${E(r)};`).join(`
|
|
3
|
+
`)}
|
|
4
|
+
${e.borderRadius&&`--radius: ${e.borderRadius};`}
|
|
5
|
+
${e.colors&&Object.entries(e.colors).map(([t,r])=>`--${t}: ${m(r[0])};`).join(`
|
|
6
|
+
`)}
|
|
7
|
+
}
|
|
8
|
+
.dark {
|
|
9
|
+
${e.colors&&Object.entries(e.colors).map(([t,r])=>`--${t}: ${m(r[1])};`).join(`
|
|
10
|
+
`)}
|
|
11
|
+
}`,P=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(t=>`<link rel="stylesheet" href="${t.url}" />`).join(`
|
|
12
|
+
`),A=e=>!e||e.length===0?[]:a.uniqBy(e,"family").map(t=>t.url),j=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(t=>`@import url("${t.url}");`).join(`
|
|
13
|
+
`),q=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(t=>t.src.map(r=>`@font-face {
|
|
14
|
+
font-family: "${t.family}";
|
|
15
|
+
src: url("${r.url}") format("${r.format}");
|
|
16
|
+
font-display: swap;
|
|
17
|
+
${r.fontWeight?`font-weight: ${r.fontWeight};`:""}
|
|
18
|
+
${r.fontStyle?`font-style: ${r.fontStyle};`:""}
|
|
19
|
+
${r.fontStretch?`font-stretch: ${r.fontStretch};`:""}
|
|
20
|
+
}`).join(`
|
|
21
|
+
`)).join(`
|
|
22
|
+
`);var d={},c={},p;function M(){return p||(p=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});function t(n,F){return{handler:n,config:F}}t.withOptions=function(n,F=()=>({})){const o=function(u){return{__options:u,handler:n(u),config:F(u)}};return o.__isOptionsFunction=!0,o.__pluginFunction=n,o.__configFunction=F,o};const r=t})(c)),c}var y;function k(){return y||(y=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});const t=r(M());function r(F){return F&&F.__esModule?F:{default:F}}const n=t.default})(d)),d}var f,$;function R(){if($)return f;$=1;let e=k();return f=(e.__esModule?e:{default:e}).default,f}var I=R();const O=b.getDefaultExportFromCjs(I);exports.defaultThemeOptions=B;exports.defaultThemeValues=v;exports.getChaiThemeCssVariables=C;exports.getChaiThemeOptions=_;exports.getThemeCustomFontFace=q;exports.getThemeFontsCSSImport=j;exports.getThemeFontsLinkMarkup=P;exports.getThemeFontsUrls=A;exports.plugin=O;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { d as $, e as K, f as Q, p as J, q as V, B as L } from "./index-Ct7ElCGK.js";
|
|
3
|
+
import { LanguageSelector as W } from "./page-manager-search-and-filter-CM0UMb6U.js";
|
|
4
|
+
import { ar as X, as as Y, A as I, aA as q, aB as Z, k as ee, m as te, ap as se, T as U, t as le } from "./index-ZuacEL1j.js";
|
|
5
|
+
import { useQuery as ae } from "@tanstack/react-query";
|
|
6
|
+
import { find as B, filter as a, map as b, keys as ne, get as F, includes as C, orderBy as N, isEmpty as re, uniq as G, first as ce, concat as oe } from "lodash-es";
|
|
7
|
+
import { Lock as ie, GlobeIcon as de, File as ue, Edit as he } from "lucide-react";
|
|
8
|
+
import { useState as D, useCallback as me, useMemo as p, useEffect as j } from "react";
|
|
9
|
+
const ge = () => {
|
|
10
|
+
const s = X(), d = Y();
|
|
11
|
+
return ae({
|
|
12
|
+
queryKey: [I.GET_CHANGES],
|
|
13
|
+
queryFn: async () => d(s, { action: I.GET_CHANGES })
|
|
14
|
+
});
|
|
15
|
+
}, pe = ({ page: s, selectedPages: d, handleCheckboxChange: k, getPageType: x, hasSlug: h, currentOwnerId: r }) => {
|
|
16
|
+
const u = q(), { data: i } = se(r), c = r === u ? null : i == null ? void 0 : i.name;
|
|
17
|
+
return /* @__PURE__ */ n("tr", { className: "group relative border-b last:border-b-0 hover:bg-gray-50", children: [
|
|
18
|
+
/* @__PURE__ */ n(
|
|
19
|
+
"td",
|
|
20
|
+
{
|
|
21
|
+
scope: "row",
|
|
22
|
+
className: `flex items-center gap-x-1 whitespace-nowrap px-6 py-2 text-gray-900 dark:text-white ${c ? "opacity-50" : ""}`,
|
|
23
|
+
children: [
|
|
24
|
+
c ? /* @__PURE__ */ t(ie, { className: "h-4 w-4 fill-red-200 text-red-500" }) : /* @__PURE__ */ t(
|
|
25
|
+
"input",
|
|
26
|
+
{
|
|
27
|
+
checked: C(d, s == null ? void 0 : s.id),
|
|
28
|
+
onClick: (f) => {
|
|
29
|
+
f.stopPropagation(), k(s == null ? void 0 : s.id);
|
|
30
|
+
},
|
|
31
|
+
type: "checkbox",
|
|
32
|
+
className: "cursor-pointer rounded focus:outline-none focus:ring-0"
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
" ",
|
|
36
|
+
h(s.pageType) ? /* @__PURE__ */ t(ue, { className: "h-4 w-4" }) : /* @__PURE__ */ t(de, { className: "h-4 w-4" }),
|
|
37
|
+
/* @__PURE__ */ t(U, { content: s.name, side: "top", showTooltip: s.name.length > 25, children: /* @__PURE__ */ t("span", { className: "max-w-[200px] truncate font-medium text-black", children: s.name }) }),
|
|
38
|
+
s.slug && /* @__PURE__ */ t(U, { content: s.slug, side: "top", showTooltip: s.slug.length > 25, children: /* @__PURE__ */ t("span", { className: "max-w-[200px] truncate font-mono text-xs text-muted-foreground", children: s.slug }) })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ t("td", { className: "px-2", children: x(s == null ? void 0 : s.pageType) }),
|
|
43
|
+
/* @__PURE__ */ t("td", { className: "px-4 text-right", children: ce(s.changes) || "" }),
|
|
44
|
+
/* @__PURE__ */ t(_, { children: c && /* @__PURE__ */ n("button", { className: "absolute right-0 top-0 flex h-full items-center gap-x-1 rounded bg-red-50 px-2 py-0.5 text-xs font-light text-red-500 opacity-0 group-hover:opacity-100", children: [
|
|
45
|
+
/* @__PURE__ */ t(he, { size: 12, className: "stroke-[3]" }),
|
|
46
|
+
" ",
|
|
47
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: c }),
|
|
48
|
+
" is editing this page"
|
|
49
|
+
] }) })
|
|
50
|
+
] }, s == null ? void 0 : s.id);
|
|
51
|
+
}, Pe = ({
|
|
52
|
+
onClose: s = () => {
|
|
53
|
+
},
|
|
54
|
+
isPending: d,
|
|
55
|
+
publishPage: k
|
|
56
|
+
}) => {
|
|
57
|
+
const x = q(), { pageToUser: h } = Z(), [r, u] = D([]), i = ee(), [c, f] = D(i), { data: w, isFetching: v } = ge(), { data: m } = te(), T = me((e) => {
|
|
58
|
+
var l;
|
|
59
|
+
return (l = B(m, { key: e })) == null ? void 0 : l.hasSlug;
|
|
60
|
+
}, [m]), y = p(
|
|
61
|
+
() => a(m, (e) => !T(e.key)).map((e) => e.key),
|
|
62
|
+
[T, m]
|
|
63
|
+
), E = G(b(w, "lang")).filter(Boolean), o = p(
|
|
64
|
+
() => a(w, (e) => e.pageType === "theme" ? !1 : c === i ? e.lang === c || e.lang === "" : e.lang === c),
|
|
65
|
+
[w, c, i]
|
|
66
|
+
), S = p(
|
|
67
|
+
() => a(o, (e) => !y.includes(e.pageType)),
|
|
68
|
+
[o, y]
|
|
69
|
+
), P = p(
|
|
70
|
+
() => a(o, (e) => y.includes(e.pageType)),
|
|
71
|
+
[o, y]
|
|
72
|
+
);
|
|
73
|
+
j(() => {
|
|
74
|
+
const e = b(a(o, { online: !0 }), "id");
|
|
75
|
+
u(e);
|
|
76
|
+
}, [o]), j(() => {
|
|
77
|
+
const e = a(ne(h), (l) => F(h, [l, "userId"]) !== x);
|
|
78
|
+
u((l) => a(l, (g) => !C(e, g)));
|
|
79
|
+
}, [h, x]);
|
|
80
|
+
const A = r.length === (o == null ? void 0 : o.length), O = (e) => {
|
|
81
|
+
u((l) => C(l, e) ? a(l, (g) => g !== e) : oe(l, e));
|
|
82
|
+
}, H = () => {
|
|
83
|
+
u(A ? [] : b(o, "id"));
|
|
84
|
+
}, z = () => {
|
|
85
|
+
k(
|
|
86
|
+
{ ids: G(r) },
|
|
87
|
+
{
|
|
88
|
+
onSuccess: () => {
|
|
89
|
+
s(), le("CENTER_CENTER"), f(i);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}, M = (e) => {
|
|
94
|
+
if (e === "theme") return "Theme";
|
|
95
|
+
const l = B(m, { key: e });
|
|
96
|
+
return l ? l == null ? void 0 : l.name : e;
|
|
97
|
+
}, R = p(() => {
|
|
98
|
+
const e = [
|
|
99
|
+
{ label: "Updated", top: "pt-2" },
|
|
100
|
+
...N(a(S, { online: !0 }), "pageType"),
|
|
101
|
+
...N(a(P, { online: !0 }), "pageType")
|
|
102
|
+
].filter((g) => g.pageType !== "theme"), l = [
|
|
103
|
+
{ label: "Offline", top: "pt-6" },
|
|
104
|
+
...N(a(S, { online: !1 }), "pageType"),
|
|
105
|
+
...N(a(P, { online: !1 }), "pageType")
|
|
106
|
+
];
|
|
107
|
+
return [...e, ...l];
|
|
108
|
+
}, [S, P]);
|
|
109
|
+
return /* @__PURE__ */ n($, { className: "flex max-h-[80%] max-w-4xl flex-col", children: [
|
|
110
|
+
/* @__PURE__ */ n(K, { children: [
|
|
111
|
+
/* @__PURE__ */ t(Q, { children: "Publish changes" }),
|
|
112
|
+
/* @__PURE__ */ t(J, { className: "text-xs", children: "Select the pages you want to publish. Click publish when you're done." })
|
|
113
|
+
] }),
|
|
114
|
+
E.length > 0 && /* @__PURE__ */ t("div", { className: "my-[2px] mt-0", children: /* @__PURE__ */ t(
|
|
115
|
+
W,
|
|
116
|
+
{
|
|
117
|
+
languages: [i, ...E],
|
|
118
|
+
selectedLanguage: c,
|
|
119
|
+
setSelectedLanguage: f
|
|
120
|
+
}
|
|
121
|
+
) }),
|
|
122
|
+
/* @__PURE__ */ t("div", { className: "no-scrollbar relative -mx-4 -mt-4 h-full max-h-full overflow-y-auto", children: v ? /* @__PURE__ */ n("div", { className: "space-y-2 px-1", children: [
|
|
123
|
+
/* @__PURE__ */ t("div", { className: "mt-2 h-6 w-full animate-pulse rounded bg-gray-200" }),
|
|
124
|
+
/* @__PURE__ */ t("div", { className: "h-6 w-full animate-pulse rounded bg-gray-200" }),
|
|
125
|
+
/* @__PURE__ */ t("div", { className: "h-6 w-full animate-pulse rounded bg-gray-200" }),
|
|
126
|
+
/* @__PURE__ */ t("div", { className: "h-6 w-full animate-pulse rounded bg-gray-200" })
|
|
127
|
+
] }) : /* @__PURE__ */ n("table", { className: "w-full text-left text-xs text-gray-500 dark:text-gray-400 rtl:text-right", children: [
|
|
128
|
+
/* @__PURE__ */ t("thead", { className: "sticky top-0 z-10 border-b bg-gray-50 text-gray-700 dark:bg-gray-700 dark:text-gray-400", children: /* @__PURE__ */ n("tr", { children: [
|
|
129
|
+
/* @__PURE__ */ n("th", { scope: "col", className: "w-[1 50px] flex items-center gap-x-2 px-6 py-3", children: [
|
|
130
|
+
/* @__PURE__ */ t(
|
|
131
|
+
"input",
|
|
132
|
+
{
|
|
133
|
+
checked: A,
|
|
134
|
+
onClick: (e) => {
|
|
135
|
+
e.stopPropagation(), H();
|
|
136
|
+
},
|
|
137
|
+
type: "checkbox",
|
|
138
|
+
className: "mt-1 cursor-pointer rounded focus:outline-none focus:ring-0"
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
"Name"
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ t("th", { scope: "col", className: "w-[150px] px-2 py-3", children: "Type" }),
|
|
144
|
+
/* @__PURE__ */ t("th", { scope: "col", className: "w-[150px] px-4 py-3 text-right", children: "Status" })
|
|
145
|
+
] }) }),
|
|
146
|
+
/* @__PURE__ */ t("tbody", { children: b(
|
|
147
|
+
R,
|
|
148
|
+
(e) => e.label ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ n("td", { colSpan: 3, className: `relative px-6 py-2 text-xs font-medium text-gray-800 ${e.top}`, children: [
|
|
149
|
+
/* @__PURE__ */ t("div", { className: "absolute inset-0 left-6 flex items-center", children: /* @__PURE__ */ t("div", { className: "order-gray-300 w-full" }) }),
|
|
150
|
+
/* @__PURE__ */ t("div", { className: "relative flex justify-start", children: /* @__PURE__ */ t("span", { className: "bg-gray-50 pr-2", children: e.label }) })
|
|
151
|
+
] }) }, "separator") : /* @__PURE__ */ t(
|
|
152
|
+
pe,
|
|
153
|
+
{
|
|
154
|
+
page: e,
|
|
155
|
+
selectedPages: r,
|
|
156
|
+
handleCheckboxChange: O,
|
|
157
|
+
getPageType: M,
|
|
158
|
+
hasSlug: T,
|
|
159
|
+
currentOwnerId: F(h, [(e == null ? void 0 : e.primaryPage) || (e == null ? void 0 : e.id), "userId"])
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
) })
|
|
163
|
+
] }) }),
|
|
164
|
+
/* @__PURE__ */ n(V, { className: "mt-10 flex items-center justify-center", children: [
|
|
165
|
+
r.length > 0 && /* @__PURE__ */ n("span", { className: "text-center text-sm text-muted-foreground", children: [
|
|
166
|
+
r.length,
|
|
167
|
+
" Page",
|
|
168
|
+
r.length !== 1 ? "s" : "",
|
|
169
|
+
" Selected"
|
|
170
|
+
] }),
|
|
171
|
+
/* @__PURE__ */ t(L, { disabled: d, variant: "outline", onClick: s, children: "Cancel" }),
|
|
172
|
+
/* @__PURE__ */ t(L, { disabled: d || v || re(r), onClick: z, children: d ? "Publishing..." : "Publish Selected" })
|
|
173
|
+
] })
|
|
174
|
+
] });
|
|
175
|
+
};
|
|
176
|
+
export {
|
|
177
|
+
Pe as default
|
|
178
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("./index-DF5DEvqb.cjs"),L=require("./page-manager-search-and-filter-DkkRIH86.cjs"),r=require("./index-WQwzsC7A.cjs"),U=require("@tanstack/react-query"),t=require("lodash-es"),b=require("lucide-react"),i=require("react"),F=()=>{const l=r.useApiUrl(),d=r.useFetch();return U.useQuery({queryKey:[r.ACTIONS.GET_CHANGES],queryFn:async()=>d(l,{action:r.ACTIONS.GET_CHANGES})})},M=({page:l,selectedPages:d,handleCheckboxChange:N,getPageType:y,hasSlug:m,currentOwnerId:a})=>{const x=r.useUserId(),{data:u}=r.useChaiUserInfo(a),c=a===x?null:u==null?void 0:u.name;return e.jsxs("tr",{className:"group relative border-b last:border-b-0 hover:bg-gray-50",children:[e.jsxs("td",{scope:"row",className:`flex items-center gap-x-1 whitespace-nowrap px-6 py-2 text-gray-900 dark:text-white ${c?"opacity-50":""}`,children:[c?e.jsx(b.Lock,{className:"h-4 w-4 fill-red-200 text-red-500"}):e.jsx("input",{checked:t.includes(d,l==null?void 0:l.id),onClick:p=>{p.stopPropagation(),N(l==null?void 0:l.id)},type:"checkbox",className:"cursor-pointer rounded focus:outline-none focus:ring-0"})," ",m(l.pageType)?e.jsx(b.File,{className:"h-4 w-4"}):e.jsx(b.GlobeIcon,{className:"h-4 w-4"}),e.jsx(r.Tooltip,{content:l.name,side:"top",showTooltip:l.name.length>25,children:e.jsx("span",{className:"max-w-[200px] truncate font-medium text-black",children:l.name})}),l.slug&&e.jsx(r.Tooltip,{content:l.slug,side:"top",showTooltip:l.slug.length>25,children:e.jsx("span",{className:"max-w-[200px] truncate font-mono text-xs text-muted-foreground",children:l.slug})})]}),e.jsx("td",{className:"px-2",children:y(l==null?void 0:l.pageType)}),e.jsx("td",{className:"px-4 text-right",children:t.first(l.changes)||""}),e.jsx(e.Fragment,{children:c&&e.jsxs("button",{className:"absolute right-0 top-0 flex h-full items-center gap-x-1 rounded bg-red-50 px-2 py-0.5 text-xs font-light text-red-500 opacity-0 group-hover:opacity-100",children:[e.jsx(b.Edit,{size:12,className:"stroke-[3]"})," ",e.jsx("span",{className:"font-medium",children:c})," is editing this page"]})})]},l==null?void 0:l.id)},G=({onClose:l=()=>{},isPending:d,publishPage:N})=>{const y=r.useUserId(),{pageToUser:m}=r.usePageToUser(),[a,x]=i.useState([]),u=r.useFallbackLang(),[c,p]=i.useState(u),{data:k,isFetching:P}=F(),{data:g}=r.usePageTypes(),T=i.useCallback(s=>{var n;return(n=t.find(g,{key:s}))==null?void 0:n.hasSlug},[g]),j=i.useMemo(()=>t.filter(g,s=>!T(s.key)).map(s=>s.key),[T,g]),C=t.uniq(t.map(k,"lang")).filter(Boolean),o=i.useMemo(()=>t.filter(k,s=>s.pageType==="theme"?!1:c===u?s.lang===c||s.lang==="":s.lang===c),[k,c,u]),w=i.useMemo(()=>t.filter(o,s=>!j.includes(s.pageType)),[o,j]),S=i.useMemo(()=>t.filter(o,s=>j.includes(s.pageType)),[o,j]);i.useEffect(()=>{const s=t.map(t.filter(o,{online:!0}),"id");x(s)},[o]),i.useEffect(()=>{const s=t.filter(t.keys(m),n=>t.get(m,[n,"userId"])!==y);x(n=>t.filter(n,f=>!t.includes(s,f)))},[m,y]);const v=a.length===(o==null?void 0:o.length),E=s=>{x(n=>t.includes(n,s)?t.filter(n,f=>f!==s):t.concat(n,s))},q=()=>{x(v?[]:t.map(o,"id"))},I=()=>{N({ids:t.uniq(a)},{onSuccess:()=>{l(),r.throwConfetti("CENTER_CENTER"),p(u)}})},A=s=>{if(s==="theme")return"Theme";const n=t.find(g,{key:s});return n?n==null?void 0:n.name:s},B=i.useMemo(()=>{const s=[{label:"Updated",top:"pt-2"},...t.orderBy(t.filter(w,{online:!0}),"pageType"),...t.orderBy(t.filter(S,{online:!0}),"pageType")].filter(f=>f.pageType!=="theme"),n=[{label:"Offline",top:"pt-6"},...t.orderBy(t.filter(w,{online:!1}),"pageType"),...t.orderBy(t.filter(S,{online:!1}),"pageType")];return[...s,...n]},[w,S]);return e.jsxs(h.DialogContent,{className:"flex max-h-[80%] max-w-4xl flex-col",children:[e.jsxs(h.DialogHeader,{children:[e.jsx(h.DialogTitle,{children:"Publish changes"}),e.jsx(h.DialogDescription,{className:"text-xs",children:"Select the pages you want to publish. Click publish when you're done."})]}),C.length>0&&e.jsx("div",{className:"my-[2px] mt-0",children:e.jsx(L.LanguageSelector,{languages:[u,...C],selectedLanguage:c,setSelectedLanguage:p})}),e.jsx("div",{className:"no-scrollbar relative -mx-4 -mt-4 h-full max-h-full overflow-y-auto",children:P?e.jsxs("div",{className:"space-y-2 px-1",children:[e.jsx("div",{className:"mt-2 h-6 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-6 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-6 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-6 w-full animate-pulse rounded bg-gray-200"})]}):e.jsxs("table",{className:"w-full text-left text-xs text-gray-500 dark:text-gray-400 rtl:text-right",children:[e.jsx("thead",{className:"sticky top-0 z-10 border-b bg-gray-50 text-gray-700 dark:bg-gray-700 dark:text-gray-400",children:e.jsxs("tr",{children:[e.jsxs("th",{scope:"col",className:"w-[1 50px] flex items-center gap-x-2 px-6 py-3",children:[e.jsx("input",{checked:v,onClick:s=>{s.stopPropagation(),q()},type:"checkbox",className:"mt-1 cursor-pointer rounded focus:outline-none focus:ring-0"}),"Name"]}),e.jsx("th",{scope:"col",className:"w-[150px] px-2 py-3",children:"Type"}),e.jsx("th",{scope:"col",className:"w-[150px] px-4 py-3 text-right",children:"Status"})]})}),e.jsx("tbody",{children:t.map(B,s=>s.label?e.jsx("tr",{children:e.jsxs("td",{colSpan:3,className:`relative px-6 py-2 text-xs font-medium text-gray-800 ${s.top}`,children:[e.jsx("div",{className:"absolute inset-0 left-6 flex items-center",children:e.jsx("div",{className:"order-gray-300 w-full"})}),e.jsx("div",{className:"relative flex justify-start",children:e.jsx("span",{className:"bg-gray-50 pr-2",children:s.label})})]})},"separator"):e.jsx(M,{page:s,selectedPages:a,handleCheckboxChange:E,getPageType:A,hasSlug:T,currentOwnerId:t.get(m,[(s==null?void 0:s.primaryPage)||(s==null?void 0:s.id),"userId"])}))})]})}),e.jsxs(h.DialogFooter,{className:"mt-10 flex items-center justify-center",children:[a.length>0&&e.jsxs("span",{className:"text-center text-sm text-muted-foreground",children:[a.length," Page",a.length!==1?"s":""," Selected"]}),e.jsx(h.Button,{disabled:d,variant:"outline",onClick:l,children:"Cancel"}),e.jsx(h.Button,{disabled:d||P||t.isEmpty(a),onClick:I,children:d?"Publishing...":"Publish Selected"})]})]})};exports.default=G;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { get as r, has as c } from "lodash-es";
|
|
2
|
+
const t = {};
|
|
3
|
+
function i(a, e) {
|
|
4
|
+
c(t, a) && console.warn(`Collection ${a} already registered`), t[a] = { ...e, id: a };
|
|
5
|
+
}
|
|
6
|
+
const l = () => Object.values(t), g = (a) => r(t, a);
|
|
7
|
+
let o = async (a) => ({
|
|
8
|
+
...a
|
|
9
|
+
});
|
|
10
|
+
const C = (a) => {
|
|
11
|
+
o = a;
|
|
12
|
+
}, h = async (a) => {
|
|
13
|
+
try {
|
|
14
|
+
return await o(a);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
return console.error(e), {};
|
|
17
|
+
}
|
|
18
|
+
}, s = {}, P = () => Object.values(s), u = (a) => s[a], T = (a, e) => {
|
|
19
|
+
s[a] = { key: a, ...e, hasSlug: !0 };
|
|
20
|
+
}, p = (a, e) => {
|
|
21
|
+
s[a] = { key: a, ...e, hasSlug: !1 };
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
t as C,
|
|
25
|
+
s as P,
|
|
26
|
+
g as a,
|
|
27
|
+
o as b,
|
|
28
|
+
C as c,
|
|
29
|
+
h as d,
|
|
30
|
+
P as e,
|
|
31
|
+
u as f,
|
|
32
|
+
l as g,
|
|
33
|
+
T as h,
|
|
34
|
+
p as i,
|
|
35
|
+
i as r
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("lodash-es"),t={};function o(e,a){i.has(t,e)&&console.warn(`Collection ${e} already registered`),t[e]={...a,id:e}}const s=()=>Object.values(t),l=e=>i.get(t,e);exports.CHAI_GLOBAL_DATA_PROVIDER=async e=>({...e});const C=e=>{exports.CHAI_GLOBAL_DATA_PROVIDER=e},c=async e=>{try{return await exports.CHAI_GLOBAL_DATA_PROVIDER(e)}catch(a){return console.error(a),{}}},r={},g=()=>Object.values(r),n=e=>r[e],h=(e,a)=>{r[e]={key:e,...a,hasSlug:!0}},P=(e,a)=>{r[e]={key:e,...a,hasSlug:!1}};exports.COLLECTIONS=t;exports.PAGE_TYPES=r;exports.getChaiCollection=l;exports.getChaiCollections=s;exports.getChaiGlobalData=c;exports.getChaiPageType=n;exports.getChaiPageTypes=g;exports.registerChaiCollection=o;exports.registerChaiGlobalDataProvider=C;exports.registerChaiPageType=h;exports.registerChaiPartialType=P;
|
package/dist/render.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./plugin-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./plugin-C6rgJDNQ.cjs"),d=require("./apply-binding-KKp5PnpZ.cjs"),m=require("react/jsx-runtime"),t=require("lodash-es"),g=require("react"),b=require("./core-BoRDjj4h.cjs"),F=require("@mhsdesign/jit-browser-tailwindcss"),j=require("@tailwindcss/aspect-ratio"),q=require("@tailwindcss/container-queries"),K=require("@tailwindcss/forms"),M=require("@tailwindcss/typography"),L=require("./get-chai-builder-theme-Dl72X7cz.cjs");async function O(e){const a={pageProps:e.pageProps,block:e.block,lang:e.lang,draft:e.draft,inBuilder:!1},n=await e.dataProvider(a);return t.has(n,"$metadata")&&t.isFunction(e.dataProviderMetadataCallback)&&e.dataProviderMetadataCallback(e.block,n.$metadata),e.children({...t.omit(n,"$metadata")})}const N=()=>m.jsx("div",{}),H=e=>{const{block:a,lang:n,fallbackLang:s,children:i,externalData:o,blocks:l,draft:r,pageProps:c,dataProviderMetadataCallback:k}=e,u=b.getRegisteredChaiBlock(a._type),p=t.get(u,"component",null),_=t.get(e.repeaterData,"index",-1),f=t.get(e.repeaterData,"dataKey",""),w=n===s?"":n,y=d.applyBindingToBlockProps(d.applyLanguage(a,w,u),o,{index:_,key:f}),h=d.getBlockTagAttributes(a,!1),I=D(l,a._id,d.getBlockRuntimeProps(a._type)),T=t.has(u,"dataProvider")&&t.isFunction(u.dataProvider),B={...y,...h,...I},P={blockProps:{},inBuilder:!1,lang:n||s,pageData:o,...B},v=t.get(B,"_show",!0);if(t.isNull(p)||!v)return null;if(T){const S=t.get(u,"suspenseFallback",N);return m.jsx(g.Suspense,{fallback:g.createElement(S),children:m.jsx(O,{lang:n,pageProps:c,block:B,dataProvider:u.dataProvider,...k?{dataProviderMetadataCallback:k}:{},draft:r,children:$=>g.createElement(p,{...P,...$,children:i({_id:a._id,_type:a._type,...t.isArray(y.repeaterItems)?{repeaterItems:d.applyLimit(y.repeaterItems,a),$repeaterItemsKey:y.$repeaterItemsKey,repeaterTotalItems:y.repeaterTotalItems??-1}:{}})})})})}return m.jsx(g.Suspense,{children:g.createElement(p,{...P,children:i({_id:a._id,_type:a._type,...t.isArray(y.repeaterItems)?{repeaterItems:d.applyLimit(y.repeaterItems,a),$repeaterItemsKey:y.$repeaterItemsKey,repeaterTotalItems:y.repeaterTotalItems??-1}:{}})})})},x=e=>{const{blocks:a,parent:n,repeaterData:s,type:i}=e;let o=t.uniqBy(t.filter(a,r=>t.has(r,"_id")&&(t.isEmpty(n)?!r._parent:r._parent===n)),"_id");const l=r=>t.filter(a,c=>c._parent===r).length>0;return(i==="Heading"||i==="Paragraph"||i==="Link"||i==="Span")&&(o=d.adjustSpacingInContentBlocks(o)),t.map(o,r=>r?g.createElement(H,{...e,key:r._id,block:r},({_id:c,_type:k,repeaterItems:u,$repeaterItemsKey:p})=>k==="Repeater"?t.isArray(u)&&u.map((_,f)=>g.createElement(x,{...e,parent:r._id,key:`${t.get(r,"_parent","root")}-${r._id}-${f}`,repeaterData:{index:f,dataKey:p}})):l(c)?g.createElement(x,{...e,parent:r._id,key:`${t.get(r,"_parent","root")}-${r._id}`,repeaterData:s,type:r._type}):null):null)},D=(e,a,n)=>t.isEmpty(n)?{}:Object.entries(n).reduce((s,[i,o])=>{const l=[];let r=t.find(e,{_id:a});for(;r;)l.push(r),r=t.find(e,{_id:r._parent});const c=t.find(l,{_type:o.block});return c&&(s[i]=t.get(c,t.get(o,"prop"),null)),s},{});function J(e){if(t.isEmpty(e.lang)&&!t.isEmpty(e.fallbackLang))throw new Error("lang prop is required when fallbackLang is provided");if(t.isEmpty(e.blocks))return null;const a=e.lang??"en",n=e.fallbackLang??a;return m.jsx(x,{...e,lang:a,fallbackLang:n})}async function V(e){const a=await e.dataProvider;return t.has(a,"$metadata")&&t.isFunction(e.dataProviderMetadataCallback)&&e.dataProviderMetadataCallback(e.block,a.$metadata),e.children({...t.omit(a,"$metadata")})}const W=()=>m.jsx("div",{}),U=async e=>{const{block:a,lang:n,fallbackLang:s,children:i,externalData:o,blocks:l,draft:r,pageProps:c,dataProviderMetadataCallback:k,dataProviders:u}=e,p=b.getRegisteredChaiBlock(a._type),_=t.get(p,"component",null),f=t.get(e.repeaterData,"index",-1),w=t.get(e.repeaterData,"dataKey",""),y=n===s?"":n,h=d.applyBindingToBlockProps(d.applyLanguage(a,y,p),o,{index:f,key:w}),I=d.getBlockTagAttributes(a,!1),T=D(l,a._id,d.getBlockRuntimeProps(a._type)),B=t.has(p,"dataProvider")&&t.isFunction(p.dataProvider),P={...h,...I,...T},v={blockProps:{},inBuilder:!1,lang:n||s,pageData:o,...P},S=t.get(P,"_show",!0);if(t.isNull(_)||!S)return null;if(B){const $=t.get(u,a._id,Promise.resolve({})),R=t.get(p,"suspenseFallback",W);return m.jsx(g.Suspense,{fallback:g.createElement(R),children:m.jsx(V,{lang:n,pageProps:c,block:P,dataProvider:$,...k?{dataProviderMetadataCallback:k}:{},draft:r,children:A=>g.createElement(_,{...v,draft:r,...A,children:i({_id:a._id,_type:a._type,...t.isArray(h.repeaterItems)?{repeaterItems:d.applyLimit(h.repeaterItems,a),$repeaterItemsKey:h.$repeaterItemsKey,repeaterTotalItems:h.repeaterTotalItems??-1}:{}})})})})}return g.createElement(_,{...v,draft:r,children:i({_id:a._id,_type:a._type,...t.isArray(h.repeaterItems)?{repeaterItems:d.applyLimit(h.repeaterItems,a),$repeaterItemsKey:h.$repeaterItemsKey,repeaterTotalItems:h.repeaterTotalItems??-1}:{}})})},C=async e=>{const{blocks:a,parent:n,repeaterData:s,type:i}=e;let o=t.uniqBy(t.filter(a,r=>t.has(r,"_id")&&(t.isEmpty(n)?!r._parent:r._parent===n)),"_id");const l=r=>t.filter(a,c=>c._parent===r).length>0;return l&&(i==="Heading"||i==="Paragraph"||i==="Link")&&(o=d.adjustSpacingInContentBlocks(o)),t.map(o,r=>r?g.createElement(U,{dataProviders:e.dataProviders,...e,key:r._id,block:r},({_id:c,_type:k,repeaterItems:u,$repeaterItemsKey:p})=>k==="Repeater"?t.isArray(u)&&u.map((_,f)=>g.createElement(C,{...e,parent:r._id,key:`${t.get(r,"_parent","root")}-${r._id}-${f}`,repeaterData:{index:f,dataKey:p}})):l(c)?g.createElement(C,{...e,parent:r._id,key:`${t.get(r,"_parent","root")}-${r._id}`,repeaterData:s,type:r._type}):null):null)};async function G(e){if(t.isEmpty(e.lang)&&!t.isEmpty(e.fallbackLang))throw new Error("lang prop is required when fallbackLang is provided");if(t.isEmpty(e.blocks))return null;const a=e.lang??"en",n=e.fallbackLang??a;if(e.dataProviders)return m.jsx(C,{...e,lang:a,fallbackLang:n,dataProviders:e.dataProviders});const i=e.blocks.filter(o=>{const l=b.getRegisteredChaiBlock(o._type);return!!(t.has(l,"dataProvider")&&t.isFunction(l.dataProvider))}).reduce((o,l)=>{const r=b.getRegisteredChaiBlock(l._type),c={pageProps:e.pageProps,block:l,lang:e.lang,draft:e.draft,inBuilder:!1};return o[l._id]=r.dataProvider(c),o},{});return m.jsx(C,{...e,lang:a,fallbackLang:n,dataProviders:i})}function z(e,a){const n=e.filter(s=>s._type==="GlobalBlock"||s._type==="PartialBlock");for(let s=0;s<n.length;s++){const i=n[s],o=t.get(i,"partialBlockId",t.get(i,"globalBlock",""));if(o==="")continue;let l=t.cloneDeep(t.get(a,o,[]));i._parent&&(l==null?void 0:l.length)>0&&(l=l.map(c=>(t.isEmpty(c._parent)&&(c._parent=i._parent),c)));const r=e.indexOf(i);e.splice(r,1,...l)}return e}const Q=e=>{if(!e)return[];try{return JSON.parse(X(e)).filter(n=>!n._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function X(e){const a=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(a,n=>{const s=decodeURIComponent(n),i=s.indexOf("public");return i!==-1?s.substring(i+6):s})}async function Y(e,a=[],n=!1){return await F.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:a,theme:{extend:{...L.getChaiBuilderTheme(),keyframes:{"accordion-down":{from:{height:"0"},to:{height:"var(--radix-accordion-content-height)"}},"accordion-up":{from:{height:"var(--radix-accordion-content-height)"},to:{height:"0"}}},animation:{"accordion-down":"accordion-down 0.2s ease-out","accordion-up":"accordion-up 0.2s ease-out"}}},plugins:[K,M,j,q,L.chaiBuilderPlugin],corePlugins:{preflight:n}}}).generateStylesFromContent(` ${n?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
|
-
@tailwind utilities;`,e)}const
|
|
3
|
+
@tailwind utilities;`,e)}const Z=(e,a)=>{const n=JSON.stringify(e).replace(/#styles:([^"]*)/g,(s,i)=>`#styles:${i.replace(/,/g," ")}`.replace(/#styles:/g,""));return Y([n],[],a)},ee=async(e,a=!1)=>await Z(e,a);exports.getChaiThemeCssVariables=E.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=E.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=E.getThemeFontsLinkMarkup;exports.applyChaiDataBinding=d.applyChaiDataBinding;exports.applyDesignTokens=d.applyDesignTokens;exports.convertHTMLToChaiBlocks=d.getBlocksFromHTML;exports.AsyncRenderChaiBlocks=G;exports.RenderChaiBlocks=J;exports.convertToBlocks=Q;exports.getMergedPartialBlocks=z;exports.getStylesForBlocks=ee;
|
package/dist/render.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ChaiFontViaUrl } from '@chaibuilder/runtime';
|
|
2
|
-
import { ChaiPageProps } from '@chaibuilder/runtime';
|
|
3
1
|
import { JSX } from 'react/jsx-runtime';
|
|
4
2
|
|
|
5
|
-
export declare const applyChaiDataBinding: (block: Record<string, string>, pageExternalData: Record<string, any>) =>
|
|
3
|
+
export declare const applyChaiDataBinding: (block: Record<string, string>, pageExternalData: Record<string, any>) => Record<string, string>;
|
|
4
|
+
|
|
5
|
+
export declare const applyDesignTokens: (blocks: ChaiBlock[], designTokens: DesignTokens) => ChaiBlock[];
|
|
6
6
|
|
|
7
7
|
export declare function AsyncRenderChaiBlocks(props: RenderChaiBlocksProps): Promise<JSX.Element>;
|
|
8
8
|
|
|
@@ -10,11 +10,22 @@ declare type ChaiBlock<T = Record<string, any>> = {
|
|
|
10
10
|
_id: string;
|
|
11
11
|
_name?: string;
|
|
12
12
|
_parent?: string | null | undefined;
|
|
13
|
-
_bindings?: Record<string, string>;
|
|
14
13
|
_type: string;
|
|
15
14
|
_libBlock?: string;
|
|
16
15
|
} & T;
|
|
17
16
|
|
|
17
|
+
declare type ChaiFontViaUrl = {
|
|
18
|
+
family: string;
|
|
19
|
+
url: string;
|
|
20
|
+
fallback: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare interface ChaiPageProps {
|
|
24
|
+
slug: string;
|
|
25
|
+
searchParams?: Record<string, string>;
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}
|
|
28
|
+
|
|
18
29
|
declare type ChaiThemeValues = {
|
|
19
30
|
fontFamily: {
|
|
20
31
|
heading: string;
|
|
@@ -58,6 +69,13 @@ export declare const convertHTMLToChaiBlocks: (html: string) => ChaiBlock[];
|
|
|
58
69
|
*/
|
|
59
70
|
export declare const convertToBlocks: (chaiFormatContent: string) => ChaiBlock[];
|
|
60
71
|
|
|
72
|
+
declare interface DesignTokens {
|
|
73
|
+
[uniqueId: string]: {
|
|
74
|
+
name: string;
|
|
75
|
+
value: string;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
61
79
|
export declare const getChaiThemeCssVariables: (chaiTheme: ChaiThemeValues) => string;
|
|
62
80
|
|
|
63
81
|
export declare function getMergedPartialBlocks(blocks: ChaiBlock[], partials: Record<string, ChaiBlock[]>): ChaiBlock[];
|
|
@@ -70,9 +88,9 @@ export declare function getMergedPartialBlocks(blocks: ChaiBlock[], partials: Re
|
|
|
70
88
|
*/
|
|
71
89
|
export declare const getStylesForBlocks: (blocks: ChaiBlock[], includeBaseStyles?: boolean) => Promise<string>;
|
|
72
90
|
|
|
73
|
-
export declare const getThemeFontsCSSImport: (fonts: ChaiFontViaUrl[]) =>
|
|
91
|
+
export declare const getThemeFontsCSSImport: (fonts: ChaiFontViaUrl[]) => string;
|
|
74
92
|
|
|
75
|
-
export declare const getThemeFontsLinkMarkup: (fonts: ChaiFontViaUrl[]) =>
|
|
93
|
+
export declare const getThemeFontsLinkMarkup: (fonts: ChaiFontViaUrl[]) => string;
|
|
76
94
|
|
|
77
95
|
declare type HexColor = string;
|
|
78
96
|
|
|
@@ -89,12 +107,13 @@ declare type RenderChaiBlocksProps = {
|
|
|
89
107
|
pageProps?: ChaiPageProps;
|
|
90
108
|
draft?: boolean;
|
|
91
109
|
dataProviderMetadataCallback?: (block: ChaiBlock, meta: Record<string, any>) => void;
|
|
110
|
+
dataProviders?: Record<string, Promise<Record<string, any>>>;
|
|
92
111
|
};
|
|
93
112
|
|
|
94
113
|
declare type RenderChaiBlocksProps_2 = {
|
|
95
114
|
blocks: ChaiBlock[];
|
|
96
115
|
parent?: string;
|
|
97
|
-
externalData?: Record<string,
|
|
116
|
+
externalData?: Record<string, unknown>;
|
|
98
117
|
lang?: string;
|
|
99
118
|
fallbackLang?: string;
|
|
100
119
|
pageProps?: ChaiPageProps;
|
|
@@ -103,9 +122,3 @@ declare type RenderChaiBlocksProps_2 = {
|
|
|
103
122
|
};
|
|
104
123
|
|
|
105
124
|
export { }
|
|
106
|
-
|
|
107
|
-
declare global {
|
|
108
|
-
interface Window {
|
|
109
|
-
clarity: any;
|
|
110
|
-
}
|
|
111
|
-
}
|