@chaibuilder/pages 0.14.3 → 0.15.0
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-DWDDkd18.cjs → 2AITGKQY-CpxlNmec.cjs} +1 -1
- package/dist/{2AITGKQY-DtQPkxBe.js → 2AITGKQY-gEvxLMa5.js} +2 -2
- package/dist/{NCMVHL6D-CksZXXOw.js → NCMVHL6D-DpycZ17L.js} +4 -4
- package/dist/{NCMVHL6D-6CkVnw0a.cjs → NCMVHL6D-sV6MElOb.cjs} +1 -1
- package/dist/{ZDWCUMSJ-DoM-AA0C.cjs → ZDWCUMSJ-BPT9OZay.cjs} +1 -1
- package/dist/{ZDWCUMSJ-BXQ01VPt.js → ZDWCUMSJ-BbzwbqTE.js} +1 -1
- package/dist/{add-new-language-page-BA73lQnm.cjs → add-new-language-page-B4_z4O8a.cjs} +1 -1
- package/dist/{add-new-language-page-D8iXtyLA.js → add-new-language-page-C8LIaHl6.js} +2 -2
- package/dist/{add-new-page-EOMgMSeq.cjs → add-new-page-CQRr6Z8g.cjs} +1 -1
- package/dist/{add-new-page-DESlqvED.js → add-new-page-JY6dRnC4.js} +1 -1
- package/dist/{delete-page-BP1Df8QL.js → delete-page-Dfa2vyQB.js} +1 -1
- package/dist/{delete-page-ZvnuEow6.cjs → delete-page-z88W-Ikh.cjs} +1 -1
- package/dist/{digital-asset-manager-BxWb1j_y.cjs → digital-asset-manager-Zh-mlMF5.cjs} +1 -1
- package/dist/{digital-asset-manager-Bb81T3mS.js → digital-asset-manager-hqMwBWhb.js} +146 -146
- package/dist/{duplicate-page-B1j0H7gP.js → duplicate-page-B0urG1pP.js} +8 -8
- package/dist/{duplicate-page-W5xbmPSC.cjs → duplicate-page-Welcro7Y.cjs} +1 -1
- package/dist/{dynamic-page-selector-Crjyco6l.js → dynamic-page-selector-CyhZ0SRO.js} +1 -1
- package/dist/{dynamic-page-selector-BZKJmSx5.cjs → dynamic-page-selector-Dn_j_r-h.cjs} +1 -1
- package/dist/index-BSEA_u0X.js +4854 -0
- package/dist/index-MlpQJHWW.cjs +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -14
- package/dist/index.js +17 -18
- package/dist/{json-diff-viewer-DRkE-x_z.cjs → json-diff-viewer-BIJ4iNWb.cjs} +1 -1
- package/dist/{json-diff-viewer-BGGSLqtx.js → json-diff-viewer-DVlb4YWD.js} +6 -6
- package/dist/{lang-panel-B3tr2uhr.js → lang-panel-D0IN38gF.js} +29 -29
- package/dist/{lang-panel-9T8dIx2p.cjs → lang-panel-l6Teik-4.cjs} +1 -1
- package/dist/{mark-as-template-L9cHzL84.js → mark-as-template-B22EANHN.js} +1 -1
- package/dist/{mark-as-template-DPVPRgbi.cjs → mark-as-template-DBPJ1gIK.cjs} +1 -1
- package/dist/{no-language-page-content-Cy_D-3jE.cjs → no-language-page-content-BUHXqSKG.cjs} +1 -1
- package/dist/{no-language-page-content-DP7gmy0s.js → no-language-page-content-DNNu8wd0.js} +1 -1
- package/dist/{page-creator-Ctn5ixJE.js → page-creator-BPgx7zdJ.js} +2 -2
- package/dist/{page-creator-DDaI1HYj.cjs → page-creator-DbN3Nvq6.cjs} +1 -1
- package/dist/{page-lock-request-BKrxnEtQ.cjs → page-lock-request-BFkpw5VN.cjs} +1 -1
- package/dist/{page-lock-request-CjJFJKL2.js → page-lock-request-Br9S1AsA.js} +1 -1
- package/dist/{page-locked-by-dialog-b25_rn2m.cjs → page-locked-by-dialog-2h8cv1tO.cjs} +1 -1
- package/dist/{page-locked-by-dialog-DmsSmAY2.js → page-locked-by-dialog-DyLcMu33.js} +1 -1
- package/dist/{page-manager-new-EsIg6iQn.js → page-manager-new-B2oBm4pU.js} +28 -28
- package/dist/{page-manager-new-DiZVY7Me.cjs → page-manager-new-CAj6WV-C.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-CgY2qiXU.cjs → page-manager-search-and-filter-CWMXLTqE.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-Bt4T_dnB.js → page-manager-search-and-filter-WQYVXUAt.js} +2 -2
- package/dist/{page-revisions-content-DtI8CmtR.cjs → page-revisions-content-AMH8AxBU.cjs} +1 -1
- package/dist/{page-revisions-content-CsT6aF2I.js → page-revisions-content-DM-ngq3R.js} +7 -7
- package/dist/{publish-pages-content-KAuhOPv0.js → publish-pages-content-Dast4sG6.js} +12 -12
- package/dist/{publish-pages-content-DpC7RcTw.cjs → publish-pages-content-Dkv0Lok8.cjs} +1 -1
- package/dist/{save-to-lib-CeWaSQdB.js → save-to-lib-B5k0MVbW.js} +23 -23
- package/dist/{save-to-lib-BGpWGHJo.cjs → save-to-lib-DWtmtrUj.cjs} +1 -1
- package/dist/{seo-panel-Dhhpe_7z.js → seo-panel-D75jQH_j.js} +1 -1
- package/dist/{seo-panel-JDQ_7bOx.cjs → seo-panel-dBvEEfi9.cjs} +1 -1
- package/dist/{shared-json-ld-BYbdMttx.cjs → shared-json-ld-BvWyXBz_.cjs} +1 -1
- package/dist/{shared-json-ld-BliIbNv9.js → shared-json-ld-ZtwsYt9H.js} +1 -1
- package/dist/{slug-input-hJdU8DaF.js → slug-input-BEegJ8bv.js} +1 -1
- package/dist/{slug-input-QxBMijHP.cjs → slug-input-BITq28nI.cjs} +1 -1
- package/dist/{theme-panel-footer-BZnPvTkM.cjs → theme-panel-footer-DcASH9l1.cjs} +1 -1
- package/dist/{theme-panel-footer-D2B7iYW2.js → theme-panel-footer-zLXS6SHh.js} +1 -1
- package/dist/{unmark-as-template-Byn2RRAp.cjs → unmark-as-template-ChmjL4-w.cjs} +1 -1
- package/dist/{unmark-as-template-Dcpkj7EZ.js → unmark-as-template-DXFRY_pc.js} +1 -1
- package/dist/{unpublish-page-5Fi1wKXb.cjs → unpublish-page-BxN0deJK.cjs} +1 -1
- package/dist/{unpublish-page-CPLlsfm4.js → unpublish-page-DMteaCpR.js} +1 -1
- package/dist/use-page-expand-manager-2KjeYfVS.cjs +1 -0
- package/dist/use-page-expand-manager-D6T75I11.js +184 -0
- package/dist/{web-preview-YuuoRaZn.js → web-preview-BDTdFQ2h.js} +1 -1
- package/dist/{web-preview-CVvxe5Ll.cjs → web-preview-DM11qhOe.cjs} +1 -1
- package/package.json +2 -2
- package/dist/index-DFvsMFVH.js +0 -5160
- package/dist/index-Qnh8Lkr0.cjs +0 -5
- package/dist/use-page-expand-manager-DkyBiNpx.js +0 -85
- package/dist/use-page-expand-manager-To-SsGy3.cjs +0 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { useAtom as x } from "jotai";
|
|
2
|
+
import { useCallback as v } from "react";
|
|
3
|
+
import { isEmpty as p, uniq as S, union as A, flatMap as P, find as I, includes as O, filter as g } from "lodash-es";
|
|
4
|
+
let N = 0;
|
|
5
|
+
function w(t, e) {
|
|
6
|
+
const n = `atom${++N}`, s = {
|
|
7
|
+
toString() {
|
|
8
|
+
return n;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
return typeof t == "function" ? s.read = t : (s.init = t, s.read = _, s.write = C), e && (s.write = e), s;
|
|
12
|
+
}
|
|
13
|
+
function _(t) {
|
|
14
|
+
return t(this);
|
|
15
|
+
}
|
|
16
|
+
function C(t, e, n) {
|
|
17
|
+
return e(
|
|
18
|
+
this,
|
|
19
|
+
typeof n == "function" ? n(t(this)) : n
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const J = Symbol(
|
|
23
|
+
""
|
|
24
|
+
), y = (t) => typeof (t == null ? void 0 : t.then) == "function";
|
|
25
|
+
function L(t = () => {
|
|
26
|
+
try {
|
|
27
|
+
return window.localStorage;
|
|
28
|
+
} catch {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}, e) {
|
|
32
|
+
var n;
|
|
33
|
+
let s, i;
|
|
34
|
+
const a = {
|
|
35
|
+
getItem: (l, r) => {
|
|
36
|
+
var o, f;
|
|
37
|
+
const h = (m) => {
|
|
38
|
+
if (m = m || "", s !== m) {
|
|
39
|
+
try {
|
|
40
|
+
i = JSON.parse(m, e == null ? void 0 : e.reviver);
|
|
41
|
+
} catch {
|
|
42
|
+
return r;
|
|
43
|
+
}
|
|
44
|
+
s = m;
|
|
45
|
+
}
|
|
46
|
+
return i;
|
|
47
|
+
}, d = (f = (o = t()) == null ? void 0 : o.getItem(l)) != null ? f : null;
|
|
48
|
+
return y(d) ? d.then(h) : h(d);
|
|
49
|
+
},
|
|
50
|
+
setItem: (l, r) => {
|
|
51
|
+
var o;
|
|
52
|
+
return (o = t()) == null ? void 0 : o.setItem(
|
|
53
|
+
l,
|
|
54
|
+
JSON.stringify(r, void 0)
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
removeItem: (l) => {
|
|
58
|
+
var r;
|
|
59
|
+
return (r = t()) == null ? void 0 : r.removeItem(l);
|
|
60
|
+
}
|
|
61
|
+
}, u = (l) => (r, o, f) => l(r, (h) => {
|
|
62
|
+
let d;
|
|
63
|
+
try {
|
|
64
|
+
d = JSON.parse(h || "");
|
|
65
|
+
} catch {
|
|
66
|
+
d = f;
|
|
67
|
+
}
|
|
68
|
+
o(d);
|
|
69
|
+
});
|
|
70
|
+
let c;
|
|
71
|
+
try {
|
|
72
|
+
c = (n = t()) == null ? void 0 : n.subscribe;
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
return !c && typeof window < "u" && typeof window.addEventListener == "function" && window.Storage && (c = (l, r) => {
|
|
76
|
+
if (!(t() instanceof window.Storage))
|
|
77
|
+
return () => {
|
|
78
|
+
};
|
|
79
|
+
const o = (f) => {
|
|
80
|
+
f.storageArea === t() && f.key === l && r(f.newValue);
|
|
81
|
+
};
|
|
82
|
+
return window.addEventListener("storage", o), () => {
|
|
83
|
+
window.removeEventListener("storage", o);
|
|
84
|
+
};
|
|
85
|
+
}), c && (a.subscribe = u(c)), a;
|
|
86
|
+
}
|
|
87
|
+
const M = L();
|
|
88
|
+
function T(t, e, n = M, s) {
|
|
89
|
+
const i = w(
|
|
90
|
+
e
|
|
91
|
+
);
|
|
92
|
+
return i.onMount = (u) => {
|
|
93
|
+
u(n.getItem(t, e));
|
|
94
|
+
let c;
|
|
95
|
+
return n.subscribe && (c = n.subscribe(t, u, e)), c;
|
|
96
|
+
}, w(
|
|
97
|
+
(u) => u(i),
|
|
98
|
+
(u, c, l) => {
|
|
99
|
+
const r = typeof l == "function" ? l(u(i)) : l;
|
|
100
|
+
return r === J ? (c(i, e), n.removeItem(t)) : y(r) ? r.then((o) => (c(i, o), n.setItem(t, o))) : (c(i, r), n.setItem(t, r));
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
const k = T("expandedPagesState", []), b = (t) => P(t, (e) => [
|
|
105
|
+
e,
|
|
106
|
+
...e.children ? b(e.children) : []
|
|
107
|
+
]), F = (t, e) => {
|
|
108
|
+
const n = (s, i = []) => {
|
|
109
|
+
for (const a of s) {
|
|
110
|
+
const u = [...i, a.id];
|
|
111
|
+
if (a.id === e)
|
|
112
|
+
return u;
|
|
113
|
+
if (a.children && a.children.length > 0) {
|
|
114
|
+
const c = n(a.children, u);
|
|
115
|
+
if (c) return c;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
};
|
|
120
|
+
return n(t) || [];
|
|
121
|
+
}, E = (t, e) => {
|
|
122
|
+
if (!e) return [];
|
|
123
|
+
const n = b(t), s = I(n, (i) => i.id === e);
|
|
124
|
+
if (s) {
|
|
125
|
+
if (s.parent)
|
|
126
|
+
return [...E(t, s.parent), e];
|
|
127
|
+
const i = F(t, e);
|
|
128
|
+
if (!p(i))
|
|
129
|
+
return i;
|
|
130
|
+
}
|
|
131
|
+
return [e];
|
|
132
|
+
}, R = (t) => {
|
|
133
|
+
const e = /* @__PURE__ */ new Set(), n = (s, i = []) => {
|
|
134
|
+
s.forEach((a) => {
|
|
135
|
+
const u = [...i, a.id];
|
|
136
|
+
a.shouldExpandOnSearch && u.forEach((c) => e.add(c)), a.children && !p(a.children) && n(a.children, u);
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
return n(t), Array.from(e);
|
|
140
|
+
}, H = (t) => {
|
|
141
|
+
const [e, n] = x(k), s = t ? O(e, t) : !1, i = v(() => {
|
|
142
|
+
n(
|
|
143
|
+
(r) => s ? g(r, (o) => o !== t) : [...r, t]
|
|
144
|
+
);
|
|
145
|
+
}, [n, s, t]), a = v(
|
|
146
|
+
(r, o) => {
|
|
147
|
+
if (!o || p(r)) return;
|
|
148
|
+
const f = b(r), h = E(f, o);
|
|
149
|
+
if (!Array.isArray(h) || p(h)) return;
|
|
150
|
+
const d = h.slice(0, -1);
|
|
151
|
+
p(d) || n((m) => S([...m, ...d]));
|
|
152
|
+
},
|
|
153
|
+
[n]
|
|
154
|
+
), u = v(
|
|
155
|
+
(r) => {
|
|
156
|
+
if (p(r)) return;
|
|
157
|
+
const o = R(r);
|
|
158
|
+
p(o) || n((f) => A(f, o));
|
|
159
|
+
},
|
|
160
|
+
[n]
|
|
161
|
+
), c = v((r) => {
|
|
162
|
+
if (p(r)) return;
|
|
163
|
+
const o = P(r, (f) => {
|
|
164
|
+
const h = (d) => [d.id, ...d.children ? P(d.children, h) : []];
|
|
165
|
+
return h(f);
|
|
166
|
+
});
|
|
167
|
+
n(o);
|
|
168
|
+
}, [n]), l = v(() => {
|
|
169
|
+
n([]);
|
|
170
|
+
}, [n]);
|
|
171
|
+
return {
|
|
172
|
+
isExpanded: s,
|
|
173
|
+
toggleExpanded: i,
|
|
174
|
+
updateForSelectedPage: a,
|
|
175
|
+
expandedPages: e,
|
|
176
|
+
expandPagesOnSearch: u,
|
|
177
|
+
setExpandedPages: n,
|
|
178
|
+
expandAll: c,
|
|
179
|
+
collapseAll: l
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
export {
|
|
183
|
+
H as u
|
|
184
|
+
};
|
|
@@ -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-BSEA_u0X.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-MlpQJHWW.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","fill-rule":"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.
|
|
6
|
+
"version": "0.15.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"@chaibuilder/runtime": "2.2.0",
|
|
85
|
-
"@chaibuilder/sdk": "3.0.
|
|
85
|
+
"@chaibuilder/sdk": "3.0.9",
|
|
86
86
|
"@mhsdesign/jit-browser-tailwindcss": "^0.4.2",
|
|
87
87
|
"@radix-ui/react-icons": "^1.3.2",
|
|
88
88
|
"@supabase/supabase-js": "2.50.3",
|