@chaibuilder/sdk 4.0.0-beta.3 → 4.0.0-beta.30

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 (245) hide show
  1. package/README.md +72 -50
  2. package/dist/{2SSKDMRQ-CnSDkQcy.js → 2SSKDMRQ-B5Tzwoh4.js} +2 -2
  3. package/dist/{2SSKDMRQ-BnsZi3K3.cjs → 2SSKDMRQ-Dub3pRV1.cjs} +1 -1
  4. package/dist/{AP7HFJJL-CymCmW14.js → AP7HFJJL-CfmdXP9M.js} +1 -1
  5. package/dist/{AP7HFJJL-B31839PG.cjs → AP7HFJJL-Dt6MglIr.cjs} +1 -1
  6. package/dist/{IconPicker-B1rWC-Ex.js → IconPicker-Cn8Z42-Z.js} +8 -7
  7. package/dist/IconPicker-DLqOB-ri.cjs +1 -0
  8. package/dist/STRINGS-BExFecZW.js +8 -0
  9. package/dist/STRINGS-FNnfjF5H.cjs +1 -0
  10. package/dist/{WDYDFRGG-BUVnbAci.js → WDYDFRGG-BOpmZGHS.js} +2 -2
  11. package/dist/{WDYDFRGG-BxhOCHc3.cjs → WDYDFRGG-Dfj1ikzw.cjs} +1 -1
  12. package/dist/{actions-registery-CZ1w0NKa.js → actions-registery-Bj-j1k5i.js} +2668 -2585
  13. package/dist/actions-registery-Cy1lqUVI.cjs +481 -0
  14. package/dist/actions.cjs +1 -1
  15. package/dist/actions.d.ts +0 -158
  16. package/dist/actions.js +3 -3
  17. package/dist/active-in-another-tab-CEWvA8SG.js +35 -0
  18. package/dist/active-in-another-tab-DV83cJ_v.cjs +1 -0
  19. package/dist/{add-new-language-page-WmlCnytQ.js → add-new-language-page-B3wK94-S.js} +54 -53
  20. package/dist/add-new-language-page-C3Uu92KN.cjs +1 -0
  21. package/dist/{add-new-page-soZ8GAkN.cjs → add-new-page-BOE-xwBc.cjs} +1 -1
  22. package/dist/{add-new-page-VW2wAYZp.js → add-new-page-DsvGVrR8.js} +2 -2
  23. package/dist/{ai-panel-content-D_o7Q_A-.js → ai-panel-content-BBSzHZG6.js} +12 -11
  24. package/dist/ai-panel-content-DBlnfRRi.cjs +1 -0
  25. package/dist/ai-panel-default-lang-BVBuwnyU.js +317 -0
  26. package/dist/ai-panel-default-lang-DJJWAtN0.cjs +3 -0
  27. package/dist/ai-panel-other-lang-fIEZkmRy.js +132 -0
  28. package/dist/ai-panel-other-lang-v8Yd5ggR.cjs +1 -0
  29. package/dist/ai-prompt-input-C7ha_0Cn.cjs +1 -0
  30. package/dist/{ai-prompt-input-Bhc0ds7X.js → ai-prompt-input-CmSfGxTN.js} +70 -73
  31. package/dist/ai-translation-prompt-BzTGAS3W.cjs +1 -0
  32. package/dist/{ai-translation-prompt-CZ55HQmo.js → ai-translation-prompt-CtBmvsRy.js} +2 -2
  33. package/dist/apply-binding-9XSrYzAE.cjs +1 -0
  34. package/dist/{apply-binding-6iwlED02.js → apply-binding-chfbBKi2.js} +238 -225
  35. package/dist/change-password-modal-CdOwtCWN.cjs +1 -0
  36. package/dist/change-password-modal-DxkhBI5d.js +137 -0
  37. package/dist/code-display-BR-gij5j.cjs +1 -0
  38. package/dist/{code-display-DhD_RBcg.js → code-display-DdWcOQ_i.js} +1 -1
  39. package/dist/code-editor-Bpn8z2fo.js +57 -0
  40. package/dist/code-editor-fL3s6Hk7.cjs +1 -0
  41. package/dist/{continue-editing-in-this-client-CS2aQ7yY.js → continue-editing-in-this-client-DDB816CQ.js} +10 -9
  42. package/dist/continue-editing-in-this-client-DjxpjsA8.cjs +1 -0
  43. package/dist/core-BWQrViOY.cjs +1 -0
  44. package/dist/core-QlWEXm1d.js +53 -0
  45. package/dist/core.cjs +1 -1
  46. package/dist/core.d.ts +272 -105
  47. package/dist/core.js +64 -33
  48. package/dist/{css-import-modal-Byg6wV0O.js → css-import-modal-CL8SIC3K.js} +11 -9
  49. package/dist/css-import-modal-CRC7bK1c.cjs +13 -0
  50. package/dist/{delete-design-token-BRZZiWtQ.js → delete-design-token-B0md8qUi.js} +1 -1
  51. package/dist/{delete-design-token-DkVs1oBf.cjs → delete-design-token-C94IgWdi.cjs} +1 -1
  52. package/dist/delete-page-41tvYcEw.js +71 -0
  53. package/dist/delete-page-BHPlx8ec.cjs +1 -0
  54. package/dist/{design-token-usage-xQs6SlaJ.js → design-token-usage-CyOY4Pni.js} +19 -18
  55. package/dist/design-token-usage-DtdjTCn3.cjs +1 -0
  56. package/dist/{digital-asset-manager-DbtwzxRz.js → digital-asset-manager-C_ru4Zes.js} +6 -5
  57. package/dist/digital-asset-manager-DSLQz8qk.cjs +1 -0
  58. package/dist/duplicate-page-BvggF83O.cjs +1 -0
  59. package/dist/{duplicate-page-BR7Dlo9d.js → duplicate-page-DMmDdmfS.js} +20 -19
  60. package/dist/dynamic-page-selector-C5agz2Ze.cjs +1 -0
  61. package/dist/{dynamic-page-selector-Cb5r_W8s.js → dynamic-page-selector-D2z51nLi.js} +12 -11
  62. package/dist/fonts/bungee/Bungee-Regular.woff2 +0 -0
  63. package/dist/fonts/dm_sans/dm-sans-variable.woff2 +0 -0
  64. package/dist/fonts/geist/Geist-VariableFont_wght.ttf +0 -0
  65. package/dist/fonts/geist/Geist-VariableFont_wght.woff2 +0 -0
  66. package/dist/fonts/geist/geist-variable.woff2 +0 -0
  67. package/dist/fonts/geist-mono/GeistMono-VariableFont_wght.woff2 +0 -0
  68. package/dist/fonts/inter/inter-latin.woff2 +0 -0
  69. package/dist/fonts/inter/inter-variable.woff2 +1449 -0
  70. package/dist/fonts/lato/lato-variable.woff2 +0 -0
  71. package/dist/fonts/lavishly_yours/lavishly-yours.woff2 +11 -0
  72. package/dist/fonts/merriweather/merriweather-variable.woff2 +11 -0
  73. package/dist/fonts/montserrat/montserrat-variable.woff2 +0 -0
  74. package/dist/fonts/nunito_sans/nunito-sans-variable.woff2 +11 -0
  75. package/dist/fonts/open_sans/open-sans-variable.woff2 +0 -0
  76. package/dist/fonts/oswald/oswald-variable.woff2 +0 -0
  77. package/dist/fonts/playfair_display/playfair-display-variable.woff2 +11 -0
  78. package/dist/fonts/poppins/poppins-variable.woff2 +0 -0
  79. package/dist/fonts/raleway/raleway-variable.woff2 +0 -0
  80. package/dist/fonts/roboto/roboto-variable.woff2 +11 -0
  81. package/dist/fonts/source_sans_3/source-sans-3-variable.woff2 +11 -0
  82. package/dist/fonts/ubuntu/ubuntu-variable.woff2 +0 -0
  83. package/dist/fonts-B3UYxuJI.js +25 -0
  84. package/dist/fonts-D5fTqvSS.cjs +1 -0
  85. package/dist/get-chai-builder-tailwind-config-DNp8Vhme.cjs +1 -0
  86. package/dist/{get-chai-builder-tailwind-config-DjoVOuAf.js → get-chai-builder-tailwind-config-k8l5sdcw.js} +5 -5
  87. package/dist/{get-chai-builder-theme-Dl72X7cz.cjs → get-chai-builder-theme-B5RkBTsB.cjs} +1 -1
  88. package/dist/{get-chai-builder-theme-BYtp20KD.js → get-chai-builder-theme-BSUcPs5t.js} +1 -1
  89. package/dist/{image-editor-G-K28aTS.cjs → image-editor-DFmlG348.cjs} +1 -1
  90. package/dist/{image-editor-DV8kUKhl.js → image-editor-sKvOFo-S.js} +1 -1
  91. package/dist/{index-Ct7ElCGK.js → index-BFnMzGe6.js} +5381 -5895
  92. package/dist/index-Bzn_gpaK.cjs +5 -0
  93. package/dist/index-CA1OwKJX.js +4887 -0
  94. package/dist/index-D30xvFa5.cjs +160 -0
  95. package/dist/{json-diff-viewer-krslPepD.js → json-diff-viewer-B5wAR5GY.js} +82 -79
  96. package/dist/json-diff-viewer-DRQSNhaS.cjs +8 -0
  97. package/dist/lang-panel-BZsICcBR.cjs +1 -0
  98. package/dist/{lang-panel-BwIewMyw.js → lang-panel-q04hEq5o.js} +15 -14
  99. package/dist/library-blocks/blocks-list.json +16 -0
  100. package/dist/library-blocks/hero-1/hero-1.html +74 -0
  101. package/dist/library-blocks/hero-1/hero-1.webp +0 -0
  102. package/dist/library-blocks/hero-2/hero-2.html +95 -0
  103. package/dist/library-blocks/hero-2/hero-2.webp +0 -0
  104. package/dist/{manage-design-tokens-Caz_20VK.js → manage-design-tokens-Cene3KEu.js} +16 -15
  105. package/dist/manage-design-tokens-Di5C6nTj.cjs +1 -0
  106. package/dist/mark-as-template-CT-hLGIW.cjs +1 -0
  107. package/dist/{mark-as-template-D295ZQtU.js → mark-as-template-raTtKmQ9.js} +17 -16
  108. package/dist/nested-path-selector-content-CSUHTj9G.cjs +1 -0
  109. package/dist/{nested-path-selector-content-CKYYK-C5.js → nested-path-selector-content-CzQ2Lorl.js} +24 -23
  110. package/dist/{no-language-page-content-BvqRBP6y.js → no-language-page-content-Bg6VjMVY.js} +8 -7
  111. package/dist/no-language-page-content-Bkj8JpEY.cjs +1 -0
  112. package/dist/{no-language-page-dialog-PjNqTUpl.js → no-language-page-dialog-CRPMr9YT.js} +2 -2
  113. package/dist/{no-language-page-dialog-BcEoqyQB.cjs → no-language-page-dialog-TffLjvJn.cjs} +1 -1
  114. package/dist/{page-creator-DiOITEMw.js → page-creator-CQhE1tgn.js} +147 -146
  115. package/dist/page-creator-RrUhy8uH.cjs +1 -0
  116. package/dist/{page-lock-BdYmCks0.cjs → page-lock-D9h5pgxn.cjs} +1 -1
  117. package/dist/{page-lock-Bfbs6RgL.js → page-lock-Dye1JZBB.js} +2 -2
  118. package/dist/{page-locked-dialog-B6MKTRfY.js → page-locked-dialog-BMjPVyHF.js} +19 -16
  119. package/dist/page-locked-dialog-b2_f-A7a.cjs +1 -0
  120. package/dist/page-manager-new-2mDjnSqc.cjs +1 -0
  121. package/dist/page-manager-new-DP1b_dXt.js +411 -0
  122. package/dist/page-manager-search-and-filter-D0ZXojiu.cjs +1 -0
  123. package/dist/{page-manager-search-and-filter-CM0UMb6U.js → page-manager-search-and-filter-DCcYyoPO.js} +20 -19
  124. package/dist/page-revisions-content-BX8ZWebc.cjs +1 -0
  125. package/dist/{page-revisions-content-NH9JK4Ey.js → page-revisions-content-mDwvH6J-.js} +134 -120
  126. package/dist/pages.cjs +1 -1
  127. package/dist/pages.d.ts +297 -97
  128. package/dist/pages.js +22 -19
  129. package/dist/plugin-DHpuZZXz.cjs +22 -0
  130. package/dist/plugin-Dkmjb2_e.js +248 -0
  131. package/dist/publish-pages-content-CR4e9inX.cjs +1 -0
  132. package/dist/{publish-pages-content-D9aixMN5.js → publish-pages-content-M_Kb8b-F.js} +71 -70
  133. package/dist/register-chai-top-bar-D6GjnauV.js +237 -0
  134. package/dist/register-chai-top-bar-DyW9GPzV.cjs +1 -0
  135. package/dist/render.cjs +2 -2
  136. package/dist/render.d.ts +21 -20
  137. package/dist/render.js +127 -120
  138. package/dist/rte-widget-modal-BRSm1Lnp.cjs +1 -0
  139. package/dist/{rte-widget-modal-DOJEXLIf.js → rte-widget-modal-CVZDktXI.js} +10 -9
  140. package/dist/runtime-client.cjs +1 -0
  141. package/dist/runtime-client.d.ts +158 -0
  142. package/dist/runtime-client.js +32 -0
  143. package/dist/runtime.cjs +11 -1
  144. package/dist/runtime.d.ts +158 -114
  145. package/dist/runtime.js +107 -42
  146. package/dist/{save-to-lib-eiOc_SSN.js → save-to-lib-B1ccNhR2.js} +152 -145
  147. package/dist/save-to-lib-CYEAWxL9.cjs +1 -0
  148. package/dist/sdk.css +1 -1
  149. package/dist/selected-block-display-MyU0rS4q.cjs +16 -0
  150. package/dist/{selected-block-display-CBFePS19.js → selected-block-display-aGR7p5JC.js} +36 -35
  151. package/dist/seo-panel-B5mDwpaT.cjs +2 -0
  152. package/dist/{seo-panel-C1-iMOR1.js → seo-panel-P9uixkoZ.js} +149 -148
  153. package/dist/{shared-json-ld-B4PxAM_0.js → shared-json-ld-Ba9GcvLr.js} +72 -71
  154. package/dist/shared-json-ld-DhQJh_mT.cjs +1 -0
  155. package/dist/slug-input-BdMnlYKT.cjs +1 -0
  156. package/dist/{slug-input-AwNJs9im.js → slug-input-CAfGHqMW.js} +9 -8
  157. package/dist/supabase-actions.cjs +1 -1
  158. package/dist/supabase-actions.d.ts +40 -1
  159. package/dist/supabase-actions.js +231 -192
  160. package/dist/take-over-request-BeHTL28z.cjs +1 -0
  161. package/dist/{take-over-request-C4FeDtN_.js → take-over-request-CXjaDliJ.js} +18 -17
  162. package/dist/theme-panel-footer-BkwhuXM7.js +26 -0
  163. package/dist/theme-panel-footer-D_gxD0j4.cjs +1 -0
  164. package/dist/{translation-warning-modal-B64YqlbI.js → translation-warning-modal-CTfArsb1.js} +11 -10
  165. package/dist/translation-warning-modal-D_vt37fW.cjs +1 -0
  166. package/dist/types.cjs +1 -0
  167. package/dist/types.d.ts +740 -0
  168. package/dist/types.js +1 -0
  169. package/dist/unmark-as-template-D2bvjGKt.cjs +1 -0
  170. package/dist/{unmark-as-template-CZ9sQp_P.js → unmark-as-template-vFgMIdxN.js} +12 -11
  171. package/dist/unpublish-page-CPjHmtSM.cjs +1 -0
  172. package/dist/unpublish-page-CxkjTzBB.js +28 -0
  173. package/dist/utils.cjs +1 -1
  174. package/dist/utils.d.ts +8 -5
  175. package/dist/utils.js +2 -2
  176. package/dist/web-blocks.cjs +1 -1
  177. package/dist/web-blocks.js +341 -332
  178. package/dist/{web-preview-Djy6WIyj.js → web-preview--by73Vvr.js} +2 -2
  179. package/dist/web-preview-C3AMe_BB.cjs +1 -0
  180. package/package.json +36 -31
  181. package/dist/IconPicker-DREyo007.cjs +0 -1
  182. package/dist/actions-registery-YnFmU21O.cjs +0 -418
  183. package/dist/active-in-another-tab-B47YjQGN.cjs +0 -1
  184. package/dist/active-in-another-tab-CyjngVA6.js +0 -34
  185. package/dist/add-new-language-page-88xzrUy8.cjs +0 -1
  186. package/dist/ai-panel-content-7zCil042.cjs +0 -1
  187. package/dist/ai-panel-default-lang-COYaxNwn.cjs +0 -3
  188. package/dist/ai-panel-default-lang-DnElspF0.js +0 -341
  189. package/dist/ai-panel-other-lang-CkynNlAU.cjs +0 -1
  190. package/dist/ai-panel-other-lang-Dp0E9_Hx.js +0 -162
  191. package/dist/ai-prompt-input-CThbVp0_.cjs +0 -1
  192. package/dist/ai-translation-prompt-C2kJQFDX.cjs +0 -1
  193. package/dist/apply-binding-KKp5PnpZ.cjs +0 -1
  194. package/dist/code-display-BnqzqzoP.cjs +0 -1
  195. package/dist/code-editor-DRIAnNbb.js +0 -50
  196. package/dist/code-editor-o3___nu2.cjs +0 -1
  197. package/dist/continue-editing-in-this-client-CtMYsk-A.cjs +0 -1
  198. package/dist/core-BoRDjj4h.cjs +0 -1
  199. package/dist/core-yvI6kCyw.js +0 -56
  200. package/dist/css-import-modal-CyqkXWCO.cjs +0 -13
  201. package/dist/delete-page-BzyX9TN-.js +0 -70
  202. package/dist/delete-page-DxX7PFIE.cjs +0 -1
  203. package/dist/design-token-usage-CAHzEGgJ.cjs +0 -1
  204. package/dist/digital-asset-manager--uO8Agia.cjs +0 -1
  205. package/dist/duplicate-page-CaNAbXwV.cjs +0 -1
  206. package/dist/dynamic-page-selector-Cxk_gjni.cjs +0 -1
  207. package/dist/fonts/GeistMonoVF.woff +0 -0
  208. package/dist/fonts/GeistVF.woff +0 -0
  209. package/dist/fonts-B-Xt29pe.cjs +0 -1
  210. package/dist/fonts-DRly3Wzd.js +0 -78
  211. package/dist/get-chai-builder-tailwind-config-B9rCyiQo.cjs +0 -1
  212. package/dist/index-B-rSiAp_.cjs +0 -1
  213. package/dist/index-DF5DEvqb.cjs +0 -160
  214. package/dist/index-Dxfyt4d4.js +0 -39
  215. package/dist/index-WQwzsC7A.cjs +0 -5
  216. package/dist/index-ZuacEL1j.js +0 -4732
  217. package/dist/json-diff-viewer-D7z4zNvv.cjs +0 -8
  218. package/dist/lang-panel-DT96k1xg.cjs +0 -1
  219. package/dist/manage-design-tokens-CrmLe7UT.cjs +0 -1
  220. package/dist/mark-as-template-W3LmpiqN.cjs +0 -1
  221. package/dist/nested-path-selector-content-CoS_d3dc.cjs +0 -1
  222. package/dist/no-language-page-content-DkfeMl90.cjs +0 -1
  223. package/dist/page-creator-C4gc5NSC.cjs +0 -1
  224. package/dist/page-locked-dialog-B1FAtK92.cjs +0 -1
  225. package/dist/page-manager-new-CHDueBDk.cjs +0 -1
  226. package/dist/page-manager-new-CzX22g2n.js +0 -394
  227. package/dist/page-manager-search-and-filter-DkkRIH86.cjs +0 -1
  228. package/dist/page-revisions-content-ChY-4f2V.cjs +0 -1
  229. package/dist/plugin-3ZKK6RXm.js +0 -245
  230. package/dist/plugin-C6rgJDNQ.cjs +0 -22
  231. package/dist/publish-pages-content-x-JuSFJ9.cjs +0 -1
  232. package/dist/rte-widget-modal-BaHIuEjF.cjs +0 -1
  233. package/dist/save-to-lib-Cgpxw8-g.cjs +0 -1
  234. package/dist/selected-block-display-BgRY82CT.cjs +0 -16
  235. package/dist/seo-panel-DfAb8U7W.cjs +0 -2
  236. package/dist/shared-json-ld-DzG398hr.cjs +0 -1
  237. package/dist/slug-input-C_ijLQ_X.cjs +0 -1
  238. package/dist/take-over-request-BNxcjY2j.cjs +0 -1
  239. package/dist/theme-panel-footer-Cq9pljro.cjs +0 -1
  240. package/dist/theme-panel-footer-uBQqSJXm.js +0 -25
  241. package/dist/translation-warning-modal-BZAcwM2_.cjs +0 -1
  242. package/dist/unmark-as-template-EVvk0vmp.cjs +0 -1
  243. package/dist/unpublish-page-D4VwOlxc.js +0 -27
  244. package/dist/unpublish-page-bdSmwAVQ.cjs +0 -1
  245. package/dist/web-preview-Cio70gk5.cjs +0 -1
