@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
package/dist/render.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { JSX as JSX_2 } from 'react/jsx-runtime';
2
- import { default as React_2 } from 'react';
3
2
 
4
3
  declare type ChaiBlock = {
5
4
  _id: string;
@@ -9,51 +8,33 @@ declare type ChaiBlock = {
9
8
  _bindings?: Record<string, string>;
10
9
  } & Record<string, any>;
11
10
 
12
- export declare type ChaiPageData = {
13
- page: {
14
- blocks: ChaiBlock[];
15
- seoData?: Record<string, string>;
16
- slug?: string;
17
- name?: string;
18
- providers?: {
19
- providerKey: string;
20
- args: Record<string, any>;
21
- }[];
22
- };
23
- subPages?: {
24
- uuid: string;
25
- blocks: ChaiBlock[];
26
- providers: {
27
- providerKey: string;
28
- args: Record<string, any>;
29
- }[];
30
- }[];
31
- project: {
32
- name?: string;
33
- favicon?: string;
34
- brandingOptions: Record<string, string | number>;
35
- seoData?: Record<string, string>;
36
- primaryLanguage?: string;
37
- languages?: string[];
38
- homepage?: string;
39
- };
40
- };
11
+ declare type ChaiBuilderTailwindTheme<T extends Record<string, unknown> = Record<string, unknown>> = {
12
+ primaryColor: string;
13
+ secondaryColor: string;
14
+ headingFont: string;
15
+ bodyFont: string;
16
+ roundedCorners: string;
17
+ bodyBgLightColor: string;
18
+ bodyBgDarkColor: string;
19
+ bodyTextLightColor: string;
20
+ bodyTextDarkColor: string;
21
+ } & T;
41
22
 
42
- declare type ChaiPageProps = {
43
- before?: React_2.ReactNode;
44
- after?: React_2.ReactNode;
45
- pageData: ChaiPageData;
46
- classPrefix?: string;
47
- externalData?: Record<string, any>;
48
- };
23
+ /**
24
+ * This function converts the chai format content to chai blocks
25
+ * @param chaiFormatContent
26
+ */
27
+ export declare const convertToBlocks: (chaiFormatContent: string) => ChaiBlock[];
49
28
 
50
- export declare function RenderChaiBlocks({ blocks, parent, classPrefix, externalData, }: {
29
+ export declare const getStylesForBlocks: (blocks: ChaiBlock[], theme?: ChaiBuilderTailwindTheme | Record<string, string>, includeBaseStyles?: boolean) => Promise<string>;
30
+
31
+ export declare function RenderChaiBlocks({ blocks, parent, classPrefix, externalData, blockModifierCallback, lang, }: {
51
32
  blocks: ChaiBlock[];
52
33
  parent?: string;
53
34
  classPrefix?: string;
54
35
  externalData?: Record<string, any>;
36
+ blockModifierCallback?: (block: ChaiBlock) => ChaiBlock;
37
+ lang?: string;
55
38
  }): JSX_2.Element;
56
39
 
57
- export declare const RenderChaiPage: ({ pageData, externalData, before, after, classPrefix, }: ChaiPageProps) => JSX_2.Element;
58
-
59
40
  export { }
package/dist/render.js CHANGED
@@ -1,123 +1,215 @@
1
- import { j as o } from "./jsx-runtime-WbnYoNE9.js";
2
- import u from "react";
3
- import { isString as E, memoize as y, get as c, isEmpty as h, each as A, filter as g, omit as x } from "lodash-es";
4
- import { twMerge as N } from "tailwind-merge";
5
- import { S as B, a as _, B as R } from "./MODIFIERS-RiXS5Mn1.js";
6
- import { getBlockComponent as T } from "@chaibuilder/runtime";
7
- import { a as F, g as L } from "./functions-xIebp8Aw.js";
8
- import { Provider as Y } from "react-wrap-balancer";
9
- import "./_commonjsHelpers-UyOWmZb0.js";
10
- const I = (t) => {
11
- const r = {};
12
- return Object.keys(t).forEach((n) => {
13
- E(t[n]) && t[n].startsWith(B) && (r[n] = t[n].replace(B, "").split(","));
14
- }), r;
15
- }, K = y((t, r) => {
16
- const n = t.replace(_, "").split(","), s = N(n[0], n[1]);
17
- return F(s, r).replace(_, "").trim();
1
+ import { last, flattenDeep, memoize, filter, isEmpty, omit, isString, get, each, cloneDeep, forEach, keys, has, includes, replace } from "lodash-es";
2
+ import { S as STYLES_KEY, a as SLOT_KEY } from "./STRINGS-t8UhMYZ6.js";
3
+ import { j as jsxRuntimeExports } from "./jsx-runtime-_yxTjXEh.js";
4
+ import React__default from "react";
5
+ import { twMerge } from "tailwind-merge";
6
+ import { getBlockComponent } from "@chaibuilder/runtime";
7
+ import { createTailwindcss } from "@mhsdesign/jit-browser-tailwindcss";
8
+ import forms from "@tailwindcss/forms";
9
+ import typography from "@tailwindcss/typography";
10
+ import aspectRatio from "@tailwindcss/aspect-ratio";
11
+ import { g as getChaiBuilderTheme, c as chaiBuilderPlugin } from "./plugin-T1qbgBUO.js";
12
+ import "./plugin-YcxlCmRm.js";
13
+ const addPrefixToClasses = (classes, prefix = "") => {
14
+ const classesArray = classes.replace(STYLES_KEY, "").split(",");
15
+ const array = classesArray.map((item) => {
16
+ const classes2 = item.split(" ");
17
+ const newClasses = classes2.map((item2) => {
18
+ if (item2 === "")
19
+ return "";
20
+ if (item2.includes(":")) {
21
+ const values = item2.split(":");
22
+ values[values.length - 1] = prefix + last(values);
23
+ return values.join(":");
24
+ }
25
+ return `${prefix}${item2}`;
26
+ });
27
+ return newClasses.join(" ");
28
+ });
29
+ return flattenDeep(array).join(" ");
30
+ };
31
+ const convertToBlocks = (chaiFormatContent) => {
32
+ if (!chaiFormatContent)
33
+ return [];
34
+ try {
35
+ const blocks = JSON.parse(removeAssetPrefix(chaiFormatContent));
36
+ return blocks.filter((block) => !block._type.startsWith("@chai"));
37
+ } catch (error) {
38
+ return [{ _type: "Paragraph", _id: "error", content: "Invalid JSON. Please check the JSON string." }];
39
+ }
40
+ };
41
+ function removeAssetPrefix(input) {
42
+ const regex = /(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;
43
+ return input.replace(regex, (match) => {
44
+ const decodedUrl = decodeURIComponent(match);
45
+ const publicIndex = decodedUrl.indexOf("public");
46
+ if (publicIndex !== -1) {
47
+ return decodedUrl.substring(publicIndex + 6);
48
+ }
49
+ return decodedUrl;
50
+ });
51
+ }
52
+ const getSlots = (block) => {
53
+ const slots = {};
54
+ Object.keys(block).forEach((key) => {
55
+ if (isString(block[key]) && block[key].startsWith(SLOT_KEY)) {
56
+ slots[key] = block[key].replace(SLOT_KEY, "").split(",");
57
+ }
58
+ });
59
+ return slots;
60
+ };
61
+ const generateClassNames = memoize((styles, classPrefix) => {
62
+ const stylesArray = styles.replace(STYLES_KEY, "").split(",");
63
+ const classes = twMerge(stylesArray[0], stylesArray[1]);
64
+ if (classPrefix === "")
65
+ return classes.replace(STYLES_KEY, "").trim();
66
+ return addPrefixToClasses(classes, classPrefix).replace(STYLES_KEY, "").trim();
18
67
  });
19
- function W(t, r) {
20
- return c(t, `${r}_attrs`, {});
68
+ function getElementAttrs(block, key) {
69
+ const attrs = get(block, `${key}_attrs`, {});
70
+ if (has(attrs, "data-ai-key")) {
71
+ delete attrs["data-ai-key"];
72
+ }
73
+ const attrsKeys = keys(attrs).join(" ");
74
+ if (includes(attrsKeys, "x-show") && !includes(attrsKeys, "x-transition")) {
75
+ attrs["x-transition"] = "";
76
+ }
77
+ return attrs;
21
78
  }
22
- function w(t, r) {
23
- const n = {};
24
- return Object.keys(t).forEach((s) => {
25
- if (E(t[s]) && t[s].startsWith(_)) {
26
- const i = K(t[s], r);
27
- n[s] = {
28
- className: i,
29
- ...W(t, s)
79
+ function getStyleAttrs(block, classPrefix) {
80
+ const styles = {};
81
+ Object.keys(block).forEach((key) => {
82
+ if (isString(block[key]) && block[key].startsWith(STYLES_KEY)) {
83
+ const classes = generateClassNames(block[key], classPrefix);
84
+ styles[key] = {
85
+ className: classes,
86
+ ...getElementAttrs(block, key)
30
87
  };
31
88
  }
32
- }), n;
89
+ });
90
+ return styles;
91
+ }
92
+ function applyBindings(block, chaiData) {
93
+ const bindings = get(block, "_bindings", {});
94
+ if (isEmpty(bindings))
95
+ return { ...block };
96
+ each(bindings, (value, key) => {
97
+ if (isString(value) && get(chaiData, value, null)) {
98
+ block[key] = get(chaiData, value, null);
99
+ }
100
+ });
101
+ return block;
33
102
  }
34
- function z(t, r) {
35
- const n = c(t, "_bindings", {});
36
- return h(n) ? { ...t } : (A(n, (s, i) => {
37
- E(s) && c(r, s, null) && (t[i] = c(r, s, null));
38
- }), t);
103
+ function applyLanguage(_block, lang, blockDefinition) {
104
+ if (isEmpty(lang))
105
+ return _block;
106
+ const block = cloneDeep(_block);
107
+ forEach(keys(block), (key) => {
108
+ if (get(blockDefinition, ["props", key, "i18n"]) && !isEmpty(lang)) {
109
+ block[key] = get(block, `${key}-${lang}`, block[key]);
110
+ }
111
+ });
112
+ return block;
39
113
  }
40
- function j({
41
- blocks: t,
42
- parent: r,
43
- classPrefix: n = "c-",
44
- externalData: s = {}
114
+ function RenderChaiBlocks({
115
+ blocks,
116
+ parent,
117
+ classPrefix = "",
118
+ externalData = {},
119
+ blockModifierCallback,
120
+ lang
45
121
  }) {
46
- const i = t, l = (e) => w(e, n), S = r ? g(t, { _parent: r }) : g(t, (e) => h(e._parent));
47
- return /* @__PURE__ */ o.jsx(o.Fragment, { children: u.Children.toArray(
48
- S.map((e, C) => {
49
- const p = I(e), m = {};
50
- h(p) || Object.keys(p).forEach((a) => {
51
- m[a] = u.Children.toArray(
52
- p[a].map((f) => /* @__PURE__ */ o.jsx(
53
- j,
54
- {
55
- externalData: s,
56
- classPrefix: n,
57
- blocks: i,
58
- parent: f
59
- }
60
- ))
61
- );
62
- });
63
- const O = g(i, { _parent: e._id });
64
- m.children = O.length > 0 ? /* @__PURE__ */ o.jsx(
65
- j,
122
+ const allBlocks = blocks;
123
+ const getStyles = (block) => getStyleAttrs(block, classPrefix);
124
+ const filteredBlocks = parent ? filter(blocks, { _parent: parent }) : filter(blocks, (block) => isEmpty(block._parent));
125
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: React__default.Children.toArray(
126
+ filteredBlocks.map((block, index) => {
127
+ const slots = getSlots(block);
128
+ const attrs = {};
129
+ if (!isEmpty(slots)) {
130
+ Object.keys(slots).forEach((key) => {
131
+ attrs[key] = React__default.Children.toArray(
132
+ slots[key].map((slotId) => /* @__PURE__ */ jsxRuntimeExports.jsx(
133
+ RenderChaiBlocks,
134
+ {
135
+ externalData,
136
+ classPrefix,
137
+ blocks: allBlocks,
138
+ parent: slotId,
139
+ lang
140
+ }
141
+ ))
142
+ );
143
+ });
144
+ }
145
+ const blocks2 = filter(allBlocks, { _parent: block._id });
146
+ attrs.children = blocks2.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
147
+ RenderChaiBlocks,
66
148
  {
67
- externalData: s,
68
- classPrefix: n,
69
- parent: e._id,
70
- blocks: i
149
+ externalData,
150
+ classPrefix,
151
+ parent: block._id,
152
+ blocks: allBlocks,
153
+ lang
71
154
  }
72
155
  ) : null;
73
- const d = T(e._type);
74
- if (d !== null) {
75
- let a = e;
76
- const f = d.component;
77
- return a = { ...d.defaults, ...e }, u.createElement(
78
- f,
79
- x(
156
+ const blockDefinition = getBlockComponent(block._type);
157
+ if (blockDefinition !== null) {
158
+ let syncedBlock = block;
159
+ const Component = blockDefinition.component;
160
+ syncedBlock = { ...blockDefinition.defaults, ...block };
161
+ if (blockModifierCallback) {
162
+ syncedBlock = blockModifierCallback(syncedBlock);
163
+ }
164
+ return React__default.createElement(
165
+ Component,
166
+ omit(
80
167
  {
81
168
  blockProps: {},
82
- inBuilder: !1,
83
- ...a,
84
- index: C,
85
- ...z(e, s),
86
- ...l(a),
87
- ...m
169
+ inBuilder: false,
170
+ ...syncedBlock,
171
+ index,
172
+ ...applyBindings(applyLanguage(block, lang, blockDefinition), externalData),
173
+ ...getStyles(syncedBlock),
174
+ ...attrs
88
175
  },
89
176
  ["_parent"]
90
177
  )
91
178
  );
92
179
  }
93
- return /* @__PURE__ */ o.jsxs("noscript", { children: [
94
- e._type,
180
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("noscript", { children: [
181
+ block._type,
95
182
  " not found"
96
183
  ] });
97
184
  })
98
185
  ) });
99
186
  }
100
- const Q = ({
101
- pageData: t,
102
- externalData: r = {},
103
- before: n = null,
104
- after: s = null,
105
- classPrefix: i = "c-"
106
- }) => {
107
- const l = c(t.project, "brandingOptions", R);
108
- return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
109
- n,
110
- /* @__PURE__ */ o.jsx(
111
- "div",
112
- {
113
- className: i.replace("-", "") + " " + L(l, i) + " min-h-screen",
114
- children: /* @__PURE__ */ o.jsx(Y, { children: /* @__PURE__ */ o.jsx(j, { externalData: r, blocks: t.page.blocks || [], classPrefix: i }) })
115
- }
116
- ),
117
- s
118
- ] });
187
+ async function getTailwindCSS(theme, markupString, safelist = [], prefix = "", includeBaseStyles = false) {
188
+ const tailwind = createTailwindcss({
189
+ tailwindConfig: {
190
+ darkMode: "class",
191
+ safelist,
192
+ theme: { extend: getChaiBuilderTheme(theme) },
193
+ plugins: [forms, typography, aspectRatio, chaiBuilderPlugin],
194
+ corePlugins: { preflight: includeBaseStyles },
195
+ ...prefix ? { prefix: `${prefix}` } : {}
196
+ }
197
+ });
198
+ return await tailwind.generateStylesFromContent(
199
+ ` ${includeBaseStyles ? "@tailwind base;" : ""}
200
+ @tailwind components;
201
+ @tailwind utilities;`,
202
+ markupString
203
+ );
204
+ }
205
+ const getBlocksTailwindCSS = (blocks, theme, includeBaseStyles = false) => {
206
+ return getTailwindCSS(theme, [replace(JSON.stringify(blocks), /#styles:,?/g, "")], [], "", includeBaseStyles);
207
+ };
208
+ const getStylesForBlocks = async (blocks, theme = {}, includeBaseStyles = true) => {
209
+ return await getBlocksTailwindCSS(blocks, theme, includeBaseStyles);
119
210
  };
120
211
  export {
121
- j as RenderChaiBlocks,
122
- Q as RenderChaiPage
212
+ RenderChaiBlocks,
213
+ convertToBlocks,
214
+ getStylesForBlocks
123
215
  };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const runtime = require("@chaibuilder/runtime");
4
+ const controls = require("./controls-4t-C_rP2.cjs");
5
+ require("lodash-es");
6
+ exports.Checkbox = controls.c;
7
+ exports.Code = controls.l;
8
+ exports.Color = controls.h;
9
+ exports.Icon = controls.q;
10
+ exports.Image = controls.x;
11
+ exports.InfoField = controls.u;
12
+ exports.Link = controls.w;
13
+ exports.List = controls.S;
14
+ exports.Model = controls.b;
15
+ exports.MultilineText = controls.f;
16
+ exports.Numeric = controls.s;
17
+ exports.RichText = controls.m;
18
+ exports.SelectOption = controls.y;
19
+ exports.SingleLineText = controls.g;
20
+ exports.Slot = controls.r;
21
+ exports.Styles = controls.T;
22
+ Object.keys(runtime).forEach((k) => {
23
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
24
+ Object.defineProperty(exports, k, {
25
+ enumerable: true,
26
+ get: () => runtime[k]
27
+ });
28
+ });
@@ -0,0 +1,5 @@
1
+
2
+ export * from "@chaibuilder/runtime";
3
+ export * from "@chaibuilder/runtime/controls";
4
+
5
+ export { }
@@ -0,0 +1,21 @@
1
+ export * from "@chaibuilder/runtime";
2
+ import { c, l, h, q, x, u, w, S, b, f, s, m, y, g, r, T } from "./controls-fQIu127i.js";
3
+ import "lodash-es";
4
+ export {
5
+ c as Checkbox,
6
+ l as Code,
7
+ h as Color,
8
+ q as Icon,
9
+ x as Image,
10
+ u as InfoField,
11
+ w as Link,
12
+ S as List,
13
+ b as Model,
14
+ f as MultilineText,
15
+ s as Numeric,
16
+ m as RichText,
17
+ y as SelectOption,
18
+ g as SingleLineText,
19
+ r as Slot,
20
+ T as Styles
21
+ };