@chaibuilder/sdk 4.0.0-beta.1 → 4.0.0-beta.3
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 +27 -20
- package/dist/2SSKDMRQ-BnsZi3K3.cjs +1 -0
- package/dist/2SSKDMRQ-CnSDkQcy.js +42 -0
- package/dist/AP7HFJJL-B31839PG.cjs +1228 -0
- package/dist/AP7HFJJL-CymCmW14.js +9214 -0
- package/dist/IconPicker-B1rWC-Ex.js +59 -0
- package/dist/IconPicker-DREyo007.cjs +1 -0
- package/dist/WDYDFRGG-BUVnbAci.js +33 -0
- package/dist/WDYDFRGG-BxhOCHc3.cjs +1 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
- package/dist/actions-registery-CZ1w0NKa.js +15545 -0
- package/dist/actions-registery-YnFmU21O.cjs +418 -0
- package/dist/actions.cjs +1 -0
- package/dist/actions.d.ts +3202 -0
- package/dist/actions.js +216 -0
- package/dist/active-in-another-tab-B47YjQGN.cjs +1 -0
- package/dist/active-in-another-tab-CyjngVA6.js +34 -0
- package/dist/add-new-language-page-88xzrUy8.cjs +1 -0
- package/dist/add-new-language-page-WmlCnytQ.js +401 -0
- package/dist/add-new-page-VW2wAYZp.js +31 -0
- package/dist/add-new-page-soZ8GAkN.cjs +1 -0
- package/dist/ai-panel-content-7zCil042.cjs +1 -0
- package/dist/ai-panel-content-D_o7Q_A-.js +61 -0
- package/dist/ai-panel-default-lang-COYaxNwn.cjs +3 -0
- package/dist/ai-panel-default-lang-DnElspF0.js +341 -0
- package/dist/ai-panel-other-lang-CkynNlAU.cjs +1 -0
- package/dist/ai-panel-other-lang-Dp0E9_Hx.js +162 -0
- package/dist/ai-prompt-input-Bhc0ds7X.js +655 -0
- package/dist/ai-prompt-input-CThbVp0_.cjs +1 -0
- package/dist/ai-translation-prompt-C2kJQFDX.cjs +1 -0
- package/dist/ai-translation-prompt-CZ55HQmo.js +28 -0
- package/dist/apply-binding-6iwlED02.js +833 -0
- package/dist/apply-binding-KKp5PnpZ.cjs +1 -0
- package/dist/code-display-BnqzqzoP.cjs +1 -0
- package/dist/{code-display-337R7Dev.js → code-display-DhD_RBcg.js} +1 -1
- package/dist/code-editor-DRIAnNbb.js +50 -0
- package/dist/code-editor-o3___nu2.cjs +1 -0
- package/dist/common-functions-B3a4xKt_.cjs +1 -0
- package/dist/common-functions-D2lMFR6K.js +13 -0
- package/dist/continue-editing-in-this-client-CS2aQ7yY.js +24 -0
- package/dist/continue-editing-in-this-client-CtMYsk-A.cjs +1 -0
- package/dist/core-BoRDjj4h.cjs +1 -0
- package/dist/core-yvI6kCyw.js +56 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +51 -383
- package/dist/core.js +39 -106
- package/dist/{css-import-modal-DA2L6kwP.js → css-import-modal-Byg6wV0O.js} +36 -36
- package/dist/css-import-modal-CyqkXWCO.cjs +13 -0
- package/dist/delete-design-token-BRZZiWtQ.js +40 -0
- package/dist/delete-design-token-DkVs1oBf.cjs +1 -0
- package/dist/delete-page-BzyX9TN-.js +70 -0
- package/dist/delete-page-DxX7PFIE.cjs +1 -0
- package/dist/design-token-usage-CAHzEGgJ.cjs +1 -0
- package/dist/design-token-usage-xQs6SlaJ.js +113 -0
- package/dist/digital-asset-manager--uO8Agia.cjs +1 -0
- package/dist/digital-asset-manager-DbtwzxRz.js +876 -0
- package/dist/duplicate-page-BR7Dlo9d.js +133 -0
- package/dist/duplicate-page-CaNAbXwV.cjs +1 -0
- package/dist/dynamic-page-selector-Cb5r_W8s.js +85 -0
- package/dist/dynamic-page-selector-Cxk_gjni.cjs +1 -0
- package/dist/fonts-B-Xt29pe.cjs +1 -0
- package/dist/fonts-DRly3Wzd.js +78 -0
- package/dist/{get-chai-builder-tailwind-config-C6MHaUM0.cjs → get-chai-builder-tailwind-config-B9rCyiQo.cjs} +1 -1
- package/dist/{get-chai-builder-tailwind-config-BqaIvg8p.js → get-chai-builder-tailwind-config-DjoVOuAf.js} +13 -10
- package/dist/{get-chai-builder-theme-D0IsUvK4.js → get-chai-builder-theme-BYtp20KD.js} +4 -4
- package/dist/get-chai-builder-theme-Dl72X7cz.cjs +1 -0
- package/dist/get-seo-defaults-9zHebckY.js +65 -0
- package/dist/get-seo-defaults-Cw7vFt-B.cjs +1 -0
- package/dist/image-compression-DZ9WMmyn.cjs +1 -0
- package/dist/image-compression-DsZ1oqpb.js +37 -0
- package/dist/image-editor-DV8kUKhl.js +108 -0
- package/dist/image-editor-G-K28aTS.cjs +1 -0
- package/dist/index-B-rSiAp_.cjs +1 -0
- package/dist/index-Ct7ElCGK.js +19069 -0
- package/dist/index-DF5DEvqb.cjs +160 -0
- package/dist/index-Dxfyt4d4.js +39 -0
- package/dist/index-WQwzsC7A.cjs +5 -0
- package/dist/index-ZuacEL1j.js +4732 -0
- package/dist/json-diff-viewer-D7z4zNvv.cjs +8 -0
- package/dist/json-diff-viewer-krslPepD.js +258 -0
- package/dist/lang-panel-BwIewMyw.js +215 -0
- package/dist/lang-panel-DT96k1xg.cjs +1 -0
- package/dist/manage-design-tokens-Caz_20VK.js +240 -0
- package/dist/manage-design-tokens-CrmLe7UT.cjs +1 -0
- package/dist/mark-as-template-D295ZQtU.js +156 -0
- package/dist/mark-as-template-W3LmpiqN.cjs +1 -0
- package/dist/models-5gOsRC56.cjs +1 -0
- package/dist/models-D95ZYr_x.js +70 -0
- package/dist/nested-path-selector-content-CKYYK-C5.js +87 -0
- package/dist/nested-path-selector-content-CoS_d3dc.cjs +1 -0
- package/dist/no-language-page-content-BvqRBP6y.js +42 -0
- package/dist/no-language-page-content-DkfeMl90.cjs +1 -0
- package/dist/no-language-page-dialog-BcEoqyQB.cjs +1 -0
- package/dist/no-language-page-dialog-PjNqTUpl.js +10 -0
- package/dist/page-creator-C4gc5NSC.cjs +1 -0
- package/dist/page-creator-DiOITEMw.js +795 -0
- package/dist/page-lock-BdYmCks0.cjs +1 -0
- package/dist/page-lock-Bfbs6RgL.js +30 -0
- package/dist/page-locked-dialog-B1FAtK92.cjs +1 -0
- package/dist/page-locked-dialog-B6MKTRfY.js +133 -0
- package/dist/page-manager-new-CHDueBDk.cjs +1 -0
- package/dist/page-manager-new-CzX22g2n.js +394 -0
- package/dist/page-manager-search-and-filter-CM0UMb6U.js +201 -0
- package/dist/page-manager-search-and-filter-DkkRIH86.cjs +1 -0
- package/dist/page-revisions-content-ChY-4f2V.cjs +1 -0
- package/dist/page-revisions-content-NH9JK4Ey.js +445 -0
- package/dist/pages.cjs +1 -0
- package/dist/pages.d.ts +491 -0
- package/dist/pages.js +27 -0
- package/dist/plugin-3ZKK6RXm.js +245 -0
- package/dist/plugin-C6rgJDNQ.cjs +22 -0
- package/dist/publish-pages-content-D9aixMN5.js +178 -0
- package/dist/publish-pages-content-x-JuSFJ9.cjs +1 -0
- package/dist/register-partial-type-BjtdfKHE.js +36 -0
- package/dist/register-partial-type-ig9fUWIJ.cjs +1 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +26 -13
- package/dist/render.js +130 -124
- package/dist/rte-widget-modal-BaHIuEjF.cjs +1 -0
- package/dist/rte-widget-modal-DOJEXLIf.js +38 -0
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +306 -7
- package/dist/runtime.js +44 -1
- package/dist/save-to-lib-Cgpxw8-g.cjs +1 -0
- package/dist/save-to-lib-eiOc_SSN.js +422 -0
- package/dist/sdk.css +1 -1
- package/dist/selected-block-display-BgRY82CT.cjs +16 -0
- package/dist/selected-block-display-CBFePS19.js +319 -0
- package/dist/seo-panel-C1-iMOR1.js +798 -0
- package/dist/seo-panel-DfAb8U7W.cjs +2 -0
- package/dist/shared-json-ld-B4PxAM_0.js +565 -0
- package/dist/shared-json-ld-DzG398hr.cjs +1 -0
- package/dist/slug-input-AwNJs9im.js +86 -0
- package/dist/slug-input-C_ijLQ_X.cjs +1 -0
- package/dist/supabase-actions.cjs +1 -0
- package/dist/supabase-actions.d.ts +284 -0
- package/dist/supabase-actions.js +524 -0
- package/dist/take-over-request-BNxcjY2j.cjs +1 -0
- package/dist/take-over-request-C4FeDtN_.js +63 -0
- package/dist/theme-panel-footer-Cq9pljro.cjs +1 -0
- package/dist/theme-panel-footer-uBQqSJXm.js +25 -0
- package/dist/translation-warning-modal-B64YqlbI.js +26 -0
- package/dist/translation-warning-modal-BZAcwM2_.cjs +1 -0
- package/dist/unmark-as-template-CZ9sQp_P.js +39 -0
- package/dist/unmark-as-template-EVvk0vmp.cjs +1 -0
- package/dist/unpublish-page-D4VwOlxc.js +27 -0
- package/dist/unpublish-page-bdSmwAVQ.cjs +1 -0
- package/dist/use-page-expand-manager-B6XTvk0E.cjs +1 -0
- package/dist/use-page-expand-manager-Cf4MUEJw.js +85 -0
- package/dist/{tailwind.cjs → utils.cjs} +1 -1
- package/dist/{tailwind.d.ts → utils.d.ts} +12 -11
- package/dist/utils.js +7 -0
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.d.ts +0 -6
- package/dist/web-blocks.js +248 -241
- package/dist/web-preview-Cio70gk5.cjs +1 -0
- package/dist/web-preview-Djy6WIyj.js +73 -0
- package/package.json +175 -105
- package/dist/IconPicker-CGWn9C4u.cjs +0 -1
- package/dist/IconPicker-QvxJ-4Ez.js +0 -64
- package/dist/apply-binding-DCno1xQL.js +0 -711
- package/dist/apply-binding-DvHNFLQD.cjs +0 -1
- package/dist/code-display-BZ1x7SqI.cjs +0 -1
- package/dist/code-editor-B28LoECM.cjs +0 -1
- package/dist/code-editor-CfG2FhJ-.js +0 -58
- package/dist/common-functions-BGzDsf1z.js +0 -14
- package/dist/common-functions-BZmyleS1.cjs +0 -1
- package/dist/css-import-modal-CENUYvcl.cjs +0 -13
- package/dist/get-chai-builder-theme-Ck_Z4Q-M.cjs +0 -1
- package/dist/index-CaGNHF7f.js +0 -12209
- package/dist/index-Gn6pJt2v.cjs +0 -166
- package/dist/mockServiceWorker.js +0 -307
- package/dist/plugin-B5627hMN.js +0 -195
- package/dist/plugin-UxTRfDum.cjs +0 -22
- package/dist/rte-widget-modal-DL739qeQ.cjs +0 -1
- package/dist/rte-widget-modal-Dte0od04.js +0 -41
- package/dist/tailwind.js +0 -7
- package/dist/tooltip-A4qGk781.cjs +0 -1
- package/dist/tooltip-tLiIOgjq.js +0 -1067
- package/dist/ui.cjs +0 -1
- package/dist/ui.d.ts +0 -415
- package/dist/ui.js +0 -129
- package/dist/vite.svg +0 -1
package/dist/pages.d.ts
ADDED
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
5
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
6
|
+
|
|
7
|
+
declare type AskAiResponse = {
|
|
8
|
+
blocks?: Array<{
|
|
9
|
+
_id: string;
|
|
10
|
+
} & Partial<ChaiBlock>>;
|
|
11
|
+
usage?: Record<any, number>;
|
|
12
|
+
error?: any;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
declare type BlocksWithDesignTokens = Record<string, string>;
|
|
16
|
+
|
|
17
|
+
declare type BorderRadiusValue = false | string;
|
|
18
|
+
|
|
19
|
+
declare type Breakpoint = {
|
|
20
|
+
title: string;
|
|
21
|
+
content: string;
|
|
22
|
+
breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | string;
|
|
23
|
+
icon: default_2.ReactNode | Element;
|
|
24
|
+
width: number;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
declare type ChaiBlock<T = Record<string, any>> = {
|
|
28
|
+
_id: string;
|
|
29
|
+
_name?: string;
|
|
30
|
+
_parent?: string | null | undefined;
|
|
31
|
+
_type: string;
|
|
32
|
+
_libBlock?: string;
|
|
33
|
+
} & T;
|
|
34
|
+
|
|
35
|
+
declare interface ChaiBuilderEditorProps {
|
|
36
|
+
children?: default_2.ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Goto page callback
|
|
39
|
+
*/
|
|
40
|
+
gotoPage?: ({ pageId, lang }: {
|
|
41
|
+
pageId: string;
|
|
42
|
+
lang: string;
|
|
43
|
+
}) => void;
|
|
44
|
+
/**
|
|
45
|
+
* User
|
|
46
|
+
*/
|
|
47
|
+
user?: {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
email: string;
|
|
51
|
+
avatar?: string;
|
|
52
|
+
role?: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Permissions
|
|
56
|
+
*/
|
|
57
|
+
permissions?: string[];
|
|
58
|
+
/**
|
|
59
|
+
* Optional pageId. If not provided, a random pageId will be generated
|
|
60
|
+
*/
|
|
61
|
+
pageId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Page external data
|
|
64
|
+
*/
|
|
65
|
+
pageExternalData?: Record<string, any>;
|
|
66
|
+
/**
|
|
67
|
+
* Theme presets
|
|
68
|
+
*/
|
|
69
|
+
themePresets?: Record<string, Partial<ChaiThemeValues>>[];
|
|
70
|
+
/**
|
|
71
|
+
* Theme options
|
|
72
|
+
*/
|
|
73
|
+
themeOptions?: (defaultThemeOptions: ChaiBuilderThemeOptions) => ChaiBuilderThemeOptions;
|
|
74
|
+
/**
|
|
75
|
+
* Theme
|
|
76
|
+
*/
|
|
77
|
+
theme?: Partial<ChaiThemeValues>;
|
|
78
|
+
/**
|
|
79
|
+
* Builder theme
|
|
80
|
+
*/
|
|
81
|
+
builderTheme?: ChaiThemeValues;
|
|
82
|
+
/**
|
|
83
|
+
* Theme panel component
|
|
84
|
+
* TODO: Move to registerChaiThemePanelComponent()
|
|
85
|
+
*/
|
|
86
|
+
themePanelComponent?: ReactComponentType;
|
|
87
|
+
/**
|
|
88
|
+
* onError callback function
|
|
89
|
+
* @param error
|
|
90
|
+
*/
|
|
91
|
+
onError?: (error: Error) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Translations object
|
|
94
|
+
*/
|
|
95
|
+
translations?: Record<string, Record<string, any>>;
|
|
96
|
+
/**
|
|
97
|
+
* Custom layout component
|
|
98
|
+
* TODO: Move to registerChaiLayoutComponent()
|
|
99
|
+
*/
|
|
100
|
+
layout?: default_2.ComponentType;
|
|
101
|
+
/**
|
|
102
|
+
* HTML direction.
|
|
103
|
+
*/
|
|
104
|
+
htmlDir?: "ltr" | "rtl";
|
|
105
|
+
/**
|
|
106
|
+
* Show debug logs
|
|
107
|
+
*/
|
|
108
|
+
debugLogs?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Auto save support
|
|
111
|
+
*/
|
|
112
|
+
autoSave?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Auto save interval in seconds
|
|
115
|
+
*/
|
|
116
|
+
autoSaveActionsCount?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Breakpoints
|
|
119
|
+
*/
|
|
120
|
+
breakpoints?: Breakpoint[];
|
|
121
|
+
/**
|
|
122
|
+
* Loading state
|
|
123
|
+
*/
|
|
124
|
+
loading?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Locale
|
|
127
|
+
*/
|
|
128
|
+
locale?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Ask AI callback
|
|
131
|
+
*/
|
|
132
|
+
askAiCallBack?: (type: "styles" | "content", prompt: string, blocks: ChaiBlock[], lang: string) => Promise<AskAiResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* Get partial blocks
|
|
135
|
+
* @returns {Record<string, { type: string; name: string; description?: string }>}
|
|
136
|
+
*/
|
|
137
|
+
getPartialBlocks?: () => Promise<Record<string, {
|
|
138
|
+
type: string;
|
|
139
|
+
name: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
}>>;
|
|
142
|
+
/**
|
|
143
|
+
* Get all blocks of a partial block
|
|
144
|
+
*/
|
|
145
|
+
getPartialBlockBlocks?: (partialBlockKey: string) => Promise<ChaiBlock[]>;
|
|
146
|
+
/**
|
|
147
|
+
* Blocks for the page
|
|
148
|
+
*/
|
|
149
|
+
blocks?: ChaiBlock[];
|
|
150
|
+
/**
|
|
151
|
+
* onSave callback function
|
|
152
|
+
* @param saveData
|
|
153
|
+
*/
|
|
154
|
+
onSave?: ({ blocks, theme, autoSave }: SavePageData) => Promise<boolean | Error>;
|
|
155
|
+
/**
|
|
156
|
+
* onSaveStateChange callback function
|
|
157
|
+
* @param syncStatus
|
|
158
|
+
*/
|
|
159
|
+
onSaveStateChange?: (syncStatus: "SAVED" | "SAVING" | "UNSAVED") => void;
|
|
160
|
+
/**
|
|
161
|
+
* Preview component
|
|
162
|
+
* TODO: Move to registerChaiPreviewComponent()
|
|
163
|
+
*/
|
|
164
|
+
previewComponent?: ReactComponentType;
|
|
165
|
+
/**
|
|
166
|
+
* Content locale
|
|
167
|
+
*/
|
|
168
|
+
fallbackLang?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Languages
|
|
171
|
+
*/
|
|
172
|
+
languages?: Array<string>;
|
|
173
|
+
/**
|
|
174
|
+
* Page Types props
|
|
175
|
+
*/
|
|
176
|
+
pageTypes?: PageType[];
|
|
177
|
+
/**
|
|
178
|
+
* Search page type items
|
|
179
|
+
*/
|
|
180
|
+
searchPageTypeItems?: (pageTypeKey: string, query: string) => Promise<PageTypeItem[] | Error>;
|
|
181
|
+
/**
|
|
182
|
+
* Collections
|
|
183
|
+
*/
|
|
184
|
+
collections?: ChaiCollectoin[];
|
|
185
|
+
/**
|
|
186
|
+
* Get Block Async Props
|
|
187
|
+
*/
|
|
188
|
+
getBlockAsyncProps?: (args: {
|
|
189
|
+
block: ChaiBlock;
|
|
190
|
+
}) => Promise<{
|
|
191
|
+
[key: string]: any;
|
|
192
|
+
}>;
|
|
193
|
+
/**
|
|
194
|
+
* temporary props. Not to be used in production
|
|
195
|
+
*/
|
|
196
|
+
flags?: {
|
|
197
|
+
librarySite?: boolean;
|
|
198
|
+
copyPaste?: boolean;
|
|
199
|
+
exportCode?: boolean;
|
|
200
|
+
darkMode?: boolean;
|
|
201
|
+
dataBinding?: boolean;
|
|
202
|
+
importHtml?: boolean;
|
|
203
|
+
importTheme?: boolean;
|
|
204
|
+
gotoSettings?: boolean;
|
|
205
|
+
dragAndDrop?: boolean;
|
|
206
|
+
validateStructure?: boolean;
|
|
207
|
+
designTokens?: boolean;
|
|
208
|
+
};
|
|
209
|
+
structureRules?: StructureRule[];
|
|
210
|
+
designTokens?: DesignTokens;
|
|
211
|
+
siteWideUsage?: SiteWideUsage;
|
|
212
|
+
/**
|
|
213
|
+
* Screen to small message component
|
|
214
|
+
*/
|
|
215
|
+
smallScreenComponent?: ReactComponentType;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare type ChaiBuilderThemeOptions = {
|
|
219
|
+
fontFamily: false | Record<VariableKey, string>;
|
|
220
|
+
borderRadius: BorderRadiusValue;
|
|
221
|
+
colors: false | {
|
|
222
|
+
group: string;
|
|
223
|
+
items: Record<VariableKey, [HSLColor, HSLColor]>;
|
|
224
|
+
}[];
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
declare type ChaiCollectoin = {
|
|
228
|
+
id: string;
|
|
229
|
+
name: string;
|
|
230
|
+
description?: string;
|
|
231
|
+
filters?: FilterOptions[];
|
|
232
|
+
sorts?: SortOptions[];
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
export declare const ChaiJsonInput: React.FC<SmartJsonInputProps>;
|
|
236
|
+
|
|
237
|
+
declare type ChaiThemeValues = {
|
|
238
|
+
fontFamily: {
|
|
239
|
+
heading: string;
|
|
240
|
+
body: string;
|
|
241
|
+
};
|
|
242
|
+
borderRadius: string;
|
|
243
|
+
colors: {
|
|
244
|
+
background: [HexColor, HexColor];
|
|
245
|
+
foreground: [HexColor, HexColor];
|
|
246
|
+
primary: [HexColor, HexColor];
|
|
247
|
+
"primary-foreground": [HexColor, HexColor];
|
|
248
|
+
secondary: [HexColor, HexColor];
|
|
249
|
+
"secondary-foreground": [HexColor, HexColor];
|
|
250
|
+
muted: [HexColor, HexColor];
|
|
251
|
+
"muted-foreground": [HSLColor, HSLColor];
|
|
252
|
+
accent: [HSLColor, HSLColor];
|
|
253
|
+
"accent-foreground": [HSLColor, HSLColor];
|
|
254
|
+
destructive: [HSLColor, HSLColor];
|
|
255
|
+
"destructive-foreground": [HSLColor, HSLColor];
|
|
256
|
+
border: [HSLColor, HSLColor];
|
|
257
|
+
input: [HSLColor, HSLColor];
|
|
258
|
+
ring: [HexColor, HexColor];
|
|
259
|
+
card: [HexColor, HexColor];
|
|
260
|
+
"card-foreground": [HexColor, HexColor];
|
|
261
|
+
popover: [HexColor, HexColor];
|
|
262
|
+
"popover-foreground": [HexColor, HexColor];
|
|
263
|
+
[key: string]: [HexColor, HexColor];
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export declare const ChaiWebsiteBuilder: (props: ChaiWebsiteBuilderProps) => JSX.Element;
|
|
268
|
+
|
|
269
|
+
declare type ChaiWebsiteBuilderProps = {
|
|
270
|
+
hasReactQueryProvider?: boolean;
|
|
271
|
+
topLeftCorner?: React.FC;
|
|
272
|
+
apiUrl?: string;
|
|
273
|
+
getPreviewUrl?: (slug: string) => string;
|
|
274
|
+
getLiveUrl?: (slug: string) => string;
|
|
275
|
+
onLogout?: () => void;
|
|
276
|
+
getAccessToken?: () => Promise<string>;
|
|
277
|
+
currentUser: LoggedInUser | null;
|
|
278
|
+
websocket?: any;
|
|
279
|
+
features?: {
|
|
280
|
+
sharedJsonLD?: boolean;
|
|
281
|
+
canResetSeoToDefault?: boolean;
|
|
282
|
+
} & Record<string, boolean>;
|
|
283
|
+
} & Pick<ChaiBuilderEditorProps, "onError" | "translations" | "locale" | "htmlDir" | "autoSave" | "autoSaveActionsCount" | "fallbackLang" | "languages" | "themePresets" | "flags" | "structureRules">;
|
|
284
|
+
|
|
285
|
+
declare type ChaiWebsiteSetting = {
|
|
286
|
+
appKey: string;
|
|
287
|
+
fallbackLang: string;
|
|
288
|
+
languages: string[];
|
|
289
|
+
theme: Record<"fontFamily" | "borderRadius" | "colors", any>;
|
|
290
|
+
designTokens: DesignTokens_2;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
declare interface DesignTokens {
|
|
294
|
+
[uniqueId: string]: {
|
|
295
|
+
name: string;
|
|
296
|
+
value: string;
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
declare type DesignTokens_2 = {
|
|
301
|
+
[token: string]: {
|
|
302
|
+
value: string;
|
|
303
|
+
name: string;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
declare type FilterOptions = {
|
|
308
|
+
id: string;
|
|
309
|
+
name: string;
|
|
310
|
+
description?: string;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
declare type HexColor = string;
|
|
314
|
+
|
|
315
|
+
declare type HSLColor = string;
|
|
316
|
+
|
|
317
|
+
export declare const ImagePicker: default_2.FC<ImagePickerProps>;
|
|
318
|
+
|
|
319
|
+
declare interface ImagePickerProps {
|
|
320
|
+
assetId?: string;
|
|
321
|
+
assetUrl?: string;
|
|
322
|
+
onChange: (value: {
|
|
323
|
+
url: string;
|
|
324
|
+
id: string;
|
|
325
|
+
}) => void;
|
|
326
|
+
className?: string;
|
|
327
|
+
placeholder?: string;
|
|
328
|
+
disabled?: boolean;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export declare const LanguageSwitcher: ({ showAdd, variant, goToDefaultLang, }: {
|
|
332
|
+
showAdd?: boolean;
|
|
333
|
+
variant?: "ghost" | "outline";
|
|
334
|
+
goToDefaultLang?: boolean;
|
|
335
|
+
}) => JSX.Element;
|
|
336
|
+
|
|
337
|
+
declare type LoggedInUser = {
|
|
338
|
+
id: string;
|
|
339
|
+
email: string;
|
|
340
|
+
name: string;
|
|
341
|
+
avatar?: string;
|
|
342
|
+
metadata?: Record<string, any>;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
export declare function NestedPathSelector({ data, onSelect, dataType, disabled }: NestedPathSelectorProps): JSX.Element;
|
|
346
|
+
|
|
347
|
+
declare type NestedPathSelectorProps = {
|
|
348
|
+
data: Record<string, any>;
|
|
349
|
+
onSelect: (path: string) => void;
|
|
350
|
+
dataType?: "value" | "array" | "object";
|
|
351
|
+
disabled?: boolean;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
declare type PageType = {
|
|
355
|
+
key: string;
|
|
356
|
+
name: string;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
declare type PageTypeItem = {
|
|
360
|
+
id: string;
|
|
361
|
+
name: string;
|
|
362
|
+
slug?: string;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
export declare const PermissionChecker: ({ permission, permissions, children, fallback, }: {
|
|
366
|
+
permission?: string;
|
|
367
|
+
permissions?: string[];
|
|
368
|
+
fallback?: React.ReactNode;
|
|
369
|
+
children: React.ReactNode;
|
|
370
|
+
}) => ReactNode;
|
|
371
|
+
|
|
372
|
+
declare type ReactComponentType = default_2.ComponentType<any>;
|
|
373
|
+
|
|
374
|
+
declare type SavePageData = {
|
|
375
|
+
autoSave: boolean;
|
|
376
|
+
blocks: ChaiBlock[];
|
|
377
|
+
theme?: ChaiThemeValues;
|
|
378
|
+
needTranslations?: boolean;
|
|
379
|
+
designTokens: DesignTokens;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
declare interface SiteWideUsage {
|
|
383
|
+
[pageId: string]: {
|
|
384
|
+
name: string;
|
|
385
|
+
isPartial: boolean;
|
|
386
|
+
partialBlocks: string[];
|
|
387
|
+
links: string[];
|
|
388
|
+
designTokens: BlocksWithDesignTokens;
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
declare interface SmartJsonInputProps {
|
|
393
|
+
value: string;
|
|
394
|
+
onChange: (value: string) => void;
|
|
395
|
+
disabled?: boolean;
|
|
396
|
+
readOnly?: boolean;
|
|
397
|
+
placeholder?: string;
|
|
398
|
+
rows?: number;
|
|
399
|
+
id?: string;
|
|
400
|
+
pageData?: Record<string, any>;
|
|
401
|
+
handleFieldInsert?: (field: string, inputId: string) => void;
|
|
402
|
+
hasJsonLdForSelectedLang?: boolean;
|
|
403
|
+
copyJsonLDFromDefaultPage?: () => void;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
declare type SortOptions = {
|
|
407
|
+
id: string;
|
|
408
|
+
name: string;
|
|
409
|
+
description?: string;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
declare type StructureError = {
|
|
413
|
+
id: string;
|
|
414
|
+
message: string;
|
|
415
|
+
severity: "error" | "warning";
|
|
416
|
+
blockId?: string;
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
declare type StructureRule = {
|
|
420
|
+
name: string;
|
|
421
|
+
description: string;
|
|
422
|
+
validate: (blocks: ChaiBlock[], tree: any[]) => StructureError[];
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
export declare const useActivePage: () => {
|
|
426
|
+
data: any;
|
|
427
|
+
isFetching: boolean;
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
export declare const useApiUrl: () => string;
|
|
431
|
+
|
|
432
|
+
export declare const useBuilderFetch: () => ({ body, headers, url, streamResponse, }: {
|
|
433
|
+
body: {
|
|
434
|
+
action: string;
|
|
435
|
+
data?: any;
|
|
436
|
+
};
|
|
437
|
+
headers?: Record<string, string>;
|
|
438
|
+
url?: string;
|
|
439
|
+
streamResponse?: boolean;
|
|
440
|
+
}) => Promise<any>;
|
|
441
|
+
|
|
442
|
+
export declare const useBuilderPageData: () => UseQueryResult<any, Error>;
|
|
443
|
+
|
|
444
|
+
export declare const useChaiAuth: () => {
|
|
445
|
+
readonly isLoggedIn: boolean;
|
|
446
|
+
readonly user: any;
|
|
447
|
+
readonly logout: any;
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
export declare const useChaiCurrentPage: () => {
|
|
451
|
+
data: any;
|
|
452
|
+
isFetching: boolean;
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
export declare const useChaiUserInfo: (currentEditor: string) => UseQueryResult< {
|
|
456
|
+
name: string;
|
|
457
|
+
id: string;
|
|
458
|
+
email: string;
|
|
459
|
+
avatar: string;
|
|
460
|
+
}, Error>;
|
|
461
|
+
|
|
462
|
+
export declare const useClearAll: () => () => void;
|
|
463
|
+
|
|
464
|
+
export declare const useFallbackLang: () => string;
|
|
465
|
+
|
|
466
|
+
export declare const useFetch: () => (url: string, body: {
|
|
467
|
+
action: string;
|
|
468
|
+
data?: any;
|
|
469
|
+
}, headers?: Record<string, string>, streamResponse?: boolean) => Promise<any>;
|
|
470
|
+
|
|
471
|
+
export declare const useGotoPage: () => ({ pageId }: {
|
|
472
|
+
pageId: string;
|
|
473
|
+
}) => void;
|
|
474
|
+
|
|
475
|
+
export declare const useLanguagePages: (pageId?: string | undefined) => UseQueryResult<any[], Error>;
|
|
476
|
+
|
|
477
|
+
export declare const usePageTypes: () => UseQueryResult<any, Error>;
|
|
478
|
+
|
|
479
|
+
export declare const useReloadPage: () => () => Promise<void>;
|
|
480
|
+
|
|
481
|
+
export declare const useUpdateActivePageMetadata: () => UseMutationResult<any, Error, Record<string, any>, unknown>;
|
|
482
|
+
|
|
483
|
+
export declare const useUserPermissions: () => UseQueryResult<any, Error>;
|
|
484
|
+
|
|
485
|
+
export declare const useWebsitePages: () => UseQueryResult<any, Error>;
|
|
486
|
+
|
|
487
|
+
export declare const useWebsiteSetting: () => UseQueryResult<ChaiWebsiteSetting, Error>;
|
|
488
|
+
|
|
489
|
+
declare type VariableKey = string;
|
|
490
|
+
|
|
491
|
+
export { }
|
package/dist/pages.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { aE as s, aT as u, aP as t, aN as i, aO as r, ax as g, aU as P, ar as l, v as h, aK as n, aZ as o, aw as c, ap as C, aV as d, k as p, as as m, aW as A, l as U, m as b, aX as k, aY as W, a_ as v, g as B, j as F } from "./index-ZuacEL1j.js";
|
|
2
|
+
export {
|
|
3
|
+
s as ChaiJsonInput,
|
|
4
|
+
u as ChaiWebsiteBuilder,
|
|
5
|
+
t as ImagePicker,
|
|
6
|
+
i as LanguageSwitcher,
|
|
7
|
+
r as NestedPathSelector,
|
|
8
|
+
g as PermissionChecker,
|
|
9
|
+
P as useActivePage,
|
|
10
|
+
l as useApiUrl,
|
|
11
|
+
h as useBuilderFetch,
|
|
12
|
+
n as useBuilderPageData,
|
|
13
|
+
o as useChaiAuth,
|
|
14
|
+
c as useChaiCurrentPage,
|
|
15
|
+
C as useChaiUserInfo,
|
|
16
|
+
d as useClearAll,
|
|
17
|
+
p as useFallbackLang,
|
|
18
|
+
m as useFetch,
|
|
19
|
+
A as useGotoPage,
|
|
20
|
+
U as useLanguagePages,
|
|
21
|
+
b as usePageTypes,
|
|
22
|
+
k as useReloadPage,
|
|
23
|
+
W as useUpdateActivePageMetadata,
|
|
24
|
+
v as useUserPermissions,
|
|
25
|
+
B as useWebsitePages,
|
|
26
|
+
F as useWebsiteSetting
|
|
27
|
+
};
|