package/dist/render.js CHANGED
@@ -1,16 +1,16 @@
1
- import { a as Le, b as De, c as Ke } from "./plugin-3ZKK6RXm.js";
2
- import { a as O, b as N, c as E, d as J, e as C, f as j } from "./apply-binding-6iwlED02.js";
3
- import { h as Ae, i as Fe, g as Me } from "./apply-binding-6iwlED02.js";
1
+ import { a as De, b as xe, c as Ke } from "./plugin-Dkmjb2_e.js";
2
+ import { a as O, b as N, c as E, d as J, e as C, f as j } from "./apply-binding-chfbBKi2.js";
3
+ import { h as Ae, i as Fe, g as Me } from "./apply-binding-chfbBKi2.js";
4
4
  import { jsx as m } from "react/jsx-runtime";
5
- import { has as P, isFunction as w, omit as q, get as d, isNull as H, isArray as B, uniqBy as W, filter as $, isEmpty as h, map as U, find as R, cloneDeep as Q } from "lodash-es";
6
- import { Suspense as A, createElement as u } from "react";
7
- import { e as S } from "./core-yvI6kCyw.js";
5
+ import { has as P, isFunction as $, omit as q, get as d, isNull as H, isArray as B, uniqBy as W, filter as S, isEmpty as h, map as U, find as A, cloneDeep as z } from "lodash-es";
6
+ import { Suspense as F, createElement as g } from "react";
7
+ import { e as T } from "./core-QlWEXm1d.js";
8
8
  import { createTailwindcss as X } from "@mhsdesign/jit-browser-tailwindcss";
