@chaibuilder/sdk 4.0.0-beta.7 → 4.0.0-beta.9

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 (151) hide show
  1. package/README.md +5 -8
  2. package/dist/{2SSKDMRQ-hL7THuKW.js → 2SSKDMRQ-CdFBQR2o.js} +2 -2
  3. package/dist/{2SSKDMRQ-DDOgISWg.cjs → 2SSKDMRQ-CuQ42ST6.cjs} +1 -1
  4. package/dist/{AP7HFJJL-tcAhVllC.cjs → AP7HFJJL-DcnEb4BE.cjs} +1 -1
  5. package/dist/{AP7HFJJL-BsLQ13V_.js → AP7HFJJL-bDlWX5Yx.js} +1 -1
  6. package/dist/{IconPicker-FLSVAZxx.js → IconPicker-CNwplOGy.js} +2 -2
  7. package/dist/{IconPicker-J1KLNrSB.cjs → IconPicker-FpyYsxOf.cjs} +1 -1
  8. package/dist/STRINGS-BExFecZW.js +8 -0
  9. package/dist/STRINGS-FNnfjF5H.cjs +1 -0
  10. package/dist/{WDYDFRGG-BTj8AXV6.cjs → WDYDFRGG-BxLmjulP.cjs} +1 -1
  11. package/dist/{WDYDFRGG-Yi0eNS2V.js → WDYDFRGG-CWq7H6Qk.js} +2 -2
  12. package/dist/{actions-registery-CtQSSexG.cjs → actions-registery-BRgseJas.cjs} +16 -16
  13. package/dist/{actions-registery-DqrFhSMp.js → actions-registery-DRV8xywr.js} +180 -181
  14. package/dist/actions.cjs +1 -1
  15. package/dist/actions.d.ts +112 -51
  16. package/dist/actions.js +2 -2
  17. package/dist/{active-in-another-tab-Dozn833d.js → active-in-another-tab-C392ZWQc.js} +3 -3
  18. package/dist/{active-in-another-tab-BtAiatqq.cjs → active-in-another-tab-DEWOFgY5.cjs} +1 -1
  19. package/dist/{add-new-language-page-DD-CAoAQ.js → add-new-language-page-BL2F_Cu7.js} +4 -4
  20. package/dist/{add-new-language-page-9AMizlES.cjs → add-new-language-page-DBWd0wDY.cjs} +1 -1
  21. package/dist/{add-new-page-BS9vPnFG.cjs → add-new-page-DYrQeKCi.cjs} +1 -1
  22. package/dist/{add-new-page-uZKCk9eB.js → add-new-page-QVlyJhn9.js} +2 -2
  23. package/dist/{ai-panel-content-CK4XOkEh.js → ai-panel-content-CCOluPtK.js} +4 -4
  24. package/dist/{ai-panel-content-PovaKJaj.cjs → ai-panel-content-DCZRBa6s.cjs} +1 -1
  25. package/dist/{ai-panel-default-lang-B37k5ADH.cjs → ai-panel-default-lang-C3t0elrO.cjs} +2 -2
  26. package/dist/{ai-panel-default-lang-BtLjUl9d.js → ai-panel-default-lang-Crz7QAxl.js} +4 -4
  27. package/dist/{ai-panel-other-lang-CdQmASqv.cjs → ai-panel-other-lang-BRkr4Te3.cjs} +1 -1
  28. package/dist/{ai-panel-other-lang-Dp1MNaLi.js → ai-panel-other-lang-DIF8PYLh.js} +4 -4
  29. package/dist/{ai-prompt-input-BT-mEdTX.js → ai-prompt-input-D4dqy8L2.js} +2 -2
  30. package/dist/{ai-prompt-input-Dtym4w8J.cjs → ai-prompt-input-Ybgvrvd6.cjs} +1 -1
  31. package/dist/{ai-translation-prompt-B-lH7emI.cjs → ai-translation-prompt-Ck12Bfl6.cjs} +1 -1
  32. package/dist/{ai-translation-prompt-B17GK1QR.js → ai-translation-prompt-eZ4Sllva.js} +2 -2
  33. package/dist/{apply-binding-BvWfJCSZ.js → apply-binding-CLU6Xp4K.js} +77 -81
  34. package/dist/apply-binding-NvZX_rJe.cjs +1 -0
  35. package/dist/{code-display-DloSPyPr.cjs → code-display-9Onx6RCq.cjs} +1 -1
  36. package/dist/{code-display-Ck81Id9K.js → code-display-oa1j0ri7.js} +1 -1
  37. package/dist/{code-editor-EZT2pMsU.js → code-editor-D45h29W1.js} +1 -1
  38. package/dist/{code-editor-CUeNiMzA.cjs → code-editor-DH8eU4WL.cjs} +1 -1
  39. package/dist/{continue-editing-in-this-client-CS7C6h9Q.js → continue-editing-in-this-client-BRrIvSrl.js} +3 -3
  40. package/dist/{continue-editing-in-this-client-DMZOc36k.cjs → continue-editing-in-this-client-DgZ9Q18G.cjs} +1 -1
  41. package/dist/core-8lkXy4lC.cjs +1 -0
  42. package/dist/core-BvsZwF26.js +52 -0
  43. package/dist/core.cjs +1 -1
  44. package/dist/core.d.ts +143 -172
  45. package/dist/core.js +22 -34
  46. package/dist/{css-import-modal-s7t5gZQo.js → css-import-modal-BhLPzQH8.js} +5 -4
  47. package/dist/css-import-modal-C2-oVwFv.cjs +13 -0
  48. package/dist/{delete-design-token-C1smbx4E.js → delete-design-token-D4Q5-Xql.js} +1 -1
  49. package/dist/{delete-design-token-Mbw_6sYI.cjs → delete-design-token-DJSQluQ6.cjs} +1 -1
  50. package/dist/{delete-page-B7J3t0FN.cjs → delete-page-BxbsKhY5.cjs} +1 -1
  51. package/dist/{delete-page-2GfBi8Iv.js → delete-page-xHdZT-7c.js} +3 -3
  52. package/dist/{design-token-usage-DyO3xM-F.js → design-token-usage-7wgmVSWI.js} +2 -2
  53. package/dist/{design-token-usage-BoGOULG8.cjs → design-token-usage-KZ4pilLm.cjs} +1 -1
  54. package/dist/{digital-asset-manager-Cz3Nlrzl.js → digital-asset-manager-BmbVU7fX.js} +4 -4
  55. package/dist/{digital-asset-manager-DDk2ucTE.cjs → digital-asset-manager-a1fqrQVH.cjs} +1 -1
  56. package/dist/{duplicate-page-BwAY4Ssm.js → duplicate-page-5uIno9Yh.js} +4 -4
  57. package/dist/{duplicate-page-Dw3U4wTT.cjs → duplicate-page-BBTxn_o1.cjs} +1 -1
  58. package/dist/{dynamic-page-selector-CvBFyX2F.cjs → dynamic-page-selector-C1ef0i2I.cjs} +1 -1
  59. package/dist/{dynamic-page-selector-sViJuQlU.js → dynamic-page-selector-rhvhg7ol.js} +3 -3
  60. package/dist/{image-editor-BgGQuESa.js → image-editor-BXYZDa0s.js} +1 -1
  61. package/dist/{image-editor-AIsccrqC.cjs → image-editor-rqUgAO8V.cjs} +1 -1
  62. package/dist/{index-B7eWP_hB.js → index-Be9lAaD7.js} +421 -425
  63. package/dist/index-BhqugjzS.cjs +160 -0
  64. package/dist/index-CNEEEgTV.cjs +5 -0
  65. package/dist/{index-RYr8kQdI.js → index-mjuSGlPU.js} +5136 -5613
  66. package/dist/{json-diff-viewer-B2A78udz.cjs → json-diff-viewer-C9qmLiaq.cjs} +1 -1
  67. package/dist/{json-diff-viewer-Svw-kbhe.js → json-diff-viewer-aVwY7_hZ.js} +3 -3
  68. package/dist/{lang-panel-Bnc-9wkM.js → lang-panel-BTWk23Mw.js} +4 -4
  69. package/dist/{lang-panel-AmEkoWid.cjs → lang-panel-Bo1ZWYfu.cjs} +1 -1
  70. package/dist/{manage-design-tokens-BBkh1t4w.js → manage-design-tokens-id8bylgO.js} +4 -4
  71. package/dist/manage-design-tokens-lUMCgjdS.cjs +1 -0
  72. package/dist/{mark-as-template-CE6tRoQy.cjs → mark-as-template-BYXBDXMv.cjs} +1 -1
  73. package/dist/{mark-as-template-0CPzZnk-.js → mark-as-template-hv3WD852.js} +3 -3
  74. package/dist/{nested-path-selector-content-kGznHufl.js → nested-path-selector-content-B8z90MFF.js} +2 -2
  75. package/dist/{nested-path-selector-content-SmfjElr-.cjs → nested-path-selector-content-DgFFXcTD.cjs} +1 -1
  76. package/dist/{no-language-page-content-B4bQLc4K.cjs → no-language-page-content-6Kk8UjFX.cjs} +1 -1
  77. package/dist/{no-language-page-content-DXsAPDZd.js → no-language-page-content-DMACzysm.js} +3 -3
  78. package/dist/{no-language-page-dialog-BpPqmw9a.js → no-language-page-dialog-D4n_XYUq.js} +2 -2
  79. package/dist/{no-language-page-dialog-BC8NHzK2.cjs → no-language-page-dialog-mBH-fthh.cjs} +1 -1
  80. package/dist/{page-creator-82qTbBj4.cjs → page-creator-CGglYnYg.cjs} +1 -1
  81. package/dist/{page-creator-Bazn6yH4.js → page-creator-CgsOF0Eg.js} +4 -4
  82. package/dist/{page-lock-CRFyqKZE.js → page-lock-CUCEBnJb.js} +2 -2
  83. package/dist/{page-lock-D2iFZDUK.cjs → page-lock-Hsi61Mk5.cjs} +1 -1
  84. package/dist/{page-locked-dialog-xLqvKzax.cjs → page-locked-dialog-DSxbAMpt.cjs} +1 -1
  85. package/dist/{page-locked-dialog-GKfQEOmk.js → page-locked-dialog-bHvbFllT.js} +3 -3
  86. package/dist/{page-manager-new-Bn2QKjbf.cjs → page-manager-new-CBfFl5rL.cjs} +1 -1
  87. package/dist/{page-manager-new-DItY2hjd.js → page-manager-new-Cifc526h.js} +8 -8
  88. package/dist/{page-manager-search-and-filter-CPa8IXdd.js → page-manager-search-and-filter-CLJss6pV.js} +3 -3
  89. package/dist/{page-manager-search-and-filter-Dc4ky-qV.cjs → page-manager-search-and-filter-mEKl-UKh.cjs} +1 -1
  90. package/dist/page-revisions-content-C95dQJyx.cjs +1 -0
  91. package/dist/{page-revisions-content-CH-PZK0O.js → page-revisions-content-DvL4ya9g.js} +75 -67
  92. package/dist/pages.cjs +1 -1
  93. package/dist/pages.d.ts +146 -92
  94. package/dist/pages.js +1 -1
  95. package/dist/{publish-pages-content-BzJDObqr.cjs → publish-pages-content-B-6vSkql.cjs} +1 -1
  96. package/dist/{publish-pages-content-CSJCFElu.js → publish-pages-content-B8-IZW_U.js} +4 -4
  97. package/dist/{register-chai-top-bar-ESJHs5s-.js → register-chai-top-bar-CX_JkRJn.js} +78 -78
  98. package/dist/register-chai-top-bar-DWTuRU53.cjs +1 -0
  99. package/dist/render.cjs +1 -1
  100. package/dist/render.d.ts +14 -15
  101. package/dist/render.js +3 -3
  102. package/dist/{rte-widget-modal-5T81P_hg.js → rte-widget-modal-1SbY5bcQ.js} +7 -7
  103. package/dist/{rte-widget-modal-BfXcA7OP.cjs → rte-widget-modal-CyKwtbOG.cjs} +1 -1
  104. package/dist/runtime-client.cjs +1 -0
  105. package/dist/runtime-client.d.ts +158 -0
  106. package/dist/runtime-client.js +32 -0
  107. package/dist/runtime.cjs +1 -1
  108. package/dist/runtime.d.ts +92 -240
  109. package/dist/runtime.js +72 -72
  110. package/dist/{save-to-lib-MtWKSVeN.js → save-to-lib-BKcBfjfi.js} +3 -3
  111. package/dist/{save-to-lib-DGAdSa-0.cjs → save-to-lib-BmPh_Vns.cjs} +1 -1
  112. package/dist/{selected-block-display-CB1-hVR5.js → selected-block-display-B3hHlcLA.js} +3 -3
  113. package/dist/{selected-block-display-DLt_nMn9.cjs → selected-block-display-BCvTNcp2.cjs} +1 -1
  114. package/dist/{seo-panel-CRzzw4FW.js → seo-panel-D3EyOYij.js} +3 -3
  115. package/dist/{seo-panel-_kGXE9MC.cjs → seo-panel-DVClgzX9.cjs} +1 -1
  116. package/dist/{shared-json-ld-DoRgzDPC.cjs → shared-json-ld-BRgJTv0m.cjs} +1 -1
  117. package/dist/{shared-json-ld-CXukkDeS.js → shared-json-ld-DSPadwbY.js} +3 -3
  118. package/dist/{slug-input-Dp187Tiy.cjs → slug-input-B39SPBdP.cjs} +1 -1
  119. package/dist/{slug-input-CeEQ0zyv.js → slug-input-C3UrwSkt.js} +2 -2
  120. package/dist/supabase-actions.cjs +1 -1
  121. package/dist/supabase-actions.js +1 -1
  122. package/dist/{take-over-request-C9J3_rev.js → take-over-request-DfAlPvpE.js} +3 -3
  123. package/dist/{take-over-request-CXuakFBm.cjs → take-over-request-Tq9-gOCV.cjs} +1 -1
  124. package/dist/{theme-panel-footer-DvwsyHNQ.js → theme-panel-footer-DIy4baYU.js} +3 -3
  125. package/dist/{theme-panel-footer-CWZ0qs13.cjs → theme-panel-footer-DQzjVBBP.cjs} +1 -1
  126. package/dist/{translation-warning-modal-_aBp5ZZQ.js → translation-warning-modal-BHwLZZOw.js} +2 -2
  127. package/dist/{translation-warning-modal-DEt_ExQp.cjs → translation-warning-modal-Ckwt5Skc.cjs} +1 -1
  128. package/dist/types.cjs +1 -0
  129. package/dist/types.d.ts +598 -0
  130. package/dist/types.js +1 -0
  131. package/dist/{unmark-as-template-BYL5naYx.cjs → unmark-as-template-BKA-sNZr.cjs} +1 -1
  132. package/dist/{unmark-as-template-JN-cDUV_.js → unmark-as-template-CbgifSbI.js} +3 -3
  133. package/dist/{unpublish-page-B06iZEIO.cjs → unpublish-page-BqzvOD76.cjs} +1 -1
  134. package/dist/{unpublish-page-DqwBY2yI.js → unpublish-page-DXQpAkvc.js} +3 -3
  135. package/dist/utils.d.ts +5 -5
  136. package/dist/web-blocks.cjs +1 -1
  137. package/dist/web-blocks.js +214 -214
  138. package/dist/{web-preview-h39D3TUh.js → web-preview-DH7Yv-jg.js} +2 -2
  139. package/dist/{web-preview-wRgRY3Tv.cjs → web-preview-DShy13AM.cjs} +1 -1
  140. package/package.json +13 -7
  141. package/dist/apply-binding-IsUf6UWJ.cjs +0 -1
  142. package/dist/core-Dr7QYemB.js +0 -56
  143. package/dist/core-Y0lXLwkq.cjs +0 -1
  144. package/dist/css-import-modal-kHB0ramf.cjs +0 -13
  145. package/dist/index-B-rSiAp_.cjs +0 -1
  146. package/dist/index-BwH1mRm_.cjs +0 -5
  147. package/dist/index-Dxfyt4d4.js +0 -39
  148. package/dist/index-xYnNKovy.cjs +0 -160
  149. package/dist/manage-design-tokens-B2fG80bi.cjs +0 -1
  150. package/dist/page-revisions-content-CcLFI4YK.cjs +0 -1
  151. package/dist/register-chai-top-bar-BqwKw4uy.cjs +0 -1
