@chaibuilder/sdk 1.1.11 → 1.1.13

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.
Files changed (86) hide show
  1. package/dist/{AddBlocks-Rd2EpNMr.js → AddBlocks-A7WofxHV.js} +29 -37
  2. package/dist/AddBlocks-Yuc4t0Z_.cjs +1 -0
  3. package/dist/{BrandingOptions-rTaSfm0M.cjs → BrandingOptions-KkPF1OGn.cjs} +1 -1
  4. package/dist/{BrandingOptions-OVjd8R6I.js → BrandingOptions-wkFrLFI_.js} +2 -2
  5. package/dist/{CanvasArea-zAT94LPr.js → CanvasArea-chEYQhH8.js} +52 -53
  6. package/dist/{CanvasArea-_eT3OREW.cjs → CanvasArea-kF46NWZK.cjs} +3 -3
  7. package/dist/{CurrentPage-awyWzrD1.js → CurrentPage-Wd7F9Egg.js} +15 -23
  8. package/dist/CurrentPage-p9MaXTOB.cjs +1 -0
  9. package/dist/{Layers-Iu48BWko.js → Layers-qMOMP2Mi.js} +9 -17
  10. package/dist/Layers-wQ0Fv9Xc.cjs +1 -0
  11. package/dist/{MarkAsGlobalBlock--GjBOKA4.js → MarkAsGlobalBlock-Czq45Amf.js} +2 -2
  12. package/dist/{MarkAsGlobalBlock-GV1kflbN.cjs → MarkAsGlobalBlock-sb3hMXLq.cjs} +1 -1
  13. package/dist/PagesPanel--maZxwX5.cjs +1 -0
  14. package/dist/{PagesPanel-FiGBY1m8.js → PagesPanel-ay4uk4mg.js} +7 -15
  15. package/dist/ProjectPanel-KhIpO7m3.cjs +1 -0
  16. package/dist/{ProjectPanel-c5QlZgrp.js → ProjectPanel-eLlbfAtj.js} +19 -27
  17. package/dist/{Settings-FuvoLEbx.js → Settings-lpoxaMDu.js} +8 -16
  18. package/dist/Settings-n2DpS5Ta.cjs +1 -0
  19. package/dist/SidePanels-Dud5Xh9L.cjs +1 -0
  20. package/dist/{SidePanels-2FjCLw9X.js → SidePanels-iRXV69vh.js} +10 -18
  21. package/dist/{Topbar-qloDpVn7.js → Topbar-dQYhW4iv.js} +2 -2
  22. package/dist/{Topbar-P3sqe-wG.cjs → Topbar-vqzjB75a.cjs} +1 -1
  23. package/dist/{UnsplashImages-8p0Vu9j_.cjs → UnsplashImages-3Sh4UZ-7.cjs} +1 -1
  24. package/dist/{UnsplashImages-aVlfl8Rj.js → UnsplashImages-AL1ASAoD.js} +2 -2
  25. package/dist/{UploadImages-7xgCWSqx.js → UploadImages-09wuhk2O.js} +2 -2
  26. package/dist/{UploadImages-PjW68B7L.cjs → UploadImages-mPzLhMiH.cjs} +1 -1
  27. package/dist/add-page-modal-FPnIWwqA.cjs +1 -0
  28. package/dist/{add-page-modal-o4WyfyUe.js → add-page-modal-TXREEFPZ.js} +20 -28
  29. package/dist/{confirm-alert-OQrR9mLj.js → confirm-alert-GkfW9chS.js} +2 -2
  30. package/dist/{confirm-alert-Wvv7pPyF.cjs → confirm-alert-YNyc3WEo.cjs} +1 -1
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.js +55 -63
  33. package/dist/{delete-page-modal-pWTbYmMV.js → delete-page-modal-LNME2FwD.js} +20 -28
  34. package/dist/delete-page-modal-sTbqZPvk.cjs +1 -0
  35. package/dist/{form-W_17vJvn.js → form-Fk4CaX1A.js} +1 -1
  36. package/dist/{form-1HQKf4Lc.cjs → form-OhgCJlVA.cjs} +1 -1
  37. package/dist/functions-ZWGlwlQY.cjs +1 -0
  38. package/dist/functions-slns6ONz.js +23 -0
  39. package/dist/html-to-json-kGgp07Hv.js +177 -0
  40. package/dist/html-to-json-po8on2ju.cjs +1 -0
  41. package/dist/{index-kVugkp77.cjs → index-61c5wSJn.cjs} +2 -2
  42. package/dist/{index-D15K4BZT.js → index-89A3jPHh.js} +2 -2
  43. package/dist/{index-MIe2pKhn.cjs → index-GNmGzavZ.cjs} +1 -1
  44. package/dist/{index-RYlMCgpN.js → index-Q5q5Y_8a.js} +16 -16
  45. package/dist/lib.cjs +2 -1
  46. package/dist/lib.d.ts +2 -65
  47. package/dist/lib.js +1140 -230
  48. package/dist/page-viewer-LPx-OTCC.js +110 -0
  49. package/dist/page-viewer-wQO9oV9h.cjs +1 -0
  50. package/dist/project-general-setting-8EwuN5lN.cjs +1 -0
  51. package/dist/{project-general-setting-rHyDn0aW.js → project-general-setting-sSpFUD_Y.js} +8 -16
  52. package/dist/{project-seo-setting-bW4cNODi.js → project-seo-setting-CGVegBtM.js} +3 -3
  53. package/dist/{project-seo-setting-uEYqfVt6.cjs → project-seo-setting-R77SKM1I.cjs} +1 -1
  54. package/dist/render.cjs +1 -1
  55. package/dist/render.js +44 -50
  56. package/dist/{single-page-detail-UUVe4WYc.js → single-page-detail-32H1_IG4.js} +54 -62
  57. package/dist/single-page-detail-nyBEHLtT.cjs +1 -0
  58. package/dist/studio.cjs +1 -1
  59. package/dist/studio.js +6 -14
  60. package/dist/tailwind.cjs +1 -1
  61. package/dist/tailwind.js +65 -7
  62. package/dist/ui.cjs +1 -1
  63. package/dist/ui.js +2 -2
  64. package/dist/{useAddBlockByDrop-8i3iNtPF.cjs → useAddBlockByDrop-4VH-SMj7.cjs} +1 -1
  65. package/dist/{useAddBlockByDrop-wiagwec5.js → useAddBlockByDrop-_kyR0iI4.js} +1 -1
  66. package/dist/utils-tx6hqsHY.cjs +1 -0
  67. package/dist/{utils-PPBbw5bk.js → utils-zWMk4dB2.js} +18 -17
  68. package/package.json +1 -1
  69. package/dist/AddBlocks-YS5XlqpG.cjs +0 -1
  70. package/dist/CurrentPage-J3WuljO3.cjs +0 -1
  71. package/dist/Layers-SkyPSf1R.cjs +0 -1
  72. package/dist/PagesPanel-dzL5sq6p.cjs +0 -1
  73. package/dist/ProjectPanel-uOP0fGfw.cjs +0 -1
  74. package/dist/Settings-QxjYc9wt.cjs +0 -1
  75. package/dist/SidePanels-9tKSnDxd.cjs +0 -1
  76. package/dist/add-page-modal-1ied5RTu.cjs +0 -1
  77. package/dist/delete-page-modal-fKBafNSA.cjs +0 -1
  78. package/dist/functions-JFP-oMsY.js +0 -1109
  79. package/dist/functions-KMQYiBHf.cjs +0 -2
  80. package/dist/page-viewer-CijLLu6R.js +0 -118
  81. package/dist/page-viewer-_mpbB5Lr.cjs +0 -1
  82. package/dist/project-general-setting-gwcHJ-ow.cjs +0 -1
  83. package/dist/single-page-detail-aNLmbldV.cjs +0 -1
  84. package/dist/tailwind-config-OxLD7oFU.cjs +0 -1
  85. package/dist/tailwind-config-d1VL1lzE.js +0 -62
  86. package/dist/utils-It2K33fU.cjs +0 -1
