@useinsider/guido 3.24.0-beta.82c2d5e → 3.24.0-beta.8779b29
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/README.md +1 -9
- package/dist/@types/config/schemas.js +14 -14
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +88 -90
- package/dist/composables/useModuleRepair.js +23 -30
- package/dist/config/migrator/index.js +16 -16
- package/dist/config/migrator/itemsPriceFormatMigrator.js +20 -0
- package/dist/enums/academy.js +1 -2
- package/dist/extensions/Blocks/Items/block.js +115 -77
- package/dist/extensions/Blocks/Items/constants/currency.js +59 -14
- package/dist/extensions/Blocks/Items/controls/blockBackground/index.js +11 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +34 -23
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +62 -51
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +18 -17
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -31
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +135 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +141 -120
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/extension.js +15 -13
- package/dist/extensions/Blocks/Items/items.css.js +19 -0
- package/dist/extensions/Blocks/Items/settingsPanel.js +38 -25
- package/dist/extensions/Blocks/Items/template.js +250 -212
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +185 -0
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +1 -0
- package/dist/extensions/Blocks/controlFactories.js +104 -104
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/@types/config/schemas.d.ts +4 -4
- package/dist/src/composables/useConfig.d.ts +2 -2
- package/dist/src/composables/useModuleRepair.d.ts +11 -2
- package/dist/src/config/migrator/index.d.ts +4 -1
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +6 -9
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/controls/blockBackground/index.d.ts +15 -0
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +24 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +4 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +66 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +12 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +1 -1
- package/dist/src/stores/config.d.ts +20 -20
- package/dist/src/stores/editor.d.ts +0 -27
- package/dist/src/utils/itemsCurrencyRepair.d.ts +5 -1
- package/dist/stores/editor.js +0 -1
- package/dist/utils/itemsCurrencyRepair.js +29 -24
- package/dist/utils/pairProductVariables.js +119 -99
- package/package.json +1 -1
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +0 -17
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +0 -30
- package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +0 -16
- package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +0 -2
- package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +0 -1
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +0 -10
- package/dist/utils/legacyUnsubscribeConversion.js +0 -49
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useConfigStore as o } from "../../stores/config.js";
|
|
2
|
-
import { useEditorStore as s } from "../../stores/editor.js";
|
|
3
|
-
import { hasLegacyUnsubscribeClass as c, convertLegacyUnsubscribeInDocumentHtml as i } from "../../utils/legacyUnsubscribeConversion.js";
|
|
4
|
-
const b = (e) => {
|
|
5
|
-
try {
|
|
6
|
-
if (!c(e) || !o().isFeatureEnabled("legacyUnsubscribeConversion"))
|
|
7
|
-
return e;
|
|
8
|
-
const { html: r, converted: t } = i(e);
|
|
9
|
-
return t && (s().isLegacyUnsubscribeModalRequested = !0), r;
|
|
10
|
-
} catch (r) {
|
|
11
|
-
return console.error("LegacyUnsubscribeTextMigrator failed:", r), e;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
b as migrateLegacyUnsubscribeText
|
|
16
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const migrateLegacyUnsubscribeText: (html: string) => string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const LEGACY_UNSUBSCRIBE_SELECTOR = "td.unsubscribe-block";
|
|
2
|
-
export declare const LEGACY_UNSUBSCRIBE_LINK_SELECTORS: readonly ["a.unsubscribe-link", "a[href*=\"unsubscribe\"]"];
|
|
3
|
-
export interface LegacyUnsubscribeConversionResult {
|
|
4
|
-
html: string;
|
|
5
|
-
converted: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const hasLegacyUnsubscribeClass: (html: string) => boolean;
|
|
8
|
-
export declare const convertLinklessLegacyUnsubscribeBlocks: (root: ParentNode) => number;
|
|
9
|
-
export declare const convertLegacyUnsubscribeInModuleHtml: (html: string) => LegacyUnsubscribeConversionResult;
|
|
10
|
-
export declare const convertLegacyUnsubscribeInDocumentHtml: (html: string) => LegacyUnsubscribeConversionResult;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { protectLiquid as a, restoreLiquid as u } from "./liquidProtection.js";
|
|
2
|
-
const b = "td.unsubscribe-block", l = ["a.unsubscribe-link", 'a[href*="unsubscribe"]'], d = "esd-block-text", m = [
|
|
3
|
-
"unsubscribe-block",
|
|
4
|
-
"esd-extension",
|
|
5
|
-
"esd-extension-block",
|
|
6
|
-
"esd-unsubscribe-block",
|
|
7
|
-
"esd-block-unsubscribe"
|
|
8
|
-
], L = "esd-extension-block-id", S = "data-unsubscribe-", E = "address,article,aside,blockquote,center,details,dialog,dir,div,dd,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,listing,main,menu,nav,ol,p,plaintext,pre,search,section,summary,table,ul,xmp", f = new RegExp(`class\\s*=\\s*(?:["'][^"']*)?(?<![\\w-])unsubscribe-block(?![\\w-])`, "i"), p = (e) => typeof e == "string" && f.test(e), y = (e) => l.some((t) => e.querySelector(t) !== null), g = (e) => {
|
|
9
|
-
e.classList.remove(...m), e.classList.add(d), e.removeAttribute(L), Array.from(e.attributes).filter(({ name: t }) => t.startsWith(S)).forEach(({ name: t }) => e.removeAttribute(t)), e.querySelector(E) || (e.innerHTML = `<p path="1">${e.innerHTML}</p>`);
|
|
10
|
-
}, h = (e) => {
|
|
11
|
-
const t = Array.from(e.querySelectorAll(b)).filter((r) => !y(r));
|
|
12
|
-
return t.forEach(g), t.length;
|
|
13
|
-
}, v = (e) => {
|
|
14
|
-
const t = e.trimStart(), r = new DOMParser();
|
|
15
|
-
return /^<t[dh][\s>]/i.test(t) ? r.parseFromString(`<table><tbody><tr>${e}</tr></tbody></table>`, "text/html").querySelector("tr") : /^<tr[\s>]/i.test(t) ? r.parseFromString(`<table><tbody>${e}</tbody></table>`, "text/html").querySelector("tbody") : /^<table[\s>]/i.test(t) ? r.parseFromString(e, "text/html").body : (console.debug("[LegacyUnsubscribeConversion] Skipped module with a non-table root"), null);
|
|
16
|
-
}, c = (e) => {
|
|
17
|
-
const t = e.search(/<html[\s>]/i), r = [...e.matchAll(/<\/html\s*>/gi)].at(-1), s = (r == null ? void 0 : r.index) === void 0 ? -1 : r.index + r[0].length;
|
|
18
|
-
return t < 0 || s <= t ? { head: "", root: e, tail: "" } : { head: e.slice(0, t), root: e.slice(t, s), tail: e.slice(s) };
|
|
19
|
-
}, i = (e, t, r, s) => {
|
|
20
|
-
if (!p(e))
|
|
21
|
-
return { html: e, converted: !1 };
|
|
22
|
-
try {
|
|
23
|
-
const o = a(e), n = t(o);
|
|
24
|
-
return !n || h(n) === 0 ? { html: e, converted: !1 } : { html: u(r(n, o)), converted: !0 };
|
|
25
|
-
} catch (o) {
|
|
26
|
-
return console.error(`Failed to convert legacy unsubscribe blocks in ${s}:`, o), { html: e, converted: !1 };
|
|
27
|
-
}
|
|
28
|
-
}, C = (e) => i(
|
|
29
|
-
e,
|
|
30
|
-
v,
|
|
31
|
-
(t) => t.innerHTML,
|
|
32
|
-
"module"
|
|
33
|
-
), _ = (e) => i(
|
|
34
|
-
e,
|
|
35
|
-
(t) => new DOMParser().parseFromString(c(t).root, "text/html"),
|
|
36
|
-
(t, r) => {
|
|
37
|
-
const { head: s, tail: o } = c(r);
|
|
38
|
-
return `${s}${t.documentElement.outerHTML}${o}`;
|
|
39
|
-
},
|
|
40
|
-
"document"
|
|
41
|
-
);
|
|
42
|
-
export {
|
|
43
|
-
l as LEGACY_UNSUBSCRIBE_LINK_SELECTORS,
|
|
44
|
-
b as LEGACY_UNSUBSCRIBE_SELECTOR,
|
|
45
|
-
_ as convertLegacyUnsubscribeInDocumentHtml,
|
|
46
|
-
C as convertLegacyUnsubscribeInModuleHtml,
|
|
47
|
-
h as convertLinklessLegacyUnsubscribeBlocks,
|
|
48
|
-
p as hasLegacyUnsubscribeClass
|
|
49
|
-
};
|