@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,199 +0,0 @@
1
- import { get as t, omit as e } from "lodash-es";
2
- const n = "#styles:", r = (i) => ({
3
- type: "singular",
4
- default: i.default || "",
5
- binding: t(i, "binding", !0),
6
- dataType: "string",
7
- schema: {
8
- type: "string",
9
- ...e(i, ["i18n", "required"])
10
- },
11
- uiSchema: {
12
- "ui:widget": "code"
13
- }
14
- });
15
- const u = (i) => ({
16
- type: "singular",
17
- default: i.default || "",
18
- binding: t(i, "binding", !0),
19
- dataType: "string",
20
- required: i.required || !1,
21
- ai: i.ai || void 0,
22
- schema: {
23
- type: "string",
24
- ...e(i, ["ai", "required"])
25
- },
26
- uiSchema: {
27
- "ui:placeholder": i.placeholder || "Enter here"
28
- }
29
- }), l = (i) => ({
30
- type: "singular",
31
- default: i.default || "",
32
- binding: t(i, "binding", !0),
33
- dataType: "string",
34
- required: i.required || !1,
35
- ai: i.ai || void 0,
36
- schema: {
37
- type: "string",
38
- ...e(i, ["i18n", "required", "rows"])
39
- },
40
- uiSchema: {
41
- "ui:widget": "textarea",
42
- "ui:placeholder": i.placeholder || "Enter here",
43
- "ui:options": {
44
- rows: i.rows || 4
45
- }
46
- }
47
- }), g = (i) => ({
48
- type: "singular",
49
- i18n: i.i18n || !1,
50
- default: i.default || !1,
51
- dataType: "boolean",
52
- binding: t(i, "binding", !0),
53
- ai: i.ai || void 0,
54
- schema: {
55
- type: "boolean",
56
- ...e(i, ["i18n", "required"])
57
- },
58
- uiSchema: {
59
- "ui:title": i.title || "Select Item",
60
- "ui:description": ""
61
- }
62
- }), s = (i) => ({
63
- type: "singular",
64
- default: i.default || "",
65
- binding: t(i, "binding", !0),
66
- dataType: "number",
67
- required: i.required || !1,
68
- ai: i.ai || void 0,
69
- schema: {
70
- type: "number",
71
- ...e(i, ["i18n", "required"])
72
- },
73
- uiSchema: {}
74
- }), p = (i) => ({
75
- type: "singular",
76
- default: i.default || "",
77
- binding: t(i, "binding", !0),
78
- required: i.required || !1,
79
- dataType: "string",
80
- ai: i.ai || void 0,
81
- schema: {
82
- type: "string",
83
- ...e(i, ["i18n", "required", "options", "binding"]),
84
- oneOf: i.options.map((a) => ({ const: a.value, title: a.title }))
85
- },
86
- uiSchema: {
87
- "ui:widget": "select"
88
- }
89
- }), y = (i) => ({
90
- type: "singular",
91
- i18n: i.i18n || !1,
92
- default: i.default || "",
93
- binding: t(i, "binding", !0),
94
- dataType: "string",
95
- ai: i.ai || void 0,
96
- schema: {
97
- type: "string",
98
- ...e(i, ["i18n", "required"])
99
- },
100
- uiSchema: {
101
- "ui:widget": "color"
102
- }
103
- });
104
- const o = (i) => ({
105
- type: "singular",
106
- default: i.default || "",
107
- binding: t(i, "binding", !0),
108
- dataType: "string",
109
- ai: i.ai || void 0,
110
- schema: {
111
- type: "string",
112
- ...e(i, ["i18n", "required"])
113
- },
114
- uiSchema: {
115
- "ui:widget": "richtext"
116
- }
117
- }), c = (i) => ({
118
- type: "model",
119
- title: i.title,
120
- dataType: "object",
121
- default: i.default || {},
122
- binding: t(i, "binding", !0),
123
- properties: i.properties
124
- }), m = (i) => ({
125
- type: "list",
126
- itemProperties: i.itemProperties,
127
- binding: t(i, "binding", !0),
128
- title: i.title,
129
- ai: i.ai || void 0,
130
- dataType: "array",
131
- default: i.default || [],
132
- itemTitle: i.getItemLabel ? i.getItemLabel({}) : () => ""
133
- }), b = (i) => ({
134
- type: "styles",
135
- binding: !1,
136
- default: `${n},${i.default || ""}`,
137
- presets: i.presets || {}
138
- }), f = (i) => ({
139
- default: i.default || "",
140
- binding: t(i, "binding", !0),
141
- type: "singular",
142
- dataType: "string",
143
- ai: i.ai || void 0,
144
- schema: {
145
- type: "string",
146
- title: "Icon",
147
- default: i.default || ""
148
- },
149
- uiSchema: {
150
- "ui:widget": "icon"
151
- }
152
- }), h = (i) => ({
153
- default: i.default,
154
- type: "singular",
155
- binding: t(i, "binding", !0),
156
- dataType: "object",
157
- ai: i.ai || void 0,
158
- schema: {
159
- type: "object",
160
- ...i || {},
161
- properties: {
162
- type: { type: "string" },
163
- href: { type: "string" },
164
- target: { type: "string" }
165
- }
166
- },
167
- uiSchema: {
168
- "ui:field": "link"
169
- }
170
- }), q = (i) => ({
171
- type: "singular",
172
- default: i.default || "",
173
- binding: t(i, "binding", !0),
174
- dataType: "string",
175
- ai: i.ai || void 0,
176
- schema: {
177
- type: "string",
178
- ...e(i, ["i18n", "required"])
179
- },
180
- uiSchema: {
181
- "ui:widget": "image"
182
- }
183
- });
184
- export {
185
- m as S,
186
- f as T,
187
- o as b,
188
- g as c,
189
- p as f,
190
- u as g,
191
- c as h,
192
- b as o,
193
- h as q,
194
- l as r,
195
- y as s,
196
- r as u,
197
- q as v,
198
- s as y
199
- };
@@ -1,85 +0,0 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./index-b33n_-zO.js";
3
- import { h } from "./index-fnkMn4Pk.js";
4
- import { TrashIcon as x } from "@radix-ui/react-icons";
5
- import "./_commonjsHelpers-UyOWmZb0.js";
6
- import "react";
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 he = ({ pageData: r, projectData: i }) => {
54
- const m = {}, t = h(), o = r.uuid === i.homepage, s = () => {
55
- t.mutate(r, {
56
- onSuccess: () => {
57
- m({ uuid: i.homepage, slug: "/home" });
58
- }
59
- });
60
- };
61
- return /* @__PURE__ */ e.jsxs(p, { children: [
62
- /* @__PURE__ */ e.jsx(l, { disabled: o, children: /* @__PURE__ */ e.jsx(
63
- "div",
64
- {
65
- className: `flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${o ? "cursor-not-allowed border-red-200 text-red-200" : "cursor-pointer border-red-400 text-red-400"}`,
66
- children: /* @__PURE__ */ e.jsx(x, {})
67
- }
68
- ) }),
69
- /* @__PURE__ */ e.jsxs(n, { children: [
70
- /* @__PURE__ */ e.jsxs(d, { children: [
71
- "Are you sure you want to delete ",
72
- /* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.name }),
73
- " page?"
74
- ] }),
75
- /* @__PURE__ */ e.jsx(a, { children: "This action cannot be undone. This will permanently delete your page." }),
76
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
77
- /* @__PURE__ */ e.jsx(c, { disabled: t.isPending, children: "Cancel" }),
78
- /* @__PURE__ */ e.jsx(u, { variant: "destructive", onClick: s, disabled: t.isPending, children: "Yes, Delete" })
79
- ] })
80
- ] })
81
- ] });
82
- };
83
- export {
84
- he as default
85
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-aeDphKpP.cjs"),l=require("./index-6w-6HYBd.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");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 d=({pageData:i,projectData:t})=>{const n={},u=l.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(q.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-es"),i=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("@react-email/components"),c=require("@chaibuilder/runtime"),d=require("./empty-slot-Sy930lX6.cjs"),l=require("./controls-rRZhz0vu.cjs"),a=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");const m=({blockProps:e,styles:t,children:o,inBuilder:r})=>{let n=o;return o||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{inBuilder:r})),i.jsxRuntimeExports.jsx(s.Container,{...e,...t,children:n})};c.registerChaiBlock(m,{type:"Email/Container",label:"Container",group:"basic",category:"core",canAcceptBlock:()=>!0,canMove:()=>!0,canDelete:()=>!1,canDuplicate:()=>!1,canBeNested:e=>!e});const x=({blockProps:e,styles:t,children:o})=>i.jsxRuntimeExports.jsx(s.Section,{...e,...t,children:o});c.registerChaiBlock(x,{type:"Email/Section",label:"Section",group:"basic",category:"core",icon:a.ImageIcon,props:{align:l.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0});const g=({blockProps:e,styles:t,children:o})=>i.jsxRuntimeExports.jsx(s.Row,{...e,...t,children:o});c.registerChaiBlock(g,{type:"Email/Row",label:"Row",group:"basic",category:"core",icon:a.ImageIcon,blocks:[{_type:"Email/Row",_id:"a"},{_type:"Email/Column",_id:"b",_parent:"a"}],props:{styles:l.o({default:""})},canAcceptBlock:e=>e==="Email/Column"});const h=({blockProps:e,styles:t,children:o,align:r})=>{let n=o;return o||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{})),i.jsxRuntimeExports.jsx(s.Column,{...e,...t,align:r,children:n})};c.registerChaiBlock(h,{type:"Email/Column",label:"Column",group:"basic",category:"core",icon:a.ImageIcon,props:{styles:l.o({default:""}),align:l.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0,canBeNested:e=>e==="Email/Row"});const k=({level:e,blockProps:t,styles:o,content:r})=>i.jsxRuntimeExports.jsx(s.Heading,{as:e,...t,...o,children:r}),b=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("h1",{...e,...t,children:o});c.registerChaiBlock(k,{type:"Email/Heading",label:"Heading",group:"basic",category:"core",icon:a.HeadingIcon,builderComponent:b,props:{content:l.g({title:"Content",default:"Enter your heading here..."}),styles:l.o({default:"text-xl"}),level:l.f({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]})},canAcceptBlock:e=>["Email/Link","Email/RawText"].includes(e)});const B=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx(s.Text,{...e,...t,children:o}),C=({content:e,blockProps:t,styles:o})=>i.jsxRuntimeExports.jsx("p",{...t,...o,children:e});c.registerChaiBlock(B,{type:"Email/Text",label:"Text",group:"basic",category:"core",icon:a.TextIcon,builderComponent:C,props:{content:l.r({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim."}),styles:l.o({default:""})},canAcceptBlock:e=>["Email/Link","Email/RawText"].includes(e)});const j=({content:e})=>e,f=({content:e,blockProps:t})=>i.jsxRuntimeExports.jsx("span",{...t,children:e});c.registerChaiBlock(j,{type:"Email/RawText",label:"Raw Text",group:"basic",category:"core",icon:a.TextIcon,hidden:!0,builderComponent:f,props:{content:l.r({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const E=({blockProps:e,styles:t,link:o,content:r})=>i.jsxRuntimeExports.jsx(s.Button,{...e,...t,href:o.href,children:r}),y=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});c.registerChaiBlock(E,{type:"Email/Button",label:"Button",group:"basic",category:"core",builderComponent:y,props:{content:l.g({title:"Content",default:"Click me"}),link:l.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:l.o({default:"bg-primary text-white px-4 py-2 rounded-md"})}});const v=({blockProps:e,styles:t,href:o,content:r,target:n,children:u})=>i.jsxRuntimeExports.jsx(s.Link,{...e,...t,href:o,target:n,children:u||r}),R=({blockProps:e,styles:t,content:o,children:r})=>{let n=r;return r||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{})),i.jsxRuntimeExports.jsx("span",{...e,...t,children:n||o})};c.registerChaiBlock(v,{type:"Email/Link",label:"Link",group:"basic",category:"core",icon:a.Link1Icon,blocks:[{_id:"a",_type:"Link"},{_id:"b",_parent:"a",_type:"RawText",content:"I am a link."}],builderComponent:R,props:{content:l.g({title:"Content",default:"I am a link."}),link:l.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:l.o({default:"font-bold text-blue-500"})},canAcceptBlock:()=>!0});const w=({blockProps:e,styles:t,children:o})=>i.jsxRuntimeExports.jsx(s.Preview,{...e,...t,children:o}),I=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("div",{...e,...t,children:o});c.registerChaiBlock(w,{type:"Email/Preview",label:"Preview",group:"basic",category:"core",builderComponent:I,canAcceptBlock:()=>!0,canDuplicate:()=>!1,props:{content:l.r({default:"Preview content",title:"Content"})}});const L=({blockProps:e,content:t})=>i.jsxRuntimeExports.jsx(s.Markdown,{children:t,...e});c.registerChaiBlock(L,{type:"Email/Markdown",label:"Markdown",group:"basic",category:"core",props:{content:l.r({default:"# This is a ~~strikethrough~~",title:"Markdown"})}});const T=({blockProps:e,styles:t,alt:o,image:r,width:n,height:u})=>i.jsxRuntimeExports.jsx(s.Img,{...e,...t,src:r,alt:o,width:n,height:u}),S=({blockProps:e,styles:t,alt:o,image:r,width:n,height:u})=>i.jsxRuntimeExports.jsx("img",{...e,...t,src:r,alt:o,width:n,height:u});c.registerChaiBlock(T,{type:"Email/Image",label:"Image",group:"basic",category:"core",icon:a.ImageIcon,builderComponent:S,props:{styles:l.o({default:"w-full"}),image:l.v({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:l.g({title:"Alt",default:""}),width:l.g({title:"Width",default:""}),height:l.g({title:"Height",default:""})}});const q=({blockProps:e,styles:t})=>i.jsxRuntimeExports.jsx(s.Hr,{...e,...t}),H=({blockProps:e,styles:t})=>i.jsxRuntimeExports.jsx("hr",{...e,...t});c.registerChaiBlock(q,{type:"Email/Divider",label:"Divider",group:"basic",category:"core",icon:a.DividerHorizontalIcon,builderComponent:H,props:{styles:l.o({default:"w-full h-2"})}});const _=({blockProps:e,styles:t,code:o,lineNumbers:r,theme:n,language:u})=>i.jsxRuntimeExports.jsx(s.CodeBlock,{...e,...t,code:o,linenumbers:r,theme:n,language:u}),A=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx("div",{...e,...t,children:i.jsxRuntimeExports.jsx("code",{children:o})});c.registerChaiBlock(_,{type:"Email/CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:a.CodeSandboxLogoIcon,builderComponent:A,props:{styles:l.o({default:""}),code:l.r({title:"Code",default:"console.log('Hello, world!');"}),theme:l.g({title:"Theme",default:"dracula"}),lineNumbers:l.c({title:"Line number",default:!1}),language:l.f({title:"Language",default:"javascript",binding:!1,options:[{value:"javascript",title:"JavaScript"},{value:"html",title:"HTML"},{value:"css",title:"CSS"}]})}});const D=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx(s.CodeInline,{...e,...t,children:o}),M=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx("code",{...e,...t,children:o});c.registerChaiBlock(D,{type:"Email/CodeInline",label:"Code Inline",group:"basic",category:"core",icon:a.CodeSandboxLogoIcon,builderComponent:M,props:{styles:l.o({default:""}),code:l.r({title:"Code",default:"console.log('Hello, world!');"})}});const N=p.noop;exports.loadEmailBlocks=N;
@@ -1,3 +0,0 @@
1
- export declare const loadEmailBlocks: any;
2
-
3
- export { }
@@ -1,294 +0,0 @@
1
- import { noop as f } from "lodash-es";
2
- import { j as o } from "./jsx-runtime-WbnYoNE9.js";
3
- import { Container as k, Section as x, Row as y, Column as B, Heading as C, Text as v, Button as j, Link as w, Preview as E, Markdown as I, Img as L, Hr as T, CodeBlock as H, CodeInline as R } from "@react-email/components";
4
- import { registerChaiBlock as r } from "@chaibuilder/runtime";
5
- import { E as m } from "./empty-slot-Lsxjts7Q.js";
6
- import { f as d, o as a, g as u, r as s, q as g, v as _, c as A } from "./controls-yjgoZzB6.js";
7
- import { ImageIcon as p, HeadingIcon as S, TextIcon as h, Link1Icon as D, DividerHorizontalIcon as M, CodeSandboxLogoIcon as b } from "@radix-ui/react-icons";
8
- import "./_commonjsHelpers-UyOWmZb0.js";
9
- import "react";
10
- import "./Functions-7jnEwJyw.js";
11
- import "clsx";
12
- import "tailwind-merge";
13
- const N = ({ blockProps: e, styles: t, children: l, inBuilder: i }) => {
14
- let n = l;
15
- return l || (n = /* @__PURE__ */ o.jsx(m, { inBuilder: i })), /* @__PURE__ */ o.jsx(k, { ...e, ...t, children: n });
16
- };
17
- r(N, {
18
- type: "Email/Container",
19
- label: "Container",
20
- group: "basic",
21
- category: "core",
22
- canAcceptBlock: () => !0,
23
- canMove: () => !0,
24
- canDelete: () => !1,
25
- canDuplicate: () => !1,
26
- canBeNested: (e) => !e
27
- });
28
- const P = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(x, { ...e, ...t, children: l });
29
- r(P, {
30
- type: "Email/Section",
31
- label: "Section",
32
- group: "basic",
33
- category: "core",
34
- icon: p,
35
- props: {
36
- align: d({
37
- title: "Align",
38
- default: "",
39
- options: [
40
- { value: "", title: "None" },
41
- { value: "left", title: "left" },
42
- { value: "center", title: "center" },
43
- { value: "right", title: "right" }
44
- ]
45
- })
46
- },
47
- canAcceptBlock: () => !0
48
- });
49
- const $ = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(y, { ...e, ...t, children: l });
50
- r($, {
51
- type: "Email/Row",
52
- label: "Row",
53
- group: "basic",
54
- category: "core",
55
- icon: p,
56
- blocks: [
57
- { _type: "Email/Row", _id: "a" },
58
- { _type: "Email/Column", _id: "b", _parent: "a" }
59
- ],
60
- props: {
61
- styles: a({ default: "" })
62
- },
63
- canAcceptBlock: (e) => e === "Email/Column"
64
- });
65
- const q = ({ blockProps: e, styles: t, children: l, align: i }) => {
66
- let n = l;
67
- return l || (n = /* @__PURE__ */ o.jsx(m, {})), /* @__PURE__ */ o.jsx(B, { ...e, ...t, align: i, children: n });
68
- };
69
- r(q, {
70
- type: "Email/Column",
71
- label: "Column",
72
- group: "basic",
73
- category: "core",
74
- icon: p,
75
- props: {
76
- styles: a({ default: "" }),
77
- align: d({
78
- title: "Align",
79
- default: "",
80
- options: [
81
- { value: "", title: "None" },
82
- { value: "left", title: "left" },
83
- { value: "center", title: "center" },
84
- { value: "right", title: "right" }
85
- ]
86
- })
87
- },
88
- canAcceptBlock: () => !0,
89
- canBeNested: (e) => e === "Email/Row"
90
- });
91
- const z = ({ level: e, blockProps: t, styles: l, content: i }) => /* @__PURE__ */ o.jsx(C, { as: e, ...t, ...l, children: i }), J = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("h1", { ...e, ...t, children: l });
92
- r(z, {
93
- type: "Email/Heading",
94
- label: "Heading",
95
- group: "basic",
96
- category: "core",
97
- icon: S,
98
- builderComponent: J,
99
- props: {
100
- content: u({ title: "Content", default: "Enter your heading here..." }),
101
- styles: a({ default: "text-xl" }),
102
- level: d({
103
- title: "Level",
104
- default: "h1",
105
- binding: !1,
106
- options: [
107
- { value: "h1", title: "h1" },
108
- { value: "h2", title: "h2" },
109
- { value: "h3", title: "h3" },
110
- { value: "h4", title: "h4" },
111
- { value: "h5", title: "h5" },
112
- { value: "h6", title: "h6" }
113
- ]
114
- })
115
- },
116
- canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
117
- });
118
- const U = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx(v, { ...e, ...t, children: l }), V = ({ content: e, blockProps: t, styles: l }) => /* @__PURE__ */ o.jsx("p", { ...t, ...l, children: e });
119
- r(U, {
120
- type: "Email/Text",
121
- label: "Text",
122
- group: "basic",
123
- category: "core",
124
- icon: h,
125
- builderComponent: V,
126
- props: {
127
- content: s({
128
- title: "Content",
129
- default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim."
130
- }),
131
- styles: a({ default: "" })
132
- },
133
- canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
134
- });
135
- const W = ({ content: e }) => e, F = ({ content: e, blockProps: t }) => /* @__PURE__ */ o.jsx("span", { ...t, children: e });
136
- r(W, {
137
- type: "Email/RawText",
138
- label: "Raw Text",
139
- group: "basic",
140
- category: "core",
141
- icon: h,
142
- hidden: !0,
143
- builderComponent: F,
144
- props: {
145
- content: s({
146
- title: "Content",
147
- default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "
148
- })
149
- }
150
- });
151
- const G = ({ blockProps: e, styles: t, link: l, content: i }) => /* @__PURE__ */ o.jsx(j, { ...e, ...t, href: l.href, children: i }), K = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("button", { type: "button", ...e, ...t, children: l });
152
- r(G, {
153
- type: "Email/Button",
154
- label: "Button",
155
- group: "basic",
156
- category: "core",
157
- builderComponent: K,
158
- props: {
159
- content: u({ title: "Content", default: "Click me" }),
160
- link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
161
- styles: a({ default: "bg-primary text-white px-4 py-2 rounded-md" })
162
- }
163
- });
164
- const O = ({ blockProps: e, styles: t, href: l, content: i, target: n, children: c }) => /* @__PURE__ */ o.jsx(w, { ...e, ...t, href: l, target: n, children: c || i }), Q = ({ blockProps: e, styles: t, content: l, children: i }) => {
165
- let n = i;
166
- return i || (n = /* @__PURE__ */ o.jsx(m, {})), /* @__PURE__ */ o.jsx("span", { ...e, ...t, children: n || l });
167
- };
168
- r(O, {
169
- type: "Email/Link",
170
- label: "Link",
171
- group: "basic",
172
- category: "core",
173
- icon: D,
174
- blocks: [
175
- {
176
- _id: "a",
177
- _type: "Link"
178
- },
179
- {
180
- _id: "b",
181
- _parent: "a",
182
- _type: "RawText",
183
- content: "I am a link."
184
- }
185
- ],
186
- builderComponent: Q,
187
- props: {
188
- content: u({ title: "Content", default: "I am a link." }),
189
- link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
190
- styles: a({ default: "font-bold text-blue-500" })
191
- },
192
- canAcceptBlock: () => !0
193
- });
194
- const X = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(E, { ...e, ...t, children: l }), Y = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("div", { ...e, ...t, children: l });
195
- r(X, {
196
- type: "Email/Preview",
197
- label: "Preview",
198
- group: "basic",
199
- category: "core",
200
- builderComponent: Y,
201
- canAcceptBlock: () => !0,
202
- canDuplicate: () => !1,
203
- props: {
204
- content: s({ default: "Preview content", title: "Content" })
205
- }
206
- });
207
- const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ o.jsx(I, { children: t, ...e });
208
- r(Z, {
209
- type: "Email/Markdown",
210
- label: "Markdown",
211
- group: "basic",
212
- category: "core",
213
- props: {
214
- content: s({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
215
- }
216
- });
217
- const ee = ({ blockProps: e, styles: t, alt: l, image: i, width: n, height: c }) => /* @__PURE__ */ o.jsx(L, { ...e, ...t, src: i, alt: l, width: n, height: c }), te = ({ blockProps: e, styles: t, alt: l, image: i, width: n, height: c }) => /* @__PURE__ */ o.jsx("img", { ...e, ...t, src: i, alt: l, width: n, height: c });
218
- r(ee, {
219
- type: "Email/Image",
220
- label: "Image",
221
- group: "basic",
222
- category: "core",
223
- icon: p,
224
- builderComponent: te,
225
- props: {
226
- styles: a({ default: "w-full" }),
227
- image: _({
228
- title: "Image",
229
- default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
230
- }),
231
- alt: u({ title: "Alt", default: "" }),
232
- width: u({ title: "Width", default: "" }),
233
- height: u({ title: "Height", default: "" })
234
- }
235
- });
236
- const le = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx(T, { ...e, ...t }), oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx("hr", { ...e, ...t });
237
- r(le, {
238
- type: "Email/Divider",
239
- label: "Divider",
240
- group: "basic",
241
- category: "core",
242
- icon: M,
243
- builderComponent: oe,
244
- props: {
245
- styles: a({ default: "w-full h-2" })
246
- }
247
- });
248
- const ie = ({ blockProps: e, styles: t, code: l, lineNumbers: i, theme: n, language: c }) => /* @__PURE__ */ o.jsx(H, { ...e, ...t, code: l, linenumbers: i, theme: n, language: c }), ne = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx("div", { ...e, ...t, children: /* @__PURE__ */ o.jsx("code", { children: l }) });
249
- r(ie, {
250
- type: "Email/CodeBlock",
251
- label: "Code Block",
252
- group: "basic",
253
- category: "core",
254
- hidden: !0,
255
- icon: b,
256
- builderComponent: ne,
257
- props: {
258
- styles: a({ default: "" }),
259
- code: s({ title: "Code", default: "console.log('Hello, world!');" }),
260
- theme: u({ title: "Theme", default: "dracula" }),
261
- lineNumbers: A({
262
- title: "Line number",
263
- default: !1
264
- }),
265
- language: d({
266
- title: "Language",
267
- default: "javascript",
268
- binding: !1,
269
- options: [
270
- { value: "javascript", title: "JavaScript" },
271
- { value: "html", title: "HTML" },
272
- { value: "css", title: "CSS" }
273
- //add more options
274
- ]
275
- })
276
- }
277
- });
278
- const re = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx(R, { ...e, ...t, children: l }), ae = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx("code", { ...e, ...t, children: l });
279
- r(re, {
280
- type: "Email/CodeInline",
281
- label: "Code Inline",
282
- group: "basic",
283
- category: "core",
284
- icon: b,
285
- builderComponent: ae,
286
- props: {
287
- styles: a({ default: "" }),
288
- code: s({ title: "Code", default: "console.log('Hello, world!');" })
289
- }
290
- });
291
- const ye = f;
292
- export {
293
- ye as loadEmailBlocks
294
- };
package/dist/email.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-audsIPBC.cjs"),r=require("@radix-ui/react-icons"),o=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("jotai");require("@react-hookz/web");require("react-arborist");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-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("tree-model");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");const n=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],s=i=>{const u={...i,filterChaiBlock:t=>o.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:n};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;