@@ -0,0 +1,110 @@
1
+ import { j as e } from "./jsx-runtime-NV737rRe.js";
2
+ import s, { useState as p, Suspense as l } from "react";
3
+ import { ChevronRightIcon as c, GearIcon as u, HomeIcon as d, FileTextIcon as x } from "@radix-ui/react-icons";
4
+ import { b0 as g, b1 as h, b2 as f } from "./index-89A3jPHh.js";
5
+ import { e as j, b, d as N } from "./index-Q5q5Y_8a.js";
6
+ import "./MODIFIERS-MLfpKQY1.js";
7
+ import "@radix-ui/react-toggle";
8
+ import "class-variance-authority";
9
+ import "./utils-zWMk4dB2.js";
10
+ import "lodash";
11
+ import "clsx";
12
+ import "tailwind-merge";
13
+ import "@radix-ui/react-switch";
14
+ import "@radix-ui/react-slot";
15
+ import "@radix-ui/react-accordion";
16
+ import "@radix-ui/react-alert-dialog";
17
+ import "@radix-ui/react-dialog";
18
+ import "@radix-ui/react-label";
19
+ import "@radix-ui/react-scroll-area";
20
+ import "@radix-ui/react-tabs";
21
+ import "@radix-ui/react-tooltip";
22
+ import "@radix-ui/react-popover";
23
+ import "@radix-ui/react-menubar";
24
+ import "@radix-ui/react-hover-card";
25
+ import "@radix-ui/react-select";
26
+ import "@radix-ui/react-dropdown-menu";
27
+ import "@radix-ui/react-separator";
28
+ import "@radix-ui/react-toast";
29
+ import "cmdk";
30
+ import "@radix-ui/react-context-menu";
31
+ import "react-icons-picker";
32
+ import "react-dom";
33
+ import "react-quill";
34
+ import "jotai";
35
+ import "flat-to-nested";
36
+ import "redux-undo";
37
+ import "@chaibuilder/runtime";
38
+ import "@react-hookz/web";
39
+ import "react-i18next";
40
+ import "i18next";
41
+ import "@floating-ui/react-dom";
42
+ import "react-textarea-autosize";
43
+ import "flagged";
44
+ import "react-dnd";
45
+ import "@minoru/react-dnd-treeview";
46
+ import "react-hotkeys-hook";
47
+ import "sonner";
48
+ import "./html-to-json-kGgp07Hv.js";
49
+ import "himalaya";
50
+ import "lucide-react";
51
+ const v = s.lazy(() => import("./single-page-detail-32H1_IG4.js")), P = ({ pageData: r }) => {
52
+ const [t, i] = p("CLOSE");
53
+ return /* @__PURE__ */ e.jsxs(
54
+ g,
55
+ {
56
+ open: t === "OPEN" || t === "ALERT" || t === "PENDING",
57
+ onOpenChange: (o) => {
58
+ i(t === "PENDING" ? "ALERT" : o ? "OPEN" : "CLOSE");
59
+ },
60
+ children: [
61
+ /* @__PURE__ */ e.jsx(
62
+ h,
63
+ {
64
+ asChild: !0,
65
+ onClick: (o) => {
66
+ o.stopPropagation(), i("OPEN");
67
+ },
68
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: t === "OPEN" || t === "ALERT" || t === "PENDING" ? /* @__PURE__ */ e.jsx(c, {}) : /* @__PURE__ */ e.jsx("div", { className: "hidden hover:text-blue-600 group-hover:flex", children: /* @__PURE__ */ e.jsx(u, {}) }) })
69
+ }
70
+ ),
71
+ /* @__PURE__ */ e.jsx(f, { side: "right", align: "start", alignOffset: -35, className: "h-screen w-96", children: /* @__PURE__ */ e.jsx(
72
+ l,
73
+ {
74
+ fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full animate-pulse flex-col gap-y-3", children: [
75
+ /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-6 w-1/2" }),
76
+ /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" }),
77
+ /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" })
78
+ ] }),
79
+ children: /* @__PURE__ */ e.jsx(v, { pageData: r, open: t, setOpen: i })
80
+ }
81
+ ) })
82
+ ]
83
+ }
84
+ );
85
+ }, E = (r) => {
86
+ const [t] = j(), { data: i } = b(), o = N(), m = (i == null ? void 0 : i.homepage) === r.uuid, a = t === r.uuid, n = () => o(r);
87
+ return i ? /* @__PURE__ */ e.jsxs(
88
+ "button",
89
+ {
90
+ className: `group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a ? "bg-blue-200 " : ""}`,
91
+ onClick: n,
92
+ type: "button",
93
+ children: [
94
+ /* @__PURE__ */ e.jsxs("div", { className: "flex text-sm items-center gap-x-1.5", children: [
95
+ m ? /* @__PURE__ */ e.jsx(d, {}) : /* @__PURE__ */ e.jsx(x, {}),
96
+ " ",
97
+ r.name
98
+ ] }),
99
+ /* @__PURE__ */ e.jsx(P, { pageData: r })
100
+ ]
101
+ }
102
+ ) : null;
103
+ }, Ne = ({ pages: r, isLoading: t }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
104
+ /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
105
+ /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
106
+ /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" })
107
+ ] }) : r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "px-2.5 pb-2 pt-4", children: "No pages" }) : /* @__PURE__ */ e.jsx("div", { className: "-mb-2", children: s.Children.toArray(r.map((i) => /* @__PURE__ */ e.jsx(E, { ...i }))) });
108
+ export {
109
+ Ne as default
110
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-GNmGzavZ.cjs"),x=require("./index-61c5wSJn.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-tx6hqsHY.cjs");require("lodash");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-po8on2ju.cjs");require("himalaya");require("lucide-react");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-nyBEHLtT.cjs"))),j=({pageData:s})=>{const[r,i]=u.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:t=>{i(r==="PENDING"?"ALERT":t?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:t=>{t.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(m,{pageData:s,open:r,setOpen:i})})})]})},p=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),t=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>t(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(j,{pageData:s})]}):null},q=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:u.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(p,{...i})))});exports.default=q;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-WUGKV8jN.cjs"),a=require("react"),f=require("./index-GNmGzavZ.cjs"),o=require("./controls-aHZq-q4b.cjs"),d=require("./form-OhgCJlVA.cjs"),m=require("./index-61c5wSJn.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-tx6hqsHY.cjs");require("lodash");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-po8on2ju.cjs");require("himalaya");require("lucide-react");function j(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const g=j(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();g.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.u({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.o({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=b;
@@ -1,13 +1,13 @@
1
1
  import { j as i } from "./jsx-runtime-NV737rRe.js";
