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

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 (124) hide show
  1. package/README.md +26 -21
  2. package/dist/CodeEditor-2fowVPcS.cjs +143 -0
  3. package/dist/CodeEditor-b6uePnTe.js +143 -0
  4. package/dist/STRINGS-RCf9qnaS.cjs +9 -0
  5. package/dist/STRINGS-t8UhMYZ6.js +10 -0
  6. package/dist/Topbar-O21Nrw2O.cjs +137 -0
  7. package/dist/Topbar-xFfdTq1m.js +137 -0
  8. package/dist/UnsplashImages-awQiGFMX.cjs +280 -0
  9. package/dist/UnsplashImages-qQmFIWEy.js +280 -0
  10. package/dist/UploadImages-a8Hl0tyg.cjs +170 -0
  11. package/dist/UploadImages-cudxJepv.js +170 -0
  12. package/dist/context-menu-VMB9i0d8.cjs +1074 -0
  13. package/dist/context-menu-mp3Gu2KA.js +1043 -0
  14. package/dist/controls-4t-C_rP2.cjs +233 -0
  15. package/dist/controls-fQIu127i.js +234 -0
  16. package/dist/core.cjs +135 -1
  17. package/dist/core.d.ts +344 -119
  18. package/dist/core.js +111 -88
  19. package/dist/iconBase-OGxLGBQ1.cjs +156 -0
  20. package/dist/iconBase-Ofd16yeE.js +157 -0
  21. package/dist/index-R7v8ZYnu.js +12110 -0
  22. package/dist/index-WHVUpVPa.cjs +12125 -0
  23. package/dist/jsx-runtime-_yxTjXEh.js +931 -0
  24. package/dist/jsx-runtime-vPqyLgmD.cjs +930 -0
  25. package/dist/mockServiceWorker.js +18 -10
  26. package/dist/plugin-RAiM74uD.cjs +116 -0
  27. package/dist/plugin-T1qbgBUO.js +55 -0
  28. package/dist/plugin-YcxlCmRm.js +117 -0
  29. package/dist/plugin-cYi6q9KC.cjs +54 -0
  30. package/dist/render.cjs +215 -1
  31. package/dist/render.d.ts +21 -40
  32. package/dist/render.js +190 -98
  33. package/dist/runtime.cjs +28 -0
  34. package/dist/runtime.d.ts +5 -0
  35. package/dist/runtime.js +21 -0
  36. package/dist/style.css +1524 -1
  37. package/dist/tailwind.cjs +80 -1
  38. package/dist/tailwind.d.ts +49 -8
  39. package/dist/tailwind.js +23 -25
  40. package/dist/ui.cjs +410 -1
  41. package/dist/ui.d.ts +3 -13
  42. package/dist/ui.js +374 -163
  43. package/dist/web-blocks.cjs +1246 -9
  44. package/dist/web-blocks.d.ts +1 -1
  45. package/dist/web-blocks.js +961 -789
  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/controls-XPXGHKht.js +0 -182
  85. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  86. package/dist/delete-page-modal-YrIBvfFA.js +0 -88
  87. package/dist/email-blocks.cjs +0 -1
  88. package/dist/email-blocks.d.ts +0 -3
  89. package/dist/email-blocks.js +0 -274
  90. package/dist/form-OVmsLOrc.js +0 -125
  91. package/dist/form-VbouZlAW.cjs +0 -1
  92. package/dist/functions-Ox_svtKm.cjs +0 -1
  93. package/dist/functions-xIebp8Aw.js +0 -23
  94. package/dist/html-to-json-2PeOCVey.cjs +0 -1
  95. package/dist/html-to-json-57841sEK.js +0 -183
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-N50dZnlC.cjs +0 -206
  98. package/dist/index-e0c8PmRQ.js +0 -205
  99. package/dist/index-gi1LIOCw.cjs +0 -1
  100. package/dist/index-niHREMmR.js +0 -2938
  101. package/dist/index-pZhGT8uT.js +0 -41620
  102. package/dist/jsx-runtime-WbnYoNE9.js +0 -634
  103. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  104. package/dist/lib.cjs +0 -4
  105. package/dist/lib.d.ts +0 -78
  106. package/dist/lib.js +0 -1322
  107. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  108. package/dist/page-viewer-feqJr1QI.js +0 -115
  109. package/dist/project-general-setting-SgagORzW.js +0 -83
  110. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  111. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  112. package/dist/project-seo-setting-wxAGEkd_.js +0 -85
  113. package/dist/server.cjs +0 -1
  114. package/dist/server.d.ts +0 -299
  115. package/dist/server.js +0 -216
  116. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
  117. package/dist/single-page-detail-dnWMyg6P.js +0 -222
  118. package/dist/studio.cjs +0 -1
  119. package/dist/studio.d.ts +0 -13
  120. package/dist/studio.js +0 -58
  121. package/dist/useAddBlockByDrop-_nwI4W3q.js +0 -20
  122. package/dist/useAddBlockByDrop-inkD7Lck.cjs +0 -1
  123. package/dist/utils-AvyFzbPC.js +0 -1075
  124. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -1,182 +0,0 @@
