@myissue/vue-website-page-builder 3.4.96 → 3.4.97

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 (74) hide show
  1. package/dist/App.vue.d.ts +3 -0
  2. package/dist/Components/ComponentThumbnail.vue.d.ts +15 -0
  3. package/dist/Components/Homepage/Footer.vue.d.ts +3 -0
  4. package/dist/Components/Inputs/ToggleInput.vue.d.ts +10 -0
  5. package/dist/Components/Loaders/ElementLoader.vue.d.ts +3 -0
  6. package/dist/Components/Loaders/GlobalLoader.vue.d.ts +3 -0
  7. package/dist/Components/Modals/BuilderComponents.vue.d.ts +43 -0
  8. package/dist/Components/Modals/DynamicModalBuilder.vue.d.ts +143 -0
  9. package/dist/Components/Modals/MediaLibraryModal.vue.d.ts +59 -0
  10. package/dist/Components/Modals/ModalBuilder.vue.d.ts +74 -0
  11. package/dist/Components/Overlays/FloatingSidePanel.vue.d.ts +53 -0
  12. package/dist/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue.d.ts +13 -0
  13. package/dist/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue.d.ts +3 -0
  14. package/dist/Components/PageBuilder/EditorMenu/Editables/Borders.vue.d.ts +3 -0
  15. package/dist/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue.d.ts +3 -0
  16. package/dist/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue.d.ts +3 -0
  17. package/dist/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue.d.ts +3 -0
  18. package/dist/Components/PageBuilder/EditorMenu/Editables/HTMLEditor.vue.d.ts +3 -0
  19. package/dist/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue.d.ts +3 -0
  20. package/dist/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue.d.ts +3 -0
  21. package/dist/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue.d.ts +3 -0
  22. package/dist/Components/PageBuilder/EditorMenu/Editables/Margin.vue.d.ts +3 -0
  23. package/dist/Components/PageBuilder/EditorMenu/Editables/OpacityEditor.vue.d.ts +3 -0
  24. package/dist/Components/PageBuilder/EditorMenu/Editables/Padding.vue.d.ts +3 -0
  25. package/dist/Components/PageBuilder/EditorMenu/Editables/StyleEditor.vue.d.ts +3 -0
  26. package/dist/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue.d.ts +13 -0
  27. package/dist/Components/PageBuilder/EditorMenu/Editables/Typography.vue.d.ts +3 -0
  28. package/dist/Components/PageBuilder/EditorMenu/Editables/TypographyForTipTap.vue.d.ts +3 -0
  29. package/dist/Components/PageBuilder/EditorMenu/EditorAccordion.vue.d.ts +15 -0
  30. package/dist/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue.d.ts +7 -0
  31. package/dist/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue.d.ts +15 -0
  32. package/dist/Components/PageBuilder/Settings/PageBuilderSettings.vue.d.ts +3 -0
  33. package/dist/Components/PageBuilder/ToolbarOption/ToolbarOption.vue.d.ts +3 -0
  34. package/dist/Components/PageBuilder/UndoRedo/UndoRedo.vue.d.ts +7 -0
  35. package/dist/Components/TipTap/TipTapInput.vue.d.ts +3 -0
  36. package/dist/PageBuilder/PageBuilder.vue.d.ts +48 -0
  37. package/dist/PageBuilder/Preview.vue.d.ts +13 -0
  38. package/dist/composables/builderInstance.d.ts +20 -0
  39. package/dist/composables/delay.d.ts +1 -0
  40. package/dist/composables/extractCleanHTMLFromPageBuilder.d.ts +2 -0
  41. package/dist/composables/preloadImage.d.ts +1 -0
  42. package/dist/composables/useDebounce.d.ts +1 -0
  43. package/dist/composables/usePageBuilderModal.d.ts +4 -0
  44. package/dist/composables/useTranslations.d.ts +12 -0
  45. package/dist/helpers/isEmptyObject.d.ts +1 -0
  46. package/dist/index.d.ts +10 -0
  47. package/dist/main.d.ts +0 -0
  48. package/dist/plugin.d.ts +4 -0
  49. package/dist/services/LocalStorageManager.d.ts +7 -0
  50. package/dist/services/PageBuilderService.d.ts +587 -0
  51. package/dist/stores/page-builder-state.d.ts +285 -0
  52. package/dist/stores/shared-store.d.ts +4 -0
  53. package/dist/style.css +1 -1
  54. package/dist/tests/DefaultComponents/DefaultBuilderComponents.vue.d.ts +15 -0
  55. package/dist/tests/DefaultComponents/DefaultMediaLibraryComponent.vue.d.ts +3 -0
  56. package/dist/tests/PageBuilderTest.vue.d.ts +3 -0
  57. package/dist/tests/TestComponents/DemoMediaLibraryComponentTest.vue.d.ts +3 -0
  58. package/dist/tests/TestComponents/DemoUnsplash.vue.d.ts +3 -0
  59. package/dist/tests/pageBuilderService.test.d.ts +1 -0
  60. package/dist/types/index.d.ts +201 -0
  61. package/dist/utils/builder/html-doc-declaration-with-components.d.ts +2 -0
  62. package/dist/utils/builder/tailwaind-colors.d.ts +6 -0
  63. package/dist/utils/builder/tailwind-border-radius.d.ts +9 -0
  64. package/dist/utils/builder/tailwind-border-style-width-color.d.ts +7 -0
  65. package/dist/utils/builder/tailwind-font-sizes.d.ts +8 -0
  66. package/dist/utils/builder/tailwind-font-styles.d.ts +7 -0
  67. package/dist/utils/builder/tailwind-opacities.d.ts +6 -0
  68. package/dist/utils/builder/tailwind-padding-margin.d.ts +8 -0
  69. package/dist/utils/html-elements/component.d.ts +13 -0
  70. package/dist/utils/html-elements/componentHelpers.d.ts +8 -0
  71. package/dist/utils/html-elements/themes.d.ts +13 -0
  72. package/dist/vue-website-page-builder.js +5 -3
  73. package/dist/vue-website-page-builder.umd.cjs +43 -43
  74. package/package.json +3 -2
