@myissue/vue-website-page-builder 3.5.13 → 3.5.15

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 (89) hide show
  1. package/dist/index.d.ts +1384 -11
  2. package/dist/style.css +1 -1
  3. package/dist/vue-website-page-builder.js +2464 -2443
  4. package/dist/vue-website-page-builder.umd.cjs +58 -54
  5. package/package.json +6 -9
  6. package/dist/App.vue.d.ts +0 -2
  7. package/dist/Components/ComponentThumbnail.vue.d.ts +0 -19
  8. package/dist/Components/Homepage/Footer.vue.d.ts +0 -2
  9. package/dist/Components/Icons/LayersIcon.vue.d.ts +0 -7
  10. package/dist/Components/Icons/SliderIcon.vue.d.ts +0 -7
  11. package/dist/Components/Inputs/ToggleInput.vue.d.ts +0 -9
  12. package/dist/Components/Loaders/ElementLoader.vue.d.ts +0 -2
  13. package/dist/Components/Loaders/GlobalLoader.vue.d.ts +0 -2
  14. package/dist/Components/Modals/BuilderComponents.vue.d.ts +0 -42
  15. package/dist/Components/Modals/DynamicModalBuilder.vue.d.ts +0 -142
  16. package/dist/Components/Modals/MediaLibraryModal.vue.d.ts +0 -58
  17. package/dist/Components/Modals/ModalBuilder.vue.d.ts +0 -73
  18. package/dist/Components/Overlays/FloatingSidePanel.vue.d.ts +0 -61
  19. package/dist/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue.d.ts +0 -12
  20. package/dist/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue.d.ts +0 -2
  21. package/dist/Components/PageBuilder/EditorMenu/Editables/Borders.vue.d.ts +0 -2
  22. package/dist/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue.d.ts +0 -2
  23. package/dist/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue.d.ts +0 -2
  24. package/dist/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue.d.ts +0 -8
  25. package/dist/Components/PageBuilder/EditorMenu/Editables/HTMLEditor.vue.d.ts +0 -2
  26. package/dist/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue.d.ts +0 -2
  27. package/dist/Components/PageBuilder/EditorMenu/Editables/ImageSettingsModal.vue.d.ts +0 -5
  28. package/dist/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue.d.ts +0 -2
  29. package/dist/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue.d.ts +0 -2
  30. package/dist/Components/PageBuilder/EditorMenu/Editables/MarginControl.vue.d.ts +0 -2
  31. package/dist/Components/PageBuilder/EditorMenu/Editables/OpacityEditor.vue.d.ts +0 -2
  32. package/dist/Components/PageBuilder/EditorMenu/Editables/PaddingControl.vue.d.ts +0 -2
  33. package/dist/Components/PageBuilder/EditorMenu/Editables/StyleEditor.vue.d.ts +0 -2
  34. package/dist/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue.d.ts +0 -12
  35. package/dist/Components/PageBuilder/EditorMenu/Editables/ThemeColorPresetManager.vue.d.ts +0 -2
  36. package/dist/Components/PageBuilder/EditorMenu/Editables/Typography.vue.d.ts +0 -2
  37. package/dist/Components/PageBuilder/EditorMenu/Editables/TypographyForTipTap.vue.d.ts +0 -2
  38. package/dist/Components/PageBuilder/EditorMenu/EditorAccordion.vue.d.ts +0 -14
  39. package/dist/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue.d.ts +0 -6
  40. package/dist/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue.d.ts +0 -14
  41. package/dist/Components/PageBuilder/Settings/PageBuilderSettings.vue.d.ts +0 -2
  42. package/dist/Components/PageBuilder/ToolbarOption/ToolbarOption.vue.d.ts +0 -2
  43. package/dist/Components/PageBuilder/UndoRedo/UndoRedo.vue.d.ts +0 -6
  44. package/dist/Components/TipTap/TipTapInput.vue.d.ts +0 -2
  45. package/dist/PageBuilder/PageBuilder.vue.d.ts +0 -47
  46. package/dist/PageBuilder/Preview.vue.d.ts +0 -12
  47. package/dist/composables/builderInstance.d.ts +0 -20
  48. package/dist/composables/delay.d.ts +0 -1
  49. package/dist/composables/extractCleanHTMLFromPageBuilder.d.ts +0 -2
  50. package/dist/composables/preloadImage.d.ts +0 -1
  51. package/dist/composables/useDebounce.d.ts +0 -1
  52. package/dist/composables/usePageBuilderModal.d.ts +0 -4
  53. package/dist/composables/useThemeColorPresets.d.ts +0 -47
  54. package/dist/composables/useTranslations.d.ts +0 -12
  55. package/dist/helpers/isEmptyObject.d.ts +0 -1
  56. package/dist/main.d.ts +0 -0
  57. package/dist/plugin.d.ts +0 -4
  58. package/dist/services/LocalStorageManager.d.ts +0 -7
  59. package/dist/services/PageBuilderService.d.ts +0 -698
  60. package/dist/sitemap.xml +0 -8
  61. package/dist/stores/page-builder-state.d.ts +0 -369
  62. package/dist/stores/shared-store.d.ts +0 -4
  63. package/dist/tests/DefaultComponents/DefaultBuilderComponents.vue.d.ts +0 -14
  64. package/dist/tests/DefaultComponents/DefaultMediaLibraryComponent.vue.d.ts +0 -2
  65. package/dist/tests/PageBuilderTest.vue.d.ts +0 -2
  66. package/dist/tests/TestComponents/DemoMediaLibraryComponentTest.vue.d.ts +0 -2
  67. package/dist/tests/TestComponents/DemoUnsplash.vue.d.ts +0 -2
  68. package/dist/tests/composables/useThemeColorPresets.test.d.ts +0 -16
  69. package/dist/tests/config/config.test.d.ts +0 -1
  70. package/dist/tests/service/componentValidation.test.d.ts +0 -1
  71. package/dist/tests/service/globalPageSettings.test.d.ts +0 -1
  72. package/dist/tests/service/htmlUtils.test.d.ts +0 -1
  73. package/dist/tests/service/localStorage.test.d.ts +0 -1
  74. package/dist/tests/service/pageBuilderService.test.d.ts +0 -1
  75. package/dist/tests/ui/modalStacking.test.d.ts +0 -1
  76. package/dist/types/index.d.ts +0 -312
  77. package/dist/utils/builder/font-family-map.d.ts +0 -22
  78. package/dist/utils/builder/html-doc-declaration-with-components.d.ts +0 -2
  79. package/dist/utils/builder/tailwaind-colors.d.ts +0 -6
  80. package/dist/utils/builder/tailwind-border-radius.d.ts +0 -9
  81. package/dist/utils/builder/tailwind-border-style-width-color.d.ts +0 -7
  82. package/dist/utils/builder/tailwind-font-sizes.d.ts +0 -8
  83. package/dist/utils/builder/tailwind-font-styles.d.ts +0 -7
  84. package/dist/utils/builder/tailwind-image.d.ts +0 -7
  85. package/dist/utils/builder/tailwind-opacities.d.ts +0 -6
  86. package/dist/utils/builder/tailwind-padding-margin.d.ts +0 -16
  87. package/dist/utils/html-elements/component.d.ts +0 -13
  88. package/dist/utils/html-elements/componentHelpers.d.ts +0 -10
  89. package/dist/utils/html-elements/themes.d.ts +0 -13