2
2
  import * as l from "react";
3
- import { bo as n } from "./index-D15K4BZT.js";
3
+ import { bo as n } from "./index-89A3jPHh.js";
4
4
  import { u as c, o as u } from "./controls-G0puEH71.js";
5
- import { F as d } from "./form-W_17vJvn.js";
6
- import { b as x } from "./index-RYlMCgpN.js";
5
+ import { F as d } from "./form-Fk4CaX1A.js";
6
+ import { b as x } from "./index-Q5q5Y_8a.js";
7
7
  import "./MODIFIERS-MLfpKQY1.js";
8
8
  import "@radix-ui/react-toggle";
9
9
  import "class-variance-authority";
10
- import "./utils-PPBbw5bk.js";
10
+ import "./utils-zWMk4dB2.js";
11
11
  import "lodash";
12
12
  import "clsx";
13
13
  import "tailwind-merge";
@@ -47,20 +47,12 @@ import "react-textarea-autosize";
47
47
  import "flagged";
48
48
  import "react-dnd";
49
49
  import "@minoru/react-dnd-treeview";
50
- import "./lib.js";
51
- import "himalaya";
52
- import "./functions-JFP-oMsY.js";
53
- import "@mhsdesign/jit-browser-tailwindcss";
54
- import "@bobthered/tailwindcss-palette-generator";
55
- import "@tailwindcss/forms";
56
- import "@tailwindcss/typography";
57
- import "@tailwindcss/aspect-ratio";
58
- import "@tailwindcss/line-clamp";
59
- import "./tailwind-config-d1VL1lzE.js";
60
50
  import "react-hotkeys-hook";
61
51
  import "sonner";
52
+ import "./html-to-json-kGgp07Hv.js";
53
+ import "himalaya";
62
54
  import "lucide-react";
