@chaibuilder/sdk 1.2.64 → 1.2.66

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 (139) hide show
  1. package/dist/AddBlocks-Mm5byzEC.js +124 -0
  2. package/dist/AddBlocks-jaxiAG4L.cjs +1 -0
  3. package/dist/CanvasArea-8NXGRRYC.js +137 -0
  4. package/dist/CanvasArea-SkeoJz9W.cjs +1 -0
  5. package/dist/{CodeEditor-37od44Ou.js → CodeEditor-3l-mFvg4.js} +61 -46
  6. package/dist/CodeEditor-o-CkvDnY.cjs +1 -0
  7. package/dist/STRINGS--j49GZJP.js +7 -0
  8. package/dist/STRINGS-gPz7CUOk.cjs +1 -0
  9. package/dist/SettingsPanel-2uYGx-MQ.cjs +1 -0
  10. package/dist/SettingsPanel-Q3xQQm81.js +82 -0
  11. package/dist/{SidePanels-UQj0XTnb.js → SidePanels-JyziIpDA.js} +125 -116
  12. package/dist/SidePanels-d04PONzN.cjs +1 -0
  13. package/dist/{Topbar-1O05wogM.js → Topbar-Xgd6YI66.js} +68 -57
  14. package/dist/Topbar-eIenyfZu.cjs +1 -0
  15. package/dist/UILibrariesPanel-ADjJse3_.cjs +1 -0
  16. package/dist/{UILibrariesPanel-vshiYI6G.js → UILibrariesPanel-a7TrMuAU.js} +98 -86
  17. package/dist/{UnsplashImages-Eq7hprBO.js → UnsplashImages-6Bj8nQ8n.js} +65 -49
  18. package/dist/UnsplashImages-hLdMtY12.cjs +1 -0
  19. package/dist/{UploadImages-lco2Tea3.js → UploadImages-4PxhlZMB.js} +58 -44
  20. package/dist/UploadImages-uL2R7fju.cjs +1 -0
  21. package/dist/badge-7BVT3zxN.cjs +1 -0
  22. package/dist/badge-pJqQSA13.js +23 -0
  23. package/dist/context-menu-_8TFbFEJ.cjs +1 -0
  24. package/dist/context-menu-sks9vdzC.js +906 -0
  25. package/dist/core.cjs +1 -1
  26. package/dist/core.d.ts +45 -21
  27. package/dist/core.js +93 -79
  28. package/dist/iconBase-vJD0OXxU.cjs +1 -0
  29. package/dist/iconBase-zweRWSz0.js +323 -0
  30. package/dist/index-Dgo2PNEV.js +33210 -0
  31. package/dist/index-jhNzBWrV.cjs +223 -0
  32. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  33. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  34. package/dist/plugin-P0tpo_XZ.cjs +1 -0
  35. package/dist/plugin-_F-KZp1i.cjs +1 -0
  36. package/dist/plugin-f5uJtdXY.js +43 -0
  37. package/dist/plugin-sJ3Hzvpv.js +57 -0
  38. package/dist/render.cjs +3 -1
  39. package/dist/render.d.ts +19 -52
  40. package/dist/render.js +136 -183
  41. package/dist/select-JW3OMYm-.js +75 -0
  42. package/dist/select-fXj5tdMX.cjs +1 -0
  43. package/dist/separator-hT24N-xp.cjs +1 -0
  44. package/dist/separator-sgwOa1FE.js +18 -0
  45. package/dist/style.css +2 -2
  46. package/dist/tailwind.cjs +1 -1
  47. package/dist/tailwind.d.ts +41 -1
  48. package/dist/tailwind.js +16 -8
  49. package/dist/ui.cjs +1 -1
  50. package/dist/ui.d.ts +0 -10
  51. package/dist/ui.js +345 -163
  52. package/dist/web-blocks.cjs +1 -1
  53. package/dist/web-blocks.d.ts +1 -1
  54. package/dist/web-blocks.js +489 -724
  55. package/package.json +15 -45
  56. package/dist/AddBlocks-6dJmFSgk.js +0 -142
  57. package/dist/AddBlocks-doCNVVbk.cjs +0 -1
  58. package/dist/CanvasArea-kB6ky_uL.js +0 -164
  59. package/dist/CanvasArea-kdnkFfKR.cjs +0 -1
  60. package/dist/CodeEditor-ypUx3RAV.cjs +0 -1
  61. package/dist/CurrentPage-Ekl5Cwbv.cjs +0 -1
  62. package/dist/CurrentPage-bHq9Uusr.js +0 -108
  63. package/dist/Functions-7jnEwJyw.js +0 -15
  64. package/dist/Functions-N3yhPYKY.cjs +0 -1
  65. package/dist/MODIFIERS-fd5XOmum.js +0 -60
  66. package/dist/MODIFIERS-mVmfEGgo.cjs +0 -1
  67. package/dist/PagesPanel-SMHrEmCb.cjs +0 -1
  68. package/dist/PagesPanel-wIPAyjJK.js +0 -66
  69. package/dist/ProjectPanel-L-SlDizV.js +0 -87
  70. package/dist/ProjectPanel-YruLal65.cjs +0 -1
  71. package/dist/Settings-WXkCyhAv.js +0 -2380
  72. package/dist/Settings-_5VHcgFC.cjs +0 -1
  73. package/dist/SidePanels-UeIZB3e1.cjs +0 -1
  74. package/dist/StaticCanvas-7C52tXAv.js +0 -749
  75. package/dist/StaticCanvas-ll9VTXI5.cjs +0 -60
  76. package/dist/ThemeConfigPanel-_86vVxLz.cjs +0 -1
  77. package/dist/ThemeConfigPanel-gw8B2zvx.js +0 -194
  78. package/dist/Topbar-gb17oHdJ.cjs +0 -1
  79. package/dist/UILibrariesPanel-03Y3F3A_.cjs +0 -1
  80. package/dist/UnsplashImages-6UjgojvF.cjs +0 -1
  81. package/dist/UploadImages-3h0cRsvr.cjs +0 -1
  82. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  83. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  84. package/dist/add-page-modal-qr7rvJzN.js +0 -106
  85. package/dist/add-page-modal-rOKavDFX.cjs +0 -1
  86. package/dist/atoms-KQpaDRnF.cjs +0 -1
  87. package/dist/atoms-Oomqut88.js +0 -6
  88. package/dist/confirm-alert-P6TAevaP.js +0 -60
  89. package/dist/confirm-alert-v1lG8ex4.cjs +0 -1
  90. package/dist/controls-rRZhz0vu.cjs +0 -1
  91. package/dist/controls-yjgoZzB6.js +0 -199
  92. package/dist/delete-page-modal-55oioI9i.js +0 -85
  93. package/dist/delete-page-modal-wdAiMVnL.cjs +0 -1
  94. package/dist/email-blocks.cjs +0 -1
  95. package/dist/email-blocks.d.ts +0 -3
  96. package/dist/email-blocks.js +0 -294
  97. package/dist/email.cjs +0 -1
  98. package/dist/email.d.ts +0 -171
  99. package/dist/email.js +0 -75
  100. package/dist/empty-slot-Lsxjts7Q.js +0 -6
  101. package/dist/empty-slot-Sy930lX6.cjs +0 -1
  102. package/dist/form-4jTocVbZ.cjs +0 -1
  103. package/dist/form-5ke_lZv8.js +0 -125
  104. package/dist/functions--tdNWQDW.js +0 -30
  105. package/dist/functions-EVUeSwX1.cjs +0 -1
  106. package/dist/html-to-json-_01DXd-a.js +0 -192
  107. package/dist/html-to-json-ndxaXRT8.cjs +0 -1
  108. package/dist/index--mLLy7QQ.cjs +0 -1
  109. package/dist/index-6w-6HYBd.cjs +0 -1
  110. package/dist/index-VBXQixVm.js +0 -117
  111. package/dist/index-aeDphKpP.cjs +0 -1
  112. package/dist/index-audsIPBC.cjs +0 -231
  113. package/dist/index-b33n_-zO.js +0 -3141
  114. package/dist/index-e0c8PmRQ.js +0 -205
  115. package/dist/index-fnkMn4Pk.js +0 -2201
  116. package/dist/index-gi1LIOCw.cjs +0 -1
  117. package/dist/index-wRAIA8zZ.js +0 -80248
  118. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  119. package/dist/lib.cjs +0 -3
  120. package/dist/lib.d.ts +0 -80
  121. package/dist/lib.js +0 -1350
  122. package/dist/page-viewer-t44DP65U.js +0 -112
  123. package/dist/page-viewer-wU7T0f48.cjs +0 -1
  124. package/dist/plugin-2hf9pCRy.cjs +0 -1
  125. package/dist/plugin-wDnsBVPp.js +0 -54
  126. package/dist/project-general-setting-87cX9vvO.cjs +0 -1
  127. package/dist/project-general-setting-NEkNjf7V.js +0 -81
  128. package/dist/project-seo-setting-YmspOYsF.js +0 -83
  129. package/dist/project-seo-setting-o0V9acCV.cjs +0 -1
  130. package/dist/server.cjs +0 -1
  131. package/dist/server.d.ts +0 -299
  132. package/dist/server.js +0 -216
  133. package/dist/single-page-detail-27UjWK8L.cjs +0 -1
  134. package/dist/single-page-detail-jHzoDP7B.js +0 -220
  135. package/dist/studio.cjs +0 -1
  136. package/dist/studio.d.ts +0 -176
  137. package/dist/studio.js +0 -55
  138. package/dist/utils-D_vtk3zK.cjs +0 -1
  139. package/dist/utils-VpVqnC9m.js +0 -1075