package/dist/index.d.ts CHANGED
@@ -1,11 +1,1384 @@
1
- export { default as PageBuilder } from './PageBuilder/PageBuilder.vue';
2
- export { default as Preview } from './PageBuilder/Preview.vue';
3
- export { usePageBuilderStateStore } from './stores/page-builder-state';
4
- export { usePageBuilderModal } from './composables/usePageBuilderModal';
5
- export { resetThemeColorPresets, buildStorageKey } from './composables/useThemeColorPresets';
6
- export type { PageBuilderUser, ComponentObject, ImageObject, PageBuilderConfig, BuilderResourceComponent, BuilderResourceData, StartBuilderResult, PageSettings, ThemeColorPreset, ThemeColorPresetId, ThemeColorPresetInput, ThemeColorPresetSettings, ThemeColorPresetSettingsInput, FormName, } from './types';
7
- export { PageBuilderService } from './services/PageBuilderService';
8
- export { createPinia } from 'pinia';
9
- export { sharedPageBuilderPinia, sharedPageBuilderStore } from './stores/shared-store';
10
- export { getPageBuilder } from './composables/builderInstance';
11
- export { pageBuilder } from './plugin';
1
+ import { App } from 'vue';
2
+ import { ComponentOptionsMixin } from 'vue';
3
+ import { ComponentProvideOptions } from 'vue';
4
+ import { createPinia } from 'pinia';
5
+ import { DefineComponent } from 'vue';
6
+ import { ExtractPropTypes } from 'vue';
7
+ import { Pinia } from 'pinia';
8
+ import { PiniaCustomStateProperties } from 'pinia';
9
+ import { PublicProps } from 'vue';
10
+ import { StoreDefinition } from 'pinia';
11
+
12
+ declare type AvailableLanguage = 'en' | 'zh-Hans' | 'fr' | 'ja' | 'ru' | 'es' | 'pt' | 'de' | 'ar' | 'hi' | 'da' | 'it';
13
+
14
+ export declare interface BuilderResourceComponent {
15
+ html_code: string;
16
+ title?: string;
17
+ [key: string]: unknown;
18
+ }
19
+
20
+ export declare type BuilderResourceData = BuilderResourceComponent[];
21
+
22
+ /**
23
+ * Build a user-scoped storage key so each user keeps their own presets.
24
+ * Falls back to the shared key when no `userForPageBuilder.id` is provided.
25
+ *
26
+ * @example
27
+ * // user id 42 → "vueWebsitePageBuilderThemeColorPresets-u42"
28
+ * // no id → "vueWebsitePageBuilderThemeColorPresets"
29
+ */
30
+ export declare function buildStorageKey(config?: PageBuilderConfig | null): string;
31
+
32
+ export declare interface ComponentObject {
33
+ id: string | number | null;
34
+ html_code: string;
35
+ title: string;
36
+ [key: string]: unknown;
37
+ }
38
+
39
+ export { createPinia }
40
+
41
+ export declare type FormName = 'post' | 'article' | 'blog' | 'news' | 'page' | 'faq' | 'testimonial' | 'case-study' | 'press-release' | 'product' | 'products' | 'category' | 'collection' | 'brand' | 'coupon' | 'discount' | 'shop' | 'cart' | 'checkout' | 'profile' | 'account' | 'team' | 'team-member' | 'author' | 'customer' | 'user' | 'service' | 'services' | 'package' | 'plan' | 'pricing' | 'subscription' | 'job' | 'job-listing' | 'career' | 'applicant' | 'event' | 'events' | 'webinar' | 'appointment' | 'reservation' | 'schedule' | 'listing' | 'directory' | 'location' | 'vendor' | 'company' | 'gallery' | 'image' | 'video' | 'media' | 'audio' | 'file' | 'contact' | 'support' | 'ticket' | 'feedback' | 'review' | 'inquiry' | 'report' | 'setting' | 'configuration' | 'integration' | 'theme' | 'language' | 'menu' | 'navigation' | 'tag' | 'meta';
42
+
43
+ /**
44
+ * Retrieves the singleton instance of the PageBuilderService.
45
+ * This function is used throughout the application to access the service.
46
+ * It throws an error if the service has not been initialized, ensuring that
47
+ * the plugin has been correctly installed.
48
+ *
49
+ * @throws {Error} If the PageBuilderService has not been initialized.
50
+ * @returns {PageBuilderService} The singleton instance of the PageBuilderService.
51
+ */
52
+ export declare function getPageBuilder(): PageBuilderService;
53
+
54
+ export declare interface ImageObject {
55
+ src: string;
56
+ [key: string]: unknown;
57
+ }
58
+
59
+ export declare const PageBuilder: DefineComponent<ExtractPropTypes<{
60
+ CustomMediaLibraryComponent: {
61
+ type: ObjectConstructor;
62
+ default: null;
63
+ };
64
+ CustomBuilderComponents: {
65
+ type: ObjectConstructor;
66
+ default: null;
67
+ };
68
+ showCloseButton: {
69
+ type: BooleanConstructor;
70
+ default: boolean;
71
+ };
72
+ showPublishButton: {
73
+ type: BooleanConstructor;
74
+ default: boolean;
75
+ };
76
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
77
+ handleClosePageBuilder: (...args: any[]) => void;
78
+ handlePublishPageBuilder: (...args: any[]) => void;
79
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
80
+ CustomMediaLibraryComponent: {
81
+ type: ObjectConstructor;
82
+ default: null;
83
+ };
84
+ CustomBuilderComponents: {
85
+ type: ObjectConstructor;
86
+ default: null;
87
+ };
88
+ showCloseButton: {
89
+ type: BooleanConstructor;
90
+ default: boolean;
91
+ };
92
+ showPublishButton: {
93
+ type: BooleanConstructor;
94
+ default: boolean;
95
+ };
96
+ }>> & Readonly<{
97
+ onHandleClosePageBuilder?: ((...args: any[]) => any) | undefined;
98
+ onHandlePublishPageBuilder?: ((...args: any[]) => any) | undefined;
99
+ }>, {
100
+ CustomBuilderComponents: Record<string, any>;
101
+ CustomMediaLibraryComponent: Record<string, any>;
102
+ showCloseButton: boolean;
103
+ showPublishButton: boolean;
104
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
105
+
106
+ export declare const pageBuilder: {
107
+ install: (app: App) => void;
108
+ };
109
+
110
+ export declare interface PageBuilderConfig {
111
+ updateOrCreate: {
112
+ /**
113
+ * Whether the builder is creating new content or updating existing content.
114
+ * Accepts `'create'`, `'update'`, or any other string for dynamic / computed values.
115
+ * The union with `(string & {})` preserves autocomplete for the two common values
116
+ * while allowing any string without requiring `as const` or explicit casting.
117
+ *
118
+ * @example
119
+ * // Dynamic value — works without `as const`
120
+ * formType: hasContent ? 'update' : 'create'
121
+ */
122
+ formType: 'create' | 'update' | (string & {});
123
+ formName: FormName | (string & {});
124
+ [key: string]: unknown;
125
+ };
126
+ pageBuilderLogo?: {
127
+ src: string;
128
+ [key: string]: unknown;
129
+ } | null;
130
+ resourceData?: {
131
+ /**
132
+ * Optional page/resource title shown in the builder toolbar.
133
+ * Made optional so consumers can pass a resource object without a title
134
+ * or when the title isn't known yet at the time `startBuilder` is called.
135
+ */
136
+ title?: string;
137
+ /**
138
+ * Accepts both numeric IDs and string-based IDs (e.g. UUIDs).
139
+ * The service handles both types at runtime when building localStorage keys.
140
+ */
141
+ id?: number | string;
142
+ [key: string]: unknown;
143
+ } | null;
144
+ userForPageBuilder?: PageBuilderUser;
145
+ [key: string]: unknown;
146
+ userSettings?: {
147
+ language?: {
148
+ default?: string;
149
+ enable?: readonly string[];
150
+ disableLanguageDropDown?: boolean;
151
+ };
152
+ autoSave?: boolean;
153
+ notifications?: boolean;
154
+ /**
155
+ * Default canvas font and, optionally, the restricted set of fonts shown in
156
+ * the font-family picker.
157
+ *
158
+ * - Single value: `'jost'` — sets the canvas default; picker shows all fonts.
159
+ * - Comma-separated list: `'jost, raleway, arial'` — first entry is the
160
+ * canvas default; picker is restricted to the listed fonts.
161
+ *
162
+ * Unknown font names (not in the built-in list) are silently ignored.
163
+ */
164
+ fontFamily?: string;
165
+ /**
166
+ * Per-element font overrides applied to the builder canvas.
167
+ * Each value follows the same format as `fontFamily` — a font key name or
168
+ * comma-separated list; the first recognised entry is used.
169
+ *
170
+ * Available font names: jost, raleway, palantino, arial, helvetica, georgia,
171
+ * times, times-new-roman, courier, courier-new, verdana, tahoma, trebuchet,
172
+ * garamond, bookman, comic-sans, impact, lucida, lucida-console, lucida-sans,
173
+ * candara, optima, avenir, futura, calibri, cambria, didot, franklin-gothic,
174
+ * rockwell, baskerville, sans, serif, mono
175
+ */
176
+ elementFonts?: PageBuilderElementFonts;
177
+ } | null;
178
+ settings?: {
179
+ brandColor?: string;
180
+ themeColorPresets?: ThemeColorPresetSettingsInput | ThemeColorPresetSettings | null;
181
+ [key: string]: unknown;
182
+ } | null;
183
+ pageSettings?: PageSettings;
184
+ }
185
+
186
+ /**
187
+ * Per-element font overrides for the builder canvas.
188
+ * Each value is a font key name or comma-separated list (e.g. `'jost'` or
189
+ * `'jost, raleway, arial'`). The first recognised font name is applied;
190
+ * unrecognised names are silently skipped.
191
+ */
192
+ declare interface PageBuilderElementFonts {
193
+ h1?: string;
194
+ h2?: string;
195
+ h3?: string;
196
+ h4?: string;
197
+ h5?: string;
198
+ h6?: string;
199
+ p?: string;
200
+ }
201
+
202
+ export declare const PageBuilderPreview: DefineComponent<ExtractPropTypes<{
203
+ mobile: {
204
+ type: BooleanConstructor;
205
+ };
206
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
207
+ mobile: {
208
+ type: BooleanConstructor;
209
+ };
210
+ }>> & Readonly<{}>, {
211
+ mobile: boolean;
212
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
213
+
214
+ export declare class PageBuilderService {
215
+ private fontSizeRegex;
216
+ protected pageBuilderStateStore: ReturnType<typeof usePageBuilderStateStore>;
217
+ private getLocalStorageItemName;
218
+ private getApplyImageToSelection;
219
+ private getHyberlinkEnable;
220
+ private getComponents;
221
+ private getComponent;
222
+ private getElement;
223
+ private getComponentArrayAddMethod;
224
+ private NoneListernesTags;
225
+ private hasStartedEditing;
226
+ private originalComponents;
227
+ private savedMountComponents;
228
+ private pendingMountComponents;
229
+ private globalStylesObserver;
230
+ private _pendingPageSettings;
231
+ private _lastKnownPageSettings;
232
+ private isPageBuilderMissingOnStart;
233
+ private elementsWithListeners;
234
+ private translate;
235
+ constructor(pageBuilderStateStore: ReturnType<typeof usePageBuilderStateStore>);
236
+ /**
237
+ * Returns an array of available languages.
238
+ * @returns {AvailableLanguage[]} An array of available language codes.
239
+ */
240
+ availableLanguage(): AvailableLanguage[];
241
+ /**
242
+ * Sets the current language in the page builder state.
243
+ * @param {string} lang - The language code to set.
244
+ */
245
+ changeLanguage(lang: string): void;
246
+ /**
247
+ * Deselects any selected or hovered elements in the builder UI.
248
+ * @returns {Promise<void>}
249
+ */
250
+ clearHtmlSelection(): Promise<void>;
251
+ /**
252
+ * Ensures that the `updateOrCreate` configuration is valid and sets default values if necessary.
253
+ * @param {PageBuilderConfig} config - The page builder configuration.
254
+ * @private
255
+ */
256
+ private ensureUpdateOrCreateConfig;
257
+ /**
258
+ * Validates the user-provided components array.
259
+ * @param {unknown} components - The components data to validate.
260
+ * @returns {{error: true, warning: string, status: string} | {error: true, reason: string} | undefined} An error object if validation fails, otherwise undefined.
261
+ * @private
262
+ */
263
+ private validateUserProvidedComponents;
264
+ /**
265
+ * Ensures that the language configuration is valid and sets default values if necessary.
266
+ * @param {PageBuilderConfig} config - The page builder configuration.
267
+ * @private
268
+ */
269
+ private ensureLanguage;
270
+ /**
271
+ * Validates the entire page builder configuration.
272
+ * @param {PageBuilderConfig} config - The page builder configuration.
273
+ * @private
274
+ */
275
+ private validateConfig;
276
+ /**
277
+ * Saves user settings to local storage.
278
+ * @param {string} newLang - The new language to save.
279
+ */
280
+ saveUserSettingsStorage(newLang: string): void;
281
+ /**
282
+ * Initializes the Page Builder.
283
+ * @param {PageBuilderConfig} config - The configuration object for the Page Builder.
284
+ * @param {BuilderResourceData} [passedComponentsArray] - Optional array of components to load.
285
+ * @returns {Promise<StartBuilderResult>} A result object indicating success or failure.
286
+ */
287
+ startBuilder(config: PageBuilderConfig, passedComponentsArray?: BuilderResourceData): Promise<StartBuilderResult>;
288
+ /**
289
+ * Completes the builder initialization process once the DOM is ready.
290
+ * @param {BuilderResourceData} [passedComponentsArray] - Optional array of components to load.
291
+ * @returns {Promise<void>}
292
+ */
293
+ completeBuilderInitialization(passedComponentsArray?: BuilderResourceData): Promise<void>;
294
+ /**
295
+ * Converts an array of ComponentObject into a single HTML string.
296
+ *
297
+ * @returns {string} A single HTML string containing all components.
298
+ */
299
+ private renderComponentsToHtml;
300
+ /**
301
+ * Completes the mounting process by loading components into the DOM and setting up listeners.
302
+ * @param {string} html - The HTML string of components to mount.
303
+ * @param {boolean} [useConfigPageSettings] - Whether to use page settings from the passed data.
304
+ * @private
305
+ */
306
+ private completeMountProcess;
307
+ /**
308
+ * Applies CSS class changes to the currently selected element.
309
+ * @param {string | undefined} cssUserSelection - The user's CSS class selection.
310
+ * @param {string[]} CSSArray - The array of possible CSS classes for this property.
311
+ * @param {string} mutationName - The name of the store mutation to call.
312
+ * @returns {string | undefined} The previously applied CSS class.
313
+ * @private
314
+ */
315
+ private applyElementClassChanges;
316
+ private removeElementClassesFromArray;
317
+ /**
318
+ * Removes all CSS classes from the main page builder container.
319
+ * @returns {Promise<void>}
320
+ */
321
+ clearClassesFromPage(): Promise<void>;
322
+ /**
323
+ * Removes all inline styles from the main page builder container.
324
+ * @returns {Promise<void>}
325
+ */
326
+ clearInlineStylesFromPage(): Promise<void>;
327
+ /**
328
+ * Selects the main page builder container for global styling.
329
+ * @returns {Promise<void>}
330
+ */
331
+ globalPageStyles(): Promise<void>;
332
+ /**
333
+ * Disconnects the MutationObserver that tracks global page style changes.
334
+ * Call when closing the global styles editor panel.
335
+ */
336
+ stopGlobalStylesSync(): void;
337
+ /**
338
+ * Handles changes to the font weight of the selected element.
339
+ * @param {string} [userSelectedFontWeight] - The selected font weight class.
340
+ */
341
+ handleFontWeight(userSelectedFontWeight?: string): void;
342
+ /**
343
+ * Handles changes to the base font size of the selected element.
344
+ * @param {string} [userSelectedFontSize] - The selected font size class.
345
+ */
346
+ handleFontSizeBase(userSelectedFontSize?: string): void;
347
+ /**
348
+ * Handles changes to the desktop font size of the selected element.
349
+ * @param {string} [userSelectedFontSize] - The selected font size class for desktop.
350
+ */
351
+ handleFontSizeDesktop(userSelectedFontSize?: string): void;
352
+ /**
353
+ * Applies helper CSS classes to elements, such as wrapping them or adding responsive text classes.
354
+ * @param {HTMLElement} element - The element to process.
355
+ * @private
356
+ */
357
+ private ensureImagesHaveAltText;
358
+ private applyHelperCSSToElements;
359
+ /**
360
+ * Toggles the visibility of the TipTap modal for rich text editing.
361
+ * @param {boolean} status - Whether to show or hide the modal.
362
+ * @returns {Promise<void>}
363
+ */
364
+ toggleTipTapModal(status: boolean): Promise<void>;
365
+ /**
366
+ * Wraps an element in a div if it's an excluded tag and adjacent to an image.
367
+ * @param {HTMLElement} element - The element to potentially wrap.
368
+ * @private
369
+ */
370
+ private wrapElementInDivIfExcluded;
371
+ /**
372
+ * Handles the mouseover event for editable elements, showing a hover state.
373
+ * @param {Event} e - The mouse event.
374
+ * @param {HTMLElement} element - The element being hovered over.
375
+ * @private
376
+ */
377
+ private handleMouseOver;
378
+ /**
379
+ * Handles the mouseleave event for editable elements, removing the hover state.
380
+ * @param {Event} e - The mouse event.
381
+ * @private
382
+ */
383
+ private handleMouseLeave;
384
+ /**
385
+ * Checks if an element is editable based on its tag name.
386
+ * @param {Element | null} el - The element to check.
387
+ * @returns {boolean} True if the element is editable, false otherwise.
388
+ */
389
+ isEditableElement(el: Element | null): boolean;
390
+ getSelectedComponentSection(): HTMLElement | null;
391
+ isSelectedComponentTopElement(): boolean;
392
+ selectedComponentIsFullWidth(): boolean;
393
+ setSelectedComponentFullWidth(enabled: boolean): Promise<void>;
394
+ /**
395
+ * Returns true when the global page wrapper has the full-width class applied.
396
+ */
397
+ isGlobalFullWidth(): boolean;
398
+ /**
399
+ * Toggles the full-width class on the page wrapper so that global background
400
+ * colours stretch across the entire browser viewport.
401
+ */
402
+ setGlobalFullWidth(enabled: boolean): Promise<void>;
403
+ /** Returns true when the currently selected element is an `<img>`. */
404
+ isSelectedElementImage(): boolean;
405
+ setImageSettingsModalOpen(open: boolean): void;
406
+ isImageSettingsModalOpen(): boolean;
407
+ private findImageAspectClass;
408
+ private removeImageAspectClasses;
409
+ handleImageObjectFit(userSelection?: string): void;
410
+ handleImageObjectPosition(userSelection?: string): void;
411
+ handleImageAspectRatio(userSelection?: string): void;
412
+ handleImageAltText(alt?: string): Promise<void>;
413
+ getSelectedImageAltText(): string;
414
+ /**
415
+ * Attaches click, mouseover, and mouseleave event listeners to all editable elements in the page builder.
416
+ * @private
417
+ */
418
+ private addListenersToEditableElements;
419
+ /**
420
+ * Handles the click event for editable elements, setting the element as selected.
421
+ * @param {Event} e - The click event.
422
+ * @param {HTMLElement} element - The clicked element.
423
+ * @private
424
+ */
425
+ private handleElementClick;
426
+ private getHistoryBaseKey;
427
+ private initializeHistory;
428
+ /**
429
+ * Triggers an auto-save of the current page builder content to local storage if enabled.
430
+ */
431
+ handleAutoSave: () => Promise<void>;
432
+ /**
433
+ * Manually saves the current page builder content to local storage.
434
+ */
435
+ handleManualSave: (doNoClearHTML?: boolean) => Promise<void>;
436
+ /**
437
+ * Clones a component object and prepares it for insertion into the DOM by adding unique IDs and prefixes.
438
+ * @param {ComponentObject} componentObject - The component object to clone.
439
+ * @returns {ComponentObject} The cloned and prepared component object.
440
+ */
441
+ cloneCompObjForDOMInsertion(componentObject: ComponentObject): ComponentObject;
442
+ /**
443
+ * Removes the 'hovered' and 'selected' attributes from all elements in the page builder.
444
+ * @private
445
+ */
446
+ private removeHoveredAndSelected;
447
+ /**
448
+ * Syncs the CSS classes of the currently selected element to the state store.
449
+ * @private
450
+ */
451
+ private syncCurrentClasses;
452
+ /**
453
+ * Syncs the inline styles of the currently selected element to the state store.
454
+ * @private
455
+ */
456
+ private syncCurrentStyles;
457
+ /**
458
+ * Adds a CSS class to the currently selected element.
459
+ * @param {string} userSelectedClass - The class to add.
460
+ */
461
+ handleAddClasses(userSelectedClass: string): void;
462
+ /**
463
+ * Adds or updates an inline style property on the currently selected element.
464
+ * @param {string} property - The CSS property to add/update.
465
+ * @param {string} value - The value of the CSS property.
466
+ */
467
+ handleAddStyle(property: string, value: string): void;
468
+ /**
469
+ * Removes an inline style property from the currently selected element.
470
+ * @param {string} property - The CSS property to remove.
471
+ */
472
+ handleRemoveStyle(property: string): void;
473
+ /**
474
+ * Handles changes to the font family of the selected element.
475
+ * @param {string} [userSelectedFontFamily] - The selected font family class.
476
+ */
477
+ handleFontFamily(userSelectedFontFamily?: string): void;
478
+ /**
479
+ * Handles changes to the font style of the selected element.
480
+ * @param {string} [userSelectedFontStyle] - The selected font style class.
481
+ */
482
+ handleFontStyle(userSelectedFontStyle?: string): void;
483
+ /**
484
+ * Removes every class that appears in any of the given arrays from the currently
485
+ * selected element. Used to strip conflicting shorthand/directional padding or
486
+ * margin classes before applying a new value (e.g. remove pbx-py-* when setting
487
+ * pbx-pt-*, so the shorthand never silently overrides the directional value).
488
+ */
489
+ private purgeConflictingClasses;
490
+ /**
491
+ * Handles changes to the vertical padding of the selected element.
492
+ * py-* shorthand: also clear individual pt-* and pb-* so they don't override.
493
+ */
494
+ handleVerticalPadding(userSelectedVerticalPadding?: string): void;
495
+ /**
496
+ * Handles changes to the horizontal padding of the selected element.
497
+ * px-* shorthand: also clear individual pl-* and pr-* so they don't override.
498
+ */
499
+ handleHorizontalPadding(userSelectedHorizontalPadding?: string): void;
500
+ /**
501
+ * Handles changes to the top padding of the selected element.
502
+ * pt-*: also clear py-* shorthand which also sets padding-top.
503
+ */
504
+ handleTopPadding(userSelectedTopPadding?: string): void;
505
+ /**
506
+ * Handles changes to the right padding of the selected element.
507
+ * pr-*: also clear px-* shorthand which also sets padding-right.
508
+ */
509
+ handleRightPadding(userSelectedRightPadding?: string): void;
510
+ /**
511
+ * Handles changes to the bottom padding of the selected element.
512
+ * pb-*: also clear py-* shorthand which also sets padding-bottom.
513
+ */
514
+ handleBottomPadding(userSelectedBottomPadding?: string): void;
515
+ /**
516
+ * Handles changes to the left padding of the selected element.
517
+ * pl-*: also clear px-* shorthand which also sets padding-left.
518
+ */
519
+ handleLeftPadding(userSelectedLeftPadding?: string): void;
520
+ /**
521
+ * Handles changes to the vertical margin of the selected element.
522
+ * my-* shorthand: also clear individual mt-* and mb-*.
523
+ */
524
+ handleVerticalMargin(userSelectedVerticalMargin?: string): void;
525
+ /**
526
+ * Handles changes to the horizontal margin of the selected element.
527
+ * mx-* shorthand: also clear individual ml-* and mr-*.
528
+ */
529
+ handleHorizontalMargin(userSelectedHorizontalMargin?: string): void;
530
+ /**
531
+ * Handles changes to the top margin of the selected element.
532
+ * mt-*: also clear my-* shorthand.
533
+ */
534
+ handleTopMargin(userSelectedTopMargin?: string): void;
535
+ /**
536
+ * Handles changes to the right margin of the selected element.
537
+ * mr-*: also clear mx-* shorthand.
538
+ */
539
+ handleRightMargin(userSelectedRightMargin?: string): void;
540
+ /**
541
+ * Handles changes to the bottom margin of the selected element.
542
+ * mb-*: also clear my-* shorthand.
543
+ */
544
+ handleBottomMargin(userSelectedBottomMargin?: string): void;
545
+ /**
546
+ * Handles changes to the left margin of the selected element.
547
+ * ml-*: also clear mx-* shorthand.
548
+ */
549
+ handleLeftMargin(userSelectedLeftMargin?: string): void;
550
+ /**
551
+ * Handles changes to the border style of the selected element.
552
+ * @param {string} [borderStyle] - The selected border style class.
553
+ */
554
+ handleBorderStyle(borderStyle?: string): void;
555
+ /**
556
+ * Handles changes to the border width of the selected element.
557
+ * @param {string} [borderWidth] - The selected border width class.
558
+ */
559
+ handleBorderWidth(borderWidth?: string): void;
560
+ /**
561
+ * Handles changes to the border color of the selected element.
562
+ * @param {string} [borderColor] - The selected border color class.
563
+ */
564
+ handleBorderColor(borderColor?: string): void;
565
+ /**
566
+ * Handles changes to the background color of the selected element.
567
+ * @param {string} [color] - The selected background color class.
568
+ */
569
+ handleBackgroundColor(color?: string): void;
570
+ handleCustomBackgroundColor(color: string): void;
571
+ /**
572
+ * Handles changes to the text color of the selected element.
573
+ * @param {string} [color] - The selected text color class.
574
+ */
575
+ handleTextColor(color?: string): void;
576
+ handleCustomTextColor(color: string): void;
577
+ /**
578
+ * Handles changes to the global border radius of the selected element.
579
+ * @param {string} [borderRadiusGlobal] - The selected global border radius class.
580
+ */
581
+ handleBorderRadiusGlobal(borderRadiusGlobal?: string): void;
582
+ /**
583
+ * Handles changes to the top-left border radius of the selected element.
584
+ * @param {string} [borderRadiusTopLeft] - The selected top-left border radius class.
585
+ */
586
+ handleBorderRadiusTopLeft(borderRadiusTopLeft?: string): void;
587
+ /**
588
+ * Handles changes to the top-right border radius of the selected element.
589
+ * @param {string} [borderRadiusTopRight] - The selected top-right border radius class.
590
+ */
591
+ handleBorderRadiusTopRight(borderRadiusTopRight?: string): void;
592
+ /**
593
+ * Handles changes to the bottom-left border radius of the selected element.
594
+ * @param {string} [borderRadiusBottomleft] - The selected bottom-left border radius class.
595
+ */
596
+ handleBorderRadiusBottomleft(borderRadiusBottomleft?: string): void;
597
+ /**
598
+ * Handles changes to the bottom-right border radius of the selected element.
599
+ * @param {string} [borderRadiusBottomRight] - The selected bottom-right border radius class.
600
+ */
601
+ handleBorderRadiusBottomRight(borderRadiusBottomRight?: string): void;
602
+ /**
603
+ * Handles changes to the tablet font size of the selected element.
604
+ * @param {string} [userSelectedFontSize] - The selected font size class for tablet.
605
+ */
606
+ handleFontSizeTablet(userSelectedFontSize?: string): void;
607
+ /**
608
+ * Handles changes to the mobile font size of the selected element.
609
+ * @param {string} [userSelectedFontSize] - The selected font size class for mobile.
610
+ */
611
+ handleFontSizeMobile(userSelectedFontSize?: string): void;
612
+ /**
613
+ * Handles changes to the background opacity of the selected element.
614
+ * @param {string} [opacity] - The selected background opacity class.
615
+ */
616
+ handleBackgroundOpacity(opacity?: string): void;
617
+ /**
618
+ * Handles changes to the opacity of the selected element.
619
+ * @param {string} [opacity] - The selected opacity class.
620
+ */
621
+ handleOpacity(opacity?: string): void;
622
+ /**
623
+ * Removes all components from both the builder state and the DOM.
624
+ * @private
625
+ */
626
+ private deleteAllComponentsFromDOM;
627
+ undo(): Promise<void>;
628
+ redo(): Promise<void>;
629
+ private hasVisibleContent;
630
+ private isSectionEmpty;
631
+ /**
632
+ * Duplicate the currently selected component from the DOM and the state.
633
+ * @returns {Promise<void>}
634
+ */
635
+ /**
636
+ * Finds the first two-column layout container inside the selected section.
637
+ * Matches flex-row containers (including responsive variants like lg:pbx-flex-row)
638
+ * AND grid containers with a grid-cols-2 class, in each case requiring exactly
639
+ * two direct element children. Returns the container or null.
640
+ */
641
+ findReverseableContainer(): HTMLElement | null;
642
+ /**
643
+ * Reverses the visual order of a two-column layout by physically swapping the
644
+ * two direct children of the detected container. This works for both flex-row
645
+ * and grid-cols-2 layouts and naturally toggles on repeated clicks.
646
+ * Persists the change to the store and localStorage.
647
+ */
648
+ reverseComponentLayout(): Promise<void>;
649
+ duplicateComponent(): Promise<void>;
650
+ /**
651
+ * Deletes the currently selected component from the DOM and the state.
652
+ * @returns {Promise<void>}
653
+ */
654
+ deleteComponentFromDOM(): Promise<void>;
655
+ /**
656
+ * Duplicates the currently selected element and inserts the copy immediately
657
+ * after it in the DOM, then syncs the change to the store.
658
+ */
659
+ duplicateElementInDOM(): Promise<void>;
660
+ /**
661
+ * Deletes the currently selected element from the DOM and stores it for potential restoration.
662
+ * @returns {Promise<void>}
663
+ */
664
+ deleteElementFromDOM(): Promise<void>;
665
+ /**
666
+ * Removes a CSS class from the currently selected element.
667
+ * @param {string} userSelectedClass - The class to remove.
668
+ */
669
+ handleRemoveClasses(userSelectedClass: string): void;
670
+ /**
671
+ * Reorders the currently selected component up or down in the component list.
672
+ * @param {number} direction - The direction to move the component (-1 for up, 1 for down).
673
+ */
674
+ reorderComponent(direction: number): Promise<void>;
675
+ /**
676
+ * Checks if the currently selected component can be moved up.
677
+ * @returns {boolean} True if the component can be moved up, false otherwise.
678
+ */
679
+ canMoveUp(): boolean;
680
+ /**
681
+ * Checks if the currently selected component can be moved down.
682
+ * @returns {boolean} True if the component can be moved down, false otherwise.
683
+ */
684
+ canMoveDown(): boolean;
685
+ /**
686
+ * Ensures that a text area element has content, adding a visual indicator if it's empty.
687
+ */
688
+ ensureTextAreaHasContent: () => void;
689
+ /**
690
+ * Handles text input for an element, updating its content.
691
+ * @param {string} textContentVueModel - The new text content from the Vue model.
692
+ * @returns {Promise<void>}
693
+ */
694
+ handleTextInput: (textContentVueModel: string) => Promise<void>;
695
+ /**
696
+ * Checks if the selected element or its first child is an iframe.
697
+ * @returns {boolean} True if it is an iframe, false otherwise.
698
+ */
699
+ ElOrFirstChildIsIframe(): boolean;
700
+ /**
701
+ * Checks if the selected element is a valid text container (i.e., does not contain images or divs).
702
+ * @returns {boolean | undefined} True if it's a valid text element, otherwise undefined.
703
+ */
704
+ isSelectedElementValidText(): false | undefined;
705
+ /**
706
+ * Generates a preview of the current page design.
707
+ */
708
+ previewCurrentDesign(): void;
709
+ /**
710
+ * Sanitizes a string to be used as a key in local storage.
711
+ * @param {string} input - The string to sanitize.
712
+ * @returns {string} The sanitized string.
713
+ */
714
+ sanitizeForLocalStorage(input: string): string;
715
+ /**
716
+ * Clones an element and removes selection-related attributes from the clone.
717
+ * @param {HTMLElement} element - The element to clone.
718
+ * @returns {HTMLElement} The sanitized clone.
719
+ * @private
720
+ */
721
+ private cloneAndRemoveSelectionAttributes;
722
+ /**
723
+ * Syncs the current DOM state of components to the in-memory store.
724
+ * @private
725
+ */
726
+ syncDomToStoreOnly(): Promise<void>;
727
+ generateHtmlFromComponents(): Promise<string>;
728
+ generateFullPageHtml(): Promise<string>;
729
+ /**
730
+ * Saves the current DOM state of components to local storage.
731
+ * @private
732
+ */
733
+ private saveDomComponentsToLocalStorage;
734
+ /**
735
+ * Removes the current page's components from local storage.
736
+ * @private
737
+ */
738
+ private removeCurrentComponentsFromLocalStorage;
739
+ /**
740
+ * Handles the form submission process, clearing local storage and the DOM.
741
+ * Global page settings (classes / inline styles on the page wrapper) are
742
+ * intentionally preserved so they survive a "remove all components" action.
743
+ * @returns {Promise<void>}
744
+ */
745
+ handleFormSubmission(): Promise<void>;
746
+ /**
747
+ * Reads the current page settings.
748
+ * Prioritises the live #pagebuilder element (always current) and falls back to localStorage.
749
+ */
750
+ private readCurrentPageSettings;
751
+ /** Applies captured global page classes/styles to the page wrapper once. */
752
+ private applyPageSettingsToPage;
753
+ /** Reconnects the global-styles MutationObserver after a Vue remount replaces nodes. */
754
+ private reconnectGlobalStylesObserver;
755
+ /**
756
+ * Updates the component store and re-renders the page without losing global page
757
+ * styles on #pagebuilder. Settings must be captured before the remount and
758
+ * re-applied after Vue renders.
759
+ */
760
+ private setComponentsPreservingPageSettings;
761
+ /**
762
+ * Parses a CSS style string into a key-value object.
763
+ * @param {string} style - The style string to parse.
764
+ * @returns {Record<string, string>} The parsed style object.
765
+ * @private
766
+ */
767
+ private parseStyleString;
768
+ /**
769
+ * Deletes old page builder data from local storage (older than 2 weeks).
770
+ */
771
+ deleteOldPageBuilderLocalStorage(): void;
772
+ /**
773
+ * Sets a flag to indicate that the user has started editing.
774
+ */
775
+ startEditing(): void;
776
+ /**
777
+ * Re-attaches click/hover listeners to any newly added DOM elements.
778
+ * Call this after programmatically inserting elements into the builder canvas.
779
+ */
780
+ refreshListeners(): Promise<void>;
781
+ /**
782
+ * Resumes editing from a draft saved in local storage.
783
+ * @returns {Promise<void>}
784
+ */
785
+ resumeEditingFromDraft(): Promise<void>;
786
+ /**
787
+ * Restores the original content that was loaded when the builder started.
788
+ * @returns {Promise<void>}
789
+ */
790
+ restoreOriginalContent(): Promise<void>;
791
+ returnLatestComponents(): Promise<ComponentObject[]>;
792
+ /**
793
+ * Gets the local storage key for the current resource.
794
+ * @returns {string | null} The local storage key.
795
+ */
796
+ getStorageItemNameForResource(): string | null;
797
+ /**
798
+ * Retrieves the saved page HTML from local storage.
799
+ * @returns {string | false} The HTML string or false if not found.
800
+ */
801
+ getSavedPageHtml(): string | false;
802
+ /**
803
+ * Applies a selected image to the current element.
804
+ * @param {ImageObject} image - The image object to apply.
805
+ * @returns {Promise<void>}
806
+ */
807
+ applySelectedImage(image: ImageObject): Promise<void>;
808
+ /**
809
+ * Sets the base primary image from the currently selected element if it's an image.
810
+ * @private
811
+ */
812
+ private setBasePrimaryImageFromSelectedElement;
813
+ /**
814
+ * Adds or removes a hyperlink from the selected element.
815
+ * @param {boolean} hyperlinkEnable - Whether to enable or disable the hyperlink.
816
+ * @param {string | null} urlInput - The URL for the hyperlink.
817
+ * @param {boolean} openHyperlinkInNewTab - Whether the link should open in a new tab.
818
+ * @private
819
+ */
820
+ private addHyperlinkToElement;
821
+ /**
822
+ * Checks if the selected element contains a hyperlink and updates the state accordingly.
823
+ * @private
824
+ */
825
+ private checkForHyperlink;
826
+ /**
827
+ * Handles all hyperlink-related actions for the selected element.
828
+ * @param {boolean} [hyperlinkEnable] - Whether to enable or disable the hyperlink.
829
+ * @param {string | null} [urlInput] - The URL for the hyperlink.
830
+ * @param {boolean} [openHyperlinkInNewTab] - Whether the link should open in a new tab.
831
+ */
832
+ handleHyperlink(hyperlinkEnable?: boolean, urlInput?: string | null, openHyperlinkInNewTab?: boolean): void;
833
+ addTheme(components: string): Promise<void>;
834
+ analyzeSEO(): Promise<SEOSummary>;
835
+ /**
836
+ * Adds a new component to the page builder.
837
+ * @param {ComponentObject} componentObject - The component to add.
838
+ * @returns {Promise<void>}
839
+ */
840
+ addComponent(componentObject: ComponentObject): Promise<void>;
841
+ /**
842
+ * Adds a prefix to Tailwind CSS classes in a string.
843
+ * @param {string} classList - The string of classes.
844
+ * @param {string} [prefix='pbx-'] - The prefix to add.
845
+ * @returns {string} The prefixed class string.
846
+ * @private
847
+ */
848
+ private addTailwindPrefixToClasses;
849
+ /**
850
+ * Converts a style object to a CSS string.
851
+ * @param {string | Record<string, string> | null | undefined} styleObj - The style object.
852
+ * @returns {string} The CSS style string.
853
+ * @private
854
+ */
855
+ private convertStyleObjectToString;
856
+ /**
857
+ * Parses a string of HTML and extracts builder components and global page settings.
858
+ * - This method expects an **HTML string** containing one or more `<section>...</section>` elements (such as the output from `getSavedPageHtml()` or a previously saved builder HTML string).
859
+ * - **Do NOT pass a JSON string** (such as the result of `JSON.stringify(componentsArray)`) to this method. Passing a JSON string to `DOMParser.parseFromString(..., 'text/html')` will not produce valid DOM nodes. Instead, it will treat the JSON as plain text, resulting in a `<html><head></head><body>{...json...}</body></html>` structure, not real HTML elements.
860
+ * - If you pass a JSON string, you will see lots of `\n` and strange HTML, because the parser is just wrapping your JSON in a `<body>` tag as text.
861
+ *
862
+ * Why only HTML?
863
+ * - It enforces a single source of truth for builder state (HTML).
864
+ * - It prevents misuse (e.g., passing JSON to a DOM parser, which is always a bug).
865
+ * - It makes your documentation and support much simpler.
866
+ *
867
+ * @param htmlString - The HTML string to parse (must contain `<section>...</section>` elements, not JSON).
868
+ * @returns An object with `components` (array of builder components) and `pageSettings` (global styles for the page).
869
+ */
870
+ parsePageBuilderHTML(htmlString: string): {
871
+ components: ComponentObject[];
872
+ pageSettings: PageSettings;
873
+ };
874
+ /**
875
+ * Applies modified components by mounting them to the DOM and attaching listeners.
876
+ * @param htmlString - The HTML string to apply
877
+ * @returns {Promise<string | null>} - Returns error message if failed, otherwise null
878
+ */
879
+ applyModifiedHTML(htmlString: string): Promise<string | null>;
880
+ private validateMountingHTML;
881
+ /**
882
+ * Applies modified components by mounting them to the DOM and attaching listeners.
883
+ * @param htmlString - The HTML string to apply
884
+ * @returns {Promise<string | null>} - Returns error message if failed, otherwise null
885
+ */
886
+ applyModifiedComponents(htmlString: string): Promise<string | null>;
887
+ /**
888
+ * Mounts builder components to the DOM from an HTML string.
889
+ *
890
+ * Input format detection:
891
+ * - If the input starts with `[` or `{`: treated as JSON (array or object).
892
+ * - If the input starts with `<`: treated as HTML.
893
+ *
894
+ * This function should be used when:
895
+ * - Restoring the builder from a published HTML snapshot.
896
+ * - Importing a static HTML export.
897
+ * - Loading the builder from previously published or saved HTML (e.g., from `getSavedPageHtml()`).
898
+ *
899
+ * Typical use cases include restoring a published state, importing templates, or previewing published content.
900
+ */
901
+ private mountComponentsToDOM;
902
+ private updateLocalStorageItemName;
903
+ /**
904
+ * Initializes the styles for the currently selected element.
905
+ */
906
+ initializeElementStyles(): Promise<void>;
907
+ }
908
+
909
+ declare interface PageBuilderState {
910
+ componentArrayAddMethod: string | null;
911
+ localStorageItemName: string | null;
912
+ showModalTipTap: boolean;
913
+ menuRight: boolean;
914
+ borderStyle: string | null;
915
+ borderWidth: string | null;
916
+ borderColor: string | null;
917
+ borderRadiusGlobal: string | null;
918
+ borderRadiusTopLeft: string | null;
919
+ borderRadiusTopRight: string | null;
920
+ borderRadiusBottomleft: string | null;
921
+ borderRadiusBottomRight: string | null;
922
+ elementContainsHyperlink: boolean | null;
923
+ hyperlinkAbility: boolean | null;
924
+ hyperlinkInput: string | null;
925
+ hyperlinkMessage: string | null;
926
+ hyperlinkError: string | null;
927
+ hyberlinkEnable: boolean;
928
+ openHyperlinkinkInNewTab: boolean | null;
929
+ opacity: string | null;
930
+ backgroundOpacity: string | null;
931
+ textAreaVueModel: string | null;
932
+ currentClasses: string[];
933
+ currentStyles: Record<string, string>;
934
+ fontVerticalPadding: string | null;
935
+ fontHorizontalPadding: string | null;
936
+ fontTopPadding: string | null;
937
+ fontRightPadding: string | null;
938
+ fontBottomPadding: string | null;
939
+ fontLeftPadding: string | null;
940
+ fontVerticalMargin: string | null;
941
+ fontHorizontalMargin: string | null;
942
+ fontTopMargin: string | null;
943
+ fontRightMargin: string | null;
944
+ fontBottomMargin: string | null;
945
+ fontLeftMargin: string | null;
946
+ fontStyle: string | null;
947
+ fontFamily: string | null;
948
+ fontWeight: string | null;
949
+ fontBase: string | null;
950
+ fontDesktop: string | null;
951
+ fontTablet: string | null;
952
+ fontMobile: string | null;
953
+ backgroundColor: string | null;
954
+ textColor: string | null;
955
+ element: (HTMLElement & {
956
+ src?: string;
957
+ }) | null;
958
+ component: ComponentObject | null;
959
+ components: ComponentObject[];
960
+ basePrimaryImage: string | null;
961
+ imageObjectFit: string | null;
962
+ imageObjectPosition: string | null;
963
+ imageAspectRatio: string | null;
964
+ imageSettingsPanelOpen: boolean;
965
+ configPageBuilder: PageBuilderConfig | null;
966
+ showModalHTMLEditor: boolean;
967
+ toggleGlobalHtmlMode: boolean;
968
+ applyImageToSelection: ImageObject;
969
+ currentPreviewImage: string | null;
970
+ builderStarted: boolean;
971
+ isLoadingGlobal: boolean;
972
+ isSaving: boolean;
973
+ hasLocalDraftForUpdate: boolean;
974
+ isResumeEditing: boolean;
975
+ isRestoring: boolean;
976
+ currentLanguage: string | null;
977
+ historyIndex: number;
978
+ historyLength: number;
979
+ addComponentAddIndex: number | null;
980
+ }
981
+
982
+ export declare interface PageBuilderUser {
983
+ /**
984
+ * Optional stable user identifier.
985
+ * When provided, theme color presets are stored under a user-scoped localStorage
986
+ * key (`vueWebsitePageBuilderThemeColorPresets-u{id}`) so every user keeps their
987
+ * own personalized presets on the same device. Accepts any string or number that
988
+ * uniquely identifies the user in the host application (e.g. a database row id).
989
+ * Also accepts `null` for cases where the DB returns a nullable id column.
990
+ */
991
+ id?: string | number | null;
992
+ /**
993
+ * Display name shown in the builder toolbar.
994
+ * Optional so consumers can omit it or pass auth-user objects where the name
995
+ * field may be `username`, `displayName`, etc. — just pick the right field.
996
+ */
997
+ name?: string;
998
+ image?: string;
999
+ }
1000
+
1001
+ export declare interface PageSettings {
1002
+ classes?: string;
1003
+ style?: string | Record<string, string>;
1004
+ [key: string]: unknown;
1005
+ }
1006
+
1007
+ /**
1008
+ * Clear the stored theme color presets for the current user and reset the
1009
+ * in-memory state to built-in defaults.
1010
+ *
1011
+ * Useful when the user explicitly wants to "restore defaults" or when a
1012
+ * host application signs out a user and needs to clear personalization data.
1013
+ */
1014
+ export declare function resetThemeColorPresets(): void;
1015
+
1016
+ declare interface SEOCheck {
1017
+ check: string;
1018
+ passed: boolean;
1019
+ details: string;
1020
+ category: string;
1021
+ }
1022
+
1023
+ declare interface SEOSummary {
1024
+ score: number;
1025
+ checks: SEOCheck[];
1026
+ }
1027
+
1028
+ declare interface SetPushComponentsPayload {
1029
+ componentArrayAddMethod?: string;
1030
+ component: ComponentObject;
1031
+ }
1032
+
1033
+ export declare const sharedPageBuilderPinia: Pinia;
1034
+
1035
+ export declare const sharedPageBuilderStore: ReturnType<typeof usePageBuilderStateStore>;
1036
+
1037
+ export declare type StartBuilderResult = {
1038
+ error: true;
1039
+ reason: string;
1040
+ } | {
1041
+ message: string;
1042
+ validation?: {
1043
+ error: true;
1044
+ warning: string;
1045
+ status: string;
1046
+ } | {
1047
+ error: true;
1048
+ reason: string;
1049
+ };
1050
+ passedComponentsArray?: BuilderResourceData;
1051
+ };
1052
+
1053
+ export declare interface ThemeColorPreset {
1054
+ id: ThemeColorPresetId;
1055
+ label: string;
1056
+ color: string;
1057
+ enabled: boolean;
1058
+ }
1059
+
1060
+ export declare type ThemeColorPresetId = 'primary' | 'secondary' | 'custom1' | 'custom2' | 'custom3' | 'custom4' | 'custom5' | 'custom6';
1061
+
1062
+ /** Flexible input for consumer configs — id accepts any string (e.g. inferred from variables). */
1063
+ export declare interface ThemeColorPresetInput {
1064
+ id: ThemeColorPresetId | (string & {});
1065
+ label?: string;
1066
+ color?: string;
1067
+ enabled?: boolean;
1068
+ [key: string]: unknown;
1069
+ }
1070
+
1071
+ export declare interface ThemeColorPresetSettings {
1072
+ enabled: boolean;
1073
+ colors: readonly ThemeColorPreset[];
1074
+ }
1075
+
1076
+ /** Input shape for themeColorPresets in PageBuilderConfig (partial colors are normalized at runtime). */
1077
+ export declare interface ThemeColorPresetSettingsInput {
1078
+ enabled?: boolean;
1079
+ colors?: ReadonlyArray<ThemeColorPresetInput>;
1080
+ [key: string]: unknown;
1081
+ }
1082
+
1083
+ export declare function usePageBuilderModal(): {
1084
+ closeAddComponentModal: () => void;
1085
+ closeMediaLibraryModal: () => void;
1086
+ };
1087
+
1088
+ export declare const usePageBuilderStateStore: StoreDefinition<"pageBuilderState", PageBuilderState, {
1089
+ getComponentArrayAddMethod(state: PageBuilderState): string | null;
1090
+ getLocalStorageItemName(state: PageBuilderState): string | null;
1091
+ getShowModalTipTap(state: PageBuilderState): boolean;
1092
+ getMenuRight(state: PageBuilderState): boolean;
1093
+ getBorderStyle(state: PageBuilderState): string | null;
1094
+ getBorderWidth(state: PageBuilderState): string | null;
1095
+ getBorderColor(state: PageBuilderState): string | null;
1096
+ getBorderRadiusGlobal(state: PageBuilderState): string | null;
1097
+ getBorderRadiusTopLeft(state: PageBuilderState): string | null;
1098
+ getBorderRadiusTopRight(state: PageBuilderState): string | null;
1099
+ getBorderRadiusBottomleft(state: PageBuilderState): string | null;
1100
+ getBorderRadiusBottomRight(state: PageBuilderState): string | null;
1101
+ getElementContainsHyperlink(state: PageBuilderState): boolean | null;
1102
+ getHyperlinkAbility(state: PageBuilderState): boolean | null;
1103
+ getHyperlinkInput(state: PageBuilderState): string | null;
1104
+ getHyperlinkMessage(state: PageBuilderState): string | null;
1105
+ getHyperlinkError(state: PageBuilderState): string | null;
1106
+ getHyberlinkEnable(state: PageBuilderState): boolean;
1107
+ getOpenHyperlinkInNewTab(state: PageBuilderState): boolean | null;
1108
+ getOpacity(state: PageBuilderState): string | null;
1109
+ getBackgroundOpacity(state: PageBuilderState): string | null;
1110
+ getTextAreaVueModel(state: PageBuilderState): string | null;
1111
+ getCurrentClasses(state: PageBuilderState): string[];
1112
+ getCurrentStyles(state: PageBuilderState): Record<string, string>;
1113
+ getFontStyle(state: PageBuilderState): string | null;
1114
+ getFontVerticalPadding(state: PageBuilderState): string | null;
1115
+ getFontHorizontalPadding(state: PageBuilderState): string | null;
1116
+ getFontTopPadding(state: PageBuilderState): string | null;
1117
+ getFontRightPadding(state: PageBuilderState): string | null;
1118
+ getFontBottomPadding(state: PageBuilderState): string | null;
1119
+ getFontLeftPadding(state: PageBuilderState): string | null;
1120
+ getFontVerticalMargin(state: PageBuilderState): string | null;
1121
+ getFontHorizontalMargin(state: PageBuilderState): string | null;
1122
+ getFontTopMargin(state: PageBuilderState): string | null;
1123
+ getFontRightMargin(state: PageBuilderState): string | null;
1124
+ getFontBottomMargin(state: PageBuilderState): string | null;
1125
+ getFontLeftMargin(state: PageBuilderState): string | null;
1126
+ getFontFamily(state: PageBuilderState): string | null;
1127
+ getFontWeight(state: PageBuilderState): string | null;
1128
+ getFontBase(state: PageBuilderState): string | null;
1129
+ getFontDesktop(state: PageBuilderState): string | null;
1130
+ getFontTablet(state: PageBuilderState): string | null;
1131
+ getFontMobile(state: PageBuilderState): string | null;
1132
+ getBackgroundColor(state: PageBuilderState): string | null;
1133
+ getTextColor(state: PageBuilderState): string | null;
1134
+ getElement(state: PageBuilderState): HTMLElement | null;
1135
+ getComponent(state: PageBuilderState): ComponentObject | null;
1136
+ getComponents(state: PageBuilderState): ComponentObject[];
1137
+ getBasePrimaryImage(state: PageBuilderState): string | null;
1138
+ getImageObjectFit(state: PageBuilderState): string | null;
1139
+ getImageObjectPosition(state: PageBuilderState): string | null;
1140
+ getImageAspectRatio(state: PageBuilderState): string | null;
1141
+ getImageSettingsPanelOpen(state: PageBuilderState): boolean;
1142
+ getPageBuilderConfig(state: PageBuilderState): PageBuilderConfig | null;
1143
+ getShowModalHTMLEditor(state: PageBuilderState): boolean;
1144
+ getToggleGlobalHtmlMode(state: PageBuilderState): boolean;
1145
+ getApplyImageToSelection(state: PageBuilderState): ImageObject;
1146
+ getCurrentPreviewImage(state: PageBuilderState): string | null;
1147
+ getBuilderStarted: (state: PageBuilderState) => boolean;
1148
+ getIsLoadingGlobal: (state: PageBuilderState) => boolean;
1149
+ getIsSaving: (state: PageBuilderState) => boolean;
1150
+ getHasLocalDraftForUpdate: (state: PageBuilderState) => boolean;
1151
+ getIsLoadingResumeEditing: (state: PageBuilderState) => boolean;
1152
+ getIsRestoring: (state: PageBuilderState) => boolean;
1153
+ getCurrentLanguage: (state: PageBuilderState) => string | null;
1154
+ getHistoryIndex: (state: PageBuilderState) => number;
1155
+ getHistoryLength: (state: PageBuilderState) => number;
1156
+ getAddComponentAddIndex: (state: {
1157
+ componentArrayAddMethod: string | null;
1158
+ localStorageItemName: string | null;
1159
+ showModalTipTap: boolean;
1160
+ menuRight: boolean;
1161
+ borderStyle: string | null;
1162
+ borderWidth: string | null;
1163
+ borderColor: string | null;
1164
+ borderRadiusGlobal: string | null;
1165
+ borderRadiusTopLeft: string | null;
1166
+ borderRadiusTopRight: string | null;
1167
+ borderRadiusBottomleft: string | null;
1168
+ borderRadiusBottomRight: string | null;
1169
+ elementContainsHyperlink: boolean | null;
1170
+ hyperlinkAbility: boolean | null;
1171
+ hyperlinkInput: string | null;
1172
+ hyperlinkMessage: string | null;
1173
+ hyperlinkError: string | null;
1174
+ hyberlinkEnable: boolean;
1175
+ openHyperlinkinkInNewTab: boolean | null;
1176
+ opacity: string | null;
1177
+ backgroundOpacity: string | null;
1178
+ textAreaVueModel: string | null;
1179
+ currentClasses: string[];
1180
+ currentStyles: Record<string, string>;
1181
+ fontVerticalPadding: string | null;
1182
+ fontHorizontalPadding: string | null;
1183
+ fontTopPadding: string | null;
1184
+ fontRightPadding: string | null;
1185
+ fontBottomPadding: string | null;
1186
+ fontLeftPadding: string | null;
1187
+ fontVerticalMargin: string | null;
1188
+ fontHorizontalMargin: string | null;
1189
+ fontTopMargin: string | null;
1190
+ fontRightMargin: string | null;
1191
+ fontBottomMargin: string | null;
1192
+ fontLeftMargin: string | null;
1193
+ fontStyle: string | null;
1194
+ fontFamily: string | null;
1195
+ fontWeight: string | null;
1196
+ fontBase: string | null;
1197
+ fontDesktop: string | null;
1198
+ fontTablet: string | null;
1199
+ fontMobile: string | null;
1200
+ backgroundColor: string | null;
1201
+ textColor: string | null;
1202
+ element: (HTMLElement & {
1203
+ src?: string;
1204
+ }) | null;
1205
+ component: {
1206
+ [x: string]: unknown;
1207
+ id: string | number | null;
1208
+ html_code: string;
1209
+ title: string;
1210
+ } | null;
1211
+ components: {
1212
+ [x: string]: unknown;
1213
+ id: string | number | null;
1214
+ html_code: string;
1215
+ title: string;
1216
+ }[];
1217
+ basePrimaryImage: string | null;
1218
+ imageObjectFit: string | null;
1219
+ imageObjectPosition: string | null;
1220
+ imageAspectRatio: string | null;
1221
+ imageSettingsPanelOpen: boolean;
1222
+ configPageBuilder: {
1223
+ [x: string]: unknown;
1224
+ updateOrCreate: {
1225
+ [x: string]: unknown;
1226
+ formType: "create" | "update" | (string & {});
1227
+ formName: FormName | (string & {});
1228
+ };
1229
+ pageBuilderLogo?: {
1230
+ [x: string]: unknown;
1231
+ src: string;
1232
+ } | null | undefined;
1233
+ resourceData?: {
1234
+ [x: string]: unknown;
1235
+ title?: string | undefined;
1236
+ id?: number | string | undefined;
1237
+ } | null | undefined;
1238
+ userForPageBuilder?: {
1239
+ id?: string | number | null | undefined;
1240
+ name?: string | undefined;
1241
+ image?: string | undefined;
1242
+ } | undefined;
1243
+ userSettings?: {
1244
+ language?: {
1245
+ default?: string | undefined;
1246
+ enable?: readonly string[] | undefined;
1247
+ disableLanguageDropDown?: boolean | undefined;
1248
+ } | undefined;
1249
+ autoSave?: boolean | undefined;
1250
+ notifications?: boolean | undefined;
1251
+ fontFamily?: string | undefined;
1252
+ elementFonts?: {
1253
+ h1?: string | undefined;
1254
+ h2?: string | undefined;
1255
+ h3?: string | undefined;
1256
+ h4?: string | undefined;
1257
+ h5?: string | undefined;
1258
+ h6?: string | undefined;
1259
+ p?: string | undefined;
1260
+ } | undefined;
1261
+ } | null | undefined;
1262
+ settings?: {
1263
+ [x: string]: unknown;
1264
+ brandColor?: string | undefined;
1265
+ themeColorPresets?: {
1266
+ [x: string]: unknown;
1267
+ enabled?: boolean | undefined;
1268
+ colors?: readonly {
1269
+ [x: string]: unknown;
1270
+ id: ThemeColorPresetId | (string & {});
1271
+ label?: string | undefined;
1272
+ color?: string | undefined;
1273
+ enabled?: boolean | undefined;
1274
+ }[] | undefined;
1275
+ } | {
1276
+ enabled: boolean;
1277
+ colors: readonly {
1278
+ id: ThemeColorPresetId;
1279
+ label: string;
1280
+ color: string;
1281
+ enabled: boolean;
1282
+ }[];
1283
+ } | null | undefined;
1284
+ } | null | undefined;
1285
+ pageSettings?: {
1286
+ [x: string]: unknown;
1287
+ classes?: string | undefined;
1288
+ style?: (string | Record<string, string>) | undefined;
1289
+ } | undefined;
1290
+ } | null;
1291
+ showModalHTMLEditor: boolean;
1292
+ toggleGlobalHtmlMode: boolean;
1293
+ applyImageToSelection: {
1294
+ [x: string]: unknown;
1295
+ src: string;
1296
+ };
1297
+ currentPreviewImage: string | null;
1298
+ builderStarted: boolean;
1299
+ isLoadingGlobal: boolean;
1300
+ isSaving: boolean;
1301
+ hasLocalDraftForUpdate: boolean;
1302
+ isResumeEditing: boolean;
1303
+ isRestoring: boolean;
1304
+ currentLanguage: string | null;
1305
+ historyIndex: number;
1306
+ historyLength: number;
1307
+ addComponentAddIndex: number | null;
1308
+ } & PiniaCustomStateProperties<PageBuilderState>) => number | null;
1309
+ }, {
1310
+ setComponentArrayAddMethod(payload: string | null): void;
1311
+ setLocalStorageItemName(payload: string | null): void;
1312
+ setShowModalTipTap(payload: boolean): void;
1313
+ setMenuRight(payload: boolean): void;
1314
+ setBorderStyle(payload: string | null): void;
1315
+ setBorderWidth(payload: string | null): void;
1316
+ setBorderColor(payload: string | null): void;
1317
+ setBorderRadiusGlobal(payload: string | null): void;
1318
+ setBorderRadiusTopLeft(payload: string | null): void;
1319
+ setBorderRadiusTopRight(payload: string | null): void;
1320
+ setBorderRadiusBottomleft(payload: string | null): void;
1321
+ setBorderRadiusBottomRight(payload: string | null): void;
1322
+ setElementContainsHyperlink(payload: boolean | null): void;
1323
+ setHyperlinkAbility(payload: boolean | null): void;
1324
+ setHyperlinkInput(payload: string | null): void;
1325
+ setHyperlinkMessage(payload: string | null): void;
1326
+ setHyperlinkError(payload: string | null): void;
1327
+ setHyberlinkEnable(payload: boolean): void;
1328
+ setOpenHyperlinkInNewTab(payload: boolean | null): void;
1329
+ setOpacity(payload: string | null): void;
1330
+ setBackgroundOpacity(payload: string | null): void;
1331
+ setTextAreaVueModel(payload: string | null): void;
1332
+ setClass(payload: string): void;
1333
+ removeClass(payload: string): void;
1334
+ setCurrentClasses(payload: string[] | ArrayLike<string>): void;
1335
+ setCurrentStyles(payload: Record<string, string>): void;
1336
+ setFontVerticalPadding(payload: string | null): void;
1337
+ setFontHorizontalPadding(payload: string | null): void;
1338
+ setFontTopPadding(payload: string | null): void;
1339
+ setFontRightPadding(payload: string | null): void;
1340
+ setFontBottomPadding(payload: string | null): void;
1341
+ setFontLeftPadding(payload: string | null): void;
1342
+ setFontVerticalMargin(payload: string | null): void;
1343
+ setFontHorizontalMargin(payload: string | null): void;
1344
+ setFontTopMargin(payload: string | null): void;
1345
+ setFontRightMargin(payload: string | null): void;
1346
+ setFontBottomMargin(payload: string | null): void;
1347
+ setFontLeftMargin(payload: string | null): void;
1348
+ setFontStyle(payload: string | null): void;
1349
+ setFontFamily(payload: string | null): void;
1350
+ setFontWeight(payload: string | null): void;
1351
+ setFontBase(payload: string | null): void;
1352
+ setFontDesktop(payload: string | null): void;
1353
+ setFontTablet(payload: string | null): void;
1354
+ setFontMobile(payload: string | null): void;
1355
+ setBackgroundColor(payload: string | null): void;
1356
+ setTextColor(payload: string | null): void;
1357
+ setElement(payload: HTMLElement | null): void;
1358
+ setComponent(payload: ComponentObject | null): void;
1359
+ setComponents(payload: ComponentObject[] | null): void;
1360
+ setPushComponents(payload: SetPushComponentsPayload): void;
1361
+ setBasePrimaryImage(payload: string | null): void;
1362
+ setImageObjectFit(payload: string | null): void;
1363
+ setImageObjectPosition(payload: string | null): void;
1364
+ setImageAspectRatio(payload: string | null): void;
1365
+ setImageSettingsPanelOpen(payload: boolean): void;
1366
+ setCurrentLayoutPreview(payload: string): void;
1367
+ setPageBuilderConfig(payload: PageBuilderConfig | null): void;
1368
+ setShowModalHTMLEditor(payload: boolean): void;
1369
+ setToggleGlobalHtmlMode(payload: boolean): void;
1370
+ setApplyImageToSelection(payload: ImageObject): void;
1371
+ setCurrentPreviewImage(payload: string | null): void;
1372
+ setBuilderStarted(payload: boolean): void;
1373
+ setIsLoadingGlobal(payload: boolean): void;
1374
+ setIsSaving(payload: boolean): void;
1375
+ setHasLocalDraftForUpdate(payload: boolean): void;
1376
+ setIsLoadingResumeEditing(payload: boolean): void;
1377
+ setIsRestoring(payload: boolean): void;
1378
+ setCurrentLanguage(payload: string): void;
1379
+ setHistoryIndex(payload: number): void;
1380
+ setHistoryLength(payload: number): void;
1381
+ setAddComponentAddIndex(payload: number | null): void;
1382
+ }>;
1383
+
1384
+ export { }