@chaibuilder/sdk 4.0.0-beta.49 → 4.0.0-beta.51
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 +35 -52
- package/dist/{2SSKDMRQ-CjvuNdPo.cjs → 2SSKDMRQ-BSYe_xPq.cjs} +1 -1
- package/dist/{2SSKDMRQ-Dvf9zadl.js → 2SSKDMRQ-Dv-C_YAA.js} +3 -3
- package/dist/{AP7HFJJL-DYFttFoI.cjs → AP7HFJJL-BJolKJBt.cjs} +1 -1
- package/dist/{AP7HFJJL-q4dJdyFs.js → AP7HFJJL-DhdVstVC.js} +1 -1
- package/dist/{IconPicker-Bf163F7t.js → IconPicker-BBkl0T8b.js} +13 -13
- package/dist/{IconPicker-JWhYq2Gp.cjs → IconPicker-C0WWlb8t.cjs} +1 -1
- package/dist/{WDYDFRGG-O9GIrtX0.js → WDYDFRGG-CJs2MxSq.js} +4 -4
- package/dist/{WDYDFRGG-BEksfGMC.cjs → WDYDFRGG-DRt6Zg7Q.cjs} +1 -1
- package/dist/{actions-registery-BHbZHkE3.cjs → actions-registery-CLL3KrNv.cjs} +2 -2
- package/dist/{actions-registery-gJb_wq2F.js → actions-registery-CrGIlqUX.js} +88 -88
- package/dist/actions.cjs +1 -1
- package/dist/actions.js +2 -2
- package/dist/{add-new-language-page-BfUp5Ua2.cjs → add-new-language-page-ByMSfRcN.cjs} +1 -1
- package/dist/{add-new-language-page-CRR93tLq.js → add-new-language-page-DtVoDNfI.js} +35 -35
- package/dist/{add-new-page-B8NGK6WS.cjs → add-new-page-CnuChfJz.cjs} +1 -1
- package/dist/add-new-page-DanzzvYo.js +31 -0
- package/dist/{ai-panel-default-lang-BXYQye3N.js → ai-panel-default-lang-BaPz2d_6.js} +35 -35
- package/dist/{ai-panel-default-lang-VhgmHFoQ.cjs → ai-panel-default-lang-CoIQSz_Y.cjs} +2 -2
- package/dist/{ai-panel-other-lang-DaCf-cq4.js → ai-panel-other-lang--i-5z4e2.js} +22 -22
- package/dist/{ai-panel-other-lang-Ds0EXeUC.cjs → ai-panel-other-lang-ChlMVodg.cjs} +1 -1
- package/dist/{ai-prompt-input-7iWk72w5.js → ai-prompt-input-BQi0VDJC.js} +77 -77
- package/dist/{ai-prompt-input-nZ5_Dm7X.cjs → ai-prompt-input-BT5426AB.cjs} +1 -1
- package/dist/{ai-translation-prompt-1OUs1P7n.js → ai-translation-prompt-BN78s33t.js} +8 -8
- package/dist/{ai-translation-prompt-B16cK-1Q.cjs → ai-translation-prompt-BQPaekp3.cjs} +1 -1
- package/dist/{apply-binding-CBSjMYSk.cjs → apply-binding-Cjh1kqMO.cjs} +1 -1
- package/dist/{apply-binding-vAuN-TGV.js → apply-binding-v_W4uR3U.js} +28 -28
- package/dist/{plugin-BSjgGgwo.js → chai-theme-helpers-BEf2rwE4.js} +83 -83
- package/dist/chai-theme-helpers-q3nwoNht.cjs +22 -0
- package/dist/{change-password-modal-D5eXjiYq.cjs → change-password-modal-DHUrrKw7.cjs} +1 -1
- package/dist/{change-password-modal-CdvJR1Ln.js → change-password-modal-pEp-nMNb.js} +30 -30
- package/dist/{code-display-DdWcOQ_i.js → code-display-BaLKScgW.js} +5 -5
- package/dist/{code-display-BR-gij5j.cjs → code-display-i7jb2kmw.cjs} +1 -1
- package/dist/{code-editor-CyLjDiEp.js → code-editor-CRoniyP0.js} +12 -12
- package/dist/{code-editor-SWbfFj1E.cjs → code-editor-gwFRjQ2_.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +0 -5
- package/dist/core.js +49 -49
- package/dist/{css-import-modal-Be47CBJn.js → css-import-modal-B3qxX9Iv.js} +14 -14
- package/dist/{css-import-modal-Bdwgd05S.cjs → css-import-modal-nAB5FSwn.cjs} +2 -2
- package/dist/{delete-page-C99K2qzS.js → delete-page-DbawNFf7.js} +13 -13
- package/dist/{delete-page-DLohaU-U.cjs → delete-page-YP1HEAoD.cjs} +1 -1
- package/dist/{digital-asset-manager-BZMb6sC7.js → digital-asset-manager-DTD5mf24.js} +388 -357
- package/dist/digital-asset-manager-kJnuMqpw.cjs +1 -0
- package/dist/{duplicate-page-D5Gtvqdv.cjs → duplicate-page-CxqW_EO7.cjs} +1 -1
- package/dist/{duplicate-page-CDc2X0eW.js → duplicate-page-DnRb1y6K.js} +19 -19
- package/dist/{dynamic-page-selector-DZHhX008.cjs → dynamic-page-selector-2EqJhUrB.cjs} +1 -1
- package/dist/{dynamic-page-selector-DvNBXo6o.js → dynamic-page-selector-D6VLDIN9.js} +17 -17
- package/dist/{get-chai-builder-tailwind-config-7CxFxEYL.cjs → get-chai-builder-tailwind-config-DNp8Vhme.cjs} +1 -1
- package/dist/{get-chai-builder-tailwind-config-DC4sDOYK.js → get-chai-builder-tailwind-config-k8l5sdcw.js} +3 -3
- package/dist/{get-chai-builder-theme-BpuwSLeS.js → get-chai-builder-theme-DLpviqPJ.js} +1 -1
- package/dist/get-chai-builder-theme-Du4ARJlw.cjs +1 -0
- package/dist/{image-editor-DwhTYkVR.cjs → image-editor-BQcOGsli.cjs} +1 -1
- package/dist/{image-editor-BBvvi9Vm.js → image-editor-CMf731xL.js} +15 -15
- package/dist/index-BYrRPW_c.cjs +5 -0
- package/dist/index-D-r_K4yA.cjs +160 -0
- package/dist/{index-OuHV9Ann.js → index-DPV6NiJ-.js} +5894 -6049
- package/dist/index-DqzFD1CG.js +4861 -0
- package/dist/{mark-as-template-CP_F9ZQ4.js → mark-as-template-D7jqSCXw.js} +28 -28
- package/dist/{mark-as-template-B9yLcasI.cjs → mark-as-template-DyB56HzI.cjs} +1 -1
- package/dist/{nested-path-selector-content-DmtCI3q9.js → nested-path-selector-content-dwSikrsV.js} +2 -2
- package/dist/{nested-path-selector-content-aTdu-o0e.cjs → nested-path-selector-content-g9_Tq_sR.cjs} +1 -1
- package/dist/no-language-page-content-BRITuyfN.js +43 -0
- package/dist/{no-language-page-content-C-MCdPXt.cjs → no-language-page-content-ZvMNVY-Y.cjs} +1 -1
- package/dist/{no-language-page-dialog-D4QIAHnE.cjs → no-language-page-dialog-Cndq8xRP.cjs} +1 -1
- package/dist/no-language-page-dialog-D7L9nVb9.js +10 -0
- package/dist/page-creator-BAIbU14q.js +652 -0
- package/dist/page-creator-qL3-M8g3.cjs +1 -0
- package/dist/{page-manager-new-ah6QYar2.cjs → page-manager-new-By3eGO3i.cjs} +1 -1
- package/dist/{page-manager-new-ttsrxdW9.js → page-manager-new-YRG89y4f.js} +63 -63
- package/dist/page-manager-search-and-filter-BbdgOU9V.cjs +1 -0
- package/dist/page-manager-search-and-filter-Cllju4CV.js +184 -0
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +0 -15
- package/dist/pages.js +20 -21
- package/dist/{publish-pages-content-KZVMHT6V.js → publish-pages-content-CG5LBUnY.js} +48 -48
- package/dist/{publish-pages-content-BrajJUcP.cjs → publish-pages-content-DxMiBxNU.cjs} +1 -1
- package/dist/{register-chai-top-bar-DyW9GPzV.cjs → register-chai-top-bar-CCssW5dL.cjs} +1 -1
- package/dist/{register-chai-top-bar-D6GjnauV.js → register-chai-top-bar-DWmJ2efT.js} +11 -11
- package/dist/render.cjs +1 -1
- package/dist/render.js +54 -54
- package/dist/{rte-widget-modal-CiTwsXTr.cjs → rte-widget-modal-CsTqFJc_.cjs} +1 -1
- package/dist/{rte-widget-modal-IU8JzPuZ.js → rte-widget-modal-DoeTMRtX.js} +2 -2
- package/dist/runtime-client.cjs +1 -1
- package/dist/runtime-client.js +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +1 -1
- package/dist/sdk.css +1 -1
- package/dist/{selected-block-display-CidmQ-wz.js → selected-block-display-Ck1kkNEi.js} +17 -28
- package/dist/{selected-block-display-CAFEOrLV.cjs → selected-block-display-DSow6N4b.cjs} +1 -1
- package/dist/seo-panel---mYZmLD.js +559 -0
- package/dist/seo-panel-mfX63fua.cjs +1 -0
- package/dist/{shared-json-ld-uvMmwCYp.js → shared-json-ld-B3I_RLE2.js} +46 -46
- package/dist/{shared-json-ld-CMH-eRUq.cjs → shared-json-ld-CGgwUOlW.cjs} +1 -1
- package/dist/{slug-input-DLWTMTsO.js → slug-input-DQ4t3-Tt.js} +5 -5
- package/dist/{slug-input-CiHC5l3r.cjs → slug-input-DaNbl597.cjs} +1 -1
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.js +2 -2
- package/dist/types.d.ts +0 -96
- package/dist/{unmark-as-template-F7TdgWjI.cjs → unmark-as-template-CZ65AE4v.cjs} +1 -1
- package/dist/{unmark-as-template-C5ovsEBP.js → unmark-as-template-DvmoTbVu.js} +11 -11
- package/dist/unpublish-page-3--vO5b0.js +28 -0
- package/dist/{unpublish-page-CUr8Xub6.cjs → unpublish-page-B46TiWlU.cjs} +1 -1
- package/dist/{unpublished-partials-modal-BhNAub_z.js → unpublished-partials-modal-DVMz3q83.js} +18 -15
- package/dist/{unpublished-partials-modal-Cv5R9-hi.cjs → unpublished-partials-modal-U5lKBOSR.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +2 -2
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +2 -2
- package/dist/{web-preview-D9pXonAv.js → web-preview-D5o5XQo0.js} +2 -2
- package/dist/{web-preview-CuMYekVJ.cjs → web-preview-Da3RhcjQ.cjs} +1 -1
- package/package.json +1 -1
- package/dist/active-in-another-tab-B4Ur0JP7.js +0 -35
- package/dist/active-in-another-tab-BPdx4lWh.cjs +0 -1
- package/dist/add-new-page-Ppy5-y5j.js +0 -31
- package/dist/continue-editing-in-this-client-BrSvK-Ay.js +0 -25
- package/dist/continue-editing-in-this-client-Cmi-GkYZ.cjs +0 -1
- package/dist/design-token-usage-D1lWCJ3L.js +0 -114
- package/dist/design-token-usage-eY2wQ0l3.cjs +0 -1
- package/dist/digital-asset-manager-Z5aJxkq0.cjs +0 -1
- package/dist/get-chai-builder-theme-B5RkBTsB.cjs +0 -1
- package/dist/image-compression-DPFITwOL.js +0 -37
- package/dist/image-compression-UaU7Bwqe.cjs +0 -1
- package/dist/index-BVwFJWDq.cjs +0 -5
- package/dist/index-DCJDQs1a.cjs +0 -160
- package/dist/index-LBTm1Jmk.js +0 -5199
- package/dist/json-diff-viewer-Cb1CmRqP.cjs +0 -8
- package/dist/json-diff-viewer-DG6qMOBS.js +0 -261
- package/dist/lang-panel-B3USOxGq.js +0 -216
- package/dist/lang-panel-DxoJ0v4y.cjs +0 -1
- package/dist/manage-design-tokens-6YGIctip.js +0 -446
- package/dist/manage-design-tokens-modal-BSSCXH8Y.cjs +0 -1
- package/dist/manage-design-tokens-modal-CzsnN49F.js +0 -161
- package/dist/manage-design-tokens-udLBvkHA.cjs +0 -1
- package/dist/no-language-page-content-D8t5dfgh.js +0 -43
- package/dist/no-language-page-dialog-C_fHI2zI.js +0 -10
- package/dist/page-creator-Cz_ah-qE.cjs +0 -1
- package/dist/page-creator-DKEkuGCO.js +0 -796
- package/dist/page-lock-CwZKJ4IE.js +0 -30
- package/dist/page-lock-DdCvtA-I.cjs +0 -1
- package/dist/page-locked-dialog-CrTDBoC4.cjs +0 -1
- package/dist/page-locked-dialog-DqLlooUz.js +0 -136
- package/dist/page-manager-search-and-filter-D7AupT6_.cjs +0 -1
- package/dist/page-manager-search-and-filter-bsqZ6wnI.js +0 -210
- package/dist/page-revisions-content-B6hsIla7.cjs +0 -1
- package/dist/page-revisions-content-C5O8_Fms.js +0 -459
- package/dist/plugin-DHpuZZXz.cjs +0 -22
- package/dist/save-to-lib-DMnv7ENo.js +0 -429
- package/dist/save-to-lib-Dc700Aop.cjs +0 -1
- package/dist/seo-panel-Br8gxDxu.js +0 -789
- package/dist/seo-panel-CMY-adM-.cjs +0 -2
- package/dist/take-over-request-IRLgF1dG.cjs +0 -1
- package/dist/take-over-request-KdR1_h_K.js +0 -64
- package/dist/translation-warning-modal-CLZ9tC1F.cjs +0 -1
- package/dist/translation-warning-modal-CzNt6LDO.js +0 -27
- package/dist/unpublish-page-0fR1o0b7.js +0 -28
|
@@ -1,459 +0,0 @@
|
|
|
1
|
-
import { jsxs as a, Fragment as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { B as g } from "./register-chai-top-bar-D6GjnauV.js";
|
|
3
|
-
import { d as le, ag as re, ah as ie, a7 as de, ai as v, I as ce, D as V, e as j, f as G, g as L, o as z, q as $, v as oe, w as ue, x as me, y as _, aj as he } from "./index-OuHV9Ann.js";
|
|
4
|
-
import { aq as C, ar as A, A as y, av as H, az as fe, ao as I, aw as E, ax as D } from "./index-LBTm1Jmk.js";
|
|
5
|
-
import { useQuery as pe, useQueryClient as O, useMutation as P } from "@tanstack/react-query";
|
|
6
|
-
import { format as S, formatDistanceToNow as xe } from "date-fns";
|
|
7
|
-
import { isEmpty as ge } from "lodash-es";
|
|
8
|
-
import { FileJson as Ne, CloudOff as be, Undo2 as J, Trash as Q, X as ye, Rocket as ve, Save as we, MoreHorizontal as De } from "lucide-react";
|
|
9
|
-
import * as w from "react";
|
|
10
|
-
import { useEffect as U, startTransition as Se, useState as Re, Suspense as Ee, lazy as Ce } from "react";
|
|
11
|
-
function Ae(t) {
|
|
12
|
-
const s = C(), n = A();
|
|
13
|
-
return pe({
|
|
14
|
-
queryKey: [y.GET_PAGE_REVISIONS, t],
|
|
15
|
-
queryFn: async () => await n(s, {
|
|
16
|
-
action: y.GET_PAGE_REVISIONS,
|
|
17
|
-
data: { pageId: t }
|
|
18
|
-
}),
|
|
19
|
-
enabled: !!t,
|
|
20
|
-
refetchOnMount: !0
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
const Ie = () => {
|
|
24
|
-
const t = C(), s = A(), n = O();
|
|
25
|
-
return P({
|
|
26
|
-
mutationFn: async (i) => await s(t, {
|
|
27
|
-
action: y.DELETE_PAGE_REVISION,
|
|
28
|
-
data: { revisionId: i }
|
|
29
|
-
}),
|
|
30
|
-
onSuccess: () => {
|
|
31
|
-
n.invalidateQueries({
|
|
32
|
-
queryKey: ["revisions"]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}, Oe = () => {
|
|
37
|
-
const t = C(), s = A(), n = O();
|
|
38
|
-
return P({
|
|
39
|
-
mutationFn: async ({
|
|
40
|
-
revisionId: i,
|
|
41
|
-
discardCurrent: r,
|
|
42
|
-
pageId: d
|
|
43
|
-
}) => await s(t, {
|
|
44
|
-
action: y.RESTORE_PAGE_REVISION,
|
|
45
|
-
data: { revisionId: i, discardCurrent: r, ...d && { pageId: d } }
|
|
46
|
-
}),
|
|
47
|
-
onSuccess: () => {
|
|
48
|
-
n.invalidateQueries({
|
|
49
|
-
queryKey: ["revisions"]
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}, Te = Ce(() => import("./json-diff-viewer-DG6qMOBS.js")), N = ({ tag: t }) => t === "draft" ? /* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-xs text-amber-600", children: [
|
|
54
|
-
/* @__PURE__ */ a("span", { className: "relative flex h-2 w-2", children: [
|
|
55
|
-
/* @__PURE__ */ e("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75" }),
|
|
56
|
-
/* @__PURE__ */ e("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-amber-500" })
|
|
57
|
-
] }),
|
|
58
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] leading-tight", children: "Draft" })
|
|
59
|
-
] }) : t === "live" ? /* @__PURE__ */ a("span", { className: "flex items-center gap-1 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary", children: [
|
|
60
|
-
/* @__PURE__ */ a("span", { className: "relative flex h-2 w-2", children: [
|
|
61
|
-
/* @__PURE__ */ e("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75" }),
|
|
62
|
-
/* @__PURE__ */ e("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-green-500" })
|
|
63
|
-
] }),
|
|
64
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] leading-tight", children: "Live" })
|
|
65
|
-
] }) : t === "published" ? /* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-full bg-green-500/10 px-1.5 py-0.5 text-xs text-green-600", children: [
|
|
66
|
-
/* @__PURE__ */ e(ve, { className: "h-3 w-3" }),
|
|
67
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] leading-tight", children: "Published" })
|
|
68
|
-
] }) : t === "unsaved" ? /* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-full bg-red-500/10 px-1.5 py-0.5 text-xs text-red-600", children: [
|
|
69
|
-
/* @__PURE__ */ e(we, { className: "h-3 w-3" }),
|
|
70
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] leading-tight", children: "Unsaved changes" })
|
|
71
|
-
] }) : /* @__PURE__ */ e("span", { className: "rounded bg-purple-500/10 px-1.5 py-0.5 font-mono text-xs font-bold text-purple-600", children: t });
|
|
72
|
-
function ke({ compare: t, setCompare: s }) {
|
|
73
|
-
const { data: n } = H(), { saveState: i } = ce(), [r] = fe();
|
|
74
|
-
if (!n) return null;
|
|
75
|
-
const d = !!t.find((u) => {
|
|
76
|
-
var l;
|
|
77
|
-
return (l = u == null ? void 0 : u.uid) == null ? void 0 : l.startsWith("draft:");
|
|
78
|
-
}), o = t.length >= 2 && !d, m = i === "UNSAVED";
|
|
79
|
-
return /* @__PURE__ */ a("div", { className: "relative flex items-start gap-3 rounded-md border bg-primary/5 p-2 hover:bg-accent/50", children: [
|
|
80
|
-
/* @__PURE__ */ a("div", { className: "flex-1 space-y-1", children: [
|
|
81
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-sm font-medium leading-none", children: [
|
|
82
|
-
/* @__PURE__ */ e(N, { tag: "draft" }),
|
|
83
|
-
/* @__PURE__ */ e("span", { className: "text-xs font-bold", children: "Currently editing" })
|
|
84
|
-
] }) }),
|
|
85
|
-
/* @__PURE__ */ e("div", { className: "flex items-center pl-2 text-[11px] text-muted-foreground", children: !ge(r.lastSaved) && /* @__PURE__ */ a("span", { children: [
|
|
86
|
-
"Last updated",
|
|
87
|
-
" ",
|
|
88
|
-
xe(new Date(r.lastSaved), {
|
|
89
|
-
addSuffix: !0
|
|
90
|
-
})
|
|
91
|
-
] }) }),
|
|
92
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 pt-0.5", children: m ? /* @__PURE__ */ e(N, { tag: "unsaved" }) : null })
|
|
93
|
-
] }),
|
|
94
|
-
/* @__PURE__ */ e(
|
|
95
|
-
K,
|
|
96
|
-
{
|
|
97
|
-
checked: d,
|
|
98
|
-
disabled: o,
|
|
99
|
-
onChange: () => {
|
|
100
|
-
s(d ? t.filter((u) => u.uid !== `draft:${n == null ? void 0 : n.id}`) : [
|
|
101
|
-
...t,
|
|
102
|
-
{ uid: `draft:${n == null ? void 0 : n.id}`, label: "draft", item: { createdAt: Date.now() } }
|
|
103
|
-
]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
)
|
|
107
|
-
] });
|
|
108
|
-
}
|
|
109
|
-
function Me() {
|
|
110
|
-
return /* @__PURE__ */ e("div", { className: "mt-2 space-y-2", children: Array.from({ length: 5 }).map((t, s) => /* @__PURE__ */ a("div", { className: "flex items-start gap-3 rounded-md border p-2", children: [
|
|
111
|
-
/* @__PURE__ */ a("div", { className: "flex-1 space-y-1", children: [
|
|
112
|
-
/* @__PURE__ */ e(v, { className: "h-4 w-3/4" }),
|
|
113
|
-
/* @__PURE__ */ e(v, { className: "h-3 w-1/2" }),
|
|
114
|
-
/* @__PURE__ */ e(v, { className: "mt-1 h-5 w-20" })
|
|
115
|
-
] }),
|
|
116
|
-
/* @__PURE__ */ e(v, { className: "h-8 w-8 rounded-full" })
|
|
117
|
-
] }, s)) });
|
|
118
|
-
}
|
|
119
|
-
function F({
|
|
120
|
-
revision: t,
|
|
121
|
-
isLatest: s,
|
|
122
|
-
onRestore: n,
|
|
123
|
-
onDelete: i,
|
|
124
|
-
revisionNumber: r,
|
|
125
|
-
compare: d,
|
|
126
|
-
setCompare: o,
|
|
127
|
-
pageId: m
|
|
128
|
-
}) {
|
|
129
|
-
const { data: u } = I(t.currentEditor), l = (u == null ? void 0 : u.name) || "Unknown", f = !!d.find((h) => {
|
|
130
|
-
var x;
|
|
131
|
-
return s ? (x = h == null ? void 0 : h.uid) == null ? void 0 : x.startsWith("live") : (h == null ? void 0 : h.uid) === t.uid;
|
|
132
|
-
}), R = d.length >= 2 && !f;
|
|
133
|
-
return /* @__PURE__ */ a("div", { className: "relative flex items-start gap-3 rounded-md border p-2 hover:bg-accent/50", children: [
|
|
134
|
-
/* @__PURE__ */ a("div", { className: "flex-1 space-y-3", children: [
|
|
135
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ a("p", { className: "flex items-center gap-1 text-xs leading-none", children: [
|
|
136
|
-
/* @__PURE__ */ e(N, { tag: s ? "live" : `#${r}` }),
|
|
137
|
-
t.type === "published" ? "Published" : "Draft",
|
|
138
|
-
" by ",
|
|
139
|
-
/* @__PURE__ */ e("span", { className: "text-xs font-bold", children: l })
|
|
140
|
-
] }) }),
|
|
141
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-x-3", children: [
|
|
142
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: t.type === "published" ? /* @__PURE__ */ e(N, { tag: "published" }) : /* @__PURE__ */ e(N, { tag: "draft" }) }),
|
|
143
|
-
/* @__PURE__ */ e("div", { className: "flex items-center text-[10px] text-muted-foreground", children: /* @__PURE__ */ e("span", { className: "leading-tight", children: S(t.createdAt, "MMM d, yyyy, h:mm a") }) })
|
|
144
|
-
] })
|
|
145
|
-
] }),
|
|
146
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(E, { permissions: [D.RESTORE_REVISION, D.DELETE_REVISION], children: /* @__PURE__ */ e(Ue, { revision: t, onRestore: n, onDelete: i }) }) }),
|
|
147
|
-
/* @__PURE__ */ e(
|
|
148
|
-
K,
|
|
149
|
-
{
|
|
150
|
-
checked: f,
|
|
151
|
-
disabled: R,
|
|
152
|
-
onChange: () => {
|
|
153
|
-
o(
|
|
154
|
-
f ? d.filter((h) => s ? h.uid !== `live:${m}` : h.uid !== t.uid) : [
|
|
155
|
-
...d,
|
|
156
|
-
{
|
|
157
|
-
uid: s ? `live:${m}` : t.uid,
|
|
158
|
-
label: s ? "live" : `#${r}`,
|
|
159
|
-
item: t
|
|
160
|
-
}
|
|
161
|
-
].sort((h, x) => new Date(h.item.createdAt).getTime() - new Date(x.item.createdAt).getTime())
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
] });
|
|
167
|
-
}
|
|
168
|
-
function q({ tab: t, onRemove: s }) {
|
|
169
|
-
return /* @__PURE__ */ a("span", { className: "flex items-center justify-between rounded border border-blue-100 p-1 font-medium", children: [
|
|
170
|
-
/* @__PURE__ */ e(N, { tag: t.label }),
|
|
171
|
-
/* @__PURE__ */ e(
|
|
172
|
-
"button",
|
|
173
|
-
{
|
|
174
|
-
className: "z-0 flex h-4 w-4 items-center justify-center rounded-full text-gray-400 hover:text-red-500",
|
|
175
|
-
style: { lineHeight: 1 },
|
|
176
|
-
onClick: () => s(t.uid),
|
|
177
|
-
"aria-label": "Remove selection",
|
|
178
|
-
children: /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
] });
|
|
182
|
-
}
|
|
183
|
-
function _e({ compare: t, setCompare: s, pageId: n }) {
|
|
184
|
-
const [i, r] = Re(!1), [d, o] = t;
|
|
185
|
-
if (t.length === 0) return null;
|
|
186
|
-
const m = (u) => s(t.filter((l) => l.uid !== u));
|
|
187
|
-
return /* @__PURE__ */ a("div", { className: "mb-2 flex w-full max-w-md flex-col gap-1 rounded border bg-accent/60 p-2 shadow-sm", children: [
|
|
188
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-x-2 text-xs", children: [
|
|
189
|
-
/* @__PURE__ */ e("span", { className: "font-medium leading-tight text-gray-600", children: "Compare" }),
|
|
190
|
-
d && /* @__PURE__ */ e(q, { tab: d, onRemove: m }),
|
|
191
|
-
/* @__PURE__ */ e("span", { className: "font-medium leading-tight text-gray-600", children: "with" }),
|
|
192
|
-
o ? /* @__PURE__ */ e(q, { tab: o, onRemove: m }) : /* @__PURE__ */ e("span", { className: "rounded border px-1 text-xs text-muted-foreground", children: "Choose another" })
|
|
193
|
-
] }),
|
|
194
|
-
/* @__PURE__ */ a("div", { className: "flex items-center justify-end gap-2 pb-0.5 pt-2", children: [
|
|
195
|
-
/* @__PURE__ */ e(
|
|
196
|
-
g,
|
|
197
|
-
{
|
|
198
|
-
size: "sm",
|
|
199
|
-
className: "h-6 gap-1 rounded px-2 text-xs leading-none text-gray-500",
|
|
200
|
-
variant: "outline",
|
|
201
|
-
onClick: () => s([]),
|
|
202
|
-
children: /* @__PURE__ */ e("span", { children: " Clear" })
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
/* @__PURE__ */ a(
|
|
206
|
-
g,
|
|
207
|
-
{
|
|
208
|
-
size: "sm",
|
|
209
|
-
className: "h-6 gap-1 rounded px-2 text-xs leading-none",
|
|
210
|
-
variant: "default",
|
|
211
|
-
onClick: () => r(!0),
|
|
212
|
-
disabled: t.length < 2,
|
|
213
|
-
children: [
|
|
214
|
-
/* @__PURE__ */ e(Ne, { className: "h-2.5 w-2.5" }),
|
|
215
|
-
/* @__PURE__ */ e("span", { className: "pt-0.5", children: "Show JSON Diff" })
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
)
|
|
219
|
-
] }),
|
|
220
|
-
i && (t == null ? void 0 : t.length) > 1 && n && /* @__PURE__ */ e(
|
|
221
|
-
Ee,
|
|
222
|
-
{
|
|
223
|
-
fallback: /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ e("span", { className: "text-sm", children: "Loading diff viewer..." }) }),
|
|
224
|
-
children: /* @__PURE__ */ e(Te, { open: i, onOpenChange: r, compare: t })
|
|
225
|
-
}
|
|
226
|
-
)
|
|
227
|
-
] });
|
|
228
|
-
}
|
|
229
|
-
function K({ checked: t, disabled: s, onChange: n, label: i = "Compare" }) {
|
|
230
|
-
return /* @__PURE__ */ e("div", { className: "absolute bottom-2 right-2", children: /* @__PURE__ */ a("label", { className: `flex cursor-pointer items-center gap-x-1 text-[11px] ${s ? "opacity-50" : ""}`, children: [
|
|
231
|
-
/* @__PURE__ */ e(
|
|
232
|
-
"input",
|
|
233
|
-
{
|
|
234
|
-
type: "checkbox",
|
|
235
|
-
className: "h-3 w-3 cursor-pointer rounded focus:ring-0 focus:ring-offset-0",
|
|
236
|
-
checked: t,
|
|
237
|
-
disabled: s,
|
|
238
|
-
onChange: n
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
/* @__PURE__ */ e("span", { className: "select-none leading-tight", children: i })
|
|
242
|
-
] }) });
|
|
243
|
-
}
|
|
244
|
-
function Ue({ revision: t, onRestore: s, onDelete: n }) {
|
|
245
|
-
return /* @__PURE__ */ a(oe, { children: [
|
|
246
|
-
/* @__PURE__ */ e(ue, { asChild: !0, children: /* @__PURE__ */ a(g, { variant: "ghost", size: "icon", className: "h-5 w-5", children: [
|
|
247
|
-
/* @__PURE__ */ e(De, { className: "h-4 w-4" }),
|
|
248
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "More options" })
|
|
249
|
-
] }) }),
|
|
250
|
-
/* @__PURE__ */ a(me, { align: "end", className: "text-xs", children: [
|
|
251
|
-
/* @__PURE__ */ e(E, { permission: D.RESTORE_REVISION, children: /* @__PURE__ */ a(_, { onClick: s, className: "cursor-pointer text-sm", children: [
|
|
252
|
-
/* @__PURE__ */ e(J, { className: "mr-2 h-4 w-4" }),
|
|
253
|
-
/* @__PURE__ */ e("span", { children: "Restore this version" })
|
|
254
|
-
] }) }),
|
|
255
|
-
/* @__PURE__ */ e(E, { permission: D.DELETE_REVISION, children: t.uid !== "current" && /* @__PURE__ */ a(p, { children: [
|
|
256
|
-
/* @__PURE__ */ e(he, {}),
|
|
257
|
-
/* @__PURE__ */ a(_, { onClick: n, className: "cursor-pointer text-destructive", children: [
|
|
258
|
-
/* @__PURE__ */ e(Q, { className: "mr-2 h-4 w-4" }),
|
|
259
|
-
/* @__PURE__ */ e("span", { children: "Delete this version" })
|
|
260
|
-
] })
|
|
261
|
-
] }) })
|
|
262
|
-
] })
|
|
263
|
-
] });
|
|
264
|
-
}
|
|
265
|
-
function Fe({
|
|
266
|
-
open: t,
|
|
267
|
-
onOpenChange: s,
|
|
268
|
-
revision: n,
|
|
269
|
-
onRestore: i,
|
|
270
|
-
isRestoring: r
|
|
271
|
-
}) {
|
|
272
|
-
const { data: d } = I((n == null ? void 0 : n.currentEditor) || ""), o = (d == null ? void 0 : d.name) || "Unknown";
|
|
273
|
-
return n ? /* @__PURE__ */ e(
|
|
274
|
-
V,
|
|
275
|
-
{
|
|
276
|
-
open: t,
|
|
277
|
-
onOpenChange: (m) => {
|
|
278
|
-
r || s(m);
|
|
279
|
-
},
|
|
280
|
-
children: /* @__PURE__ */ a(j, { className: "sm:max-w-md", children: [
|
|
281
|
-
/* @__PURE__ */ a(G, { children: [
|
|
282
|
-
/* @__PURE__ */ e(L, { children: "Restore Revision" }),
|
|
283
|
-
/* @__PURE__ */ a(z, { children: [
|
|
284
|
-
"You are about to restore to revision ",
|
|
285
|
-
n.uid.substring(0, 8),
|
|
286
|
-
" from",
|
|
287
|
-
" ",
|
|
288
|
-
S(n.createdAt, "MMM d, yyyy 'at' h:mm a"),
|
|
289
|
-
" by ",
|
|
290
|
-
o
|
|
291
|
-
] })
|
|
292
|
-
] }),
|
|
293
|
-
/* @__PURE__ */ e("div", { className: "py-2", children: /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "How would you like to handle your current edits?" }) }),
|
|
294
|
-
/* @__PURE__ */ a($, { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
295
|
-
/* @__PURE__ */ e(g, { variant: "outline", className: "sm:flex-1", onClick: () => i(!1), disabled: r, children: r ? /* @__PURE__ */ a(p, { children: [
|
|
296
|
-
/* @__PURE__ */ e("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
297
|
-
"Saving as draft..."
|
|
298
|
-
] }) : /* @__PURE__ */ a(p, { children: [
|
|
299
|
-
/* @__PURE__ */ e(be, { className: "mr-2 h-4 w-4" }),
|
|
300
|
-
"Save as draft"
|
|
301
|
-
] }) }),
|
|
302
|
-
/* @__PURE__ */ e(g, { variant: "default", className: "sm:flex-1", onClick: () => i(!0), disabled: r, children: r ? /* @__PURE__ */ a(p, { children: [
|
|
303
|
-
/* @__PURE__ */ e("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
304
|
-
"Discarding current..."
|
|
305
|
-
] }) : /* @__PURE__ */ a(p, { children: [
|
|
306
|
-
/* @__PURE__ */ e(J, { className: "mr-2 h-4 w-4" }),
|
|
307
|
-
"Discard current"
|
|
308
|
-
] }) })
|
|
309
|
-
] })
|
|
310
|
-
] })
|
|
311
|
-
}
|
|
312
|
-
) : null;
|
|
313
|
-
}
|
|
314
|
-
function qe({
|
|
315
|
-
open: t,
|
|
316
|
-
onOpenChange: s,
|
|
317
|
-
revision: n,
|
|
318
|
-
onDelete: i,
|
|
319
|
-
isDeleting: r
|
|
320
|
-
}) {
|
|
321
|
-
const { data: d } = I((n == null ? void 0 : n.currentEditor) || ""), o = (d == null ? void 0 : d.name) || "Unknown";
|
|
322
|
-
return n ? /* @__PURE__ */ e(
|
|
323
|
-
V,
|
|
324
|
-
{
|
|
325
|
-
open: t,
|
|
326
|
-
onOpenChange: (m) => {
|
|
327
|
-
r || s(m);
|
|
328
|
-
},
|
|
329
|
-
children: /* @__PURE__ */ a(j, { className: "sm:max-w-md", children: [
|
|
330
|
-
/* @__PURE__ */ a(G, { children: [
|
|
331
|
-
/* @__PURE__ */ e(L, { children: "Delete Revision" }),
|
|
332
|
-
/* @__PURE__ */ a(z, { children: [
|
|
333
|
-
"You are about to delete revision ",
|
|
334
|
-
n.uid.substring(0, 8),
|
|
335
|
-
" from",
|
|
336
|
-
" ",
|
|
337
|
-
S(n.createdAt, "MMM d, yyyy 'at' h:mm a"),
|
|
338
|
-
" by ",
|
|
339
|
-
o
|
|
340
|
-
] })
|
|
341
|
-
] }),
|
|
342
|
-
/* @__PURE__ */ e("div", { className: "py-2", children: /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "This action cannot be undone. Are you sure you want to proceed?" }) }),
|
|
343
|
-
/* @__PURE__ */ a($, { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
344
|
-
/* @__PURE__ */ e(g, { variant: "outline", className: "sm:flex-1", onClick: () => s(!1), disabled: r, children: "Cancel" }),
|
|
345
|
-
/* @__PURE__ */ e(g, { variant: "destructive", className: "sm:flex-1", onClick: i, disabled: r, children: r ? /* @__PURE__ */ a(p, { children: [
|
|
346
|
-
/* @__PURE__ */ e("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
347
|
-
"Deleting..."
|
|
348
|
-
] }) : /* @__PURE__ */ a(p, { children: [
|
|
349
|
-
/* @__PURE__ */ e(Q, { className: "mr-2 h-4 w-4" }),
|
|
350
|
-
"Delete Revision"
|
|
351
|
-
] }) })
|
|
352
|
-
] })
|
|
353
|
-
] })
|
|
354
|
-
}
|
|
355
|
-
) : null;
|
|
356
|
-
}
|
|
357
|
-
function Qe({ isOpen: t }) {
|
|
358
|
-
var M;
|
|
359
|
-
const [s, n] = w.useState([]), [i, r] = w.useState(null), [d, o] = w.useState(!1), [m, u] = w.useState(!1), { data: l } = H(), { data: f, isFetching: R, error: h, refetch: x } = Ae(l == null ? void 0 : l.id), { mutate: B, isPending: W } = Ie(), { mutate: Y, isPending: X } = Oe(), Z = O(), { selectedLang: ee, fallbackLang: te } = le(), ae = ee || te;
|
|
360
|
-
U(() => {
|
|
361
|
-
Se(() => n([]));
|
|
362
|
-
}, [l == null ? void 0 : l.id]);
|
|
363
|
-
const ne = (c) => {
|
|
364
|
-
i && Y(
|
|
365
|
-
{
|
|
366
|
-
revisionId: i.uid,
|
|
367
|
-
discardCurrent: c,
|
|
368
|
-
...i.uid === "current" && (l == null ? void 0 : l.id) && { pageId: l.id }
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
onSuccess: () => {
|
|
372
|
-
o(!1), r(null), Z.invalidateQueries({
|
|
373
|
-
queryKey: [y.GET_DRAFT_PAGE]
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
);
|
|
378
|
-
}, T = (c) => {
|
|
379
|
-
r(c), o(!0);
|
|
380
|
-
}, k = (c) => {
|
|
381
|
-
r(c), u(!0);
|
|
382
|
-
}, se = () => {
|
|
383
|
-
i && B(i.uid, {
|
|
384
|
-
/**
|
|
385
|
-
* Callback for when deletion of a revision is successful. Closes the
|
|
386
|
-
* delete dialog and resets the selected revision to null.
|
|
387
|
-
*/
|
|
388
|
-
onSuccess: () => {
|
|
389
|
-
u(!1), r(null);
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
};
|
|
393
|
-
return U(() => {
|
|
394
|
-
t && x();
|
|
395
|
-
}, [t, x]), /* @__PURE__ */ a(p, { children: [
|
|
396
|
-
/* @__PURE__ */ a(re, { children: [
|
|
397
|
-
/* @__PURE__ */ e(ie, { children: "Revision History" }),
|
|
398
|
-
(l == null ? void 0 : l.createdAt) && /* @__PURE__ */ a("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
399
|
-
"Page created on ",
|
|
400
|
-
S(new Date(l.createdAt), "MMM d, yyyy 'at' h:mm a")
|
|
401
|
-
] })
|
|
402
|
-
] }),
|
|
403
|
-
R ? /* @__PURE__ */ e(Me, {}) : h ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Failed to load revisions. Please try again." }) : /* @__PURE__ */ a("div", { className: "mt-2 flex h-full min-h-0 flex-1 flex-col space-y-2", children: [
|
|
404
|
-
/* @__PURE__ */ e(_e, { lang: ae, compare: s, setCompare: n, pageId: l == null ? void 0 : l.id }),
|
|
405
|
-
/* @__PURE__ */ e(ke, { compare: s, setCompare: n }),
|
|
406
|
-
(M = f == null ? void 0 : f.filter((c) => c.uid === "current")) == null ? void 0 : M.map((c, b) => /* @__PURE__ */ e(
|
|
407
|
-
F,
|
|
408
|
-
{
|
|
409
|
-
pageId: l == null ? void 0 : l.id,
|
|
410
|
-
revision: c,
|
|
411
|
-
isLatest: !0,
|
|
412
|
-
onRestore: () => T(c),
|
|
413
|
-
onDelete: () => k(c),
|
|
414
|
-
revisionNumber: b,
|
|
415
|
-
compare: s,
|
|
416
|
-
setCompare: n
|
|
417
|
-
},
|
|
418
|
-
c.uid
|
|
419
|
-
)),
|
|
420
|
-
/* @__PURE__ */ e(de, { className: "min-h-0 flex-1", children: /* @__PURE__ */ e("div", { className: "space-y-2", children: [...f ?? []].filter((c) => c.uid !== "current").sort((c, b) => new Date(b.createdAt).getTime() - new Date(c.createdAt).getTime()).map((c, b) => /* @__PURE__ */ e(
|
|
421
|
-
F,
|
|
422
|
-
{
|
|
423
|
-
pageId: l == null ? void 0 : l.id,
|
|
424
|
-
revision: c,
|
|
425
|
-
isLatest: c.uid === "current",
|
|
426
|
-
onRestore: () => T(c),
|
|
427
|
-
onDelete: () => k(c),
|
|
428
|
-
revisionNumber: b + 1,
|
|
429
|
-
compare: s,
|
|
430
|
-
setCompare: n
|
|
431
|
-
},
|
|
432
|
-
c.uid
|
|
433
|
-
)) }) })
|
|
434
|
-
] }),
|
|
435
|
-
/* @__PURE__ */ e(
|
|
436
|
-
Fe,
|
|
437
|
-
{
|
|
438
|
-
open: d,
|
|
439
|
-
onOpenChange: o,
|
|
440
|
-
revision: i,
|
|
441
|
-
onRestore: ne,
|
|
442
|
-
isRestoring: X
|
|
443
|
-
}
|
|
444
|
-
),
|
|
445
|
-
/* @__PURE__ */ e(
|
|
446
|
-
qe,
|
|
447
|
-
{
|
|
448
|
-
open: m,
|
|
449
|
-
onOpenChange: u,
|
|
450
|
-
revision: i,
|
|
451
|
-
onDelete: se,
|
|
452
|
-
isDeleting: W
|
|
453
|
-
}
|
|
454
|
-
)
|
|
455
|
-
] });
|
|
456
|
-
}
|
|
457
|
-
export {
|
|
458
|
-
Qe as default
|
|
459
|
-
};
|
package/dist/plugin-DHpuZZXz.cjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("lodash-es"),$=require("./fonts-D5fTqvSS.cjs"),b=require("./_commonjsHelpers-DwGv2jUC.cjs"),B={fontFamily:{"font-heading":"Arial","font-body":"Arial"},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:"Arial",body:"Arial"},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,t)=>({...r,[t.replace("font-","")]:`var(--${t})`}),{}):{},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,[t])=>({...r,[t]:`hsl(var(--${t}))`}),{}):{}});function m(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let r=parseInt(n[1],16),t=parseInt(n[2],16),F=parseInt(n[3],16);r/=255,t/=255,F/=255;const o=Math.max(r,t,F),u=Math.min(r,t,F);let i=0,l=0;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=(t-F)/s+(t<F?6:0);break;case t:i=(F-r)/s+2;break;case F:i=(r-t)/s+4;break}i/=6}return`${Math.round(i*360)} ${Math.round(l*100)}% ${Math.round(g*100)}%`}const E=e=>{const r=$.getAllRegisteredFonts().find(t=>t.family===e);return`"${e}", ${a.get(r,"fallback","")}`},A=({theme:e})=>{const n=e;return`:root {
|
|
2
|
-
${e.fontFamily?Object.entries(e.fontFamily).map(([r,t])=>`--font-${r}: ${E(t)};`).join(`
|
|
3
|
-
`):""}
|
|
4
|
-
${n.borderRadius?`--radius: ${n.borderRadius};`:""}
|
|
5
|
-
${n.colors?Object.entries(n.colors).map(([r,t])=>`--${r}: ${m(t[0])};`).join(`
|
|
6
|
-
`):""}
|
|
7
|
-
}
|
|
8
|
-
.dark {
|
|
9
|
-
${n.colors?Object.entries(n.colors).map(([r,t])=>`--${r}: ${m(t[1])};`).join(`
|
|
10
|
-
`):""}
|
|
11
|
-
}`},C=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(n=>`<link rel="stylesheet" href="${n.url}" />`).join(`
|
|
12
|
-
`),P=e=>!e||e.length===0?[]:a.uniqBy(e,"family").map(n=>n.url),j=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(n=>`@import url("${n.url}");`).join(`
|
|
13
|
-
`),q=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(n=>n.src.map(r=>`@font-face {
|
|
14
|
-
font-family: "${n.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 T(){return p||(p=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});function n(t,F){return{handler:t,config:F}}n.withOptions=function(t,F=()=>({})){const o=function(u){return{__options:u,handler:t(u),config:F(u)}};return o.__isOptionsFunction=!0,o.__pluginFunction=t,o.__configFunction=F,o};const r=n})(c)),c}var h;function M(){return h||(h=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});const n=r(T());function r(F){return F&&F.__esModule?F:{default:F}}const t=n.default})(d)),d}var f,y;function k(){if(y)return f;y=1;let e=M();return f=(e.__esModule?e:{default:e}).default,f}var R=k();const O=b.getDefaultExportFromCjs(R);exports.defaultThemeOptions=B;exports.defaultThemeValues=v;exports.getChaiThemeCssVariables=A;exports.getChaiThemeOptions=_;exports.getThemeCustomFontFace=q;exports.getThemeFontsCSSImport=j;exports.getThemeFontsLinkMarkup=C;exports.getThemeFontsUrls=P;exports.plugin=O;
|