@useinsider/guido 3.12.0-beta.435bd0b → 3.12.0-beta.4e0547f
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/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +110 -101
- package/dist/composables/useStripo.js +72 -69
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/src/components/Guido.vue.d.ts +18 -2
- package/dist/src/composables/useStripo.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/stores/config.d.ts +3 -1
- package/dist/stores/config.js +21 -19
- package/package.json +1 -1
|
@@ -115,6 +115,42 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
|
|
|
115
115
|
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* Factory for a background-color control that paints a whole extension block (SD-145082).
|
|
120
|
+
*
|
|
121
|
+
* Base is `ButtonBackgroundColorBuiltInControl` because its `GENERAL.BACKGROUND_COLOR` form key
|
|
122
|
+
* round-trips through `getValues()`; the block-text base (`TextBlockBackgroundBuiltInControl`, the
|
|
123
|
+
* built-in this replaces) reports `textBlockBackgroundColor`, which our read path never sees. That
|
|
124
|
+
* borrowed base targets the block's Buy buttons, so `getTargetNodes` here is a GUARD that keeps it
|
|
125
|
+
* off the buttons — not the write path.
|
|
126
|
+
*
|
|
127
|
+
* The write is entirely ours (`getAdditionalModifications`): Stripo's built-in emits a stylesheet
|
|
128
|
+
* rule that inline styles from regeneration outrank (SD-143023), so it would silently no-op on the
|
|
129
|
+
* next edit. We write inline `background-color` + `bgcolor` on the block `<td>` instead — surviving
|
|
130
|
+
* regeneration and reaching Outlook, matching the migrator's convention.
|
|
131
|
+
*/
|
|
132
|
+
export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string): {
|
|
133
|
+
new (): {
|
|
134
|
+
getId(): string;
|
|
135
|
+
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
136
|
+
getLabels(): {
|
|
137
|
+
title: string;
|
|
138
|
+
};
|
|
139
|
+
/** Guard: redirect the borrowed button parent onto the block `<td>` so it never paints the Buy buttons. */
|
|
140
|
+
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
141
|
+
/**
|
|
142
|
+
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
143
|
+
* attribute. This is the whole mechanism, not a mirror: the parent control's own
|
|
144
|
+
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
145
|
+
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
146
|
+
*/
|
|
147
|
+
getAdditionalModifications(root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
148
|
+
getParentControlId(): string;
|
|
149
|
+
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
150
|
+
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
151
|
+
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
118
154
|
/**
|
|
119
155
|
* Factory function to create paddings controls for different block elements
|
|
120
156
|
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
@@ -2336,7 +2336,9 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
2336
2336
|
} | null;
|
|
2337
2337
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
|
|
2338
2338
|
/**
|
|
2339
|
-
* Check if a specific feature is enabled
|
|
2339
|
+
* Check if a specific feature is enabled.
|
|
2340
|
+
* Returns false before init (config null) so header controls don't
|
|
2341
|
+
* flash on during loading, then disappear once config resolves.
|
|
2340
2342
|
*/
|
|
2341
2343
|
isFeatureEnabled: (state: {
|
|
2342
2344
|
initialized: boolean;
|
package/dist/stores/config.js
CHANGED
|
@@ -75,65 +75,67 @@ const f = r("guido-config", {
|
|
|
75
75
|
* Get the template ID
|
|
76
76
|
*/
|
|
77
77
|
templateId: (i) => {
|
|
78
|
-
var e,
|
|
79
|
-
return ((
|
|
78
|
+
var e, n;
|
|
79
|
+
return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.templateId) ?? "";
|
|
80
80
|
},
|
|
81
81
|
/**
|
|
82
82
|
* Get the user ID
|
|
83
83
|
*/
|
|
84
84
|
userId: (i) => {
|
|
85
|
-
var e,
|
|
86
|
-
return ((
|
|
85
|
+
var e, n;
|
|
86
|
+
return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.userId) ?? "";
|
|
87
87
|
},
|
|
88
88
|
/**
|
|
89
89
|
* Get the variation ID
|
|
90
90
|
*/
|
|
91
91
|
variationId: (i) => {
|
|
92
|
-
var e,
|
|
93
|
-
return ((
|
|
92
|
+
var e, n;
|
|
93
|
+
return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.variationId) ?? "";
|
|
94
94
|
},
|
|
95
95
|
/**
|
|
96
96
|
* Get the partner name
|
|
97
97
|
*/
|
|
98
98
|
partnerName: (i) => {
|
|
99
|
-
var e,
|
|
100
|
-
return ((
|
|
99
|
+
var e, n;
|
|
100
|
+
return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.name) ?? "";
|
|
101
101
|
},
|
|
102
102
|
/**
|
|
103
103
|
* Get the product type
|
|
104
104
|
*/
|
|
105
105
|
productType: (i) => {
|
|
106
|
-
var e,
|
|
107
|
-
return ((
|
|
106
|
+
var e, n;
|
|
107
|
+
return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.productType) ?? 60;
|
|
108
108
|
},
|
|
109
109
|
/**
|
|
110
110
|
* Get the message type
|
|
111
111
|
*/
|
|
112
112
|
messageType: (i) => {
|
|
113
|
-
var e,
|
|
114
|
-
return ((
|
|
113
|
+
var e, n;
|
|
114
|
+
return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.messageType) ?? 1;
|
|
115
115
|
},
|
|
116
116
|
/**
|
|
117
117
|
* Get the username
|
|
118
118
|
*/
|
|
119
119
|
username: (i) => {
|
|
120
|
-
var e,
|
|
121
|
-
return ((
|
|
120
|
+
var e, n;
|
|
121
|
+
return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.username) ?? "Guido User";
|
|
122
122
|
},
|
|
123
123
|
/**
|
|
124
124
|
* Check if header should be shown
|
|
125
125
|
*/
|
|
126
126
|
showHeader: (i) => {
|
|
127
|
-
var e,
|
|
128
|
-
return ((
|
|
127
|
+
var e, n;
|
|
128
|
+
return ((n = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : n.showHeader) ?? !0;
|
|
129
129
|
},
|
|
130
130
|
/**
|
|
131
|
-
* Check if a specific feature is enabled
|
|
131
|
+
* Check if a specific feature is enabled.
|
|
132
|
+
* Returns false before init (config null) so header controls don't
|
|
133
|
+
* flash on during loading, then disappear once config resolves.
|
|
132
134
|
*/
|
|
133
135
|
// eslint-disable-next-line @stylistic/max-len
|
|
134
136
|
isFeatureEnabled: (i) => (e) => {
|
|
135
|
-
var
|
|
136
|
-
return ((
|
|
137
|
+
var n, t;
|
|
138
|
+
return ((t = (n = i.config) == null ? void 0 : n.features) == null ? void 0 : t[e]) ?? !1;
|
|
137
139
|
}
|
|
138
140
|
},
|
|
139
141
|
actions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.12.0-beta.
|
|
3
|
+
"version": "3.12.0-beta.4e0547f",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|