@useinsider/guido 3.2.0-beta.22a0c4c → 3.2.0-beta.294ea63

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 (33) hide show
  1. package/dist/composables/useActionsApi.js +4 -4
  2. package/dist/composables/useFullStoryBridge.js +14 -0
  3. package/dist/composables/useSave.js +1 -1
  4. package/dist/composables/useStripo.js +44 -42
  5. package/dist/config/compiler/recommendationCompilerRules.js +72 -67
  6. package/dist/config/compiler/utils/recommendationCompilerUtils.js +30 -33
  7. package/dist/config/migrator/recommendationMigrator.js +1 -1
  8. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
  9. package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
  10. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  11. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +18 -21
  12. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +6 -6
  13. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +1 -3
  14. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +57 -27
  15. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +17 -18
  16. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +25 -29
  17. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
  18. package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
  19. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +324 -218
  20. package/dist/package.json.js +1 -1
  21. package/dist/src/composables/useActionsApi.d.ts +1 -1
  22. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  23. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +0 -1
  24. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +0 -3
  25. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +20 -3
  26. package/dist/static/styles/components/button.css.js +16 -9
  27. package/dist/static/styles/components/loader.css.js +4 -0
  28. package/dist/static/styles/components/narrow-panel.css.js +52 -0
  29. package/package.json +3 -3
  30. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +0 -99
  31. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +0 -14
  32. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +0 -35
  33. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +0 -29
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.54.0" } }, s = {
1
+ const o = { stripo: { version: "2.60.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -7,5 +7,5 @@ export declare const useActionsApi: () => {
7
7
  getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
8
8
  updateTimerInClonedTemplate: () => Promise<string | null>;
9
9
  updateHtmlAndCss: (html: string, css: string) => void;
10
- editorSave: () => void;
10
+ editorSave: () => Promise<void>;
11
11
  };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Injects the hosted FullStory bridge script into the Stripo editor iframe.
3
+ *
4
+ * The bridge script's origin is allowlisted via Stripo's
5
+ * `allowedScriptSourceDomains` in useStripo, so the iframe's CSP permits
6
+ * the load. The bundled script itself handles reading FS config from the
7
+ * parent window and booting the FullStory queue stub inside the iframe.
8
+ */
9
+ export declare const useFullStoryBridge: () => {
10
+ injectFullStory: () => void;
11
+ };
@@ -63,6 +63,5 @@ export declare enum RecommendationControlId {
63
63
  CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control",
64
64
  CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control",
65
65
  CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control",
66
- CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control",
67
66
  SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message"
68
67
  }
@@ -13,12 +13,10 @@
13
13
  * product cards — changing "brand" color won't affect "rating_star" color.
14
14
  */
15
15
  import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
16
- import { CustomAttributeTextTrimControl } from './textTrim';
17
16
  /**
18
17
  * Grouped Custom Attribute Controls
19
18
  * Use this object for cleaner imports in extension.ts
20
19
  */
21
- export { CustomAttributeTextTrimControl } from './textTrim';
22
20
  export declare const CustomAttributeControls: {
23
21
  readonly align: {
24
22
  new (): {
@@ -104,5 +102,4 @@ export declare const CustomAttributeControls: {
104
102
  isVisible(_node: ImmutableHtmlNode): boolean;
105
103
  };
106
104
  };
107
- readonly textTrim: typeof CustomAttributeTextTrimControl;
108
105
  };
@@ -1,9 +1,9 @@
1
- import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
1
+ import { ImmutableCssNode, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
2
  import { CommonControl } from '../../../common-control';
3
3
  /**
4
- * Control for enabling/disabling text trimming on product names.
4
+ * Control for enabling/disabling text trimming on product names
5
5
  * When enabled, adds a CSS class that applies text-overflow: ellipsis
6
- * and injects the required CSS rules into the document stylesheet.
6
+ * and injects the required CSS rules into the document stylesheet
7
7
  */
8
8
  export declare class NameTextTrimControl extends CommonControl {
9
9
  getId(): string;
@@ -12,6 +12,23 @@ export declare class NameTextTrimControl extends CommonControl {
12
12
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
13
13
  _setFormValues(): void;
14
14
  _getCurrentTrimState(): boolean;
15
+ /**
16
+ * Finds an existing CSS rule in the document stylesheet by exact query
17
+ * @param query - The CSS query to search for (uses Stripo's CSS query syntax)
18
+ * @returns The CSS rule node if found, undefined otherwise
19
+ */
20
+ _findCssRule(query: string): ImmutableCssNode | undefined;
21
+ /**
22
+ * Finds the .text-trim-enabled p rule by searching all text-trim rules and comparing selectors
23
+ * This is needed because Stripo's CSS query syntax interprets spaces as path separators
24
+ * @returns true if the rule exists
25
+ */
26
+ _hasParagraphRule(): boolean;
27
+ /**
28
+ * Ensures the text-trim CSS rules exist in the document stylesheet
29
+ * Only adds rules if they don't already exist (prevents duplicates across multiple blocks)
30
+ */
31
+ _ensureCssRulesExist(): void;
15
32
  _onTextTrimChange(enabled: boolean): void;
16
33
  _listenToFormUpdates(): void;
17
34
  }
@@ -1,4 +1,4 @@
1
- const o = `.control-shadow-wrapper:has(.button) {
1
+ const n = `.control-shadow-wrapper:has(.button) {
2
2
  border-radius: 0;
3
3
  box-shadow: none;
4
4
  background-color: transparent;
@@ -99,18 +99,12 @@ ue-check-button.checked:not(.flat-white) input:checked + label .icon-button {
99
99
  color: var(--guido-color-primary-500);
100
100
  }
101
101
 
102
- ue-select.full-width .button {
103
- border: none !important;
104
- background-color: var(--guido-color-neutral-200) !important;
105
- color: var(--guido-color-neutral-800) !important;
106
- }
107
-
108
102
  ue-select.full-width .button .icon-button {
109
103
  color: var(--guido-color-gray-600) !important;
110
104
  }
111
105
 
112
106
  ue-select.full-width .button:hover:not(:disabled,.disabled) {
113
- background-color: var(--guido-color-neutral-100) !important;
107
+ background-color: var(--guido-color-gray-0) !important;
114
108
  }
115
109
 
116
110
  ue-color {
@@ -130,7 +124,20 @@ ue-select-text-input .select-text-input-toggle .button {
130
124
  justify-content: center;
131
125
  background-color: transparent !important;
132
126
  }
127
+
128
+
129
+ .control-shadow-wrapper,
130
+ ue-button:not(.no-shadow,.flat-white),
131
+ ue-toggle:not(.no-shadow,.flat-white),
132
+ :is(ue-popover-toggler,ue-toggle-icon-picker,ue-emoji-toggle),
133
+ .button-group,
134
+ ue-counter:not(.no-shadow),
135
+ :is(ue-select,ue-mergetags,ue-font-family-select):not(.no-shadow),
136
+ ue-check-button:not(.no-shadow,.flat-white) {
137
+ background: none;
138
+ padding: 0;
139
+ }
133
140
  `;
134
141
  export {
135
- o as default
142
+ n as default
136
143
  };
@@ -4,6 +4,10 @@ const n = `ue-loader-component.full-height {
4
4
  z-index: 9;
5
5
  backdrop-filter: blur(2px);
6
6
  }
7
+
8
+ ue-loader-component .service-element.loader {
9
+ box-shadow: var(--guido-color-primary-500) 1px 1px 0 0 !important;
10
+ }
7
11
  `;
8
12
  export {
9
13
  n as default
@@ -28,6 +28,58 @@ ue-stripe-thumb:hover:not(.disabled),
28
28
  border-color: var(--guido-color-primary-500);
29
29
  }
30
30
 
31
+ /* Module search — initial */
32
+ .module-search-container {
33
+ background-color: var(--guido-color-gray-0);
34
+ border: 1px solid var(--guido-color-gray-300);
35
+ border-radius: 4px;
36
+ }
37
+
38
+ .module-search-container .service-element {
39
+ background-color: unset;
40
+ }
41
+
42
+ .module-filter-toggle {
43
+ top: -1px !important;
44
+ right: -1px !important;
45
+ }
46
+
47
+ .module-filter-toggle > .button,
48
+ .module-search-container:hover .module-filter-toggle > .button {
49
+ border: none;
50
+ background: transparent;
51
+ }
52
+
53
+ /* Module search — hover */
54
+ .module-search-container:has(.module-search-chip-input:hover) {
55
+ border-color: var(--guido-color-primary-500);
56
+ }
57
+
58
+ .module-search-container .module-search-chip-input .service-element:hover {
59
+ background-color: var(--guido-color-gray-0);
60
+ border-radius: 4px;
61
+ }
62
+
63
+ .module-search-container .module-filter-toggle:hover > .button {
64
+ background-color: var(--guido-color-gray-1);
65
+ }
66
+
67
+ /* Module search — selected (.on) */
68
+ .module-search-container:has(.module-search-chip-input.on),
69
+ .module-search-container:has(.module-search-chip-input.on):hover {
70
+ border-color: var(--guido-color-primary-500);
71
+ box-shadow: 0 0 0 3px var(--guido-color-primary-200) !important;
72
+ }
73
+
74
+ .module-search-container .module-search-chip-input.on .input-section {
75
+ background-color: unset;
76
+ box-shadow: unset;
77
+ }
78
+
79
+ .module-categories-list .menu-item {
80
+ padding: 8px 20px !important;
81
+ }
82
+
31
83
  .modules-layout-wrapper {
32
84
  padding: 0 16px 16px;
33
85
  grid-row-gap: 16px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.2.0-beta.22a0c4c",
3
+ "version": "3.2.0-beta.294ea63",
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",
@@ -32,7 +32,7 @@
32
32
  "author": "",
33
33
  "license": "ISC",
34
34
  "dependencies": {
35
- "@stripoinc/ui-editor-extensions": "3.5.0",
35
+ "@stripoinc/ui-editor-extensions": "3.7.0",
36
36
  "@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
37
37
  "@vueuse/core": "11.3.0",
38
38
  "lodash-es": "4.17.21",
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "guido": {
88
88
  "stripo": {
89
- "version": "2.54.0"
89
+ "version": "2.60.0"
90
90
  }
91
91
  }
92
92
  }
@@ -1,99 +0,0 @@
1
- import { ModificationDescription as T } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as m } from "../../../common-control.js";
3
- import { RecommendationBlockId as n } from "../../constants/blockIds.js";
4
- import { RecommendationControlId as l } from "../../constants/controlIds.js";
5
- import { BLOCK_ROOT_SELECTOR as u, ATTR_PRODUCT_ATTR as a } from "../../constants/selectors.js";
6
- import { CSS_CLASS_TEXT_TRIM as o, ensureTextTrimCssRulesExist as c } from "../shared/textTrimCssRules.js";
7
- const i = {
8
- TEXT_TRIM_ENABLED: "customAttrTextTrimEnabled"
9
- };
10
- class g extends m {
11
- getId() {
12
- return l.CUSTOM_ATTR_TEXT_TRIM;
13
- }
14
- getTemplate() {
15
- return `
16
- <hr style="margin: 0; border: none; border-top: 1px solid #e0e0e0;" />
17
- <div class="custom-attr-text-trim-control-container">
18
- ${this._GuTwoColumns([
19
- this._GuLabel({ text: this.api.translate("Trim Long Text") }),
20
- this._GuToggle(i.TEXT_TRIM_ENABLED)
21
- ])}
22
- </div>
23
- `;
24
- }
25
- onRender() {
26
- this._setFormValues(), this._listenToFormUpdates();
27
- }
28
- onTemplateNodeUpdated(t) {
29
- super.onTemplateNodeUpdated(t), this._setFormValues();
30
- }
31
- // ========================================================================
32
- // State Reading
33
- // ========================================================================
34
- _setFormValues() {
35
- this.api.updateValues({
36
- [i.TEXT_TRIM_ENABLED]: this._getCurrentTrimState()
37
- });
38
- }
39
- _getCurrentTrimState() {
40
- if (!this.currentNode || !("hasClass" in this.currentNode))
41
- return !1;
42
- if (this.currentNode.hasClass(o))
43
- return !0;
44
- const t = this._getTargetElements();
45
- return t.length > 0 && "hasClass" in t[0] ? t[0].hasClass(o) : !1;
46
- }
47
- // ========================================================================
48
- // Target Element Discovery (per-attribute scoping)
49
- // ========================================================================
50
- /**
51
- * Finds all custom attribute elements of the same type as the current node.
52
- *
53
- * Similar to getCustomAttrTargetNodes in customAttribute/index.ts, but adapted
54
- * for CommonControl lifecycle where currentNode is a class property (not a
55
- * parameter from Stripo's getTargetNodes override).
56
- */
57
- _getTargetElements() {
58
- if (!this.currentNode || !("closest" in this.currentNode))
59
- return [];
60
- const t = this.currentNode.closest(u);
61
- if (!t)
62
- return [];
63
- const e = "asElement" in this.currentNode ? this.currentNode.asElement().getAttribute(a) : null;
64
- if (e) {
65
- const s = `[esd-extension-block-id="${n.CUSTOM_ATTRIBUTE}"][${a}="${e}"]`;
66
- return Array.from(t.querySelectorAll(s));
67
- }
68
- return Array.from(
69
- t.querySelectorAll(
70
- `[esd-extension-block-id="${n.CUSTOM_ATTRIBUTE}"]`
71
- )
72
- );
73
- }
74
- // ========================================================================
75
- // Toggle Handler
76
- // ========================================================================
77
- _onTextTrimChange(t) {
78
- const e = this._getTargetElements();
79
- if (!e.length)
80
- return;
81
- t && c(this.api);
82
- const r = this.api.getDocumentModifier();
83
- e.forEach((s) => {
84
- t ? r.modifyHtml(s).setClass(o) : r.modifyHtml(s).removeClass(o);
85
- }), r.apply(
86
- new T(
87
- t ? "Enable custom attribute text trimming" : "Disable custom attribute text trimming"
88
- )
89
- );
90
- }
91
- _listenToFormUpdates() {
92
- this.api.onValueChanged(i.TEXT_TRIM_ENABLED, (t) => {
93
- this._onTextTrimChange(t);
94
- });
95
- }
96
- }
97
- export {
98
- g as CustomAttributeTextTrimControl
99
- };
@@ -1,14 +0,0 @@
1
- import { ModificationDescription as r } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- const t = "text-trim-enabled", l = `.${t}`, c = `.${t} p`, S = `.${t} { max-width: 0; }`, T = `.${t} p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; display: block; }`;
3
- function f(n) {
4
- const e = n.getDocumentRootCssNode();
5
- if (!e)
6
- return;
7
- const o = n.getDocumentModifier();
8
- let i = !1;
9
- e.querySelector(l) || (o.modifyCss(e).appendRule(S), i = !0), e.querySelectorAll(`*${t}`).some((s) => "getSelector" in s && typeof s.getSelector == "function" && s.getSelector() === c) || (o.modifyCss(e).appendRule(T), i = !0), i && o.apply(new r("Add text trim CSS rules"));
10
- }
11
- export {
12
- t as CSS_CLASS_TEXT_TRIM,
13
- f as ensureTextTrimCssRulesExist
14
- };
@@ -1,35 +0,0 @@
1
- /**
2
- * Custom Attribute Text Trim Control
3
- *
4
- * Per-attribute text trimming for custom product attributes.
5
- * Unlike NameTextTrimControl which applies to ALL product names globally,
6
- * this control is scoped to a specific custom attribute type via the
7
- * `product-attr` HTML attribute — changing text-trim on "brand" won't
8
- * affect "rating_star".
9
- *
10
- * CSS rules are shared with NameTextTrimControl via shared/textTrimCssRules.ts.
11
- */
12
- import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
13
- import { CommonControl } from '../../../common-control';
14
- /**
15
- * Control for enabling/disabling text trimming on individual custom attributes.
16
- * Scoped per attribute type using the `product-attr` HTML attribute.
17
- */
18
- export declare class CustomAttributeTextTrimControl extends CommonControl {
19
- getId(): string;
20
- getTemplate(): string;
21
- onRender(): void;
22
- onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
23
- _setFormValues(): void;
24
- _getCurrentTrimState(): boolean;
25
- /**
26
- * Finds all custom attribute elements of the same type as the current node.
27
- *
28
- * Similar to getCustomAttrTargetNodes in customAttribute/index.ts, but adapted
29
- * for CommonControl lifecycle where currentNode is a class property (not a
30
- * parameter from Stripo's getTargetNodes override).
31
- */
32
- _getTargetElements(): ImmutableHtmlNode[];
33
- _onTextTrimChange(enabled: boolean): void;
34
- _listenToFormUpdates(): void;
35
- }
@@ -1,29 +0,0 @@
1
- /**
2
- * Shared Text Trim CSS Rule Management
3
- *
4
- * Extracted from NameTextTrimControl to be reused by CustomAttributeTextTrimControl.
5
- * Follows the same pattern as controls/mobileLayout/cssRules.ts — standalone
6
- * functions that accept an API parameter, importable by any control class.
7
- *
8
- * The CSS rules are document-scoped (shared across all recommendation blocks).
9
- * Once injected, they persist until the template is closed.
10
- */
11
- import type { ImmutableCssNode } from '@stripoinc/ui-editor-extensions';
12
- import { ModificationDescription } from '@stripoinc/ui-editor-extensions';
13
- export declare const CSS_CLASS_TEXT_TRIM = "text-trim-enabled";
14
- interface CssCapableApi {
15
- getDocumentRootCssNode: () => ImmutableCssNode | null;
16
- getDocumentModifier: () => {
17
- modifyCss: (node: ImmutableCssNode) => {
18
- appendRule: (rule: string) => void;
19
- };
20
- apply: (desc: ModificationDescription) => void;
21
- };
22
- }
23
- /**
24
- * Ensures the text-trim CSS rules exist in the document stylesheet.
25
- * Only adds rules if they don't already exist (prevents duplicates across blocks).
26
- * Calls getDocumentRootCssNode once and passes it to both checks.
27
- */
28
- export declare function ensureTextTrimCssRulesExist(api: CssCapableApi): void;
29
- export {};