1
- import { get as t, omit as e } from "lodash-es";
2
- const a = "#styles:";
3
- const r = (i) => ({
4
- type: "singular",
5
- default: i.default || "",
6
- binding: t(i, "binding", !0),
7
- i18n: i.i18n || !1,
8
- dataType: "string",
9
- required: i.required || !1,
10
- schema: {
11
- type: "string",
12
- ...e(i, ["i18n", "required"])
13
- },
14
- uiSchema: {
15
- "ui:placeholder": i.placeholder || "Enter here"
16
- }
17
- }), u = (i) => ({
18
- type: "singular",
19
- default: i.default || "",
20
- binding: t(i, "binding", !0),
21
- dataType: "string",
22
- i18n: i.i18n || !1,
23
- required: i.required || !1,
24
- schema: {
25
- type: "string",
26
- ...e(i, ["i18n", "required", "rows"])
27
- },
28
- uiSchema: {
29
- "ui:widget": "textarea",
30
- "ui:placeholder": i.placeholder || "Enter here",
31
- "ui:options": {
32
- rows: i.rows || 4
33
- }
34
- }
35
- }), l = (i) => ({
36
- type: "singular",
37
- i18n: i.i18n || !1,
38
- default: i.default || !1,
39
- dataType: "boolean",
40
- binding: t(i, "binding", !0),
41
- schema: {
42
- type: "boolean",
43
- ...e(i, ["i18n", "required"])
44
- },
45
- uiSchema: {
46
- "ui:title": i.title || "Select Item",
47
- "ui:description": ""
48
- }
49
- }), g = (i) => ({
50
- type: "singular",
51
- default: i.default || "",
52
- binding: t(i, "binding", !0),
53
- dataType: "number",
54
- i18n: i.i18n || !1,
55
- required: i.required || !1,
56
- schema: {
57
- type: "number",
58
- ...e(i, ["i18n", "required"])
59
- },
60
- uiSchema: {}
61
- }), s = (i) => ({
62
- type: "singular",
63
- default: i.default || "",
64
- binding: t(i, "binding", !0),
65
- i18n: i.i18n || !1,
66
- required: i.required || !1,
67
- dataType: "string",
68
- schema: {
69
- type: "string",
70
- ...e(i, ["i18n", "required", "options", "binding"]),
71
- oneOf: i.options.map((n) => ({ const: n.value, title: n.title }))
72
- },
73
- uiSchema: {
74
- "ui:widget": "select"
75
- }
76
- }), p = (i) => ({
77
- type: "singular",
78
- i18n: i.i18n || !1,
79
- default: i.default || "",
80
- binding: t(i, "binding", !0),
81
- dataType: "string",
82
- schema: {
83
- type: "string",
84
- ...e(i, ["i18n", "required"])
85
- },
86
- uiSchema: {
87
- "ui:widget": "color"
88
- }
89
- });
90
- const y = (i) => ({
91
- type: "singular",
92
- default: i.default || "",
93
- i18n: i.i18n || !1,
94
- binding: t(i, "binding", !0),
95
- dataType: "string",
96
- schema: {
97
- type: "string",
98
- ...e(i, ["i18n", "required"])
99
- },
100
- uiSchema: {
101
- "ui:widget": "richtext"
102
- }
103
- }), m = (i) => ({
104
- type: "model",
105
- title: i.title,
106
- dataType: "object",
107
- default: i.default || {},
108
- binding: t(i, "binding", !0),
109
- properties: i.properties
110
- }), o = (i) => ({
111
- type: "list",
112
- itemProperties: i.itemProperties,
113
- binding: t(i, "binding", !0),
114
- title: i.title,
115
- dataType: "array",
116
- default: i.default || [],
117
- itemTitle: i.getItemLabel ? i.getItemLabel({}) : () => ""
118
- }), c = (i) => ({
119
- type: "styles",
120
- binding: !1,
121
- default: `${a},${i.default || ""}`
122
- }), b = (i) => ({
123
- default: i.default || "",
124
- binding: t(i, "binding", !0),
125
- type: "singular",
126
- i18n: i.i18n || !1,
127
- dataType: "string",
128
- schema: {
129
- type: "string",
130
- title: "Icon",
131
- default: i.default || ""
132
- },
133
- uiSchema: {
134
- "ui:widget": "icon"
135
- }
136
- }), f = (i) => ({
137
- default: i.default,
138
- type: "singular",
139
- binding: t(i, "binding", !0),
140
- dataType: "object",
141
- i18n: i.i18n || !1,
142
- schema: {
143
- type: "object",
144
- ...i || {},
145
- properties: {
146
- type: { type: "string" },
147
- href: { type: "string" },
148
- target: { type: "string" }
149
- }
150
- },
151
- uiSchema: {
152
- "ui:field": "link"
153
- }
154
- }), h = (i) => ({
155
- type: "singular",
156
- default: i.default || "",
157
- binding: t(i, "binding", !0),
158
- dataType: "string",
159
- i18n: i.i18n || !1,
160
- schema: {
161
- type: "string",
162
- ...e(i, ["i18n", "required"])
163
- },
164
- uiSchema: {
165
- "ui:widget": "image"
166
- }
167
- });
168
- export {
169
- c as S,
170
- b as T,
171
- m as b,
172
- g as c,
173
- s as f,
174
- u as g,
175
- o as h,
176
- y as m,
177
- h as o,
178
- f as q,
179
- l as r,
180
- r as u,
181
- p as y
182
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-H6vIwGfD.cjs"),q=require("./index-N50dZnlC.cjs"),l=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");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 d=({pageData:i,projectData:t})=>{const n={},u=q.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(l.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,88 +0,0 @@
1
- import { j as r } from "./jsx-runtime-WbnYoNE9.js";
2
- import { E as s, F as l, G as n, I as d, J as a, L as c, B as u } from "./index-niHREMmR.js";
3
- import { j as x } from "./index-pZhGT8uT.js";
4
- import { TrashIcon as h } 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-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 jr = ({ pageData: e, projectData: i }) => {
57
- const m = {}, t = x(), o = e.uuid === i.homepage, p = () => {
58
- t.mutate(e, {
59
- onSuccess: () => {
60
- m({ uuid: i.homepage, slug: "/home" });
61
- }
62
- });
63
- };
64
- return /* @__PURE__ */ r.jsxs(s, { children: [
65
- /* @__PURE__ */ r.jsx(l, { disabled: o, children: /* @__PURE__ */ r.jsx(
66
- "div",
67
- {
68
- 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"}`,
69
- children: /* @__PURE__ */ r.jsx(h, {})
70
- }
71
- ) }),
72
- /* @__PURE__ */ r.jsxs(n, { children: [
73
- /* @__PURE__ */ r.jsxs(d, { children: [
74
- "Are you sure you want to delete ",
75
- /* @__PURE__ */ r.jsx("i", { className: "text-red-500", children: e.name }),
76
- " page?"
77
- ] }),
78
- /* @__PURE__ */ r.jsx(a, { children: "This action cannot be undone. This will permanently delete your page." }),
79
- /* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
80
- /* @__PURE__ */ r.jsx(c, { disabled: t.isPending, children: "Cancel" }),
81
- /* @__PURE__ */ r.jsx(u, { variant: "destructive", onClick: p, disabled: t.isPending, children: "Yes, Delete" })
82
- ] })
83
- ] })
84
- ] });
85
- };
86
- export {
87
- jr as default
88
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("lodash-es"),l=require("./jsx-runtime-Z_BpKhVy.cjs"),c=require("@react-email/components"),i=require("@chaibuilder/runtime"),r=require("./controls-Dy1qa8Dc.cjs"),s=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");const p=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Container,{...e,...t,children:o});i.registerChaiBlock(p,{type:"Container",label:"Container",group:"basic",category:"core",props:{styles:r.S({default:""})},canAcceptBlock:()=>!0,canMove:()=>!0,canDelete:()=>!1,canDuplicate:()=>!1});const x=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Section,{...e,...t,children:o});i.registerChaiBlock(x,{type:"Section",label:"Section",group:"basic",category:"core",icon:s.ImageIcon,props:{styles:r.S({default:"w-full"}),align:r.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})=>l.jsxRuntimeExports.jsx(c.Row,{...e,...t,children:o});i.registerChaiBlock(g,{type:"Row",label:"Row",group:"basic",category:"core",icon:s.ImageIcon,props:{styles:r.S({default:""})},canAcceptBlock:e=>e==="Column"});const m=({blockProps:e,styles:t,children:o,align:n})=>l.jsxRuntimeExports.jsx(c.Column,{...e,...t,align:n,children:o});i.registerChaiBlock(m,{type:"Column",label:"Column",group:"basic",category:"core",icon:s.ImageIcon,props:{styles:r.S({default:""}),align:r.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0});const h=({level:e,blockProps:t,styles:o,content:n})=>l.jsxRuntimeExports.jsx(c.Heading,{as:e,...t,...o,children:n}),k=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("h1",{...e,...t,children:o});i.registerChaiBlock(h,{type:"Heading",label:"Heading",group:"basic",category:"core",icon:s.HeadingIcon,builderComponent:k,props:{content:r.u({title:"Content",default:"Enter your heading here..."}),styles:r.S({default:"text-xl"}),level:r.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=>["Link","RawText"].includes(e)});const b=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx(c.Text,{...e,...t,children:o}),B=({content:e,blockProps:t,styles:o})=>l.jsxRuntimeExports.jsx("p",{...t,...o,children:e});i.registerChaiBlock(b,{type:"Text",label:"Text",group:"basic",category:"core",icon:s.TextIcon,builderComponent:B,props:{content:r.g({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:r.S({default:""})},canAcceptBlock:e=>["Link","RawText"].includes(e)});const f=({content:e})=>e,C=({content:e,blockProps:t})=>l.jsxRuntimeExports.jsx("span",{...t,children:e});i.registerChaiBlock(f,{type:"RawText",label:"Raw Text",group:"basic",category:"core",icon:s.TextIcon,hidden:!0,builderComponent:C,props:{content:r.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const j=({blockProps:e,styles:t,link:o,content:n})=>l.jsxRuntimeExports.jsx(c.Button,{...e,...t,href:o.href,children:n}),y=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});i.registerChaiBlock(j,{type:"Button",label:"Button",group:"basic",category:"core",builderComponent:y,props:{content:r.u({title:"Content",default:"Click me"}),link:r.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:r.S({default:"bg-primary text-white px-4 py-2 rounded-md"})}});const v=({blockProps:e,styles:t,href:o,content:n,target:a})=>l.jsxRuntimeExports.jsx(c.Link,{...e,...t,href:o,target:a,children:n}),R=({blockProps:e,styles:t,content:o,children:n})=>l.jsxRuntimeExports.jsx("span",{...e,...t,children:n||o});i.registerChaiBlock(v,{type:"Link",label:"Link",group:"basic",category:"core",icon:s.Link1Icon,blocks:[{_id:"a",_type:"Link"},{_id:"b",_parent:"a",_type:"RawText",content:"I am a link."}],builderComponent:R,props:{content:r.u({title:"Content",default:"I am a link."}),link:r.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:r.S({default:"font-bold text-blue-500"})},canAcceptBlock:()=>!0});const E=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Preview,{...e,...t,children:o}),I=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:o});i.registerChaiBlock(E,{type:"Preview",label:"Preview",group:"basic",category:"core",builderComponent:I,canAcceptBlock:()=>!0,canDuplicate:()=>!1});const w=({blockProps:e,content:t})=>l.jsxRuntimeExports.jsx(c.Markdown,{children:t,...e});i.registerChaiBlock(w,{type:"Markdown",label:"Markdown",group:"basic",category:"core",props:{content:r.g({default:"# This is a ~~strikethrough~~",title:"Markdown"})}});const S=({blockProps:e,styles:t,alt:o,image:n,width:a,height:u})=>l.jsxRuntimeExports.jsx(c.Img,{...e,...t,src:n,alt:o,width:a,height:u}),L=({blockProps:e,styles:t,alt:o,image:n,width:a,height:u})=>l.jsxRuntimeExports.jsx("img",{...e,...t,src:n,alt:o,width:a,height:u});i.registerChaiBlock(S,{type:"Image",label:"Image",group:"basic",category:"core",icon:s.ImageIcon,builderComponent:L,props:{styles:r.S({default:"w-full"}),image:r.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:r.u({title:"Alt",default:""}),width:r.u({title:"Width",default:""}),height:r.u({title:"Height",default:""})}});const T=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx(c.Hr,{...e,...t}),H=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx("hr",{...e,...t});i.registerChaiBlock(T,{type:"Divider",label:"Divider",group:"basic",category:"core",icon:s.DividerHorizontalIcon,builderComponent:H,props:{styles:r.S({default:"w-full h-2"})}});const q=({blockProps:e,styles:t,code:o,lineNumbers:n,theme:a,language:u})=>l.jsxRuntimeExports.jsx(c.CodeBlock,{...e,...t,code:o,linenumbers:n,theme:a,language:u}),A=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:l.jsxRuntimeExports.jsx("code",{children:o})});i.registerChaiBlock(q,{type:"CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:s.CodeSandboxLogoIcon,builderComponent:A,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"}),theme:r.u({title:"Theme",default:"dracula"}),lineNumbers:r.r({title:"Line number",default:!1}),language:r.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})=>l.jsxRuntimeExports.jsx(c.CodeInline,{...e,...t,children:o}),M=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("code",{...e,...t,children:o});i.registerChaiBlock(D,{type:"CodeInline",label:"Code Inline",group:"basic",category:"core",icon:s.CodeSandboxLogoIcon,builderComponent:M,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"})}});const _=d.noop;exports.loadEmailBlocks=_;
@@ -1,3 +0,0 @@
1
- export declare const loadEmailBlocks: any;
2
-
3
- export { }
@@ -1,274 +0,0 @@
1
- import { noop as b } from "lodash-es";
2
- import { j as l } from "./jsx-runtime-WbnYoNE9.js";
3
- import { Container as f, Section as k, Row as y, Column as x, Heading as B, Text as C, Button as v, Link as j, Preview as w, Markdown as I, Img as L, Hr as T, CodeBlock as H, CodeInline as A } from "@react-email/components";
4
- import { registerChaiBlock as r } from "@chaibuilder/runtime";
5
- import { S as i, f as d, u as a, g as s, q as g, o as R, r as S } from "./controls-XPXGHKht.js";
6
- import { ImageIcon as p, HeadingIcon as D, TextIcon as m, Link1Icon as M, DividerHorizontalIcon as _, CodeSandboxLogoIcon as h } from "@radix-ui/react-icons";
7
- import "./_commonjsHelpers-UyOWmZb0.js";
8
- import "react";
9
- const N = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(f, { ...e, ...t, children: o });
10
- r(N, {
11
- type: "Container",
12
- label: "Container",
13
- group: "basic",
14
- category: "core",
15
- props: { styles: i({ default: "" }) },
16
- canAcceptBlock: () => !0,
17
- canMove: () => !0,
18
- canDelete: () => !1,
19
- canDuplicate: () => !1
20
- });
21
- const P = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(k, { ...e, ...t, children: o });
22
- r(P, {
23
- type: "Section",
24
- label: "Section",
25
- group: "basic",
26
- category: "core",
27
- icon: p,
28
- props: {
29
- styles: i({ default: "w-full" }),
30
- align: d({
31
- title: "Align",
32
- default: "",
33
- options: [
34
- { value: "", title: "None" },
35
- { value: "left", title: "left" },
36
- { value: "center", title: "center" },
37
- { value: "right", title: "right" }
38
- ]
39
- })
40
- },
41
- canAcceptBlock: () => !0
42
- });
43
- const $ = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(y, { ...e, ...t, children: o });
44
- r($, {
45
- type: "Row",
46
- label: "Row",
47
- group: "basic",
48
- category: "core",
49
- icon: p,
50
- props: {
51
- styles: i({ default: "" })
52
- },
53
- canAcceptBlock: (e) => e === "Column"
54
- });
55
- const E = ({ blockProps: e, styles: t, children: o, align: n }) => /* @__PURE__ */ l.jsx(x, { ...e, ...t, align: n, children: o });
56
- r(E, {
57
- type: "Column",
58
- label: "Column",
59
- group: "basic",
60
- category: "core",
61
- icon: p,
62
- props: {
63
- styles: i({ default: "" }),
64
- align: d({
65
- title: "Align",
66
- default: "",
67
- options: [
68
- { value: "", title: "None" },
69
- { value: "left", title: "left" },
70
- { value: "center", title: "center" },
71
- { value: "right", title: "right" }
72
- ]
73
- })
74
- },
75
- canAcceptBlock: () => !0
76
- });
77
- const q = ({ level: e, blockProps: t, styles: o, content: n }) => /* @__PURE__ */ l.jsx(B, { as: e, ...t, ...o, children: n }), z = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("h1", { ...e, ...t, children: o });
78
- r(q, {
79
- type: "Heading",
80
- label: "Heading",
81
- group: "basic",
82
- category: "core",
83
- icon: D,
84
- builderComponent: z,
85
- props: {
86
- content: a({ title: "Content", default: "Enter your heading here..." }),
87
- styles: i({ default: "text-xl" }),
88
- level: d({
89
- title: "Level",
90
- default: "h1",
91
- binding: !1,
92
- options: [
93
- { value: "h1", title: "h1" },
94
- { value: "h2", title: "h2" },
95
- { value: "h3", title: "h3" },
96
- { value: "h4", title: "h4" },
97
- { value: "h5", title: "h5" },
98
- { value: "h6", title: "h6" }
99
- ]
100
- })
101
- },
102
- canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
103
- });
104
- const J = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx(C, { ...e, ...t, children: o }), U = ({ content: e, blockProps: t, styles: o }) => /* @__PURE__ */ l.jsx("p", { ...t, ...o, children: e });
105
- r(J, {
106
- type: "Text",
107
- label: "Text",
108
- group: "basic",
109
- category: "core",
110
- icon: m,
111
- builderComponent: U,
112
- props: {
113
- content: s({
114
- title: "Content",
115
- 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."
116
- }),
117
- styles: i({ default: "" })
118
- },
119
- canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
120
- });
121
- const V = ({ content: e }) => e, W = ({ content: e, blockProps: t }) => /* @__PURE__ */ l.jsx("span", { ...t, children: e });
122
- r(V, {
123
- type: "RawText",
124
- label: "Raw Text",
125
- group: "basic",
126
- category: "core",
127
- icon: m,
128
- hidden: !0,
129
- builderComponent: W,
130
- props: {
131
- content: s({
132
- title: "Content",
133
- default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "
134
- })
135
- }
136
- });
137
- const F = ({ blockProps: e, styles: t, link: o, content: n }) => /* @__PURE__ */ l.jsx(v, { ...e, ...t, href: o.href, children: n }), G = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("button", { type: "button", ...e, ...t, children: o });
138
- r(F, {
139
- type: "Button",
140
- label: "Button",
141
- group: "basic",
142
- category: "core",
143
- builderComponent: G,
144
- props: {
145
- content: a({ title: "Content", default: "Click me" }),
146
- link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
147
- styles: i({ default: "bg-primary text-white px-4 py-2 rounded-md" })
148
- }
149
- });
150
- const K = ({ blockProps: e, styles: t, href: o, content: n, target: c }) => /* @__PURE__ */ l.jsx(j, { ...e, ...t, href: o, target: c, children: n }), O = ({ blockProps: e, styles: t, content: o, children: n }) => /* @__PURE__ */ l.jsx("span", { ...e, ...t, children: n || o });
151
- r(K, {
152
- type: "Link",
153
- label: "Link",
154
- group: "basic",
155
- category: "core",
156
- icon: M,
157
- blocks: [
158
- {
159
- _id: "a",
160
- _type: "Link"
161
- },
162
- {
163
- _id: "b",
164
- _parent: "a",
165
- _type: "RawText",
166
- content: "I am a link."
167
- }
168
- ],
169
- builderComponent: O,
170
- props: {
171
- content: a({ title: "Content", default: "I am a link." }),
172
- link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
173
- styles: i({ default: "font-bold text-blue-500" })
174
- },
175
- canAcceptBlock: () => !0
176
- });
177
- const Q = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(w, { ...e, ...t, children: o }), X = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: o });
178
- r(Q, {
179
- type: "Preview",
180
- label: "Preview",
181
- group: "basic",
182
- category: "core",
183
- builderComponent: X,
184
- canAcceptBlock: () => !0,
185
- canDuplicate: () => !1
186
- });
187
- const Y = ({ blockProps: e, content: t }) => /* @__PURE__ */ l.jsx(I, { children: t, ...e });
188
- r(Y, {
189
- type: "Markdown",
190
- label: "Markdown",
191
- group: "basic",
192
- category: "core",
193
- props: {
194
- content: s({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
195
- }
196
- });
197
- const Z = ({ blockProps: e, styles: t, alt: o, image: n, width: c, height: u }) => /* @__PURE__ */ l.jsx(L, { ...e, ...t, src: n, alt: o, width: c, height: u }), ee = ({ blockProps: e, styles: t, alt: o, image: n, width: c, height: u }) => /* @__PURE__ */ l.jsx("img", { ...e, ...t, src: n, alt: o, width: c, height: u });
198
- r(Z, {
199
- type: "Image",
200
- label: "Image",
201
- group: "basic",
202
- category: "core",
203
- icon: p,
204
- builderComponent: ee,
205
- props: {
206
- styles: i({ default: "w-full" }),
207
- image: R({
208
- title: "Image",
209
- default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
210
- }),
211
- alt: a({ title: "Alt", default: "" }),
212
- width: a({ title: "Width", default: "" }),
213
- height: a({ title: "Height", default: "" })
214
- }
215
- });
216
- const te = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx(T, { ...e, ...t }), oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx("hr", { ...e, ...t });
217
- r(te, {
218
- type: "Divider",
219
- label: "Divider",
220
- group: "basic",
221
- category: "core",
222
- icon: _,
223
- builderComponent: oe,
224
- props: {
225
- styles: i({ default: "w-full h-2" })
226
- }
227
- });
228
- const le = ({ blockProps: e, styles: t, code: o, lineNumbers: n, theme: c, language: u }) => /* @__PURE__ */ l.jsx(H, { ...e, ...t, code: o, linenumbers: n, theme: c, language: u }), ne = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: /* @__PURE__ */ l.jsx("code", { children: o }) });
229
- r(le, {
230
- type: "CodeBlock",
231
- label: "Code Block",
232
- group: "basic",
233
- category: "core",
234
- hidden: !0,
235
- icon: h,
236
- builderComponent: ne,
237
- props: {
238
- styles: i({ default: "" }),
239
- code: s({ title: "Code", default: "console.log('Hello, world!');" }),
240
- theme: a({ title: "Theme", default: "dracula" }),
241
- lineNumbers: S({
242
- title: "Line number",
243
- default: !1
244
- }),
245
- language: d({
246
- title: "Language",
247
- default: "javascript",
248
- binding: !1,
249
- options: [
250
- { value: "javascript", title: "JavaScript" },
251
- { value: "html", title: "HTML" },
252
- { value: "css", title: "CSS" }
253
- //add more options
254
- ]
255
- })
256
- }
257
- });
258
- const re = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx(A, { ...e, ...t, children: o }), ie = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("code", { ...e, ...t, children: o });
259
- r(re, {
260
- type: "CodeInline",
261
- label: "Code Inline",
262
- group: "basic",
263
- category: "core",
264
- icon: h,
265
- builderComponent: ie,
266
- props: {
267
- styles: i({ default: "" }),
268
- code: s({ title: "Code", default: "console.log('Hello, world!');" })
269
- }
270
- });
271
- const he = b;
272
- export {
273
- he as loadEmailBlocks
274
- };