@@ -1,112 +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 { aN as g, aO as h, aP as f } from "./index-b33n_-zO.js";
5
- import { d as j, a as N, c as P } from "./index-fnkMn4Pk.js";
6
- import "./_commonjsHelpers-UyOWmZb0.js";
7
- import "@radix-ui/react-toggle";
8
- import "class-variance-authority";
9
- import "./utils-VpVqnC9m.js";
10
- import "lodash-es";
11
- import "./MODIFIERS-fd5XOmum.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 "./Functions-7jnEwJyw.js";
36
- import "@chaibuilder/runtime";
37
- import "jotai";
38
- import "@react-hookz/web";
39
- import "tree-model";
40
- import "react-i18next";
41
- import "./index-wRAIA8zZ.js";
42
- import "i18next";
43
- import "react-arborist";
44
- import "lucide-react";
45
- import "./index-VBXQixVm.js";
46
- import "@floating-ui/react-dom";
47
- import "flagged";
48
- import "react-hotkeys-hook";
49
- import "sonner";
50
- import "./html-to-json-_01DXd-a.js";
51
- import "himalaya";
52
- import "lodash";
53
- const b = s.lazy(() => import("./single-page-detail-jHzoDP7B.js")), v = ({ pageData: r }) => {
54
- const [t, i] = n("CLOSE");
55
- return /* @__PURE__ */ e.jsxs(
56
- g,
57
- {
58
- open: t === "OPEN" || t === "ALERT" || t === "PENDING",
59
- onOpenChange: (o) => {
60
- i(t === "PENDING" ? "ALERT" : o ? "OPEN" : "CLOSE");
61
- },
62
- children: [
63
- /* @__PURE__ */ e.jsx(
64
- h,
65
- {
66
- asChild: !0,
67
- onClick: (o) => {
68
- o.stopPropagation(), i("OPEN");
69
- },
70
- 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, {}) }) })
71
- }
72
- ),
73
- /* @__PURE__ */ e.jsx(f, { side: "right", align: "start", alignOffset: -35, className: "h-screen w-96", children: /* @__PURE__ */ e.jsx(
74
- l,
75
- {
76
- fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full animate-pulse flex-col gap-y-3", children: [
77
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-6 w-1/2" }),
78
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" }),
79
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" })
80
- ] }),
81
- children: /* @__PURE__ */ e.jsx(b, { pageData: r, open: t, setOpen: i })
82
- }
83
- ) })
84
- ]
85
- }
86
- );
87
- }, E = (r) => {
88
- const [t] = j(), { data: i } = N(), o = P(), a = (i == null ? void 0 : i.homepage) === r.uuid, m = t === r.uuid, p = () => o(r);
89
- return i ? /* @__PURE__ */ e.jsxs(
90
- "button",
91
- {
92
- className: `group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${m ? "bg-blue-200 " : ""}`,
93
- onClick: p,
94
- type: "button",
95
- children: [
96
- /* @__PURE__ */ e.jsxs("div", { className: "flex text-sm items-center gap-x-1.5", children: [
97
- a ? /* @__PURE__ */ e.jsx(d, {}) : /* @__PURE__ */ e.jsx(x, {}),
98
- " ",
99
- r.name
100
- ] }),
101
- /* @__PURE__ */ e.jsx(v, { pageData: r })
102
- ]
103
- }
104
- ) : null;
105
- }, ve = ({ pages: r, isLoading: t }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
106
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
107
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
108
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" })
109
- ] }) : 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 }))) });
110
- export {
111
- ve as default
112
- };
@@ -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-aeDphKpP.cjs"),x=require("./index-6w-6HYBd.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("lodash-es");require("./MODIFIERS-mVmfEGgo.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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("react-i18next");require("./index-audsIPBC.cjs");require("i18next");require("react-arborist");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-ndxaXRT8.cjs");require("himalaya");require("lodash");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-27UjWK8L.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})})})]})},q=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},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(q,{...i})))});exports.default=p;
@@ -1 +0,0 @@
1
- "use strict";const f=require("./_commonjsHelpers-wDK0ZLPo.cjs");var o={},a={};(function(n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return i}});function u(t,e){return{handler:t,config:e}}u.withOptions=function(t,e=()=>({})){const r=function(c){return{__options:c,handler:t(c),config:e(c)}};return r.__isOptionsFunction=!0,r.__pluginFunction=t,r.__configFunction=e,r};const i=u})(a);(function(n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return t}});const u=i(a);function i(e){return e&&e.__esModule?e:{default:e}}const t=u.default})(o);let l=o;var s=(l.__esModule?l:{default:l}).default;const _=f.getDefaultExportFromCjs(s);exports.plugin=_;
@@ -1,54 +0,0 @@
1
- import { g as f } from "./_commonjsHelpers-UyOWmZb0.js";
2
- var o = {}, a = {};
3
- (function(n) {
4
- "use strict";
5
- Object.defineProperty(n, "__esModule", {
6
- value: !0
7
- }), Object.defineProperty(n, "default", {
8
- enumerable: !0,
9
- get: function() {
10
- return i;
11
- }
12
- });
13
- function u(t, e) {
14
- return {
15
- handler: t,
16
- config: e
17
- };
18
- }
19
- u.withOptions = function(t, e = () => ({})) {
20
- const r = function(c) {
21
- return {
22
- __options: c,
23
- handler: t(c),
24
- config: e(c)
25
- };
26
- };
27
- return r.__isOptionsFunction = !0, r.__pluginFunction = t, r.__configFunction = e, r;
28
- };
29
- const i = u;
30
- })(a);
31
- (function(n) {
32
- "use strict";
33
- Object.defineProperty(n, "__esModule", {
34
- value: !0
35
- }), Object.defineProperty(n, "default", {
36
- enumerable: !0,
37
- get: function() {
38
- return t;
39
- }
40
- });
41
- const u = /* @__PURE__ */ i(a);
42
- function i(e) {
43
- return e && e.__esModule ? e : {
44
- default: e
45
- };
46
- }
47
- const t = u.default;
48
- })(o);
49
- let l = o;
50
- var _ = (l.__esModule ? l : { default: l }).default;
51
- const s = /* @__PURE__ */ f(_);
52
- export {
53
- s as p
54
- };
@@ -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-aeDphKpP.cjs"),o=require("./controls-rRZhz0vu.cjs"),d=require("./form-4jTocVbZ.cjs"),m=require("./index-6w-6HYBd.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("lodash-es");require("./MODIFIERS-mVmfEGgo.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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-audsIPBC.cjs");require("i18next");require("react-arborist");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-ndxaXRT8.cjs");require("himalaya");require("lodash");function g(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 j=g(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();j.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.g({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.v({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,81 +0,0 @@
1
- import { j as i } from "./jsx-runtime-WbnYoNE9.js";
2
- import * as l from "react";
3
- import { ai as n } from "./index-b33n_-zO.js";
4
- import { g as c, v as d } from "./controls-yjgoZzB6.js";
5
- import { F as u } from "./form-5ke_lZv8.js";
6
- import { a as x } from "./index-fnkMn4Pk.js";
7
- import "./_commonjsHelpers-UyOWmZb0.js";
8
- import "@radix-ui/react-toggle";
9
- import "class-variance-authority";
10
- import "./utils-VpVqnC9m.js";
11
- import "lodash-es";
12
- import "./MODIFIERS-fd5XOmum.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 "./Functions-7jnEwJyw.js";
38
- import "@chaibuilder/runtime";
39
- import "jotai";
40
- import "@react-hookz/web";
41
- import "tree-model";
42
- import "react-i18next";
43
- import "@rjsf/core";
44
- import "@rjsf/validator-ajv8";
45
- import "./index-wRAIA8zZ.js";
46
- import "i18next";
47
- import "react-arborist";
48
- import "lucide-react";
49
- import "./index-VBXQixVm.js";
50
- import "@floating-ui/react-dom";
51
- import "flagged";
52
- import "react-hotkeys-hook";
53
- import "sonner";
54
- import "./html-to-json-_01DXd-a.js";
55
- import "himalaya";
56
- import "lodash";
57
- const vo = ({
58
- _projectData: m,
59
- seany: t
60
- }) => {
61
- const { data: o, isLoading: p } = x();
62
- l.useEffect(() => {
63
- o && t(o);
64
- }, [o, t]);
65
- const e = ({ formData: s }, r) => {
66
- t((f) => ({
67
- ...f,
68
- [r]: s[r]
69
- }));
70
- }, a = {
71
- name: c({
72
- title: "Project Name",
73
- default: o == null ? void 0 : o.name
74
- }),
75
- favicon: d({ title: "Favicon", default: o == null ? void 0 : o.favicon })
76
- };
77
- return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(u, { properties: a, disabled: p, formData: m, onChange: e }) });
78
- };
79
- export {
80
- vo as default
81
- };
@@ -1,83 +0,0 @@
1
- import { j as s } from "./jsx-runtime-WbnYoNE9.js";
2
- import { h as c, g as u, r as g, v as x } from "./controls-yjgoZzB6.js";
3
- import { F as v } from "./form-5ke_lZv8.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-b33n_-zO.js";
10
- import "@radix-ui/react-toggle";
11
- import "class-variance-authority";
12
- import "./utils-VpVqnC9m.js";
13
- import "./MODIFIERS-fd5XOmum.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 "./Functions-7jnEwJyw.js";
39
- import "@chaibuilder/runtime";
40
- import "jotai";
41
- import "@react-hookz/web";
42
- import "tree-model";
43
- import "react-i18next";
44
- const st = ({
45
- _projectData: t,
46
- seany: l
47
- }) => {
48
- var o, e, r, m, p, a;
49
- const n = ({ formData: f }) => {
50
- const i = { ...f };
51
- 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((D) => ({
52
- ...D,
53
- ...i
54
- }));
55
- }, d = {
56
- seoData: c({
57
- title: "",
58
- default: {
59
- title: ((o = t.seoData) == null ? void 0 : o.title) || "",
60
- description: ((e = t.seoData) == null ? void 0 : e.description) || "",
61
- image: ((r = t.seoData) == null ? void 0 : r.image) || ""
62
- },
63
- properties: {
64
- title: u({
65
- title: "Default Title",
66
- default: ((m = t.seoData) == null ? void 0 : m.title) || ""
67
- }),
68
- description: g({
69
- title: "Default Description",
70
- default: ((p = t.seoData) == null ? void 0 : p.description) || ""
71
- }),
72
- image: x({
73
- title: "Social Media Image",
74
- default: ((a = t.seoData) == null ? void 0 : a.image) || ""
75
- })
76
- }
77
- })
78
- };
79
- return /* @__PURE__ */ s.jsx("div", { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ s.jsx(v, { properties: d, formData: t, onChange: n }) });
80
- };
81
- export {
82
- st as default
83
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Z_BpKhVy.cjs"),i=require("./controls-rRZhz0vu.cjs"),g=require("./form-4jTocVbZ.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-aeDphKpP.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");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.h({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.g({title:"Default Title",default:((q=e.seoData)==null?void 0:q.title)||""}),description:i.r({title:"Default Description",default:((s=e.seoData)==null?void 0:s.description)||""}),image:i.v({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/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 { }