@useinsider/guido 3.21.0-beta.f049776 → 3.21.0-beta.ff98fc3

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/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-1a3ddd48]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-1a3ddd48]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-1a3ddd48]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
@@ -1,7 +1,9 @@
1
- const o = { stripo: { version: "2.79.0" } }, s = {
2
- guido: o
1
+ const o = "3.21.0-beta.ff98fc3", s = { stripo: { version: "2.79.0" } }, t = {
2
+ version: o,
3
+ guido: s
3
4
  };
4
5
  export {
5
- s as default,
6
- o as guido
6
+ t as default,
7
+ s as guido,
8
+ o as version
7
9
  };
@@ -0,0 +1,27 @@
1
+ export type TimedOpenPhase = 'migration' | 'default_template' | 'timer_clone';
2
+ export type OpenPhase = 'setup' | 'host_ready' | `${TimedOpenPhase}_start` | `${TimedOpenPhase}_end` | 'plugin_start' | 'script_ready' | 'fonts_sync_ready' | 'blocks_config_ready' | 'init_editor' | 'token_start' | 'token_end' | 'ready';
3
+ export type OpenOutcome = 'ready' | 'error' | 'abandoned';
4
+ export interface OpenContext {
5
+ partnerName: string;
6
+ productType: number;
7
+ templateId: string;
8
+ variationId: string;
9
+ }
10
+ export interface OpenTemplate {
11
+ html: string;
12
+ css: string;
13
+ forceRecreate: boolean;
14
+ }
15
+ export interface EditorOpenMetrics {
16
+ mark: (phase: OpenPhase) => void;
17
+ timed: <T>(phase: TimedOpenPhase, task: () => Promise<T>) => Promise<T>;
18
+ setContext: (context: OpenContext) => void;
19
+ setTemplate: (template: OpenTemplate) => void;
20
+ setScriptPreloaded: (preloaded: boolean) => void;
21
+ markReady: () => void;
22
+ markFailed: () => void;
23
+ dispose: () => void;
24
+ }
25
+ export declare const startEditorOpenMetrics: () => EditorOpenMetrics;
26
+ /** Binds to the session open at call time, so a remounted editor never writes into its replacement's session. */
27
+ export declare const useEditorOpenMetrics: () => EditorOpenMetrics;
@@ -19,6 +19,9 @@ export declare class RecommendationBlock extends Block {
19
19
  private _resetSourceIds;
20
20
  /** Ids handed to duplicates the document root does not show yet: a copied module renames all its blocks at once. */
21
21
  private _unsettledDuplicateIds;
22
+ private _arrivedBlocks;
23
+ /** Strategy each in-flight arrival or duplicate refresh is fetching, by block id, so a second one does not race it. */
24
+ private _refreshClaims;
22
25
  constructor();
23
26
  getId(): string;
24
27
  getIcon(): string;
@@ -44,6 +47,8 @@ export declare class RecommendationBlock extends Block {
44
47
  * @param node - The newly created block node
45
48
  */
46
49
  onCreated(node: ImmutableHtmlNode): void;
50
+ /** Refreshes every block of an opened template: Stripo restores a stored document without `onCreated`. */
51
+ onDocumentInit(): void;
47
52
  /**
48
53
  * Called when the document changes or template is loaded
49
54
  *
@@ -85,15 +90,26 @@ export declare class RecommendationBlock extends Block {
85
90
  * the renamed one depending on where the module was dropped (SD-149916).
86
91
  */
87
92
  private _scheduleArrivalReset;
93
+ /**
94
+ * Re-reads the strategy of a block that arrived with saved cards, without waiting for a click.
95
+ * Blocks of one opened template or dropped module arrive in one tick and refresh together.
96
+ */
97
+ private _queueArrivalRefresh;
98
+ private _refreshArrivedBlocks;
99
+ /**
100
+ * A new document reports each block to onCreated and onDocumentInit, not always in one batch, so a
101
+ * claimed block refreshes again only once the document shows it under another strategy (a restored version).
102
+ */
103
+ private _canClaimRefresh;
104
+ private _releaseRefreshClaim;
88
105
  /**
89
106
  * Heals a duplicate that slipped past the create-time `_detectDuplicate`
90
107
  * scan (or that was persisted by an older template before SD-142352).
91
108
  * When two blocks share a `recommendation-id`, the first occurrence in DOM
92
109
  * order is treated as the source and any later sibling is reassigned a
93
- * fresh id. The store entry and active-block focus are intentionally not
94
- * touched here: each block's persisted `esd-ext-config` carries its own
95
- * truth and the regular save-time hydration (`hydrateRecommendationStore`)
96
- * will seed the new id from that. Skipping `setCurrentBlock` avoids
110
+ * fresh id and queued for the arrival refresh, which seeds the new id's
111
+ * store entry from its persisted `esd-ext-config`. The source's store
112
+ * entry is not cloned and focus is not moved. Skipping `setCurrentBlock` avoids
97
113
  * yanking the user's current selection mid-edit when the heal fires from
98
114
  * `onDocumentChanged`.
99
115
  */
@@ -109,9 +125,9 @@ export declare class RecommendationBlock extends Block {
109
125
  *
110
126
  * Used by `_handleDuplicate` at create-time (which additionally clones the
111
127
  * store entry and focuses the new block) and by `_healLingeringDuplicate`
112
- * at document-change time (which intentionally skips store/focus side
113
- * effects so older bug-affected templates can self-repair without
114
- * disturbing the user's current selection).
128
+ * at document-change time (which skips the clone and focus change so older
129
+ * bug-affected templates can self-repair without disturbing the user's
130
+ * current selection, and queues the arrival refresh for the new id).
115
131
  */
116
132
  private _reassignDuplicateId;
117
133
  /**
@@ -1,10 +1,21 @@
1
1
  import type { RecommendationNodeConfig } from '../types/nodeConfig';
2
+ /** A saved module keeps the id it was saved with, so it can arrive sharing the id of an unrelated block. */
3
+ export declare function resolveSourceConfig(sourceId: number, arrived: RecommendationNodeConfig): RecommendationNodeConfig;
2
4
  /**
3
5
  * Re-reads the strategy of a duplicated block and its source and redraws both: the clone copies the
4
6
  * cards the source last drew, so a strategy edited since then only reached a block once selected (SD-153266).
5
7
  * @param config - the arriving block's persisted config; seeds either block its store entry does not match
6
8
  */
7
9
  export declare function refreshDuplicatedStrategyBlocks(sourceId: number, duplicateId: number, config: RecommendationNodeConfig): Promise<void>;
10
+ /**
11
+ * Re-reads the strategy of blocks that arrived from a saved template or module, so the panel and
12
+ * preview show a strategy edited since the design was saved without selecting the block.
13
+ * @param blocks - each block's id with its persisted config, the truth its store entry is seeded from
14
+ */
15
+ export declare function refreshArrivedStrategyBlocks(blocks: {
16
+ id: number;
17
+ config: RecommendationNodeConfig;
18
+ }[]): Promise<void>;
8
19
  /**
9
20
  * Writes a strategy change and its products straight to the document, without the settings panel.
10
21
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.21.0-beta.f049776",
3
+ "version": "3.21.0-beta.ff98fc3",
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",
@@ -1,43 +0,0 @@
1
- var g = Object.defineProperty;
2
- var m = (n, t, e) => t in n ? g(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var u = (n, t, e) => m(n, typeof t != "symbol" ? t + "" : t, e);
4
- const A = "td.coupon-block.ins-coupon-code:not([esd-extension-block-id])", f = /* @__PURE__ */ new Set(["left", "center", "right", "justify"]), p = /(?:^|;)\s*text-align\s*:\s*([^;]+)/i;
5
- function s(n) {
6
- const t = n == null ? void 0 : n.trim().toLowerCase();
7
- return t && f.has(t) ? t : null;
8
- }
9
- class y {
10
- constructor() {
11
- u(this, "parser");
12
- this.parser = new DOMParser();
13
- }
14
- migrate(t) {
15
- try {
16
- const e = this.parser.parseFromString(t, "text/html"), i = e.querySelectorAll(A);
17
- let o = !1;
18
- return i.forEach((r) => {
19
- this.normalizeBlock(r) && (o = !0);
20
- }), o ? e.documentElement.outerHTML : t;
21
- } catch (e) {
22
- return console.error("CouponBlockAlignmentMigrator failed:", e), t;
23
- }
24
- }
25
- normalizeBlock(t) {
26
- var l;
27
- const e = t.querySelector(".ins-title"), i = (e == null ? void 0 : e.getAttribute("style")) ?? "", o = s((l = p.exec(i)) == null ? void 0 : l[1]), r = s(t.getAttribute("align")) ?? s(e == null ? void 0 : e.getAttribute("align")) ?? o;
28
- if (!r)
29
- return !1;
30
- let c = !1;
31
- if (s(t.getAttribute("align")) || (t.setAttribute("align", r), c = !0), e && !o) {
32
- const a = i.trim().replace(/;+$/, "");
33
- e.setAttribute("style", a ? `${a}; text-align: ${r}` : `text-align: ${r}`), c = !0;
34
- }
35
- return c;
36
- }
37
- }
38
- function S(n) {
39
- return new y().migrate(n);
40
- }
41
- export {
42
- S as migrateCouponBlockAlignment
43
- };
@@ -1 +0,0 @@
1
- export declare function migrateCouponBlockAlignment(html: string): string;