@myissue/vue-website-page-builder 3.5.3 → 3.5.5

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 (56) hide show
  1. package/README.md +33 -1
  2. package/dist/App.vue.d.ts +1 -2
  3. package/dist/Components/ComponentThumbnail.vue.d.ts +8 -4
  4. package/dist/Components/Homepage/Footer.vue.d.ts +1 -2
  5. package/dist/Components/Inputs/ToggleInput.vue.d.ts +1 -2
  6. package/dist/Components/Loaders/ElementLoader.vue.d.ts +1 -2
  7. package/dist/Components/Loaders/GlobalLoader.vue.d.ts +1 -2
  8. package/dist/Components/Modals/BuilderComponents.vue.d.ts +1 -2
  9. package/dist/Components/Modals/DynamicModalBuilder.vue.d.ts +7 -8
  10. package/dist/Components/Modals/MediaLibraryModal.vue.d.ts +1 -2
  11. package/dist/Components/Modals/ModalBuilder.vue.d.ts +4 -5
  12. package/dist/Components/Overlays/FloatingSidePanel.vue.d.ts +4 -5
  13. package/dist/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue.d.ts +1 -2
  14. package/dist/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue.d.ts +1 -2
  15. package/dist/Components/PageBuilder/EditorMenu/Editables/Borders.vue.d.ts +1 -2
  16. package/dist/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue.d.ts +1 -2
  17. package/dist/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue.d.ts +1 -2
  18. package/dist/Components/PageBuilder/EditorMenu/Editables/EditGetElement.vue.d.ts +5 -2
  19. package/dist/Components/PageBuilder/EditorMenu/Editables/HTMLEditor.vue.d.ts +1 -2
  20. package/dist/Components/PageBuilder/EditorMenu/Editables/ImageEditor.vue.d.ts +1 -2
  21. package/dist/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue.d.ts +1 -2
  22. package/dist/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue.d.ts +1 -2
  23. package/dist/Components/PageBuilder/EditorMenu/Editables/Margin.vue.d.ts +1 -2
  24. package/dist/Components/PageBuilder/EditorMenu/Editables/OpacityEditor.vue.d.ts +1 -2
  25. package/dist/Components/PageBuilder/EditorMenu/Editables/Padding.vue.d.ts +1 -2
  26. package/dist/Components/PageBuilder/EditorMenu/Editables/StyleEditor.vue.d.ts +1 -2
  27. package/dist/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue.d.ts +1 -2
  28. package/dist/Components/PageBuilder/EditorMenu/Editables/ThemeColorPresetManager.vue.d.ts +2 -0
  29. package/dist/Components/PageBuilder/EditorMenu/Editables/Typography.vue.d.ts +1 -2
  30. package/dist/Components/PageBuilder/EditorMenu/Editables/TypographyForTipTap.vue.d.ts +1 -2
  31. package/dist/Components/PageBuilder/EditorMenu/EditorAccordion.vue.d.ts +2 -3
  32. package/dist/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue.d.ts +1 -2
  33. package/dist/Components/PageBuilder/Settings/AdvancedPageBuilderSettings.vue.d.ts +1 -2
  34. package/dist/Components/PageBuilder/Settings/PageBuilderSettings.vue.d.ts +1 -2
  35. package/dist/Components/PageBuilder/ToolbarOption/ToolbarOption.vue.d.ts +1 -2
  36. package/dist/Components/PageBuilder/UndoRedo/UndoRedo.vue.d.ts +1 -2
  37. package/dist/Components/TipTap/TipTapInput.vue.d.ts +1 -2
  38. package/dist/PageBuilder/PageBuilder.vue.d.ts +1 -2
  39. package/dist/PageBuilder/Preview.vue.d.ts +1 -2
  40. package/dist/composables/useThemeColorPresets.d.ts +47 -0
  41. package/dist/index.d.ts +2 -1
  42. package/dist/services/PageBuilderService.d.ts +56 -0
  43. package/dist/stores/page-builder-state.d.ts +61 -6
  44. package/dist/style.css +1 -1
  45. package/dist/tests/DefaultComponents/DefaultBuilderComponents.vue.d.ts +1 -2
  46. package/dist/tests/DefaultComponents/DefaultMediaLibraryComponent.vue.d.ts +1 -2
  47. package/dist/tests/PageBuilderTest.vue.d.ts +1 -2
  48. package/dist/tests/TestComponents/DemoMediaLibraryComponentTest.vue.d.ts +1 -2
  49. package/dist/tests/TestComponents/DemoUnsplash.vue.d.ts +1 -2
  50. package/dist/tests/composables/useThemeColorPresets.test.d.ts +16 -0
  51. package/dist/types/index.d.ts +76 -6
  52. package/dist/utils/builder/tailwind-padding-margin.d.ts +8 -0
  53. package/dist/utils/html-elements/componentHelpers.d.ts +1 -0
  54. package/dist/vue-website-page-builder.js +12936 -10943
  55. package/dist/vue-website-page-builder.umd.cjs +85 -69
  56. package/package.json +1 -1