9
9
  import Y from "@tailwindcss/aspect-ratio";
10
10
  import Z from "@tailwindcss/container-queries";
11
11
  import ee from "@tailwindcss/forms";
12
12
  import te from "@tailwindcss/typography";
13
- import { c as ae, g as re } from "./get-chai-builder-theme-BYtp20KD.js";
13
+ import { c as ae, g as re } from "./get-chai-builder-theme-BSUcPs5t.js";
14
14
  async function ne(e) {
15
15
  const t = {
16
16
  pageProps: e.pageProps,
@@ -19,41 +19,42 @@ async function ne(e) {
19
19
  draft: e.draft,
20
20
  inBuilder: !1
21
21
  }, r = await e.dataProvider(t);
22
- return P(r, "$metadata") && w(e.dataProviderMetadataCallback) && e.dataProviderMetadataCallback(e.block, r.$metadata), e.children({
22
+ return P(r, "$metadata") && $(e.dataProviderMetadataCallback) && e.dataProviderMetadataCallback(e.block, r.$metadata), e.children({
23
23
  ...q(r, "$metadata")
24
24
  });
25
25
  }
26
26
  const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
27
- const { block: t, lang: r, fallbackLang: i, children: n, externalData: s, blocks: o, draft: a, pageProps: l, dataProviderMetadataCallback: y } = e, c = S(t._type), p = d(c, "component", null), _ = d(e.repeaterData, "index", -1), k = d(e.repeaterData, "dataKey", ""), f = O(
28
- N(t, r === i ? "" : r, c),
29
- s,
27
+ const { block: t, lang: r, fallbackLang: i, children: n, externalData: o, blocks: s, draft: a, pageProps: l, dataProviderMetadataCallback: y } = e, u = T(t._type), c = d(u, "component", null), _ = d(e.repeaterData, "index", -1), k = d(e.repeaterData, "dataKey", ""), f = O(
28
+ N(t, r === i ? "" : r ?? "", u),
29
+ o ?? {},
30
30
  { index: _, key: k }
31
- ), g = E(t, !1), x = V(o, t._id, J(t._type)), L = P(c, "dataProvider") && w(c.dataProvider), b = {
31
+ ), p = E(t, !1), D = V(s, t._id, J(t._type)), x = P(u, "dataProvider") && $(u.dataProvider), w = {
32
32
  ...f,
33
- ...g,
34
- ...x
33
+ ...p,
34
+ ...D
35
35
  }, v = {
36
36
  blockProps: {},
37
37
  inBuilder: !1,
38
- lang: r || i,
39
- pageData: s,
40
- ...b
41
- }, I = d(b, "_show", !0);
42
- if (H(p) || !I) return null;
43
- if (L) {
44
- const D = d(c, "suspenseFallback", ie);
45
- return /* @__PURE__ */ m(A, { fallback: u(D), children: /* @__PURE__ */ m(
38
+ lang: r || i || "en",
39
+ draft: a ?? !1,
40
+ pageData: o ?? {},
41
+ ...w
42
+ }, I = d(w, "_show", !0);
43
+ if (H(c) || !I) return null;
44
+ if (x) {
45
+ const K = d(u, "suspenseFallback", ie);
46
+ return /* @__PURE__ */ m(F, { fallback: g(K), children: /* @__PURE__ */ m(
46
47
  ne,
47
48
  {
48
- lang: r,
49
+ lang: r ?? "",
49
50
  pageProps: l,
50
- block: b,
51
- dataProvider: c.dataProvider,
51
+ block: w,
52
+ dataProvider: u.dataProvider,
52
53
  ...y ? { dataProviderMetadataCallback: y } : {},
53
- draft: a,
54
- children: (K) => u(p, {
54
+ draft: a ?? !1,
55
+ children: (R) => g(c, {
55
56
  ...v,
56
- ...K,
57
+ ...R,
57
58
  children: n({
58
59
  _id: t._id,
59
60
  _type: t._type,
@@ -67,7 +68,7 @@ const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
67
68
  }
68
69
  ) });
69
70
  }
70
- return /* @__PURE__ */ m(A, { children: u(p, {
71
+ return /* @__PURE__ */ m(F, { children: g(c, {
71
72
  ...v,
72
73
  children: n({
73
74
  _id: t._id,
@@ -79,50 +80,53 @@ const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
79
80
  } : {}
80
81
  })
81
82
  }) });
82
- }, F = (e) => {
83
+ }, M = (e) => {
83
84
  const { blocks: t, parent: r, repeaterData: i, type: n } = e;
84
- let s = W(
85
- $(t, (a) => P(a, "_id") && (h(r) ? !a._parent : a._parent === r)),
85
+ let o = W(
86
+ S(t, (a) => P(a, "_id") && (h(r) ? !a._parent : a._parent === r)),
86
87
  "_id"
87
88
  );
88
- const o = (a) => $(t, (l) => l._parent === a).length > 0;
89
- return (n === "Heading" || n === "Paragraph" || n === "Link" || n === "Span") && (s = j(s)), U(s, (a) => a ? /* @__PURE__ */ u(oe, { ...e, key: a._id, block: a }, ({ _id: l, _type: y, repeaterItems: c, $repeaterItemsKey: p }) => y === "Repeater" ? B(c) && c.map((_, k) => /* @__PURE__ */ u(
90
- F,
89
+ const s = (a) => S(t, (l) => l._parent === a).length > 0;
90
+ return (n === "Heading" || n === "Paragraph" || n === "Link" || n === "Span") && (o = j(o)), U(o, (a, l) => a ? /* @__PURE__ */ g(oe, { ...e, key: a._id ? `${a._id}-${l}` : `block-${l}`, block: a }, ({ _id: y, _type: u, repeaterItems: c, $repeaterItemsKey: _ }) => u === "Repeater" ? B(c) && c.map((k, b) => /* @__PURE__ */ g(
91
+ M,
91
92
  {
92
93
  ...e,
93
94
  parent: a._id,
94
- key: `${d(a, "_parent", "root")}-${a._id}-${k}`,
95
- repeaterData: { index: k, dataKey: p }
95
+ key: `${d(a, "_parent", "root")}-${a._id}-${l}-${b}`,
96
+ repeaterData: { index: b, dataKey: _ }
96
97
  }
97
- )) : o(l) ? /* @__PURE__ */ u(
98
- F,
98
+ )) : s(y) ? /* @__PURE__ */ g(
99
+ M,
99
100
  {
100
101
  ...e,
101
102
  parent: a._id,
102
- key: `${d(a, "_parent", "root")}-${a._id}`,
103
+ key: `${d(a, "_parent", "root")}-${a._id}-${l}`,
103
104
  repeaterData: i,
104
105
  type: a._type
105
106
  }
106
107
  ) : null) : null);
107
- }, V = (e, t, r) => h(r) ? {} : Object.entries(r).reduce((i, [n, s]) => {
108
- const o = [];
109
- let a = R(e, { _id: t });
110
- for (; a; )
111
- o.push(a), a = R(e, { _id: a._parent });
112
- const l = R(o, { _type: s.block });
113
- return l && (i[n] = d(l, d(s, "prop"), null)), i;
114
- }, {});
108
+ }, V = (e, t, r) => h(r) ? {} : Object.entries(r).reduce(
109
+ (i, [n, o]) => {
110
+ const s = [];
111
+ let a = A(e, { _id: t });
112
+ for (; a; )
113
+ s.push(a), a = A(e, { _id: a._parent });
114
+ const l = A(s, { _type: o.block });
115
+ return l && (i[n] = d(l, d(o, "prop"), null)), i;
116
+ },
117
+ {}
118
+ );
115
119
  function we(e) {
116
120
  if (h(e.lang) && !h(e.fallbackLang))
117
121
  throw new Error("lang prop is required when fallbackLang is provided");
118
122
  if (h(e.blocks))
119
123
  return null;
120
124
  const t = e.lang ?? "en", r = e.fallbackLang ?? t;
121
- return /* @__PURE__ */ m(F, { ...e, lang: t, fallbackLang: r });
125
+ return /* @__PURE__ */ m(M, { ...e, lang: t, fallbackLang: r });
122
126
  }
123
127
  async function se(e) {
124
128
  const t = await e.dataProvider;
125
- return P(t, "$metadata") && w(e.dataProviderMetadataCallback) && e.dataProviderMetadataCallback(e.block, t.$metadata), e.children({
129
+ return P(t, "$metadata") && $(e.dataProviderMetadataCallback) && e.dataProviderMetadataCallback(e.block, t.$metadata), e.children({
126
130
  ...q(t, "$metadata")
127
131
  });
128
132
  }
@@ -132,86 +136,85 @@ const le = () => /* @__PURE__ */ m("div", {}), de = async (e) => {
132
136
  lang: r,
133
137
  fallbackLang: i,
134
138
  children: n,
135
- externalData: s,
136
- blocks: o,
139
+ externalData: o,
140
+ blocks: s,
137
141
  draft: a,
138
142
  pageProps: l,
139
143
  dataProviderMetadataCallback: y,
140
- dataProviders: c
141
- } = e, p = S(t._type), _ = d(p, "component", null), k = d(e.repeaterData, "index", -1), M = d(e.repeaterData, "dataKey", ""), g = O(
142
- N(t, r === i ? "" : r, p),
143
- s,
144
- { index: k, key: M }
145
- ), x = E(t, !1), L = V(o, t._id, J(t._type)), b = P(p, "dataProvider") && w(p.dataProvider), v = {
146
- ...g,
147
- ...x,
148
- ...L
144
+ dataProviders: u
145
+ } = e, c = T(t._type), _ = d(c, "component", null), k = d(e.repeaterData, "index", -1), b = d(e.repeaterData, "dataKey", ""), p = O(
146
+ N(t, r === i ? "" : r ?? "en", c),
147
+ o ?? {},
148
+ { index: k, key: b }
149
+ ), D = E(t, !1), x = V(s, t._id, J(t._type)), w = P(c, "dataProvider") && $(c.dataProvider), v = {
150
+ ...p,
151
+ ...D,
152
+ ...x
149
153
  }, I = {
150
154
  blockProps: {},
151
155
  inBuilder: !1,
152
- lang: r || i,
153
- pageData: s,
156
+ lang: r || i || "en",
157
+ draft: a ?? !1,
158
+ pageData: o ?? {},
154
159
  ...v
155
- }, D = d(v, "_show", !0);
156
- if (H(_) || !D) return null;
157
- if (b) {
158
- const K = d(c, t._id, Promise.resolve({})), G = d(p, "suspenseFallback", le);
159
- return /* @__PURE__ */ m(A, { fallback: u(G), children: /* @__PURE__ */ m(
160
+ }, K = d(v, "_show", !0);
161
+ if (H(_) || !K) return null;
162
+ if (w) {
163
+ const R = d(u, t._id, Promise.resolve({})), G = d(c, "suspenseFallback", le);
164
+ return /* @__PURE__ */ m(F, { fallback: g(G), children: /* @__PURE__ */ m(
160
165
  se,
161
166
  {
162
- lang: r,
167
+ lang: r ?? "",
163
168
  pageProps: l,
164
169
  block: v,
165
- dataProvider: K,
170
+ dataProvider: R,
166
171
  ...y ? { dataProviderMetadataCallback: y } : {},
167
- draft: a,
168
- children: (z) => u(_, {
172
+ draft: a ?? !1,
173
+ children: (Q) => g(_, {
169
174
  ...I,
170
- draft: a,
171
- ...z,
175
+ ...Q,
172
176
  children: n({
173
177
  _id: t._id,
174
178
  _type: t._type,
175
- ...B(g.repeaterItems) ? {
176
- repeaterItems: C(g.repeaterItems, t),
177
- $repeaterItemsKey: g.$repeaterItemsKey,
178
- repeaterTotalItems: g.repeaterTotalItems ?? -1
179
+ ...B(p.repeaterItems) ? {
180
+ repeaterItems: C(p.repeaterItems, t),
181
+ $repeaterItemsKey: p.$repeaterItemsKey,
182
+ repeaterTotalItems: p.repeaterTotalItems ?? -1
179
183
  } : {}
180
184
  })
181
185
  })
182
186
  }
183
187
  ) });
184
188
  }
185
- return u(_, {
189
+ return g(_, {
186
190
  ...I,
187
- draft: a,
188
191
  children: n({
189
192
  _id: t._id,
190
193
  _type: t._type,
191
- ...B(g.repeaterItems) ? {
192
- repeaterItems: C(g.repeaterItems, t),
193
- $repeaterItemsKey: g.$repeaterItemsKey,
194
- repeaterTotalItems: g.repeaterTotalItems ?? -1
194
+ ...B(p.repeaterItems) ? {
195
+ repeaterItems: C(p.repeaterItems, t),
196
+ $repeaterItemsKey: p.$repeaterItemsKey,
197
+ repeaterTotalItems: p.repeaterTotalItems ?? -1
195
198
  } : {}
196
199
  })
197
200
  });
198
- }, T = async (e) => {
201
+ }, L = async (e) => {
199
202
  const { blocks: t, parent: r, repeaterData: i, type: n } = e;
200
- let s = W(
201
- $(t, (a) => P(a, "_id") && (h(r) ? !a._parent : a._parent === r)),
203
+ let o = W(
204
+ S(t, (a) => P(a, "_id") && (h(r) ? !a._parent : a._parent === r)),
202
205
  "_id"
203
206
  );
204
- const o = (a) => $(t, (l) => l._parent === a).length > 0;
205
- return o && (n === "Heading" || n === "Paragraph" || n === "Link") && (s = j(s)), U(s, (a) => a ? /* @__PURE__ */ u(de, { dataProviders: e.dataProviders, ...e, key: a._id, block: a }, ({ _id: l, _type: y, repeaterItems: c, $repeaterItemsKey: p }) => y === "Repeater" ? B(c) && c.map((_, k) => /* @__PURE__ */ u(
206
- T,
207
+ const s = (a) => S(t, (l) => l._parent === a).length > 0;
208
+ return (n === "Heading" || n === "Paragraph" || n === "Link") && (o = j(o)), U(o, (a) => a ? /* @__PURE__ */ g(de, { ...e, dataProviders: e.dataProviders, key: a._id, block: a }, ({ _id: l, _type: y, repeaterItems: u, $repeaterItemsKey: c }) => y === "Repeater" ? B(u) && u.map((_, k) => /* @__PURE__ */ g(
209
+ L,
207
210
  {
208
211
  ...e,
209
212
  parent: a._id,
210
213
  key: `${d(a, "_parent", "root")}-${a._id}-${k}`,
211
- repeaterData: { index: k, dataKey: p }
214
+ repeaterData: { index: k, dataKey: c }
212
215
  }
213
- )) : o(l) ? /* @__PURE__ */ u(
214
- T,
216
+ )) : s(l) ? /* @__PURE__ */ g(
217
+ L,
215
218
  {
216
219
  ...e,
217
220
  parent: a._id,
@@ -221,45 +224,48 @@ const le = () => /* @__PURE__ */ m("div", {}), de = async (e) => {
221
224
  }
222
225
  ) : null) : null);
223
226
  };
224
- async function Ie(e) {
227
+ async function $e(e) {
225
228
  if (h(e.lang) && !h(e.fallbackLang))
226
229
  throw new Error("lang prop is required when fallbackLang is provided");
227
230
  if (h(e.blocks))
228
231
  return null;
229
232
  const t = e.lang ?? "en", r = e.fallbackLang ?? t;
230
233
  if (e.dataProviders)
231
- return /* @__PURE__ */ m(T, { ...e, lang: t, fallbackLang: r, dataProviders: e.dataProviders });
232
- const n = e.blocks.filter((s) => {
233
- const o = S(s._type);
234
- return !!(P(o, "dataProvider") && w(o.dataProvider));
234
+ return /* @__PURE__ */ m(L, { ...e, lang: t, fallbackLang: r, dataProviders: e.dataProviders });
235
+ const n = e.blocks.filter((o) => {
236
+ const s = T(o._type);
237
+ return !!(P(s, "dataProvider") && $(s.dataProvider));
235
238
  }).reduce(
236
- (s, o) => {
237
- const a = S(o._type), l = {
239
+ (o, s) => {
240
+ const a = T(s._type);
241
+ if (!a || !a.dataProvider)
242
+ return o;
243
+ const l = {
238
244
  pageProps: e.pageProps,
239
- block: o,
245
+ block: s,
240
246
  lang: e.lang,
241
247
  draft: e.draft,
242
248
  inBuilder: !1
243
249
  };
244
- return s[o._id] = a.dataProvider(l), s;
250
+ return o[s._id] = Promise.resolve(a.dataProvider(l)), o;
245
251
  },
246
252
  {}
247
253
  );
248
- return /* @__PURE__ */ m(T, { ...e, lang: t, fallbackLang: r, dataProviders: n });
254
+ return /* @__PURE__ */ m(L, { ...e, lang: t, fallbackLang: r, dataProviders: n });
249
255
  }
250
- function Ce(e, t) {
256
+ function Ie(e, t) {
251
257
  const r = e.filter((i) => i._type === "GlobalBlock" || i._type === "PartialBlock");
252
258
  for (let i = 0; i < r.length; i++) {
253
- const n = r[i], s = d(n, "partialBlockId", d(n, "globalBlock", ""));
254
- if (s === "") continue;
255
- let o = Q(d(t, s, []));
256
- n._parent && (o == null ? void 0 : o.length) > 0 && (o = o.map((l) => (h(l._parent) && (l._parent = n._parent), l)));
259
+ const n = r[i], o = d(n, "partialBlockId", d(n, "globalBlock", ""));
260
+ if (o === "") continue;
261
+ let s = z(d(t, o, []));
262
+ n._parent && (s == null ? void 0 : s.length) > 0 && (s = s.map((l) => (h(l._parent) && (l._parent = n._parent), l)));
257
263
  const a = e.indexOf(n);
258
- e.splice(a, 1, ...o);
264
+ e.splice(a, 1, ...s);
259
265
  }
260
266
  return e;
261
267
  }
262
- const $e = (e) => {
268
+ const Ce = (e) => {
263
269
  if (!e) return [];
264
270
  try {
265
271
  return JSON.parse(ce(e)).filter((r) => !r._type.startsWith("@chai"));
@@ -274,12 +280,13 @@ function ce(e) {
274
280
  return n !== -1 ? i.substring(n + 6) : i;
275
281
  });
276
282
  }
277
- async function pe(e, t = [], r = !1) {
283
+ async function ue(e, t = [], r = !1) {
278
284
  return await X({
279
285
  tailwindConfig: {
280
286
  darkMode: "class",
281
287
  safelist: t,
282
288
  theme: {
289
+ // @ts-ignore
283
290
  extend: {
284
291
  ...re(),
285
292
  keyframes: {
@@ -316,20 +323,20 @@ async function pe(e, t = [], r = !1) {
316
323
  e
317
324
  );
318
325
  }
319
- const ue = (e, t) => {
320
- const r = JSON.stringify(e).replace(/#styles:([^"]*)/g, (i, n) => `#styles:${n.replace(/,/g, " ")}`.replace(/#styles:/g, ""));
321
- return pe([r], [], t);
322
- }, Se = async (e, t = !1) => await ue(e, t);
326
+ const ge = (e, t) => {
327
+ const r = JSON.stringify(e).replace(/#styles:([^"]*)/g, (i, n) => `#styles:${n.replace(/^,/g, " ")}`.replace(/#styles:/g, ""));
328
+ return ue([r], [], t);
329
+ }, Se = async (e, t = !1) => await ge(e, t);
323
330
  export {
324
- Ie as AsyncRenderChaiBlocks,
331
+ $e as AsyncRenderChaiBlocks,
325
332
  we as RenderChaiBlocks,
326
333
  Ae as applyChaiDataBinding,
327
334
  Fe as applyDesignTokens,
328
335
  Me as convertHTMLToChaiBlocks,
329
- $e as convertToBlocks,
330
- Le as getChaiThemeCssVariables,
331
- Ce as getMergedPartialBlocks,
336
+ Ce as convertToBlocks,
337
+ De as getChaiThemeCssVariables,
338
+ Ie as getMergedPartialBlocks,
332
339
  Se as getStylesForBlocks,
333
- De as getThemeFontsCSSImport,
340
+ xe as getThemeFontsCSSImport,
334
341
  Ke as getThemeFontsLinkMarkup
335
342
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-D30xvFa5.cjs"),p=require("./register-chai-top-bar-DyW9GPzV.cjs"),S=({isOpen:m,onClose:r,editor:t,rteElement:f})=>{const a=s.usePageExternalData(),u=o=>{if(!t)return;const i=`{{${o}}}`;t.commands.focus();const{from:j,to:g}=t.state.selection;if(j!==g)t.chain().deleteSelection().insertContent(i).run();else{const{state:c}=t,n=c.selection.from,x=c.doc.textBetween(Math.max(0,n-1),n),l=c.doc.textBetween(n,Math.min(n+1,c.doc.content.size));let d="";n>0&&x!==" "&&!/[.,!?;:]/.test(x)&&(d=" ");let h="";l&&l!==" "&&!/[.,!?;:]/.test(l)&&(h=" "),t.chain().insertContent(d+i+h).run()}};return e.jsx(s.Dialog,{open:m,onOpenChange:o=>!o&&r(),children:e.jsxs(s.DialogContent,{className:"max-h-[90vh] overflow-y-auto sm:max-w-[800px]",children:[e.jsx(s.DialogHeader,{children:e.jsxs(s.DialogTitle,{className:"flex items-center justify-between pr-8",children:[e.jsx("span",{children:"Rich Text Editor"}),a&&Object.keys(a).length>0&&e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"mr-2 text-sm text-muted-foreground",children:"Add field:"}),e.jsx("div",{className:"rte-path-selector",children:e.jsx(s.NestedPathSelector,{data:a,onSelect:u})})]})]})}),f,e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx(p.Button,{onClick:r,children:"Done"})})]})})};exports.default=S;
@@ -1,27 +1,28 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { g as D, D as N, d as S, e as j, f as v, N as w, B } from "./index-Ct7ElCGK.js";
3
- const P = ({
2
+ import { h as D, D as N, e as S, f as j, g as v, N as w } from "./index-BFnMzGe6.js";
3
+ import { B } from "./register-chai-top-bar-D6GjnauV.js";
4
+ const M = ({
4
5
  isOpen: f,
5
- onClose: i,
6
+ onClose: r,
6
7
  editor: t,
7
8
  rteElement: x
8
9
  }) => {
9
10
  const a = D(), u = (c) => {
10
11
  if (!t) return;
11
- const r = `{{${c}}}`;
12
+ const i = `{{${c}}}`;
12
13
  t.commands.focus();
13
14
  const { from: p, to: g } = t.state.selection;
14
15
  if (p !== g)
15
- t.chain().deleteSelection().insertContent(r).run();
16
+ t.chain().deleteSelection().insertContent(i).run();
16
17
  else {
17
18
  const { state: s } = t, n = s.selection.from, d = s.doc.textBetween(Math.max(0, n - 1), n), o = s.doc.textBetween(n, Math.min(n + 1, s.doc.content.size));
18
19
  let h = "";
19
20
  n > 0 && d !== " " && !/[.,!?;:]/.test(d) && (h = " ");
20
21
  let m = "";
21
- o && o !== " " && !/[.,!?;:]/.test(o) && (m = " "), t.chain().insertContent(h + r + m).run();
22
+ o && o !== " " && !/[.,!?;:]/.test(o) && (m = " "), t.chain().insertContent(h + i + m).run();
22
23
  }
23
24
  };
24
- return /* @__PURE__ */ e(N, { open: f, onOpenChange: (c) => !c && i(), children: /* @__PURE__ */ l(S, { className: "max-h-[90vh] overflow-y-auto sm:max-w-[800px]", children: [
25
+ return /* @__PURE__ */ e(N, { open: f, onOpenChange: (c) => !c && r(), children: /* @__PURE__ */ l(S, { className: "max-h-[90vh] overflow-y-auto sm:max-w-[800px]", children: [
25
26
  /* @__PURE__ */ e(j, { children: /* @__PURE__ */ l(v, { className: "flex items-center justify-between pr-8", children: [
26
27
  /* @__PURE__ */ e("span", { children: "Rich Text Editor" }),
27
28
  a && Object.keys(a).length > 0 && /* @__PURE__ */ l("div", { className: "flex items-center", children: [
@@ -30,9 +31,9 @@ const P = ({
30
31
  ] })
31
32
  ] }) }),
32
33
  x,
33
- /* @__PURE__ */ e("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ e(B, { onClick: i, children: "Done" }) })
34
+ /* @__PURE__ */ e("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ e(B, { onClick: r, children: "Done" }) })
34
35
  ] }) });
35
36
  };
36
37
  export {
37
- P as default
38
+ M as default
38
39
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./register-chai-top-bar-DyW9GPzV.cjs");exports.ADD_BLOCK_TABS=e.ADD_BLOCK_TABS;exports.CHAI_BUILDER_PANELS=e.CHAI_BUILDER_PANELS;exports.IfChaiFeatureFlag=e.IfChaiFeatureFlag;exports.RJSF_EXTENSIONS=e.RJSF_EXTENSIONS;exports.getChaiLibrary=e.getChaiLibrary;exports.getPreImportHTML=e.getPreImportHTML;exports.registerChaiAddBlockTab=e.registerChaiAddBlockTab;exports.registerChaiBlockSettingField=e.registerChaiBlockSettingField;exports.registerChaiBlockSettingTemplate=e.registerChaiBlockSettingTemplate;exports.registerChaiBlockSettingWidget=e.registerChaiBlockSettingWidget;exports.registerChaiFeatureFlag=e.registerChaiFeatureFlag;exports.registerChaiFeatureFlags=e.registerChaiFeatureFlags;exports.registerChaiLibrary=e.registerChaiLibrary;exports.registerChaiMediaManager=e.registerChaiMediaManager;exports.registerChaiPreImportHTMLHook=e.registerChaiPreImportHTMLHook;exports.registerChaiSaveToLibrary=e.registerChaiSaveToLibrary;exports.registerChaiSidebarPanel=e.registerChaiSidebarPanel;exports.registerChaiTopBar=e.registerChaiTopBar;exports.resetSaveToLibrary=e.resetSaveToLibrary;exports.useChaiAddBlockTabs=e.useChaiAddBlockTabs;exports.useChaiBlockSettingComponents=e.useChaiBlockSettingComponents;exports.useChaiFeatureFlag=e.useChaiFeatureFlag;exports.useChaiFeatureFlags=e.useChaiFeatureFlags;exports.useChaiLibraries=e.useChaiLibraries;exports.useChaiSidebarPanels=e.useChaiSidebarPanels;exports.useMediaManagerComponent=e.useMediaManagerComponent;exports.useSaveToLibraryComponent=e.useSaveToLibraryComponent;exports.useToggleChaiFeatureFlag=e.useToggleChaiFeatureFlag;exports.useTopBarComponent=e.useTopBarComponent;
@@ -0,0 +1,158 @@
1
+ import { ComponentType } from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ export declare const ADD_BLOCK_TABS: Record<string, AddBlockTab>;
5
+
6
+ export declare type AddBlockTab = {
7
+ id: string;
8
+ tab: React.ComponentType;
9
+ tabContent: React.ComponentType;
10
+ };
11
+
12
+ export declare const CHAI_BUILDER_PANELS: Record<string, ChaiSidebarPanel>;
13
+
14
+ declare type ChaiAsset = {
15
+ url: string;
16
+ id?: string;
17
+ thumbnailUrl?: string;
18
+ description?: string;
19
+ width?: number;
20
+ height?: number;
21
+ };
22
+
23
+ declare type ChaiBlock<T = Record<string, any>> = {
24
+ _id: string;
25
+ _name?: string;
26
+ _parent?: string | null | undefined;
27
+ _libBlock?: string;
28
+ _type: string;
29
+ partialBlockId?: string;
30
+ } & T;
31
+
32
+ declare type ChaiFlagOptions = {
33
+ key: string;
34
+ value?: any;
35
+ description?: string;
36
+ };
37
+
38
+ declare type ChaiLibrary<T = Record<string, any>> = {
39
+ id: string;
40
+ name: string;
41
+ blocks?: ChaiLibraryBlock[];
42
+ description?: string;
43
+ } & T;
44
+
45
+ declare type ChaiLibraryBlock<T = Record<string, any>> = {
46
+ id: string;
47
+ group: string;
48
+ name: string;
49
+ preview?: string;
50
+ tags?: string[];
51
+ description?: string;
52
+ } & T;
53
+
54
+ declare type ChaiLibraryConfig<T> = {
55
+ id: string;
56
+ name: string;
57
+ description: string;
58
+ getBlocksList: (library: ChaiLibrary) => Promise<ChaiLibraryBlock<T>[]>;
59
+ getBlock: ({ library, block, }: {
60
+ library: ChaiLibrary;
61
+ block: ChaiLibraryBlock<T>;
62
+ }) => Promise<HTMLString | ChaiBlock[]>;
63
+ };
64
+
65
+ export declare interface ChaiSidebarPanel {
66
+ id: string;
67
+ position: "top" | "bottom";
68
+ view?: "standard" | "modal" | "overlay" | "drawer";
69
+ button: React.ComponentType<{
70
+ isActive: boolean;
71
+ show: () => void;
72
+ panelId: string;
73
+ position: "top" | "bottom";
74
+ }>;
75
+ label: string;
76
+ panel?: ComponentType;
77
+ width?: number;
78
+ isInternal?: boolean;
79
+ icon?: React.ReactNode;
80
+ }
81
+
82
+ export declare const getChaiLibrary: (id: string) => ChaiLibraryConfig<any>;
83
+
84
+ export declare const getPreImportHTML: (code: string) => Promise<string>;
85
+
86
+ declare type HTMLString = string;
87
+
88
+ export declare const IfChaiFeatureFlag: ({ flagKey, children }: {
89
+ flagKey: string;
90
+ children: React.ReactNode;
91
+ }) => ReactNode;
92
+
93
+ export declare type MediaManagerProps = {
94
+ assetId?: string;
95
+ close: () => void;
96
+ onSelect: (assets: ChaiAsset | ChaiAsset[]) => void;
97
+ mode?: "image" | "video" | "audio";
98
+ };
99
+
100
+ export declare const registerChaiAddBlockTab: (id: string, tab: Omit<AddBlockTab, "id">) => void;
101
+
102
+ export declare const registerChaiBlockSettingField: (id: string, component: React.ComponentType<any>) => void;
103
+
104
+ export declare const registerChaiBlockSettingTemplate: (id: string, component: React.ComponentType<any>) => void;
105
+
106
+ export declare const registerChaiBlockSettingWidget: (id: string, component: React.ComponentType<any>) => void;
107
+
108
+ export declare const registerChaiFeatureFlag: (key: string, flagOptions: Omit<ChaiFlagOptions, "key">) => void;
109
+
110
+ export declare const registerChaiFeatureFlags: (flags: Record<string, Omit<ChaiFlagOptions, "key">>) => void;
111
+
112
+ export declare const registerChaiLibrary: <T extends Record<string, any> = Record<string, any>>(id: string, library: Omit<ChaiLibraryConfig<T>, "id">) => void;
113
+
114
+ export declare const registerChaiMediaManager: (component: React.ComponentType<MediaManagerProps>) => void;
115
+
116
+ export declare const registerChaiPreImportHTMLHook: (fn: (code: string) => Promise<string>) => void;
117
+
118
+ export declare const registerChaiSaveToLibrary: (component: ComponentType<SaveToLibraryProps>) => void;
119
+
120
+ export declare const registerChaiSidebarPanel: (panelId: string, panelOptions: Omit<ChaiSidebarPanel, "id">) => void;
121
+
122
+ export declare const registerChaiTopBar: (component: React.ComponentType) => void;
123
+
124
+ export declare const resetSaveToLibrary: () => void;
125
+
126
+ export declare const RJSF_EXTENSIONS: Record<string, {
127
+ id: string;
128
+ component: React.ComponentType<any>;
129
+ type: string;
130
+ }>;
131
+
132
+ export declare type SaveToLibraryProps = {
133
+ blockId: string;
134
+ blocks: ChaiBlock[];
135
+ close: () => void;
136
+ };
137
+
138
+ export declare const useChaiAddBlockTabs: () => AddBlockTab[];
139
+
140
+ export declare const useChaiBlockSettingComponents: (type: "widget" | "field" | "template") => Record<string, React.ComponentType<any>>;
141
+
142
+ export declare const useChaiFeatureFlag: (flagKey: string) => boolean;
143
+
144
+ export declare const useChaiFeatureFlags: () => Record<string, ChaiFlagOptions>;
145
+
146
+ export declare const useChaiLibraries: () => ChaiLibraryConfig<any>[];
147
+
148
+ export declare const useChaiSidebarPanels: (position: "top" | "bottom") => ChaiSidebarPanel[];
149
+
150
+ export declare const useMediaManagerComponent: () => ComponentType<MediaManagerProps>;
151
+
152
+ export declare const useSaveToLibraryComponent: () => ComponentType<SaveToLibraryProps> | null;
153
+
154
+ export declare const useToggleChaiFeatureFlag: (flagKey: string) => () => void;
155
+
156
+ export declare const useTopBarComponent: () => ComponentType< {}>;
157
+
158
+ export { }
@@ -0,0 +1,32 @@
1
+ import { A as s, C as r, I as i, R as t, k as g, o as C, c as o, a as h, b as l, r as n, e as u, f as F, j as S, m as T, p as b, q as d, v as p, x as B, t as L, d as m, u as k, h as c, g as A, l as I, w as y, n as M, s as P, i as _, y as v } from "./register-chai-top-bar-D6GjnauV.js";
2
+ export {
3
+ s as ADD_BLOCK_TABS,
4
+ r as CHAI_BUILDER_PANELS,
5
+ i as IfChaiFeatureFlag,
6
+ t as RJSF_EXTENSIONS,
7
+ g as getChaiLibrary,
8
+ C as getPreImportHTML,
9
+ o as registerChaiAddBlockTab,
10
+ h as registerChaiBlockSettingField,
11
+ l as registerChaiBlockSettingTemplate,
12
+ n as registerChaiBlockSettingWidget,
13
+ u as registerChaiFeatureFlag,
14
+ F as registerChaiFeatureFlags,
15
+ S as registerChaiLibrary,
16
+ T as registerChaiMediaManager,
17
+ b as registerChaiPreImportHTMLHook,
18
+ d as registerChaiSaveToLibrary,
19
+ p as registerChaiSidebarPanel,
20
+ B as registerChaiTopBar,
21
+ L as resetSaveToLibrary,
22
+ m as useChaiAddBlockTabs,
23
+ k as useChaiBlockSettingComponents,
24
+ c as useChaiFeatureFlag,
25
+ A as useChaiFeatureFlags,
26
+ I as useChaiLibraries,
27
+ y as useChaiSidebarPanels,
28
+ M as useMediaManagerComponent,
29
+ P as useSaveToLibraryComponent,
30
+ _ as useToggleChaiFeatureFlag,
31
+ v as useTopBarComponent
32
+ };