@chaibuilder/sdk 1.2.9 → 1.2.10-7.beta.1

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 (122) hide show
  1. package/README.md +26 -21
  2. package/dist/CodeEditor-3Vp79cuE.cjs +1 -0
  3. package/dist/CodeEditor-bUqM7eCa.js +129 -0
  4. package/dist/STRINGS-Xxstm-7I.js +7 -0
  5. package/dist/STRINGS-Yl7cSWDc.cjs +1 -0
  6. package/dist/Topbar-P7-9Rps1.js +124 -0
  7. package/dist/Topbar-xwQ4JUZD.cjs +1 -0
  8. package/dist/UnsplashImages-BxgbXGB6.cjs +1 -0
  9. package/dist/UnsplashImages-nQSvWPU0.js +244 -0
  10. package/dist/UploadImages-L9LlI-jl.cjs +1 -0
  11. package/dist/UploadImages-SVnIHigg.js +153 -0
  12. package/dist/context-menu-YGd09SE1.js +979 -0
  13. package/dist/context-menu-sQn7ryJ6.cjs +1 -0
  14. package/dist/{controls-XPXGHKht.js → controls-lEwMTdPQ.js} +96 -44
  15. package/dist/controls-p9IwFnPx.cjs +1 -0
  16. package/dist/core.cjs +1 -1
  17. package/dist/core.d.ts +344 -119
  18. package/dist/core.js +111 -88
  19. package/dist/iconBase-Ief2hJUZ.js +130 -0
  20. package/dist/iconBase-aZzpqff_.cjs +1 -0
  21. package/dist/index-3NV_rst1.js +9051 -0
  22. package/dist/index-qTKBamQ6.cjs +63 -0
  23. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  24. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  25. package/dist/mockServiceWorker.js +18 -10
  26. package/dist/plugin-UiUFs2fK.js +44 -0
  27. package/dist/plugin-f6SDZ_Or.js +108 -0
  28. package/dist/plugin-jum1MjXp.cjs +1 -0
  29. package/dist/plugin-xOpS-UNV.cjs +1 -0
  30. package/dist/render.cjs +3 -1
  31. package/dist/render.d.ts +21 -40
  32. package/dist/render.js +129 -85
  33. package/dist/runtime.cjs +1 -0
  34. package/dist/runtime.d.ts +5 -0
  35. package/dist/runtime.js +21 -0
  36. package/dist/style.css +2 -2
  37. package/dist/tailwind.cjs +1 -1
  38. package/dist/tailwind.d.ts +49 -8
  39. package/dist/tailwind.js +16 -20
  40. package/dist/ui.cjs +1 -1
  41. package/dist/ui.d.ts +3 -13
  42. package/dist/ui.js +363 -163
  43. package/dist/web-blocks.cjs +3 -9
  44. package/dist/web-blocks.d.ts +1 -1
  45. package/dist/web-blocks.js +722 -770
  46. package/package.json +66 -83
  47. package/dist/AddBlocks-tMxKPoen.js +0 -225
  48. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  49. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  50. package/dist/BrandingOptions-QJJ1y5ez.js +0 -194
  51. package/dist/CanvasArea-mlNKmCOh.js +0 -1425
  52. package/dist/CanvasArea-xs4wM64L.cjs +0 -60
  53. package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
  54. package/dist/CurrentPage-lBy25sZn.js +0 -111
  55. package/dist/Functions-7jnEwJyw.js +0 -15
  56. package/dist/Functions-N3yhPYKY.cjs +0 -1
  57. package/dist/Layers-3Xs4A5i8.js +0 -404
  58. package/dist/Layers-eaHy5PK9.cjs +0 -1
  59. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  60. package/dist/MODIFIERS-RiXS5Mn1.js +0 -67
  61. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  62. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  63. package/dist/PagesPanel--BZhafnt.js +0 -69
  64. package/dist/PagesPanel-gGKCV394.cjs +0 -1
  65. package/dist/ProjectPanel-YcLkM-DW.js +0 -90
  66. package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
  67. package/dist/Settings-7wlLcvoh.cjs +0 -1
  68. package/dist/Settings-TAgX4hov.js +0 -2186
  69. package/dist/SidePanels-5H4j0mIs.cjs +0 -1
  70. package/dist/SidePanels-btVQQkVK.js +0 -349
  71. package/dist/Topbar-V8xCetWF.cjs +0 -1
  72. package/dist/Topbar-j4t4AgCq.js +0 -116
  73. package/dist/UnsplashImages-41Y3q5_Q.js +0 -200
  74. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  75. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  76. package/dist/UploadImages-xBg-kbKv.js +0 -138
  77. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  78. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  79. package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
  80. package/dist/add-page-modal-cm8damU2.js +0 -108
  81. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  82. package/dist/confirm-alert-i4pM3mOt.js +0 -62
  83. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  84. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  85. package/dist/delete-page-modal-YrIBvfFA.js +0 -88
  86. package/dist/email-blocks.cjs +0 -1
  87. package/dist/email-blocks.d.ts +0 -3
  88. package/dist/email-blocks.js +0 -274
  89. package/dist/form-OVmsLOrc.js +0 -125
  90. package/dist/form-VbouZlAW.cjs +0 -1
  91. package/dist/functions-Ox_svtKm.cjs +0 -1
  92. package/dist/functions-xIebp8Aw.js +0 -23
  93. package/dist/html-to-json-2PeOCVey.cjs +0 -1
  94. package/dist/html-to-json-57841sEK.js +0 -183
  95. package/dist/index-H6vIwGfD.cjs +0 -1
  96. package/dist/index-N50dZnlC.cjs +0 -206
  97. package/dist/index-e0c8PmRQ.js +0 -205
  98. package/dist/index-gi1LIOCw.cjs +0 -1
  99. package/dist/index-niHREMmR.js +0 -2938
  100. package/dist/index-pZhGT8uT.js +0 -41620
  101. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  102. package/dist/lib.cjs +0 -4
  103. package/dist/lib.d.ts +0 -78
  104. package/dist/lib.js +0 -1322
  105. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  106. package/dist/page-viewer-feqJr1QI.js +0 -115
  107. package/dist/project-general-setting-SgagORzW.js +0 -83
  108. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  109. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  110. package/dist/project-seo-setting-wxAGEkd_.js +0 -85
  111. package/dist/server.cjs +0 -1
  112. package/dist/server.d.ts +0 -299
  113. package/dist/server.js +0 -216
  114. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
  115. package/dist/single-page-detail-dnWMyg6P.js +0 -222
  116. package/dist/studio.cjs +0 -1
  117. package/dist/studio.d.ts +0 -13
  118. package/dist/studio.js +0 -58
  119. package/dist/useAddBlockByDrop-_nwI4W3q.js +0 -20
  120. package/dist/useAddBlockByDrop-inkD7Lck.cjs +0 -1
  121. package/dist/utils-AvyFzbPC.js +0 -1075
  122. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-H6vIwGfD.cjs"),x=require("./index-N50dZnlC.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.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-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("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");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-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const q=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-IPod1o5P.cjs"))),m=({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(q,{pageData:s,open:r,setOpen:i})})})]})},j=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(m,{pageData:s})]}):null},p=({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(j,{...i})))});exports.default=p;