package/dist/runtime.d.ts CHANGED
@@ -1,46 +1,16 @@
1
- import { ComponentType } from 'react';
2
1
  import { default as default_2 } from 'react';
3
- import { ReactNode } from 'react';
4
2
  import { RJSFSchema } from '@rjsf/utils';
5
3
  import { UiSchema } from '@rjsf/utils';
6
4
 
7
- export declare const ADD_BLOCK_TABS: Record<string, AddBlockTab>;
8
-
9
- export declare type AddBlockTab = {
10
- id: string;
11
- tab: React.ComponentType;
12
- tabContent: React.ComponentType;
13
- };
14
-
15
5
  export declare const builderProp: (options: ChaiBlockPropSchema) => ChaiBlockPropSchema;
16
6
 
17
- export declare const CHAI_BUILDER_PANELS: Record<string, ChaiSidebarPanel>;
18
-
19
7
  export declare let CHAI_GLOBAL_DATA_PROVIDER: (args: {
20
8
  lang: string;
21
9
  draft: boolean;
22
10
  inBuilder: boolean;
23
11
  }) => Promise<any>;
24
12
 
25
- declare type ChaiAsset = {
26
- url: string;
27
- id?: string;
28
- thumbnailUrl?: string;
29
- description?: string;
30
- width?: number;
31
- height?: number;
32
- };
33
-
34
- export declare type ChaiAsyncProp<T> = T | undefined;
35
-
36
- export declare type ChaiBlock<BlockProps = Record<string, any>> = {
37
- _id: string;
38
- _type: string;
39
- _name?: string;
40
- _parent?: string | null;
41
- } & BlockProps;
42
-
43
- declare type ChaiBlock_2<T = Record<string, any>> = {
13
+ declare type ChaiBlock<T = Record<string, any>> = {
44
14
  _id: string;
45
15
  _name?: string;
46
16
  _parent?: string | null | undefined;
@@ -49,15 +19,7 @@ declare type ChaiBlock_2<T = Record<string, any>> = {
49
19
  partialBlockId?: string;
50
20
  } & T;
51
21
 
52
- declare type ChaiBlock_3<T = Record<string, any>> = {
53
- _id: string;
54
- _name?: string;
55
- _parent?: string | null | undefined;
56
- _type: string;
57
- _libBlock?: string;
58
- } & T;
59
-
60
- export declare type ChaiBlockComponentProps<BlockProps, PageData = Record<string, unknown>> = ChaiBlock<BlockProps> & {
22
+ declare type ChaiBlockComponentProps<BlockProps, PageData = Record<string, unknown>> = ChaiBlock<BlockProps> & {
61
23
  $loading?: boolean;
62
24
  blockProps: Record<string, string>;
63
25
  inBuilder: boolean;
@@ -68,7 +30,7 @@ export declare type ChaiBlockComponentProps<BlockProps, PageData = Record<string
68
30
  children?: default_2.ReactNode;
69
31
  };
70
32
 
71
- export declare interface ChaiBlockDefinition<T = Record<string, any>, K = Record<string, any>> {
33
+ declare interface ChaiBlockDefinition<T = Record<string, any>, K = Record<string, any>> {
72
34
  component: default_2.ComponentType<ChaiBlockComponentProps<T>>;
73
35
  type: string;
74
36
  label: string;
@@ -102,82 +64,34 @@ export declare interface ChaiBlockDefinition<T = Record<string, any>, K = Record
102
64
 
103
65
  declare type ChaiBlockDefinitionOptions<T, K> = Omit<ChaiBlockDefinition<T, K>, "component">;
104
66
 
105
- export declare type ChaiBlockPropSchema = RJSFSchema & {
67
+ declare type ChaiBlockPropSchema = RJSFSchema & {
106
68
  ui?: ChaiBlockUiSchema;
107
69
  default: any;
108
70
  };
109
71
 
110
- export declare type ChaiBlockSchema = {
72
+ declare type ChaiBlockSchema = {
111
73
  properties?: Record<string, ChaiBlockPropSchema>;
112
74
  allOf?: any[];
113
75
  oneOf?: any[];
114
76
  } & Partial<Pick<ChaiBlockPropSchema, "required" | "dependencies" | "ui" | "title" | "description" | "default">>;
115
77
 
116
- export declare type ChaiBlockSchemas = {
78
+ declare type ChaiBlockSchemas = {
117
79
  schema: object | Omit<ChaiBlockSchema, "ui">;
118
80
  uiSchema?: ChaiBlockUiSchema;
119
81
  };
120
82
 
121
- export declare type ChaiBlockUiSchema = UiSchema;
122
-
123
- declare type ChaiBuilderPage = {
124
- id: string;
125
- slug: string;
126
- name: string;
127
- lang: string;
128
- online: boolean;
129
- seo: Record<string, any>;
130
- };
131
-
132
- declare type ChaiBuilderPageType = {
133
- key: string;
134
- helpText?: string;
135
- icon?: string;
136
- hasSlug?: boolean;
137
- name: string | (() => Promise<string>);
138
- dynamicSegments?: string;
139
- dynamicSlug?: string;
140
- getDynamicPages?: ({ query, uuid }: {
141
- query?: string;
142
- uuid?: string;
143
- }) => Promise<ChaiDynamicPage[]>;
144
- search?: (query: string) => Promise<PageTypeSearchResult[] | Error>;
145
- resolveLink?: (id: string, draft?: boolean, lang?: string) => Promise<string>;
146
- onCreate?: (data: Omit<ChaiBuilderPage, "seo">) => Promise<void>;
147
- onUpdate?: (data: ChaiBuilderPage) => Promise<void>;
148
- onDelete?: (data: Pick<ChaiBuilderPage, "id">) => Promise<void>;
149
- dataProvider?: (args: {
150
- lang: string;
151
- draft: boolean;
152
- inBuilder: boolean;
153
- pageProps: ChaiPageProps;
154
- }) => Promise<Record<string, any>>;
155
- defaultTrackingInfo?: () => Record<string, any>;
156
- defaultSeo?: () => Record<string, any>;
157
- defaultJSONLD?: () => Record<string, any>;
158
- defaultMetaTags?: () => Record<string, string>;
159
- };
160
-
161
- export declare type ChaiDataProviderArgs<T = Record<string, any>, K = Record<string, any>> = {
162
- block: ChaiBlock<T>;
163
- } & K;
83
+ declare type ChaiBlockUiSchema = UiSchema;
164
84
 
165
- declare type ChaiDynamicPage = {
166
- id: string;
167
- slug: string;
168
- name: string;
169
- primaryPage?: string;
170
- };
171
-
172
- declare type ChaiFlagOptions = {
173
- key: string;
174
- value?: any;
175
- description?: string;
176
- };
85
+ declare interface ChaiDesignTokens {
86
+ [uniqueId: string]: {
87
+ name: string;
88
+ value: string;
89
+ };
90
+ }
177
91
 
178
- export declare type ChaiFont = ChaiFontViaUrl | ChaiFontViaSrc;
92
+ declare type ChaiFont = ChaiFontViaUrl | ChaiFontViaSrc;
179
93
 
180
- export declare type ChaiFontViaSrc = {
94
+ declare type ChaiFontViaSrc = {
181
95
  family: string;
182
96
  src: {
183
97
  url: string;
@@ -190,48 +104,89 @@ export declare type ChaiFontViaSrc = {
190
104
  fallback: string;
191
105
  };
192
106
 
193
- export declare type ChaiFontViaUrl = {
107
+ declare type ChaiFontViaUrl = {
194
108
  family: string;
195
109
  url: string;
196
110
  fallback: string;
197
111
  };
198
112
 
199
- declare type ChaiLibrary<T = Record<string, any>> = {
200
- id: string;
201
- name: string;
202
- blocks?: ChaiLibraryBlock[];
203
- description?: string;
204
- } & T;
205
-
206
- declare type ChaiLibraryBlock<T = Record<string, any>> = {
207
- id: string;
208
- group: string;
209
- name: string;
210
- preview?: string;
211
- tags?: string[];
212
- description?: string;
213
- } & T;
214
-
215
- declare type ChaiLibraryConfig<T> = {
113
+ declare type ChaiPage = {
216
114
  id: string;
115
+ slug: string;
116
+ lang: string;
217
117
  name: string;
218
- description: string;
219
- getBlocksList: (library: ChaiLibrary) => Promise<ChaiLibraryBlock<T>[]>;
220
- getBlock: ({ library, block, }: {
221
- library: ChaiLibrary;
222
- block: ChaiLibraryBlock<T>;
223
- }) => Promise<HTMLString | ChaiBlock_2[]>;
118
+ pageType: string;
119
+ blocks: ChaiBlock[];
120
+ createdAt: string;
121
+ lastSaved: string;
122
+ dynamic: boolean;
123
+ online: boolean;
124
+ seo: ChaiPageSeo;
125
+ app: string;
126
+ primaryPage?: string | null;
127
+ currentEditor?: string | null;
128
+ changes: object[];
129
+ parent?: string | null;
130
+ libRefId?: string | null;
131
+ dynamicSlugCustom?: string | null;
132
+ metadata?: object;
133
+ jsonld?: object;
134
+ globalJsonLds?: string[];
135
+ links?: string;
136
+ partialBlocks?: string;
137
+ designTokens?: ChaiDesignTokens;
224
138
  };
225
139
 
226
- export declare interface ChaiPageProps {
140
+ declare type ChaiPageProps<T = Record<string, any>> = {
227
141
  slug: string;
228
142
  searchParams?: Record<string, string>;
229
- [key: string]: any;
230
- }
143
+ } & T;
231
144
 
232
- export declare type ChaiRuntimeProp<T> = T | undefined;
145
+ declare type ChaiPageSeo = {
146
+ title?: string;
147
+ description?: string;
148
+ ogTitle?: string;
149
+ ogDescription?: string;
150
+ ogImage?: string;
151
+ canonicalUrl?: string;
152
+ noIndex?: boolean;
153
+ noFollow?: boolean;
154
+ jsonLD?: string;
155
+ };
233
156
 
234
- export declare interface ChaiServerBlockDefinition<T = Record<string, any>, K = Record<string, any>> {
157
+ declare type ChaiPageType = {
158
+ key: string;
159
+ helpText?: string;
160
+ icon?: string;
161
+ hasSlug?: boolean;
162
+ name: string | (() => Promise<string>);
163
+ dynamicSegments?: string;
164
+ dynamicSlug?: string;
165
+ getDynamicPages?: ({ query, uuid, }: {
166
+ query?: string;
167
+ uuid?: string;
168
+ }) => Promise<Pick<ChaiPage, "id" | "name" | "slug" | "primaryPage">[]>;
169
+ search?: (query: string) => Promise<Pick<ChaiPage, "id" | "name" | "slug">[] | Error>;
170
+ resolveLink?: (id: string, draft?: boolean, lang?: string) => Promise<string>;
171
+ onCreate?: (data: Partial<ChaiPage> & {
172
+ id: string;
173
+ }) => Promise<void>;
174
+ onUpdate?: (data: Partial<ChaiPage> & {
175
+ id: string;
176
+ }) => Promise<void>;
177
+ onDelete?: (data: Pick<ChaiPage, "id">) => Promise<void>;
178
+ dataProvider?: (args: {
179
+ lang: string;
180
+ draft: boolean;
181
+ inBuilder: boolean;
182
+ pageProps: ChaiPageProps;
183
+ }) => Promise<Record<string, any>>;
184
+ defaultSeo?: () => Record<string, any>;
185
+ defaultJSONLD?: () => Record<string, any>;
186
+ defaultMetaTags?: () => Record<string, string>;
187
+ };
188
+
189
+ declare interface ChaiServerBlockDefinition<T = Record<string, any>, K = Record<string, any>> {
235
190
  component: default_2.ComponentType<ChaiBlockComponentProps<T>>;
236
191
  type: string;
237
192
  dataProvider?: (args: {
@@ -244,27 +199,6 @@ export declare interface ChaiServerBlockDefinition<T = Record<string, any>, K =
244
199
  suspenseFallback?: default_2.ComponentType<any>;
245
200
  }
246
201
 
247
- export declare interface ChaiSidebarPanel {
248
- id: string;
249
- position: "top" | "bottom";
250
- view?: "standard" | "modal" | "overlay" | "drawer";
251
- button: React.ComponentType<{
252
- isActive: boolean;
253
- show: () => void;
254
- panelId: string;
255
- position: "top" | "bottom";
256
- }>;
257
- label: string;
258
- panel?: ComponentType;
259
- width?: number;
260
- isInternal?: boolean;
261
- icon?: React.ReactNode;
262
- }
263
-
264
- export declare type ChaiStyles = {
265
- [key: string]: string;
266
- };
267
-
268
202
  export declare const closestBlockProp: (blockType: keyof typeof REGISTERED_CHAI_BLOCKS, prop: string) => ChaiBlockPropSchema;
269
203
 
270
204
  declare interface CollectionConfig<T> {
@@ -301,7 +235,7 @@ export declare const COLLECTIONS: Record<string, CollectionConfig<any>>;
301
235
 
302
236
  export declare const defaultChaiStyles: (classes: string) => string;
303
237
 
304
- export declare const getAIBlockProps: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => ChaiBlockDefinition<Record<string, any>, Record<string, any>> | ChaiServerBlockDefinition<Record<string, any>, Record<string, any>> | never[];
238
+ export declare const getAIBlockProps: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => never[] | ChaiBlockDefinition<Record<string, any>, Record<string, any>> | ChaiServerBlockDefinition<Record<string, any>, Record<string, any>>;
305
239
 
306
240
  export declare const getAllRegisteredFonts: () => ChaiFont[];
307
241
 
@@ -320,51 +254,19 @@ export declare const getChaiGlobalData: (args: {
320
254
  inBuilder: boolean;
321
255
  }) => Promise<any>;
322
256
 
323
- export declare const getChaiLibrary: (id: string) => ChaiLibraryConfig<any>;
257
+ export declare const getChaiPageType: (key: keyof typeof PAGE_TYPES) => ChaiPageType;
324
258
 
325
- export declare const getChaiPageType: (key: keyof typeof PAGE_TYPES) => ChaiBuilderPageType;
326
-
327
- export declare const getChaiPageTypes: () => ChaiBuilderPageType[];
259
+ export declare const getChaiPageTypes: () => ChaiPageType[];
328
260
 
329
261
  export declare const getDefaultBlockProps: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => Record<string, any>;
330
262
 
331
- export declare const getI18nBlockProps: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => ChaiBlockDefinition<Record<string, any>, Record<string, any>> | ChaiServerBlockDefinition<Record<string, any>, Record<string, any>> | never[];
332
-
333
- export declare const getPreImportHTML: (code: string) => Promise<string>;
263
+ export declare const getI18nBlockProps: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => never[] | ChaiBlockDefinition<Record<string, any>, Record<string, any>> | ChaiServerBlockDefinition<Record<string, any>, Record<string, any>>;
334
264
 
335
265
  export declare const getRegisteredChaiBlock: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => ChaiBlockDefinition | null;
336
266
 
337
267
  export declare const getRegisteredFont: (family: string) => ChaiFont | undefined;
338
268
 
339
- declare type HTMLString = string;
340
-
341
- export declare const IfChaiFeatureFlag: ({ flagKey, children }: {
342
- flagKey: string;
343
- children: React.ReactNode;
344
- }) => ReactNode;
345
-
346
- export declare type MediaManagerProps = {
347
- assetId?: string;
348
- close: () => void;
349
- onSelect: (assets: ChaiAsset | ChaiAsset[]) => void;
350
- mode?: "image" | "video" | "audio";
351
- };
352
-
353
- export declare const PAGE_TYPES: Record<string, ChaiBuilderPageType>;
354
-
355
- declare type PageTypeSearchResult = {
356
- id: string;
357
- name: string;
358
- slug?: string;
359
- };
360
-
361
- export declare const registerBlockSettingField: (id: string, component: React.ComponentType<any>) => void;
362
-
363
- export declare const registerBlockSettingTemplate: (id: string, component: React.ComponentType<any>) => void;
364
-
365
- export declare const registerBlockSettingWidget: (id: string, component: React.ComponentType<any>) => void;
366
-
367
- export declare const registerChaiAddBlockTab: (id: string, tab: Omit<AddBlockTab, "id">) => void;
269
+ export declare const PAGE_TYPES: Record<string, ChaiPageType>;
368
270
 
369
271
  export declare const registerChaiBlock: <T extends Record<string, any> = Record<string, any>, K extends Record<string, any> = Record<string, any>>(component: default_2.ComponentType<ChaiBlockComponentProps<T>>, options: ChaiBlockDefinitionOptions<T, K>) => void;
370
272
 
@@ -372,10 +274,6 @@ export declare const registerChaiBlockSchema: (blockSchema: ChaiBlockSchema) =>
372
274
 
373
275
  export declare function registerChaiCollection<T = Record<any, any>>(id: string, collection: Omit<CollectionConfig<T>, "id">): void;
374
276
 
375
- export declare const registerChaiFeatureFlag: (key: string, flagOptions: Omit<ChaiFlagOptions, "key">) => void;
376
-
377
- export declare const registerChaiFeatureFlags: (flags: Record<string, Omit<ChaiFlagOptions, "key">>) => void;
378
-
379
277
  export declare const registerChaiFont: (family: string, font: Omit<ChaiFont, "family">) => void;
380
278
 
381
279
  export declare const registerChaiGlobalDataProvider: <T>(globalDataProvider: (args: {
@@ -384,42 +282,16 @@ export declare const registerChaiGlobalDataProvider: <T>(globalDataProvider: (ar
384
282
  inBuilder: boolean;
385
283
  }) => Promise<T>) => void;
386
284
 
387
- export declare const registerChaiLibrary: <T extends Record<string, any> = Record<string, any>>(id: string, library: Omit<ChaiLibraryConfig<T>, "id">) => void;
388
-
389
- export declare const registerChaiMediaManager: (component: React.ComponentType<MediaManagerProps>) => void;
390
-
391
- export declare const registerChaiPageType: (key: string, pageTypeOptions: Omit<ChaiBuilderPageType, "key" | "hasSlug">) => void;
392
-
393
- export declare const registerChaiPartialType: (key: string, pageTypeOptions: Omit<ChaiBuilderPageType, "key">) => void;
394
-
395
- export declare const registerChaiPreImportHTMLHook: (fn: (code: string) => Promise<string>) => void;
285
+ export declare const registerChaiPageType: (key: string, pageTypeOptions: Omit<ChaiPageType, "key" | "hasSlug">) => void;
396
286
 
397
- export declare const registerChaiSaveToLibrary: (component: ComponentType<SaveToLibraryProps>) => void;
287
+ export declare const registerChaiPartialType: (key: string, pageTypeOptions: Omit<ChaiPageType, "key">) => void;
398
288
 
399
289
  export declare const registerChaiServerBlock: <T extends Record<string, any> = Record<string, any>, K extends Record<string, any> = Record<string, any>>(component: default_2.ComponentType<ChaiBlockComponentProps<T>>, options: Pick<ChaiBlockDefinition<T, K>, "type" | "dataProvider" | "i18nProps" | "aiProps">) => void;
400
290
 
401
- export declare const registerChaiSidebarPanel: (panelId: string, panelOptions: Omit<ChaiSidebarPanel, "id">) => void;
402
-
403
- export declare const registerChaiTopBar: (component: React.ComponentType) => void;
404
-
405
291
  declare const REGISTERED_CHAI_BLOCKS: Record<string, ChaiBlockDefinition | ChaiServerBlockDefinition>;
406
292
 
407
- export declare const resetSaveToLibrary: () => void;
408
-
409
- export declare const RJSF_EXTENSIONS: Record<string, {
410
- id: string;
411
- component: React.ComponentType<any>;
412
- type: string;
413
- }>;
414
-
415
293
  export declare const runtimeProp: (options: ChaiBlockPropSchema) => ChaiBlockPropSchema;
416
294
 
417
- export declare type SaveToLibraryProps = {
418
- blockId: string;
419
- blocks: ChaiBlock_3[];
420
- close: () => void;
421
- };
422
-
423
295
  export declare const setChaiBlockComponent: <T extends Record<string, any> = Record<string, any>>(type: keyof typeof REGISTERED_CHAI_BLOCKS, component: default_2.ComponentType<ChaiBlockComponentProps<T>>) => void;
424
296
 
425
297
  export declare const setChaiBlockDataProvider: <K extends Record<string, any> = Record<string, any>>(type: string, dataProvider: (args: {
@@ -444,30 +316,10 @@ export declare const stylesProp: (defaultClasses?: string) => ChaiBlockPropSchem
444
316
 
445
317
  export declare const syncBlocksWithDefaults: (blocks: ChaiBlock[]) => ChaiBlock[];
446
318
 
447
- export declare const useBlockSettingComponents: (type: "widget" | "field" | "template") => Record<string, React.ComponentType<any>>;
448
-
449
- export declare const useChaiAddBlockTabs: () => AddBlockTab[];
450
-
451
- export declare const useChaiFeatureFlag: (flagKey: string) => boolean;
452
-
453
- export declare const useChaiFeatureFlags: () => Record<string, ChaiFlagOptions>;
454
-
455
- export declare const useChaiLibraries: () => ChaiLibraryConfig<any>[];
456
-
457
- export declare const useChaiSidebarPanels: (position: "top" | "bottom") => ChaiSidebarPanel[];
458
-
459
- export declare const useMediaManagerComponent: () => ComponentType<MediaManagerProps>;
460
-
461
319
  export declare const useRegisteredChaiBlock: (type: keyof typeof REGISTERED_CHAI_BLOCKS) => ChaiBlockDefinition<Record<string, any>, Record<string, any>> | ChaiServerBlockDefinition<Record<string, any>, Record<string, any>> | null;
462
320
 
463
321
  export declare const useRegisteredChaiBlocks: () => Record<string, ChaiBlockDefinition<Record<string, any>, Record<string, any>> | ChaiServerBlockDefinition<Record<string, any>, Record<string, any>>>;
464
322
 
465
323
  export declare const useRegisteredFonts: () => ChaiFont[];
466
324
 
467
- export declare const useSaveToLibraryComponent: () => ComponentType<SaveToLibraryProps> | null;
468
-
469
- export declare const useToggleChaiFeatureFlag: (flagKey: string) => () => void;
470
-
471
- export declare const useTopBarComponent: () => ComponentType< {}>;
472
-
473
325
  export { }
package/dist/runtime.js CHANGED
@@ -1,74 +1,74 @@
1
- import { S as i, b as o, d as g, r as l, a as C, s as h } from "./index-Dxfyt4d4.js";
2
- import { A as n, C as p, I as u, R as B, k as d, o as P, a as k, b as S, r as m, c as T, e as F, f as b, j as L, m as y, p as A, q as f, v as I, x as D, t as R, u as v, d as _, h as E, g as x, l as M, w as O, n as H, s as G, i as N, y as j } from "./register-chai-top-bar-ESJHs5s-.js";
3
- import { b as q, C as w, P as J, a as K, g as U, d as V, f as X, e as Y, r as z, c as Q, h as Z, i as $ } from "./register-partial-type-BjtdfKHE.js";
4
- import { a as ae, g as se, r as re, u as te } from "./fonts-DRly3Wzd.js";
5
- import { s as e } from "./core-Dr7QYemB.js";
6
- import { c as oe, g as ge, a as le, b as Ce, d as he, e as ce, r as ne, f as pe, h as ue, i as Be, u as de, j as Pe } from "./core-Dr7QYemB.js";
7
- const s = e;
1
+ import { S as a } from "./STRINGS-BExFecZW.js";
2
+ import { keys as u, intersection as s, get as g, each as d, isEmpty as c, omit as h } from "lodash-es";
3
+ import { b as $, C as T, P as v, a as A, g as b, d as F, f as I, e as L, r as x, c as G, h as O, i as j } from "./register-partial-type-BjtdfKHE.js";
4
+ import { s as C } from "./core-BvsZwF26.js";
5
+ import { c as K, g as H, a as N, b as V, d as W, e as q, r as z, f as J, h as M, i as Q, u as U, j as X } from "./core-BvsZwF26.js";
6
+ import { a as ee, g as re, r as se, u as te } from "./fonts-DRly3Wzd.js";
7
+ const y = C, B = (e) => {
8
+ const i = ["_type", "_id", "_parent", "_bindings", "_name"], o = ["$loading", "blockProps", "inBuilder", "lang", "draft", "pageProps", "pageData", "children"], r = u(e.properties);
9
+ if (s(r, i).length > 0)
10
+ throw new Error(`Reserved props are not allowed: ${s(r, i).join(", ")}`);
11
+ if (s(r, o).length > 0)
12
+ throw new Error(`Runtime props are not allowed in schema: ${s(r, o).join(", ")}`);
13
+ const t = g(e, "properties", {}), n = {};
14
+ return d(t, (l, p) => {
15
+ c(l.ui) || (n[p] = { ...l.ui }, delete t[p].ui);
16
+ }), {
17
+ schema: c(t) ? {} : { ...h(e, ["ui"]) },
18
+ uiSchema: { ...g(e, "ui", {}), ...n }
19
+ };
20
+ }, k = (e = "") => (console.warn("StylesProp is deprecated, use stylesProp instead"), {
21
+ type: "string",
22
+ styles: !0,
23
+ default: `${a},${e}`,
24
+ ui: { "ui:widget": "hidden" }
25
+ }), S = (e = "") => ({
26
+ type: "string",
27
+ styles: !0,
28
+ default: `${a},${e}`,
29
+ ui: { "ui:widget": "hidden" }
30
+ }), w = (e) => (console.warn("runtimeProp is deprecated, use builderProp instead"), {
31
+ runtime: !0,
32
+ ...e
33
+ }), R = (e) => ({
34
+ builderProp: !0,
35
+ ...e
36
+ }), _ = (e) => `${a},${e}`;
8
37
  export {
9
- n as ADD_BLOCK_TABS,
10
- p as CHAI_BUILDER_PANELS,
11
- q as CHAI_GLOBAL_DATA_PROVIDER,
12
- w as COLLECTIONS,
13
- u as IfChaiFeatureFlag,
14
- J as PAGE_TYPES,
15
- B as RJSF_EXTENSIONS,
16
- i as StylesProp,
17
- o as builderProp,
18
- oe as closestBlockProp,
19
- g as defaultChaiStyles,
20
- ge as getAIBlockProps,
21
- ae as getAllRegisteredFonts,
22
- le as getBlockFormSchemas,
23
- K as getChaiCollection,
24
- U as getChaiCollections,
25
- V as getChaiGlobalData,
26
- d as getChaiLibrary,
27
- X as getChaiPageType,
28
- Y as getChaiPageTypes,
29
- Ce as getDefaultBlockProps,
30
- he as getI18nBlockProps,
31
- P as getPreImportHTML,
32
- ce as getRegisteredChaiBlock,
33
- se as getRegisteredFont,
34
- k as registerBlockSettingField,
35
- S as registerBlockSettingTemplate,
36
- m as registerBlockSettingWidget,
37
- T as registerChaiAddBlockTab,
38
- ne as registerChaiBlock,
39
- l as registerChaiBlockSchema,
40
- z as registerChaiCollection,
41
- F as registerChaiFeatureFlag,
42
- b as registerChaiFeatureFlags,
43
- re as registerChaiFont,
44
- Q as registerChaiGlobalDataProvider,
45
- L as registerChaiLibrary,
46
- y as registerChaiMediaManager,
47
- Z as registerChaiPageType,
48
- $ as registerChaiPartialType,
49
- A as registerChaiPreImportHTMLHook,
50
- f as registerChaiSaveToLibrary,
51
- pe as registerChaiServerBlock,
52
- I as registerChaiSidebarPanel,
53
- D as registerChaiTopBar,
54
- R as resetSaveToLibrary,
55
- C as runtimeProp,
56
- ue as setChaiBlockComponent,
57
- s as setChaiBlockDataProvider,
58
- e as setChaiServerBlockDataProvider,
59
- h as stylesProp,
60
- Be as syncBlocksWithDefaults,
61
- v as useBlockSettingComponents,
62
- _ as useChaiAddBlockTabs,
63
- E as useChaiFeatureFlag,
64
- x as useChaiFeatureFlags,
65
- M as useChaiLibraries,
66
- O as useChaiSidebarPanels,
67
- H as useMediaManagerComponent,
68
- de as useRegisteredChaiBlock,
69
- Pe as useRegisteredChaiBlocks,
70
- te as useRegisteredFonts,
71
- G as useSaveToLibraryComponent,
72
- N as useToggleChaiFeatureFlag,
73
- j as useTopBarComponent
38
+ $ as CHAI_GLOBAL_DATA_PROVIDER,
39
+ T as COLLECTIONS,
40
+ v as PAGE_TYPES,
41
+ k as StylesProp,
42
+ R as builderProp,
43
+ K as closestBlockProp,
44
+ _ as defaultChaiStyles,
45
+ H as getAIBlockProps,
46
+ ee as getAllRegisteredFonts,
47
+ N as getBlockFormSchemas,
48
+ A as getChaiCollection,
49
+ b as getChaiCollections,
50
+ F as getChaiGlobalData,
51
+ I as getChaiPageType,
52
+ L as getChaiPageTypes,
53
+ V as getDefaultBlockProps,
54
+ W as getI18nBlockProps,
55
+ q as getRegisteredChaiBlock,
56
+ re as getRegisteredFont,
57
+ z as registerChaiBlock,
58
+ B as registerChaiBlockSchema,
59
+ x as registerChaiCollection,
60
+ se as registerChaiFont,
61
+ G as registerChaiGlobalDataProvider,
62
+ O as registerChaiPageType,
63
+ j as registerChaiPartialType,
64
+ J as registerChaiServerBlock,
65
+ w as runtimeProp,
66
+ M as setChaiBlockComponent,
67
+ y as setChaiBlockDataProvider,
68
+ C as setChaiServerBlockDataProvider,
69
+ S as stylesProp,
70
+ Q as syncBlocksWithDefaults,
71
+ U as useRegisteredChaiBlock,
72
+ X as useRegisteredChaiBlocks,
73
+ te as useRegisteredFonts
74
74
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { B as b, z as L } from "./register-chai-top-bar-ESJHs5s-.js";
3
- import { c as j, a6 as se, a7 as ie, P as oe, az as le, ai as ce, aA as de, L as P } from "./index-RYr8kQdI.js";
4
- import { ar as D, as as G, A as _, ay as ue } from "./index-B7eWP_hB.js";
2
+ import { B as b, z as L } from "./register-chai-top-bar-CX_JkRJn.js";
3
+ import { c as j, a6 as se, a7 as ie, P as oe, az as le, ai as ce, aA as de, L as P } from "./index-mjuSGlPU.js";
4
+ import { ar as D, as as G, A as _, ay as ue } from "./index-Be9lAaD7.js";
5
5
  import { useQuery as K, useMutation as U, useQueryClient as me } from "@tanstack/react-query";
6
6
  import { toast as N } from "sonner";
7
7
  import { Trash2 as Y, Plus as pe, ImageIcon as fe, X as he, AlertCircle as ge } from "lucide-react";