@@ -19,6 +19,7 @@ export declare class PageBuilderService {
19
19
  private pendingMountComponents;
20
20
  private globalStylesObserver;
21
21
  private _pendingPageSettings;
22
+ private _lastKnownPageSettings;
22
23
  private isPageBuilderMissingOnStart;
23
24
  private elementsWithListeners;
24
25
  private translate;
@@ -103,6 +104,7 @@ export declare class PageBuilderService {
103
104
  * @private
104
105
  */
105
106
  private applyElementClassChanges;
107
+ private removeElementClassesFromArray;
106
108
  /**
107
109
  * Removes all CSS classes from the main page builder container.
108
110
  * @returns {Promise<void>}
@@ -177,6 +179,10 @@ export declare class PageBuilderService {
177
179
  * @returns {boolean} True if the element is editable, false otherwise.
178
180
  */
179
181
  isEditableElement(el: Element | null): boolean;
182
+ getSelectedComponentSection(): HTMLElement | null;
183
+ isSelectedComponentTopElement(): boolean;
184
+ selectedComponentIsFullWidth(): boolean;
185
+ setSelectedComponentFullWidth(enabled: boolean): Promise<void>;
180
186
  /**
181
187
  * Attaches click, mouseover, and mouseleave event listeners to all editable elements in the page builder.
182
188
  * @private
@@ -256,6 +262,26 @@ export declare class PageBuilderService {
256
262
  * @param {string} [userSelectedHorizontalPadding] - The selected horizontal padding class.
257
263
  */
258
264
  handleHorizontalPadding(userSelectedHorizontalPadding?: string): void;
265
+ /**
266
+ * Handles changes to the top padding of the selected element.
267
+ * @param {string} [userSelectedTopPadding] - The selected top padding class.
268
+ */
269
+ handleTopPadding(userSelectedTopPadding?: string): void;
270
+ /**
271
+ * Handles changes to the right padding of the selected element.
272
+ * @param {string} [userSelectedRightPadding] - The selected right padding class.
273
+ */
274
+ handleRightPadding(userSelectedRightPadding?: string): void;
275
+ /**
276
+ * Handles changes to the bottom padding of the selected element.
277
+ * @param {string} [userSelectedBottomPadding] - The selected bottom padding class.
278
+ */
279
+ handleBottomPadding(userSelectedBottomPadding?: string): void;
280
+ /**
281
+ * Handles changes to the left padding of the selected element.
282
+ * @param {string} [userSelectedLeftPadding] - The selected left padding class.
283
+ */
284
+ handleLeftPadding(userSelectedLeftPadding?: string): void;
259
285
  /**
260
286
  * Handles changes to the vertical margin of the selected element.
261
287
  * @param {string} [userSelectedVerticalMargin] - The selected vertical margin class.
@@ -266,6 +292,26 @@ export declare class PageBuilderService {
266
292
  * @param {string} [userSelectedHorizontalMargin] - The selected horizontal margin class.
267
293
  */
268
294
  handleHorizontalMargin(userSelectedHorizontalMargin?: string): void;
295
+ /**
296
+ * Handles changes to the top margin of the selected element.
297
+ * @param {string} [userSelectedTopMargin] - The selected top margin class.
298
+ */
299
+ handleTopMargin(userSelectedTopMargin?: string): void;
300
+ /**
301
+ * Handles changes to the right margin of the selected element.
302
+ * @param {string} [userSelectedRightMargin] - The selected right margin class.
303
+ */
304
+ handleRightMargin(userSelectedRightMargin?: string): void;
305
+ /**
306
+ * Handles changes to the bottom margin of the selected element.
307
+ * @param {string} [userSelectedBottomMargin] - The selected bottom margin class.
308
+ */
309
+ handleBottomMargin(userSelectedBottomMargin?: string): void;
310
+ /**
311
+ * Handles changes to the left margin of the selected element.
312
+ * @param {string} [userSelectedLeftMargin] - The selected left margin class.
313
+ */
314
+ handleLeftMargin(userSelectedLeftMargin?: string): void;
269
315
  /**
270
316
  * Handles changes to the border style of the selected element.
271
317
  * @param {string} [borderStyle] - The selected border style class.
@@ -286,11 +332,13 @@ export declare class PageBuilderService {
286
332
  * @param {string} [color] - The selected background color class.
287
333
  */
288
334
  handleBackgroundColor(color?: string): void;
335
+ handleCustomBackgroundColor(color: string): void;
289
336
  /**
290
337
  * Handles changes to the text color of the selected element.
291
338
  * @param {string} [color] - The selected text color class.
292
339
  */
293
340
  handleTextColor(color?: string): void;
341
+ handleCustomTextColor(color: string): void;
294
342
  /**
295
343
  * Handles changes to the global border radius of the selected element.
296
344
  * @param {string} [borderRadiusGlobal] - The selected global border radius class.
@@ -435,9 +483,17 @@ export declare class PageBuilderService {
435
483
  private removeCurrentComponentsFromLocalStorage;
436
484
  /**
437
485
  * Handles the form submission process, clearing local storage and the DOM.
486
+ * Global page settings (classes / inline styles on the content wrapper) are
487
+ * intentionally preserved so they survive a "remove all components" action.
438
488
  * @returns {Promise<void>}
439
489
  */
440
490
  handleFormSubmission(): Promise<void>;
491
+ /**
492
+ * Reads the current page settings.
493
+ * Prioritises the live DOM (always current) and falls back to localStorage
494
+ * if there are no [data-pagebuilder-content] elements.
495
+ */
496
+ private readCurrentPageSettings;
441
497
  /**
442
498
  * Parses a CSS style string into a key-value object.
443
499
  * @param {string} style - The style string to parse.
@@ -26,8 +26,16 @@ interface PageBuilderState {
26
26
  currentStyles: Record<string, string>;
27
27
  fontVerticalPadding: string | null;
28
28
  fontHorizontalPadding: string | null;
29
+ fontTopPadding: string | null;
30
+ fontRightPadding: string | null;
31
+ fontBottomPadding: string | null;
32
+ fontLeftPadding: string | null;
29
33
  fontVerticalMargin: string | null;
30
34
  fontHorizontalMargin: string | null;
35
+ fontTopMargin: string | null;
36
+ fontRightMargin: string | null;
37
+ fontBottomMargin: string | null;
38
+ fontLeftMargin: string | null;
31
39
  fontStyle: string | null;
32
40
  fontFamily: string | null;
33
41
  fontWeight: string | null;
@@ -87,8 +95,16 @@ export declare const usePageBuilderStateStore: import('pinia').StoreDefinition<"
87
95
  getFontStyle(state: PageBuilderState): string | null;
88
96
  getFontVerticalPadding(state: PageBuilderState): string | null;
89
97
  getFontHorizontalPadding(state: PageBuilderState): string | null;
98
+ getFontTopPadding(state: PageBuilderState): string | null;
99
+ getFontRightPadding(state: PageBuilderState): string | null;
100
+ getFontBottomPadding(state: PageBuilderState): string | null;
101
+ getFontLeftPadding(state: PageBuilderState): string | null;
90
102
  getFontVerticalMargin(state: PageBuilderState): string | null;
91
103
  getFontHorizontalMargin(state: PageBuilderState): string | null;
104
+ getFontTopMargin(state: PageBuilderState): string | null;
105
+ getFontRightMargin(state: PageBuilderState): string | null;
106
+ getFontBottomMargin(state: PageBuilderState): string | null;
107
+ getFontLeftMargin(state: PageBuilderState): string | null;
92
108
  getFontFamily(state: PageBuilderState): string | null;
93
109
  getFontWeight(state: PageBuilderState): string | null;
94
110
  getFontBase(state: PageBuilderState): string | null;
@@ -142,8 +158,16 @@ export declare const usePageBuilderStateStore: import('pinia').StoreDefinition<"
142
158
  currentStyles: Record<string, string>;
143
159
  fontVerticalPadding: string | null;
144
160
  fontHorizontalPadding: string | null;
161
+ fontTopPadding: string | null;
162
+ fontRightPadding: string | null;
163
+ fontBottomPadding: string | null;
164
+ fontLeftPadding: string | null;
145
165
  fontVerticalMargin: string | null;
146
166
  fontHorizontalMargin: string | null;
167
+ fontTopMargin: string | null;
168
+ fontRightMargin: string | null;
169
+ fontBottomMargin: string | null;
170
+ fontLeftMargin: string | null;
147
171
  fontStyle: string | null;
148
172
  fontFamily: string | null;
149
173
  fontWeight: string | null;
@@ -172,19 +196,22 @@ export declare const usePageBuilderStateStore: import('pinia').StoreDefinition<"
172
196
  configPageBuilder: {
173
197
  [x: string]: unknown;
174
198
  updateOrCreate: {
175
- formType: "create" | "update";
199
+ [x: string]: unknown;
200
+ formType: "create" | "update" | (string & {});
176
201
  formName: import('..').FormName | (string & {});
177
202
  };
178
203
  pageBuilderLogo?: {
204
+ [x: string]: unknown;
179
205
  src: string;
180
206
  } | null | undefined;
181
207
  resourceData?: {
182
208
  [x: string]: unknown;
183
- title: string;
184
- id?: number | undefined;
209
+ title?: string | undefined;
210
+ id?: number | string | undefined;
185
211
  } | null | undefined;
186
212
  userForPageBuilder?: {
187
- name: string;
213
+ id?: string | number | null | undefined;
214
+ name?: string | undefined;
188
215
  image?: string | undefined;
189
216
  } | undefined;
190
217
  userSettings?: {
@@ -200,10 +227,30 @@ export declare const usePageBuilderStateStore: import('pinia').StoreDefinition<"
200
227
  settings?: {
201
228
  [x: string]: unknown;
202
229
  brandColor?: string | undefined;
230
+ themeColorPresets?: {
231
+ [x: string]: unknown;
232
+ enabled?: boolean | undefined;
233
+ colors?: readonly {
234
+ [x: string]: unknown;
235
+ id: import('..').ThemeColorPresetId | (string & {});
236
+ label?: string | undefined;
237
+ color?: string | undefined;
238
+ enabled?: boolean | undefined;
239
+ }[] | undefined;
240
+ } | {
241
+ enabled: boolean;
242
+ colors: readonly {
243
+ id: import('..').ThemeColorPresetId;
244
+ label: string;
245
+ color: string;
246
+ enabled: boolean;
247
+ }[];
248
+ } | null | undefined;
203
249
  } | null | undefined;
204
250
  pageSettings?: {
205
- classes: string;
206
- style?: Record<string, string> | undefined;
251
+ [x: string]: unknown;
252
+ classes?: string | undefined;
253
+ style?: (string | Record<string, string>) | undefined;
207
254
  } | undefined;
208
255
  } | null;
209
256
  showModalHTMLEditor: boolean;
@@ -253,8 +300,16 @@ export declare const usePageBuilderStateStore: import('pinia').StoreDefinition<"
253
300
  setCurrentStyles(payload: Record<string, string>): void;
254
301
  setFontVerticalPadding(payload: string | null): void;
255
302
  setFontHorizontalPadding(payload: string | null): void;
303
+ setFontTopPadding(payload: string | null): void;
304
+ setFontRightPadding(payload: string | null): void;
305
+ setFontBottomPadding(payload: string | null): void;
306
+ setFontLeftPadding(payload: string | null): void;
256
307
  setFontVerticalMargin(payload: string | null): void;
257
308
  setFontHorizontalMargin(payload: string | null): void;
309
+ setFontTopMargin(payload: string | null): void;
310
+ setFontRightMargin(payload: string | null): void;
311
+ setFontBottomMargin(payload: string | null): void;
312
+ setFontLeftMargin(payload: string | null): void;
258
313
  setFontStyle(payload: string | null): void;
259
314
  setFontFamily(payload: string | null): void;
260
315
  setFontWeight(payload: string | null): void;