@chaibuilder/sdk 4.0.0-beta.8 → 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.
- package/README.md +4 -5
- package/dist/{2SSKDMRQ-DewwiCoQ.js → 2SSKDMRQ-CdFBQR2o.js} +2 -2
- package/dist/{2SSKDMRQ-DHv4u_0i.cjs → 2SSKDMRQ-CuQ42ST6.cjs} +1 -1
- package/dist/{AP7HFJJL-cz754qhG.cjs → AP7HFJJL-DcnEb4BE.cjs} +1 -1
- package/dist/{AP7HFJJL-ComnZw7J.js → AP7HFJJL-bDlWX5Yx.js} +1 -1
- package/dist/{IconPicker-2H9IGKMS.js → IconPicker-CNwplOGy.js} +1 -1
- package/dist/{IconPicker-U0Z2dWeR.cjs → IconPicker-FpyYsxOf.cjs} +1 -1
- package/dist/STRINGS-BExFecZW.js +8 -0
- package/dist/STRINGS-FNnfjF5H.cjs +1 -0
- package/dist/{WDYDFRGG-BfRX3M58.cjs → WDYDFRGG-BxLmjulP.cjs} +1 -1
- package/dist/{WDYDFRGG-vy7nMYD4.js → WDYDFRGG-CWq7H6Qk.js} +2 -2
- package/dist/{actions-registery-CtQSSexG.cjs → actions-registery-BRgseJas.cjs} +16 -16
- package/dist/{actions-registery-DqrFhSMp.js → actions-registery-DRV8xywr.js} +180 -181
- package/dist/actions.cjs +1 -1
- package/dist/actions.d.ts +112 -51
- package/dist/actions.js +2 -2
- package/dist/{active-in-another-tab-5hn17Jeq.js → active-in-another-tab-C392ZWQc.js} +2 -2
- package/dist/{active-in-another-tab-ijahI5qu.cjs → active-in-another-tab-DEWOFgY5.cjs} +1 -1
- package/dist/{add-new-language-page-DmOyPy0u.js → add-new-language-page-BL2F_Cu7.js} +3 -3
- package/dist/{add-new-language-page-vmNKNx-e.cjs → add-new-language-page-DBWd0wDY.cjs} +1 -1
- package/dist/{add-new-page-XDuCkOyb.cjs → add-new-page-DYrQeKCi.cjs} +1 -1
- package/dist/{add-new-page-NHScAQn8.js → add-new-page-QVlyJhn9.js} +2 -2
- package/dist/{ai-panel-content-CHJ0JcQI.js → ai-panel-content-CCOluPtK.js} +3 -3
- package/dist/{ai-panel-content-BDqW16AW.cjs → ai-panel-content-DCZRBa6s.cjs} +1 -1
- package/dist/{ai-panel-default-lang-HeYWpbMu.cjs → ai-panel-default-lang-C3t0elrO.cjs} +2 -2
- package/dist/{ai-panel-default-lang-BIomgsN0.js → ai-panel-default-lang-Crz7QAxl.js} +4 -4
- package/dist/{ai-panel-other-lang-BMelEs3p.cjs → ai-panel-other-lang-BRkr4Te3.cjs} +1 -1
- package/dist/{ai-panel-other-lang-CbAgG-qX.js → ai-panel-other-lang-DIF8PYLh.js} +4 -4
- package/dist/{ai-prompt-input-BH8LOVT4.js → ai-prompt-input-D4dqy8L2.js} +1 -1
- package/dist/{ai-prompt-input-C_GG6nwq.cjs → ai-prompt-input-Ybgvrvd6.cjs} +1 -1
- package/dist/{ai-translation-prompt-CkHaFv5I.cjs → ai-translation-prompt-Ck12Bfl6.cjs} +1 -1
- package/dist/{ai-translation-prompt-DxsNw8YR.js → ai-translation-prompt-eZ4Sllva.js} +1 -1
- package/dist/{apply-binding-BvWfJCSZ.js → apply-binding-CLU6Xp4K.js} +77 -81
- package/dist/apply-binding-NvZX_rJe.cjs +1 -0
- package/dist/{code-editor-CGBAc-A6.js → code-editor-D45h29W1.js} +1 -1
- package/dist/{code-editor-GV8ibQ4h.cjs → code-editor-DH8eU4WL.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-Da8ab_9d.js → continue-editing-in-this-client-BRrIvSrl.js} +2 -2
- package/dist/{continue-editing-in-this-client-DKHP0pq8.cjs → continue-editing-in-this-client-DgZ9Q18G.cjs} +1 -1
- package/dist/core-8lkXy4lC.cjs +1 -0
- package/dist/core-BvsZwF26.js +52 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +147 -87
- package/dist/core.js +2 -2
- package/dist/{css-import-modal-CcZVLsF9.js → css-import-modal-BhLPzQH8.js} +1 -1
- package/dist/{css-import-modal-B4j26_cO.cjs → css-import-modal-C2-oVwFv.cjs} +1 -1
- package/dist/{delete-design-token-DzINIVtO.js → delete-design-token-D4Q5-Xql.js} +1 -1
- package/dist/{delete-design-token-3-WwqXMO.cjs → delete-design-token-DJSQluQ6.cjs} +1 -1
- package/dist/{delete-page-B7ODELqM.cjs → delete-page-BxbsKhY5.cjs} +1 -1
- package/dist/{delete-page-DwZDMwfI.js → delete-page-xHdZT-7c.js} +2 -2
- package/dist/{design-token-usage-DQf180Lg.js → design-token-usage-7wgmVSWI.js} +1 -1
- package/dist/{design-token-usage-Dy08kcIc.cjs → design-token-usage-KZ4pilLm.cjs} +1 -1
- package/dist/{digital-asset-manager-CDy9kHZO.js → digital-asset-manager-BmbVU7fX.js} +3 -3
- package/dist/{digital-asset-manager-C7subULa.cjs → digital-asset-manager-a1fqrQVH.cjs} +1 -1
- package/dist/{duplicate-page-DTnSztlr.js → duplicate-page-5uIno9Yh.js} +3 -3
- package/dist/{duplicate-page-CWQ9aMd9.cjs → duplicate-page-BBTxn_o1.cjs} +1 -1
- package/dist/{dynamic-page-selector-DJuxLcsM.cjs → dynamic-page-selector-C1ef0i2I.cjs} +1 -1
- package/dist/{dynamic-page-selector-DYW3ov_u.js → dynamic-page-selector-rhvhg7ol.js} +2 -2
- package/dist/{image-editor-DLeSST0K.js → image-editor-BXYZDa0s.js} +1 -1
- package/dist/{image-editor-C4H3AkZK.cjs → image-editor-rqUgAO8V.cjs} +1 -1
- package/dist/{index-D5d4QDq7.js → index-Be9lAaD7.js} +420 -422
- package/dist/index-BhqugjzS.cjs +160 -0
- package/dist/index-CNEEEgTV.cjs +5 -0
- package/dist/{index-BK0xWO1z.js → index-mjuSGlPU.js} +440 -447
- package/dist/{json-diff-viewer-g6SY62bl.cjs → json-diff-viewer-C9qmLiaq.cjs} +1 -1
- package/dist/{json-diff-viewer-BYHieVod.js → json-diff-viewer-aVwY7_hZ.js} +2 -2
- package/dist/{lang-panel-BG1GMn-1.js → lang-panel-BTWk23Mw.js} +3 -3
- package/dist/{lang-panel-Dm1eOO2J.cjs → lang-panel-Bo1ZWYfu.cjs} +1 -1
- package/dist/{manage-design-tokens-BdWQUHhw.js → manage-design-tokens-id8bylgO.js} +3 -3
- package/dist/manage-design-tokens-lUMCgjdS.cjs +1 -0
- package/dist/{mark-as-template-DUFnfVM3.cjs → mark-as-template-BYXBDXMv.cjs} +1 -1
- package/dist/{mark-as-template-D2XxagVO.js → mark-as-template-hv3WD852.js} +2 -2
- package/dist/{nested-path-selector-content-Wd6-Eql0.js → nested-path-selector-content-B8z90MFF.js} +1 -1
- package/dist/{nested-path-selector-content-CQOx2L9C.cjs → nested-path-selector-content-DgFFXcTD.cjs} +1 -1
- package/dist/{no-language-page-content-C11uF6hs.cjs → no-language-page-content-6Kk8UjFX.cjs} +1 -1
- package/dist/{no-language-page-content-BOv6TZIk.js → no-language-page-content-DMACzysm.js} +2 -2
- package/dist/{no-language-page-dialog-DIXyKRJq.js → no-language-page-dialog-D4n_XYUq.js} +2 -2
- package/dist/{no-language-page-dialog-CY5XhXsC.cjs → no-language-page-dialog-mBH-fthh.cjs} +1 -1
- package/dist/{page-creator-zSUFF4eT.cjs → page-creator-CGglYnYg.cjs} +1 -1
- package/dist/{page-creator-WX9lMrJY.js → page-creator-CgsOF0Eg.js} +3 -3
- package/dist/{page-lock-D9miLZjm.js → page-lock-CUCEBnJb.js} +2 -2
- package/dist/{page-lock-DGhR_url.cjs → page-lock-Hsi61Mk5.cjs} +1 -1
- package/dist/{page-locked-dialog-DTLnbfuP.cjs → page-locked-dialog-DSxbAMpt.cjs} +1 -1
- package/dist/{page-locked-dialog-CNCUCcvH.js → page-locked-dialog-bHvbFllT.js} +2 -2
- package/dist/{page-manager-new-Dd2c-Q_O.cjs → page-manager-new-CBfFl5rL.cjs} +1 -1
- package/dist/{page-manager-new-BFFOLh-l.js → page-manager-new-Cifc526h.js} +7 -7
- package/dist/{page-manager-search-and-filter-C1IWF_4d.js → page-manager-search-and-filter-CLJss6pV.js} +2 -2
- package/dist/{page-manager-search-and-filter-BKdQUJ2W.cjs → page-manager-search-and-filter-mEKl-UKh.cjs} +1 -1
- package/dist/{page-revisions-content-D0cflnj1.cjs → page-revisions-content-C95dQJyx.cjs} +1 -1
- package/dist/{page-revisions-content-DHapiLck.js → page-revisions-content-DvL4ya9g.js} +3 -3
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +146 -93
- package/dist/pages.js +1 -1
- package/dist/{publish-pages-content-BqLcnKry.cjs → publish-pages-content-B-6vSkql.cjs} +1 -1
- package/dist/{publish-pages-content-Bd2zJHtK.js → publish-pages-content-B8-IZW_U.js} +3 -3
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +12 -14
- package/dist/render.js +3 -3
- package/dist/{rte-widget-modal-RS8PMKOn.js → rte-widget-modal-1SbY5bcQ.js} +1 -1
- package/dist/{rte-widget-modal-DiB5BjH1.cjs → rte-widget-modal-CyKwtbOG.cjs} +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +91 -77
- package/dist/runtime.js +57 -56
- package/dist/{save-to-lib--6ZXHEbC.js → save-to-lib-BKcBfjfi.js} +2 -2
- package/dist/{save-to-lib-BXJvaC1N.cjs → save-to-lib-BmPh_Vns.cjs} +1 -1
- package/dist/{selected-block-display-CUnCqXQw.js → selected-block-display-B3hHlcLA.js} +2 -2
- package/dist/{selected-block-display-BfpJda4h.cjs → selected-block-display-BCvTNcp2.cjs} +1 -1
- package/dist/{seo-panel-Bs-FcY1A.js → seo-panel-D3EyOYij.js} +2 -2
- package/dist/{seo-panel-CQITMfZ6.cjs → seo-panel-DVClgzX9.cjs} +1 -1
- package/dist/{shared-json-ld-DDXXi-Mj.cjs → shared-json-ld-BRgJTv0m.cjs} +1 -1
- package/dist/{shared-json-ld-7EujD341.js → shared-json-ld-DSPadwbY.js} +2 -2
- package/dist/{slug-input-CsVJAr7r.cjs → slug-input-B39SPBdP.cjs} +1 -1
- package/dist/{slug-input-DoEIq5rs.js → slug-input-C3UrwSkt.js} +1 -1
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.js +1 -1
- package/dist/{take-over-request-C14kJ356.js → take-over-request-DfAlPvpE.js} +2 -2
- package/dist/{take-over-request-D5Oo3MPo.cjs → take-over-request-Tq9-gOCV.cjs} +1 -1
- package/dist/{theme-panel-footer-Dvknelm8.js → theme-panel-footer-DIy4baYU.js} +2 -2
- package/dist/{theme-panel-footer-Eeibz2JA.cjs → theme-panel-footer-DQzjVBBP.cjs} +1 -1
- package/dist/{translation-warning-modal-YlzP2XoO.js → translation-warning-modal-BHwLZZOw.js} +1 -1
- package/dist/{translation-warning-modal-CPzdHzqq.cjs → translation-warning-modal-Ckwt5Skc.cjs} +1 -1
- package/dist/types.cjs +1 -0
- package/dist/types.d.ts +598 -0
- package/dist/types.js +1 -0
- package/dist/{unmark-as-template-BGDwuCnv.cjs → unmark-as-template-BKA-sNZr.cjs} +1 -1
- package/dist/{unmark-as-template-CPJvQk7L.js → unmark-as-template-CbgifSbI.js} +2 -2
- package/dist/{unpublish-page-BMowW5wT.cjs → unpublish-page-BqzvOD76.cjs} +1 -1
- package/dist/{unpublish-page-DlFHLlmI.js → unpublish-page-DXQpAkvc.js} +2 -2
- package/dist/utils.d.ts +5 -5
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +237 -237
- package/dist/{web-preview-BUnv3jIc.js → web-preview-DH7Yv-jg.js} +1 -1
- package/dist/{web-preview-D8GQHCjs.cjs → web-preview-DShy13AM.cjs} +1 -1
- package/package.json +6 -1
- package/dist/apply-binding-IsUf6UWJ.cjs +0 -1
- package/dist/core-Dr7QYemB.js +0 -56
- package/dist/core-Y0lXLwkq.cjs +0 -1
- package/dist/index-BRJCj7c_.cjs +0 -5
- package/dist/index-Bm8iS2OH.cjs +0 -160
- package/dist/manage-design-tokens-XWs_B6jo.cjs +0 -1
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BhqugjzS.cjs"),o=require("./common-functions-B3a4xKt_.cjs"),i=require("./apply-binding-NvZX_rJe.cjs"),a=require("i18next");exports.ChaiAddBlocksDialog=e.AddBlocksDialog;exports.ChaiAddBlocksPanel=e.AddBlocksPanel;exports.ChaiAskAiUserPrompt=e.AIUserPrompt;exports.ChaiBlockAttributesEditor=e.BlockAttributesEditor;exports.ChaiBlockPropsEditor=e.BlockSettings;exports.ChaiBlockStyleEditor=e.BlockStyling;exports.ChaiBuilderCanvas=e.CanvasArea;exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiDarkModeSwitcher=e.DarkMode;exports.ChaiDefaultBlocks=e.DefaultChaiBlocks;exports.ChaiDraggableBlock=e.ChaiDraggableBlock;exports.ChaiExportCodeModal=e.ExportCodeModal;exports.ChaiImportHTML=e.ImportHTML;exports.ChaiOutline=e.ListTree;exports.ChaiScreenSizes=e.Breakpoints;exports.ChaiThemeConfigPanel=e.ThemeConfigPanel;exports.ChaiUILibrariesPanel=e.UILibrariesPanel;exports.ChaiUndoRedo=e.UndoRedo;exports.PERMISSIONS=e.PERMISSIONS;exports.getClassValueAndUnit=e.getClassValueAndUnit;exports.generateBlockId=o.generateUUID;exports.mergeClasses=o.cn;exports.convertHTMLToChaiBlocks=i.getBlocksFromHTML;exports.getBlocksFromHTML=i.getBlocksFromHTML;exports.i18n=a;
|
package/dist/core.d.ts
CHANGED
|
@@ -5,26 +5,6 @@ import { default as i18n } from 'i18next';
|
|
|
5
5
|
import { JSX } from 'react/jsx-runtime';
|
|
6
6
|
import * as React_2 from 'react';
|
|
7
7
|
|
|
8
|
-
declare type AskAiResponse = {
|
|
9
|
-
blocks?: Array<{
|
|
10
|
-
_id: string;
|
|
11
|
-
} & Partial<ChaiBlock>>;
|
|
12
|
-
usage?: Record<any, number>;
|
|
13
|
-
error?: any;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
declare type BlocksWithDesignTokens = Record<string, string>;
|
|
17
|
-
|
|
18
|
-
declare type BorderRadiusValue = false | string;
|
|
19
|
-
|
|
20
|
-
declare type Breakpoint = {
|
|
21
|
-
title: string;
|
|
22
|
-
content: string;
|
|
23
|
-
breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | string;
|
|
24
|
-
icon: default_2.ReactNode | Element;
|
|
25
|
-
width: number;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
8
|
export declare const ChaiAddBlocksDialog: () => JSX.Element;
|
|
29
9
|
|
|
30
10
|
export declare const ChaiAddBlocksPanel: ({ className, showHeading, parentId, position, fromSidebar, }: {
|
|
@@ -35,6 +15,14 @@ export declare const ChaiAddBlocksPanel: ({ className, showHeading, parentId, po
|
|
|
35
15
|
fromSidebar?: boolean;
|
|
36
16
|
}) => JSX.Element;
|
|
37
17
|
|
|
18
|
+
declare type ChaiAskAiResponse = {
|
|
19
|
+
blocks?: Array<{
|
|
20
|
+
_id: string;
|
|
21
|
+
} & Partial<ChaiBlock>>;
|
|
22
|
+
usage?: Record<any, number>;
|
|
23
|
+
error?: any;
|
|
24
|
+
};
|
|
25
|
+
|
|
38
26
|
export declare const ChaiAskAiUserPrompt: ({ blockId }: {
|
|
39
27
|
blockId: string | undefined;
|
|
40
28
|
}) => JSX.Element;
|
|
@@ -58,6 +46,16 @@ export declare function ChaiBlockPropsEditor(): JSX.Element;
|
|
|
58
46
|
|
|
59
47
|
export declare function ChaiBlockStyleEditor(): JSX.Element | null;
|
|
60
48
|
|
|
49
|
+
declare type ChaiBlocksWithDesignTokens = Record<string, string>;
|
|
50
|
+
|
|
51
|
+
declare type ChaiBreakpoint = {
|
|
52
|
+
title: string;
|
|
53
|
+
content: string;
|
|
54
|
+
breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | string;
|
|
55
|
+
icon: default_2.ReactNode | Element;
|
|
56
|
+
width: number;
|
|
57
|
+
};
|
|
58
|
+
|
|
61
59
|
export declare const ChaiBuilderCanvas: default_2.FC;
|
|
62
60
|
|
|
63
61
|
/**
|
|
@@ -77,13 +75,7 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
77
75
|
/**
|
|
78
76
|
* User
|
|
79
77
|
*/
|
|
80
|
-
user?:
|
|
81
|
-
id: string;
|
|
82
|
-
name: string;
|
|
83
|
-
email: string;
|
|
84
|
-
avatar?: string;
|
|
85
|
-
role?: string;
|
|
86
|
-
};
|
|
78
|
+
user?: ChaiUserInfo;
|
|
87
79
|
/**
|
|
88
80
|
* Permissions
|
|
89
81
|
*/
|
|
@@ -100,14 +92,10 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
100
92
|
* Theme presets
|
|
101
93
|
*/
|
|
102
94
|
themePresets?: Record<string, Partial<ChaiThemeValues>>[];
|
|
103
|
-
/**
|
|
104
|
-
* Theme options
|
|
105
|
-
*/
|
|
106
|
-
themeOptions?: (defaultThemeOptions: ChaiBuilderThemeOptions) => ChaiBuilderThemeOptions;
|
|
107
95
|
/**
|
|
108
96
|
* Theme
|
|
109
97
|
*/
|
|
110
|
-
theme?:
|
|
98
|
+
theme?: ChaiThemeValues;
|
|
111
99
|
/**
|
|
112
100
|
* Builder theme
|
|
113
101
|
*/
|
|
@@ -150,7 +138,7 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
150
138
|
/**
|
|
151
139
|
* Breakpoints
|
|
152
140
|
*/
|
|
153
|
-
breakpoints?:
|
|
141
|
+
breakpoints?: ChaiBreakpoint[];
|
|
154
142
|
/**
|
|
155
143
|
* Loading state
|
|
156
144
|
*/
|
|
@@ -162,7 +150,7 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
162
150
|
/**
|
|
163
151
|
* Ask AI callback
|
|
164
152
|
*/
|
|
165
|
-
askAiCallBack?: (type: "styles" | "content", prompt: string, blocks: ChaiBlock[], lang: string) => Promise<
|
|
153
|
+
askAiCallBack?: (type: "styles" | "content", prompt: string, blocks: ChaiBlock[], lang: string) => Promise<ChaiAskAiResponse>;
|
|
166
154
|
/**
|
|
167
155
|
* Get partial blocks
|
|
168
156
|
* @returns {Record<string, { type: string; name: string; description?: string }>}
|
|
@@ -184,7 +172,7 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
184
172
|
* onSave callback function
|
|
185
173
|
* @param saveData
|
|
186
174
|
*/
|
|
187
|
-
onSave?: ({ blocks, theme, autoSave }:
|
|
175
|
+
onSave?: ({ blocks, theme, autoSave }: ChaiSavePageData) => Promise<boolean | Error>;
|
|
188
176
|
/**
|
|
189
177
|
* onSaveStateChange callback function
|
|
190
178
|
* @param syncStatus
|
|
@@ -202,15 +190,15 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
202
190
|
/**
|
|
203
191
|
* Languages
|
|
204
192
|
*/
|
|
205
|
-
languages?:
|
|
193
|
+
languages?: string[];
|
|
206
194
|
/**
|
|
207
195
|
* Page Types props
|
|
208
196
|
*/
|
|
209
|
-
pageTypes?:
|
|
197
|
+
pageTypes?: ChaiPageType[];
|
|
210
198
|
/**
|
|
211
199
|
* Search page type items
|
|
212
200
|
*/
|
|
213
|
-
searchPageTypeItems?: (pageTypeKey: string, query: string) => Promise<
|
|
201
|
+
searchPageTypeItems?: (pageTypeKey: string, query: string) => Promise<Pick<ChaiPage_2, "id" | "slug" | "name">[] | Error>;
|
|
214
202
|
/**
|
|
215
203
|
* Collections
|
|
216
204
|
*/
|
|
@@ -240,23 +228,14 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
240
228
|
designTokens?: boolean;
|
|
241
229
|
};
|
|
242
230
|
structureRules?: StructureRule[];
|
|
243
|
-
designTokens?:
|
|
244
|
-
siteWideUsage?:
|
|
231
|
+
designTokens?: ChaiDesignTokens;
|
|
232
|
+
siteWideUsage?: ChaiSiteWideUsageData;
|
|
245
233
|
/**
|
|
246
234
|
* Screen to small message component
|
|
247
235
|
*/
|
|
248
236
|
smallScreenComponent?: ReactComponentType;
|
|
249
237
|
}
|
|
250
238
|
|
|
251
|
-
declare type ChaiBuilderThemeOptions = {
|
|
252
|
-
fontFamily: false | Record<VariableKey, string>;
|
|
253
|
-
borderRadius: BorderRadiusValue;
|
|
254
|
-
colors: false | {
|
|
255
|
-
group: string;
|
|
256
|
-
items: Record<VariableKey, [HSLColor, HSLColor]>;
|
|
257
|
-
}[];
|
|
258
|
-
};
|
|
259
|
-
|
|
260
239
|
declare type ChaiCollectoin = {
|
|
261
240
|
id: string;
|
|
262
241
|
name: string;
|
|
@@ -274,6 +253,13 @@ export declare const ChaiDefaultBlocks: ({ parentId, position, gridCols, disable
|
|
|
274
253
|
disableBlockGroupsSidebar?: boolean;
|
|
275
254
|
}) => JSX.Element;
|
|
276
255
|
|
|
256
|
+
declare interface ChaiDesignTokens {
|
|
257
|
+
[uniqueId: string]: {
|
|
258
|
+
name: string;
|
|
259
|
+
value: string;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
277
263
|
/**
|
|
278
264
|
* @component ChaiDraggableBlock
|
|
279
265
|
* @description
|
|
@@ -345,6 +331,102 @@ export declare type ChaiLibraryBlock<T = Record<string, any>> = {
|
|
|
345
331
|
|
|
346
332
|
export declare const ChaiOutline: () => JSX.Element;
|
|
347
333
|
|
|
334
|
+
declare type ChaiPage = {
|
|
335
|
+
id: string;
|
|
336
|
+
slug: string;
|
|
337
|
+
lang: string;
|
|
338
|
+
name: string;
|
|
339
|
+
pageType: string;
|
|
340
|
+
blocks: ChaiBlock[];
|
|
341
|
+
createdAt: string;
|
|
342
|
+
lastSaved: string;
|
|
343
|
+
dynamic: boolean;
|
|
344
|
+
online: boolean;
|
|
345
|
+
seo: ChaiPageSeo;
|
|
346
|
+
app: string;
|
|
347
|
+
primaryPage?: string | null;
|
|
348
|
+
currentEditor?: string | null;
|
|
349
|
+
changes: object[];
|
|
350
|
+
parent?: string | null;
|
|
351
|
+
libRefId?: string | null;
|
|
352
|
+
dynamicSlugCustom?: string | null;
|
|
353
|
+
metadata?: object;
|
|
354
|
+
jsonld?: object;
|
|
355
|
+
globalJsonLds?: string[];
|
|
356
|
+
links?: string;
|
|
357
|
+
partialBlocks?: string;
|
|
358
|
+
designTokens?: ChaiDesignTokens;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
declare interface ChaiPage_2 {
|
|
362
|
+
id: string;
|
|
363
|
+
name: string;
|
|
364
|
+
slug: string;
|
|
365
|
+
pageType: string;
|
|
366
|
+
parent: string | null;
|
|
367
|
+
children?: ChaiPage_2[];
|
|
368
|
+
isTemplate?: boolean;
|
|
369
|
+
dynamic?: boolean;
|
|
370
|
+
[key: string]: any;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
declare type ChaiPageProps<T = Record<string, any>> = {
|
|
374
|
+
slug: string;
|
|
375
|
+
searchParams?: Record<string, string>;
|
|
376
|
+
} & T;
|
|
377
|
+
|
|
378
|
+
declare type ChaiPageSeo = {
|
|
379
|
+
title?: string;
|
|
380
|
+
description?: string;
|
|
381
|
+
ogTitle?: string;
|
|
382
|
+
ogDescription?: string;
|
|
383
|
+
ogImage?: string;
|
|
384
|
+
canonicalUrl?: string;
|
|
385
|
+
noIndex?: boolean;
|
|
386
|
+
noFollow?: boolean;
|
|
387
|
+
jsonLD?: string;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
declare type ChaiPageType = {
|
|
391
|
+
key: string;
|
|
392
|
+
helpText?: string;
|
|
393
|
+
icon?: string;
|
|
394
|
+
hasSlug?: boolean;
|
|
395
|
+
name: string | (() => Promise<string>);
|
|
396
|
+
dynamicSegments?: string;
|
|
397
|
+
dynamicSlug?: string;
|
|
398
|
+
getDynamicPages?: ({ query, uuid, }: {
|
|
399
|
+
query?: string;
|
|
400
|
+
uuid?: string;
|
|
401
|
+
}) => Promise<Pick<ChaiPage, "id" | "name" | "slug" | "primaryPage">[]>;
|
|
402
|
+
search?: (query: string) => Promise<Pick<ChaiPage, "id" | "name" | "slug">[] | Error>;
|
|
403
|
+
resolveLink?: (id: string, draft?: boolean, lang?: string) => Promise<string>;
|
|
404
|
+
onCreate?: (data: Partial<ChaiPage> & {
|
|
405
|
+
id: string;
|
|
406
|
+
}) => Promise<void>;
|
|
407
|
+
onUpdate?: (data: Partial<ChaiPage> & {
|
|
408
|
+
id: string;
|
|
409
|
+
}) => Promise<void>;
|
|
410
|
+
onDelete?: (data: Pick<ChaiPage, "id">) => Promise<void>;
|
|
411
|
+
dataProvider?: (args: {
|
|
412
|
+
lang: string;
|
|
413
|
+
draft: boolean;
|
|
414
|
+
inBuilder: boolean;
|
|
415
|
+
pageProps: ChaiPageProps;
|
|
416
|
+
}) => Promise<Record<string, any>>;
|
|
417
|
+
defaultSeo?: () => Record<string, any>;
|
|
418
|
+
defaultJSONLD?: () => Record<string, any>;
|
|
419
|
+
defaultMetaTags?: () => Record<string, string>;
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
declare type ChaiSavePageData = {
|
|
423
|
+
autoSave: boolean;
|
|
424
|
+
blocks: ChaiBlock[];
|
|
425
|
+
theme?: ChaiThemeValues;
|
|
426
|
+
needTranslations?: boolean;
|
|
427
|
+
designTokens: ChaiDesignTokens;
|
|
428
|
+
};
|
|
429
|
+
|
|
348
430
|
export declare const ChaiScreenSizes: ({ openDelay, canvas, tooltip, buttonClass, activeButtonClass, }: {
|
|
349
431
|
openDelay?: number;
|
|
350
432
|
canvas?: boolean;
|
|
@@ -353,6 +435,16 @@ export declare const ChaiScreenSizes: ({ openDelay, canvas, tooltip, buttonClass
|
|
|
353
435
|
activeButtonClass?: string;
|
|
354
436
|
}) => JSX.Element;
|
|
355
437
|
|
|
438
|
+
declare interface ChaiSiteWideUsageData {
|
|
439
|
+
[pageId: string]: {
|
|
440
|
+
name: string;
|
|
441
|
+
isPartial: boolean;
|
|
442
|
+
partialBlocks: string[];
|
|
443
|
+
links: string[];
|
|
444
|
+
designTokens: ChaiBlocksWithDesignTokens;
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
|
|
356
448
|
export declare const ChaiThemeConfigPanel: React_2.FC<ThemeConfigProps>;
|
|
357
449
|
|
|
358
450
|
export declare type ChaiThemeValues = {
|
|
@@ -381,7 +473,6 @@ export declare type ChaiThemeValues = {
|
|
|
381
473
|
"card-foreground": [HexColor, HexColor];
|
|
382
474
|
popover: [HexColor, HexColor];
|
|
383
475
|
"popover-foreground": [HexColor, HexColor];
|
|
384
|
-
[key: string]: [HexColor, HexColor];
|
|
385
476
|
};
|
|
386
477
|
};
|
|
387
478
|
|
|
@@ -393,12 +484,12 @@ export declare const ChaiUILibrariesPanel: ({ parentId, position, fromSidebar, }
|
|
|
393
484
|
|
|
394
485
|
export declare const ChaiUndoRedo: () => JSX.Element;
|
|
395
486
|
|
|
396
|
-
declare
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}
|
|
487
|
+
declare type ChaiUserInfo = {
|
|
488
|
+
id: string;
|
|
489
|
+
email: string;
|
|
490
|
+
name: string;
|
|
491
|
+
avatar?: string;
|
|
492
|
+
};
|
|
402
493
|
|
|
403
494
|
declare type FilterOptions = {
|
|
404
495
|
id: string;
|
|
@@ -437,17 +528,6 @@ export { i18n }
|
|
|
437
528
|
|
|
438
529
|
export declare const mergeClasses: (...inputs: ClassValue[]) => string;
|
|
439
530
|
|
|
440
|
-
declare type PageType = {
|
|
441
|
-
key: string;
|
|
442
|
-
name: string;
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
declare type PageTypeItem = {
|
|
446
|
-
id: string;
|
|
447
|
-
name: string;
|
|
448
|
-
slug?: string;
|
|
449
|
-
};
|
|
450
|
-
|
|
451
531
|
export declare const PERMISSIONS: {
|
|
452
532
|
ADD_BLOCK: string;
|
|
453
533
|
DELETE_BLOCK: string;
|
|
@@ -465,24 +545,6 @@ export declare const PERMISSIONS: {
|
|
|
465
545
|
|
|
466
546
|
declare type ReactComponentType = default_2.ComponentType<any>;
|
|
467
547
|
|
|
468
|
-
declare type SavePageData = {
|
|
469
|
-
autoSave: boolean;
|
|
470
|
-
blocks: ChaiBlock[];
|
|
471
|
-
theme?: ChaiThemeValues;
|
|
472
|
-
needTranslations?: boolean;
|
|
473
|
-
designTokens: DesignTokens;
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
declare interface SiteWideUsage {
|
|
477
|
-
[pageId: string]: {
|
|
478
|
-
name: string;
|
|
479
|
-
isPartial: boolean;
|
|
480
|
-
partialBlocks: string[];
|
|
481
|
-
links: string[];
|
|
482
|
-
designTokens: BlocksWithDesignTokens;
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
|
|
486
548
|
declare type SortOptions = {
|
|
487
549
|
id: string;
|
|
488
550
|
name: string;
|
|
@@ -506,6 +568,4 @@ declare interface ThemeConfigProps {
|
|
|
506
568
|
className?: string;
|
|
507
569
|
}
|
|
508
570
|
|
|
509
|
-
declare type VariableKey = string;
|
|
510
|
-
|
|
511
571
|
export { }
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { aW as e, aK as i, aS as o, aX as r, aL as l, aM as t, aN as C, aI as h, aU as d, aY as c, aZ as n, a_ as k, aO as B, aP as g, aT as m, aQ as p, aR as S, aV as f, aj as u, a$ as M } from "./index-
|
|
1
|
+
import { aW as e, aK as i, aS as o, aX as r, aL as l, aM as t, aN as C, aI as h, aU as d, aY as c, aZ as n, a_ as k, aO as B, aP as g, aT as m, aQ as p, aR as S, aV as f, aj as u, a$ as M } from "./index-mjuSGlPU.js";
|
|
2
2
|
import { g as A, c as E } from "./common-functions-D2lMFR6K.js";
|
|
3
|
-
import { g as T, g as x } from "./apply-binding-
|
|
3
|
+
import { g as T, g as x } from "./apply-binding-CLU6Xp4K.js";
|
|
4
4
|
import { default as U } from "i18next";
|
|
5
5
|
export {
|
|
6
6
|
e as ChaiAddBlocksDialog,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import { B as y } from "./register-chai-top-bar-CX_JkRJn.js";
|
|
3
|
-
import { D as T, d as V, e as N, f as R, p as E, L as D, T as I, q as A } from "./index-
|
|
3
|
+
import { D as T, d as V, e as N, f as R, p as E, L as D, T as I, q as A } from "./index-mjuSGlPU.js";
|
|
4
4
|
import "lodash-es";
|
|
5
5
|
import * as b from "culori";
|
|
6
6
|
import { a as L } from "./fonts-DRly3Wzd.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("./register-chai-top-bar-DWTuRU53.cjs"),f=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("./register-chai-top-bar-DWTuRU53.cjs"),f=require("./index-BhqugjzS.cjs");require("lodash-es");const T=require("culori"),V=require("./fonts-B-Xt29pe.cjs"),N=require("react"),R=require("react-i18next");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=j(T),C=j(N),d=e=>e?e%1===0?e:e.toFixed(4):"0",q=e=>`hsl(${d(e.h)} ${d(e.s*100)}% ${d(e.l*100)}%)`,E=(e,o="hsl",t="4")=>{try{const r=b.parse(e);if(!r)throw new Error("Invalid color input");switch(o){case"hsl":{const s=b.converter("hsl")(r);return t==="4"?q(s):`${d(s.h)} ${d(s.s*100)}% ${d(s.l*100)}%`}case"rgb":return b.formatRgb(r);case"oklch":{const s=b.converter("oklch")(r);return`oklch(${d(s.l)} ${d(s.c)} ${d(s.h)})`}case"hex":return b.formatHex(r);default:return e}}catch(r){return console.error(`Failed to convert color: ${e}`,r),e}},x=e=>E(e,"hex"),I=e=>{const o={fontFamily:{heading:"",body:""},borderRadius:"",colors:{}};try{const t=w(e);if(!t.isValid)return console.warn("CSS validation failed:",t.error),$();const r=v(e,":root"),s=v(e,".dark"),c=u(r,"--font-sans")||u(r,"--font-family")||u(r,"--font-heading")||u(r,"--font-body"),a=D(c);o.fontFamily={heading:a,body:a};const h=u(r,"--radius")||u(r,"--border-radius")||"0.5rem";o.borderRadius=P(h),["background","foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","destructive","destructive-foreground","border","input","ring","card","card-foreground","popover","popover-foreground"].forEach(i=>{const p=u(r,`--${i}`),g=u(s,`--${i}`);if(p||g){const l=p?k(p):"#000000",S=g?k(g):l;o.colors[i]=[l,S]}})}catch(t){return console.error("Error parsing CSS to ChaiThemeValues:",t),$()}return o},v=(e,o)=>{var r,s;const t=new RegExp(`${F(o)}\\s*{([^}]+)}`);return((s=(r=e.match(t))==null?void 0:r[1])==null?void 0:s.trim())||null},u=(e,o)=>{var s;if(!e)return null;const t=new RegExp(`${F(o)}\\s*:\\s*([^;]+)`),r=e.match(t);return((s=r==null?void 0:r[1])==null?void 0:s.trim())||null},k=e=>{if(!e||typeof e!="string")return"#000000";try{const o=e.replace(/var\([^)]+\)/g,"").trim();if(!o)return"#000000";if(/^[a-z]+$/i.test(o))return x(o)||"#000000";if(/^#?([0-9A-F]{3,4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(o.replace(/#/g,""))){const r=o.startsWith("#")?o:`#${o}`;return r.length<=5?`#${r.slice(1).split("").map(s=>s+s).join("")}`.slice(0,7):r.length>7?r.slice(0,7):r}if(/^(rgb|hsl|oklch)a?\(/i.test(o))return x(o)||"#000000";const t=o.match(/^(\d+\.?\d*)\s+(\d+\.?\d*)%\s+(\d+\.?\d*)%$/);if(t){const[,r,s,c]=t,a=`hsl(${r} ${s}% ${c}%)`;return x(a)||"#000000"}if(/^[\d.]+[\s,]+[\d.]+[\s,]+[\d.]+(?:[\s,/]+[\d.]+)?$/.test(o)){const r=o.split(/[\s,]+/).filter(Boolean);if(r.length>=3){const c=r.some(a=>a.includes("%"))?`hsl(${r[0]} ${r[1]} ${r[2]})`:`rgb(${r[0]}, ${r[1]}, ${r[2]})`;return x(c)||"#000000"}}return x(o)||"#000000"}catch(o){return console.warn("Failed to process color:",e,o),"#000000"}},D=e=>{const o=V.getAllRegisteredFonts();if(!e)return"ui-sans-serif, system-ui, sans-serif";try{const r=e.replace(/["']/g,"").trim().split(",")[0].trim(),s=o.find(c=>c.family.toLowerCase()===r.toLowerCase());return(s==null?void 0:s.family)||"ui-sans-serif, system-ui, sans-serif"}catch(t){return console.warn("Error processing font family:",e,t),"ui-sans-serif, system-ui, sans-serif"}},P=e=>{try{const o=e.trim();if(o.endsWith("px"))return o;if(o.endsWith("rem")){const r=parseFloat(o.replace("rem",""));if(!isNaN(r))return`${Math.round(r*16)}px`}if(o.endsWith("em")){const r=parseFloat(o.replace("em",""));if(!isNaN(r))return`${Math.round(r*16)}px`}const t=parseFloat(o);return isNaN(t)?"8px":`${Math.round(t)}px`}catch(o){return console.warn("Error converting border radius to px:",e,o),"8px"}},$=()=>({fontFamily:{heading:"ui-sans-serif, system-ui, sans-serif",body:"ui-sans-serif, system-ui, sans-serif"},borderRadius:"8px",colors:{background:["#ffffff","#000000"],foreground:["#000000","#ffffff"],primary:["#3b82f6","#60a5fa"],"primary-foreground":["#ffffff","#1e293b"],secondary:["#f1f5f9","#334155"],"secondary-foreground":["#0f172a","#f8fafc"],muted:["#f8fafc","#1e293b"],"muted-foreground":["#64748b","#94a3b8"],accent:["#f1f5f9","#334155"],"accent-foreground":["#0f172a","#f8fafc"],destructive:["#ef4444","#f87171"],"destructive-foreground":["#ffffff","#1e293b"],border:["#e2e8f0","#475569"],input:["#e2e8f0","#475569"],ring:["#3b82f6","#60a5fa"],card:["#ffffff","#0f172a"],"card-foreground":["#000000","#f8fafc"],popover:["#ffffff","#0f172a"],"popover-foreground":["#000000","#f8fafc"]}}),F=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),B=e=>["background","foreground","primary","primary-foreground"].every(r=>e.colors[r]&&Array.isArray(e.colors[r])&&e.colors[r].length>=2)&&!!e.fontFamily.heading&&!!e.fontFamily.body&&!!e.borderRadius,w=e=>{if(!e||typeof e!="string")return{isValid:!1,error:"Please enter valid CSS content"};const o=e.trim();if(!o)return{isValid:!1,error:"Please enter CSS content"};try{if(!o.includes("{")||!o.includes("}"))return{isValid:!1,error:"Invalid CSS format. CSS should contain proper block structure with { }"};const t=(o.match(/{/g)||[]).length,r=(o.match(/}/g)||[]).length;return t!==r?{isValid:!1,error:"Invalid CSS format. Unmatched braces detected"}:!o.includes("--")||!o.includes(":")?{isValid:!1,error:"Invalid CSS format. CSS should contain variable definitions like --primary: #color"}:!o.includes(":root")&&!o.includes(".dark")?{isValid:!1,error:"CSS should contain at least :root or .dark selector with theme variables"}:{isValid:!0}}catch(t){return console.error("CSS validation error:",t),{isValid:!1,error:"Failed to parse CSS. Please check your syntax."}}},M=`:root {
|
|
2
2
|
--background: 0 0% 100%;
|
|
3
3
|
--foreground: oklch(0.52 0.13 144.17);
|
|
4
4
|
--primary: #3e2723;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { E as i, F as n, G as c, H as d, I as m, J as h, K as g, M as u, O as x } from "./index-
|
|
2
|
+
import { E as i, F as n, G as c, H as d, I as m, J as h, K as g, M as u, O as x } from "./index-mjuSGlPU.js";
|
|
3
3
|
import { useTranslation as D } from "react-i18next";
|
|
4
4
|
const N = ({ tokenName: l, tokenValue: s, onDelete: a, children: o }) => {
|
|
5
5
|
const { t: r } = D();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-BhqugjzS.cjs"),i=require("react-i18next"),a=({tokenName:r,tokenValue:l,onDelete:n,children:o})=>{const{t:s}=i.useTranslation();return e.jsxs(t.AlertDialog,{children:[e.jsx(t.AlertDialogTrigger,{asChild:!0,children:o}),e.jsxs(t.AlertDialogContent,{className:"max-w-md",children:[e.jsxs(t.AlertDialogHeader,{children:[e.jsxs(t.AlertDialogTitle,{className:"text-base",children:[s("Delete"),' "',r,'"?']}),e.jsx(t.AlertDialogDescription,{asChild:!0,children:e.jsxs("div",{className:"space-y-3 pt-1 text-sm",children:[e.jsx("p",{className:"text-muted-foreground",children:s("This action cannot be undone. This will permanently remove the design token from your project.")}),e.jsxs("div",{className:"rounded-md border bg-muted/50 p-3",children:[e.jsx("p",{className:"mb-1 text-xs font-medium text-foreground",children:s("Token classes")}),e.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:l})]})]})})]}),e.jsxs(t.AlertDialogFooter,{children:[e.jsx(t.AlertDialogCancel,{className:"h-7 text-xs",children:s("Cancel")}),e.jsx(t.AlertDialogAction,{onClick:n,className:"h-7 bg-destructive text-xs text-destructive-foreground hover:bg-destructive/90",children:s("Delete")})]})]})]})};exports.default=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),D=require("./register-chai-top-bar-DWTuRU53.cjs"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),D=require("./register-chai-top-bar-DWTuRU53.cjs"),n=require("./index-BhqugjzS.cjs"),o=require("./index-CNEEEgTV.cjs"),N=require("lodash-es"),v=require("react"),q=require("react-i18next"),f=(e,r)=>{const s=r.filter(u=>u.parent===e);if(s.length===0)return 0;let a=s.length;return s.forEach(u=>{a+=f(u.id,r)}),a};function A({page:e,onClose:r}){const{t:s}=q.useTranslation(),[,a]=o.useSearchParams(),{mutate:u,isPending:x}=o.useDeletePage(),{data:P}=o.usePageTypes(),{data:h=[]}=o.useWebsitePages(),{setSelectedLang:S,fallbackLang:w}=n.useLanguages(),[,C]=n.useSidebarActivePanel(),l=!(e!=null&&e.primaryPage),{data:i=[]}=o.useLanguagePages(l?e==null?void 0:e.id:void 0),j=v.useMemo(()=>!l||!i?0:i.filter(d=>d.id!==(e==null?void 0:e.id)).length,[l,i,e==null?void 0:e.id]),m=v.useMemo(()=>{if(!(e!=null&&e.id)||!h.length)return 0;let d=f(e.id,h);return l&&i&&i.length>0&&i.forEach(y=>{y.id!==e.id&&(d+=f(y.id,h))}),d},[e==null?void 0:e.id,h,l,i]),L=()=>{x||u(e,{onSuccess:()=>{e!=null&&e.primaryPage?(window.history.replaceState({},"",`/?page=${e.primaryPage}`),a(new URLSearchParams({page:e.primaryPage}))):(window.history.replaceState({},"","/"),a(new URLSearchParams)),window.dispatchEvent(new PopStateEvent("popstate")),S(w),C("outline"),r()}})},c=P==null?void 0:P.find(d=>d.key===(e==null?void 0:e.pageType));return t.jsx(n.Dialog,{open:!!e,onOpenChange:r,children:t.jsxs(n.DialogContent,{children:[t.jsxs(n.DialogHeader,{children:[t.jsx(n.DialogTitle,{children:s("Confirm Deletion")}),t.jsxs(n.DialogDescription,{className:"py-4 text-slate-500",children:[t.jsxs("div",{children:[s("Are you sure you want to remove")," ",t.jsx("b",{children:(e==null?void 0:e.name)??(e==null?void 0:e.slug)})," ",c!=null&&c.hasSlug?(c==null?void 0:c.name)+"?":s("page?")]}),l&&(j>0||m>0)&&t.jsxs("div",{className:"mt-3 rounded-md bg-red-50 p-3 text-sm",children:[t.jsxs("div",{className:"font-semibold text-red-800",children:[s("Warning: Deleting this primary page will also delete"),":"]}),t.jsxs("ul",{className:"mt-2 list-inside list-disc space-y-1 text-red-700",children:[m>0&&t.jsxs("li",{children:[t.jsx("span",{className:"font-medium",children:m})," ",s(m===1?"nested child page":"nested child pages")]}),j>0&&t.jsx("li",{children:s("All associated language pages")})]})]}),e.lang&&t.jsxs("div",{className:"py-2 text-sm",children:[s("Language"),":"," ",t.jsx("span",{className:"font-medium text-gray-500",children:N.get(o.LANGUAGES,e.lang,e.lang)})]})]})]}),t.jsxs(n.DialogFooter,{children:[t.jsx(D.Button,{variant:"outline",onClick:r,children:s("Cancel")}),t.jsx(D.Button,{variant:"destructive",disabled:x,onClick:L,children:s(x?"Deleting...":"Delete")})]})]})})}exports.default=A;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { B as v } from "./register-chai-top-bar-CX_JkRJn.js";
|
|
3
|
-
import { n as N, o as A, D as E, d as b, e as k, f as U, p as B, q as G } from "./index-
|
|
4
|
-
import { c as R, o as W, m as q, g as F, l as H, L as M } from "./index-
|
|
3
|
+
import { n as N, o as A, D as E, d as b, e as k, f as U, p as B, q as G } from "./index-mjuSGlPU.js";
|
|
4
|
+
import { c as R, o as W, m as q, g as F, l as H, L as M } from "./index-Be9lAaD7.js";
|
|
5
5
|
import { get as Q } from "lodash-es";
|
|
6
6
|
import { useMemo as w } from "react";
|
|
7
7
|
import { useTranslation as $ } from "react-i18next";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { ad as _, a as j, ae as p, n as C, Q as I, a6 as O, a7 as z, P as E } from "./index-
|
|
2
|
+
import { ad as _, a as j, ae as p, n as C, Q as I, a6 as O, a7 as z, P as E } from "./index-mjuSGlPU.js";
|
|
3
3
|
import { E as W } from "./register-chai-top-bar-CX_JkRJn.js";
|
|
4
4
|
import { ArrowRightIcon as A, FileIcon as F, GlobeIcon as M } from "@radix-ui/react-icons";
|
|
5
5
|
import { noop as R } from "lodash-es";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index-BhqugjzS.cjs"),L=require("./register-chai-top-bar-DWTuRU53.cjs"),p=require("@radix-ui/react-icons"),q=require("lodash-es"),d=require("react"),w=require("react-i18next"),x=({title:n,items:a,emptyLabel:r,onSelect:t,icon:i})=>s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:n}),a.length>0?s.jsx("div",{className:"space-y-1",children:a.map(l=>s.jsx("button",{type:"button",onClick:()=>t(l.id),className:L.cn("group flex w-full items-center justify-between rounded-md border border-transparent bg-muted/40 px-3 py-1 text-left text-xs transition","hover:border-muted-foreground/20 hover:bg-muted/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1",l.isSelected&&"border-primary/40 bg-primary/10 text-primary"),children:s.jsxs("span",{className:"flex items-center space-x-2",children:[i&&i,s.jsx("span",{className:"truncate",children:l.label})]})},l.id))}):s.jsx("div",{className:"rounded border border-dashed border-muted px-3 py-1 text-xs text-muted-foreground",children:r})]}),C="#styles:",M=n=>{const r=[typeof n._name=="string"?n._name:void 0,typeof n._type=="string"?n._type:void 0].filter(Boolean).find(t=>t.trim().length>0);return r?r.length>40?`${r.slice(0,37)}...`:r:n._id},_=(n,a)=>{const r=`${a}`;return n.filter(t=>Object.values(t).some(i=>typeof i!="string"||!i.startsWith(C)?!1:i.includes(r))).map(t=>({id:t._id,label:M(t)}))},O=({tokenId:n,tokenName:a,children:r})=>{const{t}=w.useTranslation(),[i]=o.useBlocksStore(),[l,b]=o.useSelectedBlockIds(),g=o.useBuilderProp("pageId",""),m=o.useBuilderProp("siteWideUsage",{}),h=d.useMemo(()=>_(i,n),[i,n]),P=d.useMemo(()=>h.map(e=>({id:e.id,label:e.label,isSelected:l.includes(e.id)})),[h,l]),u=d.useMemo(()=>m?Object.entries(m).reduce((e,[f,c])=>(f===g||!(c!=null&&c.designTokens)||!Object.keys(c.designTokens).some(j=>typeof j!="string"?!1:j===n)||e.push({id:f,name:c.name||f,isPartial:!!c.isPartial}),e),[]):[],[m,a,n,g]),S=d.useMemo(()=>u.filter(e=>!e.isPartial).map(e=>({id:e.id,label:e.name})),[u]),k=d.useMemo(()=>u.filter(e=>e.isPartial).map(e=>({id:e.id,label:e.name})),[u]),v=d.useCallback(e=>{b([e])},[b]),B=o.useBuilderProp("gotoPage",q.noop),{selectedLang:N,fallbackLang:T}=o.useLanguages(),{savePageAsync:I}=o.useSavePage(),y=async e=>{e&&(await I(!0),B({pageId:e,lang:N||T}))};return s.jsxs(o.Popover,{children:[s.jsx(o.PopoverTrigger,{asChild:!0,children:r}),s.jsxs(o.PopoverContent,{side:"bottom",align:"end",className:"w-80 p-0",children:[s.jsxs("div",{className:"space-y-1 px-4 py-3",children:[s.jsx("p",{className:"text-xs font-semibold",children:a}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("Usage summary for this design token across your site.")})]}),s.jsxs("div",{className:"no-scrollbar max-h-64 space-y-4 overflow-y-auto px-4 pb-4",children:[s.jsx(x,{title:t("Blocks affected on this page"),items:P,emptyLabel:t("None"),onSelect:v,icon:s.jsx(p.ArrowRightIcon,{fontSize:4})}),s.jsx(x,{title:t("Blocks affected on other pages"),items:S,emptyLabel:t("None"),onSelect:y,icon:s.jsx(p.FileIcon,{fontSize:8})}),s.jsx(x,{title:t("Blocks affected on partial blocks"),items:k,emptyLabel:t("None"),onSelect:y,icon:s.jsx(p.GlobeIcon,{fontSize:8})})]})]})]})};exports.default=O;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as H } from "react/jsx-runtime";
|
|
2
2
|
import { B as p, z as me } from "./register-chai-top-bar-CX_JkRJn.js";
|
|
3
|
-
import { L as V, T as Fe, ar as _, w as q, x as P, y as G, D as Ue, d as Le, e as $e, f as Me, p as _e, q as qe, af as Pe } from "./index-
|
|
3
|
+
import { L as V, T as Fe, ar as _, w as q, x as P, y as G, D as Ue, d as Le, e as $e, f as Me, p as _e, q as qe, af as Pe } from "./index-mjuSGlPU.js";
|
|
4
4
|
import { f as Ge, c as Oe } from "./image-compression-DsZ1oqpb.js";
|
|
5
5
|
import { find as Be, merge as Ke, pick as Y, first as Qe, isEmpty as Re } from "lodash-es";
|
|
6
6
|
import { ChevronLeft as ue, ChevronRight as We, Loader as B, AlertCircle as Ve, Copy as he, Pencil as He, Link as Xe, Search as Ze, RefreshCwIcon as Je, Archive as Ye, Film as et, ImageIcon as tt, Edit as it, Trash2 as at, Check as lt, Upload as rt, AlertTriangle as nt } from "lucide-react";
|
|
@@ -10,7 +10,7 @@ import { ErrorBoundary as ot } from "react-error-boundary";
|
|
|
10
10
|
import { useTranslation as ee } from "react-i18next";
|
|
11
11
|
import { toast as A } from "sonner";
|
|
12
12
|
import { useQueryClient as te, useMutation as ie, useQuery as ge } from "@tanstack/react-query";
|
|
13
|
-
import { ar as K, as as Q, A as b } from "./index-
|
|
13
|
+
import { ar as K, as as Q, A as b } from "./index-Be9lAaD7.js";
|
|
14
14
|
import { c as xe } from "./common-functions-D2lMFR6K.js";
|
|
15
15
|
const dt = () => {
|
|
16
16
|
const s = K(), n = te(), h = Q();
|
|
@@ -385,7 +385,7 @@ const xt = ({ assetId: s, onBack: n, onEdit: h, onSave: a, isSaving: c }) => {
|
|
|
385
385
|
] })
|
|
386
386
|
] })
|
|
387
387
|
] });
|
|
388
|
-
}, vt = fe.lazy(() => import("./image-editor-
|
|
388
|
+
}, vt = fe.lazy(() => import("./image-editor-BXYZDa0s.js")), yt = 25 * 1024 * 1024, Nt = ({ isUpdatingAsset: s, allowedTypes: n, uploadAssets: h, isUploadingAsset: a, onUploaded: c }) => {
|
|
389
389
|
const { t: i } = ee(), [l, I] = y(() => {
|
|
390
390
|
const o = localStorage.getItem("chai_optimize_images");
|
|
391
391
|
return o !== null ? o === "true" : !0;
|