@@ -0,0 +1,587 @@
1
+ import { BuilderResourceData, ComponentObject, ImageObject, PageBuilderConfig, PageSettings, SEOSummary, StartBuilderResult } from '../types';
2
+ import { usePageBuilderStateStore } from '../stores/page-builder-state';
3
+ export type AvailableLanguage = 'en' | 'zh-Hans' | 'fr' | 'ja' | 'ru' | 'es' | 'pt' | 'de' | 'ar' | 'hi' | 'da' | 'it';
4
+ export declare const AVAILABLE_LANGUAGES: AvailableLanguage[];
5
+ export declare class PageBuilderService {
6
+ private fontSizeRegex;
7
+ protected pageBuilderStateStore: ReturnType<typeof usePageBuilderStateStore>;
8
+ private getLocalStorageItemName;
9
+ private getApplyImageToSelection;
10
+ private getHyberlinkEnable;
11
+ private getComponents;
12
+ private getComponent;
13
+ private getElement;
14
+ private getComponentArrayAddMethod;
15
+ private NoneListernesTags;
16
+ private hasStartedEditing;
17
+ private originalComponents;
18
+ private savedMountComponents;
19
+ private pendingMountComponents;
20
+ private globalStylesObserver;
21
+ private _pendingPageSettings;
22
+ private isPageBuilderMissingOnStart;
23
+ private elementsWithListeners;
24
+ private translate;
25
+ constructor(pageBuilderStateStore: ReturnType<typeof usePageBuilderStateStore>);
26
+ /**
27
+ * Returns an array of available languages.
28
+ * @returns {AvailableLanguage[]} An array of available language codes.
29
+ */
30
+ availableLanguage(): AvailableLanguage[];
31
+ /**
32
+ * Sets the current language in the page builder state.
33
+ * @param {string} lang - The language code to set.
34
+ */
35
+ changeLanguage(lang: string): void;
36
+ /**
37
+ * Deselects any selected or hovered elements in the builder UI.
38
+ * @returns {Promise<void>}
39
+ */
40
+ clearHtmlSelection(): Promise<void>;
41
+ /**
42
+ * Ensures that the `updateOrCreate` configuration is valid and sets default values if necessary.
43
+ * @param {PageBuilderConfig} config - The page builder configuration.
44
+ * @private
45
+ */
46
+ private ensureUpdateOrCreateConfig;
47
+ /**
48
+ * Validates the user-provided components array.
49
+ * @param {unknown} components - The components data to validate.
50
+ * @returns {{error: true, warning: string, status: string} | {error: true, reason: string} | undefined} An error object if validation fails, otherwise undefined.
51
+ * @private
52
+ */
53
+ private validateUserProvidedComponents;
54
+ /**
55
+ * Ensures that the language configuration is valid and sets default values if necessary.
56
+ * @param {PageBuilderConfig} config - The page builder configuration.
57
+ * @private
58
+ */
59
+ private ensureLanguage;
60
+ /**
61
+ * Validates the entire page builder configuration.
62
+ * @param {PageBuilderConfig} config - The page builder configuration.
63
+ * @private
64
+ */
65
+ private validateConfig;
66
+ /**
67
+ * Saves user settings to local storage.
68
+ * @param {string} newLang - The new language to save.
69
+ */
70
+ saveUserSettingsStorage(newLang: string): void;
71
+ /**
72
+ * Initializes the Page Builder.
73
+ * @param {PageBuilderConfig} config - The configuration object for the Page Builder.
74
+ * @param {BuilderResourceData} [passedComponentsArray] - Optional array of components to load.
75
+ * @returns {Promise<StartBuilderResult>} A result object indicating success or failure.
76
+ */
77
+ startBuilder(config: PageBuilderConfig, passedComponentsArray?: BuilderResourceData): Promise<StartBuilderResult>;
78
+ /**
79
+ * Completes the builder initialization process once the DOM is ready.
80
+ * @param {BuilderResourceData} [passedComponentsArray] - Optional array of components to load.
81
+ * @returns {Promise<void>}
82
+ */
83
+ completeBuilderInitialization(passedComponentsArray?: BuilderResourceData): Promise<void>;
84
+ /**
85
+ * Converts an array of ComponentObject into a single HTML string.
86
+ *
87
+ * @returns {string} A single HTML string containing all components.
88
+ */
89
+ private renderComponentsToHtml;
90
+ /**
91
+ * Completes the mounting process by loading components into the DOM and setting up listeners.
92
+ * @param {string} html - The HTML string of components to mount.
93
+ * @param {boolean} [useConfigPageSettings] - Whether to use page settings from the passed data.
94
+ * @private
95
+ */
96
+ private completeMountProcess;
97
+ /**
98
+ * Applies CSS class changes to the currently selected element.
99
+ * @param {string | undefined} cssUserSelection - The user's CSS class selection.
100
+ * @param {string[]} CSSArray - The array of possible CSS classes for this property.
101
+ * @param {string} mutationName - The name of the store mutation to call.
102
+ * @returns {string | undefined} The previously applied CSS class.
103
+ * @private
104
+ */
105
+ private applyElementClassChanges;
106
+ /**
107
+ * Removes all CSS classes from the main page builder container.
108
+ * @returns {Promise<void>}
109
+ */
110
+ clearClassesFromPage(): Promise<void>;
111
+ /**
112
+ * Removes all inline styles from the main page builder container.
113
+ * @returns {Promise<void>}
114
+ */
115
+ clearInlineStylesFromPage(): Promise<void>;
116
+ /**
117
+ * Selects the main page builder container for global styling.
118
+ * @returns {Promise<void>}
119
+ */
120
+ globalPageStyles(): Promise<void>;
121
+ /**
122
+ * Disconnects the MutationObserver that syncs global page style changes across
123
+ * all [data-pagebuilder-content] section wrappers. Call when closing the global
124
+ * styles editor panel.
125
+ */
126
+ stopGlobalStylesSync(): void;
127
+ /**
128
+ * Handles changes to the font weight of the selected element.
129
+ * @param {string} [userSelectedFontWeight] - The selected font weight class.
130
+ */
131
+ handleFontWeight(userSelectedFontWeight?: string): void;
132
+ /**
133
+ * Handles changes to the base font size of the selected element.
134
+ * @param {string} [userSelectedFontSize] - The selected font size class.
135
+ */
136
+ handleFontSizeBase(userSelectedFontSize?: string): void;
137
+ /**
138
+ * Handles changes to the desktop font size of the selected element.
139
+ * @param {string} [userSelectedFontSize] - The selected font size class for desktop.
140
+ */
141
+ handleFontSizeDesktop(userSelectedFontSize?: string): void;
142
+ /**
143
+ * Applies helper CSS classes to elements, such as wrapping them or adding responsive text classes.
144
+ * @param {HTMLElement} element - The element to process.
145
+ * @private
146
+ */
147
+ private ensureImagesHaveAltText;
148
+ private applyHelperCSSToElements;
149
+ /**
150
+ * Toggles the visibility of the TipTap modal for rich text editing.
151
+ * @param {boolean} status - Whether to show or hide the modal.
152
+ * @returns {Promise<void>}
153
+ */
154
+ toggleTipTapModal(status: boolean): Promise<void>;
155
+ /**
156
+ * Wraps an element in a div if it's an excluded tag and adjacent to an image.
157
+ * @param {HTMLElement} element - The element to potentially wrap.
158
+ * @private
159
+ */
160
+ private wrapElementInDivIfExcluded;
161
+ /**
162
+ * Handles the mouseover event for editable elements, showing a hover state.
163
+ * @param {Event} e - The mouse event.
164
+ * @param {HTMLElement} element - The element being hovered over.
165
+ * @private
166
+ */
167
+ private handleMouseOver;
168
+ /**
169
+ * Handles the mouseleave event for editable elements, removing the hover state.
170
+ * @param {Event} e - The mouse event.
171
+ * @private
172
+ */
173
+ private handleMouseLeave;
174
+ /**
175
+ * Checks if an element is editable based on its tag name.
176
+ * @param {Element | null} el - The element to check.
177
+ * @returns {boolean} True if the element is editable, false otherwise.
178
+ */
179
+ isEditableElement(el: Element | null): boolean;
180
+ /**
181
+ * Attaches click, mouseover, and mouseleave event listeners to all editable elements in the page builder.
182
+ * @private
183
+ */
184
+ private addListenersToEditableElements;
185
+ /**
186
+ * Handles the click event for editable elements, setting the element as selected.
187
+ * @param {Event} e - The click event.
188
+ * @param {HTMLElement} element - The clicked element.
189
+ * @private
190
+ */
191
+ private handleElementClick;
192
+ private getHistoryBaseKey;
193
+ private initializeHistory;
194
+ /**
195
+ * Triggers an auto-save of the current page builder content to local storage if enabled.
196
+ */
197
+ handleAutoSave: () => Promise<void>;
198
+ /**
199
+ * Manually saves the current page builder content to local storage.
200
+ */
201
+ handleManualSave: (doNoClearHTML?: boolean) => Promise<void>;
202
+ /**
203
+ * Clones a component object and prepares it for insertion into the DOM by adding unique IDs and prefixes.
204
+ * @param {ComponentObject} componentObject - The component object to clone.
205
+ * @returns {ComponentObject} The cloned and prepared component object.
206
+ */
207
+ cloneCompObjForDOMInsertion(componentObject: ComponentObject): ComponentObject;
208
+ /**
209
+ * Removes the 'hovered' and 'selected' attributes from all elements in the page builder.
210
+ * @private
211
+ */
212
+ private removeHoveredAndSelected;
213
+ /**
214
+ * Syncs the CSS classes of the currently selected element to the state store.
215
+ * @private
216
+ */
217
+ private syncCurrentClasses;
218
+ /**
219
+ * Syncs the inline styles of the currently selected element to the state store.
220
+ * @private
221
+ */
222
+ private syncCurrentStyles;
223
+ /**
224
+ * Adds a CSS class to the currently selected element.
225
+ * @param {string} userSelectedClass - The class to add.
226
+ */
227
+ handleAddClasses(userSelectedClass: string): void;
228
+ /**
229
+ * Adds or updates an inline style property on the currently selected element.
230
+ * @param {string} property - The CSS property to add/update.
231
+ * @param {string} value - The value of the CSS property.
232
+ */
233
+ handleAddStyle(property: string, value: string): void;
234
+ /**
235
+ * Removes an inline style property from the currently selected element.
236
+ * @param {string} property - The CSS property to remove.
237
+ */
238
+ handleRemoveStyle(property: string): void;
239
+ /**
240
+ * Handles changes to the font family of the selected element.
241
+ * @param {string} [userSelectedFontFamily] - The selected font family class.
242
+ */
243
+ handleFontFamily(userSelectedFontFamily?: string): void;
244
+ /**
245
+ * Handles changes to the font style of the selected element.
246
+ * @param {string} [userSelectedFontStyle] - The selected font style class.
247
+ */
248
+ handleFontStyle(userSelectedFontStyle?: string): void;
249
+ /**
250
+ * Handles changes to the vertical padding of the selected element.
251
+ * @param {string} [userSelectedVerticalPadding] - The selected vertical padding class.
252
+ */
253
+ handleVerticalPadding(userSelectedVerticalPadding?: string): void;
254
+ /**
255
+ * Handles changes to the horizontal padding of the selected element.
256
+ * @param {string} [userSelectedHorizontalPadding] - The selected horizontal padding class.
257
+ */
258
+ handleHorizontalPadding(userSelectedHorizontalPadding?: string): void;
259
+ /**
260
+ * Handles changes to the vertical margin of the selected element.
261
+ * @param {string} [userSelectedVerticalMargin] - The selected vertical margin class.
262
+ */
263
+ handleVerticalMargin(userSelectedVerticalMargin?: string): void;
264
+ /**
265
+ * Handles changes to the horizontal margin of the selected element.
266
+ * @param {string} [userSelectedHorizontalMargin] - The selected horizontal margin class.
267
+ */
268
+ handleHorizontalMargin(userSelectedHorizontalMargin?: string): void;
269
+ /**
270
+ * Handles changes to the border style of the selected element.
271
+ * @param {string} [borderStyle] - The selected border style class.
272
+ */
273
+ handleBorderStyle(borderStyle?: string): void;
274
+ /**
275
+ * Handles changes to the border width of the selected element.
276
+ * @param {string} [borderWidth] - The selected border width class.
277
+ */
278
+ handleBorderWidth(borderWidth?: string): void;
279
+ /**
280
+ * Handles changes to the border color of the selected element.
281
+ * @param {string} [borderColor] - The selected border color class.
282
+ */
283
+ handleBorderColor(borderColor?: string): void;
284
+ /**
285
+ * Handles changes to the background color of the selected element.
286
+ * @param {string} [color] - The selected background color class.
287
+ */
288
+ handleBackgroundColor(color?: string): void;
289
+ /**
290
+ * Handles changes to the text color of the selected element.
291
+ * @param {string} [color] - The selected text color class.
292
+ */
293
+ handleTextColor(color?: string): void;
294
+ /**
295
+ * Handles changes to the global border radius of the selected element.
296
+ * @param {string} [borderRadiusGlobal] - The selected global border radius class.
297
+ */
298
+ handleBorderRadiusGlobal(borderRadiusGlobal?: string): void;
299
+ /**
300
+ * Handles changes to the top-left border radius of the selected element.
301
+ * @param {string} [borderRadiusTopLeft] - The selected top-left border radius class.
302
+ */
303
+ handleBorderRadiusTopLeft(borderRadiusTopLeft?: string): void;
304
+ /**
305
+ * Handles changes to the top-right border radius of the selected element.
306
+ * @param {string} [borderRadiusTopRight] - The selected top-right border radius class.
307
+ */
308
+ handleBorderRadiusTopRight(borderRadiusTopRight?: string): void;
309
+ /**
310
+ * Handles changes to the bottom-left border radius of the selected element.
311
+ * @param {string} [borderRadiusBottomleft] - The selected bottom-left border radius class.
312
+ */
313
+ handleBorderRadiusBottomleft(borderRadiusBottomleft?: string): void;
314
+ /**
315
+ * Handles changes to the bottom-right border radius of the selected element.
316
+ * @param {string} [borderRadiusBottomRight] - The selected bottom-right border radius class.
317
+ */
318
+ handleBorderRadiusBottomRight(borderRadiusBottomRight?: string): void;
319
+ /**
320
+ * Handles changes to the tablet font size of the selected element.
321
+ * @param {string} [userSelectedFontSize] - The selected font size class for tablet.
322
+ */
323
+ handleFontSizeTablet(userSelectedFontSize?: string): void;
324
+ /**
325
+ * Handles changes to the mobile font size of the selected element.
326
+ * @param {string} [userSelectedFontSize] - The selected font size class for mobile.
327
+ */
328
+ handleFontSizeMobile(userSelectedFontSize?: string): void;
329
+ /**
330
+ * Handles changes to the background opacity of the selected element.
331
+ * @param {string} [opacity] - The selected background opacity class.
332
+ */
333
+ handleBackgroundOpacity(opacity?: string): void;
334
+ /**
335
+ * Handles changes to the opacity of the selected element.
336
+ * @param {string} [opacity] - The selected opacity class.
337
+ */
338
+ handleOpacity(opacity?: string): void;
339
+ /**
340
+ * Removes all components from both the builder state and the DOM.
341
+ * @private
342
+ */
343
+ private deleteAllComponentsFromDOM;
344
+ undo(): Promise<void>;
345
+ redo(): Promise<void>;
346
+ private hasVisibleContent;
347
+ private isSectionEmpty;
348
+ /**
349
+ * Duplicate the currently selected component from the DOM and the state.
350
+ * @returns {Promise<void>}
351
+ */
352
+ duplicateComponent(): Promise<void>;
353
+ /**
354
+ * Deletes the currently selected component from the DOM and the state.
355
+ * @returns {Promise<void>}
356
+ */
357
+ deleteComponentFromDOM(): Promise<void>;
358
+ /**
359
+ * Deletes the currently selected element from the DOM and stores it for potential restoration.
360
+ * @returns {Promise<void>}
361
+ */
362
+ deleteElementFromDOM(): Promise<void>;
363
+ /**
364
+ * Removes a CSS class from the currently selected element.
365
+ * @param {string} userSelectedClass - The class to remove.
366
+ */
367
+ handleRemoveClasses(userSelectedClass: string): void;
368
+ /**
369
+ * Reorders the currently selected component up or down in the component list.
370
+ * @param {number} direction - The direction to move the component (-1 for up, 1 for down).
371
+ */
372
+ reorderComponent(direction: number): Promise<void>;
373
+ /**
374
+ * Checks if the currently selected component can be moved up.
375
+ * @returns {boolean} True if the component can be moved up, false otherwise.
376
+ */
377
+ canMoveUp(): boolean;
378
+ /**
379
+ * Checks if the currently selected component can be moved down.
380
+ * @returns {boolean} True if the component can be moved down, false otherwise.
381
+ */
382
+ canMoveDown(): boolean;
383
+ /**
384
+ * Ensures that a text area element has content, adding a visual indicator if it's empty.
385
+ */
386
+ ensureTextAreaHasContent: () => void;
387
+ /**
388
+ * Handles text input for an element, updating its content.
389
+ * @param {string} textContentVueModel - The new text content from the Vue model.
390
+ * @returns {Promise<void>}
391
+ */
392
+ handleTextInput: (textContentVueModel: string) => Promise<void>;
393
+ /**
394
+ * Checks if the selected element or its first child is an iframe.
395
+ * @returns {boolean} True if it is an iframe, false otherwise.
396
+ */
397
+ ElOrFirstChildIsIframe(): boolean;
398
+ /**
399
+ * Checks if the selected element is a valid text container (i.e., does not contain images or divs).
400
+ * @returns {boolean | undefined} True if it's a valid text element, otherwise undefined.
401
+ */
402
+ isSelectedElementValidText(): false | undefined;
403
+ /**
404
+ * Generates a preview of the current page design.
405
+ */
406
+ previewCurrentDesign(): void;
407
+ /**
408
+ * Sanitizes a string to be used as a key in local storage.
409
+ * @param {string} input - The string to sanitize.
410
+ * @returns {string} The sanitized string.
411
+ */
412
+ sanitizeForLocalStorage(input: string): string;
413
+ /**
414
+ * Clones an element and removes selection-related attributes from the clone.
415
+ * @param {HTMLElement} element - The element to clone.
416
+ * @returns {HTMLElement} The sanitized clone.
417
+ * @private
418
+ */
419
+ private cloneAndRemoveSelectionAttributes;
420
+ /**
421
+ * Syncs the current DOM state of components to the in-memory store.
422
+ * @private
423
+ */
424
+ syncDomToStoreOnly(): void;
425
+ generateHtmlFromComponents(): Promise<string>;
426
+ /**
427
+ * Saves the current DOM state of components to local storage.
428
+ * @private
429
+ */
430
+ private saveDomComponentsToLocalStorage;
431
+ /**
432
+ * Removes the current page's components from local storage.
433
+ * @private
434
+ */
435
+ private removeCurrentComponentsFromLocalStorage;
436
+ /**
437
+ * Handles the form submission process, clearing local storage and the DOM.
438
+ * @returns {Promise<void>}
439
+ */
440
+ handleFormSubmission(): Promise<void>;
441
+ /**
442
+ * Parses a CSS style string into a key-value object.
443
+ * @param {string} style - The style string to parse.
444
+ * @returns {Record<string, string>} The parsed style object.
445
+ * @private
446
+ */
447
+ private parseStyleString;
448
+ /**
449
+ * Deletes old page builder data from local storage (older than 2 weeks).
450
+ */
451
+ deleteOldPageBuilderLocalStorage(): void;
452
+ /**
453
+ * Sets a flag to indicate that the user has started editing.
454
+ */
455
+ startEditing(): void;
456
+ /**
457
+ * Re-attaches click/hover listeners to any newly added DOM elements.
458
+ * Call this after programmatically inserting elements into the builder canvas.
459
+ */
460
+ refreshListeners(): Promise<void>;
461
+ /**
462
+ * Resumes editing from a draft saved in local storage.
463
+ * @returns {Promise<void>}
464
+ */
465
+ resumeEditingFromDraft(): Promise<void>;
466
+ /**
467
+ * Restores the original content that was loaded when the builder started.
468
+ * @returns {Promise<void>}
469
+ */
470
+ restoreOriginalContent(): Promise<void>;
471
+ returnLatestComponents(): Promise<ComponentObject[]>;
472
+ /**
473
+ * Gets the local storage key for the current resource.
474
+ * @returns {string | null} The local storage key.
475
+ */
476
+ getStorageItemNameForResource(): string | null;
477
+ /**
478
+ * Retrieves the saved page HTML from local storage.
479
+ * @returns {string | false} The HTML string or false if not found.
480
+ */
481
+ getSavedPageHtml(): string | false;
482
+ /**
483
+ * Applies a selected image to the current element.
484
+ * @param {ImageObject} image - The image object to apply.
485
+ * @returns {Promise<void>}
486
+ */
487
+ applySelectedImage(image: ImageObject): Promise<void>;
488
+ /**
489
+ * Sets the base primary image from the currently selected element if it's an image.
490
+ * @private
491
+ */
492
+ private setBasePrimaryImageFromSelectedElement;
493
+ /**
494
+ * Adds or removes a hyperlink from the selected element.
495
+ * @param {boolean} hyperlinkEnable - Whether to enable or disable the hyperlink.
496
+ * @param {string | null} urlInput - The URL for the hyperlink.
497
+ * @param {boolean} openHyperlinkInNewTab - Whether the link should open in a new tab.
498
+ * @private
499
+ */
500
+ private addHyperlinkToElement;
501
+ /**
502
+ * Checks if the selected element contains a hyperlink and updates the state accordingly.
503
+ * @private
504
+ */
505
+ private checkForHyperlink;
506
+ /**
507
+ * Handles all hyperlink-related actions for the selected element.
508
+ * @param {boolean} [hyperlinkEnable] - Whether to enable or disable the hyperlink.
509
+ * @param {string | null} [urlInput] - The URL for the hyperlink.
510
+ * @param {boolean} [openHyperlinkInNewTab] - Whether the link should open in a new tab.
511
+ */
512
+ handleHyperlink(hyperlinkEnable?: boolean, urlInput?: string | null, openHyperlinkInNewTab?: boolean): void;
513
+ addTheme(components: string): Promise<void>;
514
+ analyzeSEO(): Promise<SEOSummary>;
515
+ /**
516
+ * Adds a new component to the page builder.
517
+ * @param {ComponentObject} componentObject - The component to add.
518
+ * @returns {Promise<void>}
519
+ */
520
+ addComponent(componentObject: ComponentObject): Promise<void>;
521
+ /**
522
+ * Adds a prefix to Tailwind CSS classes in a string.
523
+ * @param {string} classList - The string of classes.
524
+ * @param {string} [prefix='pbx-'] - The prefix to add.
525
+ * @returns {string} The prefixed class string.
526
+ * @private
527
+ */
528
+ private addTailwindPrefixToClasses;
529
+ /**
530
+ * Converts a style object to a CSS string.
531
+ * @param {string | Record<string, string> | null | undefined} styleObj - The style object.
532
+ * @returns {string} The CSS style string.
533
+ * @private
534
+ */
535
+ private convertStyleObjectToString;
536
+ /**
537
+ * Parses a string of HTML and extracts builder components and global page settings.
538
+ * - 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).
539
+ * - **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.
540
+ * - 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.
541
+ *
542
+ * Why only HTML?
543
+ * - It enforces a single source of truth for builder state (HTML).
544
+ * - It prevents misuse (e.g., passing JSON to a DOM parser, which is always a bug).
545
+ * - It makes your documentation and support much simpler.
546
+ *
547
+ * @param htmlString - The HTML string to parse (must contain `<section>...</section>` elements, not JSON).
548
+ * @returns An object with `components` (array of builder components) and `pageSettings` (global styles for the page).
549
+ */
550
+ parsePageBuilderHTML(htmlString: string): {
551
+ components: ComponentObject[];
552
+ pageSettings: PageSettings;
553
+ };
554
+ /**
555
+ * Applies modified components by mounting them to the DOM and attaching listeners.
556
+ * @param htmlString - The HTML string to apply
557
+ * @returns {Promise<string | null>} - Returns error message if failed, otherwise null
558
+ */
559
+ applyModifiedHTML(htmlString: string): Promise<string | null>;
560
+ private validateMountingHTML;
561
+ /**
562
+ * Applies modified components by mounting them to the DOM and attaching listeners.
563
+ * @param htmlString - The HTML string to apply
564
+ * @returns {Promise<string | null>} - Returns error message if failed, otherwise null
565
+ */
566
+ applyModifiedComponents(htmlString: string): Promise<string | null>;
567
+ /**
568
+ * Mounts builder components to the DOM from an HTML string.
569
+ *
570
+ * Input format detection:
571
+ * - If the input starts with `[` or `{`: treated as JSON (array or object).
572
+ * - If the input starts with `<`: treated as HTML.
573
+ *
574
+ * This function should be used when:
575
+ * - Restoring the builder from a published HTML snapshot.
576
+ * - Importing a static HTML export.
577
+ * - Loading the builder from previously published or saved HTML (e.g., from `getSavedPageHtml()`).
578
+ *
579
+ * Typical use cases include restoring a published state, importing templates, or previewing published content.
580
+ */
581
+ private mountComponentsToDOM;
582
+ private updateLocalStorageItemName;
583
+ /**
584
+ * Initializes the styles for the currently selected element.
585
+ */
586
+ initializeElementStyles(): Promise<void>;
587
+ }