@useinsider/guido 3.8.0 → 3.8.1-beta.110be29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +8 -8
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +15 -12
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +16 -15
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +42 -37
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +40 -37
- package/dist/composables/usePreviewInteractionGuard.js +17 -0
- package/dist/composables/useSave.js +14 -14
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +26 -17
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +19 -25
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +11 -10
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +24 -26
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +30 -39
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +28 -34
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +285 -333
- package/dist/extensions/Blocks/Recommendation/extension.js +6 -5
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +142 -173
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +56 -30
- package/dist/extensions/Blocks/Recommendation/templates/index.js +29 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +132 -105
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +44 -23
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +112 -64
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +219 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +30 -22
- package/dist/extensions/Blocks/Unsubscribe/block.js +40 -37
- package/dist/extensions/Blocks/Unsubscribe/control.js +19 -16
- package/dist/extensions/Blocks/controlFactories.js +159 -133
- package/dist/guido.css +1 -1
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +20 -47
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +165 -11
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +78 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +29 -9
- package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
- package/dist/src/stores/unsubscribe.d.ts +11 -1
- package/dist/stores/unsubscribe.js +8 -7
- package/package.json +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Style Preserver Utility
|
|
3
|
-
*
|
|
4
|
-
* Captures and restores element styles during block regeneration.
|
|
5
|
-
* This ensures user styling is preserved when:
|
|
6
|
-
* - Layout changes (grid <-> list)
|
|
7
|
-
* - Cards per row changes
|
|
8
|
-
* - Composition order changes
|
|
9
|
-
*
|
|
10
|
-
* Works with the node config system to provide complete style persistence.
|
|
11
|
-
*/
|
|
12
|
-
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
13
|
-
import { ModificationDescription } from '@stripoinc/ui-editor-extensions';
|
|
14
|
-
/**
|
|
15
|
-
* Style properties that can be captured for text elements
|
|
16
|
-
*/
|
|
17
|
-
export interface TextElementStyles {
|
|
18
|
-
fontSize?: string;
|
|
19
|
-
fontFamily?: string;
|
|
20
|
-
fontWeight?: string;
|
|
21
|
-
fontStyle?: string;
|
|
22
|
-
color?: string;
|
|
23
|
-
textAlign?: string;
|
|
24
|
-
lineHeight?: string;
|
|
25
|
-
textDecoration?: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Style properties for button elements
|
|
29
|
-
*/
|
|
30
|
-
export interface ButtonElementStyles extends TextElementStyles {
|
|
31
|
-
backgroundColor?: string;
|
|
32
|
-
borderRadius?: string;
|
|
33
|
-
border?: string;
|
|
34
|
-
padding?: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Style properties for image elements
|
|
38
|
-
*/
|
|
39
|
-
export interface ImageElementStyles {
|
|
40
|
-
width?: string;
|
|
41
|
-
height?: string;
|
|
42
|
-
maxWidth?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Complete captured styles for a recommendation block
|
|
46
|
-
*/
|
|
47
|
-
export interface CapturedStyles {
|
|
48
|
-
/** Product name text styles */
|
|
49
|
-
name: TextElementStyles;
|
|
50
|
-
/** Current price text styles */
|
|
51
|
-
price: TextElementStyles;
|
|
52
|
-
/** Original/old price text styles */
|
|
53
|
-
oldPrice: TextElementStyles;
|
|
54
|
-
/** Omnibus price text styles */
|
|
55
|
-
omnibusPrice: TextElementStyles;
|
|
56
|
-
/** Omnibus discount text styles */
|
|
57
|
-
omnibusDiscount: TextElementStyles;
|
|
58
|
-
/** CTA button styles */
|
|
59
|
-
button: ButtonElementStyles;
|
|
60
|
-
/** Product image styles */
|
|
61
|
-
image: ImageElementStyles;
|
|
62
|
-
/** Card background color */
|
|
63
|
-
cardBackgroundColor: string | null;
|
|
64
|
-
/** Column spacing in pixels */
|
|
65
|
-
columnSpacing: number;
|
|
66
|
-
/** Row spacing in pixels */
|
|
67
|
-
rowSpacing: number;
|
|
68
|
-
/** Element composition order */
|
|
69
|
-
composition: string[];
|
|
70
|
-
/** Element visibility flags */
|
|
71
|
-
visibility: Record<string, boolean>;
|
|
72
|
-
}
|
|
73
|
-
type DocumentModifier = {
|
|
74
|
-
modifyHtml: (node: ImmutableHtmlNode) => {
|
|
75
|
-
setStyle: (prop: string, value: string) => DocumentModifier;
|
|
76
|
-
};
|
|
77
|
-
apply: (description: ModificationDescription) => void;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Capture all styles from a recommendation block
|
|
81
|
-
*
|
|
82
|
-
* Call this BEFORE any operation that regenerates the block HTML.
|
|
83
|
-
* The captured styles can then be restored after regeneration.
|
|
84
|
-
* @example
|
|
85
|
-
* // Before layout change
|
|
86
|
-
* const styles = captureStyles(this.currentNode);
|
|
87
|
-
*
|
|
88
|
-
* // ... regenerate block HTML ...
|
|
89
|
-
*
|
|
90
|
-
* // After regeneration
|
|
91
|
-
* restoreStyles(this.currentNode, this.api.getDocumentModifier(), styles);
|
|
92
|
-
* @param node - The block node to capture styles from
|
|
93
|
-
* @returns Complete captured styles object
|
|
94
|
-
*/
|
|
95
|
-
export declare function captureStyles(node: ImmutableHtmlNode | null | undefined): CapturedStyles;
|
|
96
|
-
/**
|
|
97
|
-
* Restore captured styles to a regenerated block
|
|
98
|
-
*
|
|
99
|
-
* Call this AFTER regenerating block HTML to reapply user styling.
|
|
100
|
-
* @example
|
|
101
|
-
* restoreStyles(this.currentNode, this.api.getDocumentModifier(), capturedStyles);
|
|
102
|
-
* @param node - The block node to restore styles to
|
|
103
|
-
* @param modifier - Document modifier for applying changes
|
|
104
|
-
* @param styles - Previously captured styles
|
|
105
|
-
*/
|
|
106
|
-
export declare function restoreStyles(node: ImmutableHtmlNode | null | undefined, modifier: DocumentModifier, styles: CapturedStyles): void;
|
|
107
|
-
/**
|
|
108
|
-
* Check if styles have meaningful content worth restoring
|
|
109
|
-
* @param styles - Captured styles to check
|
|
110
|
-
* @returns True if styles contain restorable content
|
|
111
|
-
*/
|
|
112
|
-
export declare function hasRestorableStyles(styles: CapturedStyles): boolean;
|
|
113
|
-
export {};
|