63
- const Eo = ({
55
+ const jo = ({
64
56
  _projectData: m,
65
57
  seany: t
66
58
  }) => {
@@ -83,5 +75,5 @@ const Eo = ({
83
75
  return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(d, { properties: a, disabled: p, formData: m, onChange: e }) });
84
76
  };
85
77
  export {
86
- Eo as default
78
+ jo as default
87
79
  };
@@ -1,15 +1,15 @@
1
1
  import { j as s } from "./jsx-runtime-NV737rRe.js";
2
2
  import { b as D, u as c, g, o as x } from "./controls-G0puEH71.js";
3
- import { F as v } from "./form-W_17vJvn.js";
3
+ import { F as v } from "./form-Fk4CaX1A.js";
4
4
  import "./MODIFIERS-MLfpKQY1.js";
5
5
  import "react";
6
6
  import "lodash";
7
7
  import "@rjsf/core";
8
8
  import "@rjsf/validator-ajv8";
9
- import "./index-D15K4BZT.js";
9
+ import "./index-89A3jPHh.js";
10
10
  import "@radix-ui/react-toggle";
11
11
  import "class-variance-authority";
12
- import "./utils-PPBbw5bk.js";
12
+ import "./utils-zWMk4dB2.js";
13
13
  import "clsx";
14
14
  import "tailwind-merge";
15
15
  import "@radix-ui/react-switch";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-WUGKV8jN.cjs"),i=require("./controls-aHZq-q4b.cjs"),g=require("./form-1HQKf4Lc.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("lodash");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-MIe2pKhn.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");const D=({_projectData:e,seany:n})=>{var t,u,o,s,q,a;const d=({formData:f})=>{const r={...f};r.seoData.title===void 0&&(r.seoData.title=""),r.seoData.description===void 0&&(r.seoData.description=""),r.seoData.image===void 0&&(r.seoData.image=""),n(m=>({...m,...r}))},c={seoData:i.b({title:"",default:{title:((t=e.seoData)==null?void 0:t.title)||"",description:((u=e.seoData)==null?void 0:u.description)||"",image:((o=e.seoData)==null?void 0:o.image)||""},properties:{title:i.u({title:"Default Title",default:((s=e.seoData)==null?void 0:s.title)||""}),description:i.g({title:"Default Description",default:((q=e.seoData)==null?void 0:q.description)||""}),image:i.o({title:"Social Media Image",default:((a=e.seoData)==null?void 0:a.image)||""})}})};return l.jsxRuntimeExports.jsx("div",{className:"flex h-full select-none flex-col",children:l.jsxRuntimeExports.jsx(g.Form,{properties:c,formData:e,onChange:d})})};exports.default=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-WUGKV8jN.cjs"),i=require("./controls-aHZq-q4b.cjs"),g=require("./form-OhgCJlVA.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("lodash");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-GNmGzavZ.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-tx6hqsHY.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");const D=({_projectData:e,seany:n})=>{var t,u,o,s,q,a;const d=({formData:f})=>{const r={...f};r.seoData.title===void 0&&(r.seoData.title=""),r.seoData.description===void 0&&(r.seoData.description=""),r.seoData.image===void 0&&(r.seoData.image=""),n(m=>({...m,...r}))},c={seoData:i.b({title:"",default:{title:((t=e.seoData)==null?void 0:t.title)||"",description:((u=e.seoData)==null?void 0:u.description)||"",image:((o=e.seoData)==null?void 0:o.image)||""},properties:{title:i.u({title:"Default Title",default:((s=e.seoData)==null?void 0:s.title)||""}),description:i.g({title:"Default Description",default:((q=e.seoData)==null?void 0:q.description)||""}),image:i.o({title:"Social Media Image",default:((a=e.seoData)==null?void 0:a.image)||""})}})};return l.jsxRuntimeExports.jsx("div",{className:"flex h-full select-none flex-col",children:l.jsxRuntimeExports.jsx(g.Form,{properties:c,formData:e,onChange:d})})};exports.default=D;
package/dist/render.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-WUGKV8jN.cjs"),j=require("react"),r=require("lodash"),R=require("tailwind-merge"),l=require("./MODIFIERS-WFzDQfiT.cjs"),_=require("@chaibuilder/runtime"),x=require("./functions-KMQYiBHf.cjs"),q=require("react-wrap-balancer");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");const y=t=>{const s={};return Object.keys(t).forEach(e=>{r.isString(t[e])&&t[e].startsWith(l.SLOT_KEY)&&(s[e]=t[e].replace(l.SLOT_KEY,"").split(","))}),s},B=r.memoize((t,s)=>{const e=t.replace(l.STYLES_KEY,"").split(","),n=R.twMerge(e[0],e[1]);return x.addPrefixToClasses(n,s).replace(l.STYLES_KEY,"").trim()});function C(t,s){return r.get(t,`${s}_attrs`,{})}function O(t,s){const e={};return Object.keys(t).forEach(n=>{if(r.isString(t[n])&&t[n].startsWith(l.STYLES_KEY)){const o=B(t[n],s);e[n]={className:o,...C(t,n)}}}),e}function T(t,s){const e=r.get(t,"_bindings",{});return r.isEmpty(e)?{...t}:(r.each(e,(n,o)=>{r.isString(n)&&r.get(s,n,null)&&(t[o]=r.get(s,n,null))}),t)}function a({blocks:t,parent:s,classPrefix:e="c-",externalData:n={}}){const o=t,p=i=>O(i,e),f=s?r.filter(t,{_parent:s}):r.filter(t,i=>r.isEmpty(i._parent));return c.jsxRuntimeExports.jsx(c.jsxRuntimeExports.Fragment,{children:j.Children.toArray(f.map((i,h)=>{const d=y(i),m={};r.isEmpty(d)||Object.keys(d).forEach(u=>{m[u]=j.Children.toArray(d[u].map(E=>c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:e,blocks:o,parent:E})))});const S=r.filter(o,{_parent:i._id});m.children=S.length>0?c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:e,parent:i._id,blocks:o}):null;const g=_.getBlockComponent(i._type);if(g!==null){let u=i;const E=g.component;return u={...g.defaults,...i},j.createElement(E,r.omit({blockProps:{},inBuilder:!1,...u,index:h,...T(i,n),...p(u),...m},["_parent"]))}return c.jsxRuntimeExports.jsxs("noscript",{children:[i._type," not found"]})}))})}const Y=({pageData:t,externalData:s={},before:e=null,after:n=null,classPrefix:o="c-"})=>{const p=r.get(t.project,"brandingOptions",l.BRANDING_OPTIONS_DEFAULTS);return c.jsxRuntimeExports.jsxs(c.jsxRuntimeExports.Fragment,{children:[e,c.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+x.getBrandingClasses(p,o)+" min-h-screen",children:c.jsxRuntimeExports.jsx(q.Provider,{children:c.jsxRuntimeExports.jsx(a,{externalData:s,blocks:t.page.blocks||[],classPrefix:o})})}),n]})};exports.RenderChaiBlocks=a;exports.RenderChaiPage=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-WUGKV8jN.cjs"),j=require("react"),s=require("lodash"),R=require("tailwind-merge"),u=require("./MODIFIERS-WFzDQfiT.cjs"),_=require("@chaibuilder/runtime"),x=require("./functions-ZWGlwlQY.cjs"),y=require("react-wrap-balancer"),B=t=>{const r={};return Object.keys(t).forEach(e=>{s.isString(t[e])&&t[e].startsWith(u.SLOT_KEY)&&(r[e]=t[e].replace(u.SLOT_KEY,"").split(","))}),r},C=s.memoize((t,r)=>{const e=t.replace(u.STYLES_KEY,"").split(","),n=R.twMerge(e[0],e[1]);return x.addPrefixToClasses(n,r).replace(u.STYLES_KEY,"").trim()});function O(t,r){return s.get(t,`${r}_attrs`,{})}function T(t,r){const e={};return Object.keys(t).forEach(n=>{if(s.isString(t[n])&&t[n].startsWith(u.STYLES_KEY)){const o=C(t[n],r);e[n]={className:o,...O(t,n)}}}),e}function q(t,r){const e=s.get(t,"_bindings",{});return s.isEmpty(e)?{...t}:(s.each(e,(n,o)=>{s.isString(n)&&s.get(r,n,null)&&(t[o]=s.get(r,n,null))}),t)}function a({blocks:t,parent:r,classPrefix:e="c-",externalData:n={}}){const o=t,p=i=>T(i,e),f=r?s.filter(t,{_parent:r}):s.filter(t,i=>s.isEmpty(i._parent));return c.jsxRuntimeExports.jsx(c.jsxRuntimeExports.Fragment,{children:j.Children.toArray(f.map((i,h)=>{const d=B(i),m={};s.isEmpty(d)||Object.keys(d).forEach(l=>{m[l]=j.Children.toArray(d[l].map(E=>c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:e,blocks:o,parent:E})))});const S=s.filter(o,{_parent:i._id});m.children=S.length>0?c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:e,parent:i._id,blocks:o}):null;const g=_.getBlockComponent(i._type);if(g!==null){let l=i;const E=g.component;return l={...g.defaults,...i},j.createElement(E,s.omit({blockProps:{},inBuilder:!1,...l,index:h,...q(i,n),...p(l),...m},["_parent"]))}return c.jsxRuntimeExports.jsxs("noscript",{children:[i._type," not found"]})}))})}const Y=({pageData:t,externalData:r={},before:e=null,after:n=null,classPrefix:o="c-"})=>{const p=s.get(t.project,"brandingOptions",u.BRANDING_OPTIONS_DEFAULTS);return c.jsxRuntimeExports.jsxs(c.jsxRuntimeExports.Fragment,{children:[e,c.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+x.getBrandingClasses(p,o)+" min-h-screen",children:c.jsxRuntimeExports.jsx(y.Provider,{children:c.jsxRuntimeExports.jsx(a,{externalData:r,blocks:t.page.blocks||[],classPrefix:o})})}),n]})};exports.RenderChaiBlocks=a;exports.RenderChaiPage=Y;
package/dist/render.js CHANGED
@@ -1,63 +1,57 @@
1
1
  import { j as o } from "./jsx-runtime-NV737rRe.js";
