@chaibuilder/pages 0.16.14 → 0.16.15
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/{2AITGKQY-B7xwscsX.js → 2AITGKQY-2rt9M99C.js} +5 -5
- package/dist/{2AITGKQY-B9AnRLq_.cjs → 2AITGKQY-Cs6RBSPQ.cjs} +1 -1
- package/dist/{NCMVHL6D-CRMC-wXy.cjs → NCMVHL6D-CsC6nsSQ.cjs} +1 -1
- package/dist/{NCMVHL6D-B1mwht0Q.js → NCMVHL6D-vUfYKc6i.js} +4 -4
- package/dist/{ZDWCUMSJ-BqqPEOij.cjs → ZDWCUMSJ-B2OZjsr6.cjs} +1 -1
- package/dist/{ZDWCUMSJ-CxKNtXtp.js → ZDWCUMSJ-CzEWKlEU.js} +1 -1
- package/dist/active-in-another-tab-B0N5S-Bh.js +34 -0
- package/dist/active-in-another-tab-BK3cZf-x.cjs +1 -0
- package/dist/{add-new-language-page-D2a6GK-7.cjs → add-new-language-page-Dt1j-8Zg.cjs} +1 -1
- package/dist/{add-new-language-page-DD0qvJJs.js → add-new-language-page-YlqcCdlK.js} +20 -20
- package/dist/{add-new-page-01GDCaa4.cjs → add-new-page-DqhQUQBz.cjs} +1 -1
- package/dist/{add-new-page-CYtuChN1.js → add-new-page-aYomeid4.js} +1 -1
- package/dist/{ai-panel-content-DfdnvlS8.js → ai-panel-content-C6cH9rrC.js} +2 -2
- package/dist/{ai-panel-content-Ouz6pu_0.cjs → ai-panel-content-MOZmNIKP.cjs} +1 -1
- package/dist/{ai-panel-default-lang-Bi2fH1so.js → ai-panel-default-lang-BZHkFsox.js} +3 -3
- package/dist/{ai-panel-default-lang-N1pb8rzQ.cjs → ai-panel-default-lang-DOk_Q0IO.cjs} +2 -2
- package/dist/{ai-panel-other-lang-2JPRSyO1.js → ai-panel-other-lang-D2A46FTg.js} +3 -3
- package/dist/{ai-panel-other-lang-BysU1464.cjs → ai-panel-other-lang-qHrdvAMa.cjs} +1 -1
- package/dist/{ai-prompt-input-JeIqWZco.cjs → ai-prompt-input-BZSjjNJd.cjs} +1 -1
- package/dist/{ai-prompt-input-DadL_cng.js → ai-prompt-input-C6gDvvLQ.js} +2 -2
- package/dist/{ai-translation-prompt-CQb1L7NM.cjs → ai-translation-prompt-BqXo2CLp.cjs} +1 -1
- package/dist/{ai-translation-prompt-B0si-R0R.js → ai-translation-prompt-DTR0wbGt.js} +1 -1
- package/dist/continue-editing-in-this-client-C3T6Jzhi.cjs +1 -0
- package/dist/continue-editing-in-this-client-D2S1yCOM.js +24 -0
- package/dist/delete-page-BF1k60U2.js +70 -0
- package/dist/delete-page-x0DWKzsR.cjs +1 -0
- package/dist/{digital-asset-manager-B5FQGtGY.cjs → digital-asset-manager-BmlFt2T_.cjs} +1 -1
- package/dist/{digital-asset-manager-jfnmWRJj.js → digital-asset-manager-C8udwDBW.js} +1 -1
- package/dist/{duplicate-page-BNjfZ7Wd.cjs → duplicate-page-Dt_QZkTk.cjs} +1 -1
- package/dist/{duplicate-page-CERjaPIW.js → duplicate-page-u_6vUVo1.js} +13 -13
- package/dist/{dynamic-page-selector-Bpz_bvRu.cjs → dynamic-page-selector-Cgs_Y_Kl.cjs} +1 -1
- package/dist/{dynamic-page-selector-XEWV4iCf.js → dynamic-page-selector-DxBHmglP.js} +1 -1
- package/dist/index-BeWL6Sj6.cjs +5 -0
- package/dist/index-DI2Rwk5v.js +4820 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -34
- package/dist/index.js +21 -22
- package/dist/{json-diff-viewer-H-2DkGza.cjs → json-diff-viewer-D2g0Yab2.cjs} +1 -1
- package/dist/{json-diff-viewer-DyvKomxd.js → json-diff-viewer-QdUwk7yF.js} +6 -6
- package/dist/{lang-panel-BWP5A-FD.js → lang-panel-B8OD0GiA.js} +24 -24
- package/dist/{lang-panel-DcZ7u4em.cjs → lang-panel-M2Zb01lF.cjs} +1 -1
- package/dist/{mark-as-template-1oVraE1x.js → mark-as-template-CJ1mlxYT.js} +7 -7
- package/dist/{mark-as-template-B_FyVRRO.cjs → mark-as-template-DONU52b1.cjs} +1 -1
- package/dist/{no-language-page-content-JO4YYUx7.cjs → no-language-page-content-DD9Ok2Ku.cjs} +1 -1
- package/dist/{no-language-page-content-CEci_4j7.js → no-language-page-content-Dtm37LTJ.js} +1 -1
- package/dist/no-language-page-dialog-D3dvenZ7.cjs +1 -0
- package/dist/no-language-page-dialog-Dj_z2_hF.js +10 -0
- package/dist/{page-creator-DJJFl7px.js → page-creator-DIMFISo4.js} +52 -52
- package/dist/{page-creator-BGgoOA92.cjs → page-creator-DTC66ujU.cjs} +1 -1
- package/dist/page-lock-CI6BYvF_.cjs +1 -0
- package/dist/page-lock-DUlNr3os.js +30 -0
- package/dist/page-locked-dialog-BKwULMV7.js +133 -0
- package/dist/page-locked-dialog-DorIbva0.cjs +1 -0
- package/dist/page-manager-new-lNVrLOJp.cjs +1 -0
- package/dist/page-manager-new-znvqI9_L.js +354 -0
- package/dist/{page-manager-search-and-filter-DbUoW8Di.js → page-manager-search-and-filter-C-_w7N27.js} +1 -1
- package/dist/{page-manager-search-and-filter-Dgh8iyGp.cjs → page-manager-search-and-filter-pe0q0qnZ.cjs} +1 -1
- package/dist/{page-revisions-content-CwoXXE53.cjs → page-revisions-content-Caaj5TEI.cjs} +1 -1
- package/dist/{page-revisions-content-CxEJGxLY.js → page-revisions-content-CyLjyxNU.js} +19 -19
- package/dist/pages.css +1 -1
- package/dist/{publish-pages-content-CfAlmivf.js → publish-pages-content-Bih1W9C4.js} +88 -88
- package/dist/publish-pages-content-D5beVcQI.cjs +1 -0
- package/dist/{save-to-lib-BCaBfh0I.js → save-to-lib-BwpkJcT2.js} +1 -1
- package/dist/{save-to-lib-DpyJA0y1.cjs → save-to-lib-DPAERsi4.cjs} +1 -1
- package/dist/{selected-block-display-BmNhvYKu.js → selected-block-display-GXSf3y2s.js} +1 -1
- package/dist/{selected-block-display-CqnwyGRp.cjs → selected-block-display-s99Y91qI.cjs} +1 -1
- package/dist/{seo-panel-BH8fcGqr.js → seo-panel-BurZA566.js} +61 -61
- package/dist/{seo-panel-D-nKfsRJ.cjs → seo-panel-BxUfalVy.cjs} +1 -1
- package/dist/{shared-json-ld-m_OsVv8h.cjs → shared-json-ld-BYAdrPeC.cjs} +1 -1
- package/dist/{shared-json-ld-zTDoJzUv.js → shared-json-ld-DHWdJvQd.js} +39 -39
- package/dist/{slug-input-vzNtu37S.cjs → slug-input-CR2B1kDJ.cjs} +1 -1
- package/dist/{slug-input-CumDDlCk.js → slug-input-Z_ny7bgX.js} +1 -1
- package/dist/take-over-request-CnEpToCM.cjs +1 -0
- package/dist/take-over-request-DF2JsIes.js +63 -0
- package/dist/{theme-panel-footer-CdUmjB-e.js → theme-panel-footer-5mxFeEua.js} +4 -4
- package/dist/{theme-panel-footer-CKccBcd9.cjs → theme-panel-footer-C2CjHoBu.cjs} +1 -1
- package/dist/{unmark-as-template-BNFOsxIg.cjs → unmark-as-template-Dn90g1eh.cjs} +1 -1
- package/dist/{unmark-as-template-6ew-7bf8.js → unmark-as-template-JRRUYTOY.js} +1 -1
- package/dist/{unpublish-page-BZQpTpU3.cjs → unpublish-page-C3C_rTRd.cjs} +1 -1
- package/dist/{unpublish-page-BomE76Wg.js → unpublish-page-FZ8rbi7u.js} +9 -9
- package/dist/{web-preview-jo8lnpEx.js → web-preview-CGBKG162.js} +1 -1
- package/dist/{web-preview-C5QTX7bS.cjs → web-preview-NdxC92Fk.cjs} +1 -1
- package/package.json +3 -3
- package/dist/delete-page-C8Nt7IYF.cjs +0 -1
- package/dist/delete-page-_96Di9yN.js +0 -40
- package/dist/index-Pdb5tSRL.cjs +0 -5
- package/dist/index-e9WlBH0R.js +0 -4960
- package/dist/page-lock-request-BoYzkcyt.cjs +0 -1
- package/dist/page-lock-request-WzpcD2ZN.js +0 -75
- package/dist/page-locked-by-dialog-Djvjp2Hx.js +0 -68
- package/dist/page-locked-by-dialog-bvI27OZ6.cjs +0 -1
- package/dist/page-manager-new-CMfGorRQ.cjs +0 -1
- package/dist/page-manager-new-DmVX0qLk.js +0 -354
- package/dist/publish-pages-content-BRu7qwAo.cjs +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as G } from "react/jsx-runtime";
|
|
2
2
|
import { useLanguages as me } from "@chaibuilder/sdk";
|
|
3
3
|
import { useQuery as he, useQueryClient as ue } from "@tanstack/react-query";
|
|
4
|
-
import {
|
|
5
|
-
import { Dialog as $, DialogContent as W, DialogHeader as Y, DialogTitle as X, Alert as we, AlertDescription as Ae, Label as y, Input as
|
|
6
|
-
import { filter as Je, find as
|
|
7
|
-
import { Info as
|
|
4
|
+
import { aq as ge, ar as fe, A as U, aw as te, aC as pe, aD as se, aE as re, aF as de, aG as xe, aH as Ne, aI as be, l as ye, aJ as ve } from "./index-DI2Rwk5v.js";
|
|
5
|
+
import { Dialog as $, DialogContent as W, DialogHeader as Y, DialogTitle as X, Alert as we, AlertDescription as Ae, Label as y, Input as j, Button as v, AlertDialog as _, AlertDialogContent as R, AlertDialogHeader as q, AlertDialogTitle as M, AlertDialogDescription as H, AlertDialogFooter as Q, AlertDialogCancel as V, AlertDialogAction as K, Tooltip as L, TooltipTrigger as J, TooltipContent as F, ScrollArea as Ce, Card as Se, CardHeader as Pe, CardTitle as Te, AlertDialogTrigger as De, CardContent as Ee, Textarea as Le } from "@chaibuilder/sdk/ui";
|
|
6
|
+
import { filter as Je, find as Fe } from "lodash-es";
|
|
7
|
+
import { Info as Oe, Loader as O, Plus as ke, Eye as Ge, Edit as je, Trash as Be } from "lucide-react";
|
|
8
8
|
import { useState as g, useEffect as Z, useMemo as z } from "react";
|
|
9
9
|
import { toast as B } from "sonner";
|
|
10
10
|
const oe = () => {
|
|
@@ -67,7 +67,7 @@ const oe = () => {
|
|
|
67
67
|
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(X, { children: "Add New Shared JSON-LD Schema" }) }),
|
|
68
68
|
/* @__PURE__ */ n("div", { className: "flex max-h-[75vh] flex-col space-y-2 overflow-y-auto", children: [
|
|
69
69
|
(a == null ? void 0 : a.languageCode) && /* @__PURE__ */ n(we, { className: "border-blue-200 bg-blue-50", children: [
|
|
70
|
-
/* @__PURE__ */ e(
|
|
70
|
+
/* @__PURE__ */ e(Oe, { className: "h-4 w-4 text-blue-600" }),
|
|
71
71
|
/* @__PURE__ */ n(Ae, { className: "text-sm text-blue-800", children: [
|
|
72
72
|
"You are creating a ",
|
|
73
73
|
/* @__PURE__ */ e("span", { className: "font-semibold", children: a.languageCode }),
|
|
@@ -77,7 +77,7 @@ const oe = () => {
|
|
|
77
77
|
/* @__PURE__ */ n("div", { children: [
|
|
78
78
|
/* @__PURE__ */ e(y, { htmlFor: "new-name", children: "Schema Name" }),
|
|
79
79
|
/* @__PURE__ */ e(
|
|
80
|
-
|
|
80
|
+
j,
|
|
81
81
|
{
|
|
82
82
|
id: "new-name",
|
|
83
83
|
value: d.name,
|
|
@@ -90,7 +90,7 @@ const oe = () => {
|
|
|
90
90
|
/* @__PURE__ */ n("div", { children: [
|
|
91
91
|
/* @__PURE__ */ e(y, { htmlFor: "new-description", children: "Description" }),
|
|
92
92
|
/* @__PURE__ */ e(
|
|
93
|
-
|
|
93
|
+
j,
|
|
94
94
|
{
|
|
95
95
|
id: "new-description",
|
|
96
96
|
value: d.description || "",
|
|
@@ -148,10 +148,10 @@ const oe = () => {
|
|
|
148
148
|
] }),
|
|
149
149
|
/* @__PURE__ */ e("div", { className: "border-t pt-3", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2", children: [
|
|
150
150
|
/* @__PURE__ */ e(v, { disabled: p, variant: "outline", type: "button", size: "sm", onClick: () => i(), children: "Cancel" }),
|
|
151
|
-
/* @__PURE__ */ e(v, { disabled: p, type: "button", size: "sm", onClick: o, children: p ? /* @__PURE__ */ n(
|
|
152
|
-
/* @__PURE__ */ e(
|
|
151
|
+
/* @__PURE__ */ e(v, { disabled: p, type: "button", size: "sm", onClick: o, children: p ? /* @__PURE__ */ n(G, { children: [
|
|
152
|
+
/* @__PURE__ */ e(O, { className: "h-4 w-4 animate-spin" }),
|
|
153
153
|
" Adding"
|
|
154
|
-
] }) : /* @__PURE__ */ n(
|
|
154
|
+
] }) : /* @__PURE__ */ n(G, { children: [
|
|
155
155
|
"Add Schema",
|
|
156
156
|
(a == null ? void 0 : a.languageCode) && ` (${a.languageCode})`
|
|
157
157
|
] }) })
|
|
@@ -168,7 +168,7 @@ const oe = () => {
|
|
|
168
168
|
Z(() => {
|
|
169
169
|
var m, D;
|
|
170
170
|
if (l && c) {
|
|
171
|
-
const b = c.find((
|
|
171
|
+
const b = c.find((E) => E.id === l);
|
|
172
172
|
b && (d({
|
|
173
173
|
name: b.name,
|
|
174
174
|
description: ((m = b.metadata) == null ? void 0 : m.description) || "",
|
|
@@ -224,7 +224,7 @@ const oe = () => {
|
|
|
224
224
|
/* @__PURE__ */ n("div", { children: [
|
|
225
225
|
/* @__PURE__ */ e(y, { htmlFor: "edit-name", children: "Schema Name" }),
|
|
226
226
|
/* @__PURE__ */ e(
|
|
227
|
-
|
|
227
|
+
j,
|
|
228
228
|
{
|
|
229
229
|
id: "edit-name",
|
|
230
230
|
value: a.name,
|
|
@@ -237,7 +237,7 @@ const oe = () => {
|
|
|
237
237
|
/* @__PURE__ */ n("div", { children: [
|
|
238
238
|
/* @__PURE__ */ e(y, { htmlFor: "edit-description", children: "Description" }),
|
|
239
239
|
/* @__PURE__ */ e(
|
|
240
|
-
|
|
240
|
+
j,
|
|
241
241
|
{
|
|
242
242
|
id: "edit-description",
|
|
243
243
|
value: a.description || "",
|
|
@@ -277,8 +277,8 @@ const oe = () => {
|
|
|
277
277
|
] }),
|
|
278
278
|
/* @__PURE__ */ e("div", { className: "border-t pt-3", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2", children: [
|
|
279
279
|
/* @__PURE__ */ e(v, { disabled: o, variant: "outline", type: "button", size: "sm", onClick: () => i(), children: "Cancel" }),
|
|
280
|
-
/* @__PURE__ */ e(v, { disabled: o, type: "button", size: "sm", onClick: A, children: o ? /* @__PURE__ */ n(
|
|
281
|
-
/* @__PURE__ */ e(
|
|
280
|
+
/* @__PURE__ */ e(v, { disabled: o, type: "button", size: "sm", onClick: A, children: o ? /* @__PURE__ */ n(G, { children: [
|
|
281
|
+
/* @__PURE__ */ e(O, { className: "h-4 w-4 animate-spin" }),
|
|
282
282
|
" Updating"
|
|
283
283
|
] }) : "Update Schema" })
|
|
284
284
|
] }) })
|
|
@@ -315,7 +315,7 @@ const oe = () => {
|
|
|
315
315
|
};
|
|
316
316
|
function Xe() {
|
|
317
317
|
const [l, i] = g(!1), [a, d] = g(void 0), [f, x] = g(null), [P, u] = g(null), [C, p] = g(null), { data: c, isLoading: w } = oe(), { selectedLang: o } = me(), { data: t } = te(), { data: N } = ye(), { mutateAsync: A } = ve(), { mutateAsync: I } = se(), T = z(() => N == null ? void 0 : N.find((s) => !s.primaryPage && s.lang === ""), [N]), m = z(() => (T == null ? void 0 : T.globalJsonLds) || [], [T]), D = z(() => c ? Je(c, (r) => r.primaryPage === null && r.lang === "").map((r) => {
|
|
318
|
-
const h = o ?
|
|
318
|
+
const h = o ? Fe(c, (S) => S.primaryPage === r.id && S.lang === o) : null;
|
|
319
319
|
return {
|
|
320
320
|
defaultSchema: r,
|
|
321
321
|
languageVersion: h,
|
|
@@ -323,15 +323,15 @@ function Xe() {
|
|
|
323
323
|
displayItem: h || r,
|
|
324
324
|
hasLanguageVersion: !!h
|
|
325
325
|
};
|
|
326
|
-
}) : [], [c, o]), [b,
|
|
326
|
+
}) : [], [c, o]), [b, E] = g([]), k = b.length > 0 ? b : (t == null ? void 0 : t.globalJsonLds) || [];
|
|
327
327
|
Z(() => {
|
|
328
|
-
t != null && t.globalJsonLds &&
|
|
328
|
+
t != null && t.globalJsonLds && E(t.globalJsonLds);
|
|
329
329
|
}, [t == null ? void 0 : t.globalJsonLds]);
|
|
330
330
|
const ie = async (s) => {
|
|
331
331
|
if (!(t != null && t.id)) return;
|
|
332
332
|
p(s);
|
|
333
333
|
const r = k.includes(s), h = r ? k.filter((S) => S !== s) : [...k, s];
|
|
334
|
-
|
|
334
|
+
E(h);
|
|
335
335
|
try {
|
|
336
336
|
await I({
|
|
337
337
|
schemaId: s,
|
|
@@ -339,7 +339,7 @@ function Xe() {
|
|
|
339
339
|
enabled: !r
|
|
340
340
|
});
|
|
341
341
|
} catch {
|
|
342
|
-
|
|
342
|
+
E(t.globalJsonLds);
|
|
343
343
|
} finally {
|
|
344
344
|
p(null);
|
|
345
345
|
}
|
|
@@ -357,7 +357,7 @@ function Xe() {
|
|
|
357
357
|
/* @__PURE__ */ e("div", { className: "text-xs font-medium", children: "Shared JSON-LD Templates" }),
|
|
358
358
|
/* @__PURE__ */ e("div", { className: "w-full text-xs text-gray-500", children: "Manage reusable JSON-LD schemas that can be applied across multiple pages" })
|
|
359
359
|
] }),
|
|
360
|
-
!o && /* @__PURE__ */ n(
|
|
360
|
+
!o && /* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
361
361
|
/* @__PURE__ */ e(
|
|
362
362
|
J,
|
|
363
363
|
{
|
|
@@ -367,10 +367,10 @@ function Xe() {
|
|
|
367
367
|
onClick: (s) => {
|
|
368
368
|
s.stopPropagation(), i(!0);
|
|
369
369
|
},
|
|
370
|
-
children: w ? /* @__PURE__ */ e(
|
|
370
|
+
children: w ? /* @__PURE__ */ e(O, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-4 w-4" })
|
|
371
371
|
}
|
|
372
372
|
),
|
|
373
|
-
/* @__PURE__ */ e(
|
|
373
|
+
/* @__PURE__ */ e(F, { children: "Add new schema" })
|
|
374
374
|
] })
|
|
375
375
|
] }),
|
|
376
376
|
/* @__PURE__ */ n(Ce, { className: "max-h-96 overflow-y-auto", children: [
|
|
@@ -384,10 +384,10 @@ function Xe() {
|
|
|
384
384
|
{
|
|
385
385
|
className: `relative border-gray-300 p-0 shadow-none transition-all ${C === r.id ? "pointer-events-none" : ""}`,
|
|
386
386
|
children: [
|
|
387
|
-
C === r.id && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 flex items-center justify-center rounded-xl bg-white/80", children: /* @__PURE__ */ e(
|
|
387
|
+
C === r.id && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 flex items-center justify-center rounded-xl bg-white/80", children: /* @__PURE__ */ e(O, { className: "h-5 w-5 animate-spin text-primary" }) }),
|
|
388
388
|
/* @__PURE__ */ e(Pe, { className: "p-2", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
389
389
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
390
|
-
(h || !o) && /* @__PURE__ */ n(
|
|
390
|
+
(h || !o) && /* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
391
391
|
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(
|
|
392
392
|
"input",
|
|
393
393
|
{
|
|
@@ -398,7 +398,7 @@ function Xe() {
|
|
|
398
398
|
className: "h-5 w-5 cursor-pointer rounded focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1"
|
|
399
399
|
}
|
|
400
400
|
) }),
|
|
401
|
-
h && o && /* @__PURE__ */ e(
|
|
401
|
+
h && o && /* @__PURE__ */ e(F, { children: "Using the default language state" })
|
|
402
402
|
] }),
|
|
403
403
|
/* @__PURE__ */ n("div", { children: [
|
|
404
404
|
/* @__PURE__ */ n(Te, { className: "flex items-center gap-2 text-sm leading-none", children: [
|
|
@@ -415,7 +415,7 @@ function Xe() {
|
|
|
415
415
|
] }),
|
|
416
416
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
417
417
|
/* @__PURE__ */ e("div", { className: "mx-2 h-6 w-px bg-border" }),
|
|
418
|
-
/* @__PURE__ */ n(
|
|
418
|
+
/* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
419
419
|
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(
|
|
420
420
|
v,
|
|
421
421
|
{
|
|
@@ -424,13 +424,13 @@ function Xe() {
|
|
|
424
424
|
size: "icon",
|
|
425
425
|
className: "h-5 w-5 p-0",
|
|
426
426
|
onClick: () => u(r.id),
|
|
427
|
-
children: /* @__PURE__ */ e(
|
|
427
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-4 w-4" })
|
|
428
428
|
}
|
|
429
429
|
) }),
|
|
430
|
-
/* @__PURE__ */ e(
|
|
430
|
+
/* @__PURE__ */ e(F, { children: "View schema" })
|
|
431
431
|
] }),
|
|
432
|
-
(h || !o) && /* @__PURE__ */ n(
|
|
433
|
-
/* @__PURE__ */ n(
|
|
432
|
+
(h || !o) && /* @__PURE__ */ n(G, { children: [
|
|
433
|
+
/* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
434
434
|
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(
|
|
435
435
|
v,
|
|
436
436
|
{
|
|
@@ -439,15 +439,15 @@ function Xe() {
|
|
|
439
439
|
size: "icon",
|
|
440
440
|
className: "h-5 w-5 p-0",
|
|
441
441
|
onClick: () => x(r.id),
|
|
442
|
-
children: /* @__PURE__ */ e(
|
|
442
|
+
children: /* @__PURE__ */ e(je, { className: "h-4 w-4" })
|
|
443
443
|
}
|
|
444
444
|
) }),
|
|
445
|
-
/* @__PURE__ */ e(
|
|
445
|
+
/* @__PURE__ */ e(F, { children: "Edit schema" })
|
|
446
446
|
] }),
|
|
447
447
|
/* @__PURE__ */ n(_, { children: [
|
|
448
|
-
/* @__PURE__ */ n(
|
|
448
|
+
/* @__PURE__ */ n(L, { delayDuration: 0, children: [
|
|
449
449
|
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(De, { className: "flex h-5 w-5 items-center justify-center rounded-md text-red-500 hover:bg-red-100 hover:text-red-800", children: /* @__PURE__ */ e(Be, { className: "h-4 w-4" }) }) }),
|
|
450
|
-
/* @__PURE__ */ e(
|
|
450
|
+
/* @__PURE__ */ e(F, { children: "Delete schema" })
|
|
451
451
|
] }),
|
|
452
452
|
/* @__PURE__ */ n(R, { children: [
|
|
453
453
|
/* @__PURE__ */ n(q, { children: [
|
|
@@ -476,7 +476,7 @@ function Xe() {
|
|
|
476
476
|
] })
|
|
477
477
|
] })
|
|
478
478
|
] }) }),
|
|
479
|
-
!h && o && /* @__PURE__ */ e(
|
|
479
|
+
!h && o && /* @__PURE__ */ e(Ee, { className: "px-2 pb-2", children: /* @__PURE__ */ n("div", { className: "flex w-full flex-col items-center justify-center rounded-lg border bg-gray-100 py-3", children: [
|
|
480
480
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
481
481
|
/* @__PURE__ */ n("div", { className: "max-w-xl text-center text-xs text-gray-500", children: [
|
|
482
482
|
"Not available in '",
|
|
@@ -511,7 +511,7 @@ function Xe() {
|
|
|
511
511
|
);
|
|
512
512
|
})
|
|
513
513
|
] }),
|
|
514
|
-
w && /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ e(
|
|
514
|
+
w && /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ e(O, { className: "h-5 w-5 animate-spin" }) })
|
|
515
515
|
] }),
|
|
516
516
|
/* @__PURE__ */ e(
|
|
517
517
|
Ie,
|
|
@@ -550,7 +550,7 @@ const Re = ({ schema: l, onClose: i }) => /* @__PURE__ */ e($, { open: !!l, onOp
|
|
|
550
550
|
/* @__PURE__ */ n("div", { children: [
|
|
551
551
|
/* @__PURE__ */ e("div", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "JSON-LD Schema" }),
|
|
552
552
|
/* @__PURE__ */ e(
|
|
553
|
-
|
|
553
|
+
Le,
|
|
554
554
|
{
|
|
555
555
|
value: JSON.stringify(l == null ? void 0 : l.jsonld, null, 2),
|
|
556
556
|
readOnly: !0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),u=require("./index-
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),u=require("./index-BeWL6Sj6.cjs"),b=require("@chaibuilder/sdk/ui"),d=require("react"),j=e=>{if(!e)return{base:e,extension:null};const n=e.lastIndexOf(".");if(n<=0)return{base:e,extension:null};const t=e.substring(n);return{base:e.substring(0,n),extension:t}},x=e=>{if(!e)return e;const{base:n}=j(e);return n};function E(e,n){const t=(e||"").split("/").filter(Boolean);let r="",a=!0;if(n.slug==="/"){const i=t.pop()||"";if(u.LANGUAGES[i])a=!0;else{r=i;const l=t.pop()||"";a=!!u.LANGUAGES[l]}}else if(n.parent)t.length&&(r=t.pop()||"");else if(t.length){r=t.pop()||"";const i=t.pop()||"";a=!!u.LANGUAGES[i]}return{initSlug:r,prefix:a}}const v=e=>e&&x(e),C=(e,n)=>{const t=x(e||"");return!t||t==="/"?`/${n}`:`${t}/${n}`};function A({value:e,onChange:n,placeholder:t,parentSlug:r,onValidationChange:a,disabled:i=!1,fullSlug:l}){const[g,p]=d.useState(e),[o,f]=d.useState(null);d.useEffect(()=>{p(e)},[e]);const h=S=>{const c=S.target.value.replace(/\//g,"").replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-_.]/g,"-").replace(/-+/g,"-").replace(/^-+/,"").toLowerCase(),m=(c.match(/\./g)||[]).length,N=m<=1;m>1?f("Invalid slug. Only one dot (.) is allowed in the slug"):f(null),a&&a(N),p(c),n(c)};return s.jsxs("div",{children:[r&&s.jsx("div",{className:"mb-1 flex items-center",children:s.jsxs("span",{className:"text-xs text-gray-500",children:["Parent: ",s.jsx("span",{className:"font-mono text-gray-900",children:v(r)})]})}),s.jsxs("div",{className:"relative",children:[s.jsx(b.Input,{disabled:i,value:g,onChange:h,placeholder:t,className:o?"border-red-500":""}),o&&s.jsx("div",{className:"mt-1 text-xs text-red-500",children:o})]}),l&&l!=="undefined"&&s.jsx("div",{className:"mt-1 flex items-center",children:s.jsxs("span",{className:"text-xs text-gray-500",children:["Complete Slug: ",s.jsx("span",{className:"font-mono text-gray-900",children:l})]})})]})}exports.SlugInput=A;exports.combineParentChildSlugs=C;exports.parseSlugForEdit=E;exports.removeSlugExtension=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { L as d } from "./index-
|
|
2
|
+
import { L as d } from "./index-DI2Rwk5v.js";
|
|
3
3
|
import { Input as v } from "@chaibuilder/sdk/ui";
|
|
4
4
|
import { useState as x, useEffect as C } from "react";
|
|
5
5
|
const y = (e) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-BeWL6Sj6.cjs"),m=require("@chaibuilder/sdk"),a=require("@chaibuilder/sdk/ui"),l=require("lucide-react"),j=require("react"),p=()=>{const i=t.useSendRealtimeEvent(),{pageLockMeta:r}=t.usePageLockMeta(),{setPageStatus:d}=t.usePageLockStatus(),{savePageAsync:x}=m.useSavePage(),h=r==null?void 0:r.requestingUserId,{data:s,isFetching:g}=t.useChaiUserInfo(h||""),o=g?"Fetching user...":(s==null?void 0:s.name)||"Current editor",[u,c]=j.useState(!1),N=async()=>{c(!0),await x(),i(t.EVENT.CONTINUE_EDITING_IN_THIS_CLIENT,r),d(t.PAGE_STATUS.CHECKING),setTimeout(()=>c(!1),2e3)},f=()=>{c(!0),i(t.EVENT.TAKE_OVER_REJECTED,r),d(t.PAGE_STATUS.EDITING),setTimeout(()=>c(!1),2e3)},{t:n}=m.useTranslation();return e.jsx(t.BlurContainer,{children:e.jsxs(a.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(a.CardHeader,{className:"space-y-1",children:e.jsxs(a.CardTitle,{className:"flex items-center gap-2 text-xl",children:[e.jsx(l.AlertCircle,{className:"h-8 w-8 rounded-md bg-amber-500/20 p-1.5 text-amber-500"}),n("Take Over Requested")]})}),e.jsxs(a.CardContent,{className:"space-y-4",children:[e.jsxs("div",{className:"relative rounded-md border border-green-500 px-2 pb-2 pt-4",children:[e.jsx("div",{className:"absolute -top-2.5 left-3 w-max rounded-full bg-green-500 px-3 py-1 text-xs font-medium leading-3 text-white",children:"Requested by"}),e.jsxs("div",{className:"flex items-center space-x-4 p-1",children:[s!=null&&s.avatar?e.jsx("img",{src:s.avatar,alt:s.name,className:"h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white"}):e.jsx(l.UserIcon,{className:"h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white"}),e.jsxs("div",{className:"flex-1 space-y-0",children:[e.jsx("div",{className:"truncate font-medium leading-tight text-black",children:o}),(s==null?void 0:s.email)&&e.jsx("p",{className:"truncate text-sm leading-tight text-muted-foreground",children:s.email})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-gray-700",children:o})," ",n("has requested to")," ",e.jsx("span",{className:"font-medium text-gray-500",children:"take over"})," ",n("editing this page."),"."," ",n("Do you want to allow them to continue?")]})]}),e.jsxs(a.CardFooter,{className:"flex gap-2",children:[e.jsxs(a.Button,{disabled:u,variant:"default",onClick:N,className:"flex-1 gap-2",children:[e.jsx(l.Check,{className:"h-4 w-4"}),n("Accept")]}),e.jsxs(a.Button,{disabled:u,variant:"outline",onClick:f,className:"flex-1 gap-2",children:[e.jsx(l.X,{className:"h-4 w-4"}),n("Reject")]})]})]})})};exports.default=p;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { an as N, b as C, a as b, ao as v, B as E, E as d, P as m } from "./index-DI2Rwk5v.js";
|
|
3
|
+
import { useSavePage as T, useTranslation as w } from "@chaibuilder/sdk";
|
|
4
|
+
import { Card as I, CardHeader as k, CardTitle as y, CardContent as R, CardFooter as S, Button as u } from "@chaibuilder/sdk/ui";
|
|
5
|
+
import { AlertCircle as A, UserIcon as P, Check as _, X as q } from "lucide-react";
|
|
6
|
+
import { useState as U } from "react";
|
|
7
|
+
const H = () => {
|
|
8
|
+
const l = N(), { pageLockMeta: r } = C(), { setPageStatus: c } = b(), { savePageAsync: h } = T(), x = r == null ? void 0 : r.requestingUserId, { data: e, isFetching: f } = v(x || ""), i = f ? "Fetching user..." : (e == null ? void 0 : e.name) || "Current editor", [o, n] = U(!1), p = async () => {
|
|
9
|
+
n(!0), await h(), l(d.CONTINUE_EDITING_IN_THIS_CLIENT, r), c(m.CHECKING), setTimeout(() => n(!1), 2e3);
|
|
10
|
+
}, g = () => {
|
|
11
|
+
n(!0), l(d.TAKE_OVER_REJECTED, r), c(m.EDITING), setTimeout(() => n(!1), 2e3);
|
|
12
|
+
}, { t: s } = w();
|
|
13
|
+
return /* @__PURE__ */ t(E, { children: /* @__PURE__ */ a(I, { className: "mx-auto w-full max-w-md", children: [
|
|
14
|
+
/* @__PURE__ */ t(k, { className: "space-y-1", children: /* @__PURE__ */ a(y, { className: "flex items-center gap-2 text-xl", children: [
|
|
15
|
+
/* @__PURE__ */ t(A, { className: "h-8 w-8 rounded-md bg-amber-500/20 p-1.5 text-amber-500" }),
|
|
16
|
+
s("Take Over Requested")
|
|
17
|
+
] }) }),
|
|
18
|
+
/* @__PURE__ */ a(R, { className: "space-y-4", children: [
|
|
19
|
+
/* @__PURE__ */ a("div", { className: "relative rounded-md border border-green-500 px-2 pb-2 pt-4", children: [
|
|
20
|
+
/* @__PURE__ */ t("div", { className: "absolute -top-2.5 left-3 w-max rounded-full bg-green-500 px-3 py-1 text-xs font-medium leading-3 text-white", children: "Requested by" }),
|
|
21
|
+
/* @__PURE__ */ a("div", { className: "flex items-center space-x-4 p-1", children: [
|
|
22
|
+
e != null && e.avatar ? /* @__PURE__ */ t(
|
|
23
|
+
"img",
|
|
24
|
+
{
|
|
25
|
+
src: e.avatar,
|
|
26
|
+
alt: e.name,
|
|
27
|
+
className: "h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white"
|
|
28
|
+
}
|
|
29
|
+
) : /* @__PURE__ */ t(P, { className: "h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white" }),
|
|
30
|
+
/* @__PURE__ */ a("div", { className: "flex-1 space-y-0", children: [
|
|
31
|
+
/* @__PURE__ */ t("div", { className: "truncate font-medium leading-tight text-black", children: i }),
|
|
32
|
+
(e == null ? void 0 : e.email) && /* @__PURE__ */ t("p", { className: "truncate text-sm leading-tight text-muted-foreground", children: e.email })
|
|
33
|
+
] })
|
|
34
|
+
] })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ a("p", { className: "text-sm text-muted-foreground", children: [
|
|
37
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-gray-700", children: i }),
|
|
38
|
+
" ",
|
|
39
|
+
s("has requested to"),
|
|
40
|
+
" ",
|
|
41
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-gray-500", children: "take over" }),
|
|
42
|
+
" ",
|
|
43
|
+
s("editing this page."),
|
|
44
|
+
".",
|
|
45
|
+
" ",
|
|
46
|
+
s("Do you want to allow them to continue?")
|
|
47
|
+
] })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ a(S, { className: "flex gap-2", children: [
|
|
50
|
+
/* @__PURE__ */ a(u, { disabled: o, variant: "default", onClick: p, className: "flex-1 gap-2", children: [
|
|
51
|
+
/* @__PURE__ */ t(_, { className: "h-4 w-4" }),
|
|
52
|
+
s("Accept")
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ a(u, { disabled: o, variant: "outline", onClick: g, className: "flex-1 gap-2", children: [
|
|
55
|
+
/* @__PURE__ */ t(q, { className: "h-4 w-4" }),
|
|
56
|
+
s("Reject")
|
|
57
|
+
] })
|
|
58
|
+
] })
|
|
59
|
+
] }) });
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
H as default
|
|
63
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useTheme as b, useTranslation as
|
|
2
|
+
import { e as d, f as h, t as u } from "./index-DI2Rwk5v.js";
|
|
3
|
+
import { useTheme as b, useTranslation as f } from "@chaibuilder/sdk";
|
|
4
4
|
import { Button as o } from "@chaibuilder/sdk/ui";
|
|
5
5
|
const x = () => {
|
|
6
|
-
const [e] = b(), { mutate: r, isPending: s } =
|
|
6
|
+
const [e] = b(), { mutate: r, isPending: s } = d(), { mutateAsync: t, isPending: i } = h(), { t: n } = f(), l = () => {
|
|
7
7
|
t({ settings: { theme: e } });
|
|
8
8
|
}, m = async () => {
|
|
9
9
|
await t({ settings: { theme: e } }), r(
|
|
10
10
|
{ ids: ["THEME"] },
|
|
11
11
|
{
|
|
12
12
|
onSuccess: () => {
|
|
13
|
-
|
|
13
|
+
u("BOTTOM_RIGHT");
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-BeWL6Sj6.cjs"),o=require("@chaibuilder/sdk"),r=require("@chaibuilder/sdk/ui"),h=()=>{const[t]=o.useTheme(),{mutate:c,isPending:i}=s.usePublishPages(),{mutateAsync:n,isPending:u}=s.useUpdateWebsiteSettings(),{t:a}=o.useTranslation(),l=()=>{n({settings:{theme:t}})},d=async()=>{await n({settings:{theme:t}}),c({ids:["THEME"]},{onSuccess:()=>{s.throwConfetti("BOTTOM_RIGHT")}})};return e.jsxs("div",{className:"flex items-center justify-center gap-x-3 border-t bg-white py-3",children:[e.jsx(r.Button,{size:"sm",variant:"outline",disabled:i||u,onClick:l,children:a("Save draft")}),e.jsx(r.Button,{size:"sm",disabled:i||u,onClick:d,children:a("Publish")})]})};exports.default=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./index-BeWL6Sj6.cjs"),d=require("@chaibuilder/sdk"),t=require("@chaibuilder/sdk/ui"),m=require("react"),p=({page:i,onClose:n})=>{const{t:a}=d.useTranslation(),[r,s]=m.useState(!1),o=u.useUnmarkAsTemplate(),l=()=>{s(!0),o.mutate(i,{onSuccess:()=>{s(!1),n()},onError:()=>{s(!1)}})};return e.jsx(t.Dialog,{open:!0,onOpenChange:n,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:a("Unmark as template")}),e.jsx(t.DialogDescription,{className:"space-y-1 py-4 text-xs text-slate-500",children:a("Are you sure you want to unmark this page as a template?")})]}),e.jsxs(t.DialogFooter,{className:r?"pointer-events-none opacity-75":"",children:[e.jsx(t.Button,{variant:"outline",onClick:c=>{c.stopPropagation(),n()},children:a("Cancel")}),e.jsx(t.Button,{variant:"default",disabled:r,onClick:l,children:a("Unmark as template")})]})]})})};exports.default=p;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { s as p } from "./index-DI2Rwk5v.js";
|
|
3
3
|
import { useTranslation as u } from "@chaibuilder/sdk";
|
|
4
4
|
import { Dialog as d, DialogContent as g, DialogHeader as h, DialogTitle as f, DialogDescription as k, DialogFooter as D, Button as s } from "@chaibuilder/sdk/ui";
|
|
5
5
|
import { useState as x } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("./index-BeWL6Sj6.cjs"),c=require("@chaibuilder/sdk"),s=require("@chaibuilder/sdk/ui"),d=({page:i,onClose:t})=>{const{t:e}=c.useTranslation(),{mutate:r,isPending:l}=u.useUnpublishPage(),o=async()=>{r(i,{onSuccess:t})};return n.jsx(s.Dialog,{open:!!i,onOpenChange:t,children:n.jsxs(s.DialogContent,{children:[n.jsxs(s.DialogHeader,{children:[n.jsx(s.DialogTitle,{children:e("Confirm action")}),n.jsxs(s.DialogDescription,{children:[e("Are you sure you want to unpublish")," ",n.jsx("b",{children:(i==null?void 0:i.name)??(i==null?void 0:i.slug)}),"?"]})]}),n.jsxs(s.DialogFooter,{children:[n.jsx(s.Button,{variant:"outline",onClick:t,children:e("Cancel")}),n.jsx(s.Button,{variant:"destructive",disabled:l,onClick:o,children:e(l?"Updating...":"Unpublish")})]})]})})};exports.default=d;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as o, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { o as u } from "./index-DI2Rwk5v.js";
|
|
3
3
|
import { useTranslation as a } from "@chaibuilder/sdk";
|
|
4
4
|
import { Dialog as h, DialogContent as d, DialogHeader as m, DialogTitle as b, DialogDescription as D, DialogFooter as f, Button as s } from "@chaibuilder/sdk/ui";
|
|
5
|
-
const g = ({ page: n, onClose:
|
|
5
|
+
const g = ({ page: n, onClose: l }) => {
|
|
6
6
|
const { t: i } = a(), { mutate: e, isPending: r } = u(), c = async () => {
|
|
7
|
-
e(n, { onSuccess:
|
|
7
|
+
e(n, { onSuccess: l });
|
|
8
8
|
};
|
|
9
|
-
return /* @__PURE__ */ o(h, { open: !!n, onOpenChange:
|
|
10
|
-
/* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ o(h, { open: !!n, onOpenChange: l, children: /* @__PURE__ */ t(d, { children: [
|
|
10
|
+
/* @__PURE__ */ t(m, { children: [
|
|
11
11
|
/* @__PURE__ */ o(b, { children: i("Confirm action") }),
|
|
12
|
-
/* @__PURE__ */
|
|
12
|
+
/* @__PURE__ */ t(D, { children: [
|
|
13
13
|
i("Are you sure you want to unpublish"),
|
|
14
14
|
" ",
|
|
15
15
|
/* @__PURE__ */ o("b", { children: (n == null ? void 0 : n.name) ?? (n == null ? void 0 : n.slug) }),
|
|
16
16
|
"?"
|
|
17
17
|
] })
|
|
18
18
|
] }),
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */ o(s, { variant: "outline", onClick:
|
|
19
|
+
/* @__PURE__ */ t(f, { children: [
|
|
20
|
+
/* @__PURE__ */ o(s, { variant: "outline", onClick: l, children: i("Cancel") }),
|
|
21
21
|
/* @__PURE__ */ o(s, { variant: "destructive", disabled: r, onClick: c, children: i(r ? "Updating..." : "Unpublish") })
|
|
22
22
|
] })
|
|
23
23
|
] }) });
|
|
@@ -4,7 +4,7 @@ import { Button as s } from "@chaibuilder/sdk/ui";
|
|
|
4
4
|
import { useAtom as h } from "jotai";
|
|
5
5
|
import { map as p } from "lodash-es";
|
|
6
6
|
import { Smartphone as w, Tablet as f, Laptop as u, LaptopMinimal as x } from "lucide-react";
|
|
7
|
-
import { p as v, T as _ } from "./index-
|
|
7
|
+
import { p as v, T as _ } from "./index-DI2Rwk5v.js";
|
|
8
8
|
const b = [
|
|
9
9
|
{
|
|
10
10
|
title: "mobile_xs_title",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),a=require("@chaibuilder/sdk/ui"),h=require("jotai"),x=require("lodash-es"),n=require("lucide-react"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),a=require("@chaibuilder/sdk/ui"),h=require("jotai"),x=require("lodash-es"),n=require("lucide-react"),c=require("./index-BeWL6Sj6.cjs"),m=[{title:"mobile_xs_title",content:"mobile_xs_content",icon:e.jsx(n.Smartphone,{className:"h-4 w-4"}),width:400},{title:"tablet_md_title",content:"tablet_md_content",icon:e.jsx(n.Tablet,{className:"h-4 w-4"}),width:800},{title:"desktop_xl_title",content:"desktop_xl_content",icon:e.jsx(n.Laptop,{className:"h-4 w-4"}),width:1200},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",icon:e.jsx(n.LaptopMinimal,{className:"h-4 w-4"}),width:1600}],w=({currentWidth:t,width:s,icon:l,setIframeWidth:i})=>e.jsx(a.Button,{className:"px-3 py-3",onClick:()=>i(s),variant:s===t?"default":"ghost",children:l}),p=()=>{const[t,s]=o.useState(1200),l=r=>s(r),[i,d]=h.useAtom(c.previewUrlAtom);if(!i)return null;const u=()=>{d("")};return e.jsxs("div",{className:"absolute inset-0 z-[999999] flex h-screen w-screen flex-col overflow-hidden bg-gray-100",children:[e.jsxs("div",{className:"flex h-[50px] items-center justify-center border-b border-gray-200 px-4 shadow-sm",children:[e.jsx("div",{className:"flex items-center justify-center rounded-md border border-gray-300",children:x.map(m,r=>o.createElement(w,{...r,setIframeWidth:l,key:r.title,currentWidth:t}))})," ",e.jsx(c.Tooltip,{content:"Exit Preview",delayDuration:0,children:e.jsx(a.Button,{variant:"destructive",size:"sm",onClick:u,children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:"currentColor",fillRule:"evenodd","clip-rule":"evenodd"})})})})]}),e.jsx("iframe",{style:{width:`${t}px`,transition:"width 0.3s ease-in-out"},className:"no-scrollbar mx-auto h-full overflow-y-auto border bg-white",src:i})]})};exports.default=p;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "Suraj Air",
|
|
4
4
|
"license": "Private",
|
|
5
5
|
"homepage": "https://chaibuilder.com",
|
|
6
|
-
"version": "0.16.
|
|
6
|
+
"version": "0.16.15",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@chaibuilder/runtime": "2.2.0",
|
|
61
|
-
"@chaibuilder/sdk": "3.1.
|
|
61
|
+
"@chaibuilder/sdk": "3.1.20",
|
|
62
62
|
"@types/react": "*",
|
|
63
63
|
"@types/react-dom": "*",
|
|
64
64
|
"jotai": "2.14.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@chaibuilder/runtime": "2.2.0",
|
|
78
|
-
"@chaibuilder/sdk": "3.1.
|
|
78
|
+
"@chaibuilder/sdk": "3.1.20",
|
|
79
79
|
"@mhsdesign/jit-browser-tailwindcss": "^0.4.2",
|
|
80
80
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
81
81
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("./index-Pdb5tSRL.cjs"),c=require("@chaibuilder/sdk"),s=require("@chaibuilder/sdk/ui"),y=require("lodash-es");function S({page:e,onClose:l}){const{t}=c.useTranslation(),[,d]=r.useSearchParams(),{mutate:u,isPending:a}=r.useDeletePage(),{data:o}=r.usePageTypes(),{setSelectedLang:h,fallbackLang:m}=c.useLanguages(),[,x]=c.useSidebarActivePanel(),P=()=>{a||u(e,{onSuccess:()=>{e!=null&&e.primaryPage?(window.history.replaceState({},"",`/?page=${e.primaryPage}`),d(new URLSearchParams({page:e.primaryPage}))):(window.history.replaceState({},"","/"),d(new URLSearchParams)),window.dispatchEvent(new PopStateEvent("popstate")),h(m),x("outline"),l()}})},i=o==null?void 0:o.find(D=>D.key===(e==null?void 0:e.pageType));return n.jsx(s.Dialog,{open:!!e,onOpenChange:l,children:n.jsxs(s.DialogContent,{children:[n.jsxs(s.DialogHeader,{children:[n.jsx(s.DialogTitle,{children:t("Confirm Deletion")}),n.jsxs(s.DialogDescription,{className:"py-4 text-slate-500",children:[n.jsxs("div",{children:[t("Are you sure you want to remove")," ",n.jsx("b",{children:(e==null?void 0:e.name)??(e==null?void 0:e.slug)})," ",i!=null&&i.hasSlug?(i==null?void 0:i.name)+"?":`${t("page?")} ${e!=null&&e.primaryPage?"":t("This will also delete all associated language pages.")}`]}),e.lang&&n.jsxs("div",{className:"py-2 text-sm",children:[t("Language"),": ",n.jsx("span",{className:"font-medium text-gray-500",children:y.get(r.LANGUAGES,e.lang,e.lang)})]})]})]}),n.jsxs(s.DialogFooter,{children:[n.jsx(s.Button,{variant:"outline",onClick:l,children:t("Cancel")}),n.jsx(s.Button,{variant:"destructive",disabled:a,onClick:P,children:t(a?"Deleting...":"Delete")})]})]})})}exports.default=S;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as i, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import { i as f, m as w, h as y, L as S } from "./index-e9WlBH0R.js";
|
|
3
|
-
import { useTranslation as v, useLanguages as L, useSidebarActivePanel as x } from "@chaibuilder/sdk";
|
|
4
|
-
import { Dialog as A, DialogContent as k, DialogHeader as C, DialogTitle as N, DialogDescription as g, DialogFooter as E, Button as c } from "@chaibuilder/sdk/ui";
|
|
5
|
-
import { get as U } from "lodash-es";
|
|
6
|
-
function F({ page: e, onClose: a }) {
|
|
7
|
-
const { t } = v(), [, o] = f(), { mutate: d, isPending: l } = w(), { data: s } = y(), { setSelectedLang: m, fallbackLang: u } = L(), [, h] = x(), P = () => {
|
|
8
|
-
l || d(e, {
|
|
9
|
-
onSuccess: () => {
|
|
10
|
-
e != null && e.primaryPage ? (window.history.replaceState({}, "", `/?page=${e.primaryPage}`), o(new URLSearchParams({ page: e.primaryPage }))) : (window.history.replaceState({}, "", "/"), o(new URLSearchParams())), window.dispatchEvent(new PopStateEvent("popstate")), m(u), h("outline"), a();
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
}, n = s == null ? void 0 : s.find((D) => D.key === (e == null ? void 0 : e.pageType));
|
|
14
|
-
return /* @__PURE__ */ i(A, { open: !!e, onOpenChange: a, children: /* @__PURE__ */ r(k, { children: [
|
|
15
|
-
/* @__PURE__ */ r(C, { children: [
|
|
16
|
-
/* @__PURE__ */ i(N, { children: t("Confirm Deletion") }),
|
|
17
|
-
/* @__PURE__ */ r(g, { className: "py-4 text-slate-500", children: [
|
|
18
|
-
/* @__PURE__ */ r("div", { children: [
|
|
19
|
-
t("Are you sure you want to remove"),
|
|
20
|
-
" ",
|
|
21
|
-
/* @__PURE__ */ i("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
|
|
22
|
-
" ",
|
|
23
|
-
n != null && n.hasSlug ? (n == null ? void 0 : n.name) + "?" : `${t("page?")} ${e != null && e.primaryPage ? "" : t("This will also delete all associated language pages.")}`
|
|
24
|
-
] }),
|
|
25
|
-
e.lang && /* @__PURE__ */ r("div", { className: "py-2 text-sm", children: [
|
|
26
|
-
t("Language"),
|
|
27
|
-
": ",
|
|
28
|
-
/* @__PURE__ */ i("span", { className: "font-medium text-gray-500", children: U(S, e.lang, e.lang) })
|
|
29
|
-
] })
|
|
30
|
-
] })
|
|
31
|
-
] }),
|
|
32
|
-
/* @__PURE__ */ r(E, { children: [
|
|
33
|
-
/* @__PURE__ */ i(c, { variant: "outline", onClick: a, children: t("Cancel") }),
|
|
34
|
-
/* @__PURE__ */ i(c, { variant: "destructive", disabled: l, onClick: P, children: t(l ? "Deleting..." : "Delete") })
|
|
35
|
-
] })
|
|
36
|
-
] }) });
|
|
37
|
-
}
|
|
38
|
-
export {
|
|
39
|
-
F as default
|
|
40
|
-
};
|