@@ -1,115 +0,0 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import s, { useState as n, 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 { a$ as g, b0 as h, b1 as f } from "./index-niHREMmR.js";
5
- import { e as j, b as N, d as b } from "./index-pZhGT8uT.js";
6
- import "./_commonjsHelpers-UyOWmZb0.js";
7
- import "@radix-ui/react-toggle";
8
- import "class-variance-authority";
9
- import "./utils-AvyFzbPC.js";
10
- import "lodash-es";
11
- import "./MODIFIERS-RiXS5Mn1.js";
12
- import "clsx";
13
- import "tailwind-merge";
14
- import "@radix-ui/react-switch";
15
- import "@radix-ui/react-slot";
16
- import "@radix-ui/react-accordion";
17
- import "@radix-ui/react-alert-dialog";
18
- import "@radix-ui/react-dialog";
19
- import "@radix-ui/react-label";
20
- import "@radix-ui/react-scroll-area";
21
- import "@radix-ui/react-tabs";
22
- import "@radix-ui/react-tooltip";
23
- import "@radix-ui/react-popover";
24
- import "@radix-ui/react-menubar";
25
- import "@radix-ui/react-hover-card";
26
- import "@radix-ui/react-select";
27
- import "@radix-ui/react-dropdown-menu";
28
- import "@radix-ui/react-separator";
29
- import "@radix-ui/react-toast";
30
- import "cmdk";
31
- import "@radix-ui/react-context-menu";
32
- import "react-icons-picker";
33
- import "react-dom";
34
- import "react-quill";
35
- import "jotai";
36
- import "flat-to-nested";
37
- import "./Functions-7jnEwJyw.js";
38
- import "redux-undo";
39
- import "@chaibuilder/runtime";
40
- import "lodash";
41
- import "@react-hookz/web";
42
- import "react-i18next";
43
- import "i18next";
44
- import "@floating-ui/react-dom";
45
- import "react-textarea-autosize";
46
- import "flagged";
47
- import "react-dnd";
48
- import "@minoru/react-dnd-treeview";
49
- import "react-hotkeys-hook";
50
- import "sonner";
51
- import "./html-to-json-57841sEK.js";
52
- import "himalaya";
53
- import "lucide-react";
54
- import "./web-blocks.js";
55
- import "./controls-XPXGHKht.js";
56
- const v = s.lazy(() => import("./single-page-detail-dnWMyg6P.js")), P = ({ pageData: r }) => {
57
- const [t, i] = n("CLOSE");
58
- return /* @__PURE__ */ e.jsxs(
59
- g,
60
- {
61
- open: t === "OPEN" || t === "ALERT" || t === "PENDING",
62
- onOpenChange: (o) => {
63
- i(t === "PENDING" ? "ALERT" : o ? "OPEN" : "CLOSE");
64
- },
65
- children: [
66
- /* @__PURE__ */ e.jsx(
67
- h,
68
- {
69
- asChild: !0,
70
- onClick: (o) => {
71
- o.stopPropagation(), i("OPEN");
72
- },
73
- 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, {}) }) })
74
- }
75
- ),
76
- /* @__PURE__ */ e.jsx(f, { side: "right", align: "start", alignOffset: -35, className: "h-screen w-96", children: /* @__PURE__ */ e.jsx(
77
- l,
78
- {
79
- fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full animate-pulse flex-col gap-y-3", children: [
80
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-6 w-1/2" }),
81
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" }),
82
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" })
83
- ] }),
84
- children: /* @__PURE__ */ e.jsx(v, { pageData: r, open: t, setOpen: i })
85
- }
86
- ) })
87
- ]
88
- }
89
- );
90
- }, E = (r) => {
91
- const [t] = j(), { data: i } = N(), o = b(), m = (i == null ? void 0 : i.homepage) === r.uuid, a = t === r.uuid, p = () => o(r);
92
- return i ? /* @__PURE__ */ e.jsxs(
93
- "button",
94
- {
95
- className: `group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a ? "bg-blue-200 " : ""}`,
96
- onClick: p,
97
- type: "button",
98
- children: [
99
- /* @__PURE__ */ e.jsxs("div", { className: "flex text-sm items-center gap-x-1.5", children: [
100
- m ? /* @__PURE__ */ e.jsx(d, {}) : /* @__PURE__ */ e.jsx(x, {}),
101
- " ",
102
- r.name
103
- ] }),
104
- /* @__PURE__ */ e.jsx(P, { pageData: r })
105
- ]
106
- }
107
- ) : null;
108
- }, Ce = ({ pages: r, isLoading: t }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
109
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
110
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
111
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" })
112
- ] }) : 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 }))) });
113
- export {
114
- Ce as default
115
- };
@@ -1,83 +0,0 @@
1
- import { j as i } from "./jsx-runtime-WbnYoNE9.js";
2
- import * as l from "react";
3
- import { bn as n } from "./index-niHREMmR.js";
4
- import { u as c, o as u } from "./controls-XPXGHKht.js";
5
- import { F as d } from "./form-OVmsLOrc.js";
6
- import { b as x } from "./index-pZhGT8uT.js";
7
- import "./_commonjsHelpers-UyOWmZb0.js";
8
- import "@radix-ui/react-toggle";
9
- import "class-variance-authority";
10
- import "./utils-AvyFzbPC.js";
11
- import "lodash-es";
12
- import "./MODIFIERS-RiXS5Mn1.js";
13
- import "clsx";
14
- import "tailwind-merge";
15
- import "@radix-ui/react-switch";
16
- import "@radix-ui/react-slot";
17
- import "@radix-ui/react-accordion";
18
- import "@radix-ui/react-icons";
19
- import "@radix-ui/react-alert-dialog";
20
- import "@radix-ui/react-dialog";
21
- import "@radix-ui/react-label";
22
- import "@radix-ui/react-scroll-area";
23
- import "@radix-ui/react-tabs";
24
- import "@radix-ui/react-tooltip";
25
- import "@radix-ui/react-popover";
26
- import "@radix-ui/react-menubar";
27
- import "@radix-ui/react-hover-card";
28
- import "@radix-ui/react-select";
29
- import "@radix-ui/react-dropdown-menu";
30
- import "@radix-ui/react-separator";
31
- import "@radix-ui/react-toast";
32
- import "cmdk";
33
- import "@radix-ui/react-context-menu";
34
- import "react-icons-picker";
35
- import "react-dom";
36
- import "react-quill";
37
- import "jotai";
38
- import "flat-to-nested";
39
- import "./Functions-7jnEwJyw.js";
40
- import "redux-undo";
41
- import "@chaibuilder/runtime";
42
- import "lodash";
43
- import "@react-hookz/web";
44
- import "react-i18next";
45
- import "@rjsf/core";
46
- import "@rjsf/validator-ajv8";
47
- import "i18next";
48
- import "@floating-ui/react-dom";
49
- import "react-textarea-autosize";
50
- import "flagged";
51
- import "react-dnd";
52
- import "@minoru/react-dnd-treeview";
53
- import "react-hotkeys-hook";
54
- import "sonner";
55
- import "./html-to-json-57841sEK.js";
56
- import "himalaya";
57
- import "lucide-react";
58
- import "./web-blocks.js";
59
- const ho = ({
60
- _projectData: m,
61
- seany: t
62
- }) => {
63
- const { data: o, isLoading: p } = x();
64
- l.useEffect(() => {
65
- o && t(o);
66
- }, [o, t]);
67
- const e = ({ formData: s }, r) => {
68
- t((f) => ({
69
- ...f,
70
- [r]: s[r]
71
- }));
72
- }, a = {
73
- name: c({
74
- title: "Project Name",
75
- default: o == null ? void 0 : o.name
76
- }),
77
- favicon: u({ title: "Favicon", default: o == null ? void 0 : o.favicon })
78
- };
79
- 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 }) });
80
- };
81
- export {
82
- ho as default
83
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./index-H6vIwGfD.cjs"),o=require("./controls-Dy1qa8Dc.cjs"),d=require("./form-VbouZlAW.cjs"),m=require("./index-N50dZnlC.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.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("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");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-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");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 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Z_BpKhVy.cjs"),i=require("./controls-Dy1qa8Dc.cjs"),g=require("./form-VbouZlAW.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-H6vIwGfD.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.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("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("react-i18next");const D=({_projectData:e,seany:n})=>{var t,u,o,q,s,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:((q=e.seoData)==null?void 0:q.title)||""}),description:i.g({title:"Default Description",default:((s=e.seoData)==null?void 0:s.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,85 +0,0 @@
1
- import { j as s } from "./jsx-runtime-WbnYoNE9.js";
2
- import { b as D, u as c, g, o as x } from "./controls-XPXGHKht.js";
3
- import { F as v } from "./form-OVmsLOrc.js";
4
- import "./_commonjsHelpers-UyOWmZb0.js";
5
- import "react";
6
- import "lodash-es";
7
- import "@rjsf/core";
8
- import "@rjsf/validator-ajv8";
9
- import "./index-niHREMmR.js";
10
- import "@radix-ui/react-toggle";
11
- import "class-variance-authority";
12
- import "./utils-AvyFzbPC.js";
13
- import "./MODIFIERS-RiXS5Mn1.js";
14
- import "clsx";
15
- import "tailwind-merge";
16
- import "@radix-ui/react-switch";
17
- import "@radix-ui/react-slot";
18
- import "@radix-ui/react-accordion";
19
- import "@radix-ui/react-icons";
20
- import "@radix-ui/react-alert-dialog";
21
- import "@radix-ui/react-dialog";
22
- import "@radix-ui/react-label";
23
- import "@radix-ui/react-scroll-area";
24
- import "@radix-ui/react-tabs";
25
- import "@radix-ui/react-tooltip";
26
- import "@radix-ui/react-popover";
27
- import "@radix-ui/react-menubar";
28
- import "@radix-ui/react-hover-card";
29
- import "@radix-ui/react-select";
30
- import "@radix-ui/react-dropdown-menu";
31
- import "@radix-ui/react-separator";
32
- import "@radix-ui/react-toast";
33
- import "cmdk";
34
- import "@radix-ui/react-context-menu";
35
- import "react-icons-picker";
36
- import "react-dom";
37
- import "react-quill";
38
- import "jotai";
39
- import "flat-to-nested";
40
- import "./Functions-7jnEwJyw.js";
41
- import "redux-undo";
42
- import "@chaibuilder/runtime";
43
- import "lodash";
44
- import "@react-hookz/web";
45
- import "react-i18next";
46
- const nt = ({
47
- _projectData: t,
48
- seany: l
49
- }) => {
50
- var o, r, e, m, p, a;
51
- const n = ({ formData: f }) => {
52
- const i = { ...f };
53
- i.seoData.title === void 0 && (i.seoData.title = ""), i.seoData.description === void 0 && (i.seoData.description = ""), i.seoData.image === void 0 && (i.seoData.image = ""), l((u) => ({
54
- ...u,
55
- ...i
56
- }));
57
- }, d = {
58
- seoData: D({
59
- title: "",
60
- default: {
61
- title: ((o = t.seoData) == null ? void 0 : o.title) || "",
62
- description: ((r = t.seoData) == null ? void 0 : r.description) || "",
63
- image: ((e = t.seoData) == null ? void 0 : e.image) || ""
64
- },
65
- properties: {
66
- title: c({
67
- title: "Default Title",
68
- default: ((m = t.seoData) == null ? void 0 : m.title) || ""
69
- }),
70
- description: g({
71
- title: "Default Description",
72
- default: ((p = t.seoData) == null ? void 0 : p.description) || ""
73
- }),
74
- image: x({
75
- title: "Social Media Image",
76
- default: ((a = t.seoData) == null ? void 0 : a.image) || ""
77
- })
78
- }
79
- })
80
- };
81
- return /* @__PURE__ */ s.jsx("div", { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ s.jsx(v, { properties: d, formData: t, onChange: n }) });
82
- };
83
- export {
84
- nt as default
85
- };
package/dist/server.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";var u=Object.defineProperty;var g=(a,t,e)=>t in a?u(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var h=(a,t,e)=>(g(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("lodash-es"),l=require("@chaibuilder/runtime"),d="https://api.chaibuilder.com";class p{constructor(t,e){h(this,"_authSecret");h(this,"_accessToken",null);h(this,"_appKey");if(!t)throw"Please provide valid auth secret.";if(!e)throw"Please provide valid project key.";this._authSecret=t,this._appKey=e}setAccessToken(t){this._accessToken=t}async getPageData(t){const e=this.getHeaders(),s=this.getURL("page-data",i.isEmpty(t)?{}:{slug:t}),o={method:"GET",headers:e,next:{tags:["everything",i.isEmpty(t)?"_homepage":t]}};return this.fetchAPI(s,o)}async unlockPage(t){if(!t)return Promise.reject({data:null,error:{message:"Invalid page uuid"},result:"error"});const e=this.getHeaders(),s=this.getURL("page/unlock"),o={method:"POST",headers:e,body:JSON.stringify({uuid:t})};return this.fetchAPI(s,o)}async getPage(t){if(!t)return Promise.reject({data:null,error:{message:"Invalid page uuid"},result:"error"});const e=this.getHeaders(),s=this.getURL("page",{uuid:t}),o={method:"GET",headers:e};return this.fetchAPI(s,o)}async getPages(){const t=this.getHeaders(),e=this.getURL("pages"),r={method:"GET",headers:t};return this.fetchAPI(e,r)}async addPage(t){const e=JSON.stringify(t),s=this.getHeaders(),r=this.getURL("page"),n={method:"POST",headers:s,body:e};return this.fetchAPI(r,n)}async deletePage(t){if(!t)return Promise.reject({data:null,error:{message:"Invalid page uuid"},result:"error"});const e=this.getHeaders(),s=this.getURL("page",{uuid:t}),o={method:"DELETE",headers:e};return this.fetchAPI(s,o)}async updatePage(t){const e=JSON.stringify(t),s=this.getHeaders(),r=this.getURL("page"),n={method:"PUT",headers:s,body:e};return this.fetchAPI(r,n)}async getProject(){const t=this.getHeaders(),e=this.getURL("project"),r={method:"GET",headers:t};return this.fetchAPI(e,r)}async updateProject(t){const e=JSON.stringify(t),s=this.getHeaders(),r=this.getURL("project"),n={method:"PUT",headers:s,body:e};return this.fetchAPI(r,n)}async uploadAsset(t){const e=this.getHeaders(),s=this.getURL("asset"),r="POST",o=await t.get("file"),n=new FormData;n.append("file",o);const c={method:r,headers:e,body:n};return this.fetchAPI(s,c)}async getAssets(t,e){const s=this.getHeaders(),r=this.getURL("asset");t&&r.concat(`?limit=${t}`),e&&r.concat(`&offset=${e}`);const n={method:"GET",headers:s};return this.fetchAPI(r,n)}async authenticate({password:t}){const e=JSON.stringify({password:t}),s=this.getHeaders(),r=this.getURL("authenticate"),n={method:"POST",headers:s,body:e};return this.fetchAPI(r,n)}async login({password:t,email:e}){const s=JSON.stringify({password:t,email:e}),r=this.getHeaders(),o=this.getURL("login"),c={method:"POST",headers:r,body:s};return this.fetchAPI(o,c)}async logout(){const t=this.getHeaders(),e=this.getURL("logout"),r={method:"POST",headers:t};return this.fetchAPI(e,r)}async verify(){const t=this.getHeaders(),e=this.getURL("verify"),r={method:"POST",headers:t};return this.fetchAPI(e,r)}getURL(t,e){const s=new URLSearchParams(e).toString();return i.isEmpty(e)?`${d}/v1/${t}`:`${d}/v1/${t}?${s}`}getHeaders(){const t=new Headers;return t.append("x-chai-app-key",this._appKey),t.append("x-chai-auth-secret",this._authSecret),this._accessToken&&t.append("x-chai-access-token",this._accessToken),t}async fetchAPI(t,e){try{const s=await fetch(t,e).then(r=>r.json());if((s==null?void 0:s.result)==="success")return{data:s==null?void 0:s.data,error:null,result:"success"};throw s==null?void 0:s.error}catch(s){return{data:null,error:s,result:"error"}}}}const y=async(a,t)=>{const e=l.getChaiDataProviders(),s=i.filter(e,n=>i.map(a,"providerKey").includes(n.providerKey)),r={},o=[];for(const n of s)try{r[n.providerKey]=await n.dataFn({},t)}catch(c){o.push(c)}return{data:r,errors:o}};exports.ChaibuilderBackend=p;exports.prepareExternalData=y;
package/dist/server.d.ts DELETED
@@ -1,299 +0,0 @@
1
- declare type ChaiApiResponse<T> = Promise<{
2
- data: T;
3
- error: null;
4
- result: "success" | "error";
5
- }>;
6
-
7
- declare type ChaiAsset = {
8
- id: string;
9
- url: string;
10
- thumbUrl: string;
11
- };
12
-
13
- declare type ChaiBlock = {
14
- _id: string;
15
- _type: string;
16
- _name?: string;
17
- _parent?: string | null | undefined;
18
- _bindings?: Record<string, string>;
19
- } & Record<string, any>;
20
-
21
- export declare class ChaibuilderBackend implements ChaibuilderBackendInterface {
22
- private _authSecret;
23
- private _accessToken;
24
- private readonly _appKey;
25
- constructor(authSecret: string, appKey: string);
26
- setAccessToken(token: string | null): void;
27
- getPageData(slug: string): Promise<{
28
- data: ChaiPageData;
29
- error: null;
30
- result: "success" | "error";
31
- }>;
32
- unlockPage(uuid: string): Promise<{
33
- data: any;
34
- error: null;
35
- result: "success" | "error";
36
- }>;
37
- /**
38
- *
39
- * @param uuid
40
- * @returns Detail Single Page Information
41
- */
42
- getPage(uuid: string): Promise<{
43
- data: ChaiPage & {
44
- subPages: ChaiSubPage[];
45
- };
46
- error: null;
47
- result: "success" | "error";
48
- }>;
49
- /**
50
- *
51
- * @returns List of all pages
52
- */
53
- getPages(): Promise<{
54
- data: Omit<ChaiPage, "blocks">[];
55
- error: null;
56
- result: "success" | "error";
57
- }>;
58
- /**
59
- *
60
- * @param page
61
- * @returns Detail of new page
62
- */
63
- addPage(page: Pick<ChaiPage, "name" | "slug">): Promise<{
64
- data: ChaiPage;
65
- error: null;
66
- result: "success" | "error";
67
- }>;
68
- /**
69
- *
70
- * @param uuid
71
- * @returns Success | Error Message
72
- */
73
- deletePage(uuid: string): Promise<{
74
- data: null;
75
- error: null;
76
- result: "success" | "error";
77
- }>;
78
- /**
79
- *
80
- * @param page
81
- * @returns Update page information or Error response
82
- */
83
- updatePage(page: ChaiPage): Promise<{
84
- data: ChaiPage;
85
- error: null;
86
- result: "success" | "error";
87
- }>;
88
- /**
89
- *
90
- * @returns Project detail
91
- */
92
- getProject(): Promise<{
93
- data: ChaiProject;
94
- error: null;
95
- result: "success" | "error";
96
- }>;
97
- /**
98
- *
99
- * @param project
100
- * @returns Updated project detail
101
- */
102
- updateProject(project: Partial<ChaiProject>): Promise<{
103
- data: ChaiProject;
104
- error: null;
105
- result: "success" | "error";
106
- }>;
107
- /**
108
- *
109
- * @returns Upload asset
110
- * @param formData
111
- */
112
- uploadAsset(formData: FormData): Promise<{
113
- data: {
114
- url: string;
115
- };
116
- error: null;
117
- result: "success" | "error";
118
- }>;
119
- /**
120
- *
121
- * @returns Get assets
122
- * @param limit
123
- * @param offset
124
- */
125
- getAssets(limit?: string, offset?: string): Promise<{
126
- data: ChaiAsset[];
127
- error: null;
128
- result: "success" | "error";
129
- }>;
130
- /**
131
- *
132
- * @param { password }
133
- * @returns { token }
134
- */
135
- authenticate({ password }: {
136
- password: string;
137
- }): Promise<{
138
- data: {
139
- token: string;
140
- };
141
- error: null;
142
- result: "success" | "error";
143
- }>;
144
- /**
145
- *
146
- * @param { password }
147
- * @returns { token }
148
- */
149
- login({ password, email }: {
150
- password: string;
151
- email: string;
152
- }): Promise<{
153
- data: {
154
- accessToken: string;
155
- name: string;
156
- email: string;
157
- };
158
- error: null;
159
- result: "success" | "error";
160
- }>;
161
- /**
162
- *
163
- * @returns { token }
164
- */
165
- logout(): Promise<{
166
- data: true;
167
- error: null;
168
- result: "success" | "error";
169
- }>;
170
- /**
171
- *
172
- * @returns { result: 'success' | 'error' }
173
- */
174
- verify(): Promise<{
175
- data: {
176
- result: string;
177
- };
178
- error: null;
179
- result: "success" | "error";
180
- }>;
181
- /**
182
- *
183
- * @param endpoint
184
- * @param queryParam
185
- * @returns api endpoint with query param
186
- */
187
- private getURL;
188
- /**
189
- *
190
- * @returns headers for api
191
- */
192
- private getHeaders;
193
- /**
194
- *
195
- * @returns Fetch API
196
- */
197
- private fetchAPI;
198
- }
199
-
200
- declare interface ChaibuilderBackendInterface {
201
- getPage(uuid: string): ChaiApiResponse<ChaiPage & {
202
- subPages: ChaiSubPage[];
203
- }>;
204
- getPages(): ChaiApiResponse<ChaiPage>;
205
- addPage(page: Pick<ChaiPage, "name" | "slug">): ChaiApiResponse<ChaiPage>;
206
- deletePage(uuid: string): ChaiApiResponse<null>;
207
- updatePage(page: ChaiPage): ChaiApiResponse<ChaiPage>;
208
- getProject(): ChaiApiResponse<ChaiProject>;
209
- updateProject(project: Partial<ChaiProject>): ChaiApiResponse<ChaiProject>;
210
- uploadAsset(formData: FormData): ChaiApiResponse<{
211
- url: string;
212
- }>;
213
- getAssets(): ChaiApiResponse<ChaiAsset[]>;
214
- login({ password, email, }: {
215
- password: string;
216
- email: string;
217
- }): ChaiApiResponse<{
218
- accessToken: string;
219
- name: string;
220
- email: string;
221
- }>;
222
- logout(): ChaiApiResponse<any>;
223
- unlockPage(uuid: string): ChaiApiResponse<any>;
224
- }
225
-
226
- declare type ChaiPage = {
227
- uuid: string;
228
- name: string;
229
- slug: string;
230
- blocks: ChaiBlock[];
231
- seoData: object;
232
- providers: {
233
- providerKey: string;
234
- args: Record<string, any>;
235
- }[];
236
- type: "STATIC" | "DYNAMIC" | "SUBPAGE";
237
- project: string;
238
- lockedBy: null | {
239
- name: string;
240
- self: boolean;
241
- email: string;
242
- };
243
- };
244
-
245
- declare type ChaiPageData = {
246
- page: {
247
- blocks: ChaiBlock[];
248
- seoData?: Record<string, string>;
249
- slug?: string;
250
- name?: string;
251
- providers?: {
252
- providerKey: string;
253
- args: Record<string, any>;
254
- }[];
255
- };
256
- subPages?: {
257
- uuid: string;
258
- blocks: ChaiBlock[];
259
- providers: {
260
- providerKey: string;
261
- args: Record<string, any>;
262
- }[];
263
- }[];
264
- project: {
265
- name?: string;
266
- favicon?: string;
267
- brandingOptions: Record<string, string | number>;
268
- seoData?: Record<string, string>;
269
- primaryLanguage?: string;
270
- languages?: string[];
271
- homepage?: string;
272
- };
273
- };
274
-
275
- declare type ChaiProject = {
276
- uuid: string;
277
- brandingOptions: Record<string, string | number>;
278
- favicon: string;
279
- homepage: string;
280
- name: string;
281
- description?: string;
282
- seoData: Record<string, string>;
283
- primaryLanguage?: string;
284
- password?: string;
285
- languages?: Array<string>;
286
- user?: string;
287
- };
288
-
289
- declare type ChaiSubPage = Pick<ChaiPage, "uuid" | "name" | "blocks" | "type" | "project" | "providers" | "lockedBy">;
290
-
291
- export declare const prepareExternalData: (providers: {
292
- providerKey: string;
293
- args: Record<string, unknown>;
294
- }[], currentPageUrl: string) => Promise<{
295
- data: {};
296
- errors: any[];
297
- }>;
298
-
299
- export { }