2
2
  import u from "react";
3
- import { isString as E, memoize as y, get as m, isEmpty as h, each as A, filter as g, omit as x } from "lodash";
3
+ import { isString as E, memoize as y, get as c, isEmpty as h, each as A, filter as g, omit as x } from "lodash";
4
4
  import { twMerge as N } from "tailwind-merge";
5
5
  import { S as B, a as _, B as R } from "./MODIFIERS-MLfpKQY1.js";
6
6
  import { getBlockComponent as T } from "@chaibuilder/runtime";
7
- import { a as F, g as L } from "./functions-JFP-oMsY.js";
7
+ import { a as F, g as L } from "./functions-slns6ONz.js";
8
8
  import { Provider as Y } from "react-wrap-balancer";
9
- import "@mhsdesign/jit-browser-tailwindcss";
10
- import "@bobthered/tailwindcss-palette-generator";
11
- import "@tailwindcss/forms";
12
- import "@tailwindcss/typography";
13
- import "@tailwindcss/aspect-ratio";
14
- import "@tailwindcss/line-clamp";
15
9
  const I = (t) => {
16
- const s = {};
10
+ const r = {};
17
11
  return Object.keys(t).forEach((n) => {
18
- E(t[n]) && t[n].startsWith(B) && (s[n] = t[n].replace(B, "").split(","));
19
- }), s;
20
- }, K = y((t, s) => {
21
- const n = t.replace(_, "").split(","), r = N(n[0], n[1]);
22
- return F(r, s).replace(_, "").trim();
12
+ E(t[n]) && t[n].startsWith(B) && (r[n] = t[n].replace(B, "").split(","));
13
+ }), r;
14
+ }, K = y((t, r) => {
15
+ const n = t.replace(_, "").split(","), s = N(n[0], n[1]);
16
+ return F(s, r).replace(_, "").trim();
23
17
  });
24
- function W(t, s) {
25
- return m(t, `${s}_attrs`, {});
18
+ function W(t, r) {
19
+ return c(t, `${r}_attrs`, {});
26
20
  }
27
- function w(t, s) {
21
+ function w(t, r) {
28
22
  const n = {};
29
- return Object.keys(t).forEach((r) => {
30
- if (E(t[r]) && t[r].startsWith(_)) {
31
- const i = K(t[r], s);
32
- n[r] = {
23
+ return Object.keys(t).forEach((s) => {
24
+ if (E(t[s]) && t[s].startsWith(_)) {
25
+ const i = K(t[s], r);
26
+ n[s] = {
33
27
  className: i,
34
- ...W(t, r)
28
+ ...W(t, s)
35
29
  };
36
30
  }
37
31
  }), n;
38
32
  }
39
- function z(t, s) {
40
- const n = m(t, "_bindings", {});
41
- return h(n) ? { ...t } : (A(n, (r, i) => {
42
- E(r) && m(s, r, null) && (t[i] = m(s, r, null));
33
+ function z(t, r) {
34
+ const n = c(t, "_bindings", {});
35
+ return h(n) ? { ...t } : (A(n, (s, i) => {
36
+ E(s) && c(r, s, null) && (t[i] = c(r, s, null));
43
37
  }), t);
44
38
  }
45
39
  function j({
46
40
  blocks: t,
47
- parent: s,
41
+ parent: r,
48
42
  classPrefix: n = "c-",
49
- externalData: r = {}
43
+ externalData: s = {}
50
44
  }) {
51
- const i = t, a = (e) => w(e, n), S = s ? g(t, { _parent: s }) : g(t, (e) => h(e._parent));
45
+ const i = t, l = (e) => w(e, n), S = r ? g(t, { _parent: r }) : g(t, (e) => h(e._parent));
52
46
  return /* @__PURE__ */ o.jsx(o.Fragment, { children: u.Children.toArray(
53
47
  S.map((e, C) => {
54
- const c = I(e), l = {};
55
- h(c) || Object.keys(c).forEach((p) => {
56
- l[p] = u.Children.toArray(
57
- c[p].map((f) => /* @__PURE__ */ o.jsx(
48
+ const p = I(e), m = {};
49
+ h(p) || Object.keys(p).forEach((a) => {
50
+ m[a] = u.Children.toArray(
51
+ p[a].map((f) => /* @__PURE__ */ o.jsx(
58
52
  j,
59
53
  {
60
- externalData: r,
54
+ externalData: s,
61
55
  classPrefix: n,
62
56
  blocks: i,
63
57
  parent: f
@@ -66,10 +60,10 @@ function j({
66
60
  );
67
61
  });
68
62
  const O = g(i, { _parent: e._id });
69
- l.children = O.length > 0 ? /* @__PURE__ */ o.jsx(
63
+ m.children = O.length > 0 ? /* @__PURE__ */ o.jsx(
70
64
  j,
71
65
  {
72
- externalData: r,
66
+ externalData: s,
73
67
  classPrefix: n,
74
68
  parent: e._id,
75
69
  blocks: i
@@ -77,19 +71,19 @@ function j({
77
71
  ) : null;
78
72
  const d = T(e._type);
79
73
  if (d !== null) {
80
- let p = e;
74
+ let a = e;
81
75
  const f = d.component;
82
- return p = { ...d.defaults, ...e }, u.createElement(
76
+ return a = { ...d.defaults, ...e }, u.createElement(
83
77
  f,
84
78
  x(
85
79
  {
86
80
  blockProps: {},
87
81
  inBuilder: !1,
88
- ...p,
82
+ ...a,
89
83
  index: C,
90
- ...z(e, r),
91
- ...a(p),
92
- ...l
84
+ ...z(e, s),
85
+ ...l(a),
86
+ ...m
93
87
  },
94
88
  ["_parent"]
95
89
  )
@@ -102,27 +96,27 @@ function j({
102
96
  })
103
97
  ) });
104
98
  }
105
- const b = ({
99
+ const J = ({
106
100
  pageData: t,
107
- externalData: s = {},
101
+ externalData: r = {},
108
102
  before: n = null,
109
- after: r = null,
103
+ after: s = null,
110
104
  classPrefix: i = "c-"
111
105
  }) => {
112
- const a = m(t.project, "brandingOptions", R);
106
+ const l = c(t.project, "brandingOptions", R);
113
107
  return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
114
108
  n,
115
109
  /* @__PURE__ */ o.jsx(
116
110
  "div",
117
111
  {
118
- className: i.replace("-", "") + " " + L(a, i) + " min-h-screen",
119
- children: /* @__PURE__ */ o.jsx(Y, { children: /* @__PURE__ */ o.jsx(j, { externalData: s, blocks: t.page.blocks || [], classPrefix: i }) })
112
+ className: i.replace("-", "") + " " + L(l, i) + " min-h-screen",
113
+ children: /* @__PURE__ */ o.jsx(Y, { children: /* @__PURE__ */ o.jsx(j, { externalData: r, blocks: t.page.blocks || [], classPrefix: i }) })
120
114
  }
121
115
  ),
122
- r
116
+ s
123
117
  ] });
124
118
  };
125
119
  export {
126
120
  j as RenderChaiBlocks,
127
- b as RenderChaiPage
121
+ J as RenderChaiPage
128
122
  };
@@ -1,16 +1,16 @@
1
- import { j as s } from "./jsx-runtime-NV737rRe.js";
1
+ import { j as t } from "./jsx-runtime-NV737rRe.js";
2
2
  import I, { useState as j, useEffect as z } from "react";
3
3
  import { isString as L, isEmpty as x, isEqual as C, omit as y, kebabCase as B } from "lodash";
4
4
  import { HomeIcon as G } from "@radix-ui/react-icons";
5
- import { bo as Y, B as q } from "./index-D15K4BZT.js";
5
+ import { bo as Y, B as q } from "./index-89A3jPHh.js";
6
6
  import { u as g, b as Z, g as $, o as F, r as Q } from "./controls-G0puEH71.js";
7
7
  import { toast as U } from "sonner";
8
- import { F as h } from "./form-W_17vJvn.js";
9
- import { h as V, b as X, i as _, c as K } from "./index-RYlMCgpN.js";
8
+ import { F as h } from "./form-Fk4CaX1A.js";
9
+ import { h as V, b as X, i as _, c as K } from "./index-Q5q5Y_8a.js";
10
10
  import "./MODIFIERS-MLfpKQY1.js";
11
11
  import "@radix-ui/react-toggle";
12
12
  import "class-variance-authority";
13
- import "./utils-PPBbw5bk.js";
13
+ import "./utils-zWMk4dB2.js";
14
14
  import "clsx";
15
15
  import "tailwind-merge";
16
16
  import "@radix-ui/react-switch";
@@ -48,76 +48,68 @@ import "react-textarea-autosize";
48
48
  import "flagged";
49
49
  import "react-dnd";
50
50
  import "@minoru/react-dnd-treeview";
51
- import "./lib.js";
52
- import "himalaya";
53
- import "./functions-JFP-oMsY.js";
54
- import "@mhsdesign/jit-browser-tailwindcss";
55
- import "@bobthered/tailwindcss-palette-generator";
56
- import "@tailwindcss/forms";
57
- import "@tailwindcss/typography";
58
- import "@tailwindcss/aspect-ratio";
59
- import "@tailwindcss/line-clamp";
60
- import "./tailwind-config-d1VL1lzE.js";
61
51
  import "react-hotkeys-hook";
52
+ import "./html-to-json-kGgp07Hv.js";
53
+ import "himalaya";
62
54
  import "lucide-react";
63
- const O = I.lazy(() => import("./delete-page-modal-pWTbYmMV.js")), J = I.lazy(() => import("./confirm-alert-OQrR9mLj.js")), P = (r) => {
55
+ const O = I.lazy(() => import("./delete-page-modal-LNME2FwD.js")), J = I.lazy(() => import("./confirm-alert-GkfW9chS.js")), P = (r) => {
64
56
  if (!L(r) || !(r.includes("/[") && r.includes("]")))
65
57
  return !1;
66
- const t = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, p = /^[a-zA-Z0-9_-]+$/;
58
+ const s = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, u = /^[a-zA-Z0-9_-]+$/;
67
59
  let e = !0;
68
- return r.split("/").forEach((m) => {
69
- e && (m.includes("[[") && m.includes("]]") ? e = /^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(m) : m.includes("[") && m.includes("]") ? e = t.test(m) : e = p.test(m));
60
+ return r.split("/").forEach((n) => {
61
+ e && (n.includes("[[") && n.includes("]]") ? e = /^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(n) : n.includes("[") && n.includes("]") ? e = s.test(n) : e = u.test(n));
70
62
  }), e;
71
63
  }, f = (r) => r && x(r.seoData) ? {
72
64
  ...r,
73
65
  seoData: { title: "", description: "", image: "" }
74
- } : r, W = (r, n) => {
75
- const t = !C(y(r, ["seoData"]), y(n, ["seoData"])), p = !C(f(n).seoData, f(r).seoData);
76
- return t || p;
77
- }, mi = ({ open: r, setOpen: n, pageData: t }) => {
78
- const p = V(), { data: e } = X(), m = _(), c = K("Homepage updated successfully."), [i, T] = j(f(t)), [d, v] = j({
79
- isHomePage: (e == null ? void 0 : e.homepage) === t.uuid
80
- }), N = W(i, t);
66
+ } : r, W = (r, m) => {
67
+ const s = !C(y(r, ["seoData"]), y(m, ["seoData"])), u = !C(f(m).seoData, f(r).seoData);
68
+ return s || u;
69
+ }, ke = ({ open: r, setOpen: m, pageData: s }) => {
70
+ const u = V(), { data: e } = X(), n = _(), c = K("Homepage updated successfully."), [i, T] = j(f(s)), [d, v] = j({
71
+ isHomePage: (e == null ? void 0 : e.homepage) === s.uuid
72
+ }), N = W(i, s);
81
73
  z(() => {
82
- const l = !C(f(t), i), o = (e == null ? void 0 : e.homepage) !== t.uuid && d.isHomePage;
83
- n(l || o ? "PENDING" : "OPEN");
84
- }, [e, t, i, d, n]);
74
+ const l = !C(f(s), i), o = (e == null ? void 0 : e.homepage) !== s.uuid && d.isHomePage;
75
+ m(l || o ? "PENDING" : "OPEN");
76
+ }, [e, s, i, d, m]);
85
77
  const S = () => {
86
78
  if (N) {
87
- if (t.type === "DYNAMIC" && !P((i == null ? void 0 : i.slug) || "")) {
88
- r === "ALERT" && n("PENDING");
79
+ if (s.type === "DYNAMIC" && !P((i == null ? void 0 : i.slug) || "")) {
80
+ r === "ALERT" && m("PENDING");
89
81
  return;
90
82
  }
91
- m.mutate(i, {
83
+ n.mutate(i, {
92
84
  onSuccess: () => {
93
- p.invalidateQueries({
85
+ u.invalidateQueries({
94
86
  refetchType: "active",
95
87
  queryKey: ["pages", e == null ? void 0 : e.uuid]
96
- }), n("CLOSE"), U.success("Page updated successfully.");
88
+ }), m("CLOSE"), U.success("Page updated successfully.");
97
89
  }
98
90
  });
99
91
  }
100
- d.isHomePage && (e == null ? void 0 : e.homepage) !== t.uuid && c.mutate({ ...e, homepage: t == null ? void 0 : t.uuid }, { onSuccess: () => n("CLOSE") });
92
+ d.isHomePage && (e == null ? void 0 : e.homepage) !== s.uuid && c.mutate({ ...e, homepage: s == null ? void 0 : s.uuid }, { onSuccess: () => m("CLOSE") });
101
93
  }, b = ({ formData: l }, o) => {
102
- T((u) => {
94
+ T((p) => {
103
95
  var E, A;
104
96
  if (!o)
105
- return u;
97
+ return p;
106
98
  const a = { [o]: l[o] };
107
99
  return o === "name" ? a.slug = B((E = l[o]) == null ? void 0 : E.replace(/\d/g, "")) : o === "slug" ? a.slug = (A = l[o]) == null ? void 0 : A.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_") : o === "seoData" && (a.seoData = {
108
100
  title: l[o].title || "",
109
101
  description: l[o].description || "",
110
102
  image: l[o].image || ""
111
103
  }), {
112
- ...u,
104
+ ...p,
113
105
  ...a
114
106
  };
115
107
  });
116
108
  }, H = ({ formData: l }, o) => {
117
- v((u) => {
109
+ v((p) => {
118
110
  const a = { [o]: l[o] };
119
111
  return {
120
- ...u,
112
+ ...p,
121
113
  ...a
122
114
  };
123
115
  });
@@ -154,73 +146,73 @@ const O = I.lazy(() => import("./delete-page-modal-pWTbYmMV.js")), J = I.lazy(()
154
146
  default: d.isHomePage
155
147
  })
156
148
  };
157
- return /* @__PURE__ */ s.jsxs(Y, { className: "flex h-full select-none flex-col", children: [
158
- /* @__PURE__ */ s.jsx(
149
+ return /* @__PURE__ */ t.jsxs(Y, { className: "flex h-full select-none flex-col", children: [
150
+ /* @__PURE__ */ t.jsx(
159
151
  J,
160
152
  {
161
153
  open: r === "ALERT",
162
154
  title: "Do yo want to save changes?",
163
- onCancel: () => n("CLOSE"),
155
+ onCancel: () => m("CLOSE"),
164
156
  onConfirm: S,
165
- disabled: c.isPending || m.isPending
157
+ disabled: c.isPending || n.isPending
166
158
  }
167
159
  ),
168
- /* @__PURE__ */ s.jsx("div", { className: "rounded-md bg-background/30 px-2.5 py-1", children: /* @__PURE__ */ s.jsx("h1", { className: "px-1 font-semibold", children: "Page Details" }) }),
169
- /* @__PURE__ */ s.jsx("div", { className: "px-2.5 pt-2", children: /* @__PURE__ */ s.jsxs("div", { className: "flex flex-col space-y-2", children: [
170
- /* @__PURE__ */ s.jsx(
160
+ /* @__PURE__ */ t.jsx("div", { className: "rounded-md bg-background/30 px-2.5 py-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Page Details" }) }),
161
+ /* @__PURE__ */ t.jsx("div", { className: "px-2.5 pt-2", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col space-y-2", children: [
162
+ /* @__PURE__ */ t.jsx(
171
163
  h,
172
164
  {
173
165
  title: "Basic Details",
174
166
  formData: i,
175
167
  properties: M,
176
168
  onChange: b,
177
- disabled: m.isPending || c.isPending
169
+ disabled: n.isPending || c.isPending
178
170
  }
179
171
  ),
180
- /* @__PURE__ */ s.jsx("div", { className: "h-2 w-full" }),
181
- /* @__PURE__ */ s.jsx(
172
+ /* @__PURE__ */ t.jsx("div", { className: "h-2 w-full" }),
173
+ /* @__PURE__ */ t.jsx(
182
174
  h,
183
175
  {
184
176
  title: "SEO Details",
185
177
  formData: i,
186
178
  properties: w,
187
179
  onChange: b,
188
- disabled: m.isPending || c.isPending
180
+ disabled: n.isPending || c.isPending
189
181
  }
190
182
  ),
191
- (e == null ? void 0 : e.homepage) !== t.uuid && t.type === "STATIC" ? /* @__PURE__ */ s.jsx(
183
+ (e == null ? void 0 : e.homepage) !== s.uuid && s.type === "STATIC" ? /* @__PURE__ */ t.jsx(
192
184
  h,
193
185
  {
194
186
  formData: d,
195
187
  properties: R,
196
188
  onChange: H,
197
- disabled: m.isPending || c.isPending
189
+ disabled: n.isPending || c.isPending
198
190
  }
199
- ) : t.type === "STATIC" && /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500", children: [
200
- /* @__PURE__ */ s.jsx(G, {}),
191
+ ) : s.type === "STATIC" && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500", children: [
192
+ /* @__PURE__ */ t.jsx(G, {}),
201
193
  " This is homepage",
202
194
  " "
203
195
  ] }),
204
- i.type === "DYNAMIC" && !P((i == null ? void 0 : i.slug) || "") && /* @__PURE__ */ s.jsxs("small", { className: "px-1 text-red-400", children: [
196
+ i.type === "DYNAMIC" && !P((i == null ? void 0 : i.slug) || "") && /* @__PURE__ */ t.jsxs("small", { className: "px-1 text-red-400", children: [
205
197
  "Add dynamic ID in page slug Eg: ",
206
- /* @__PURE__ */ s.jsx("i", { className: "underline", children: "some-url/[some-id]" })
198
+ /* @__PURE__ */ t.jsx("i", { className: "underline", children: "some-url/[some-id]" })
207
199
  ] }),
208
- /* @__PURE__ */ s.jsxs("div", { className: "my-2 flex w-full items-center justify-between gap-x-2 px-1", children: [
209
- /* @__PURE__ */ s.jsx(
200
+ /* @__PURE__ */ t.jsxs("div", { className: "my-2 flex w-full items-center justify-between gap-x-2 px-1", children: [
201
+ /* @__PURE__ */ t.jsx(
210
202
  q,
211
203
  {
212
204
  className: "w-full",
213
205
  type: "submit",
214
206
  onClick: S,
215
- disabled: (e == null ? void 0 : e.homepage) !== t.uuid && d.isHomePage ? !1 : x(i.name) || x(i.slug) || !N || m.isPending || c.isPending || i.type === "DYNAMIC" && !P((i == null ? void 0 : i.slug) || ""),
207
+ disabled: (e == null ? void 0 : e.homepage) !== s.uuid && d.isHomePage ? !1 : x(i.name) || x(i.slug) || !N || n.isPending || c.isPending || i.type === "DYNAMIC" && !P((i == null ? void 0 : i.slug) || ""),
216
208
  children: "Save"
217
209
  }
218
210
  ),
219
- /* @__PURE__ */ s.jsx(O, { pageData: t, projectData: e })
211
+ /* @__PURE__ */ t.jsx(O, { pageData: s, projectData: e })
220
212
  ] })
221
213
  ] }) })
222
214
  ] });
223
215
  };
224
216
  export {
225
- mi as default
217
+ ke as default
226
218
  };