@useinsider/guido 3.23.0-beta.9f6bfbf → 3.23.0-beta.a35efcf

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 (55) hide show
  1. package/README.md +9 -1
  2. package/dist/@types/config/schemas.js +26 -26
  3. package/dist/components/Guido.vue.js +5 -5
  4. package/dist/components/Guido.vue2.js +88 -86
  5. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +17 -0
  6. package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +30 -0
  7. package/dist/composables/useModuleRepair.js +30 -23
  8. package/dist/config/migrator/index.js +16 -16
  9. package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +16 -0
  10. package/dist/enums/academy.js +2 -1
  11. package/dist/extensions/Blocks/Items/block.js +77 -115
  12. package/dist/extensions/Blocks/Items/constants/currency.js +14 -59
  13. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +22 -33
  14. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +51 -62
  15. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +17 -18
  16. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +31 -42
  17. package/dist/extensions/Blocks/Items/controls/settingsControl.js +120 -141
  18. package/dist/extensions/Blocks/Items/enums/controlEnums.js +1 -1
  19. package/dist/extensions/Blocks/Items/extension.js +8 -9
  20. package/dist/extensions/Blocks/Items/items.css.js +0 -19
  21. package/dist/extensions/Blocks/Items/settingsPanel.js +25 -34
  22. package/dist/extensions/Blocks/Items/template.js +212 -250
  23. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +0 -1
  24. package/dist/guido.css +1 -1
  25. package/dist/package.json.js +2 -2
  26. package/dist/src/@types/config/schemas.d.ts +4 -4
  27. package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +2 -0
  28. package/dist/src/composables/useConfig.d.ts +2 -2
  29. package/dist/src/composables/useModuleRepair.d.ts +2 -11
  30. package/dist/src/config/migrator/index.d.ts +1 -4
  31. package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +1 -0
  32. package/dist/src/enums/academy.d.ts +1 -0
  33. package/dist/src/extensions/Blocks/Items/block.d.ts +9 -6
  34. package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +0 -32
  35. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -1
  36. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
  37. package/dist/src/extensions/Blocks/Items/template.d.ts +1 -4
  38. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -3
  39. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +0 -12
  40. package/dist/src/stores/config.d.ts +20 -20
  41. package/dist/src/stores/editor.d.ts +25 -0
  42. package/dist/src/utils/itemsCurrencyRepair.d.ts +1 -5
  43. package/dist/src/utils/legacyUnsubscribeConversion.d.ts +10 -0
  44. package/dist/static/stripo-runtime-manifest.json.js +1 -1
  45. package/dist/stores/editor.js +15 -14
  46. package/dist/utils/itemsCurrencyRepair.js +24 -29
  47. package/dist/utils/legacyUnsubscribeConversion.js +49 -0
  48. package/dist/utils/pairProductVariables.js +99 -119
  49. package/package.json +2 -2
  50. package/dist/config/migrator/itemsPriceFormatMigrator.js +0 -20
  51. package/dist/extensions/Blocks/Items/controls/priceFormat.js +0 -145
  52. package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +0 -185
  53. package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +0 -1
  54. package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +0 -23
  55. package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +0 -61
@@ -1,23 +0,0 @@
1
- import { ControlApi, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
- import { CommonControl } from '../../common-control';
3
- import { ItemsBlockControlId } from '../enums/controlEnums';
4
- import { type ItemsBlockConfig } from '../utils/nodeConfigUtils';
5
- export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_FORMAT;
6
- export declare function isNewPriceFormatBlock(currentNode: ImmutableHtmlNode | undefined): boolean;
7
- /** One apply: the config patch, the root attrs the export reads, and both price texts re-rendered. */
8
- export declare function applyPriceFormatChange(currentNode: ImmutableHtmlNode | undefined, api: ControlApi, patch: Partial<ItemsBlockConfig>, description: string): void;
9
- export declare class ItemsBlockPriceFormatControl extends CommonControl {
10
- private lastWritten;
11
- getId(): string;
12
- getTemplate(): string;
13
- onRender(): void;
14
- onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
15
- onDestroy(): void;
16
- _onThousandSeparatorChange(value: string): void;
17
- _onDecimalSeparatorChange(value: string): void;
18
- _onDecimalCountChange(value: string): void;
19
- private _currentFormat;
20
- private _write;
21
- private _formValues;
22
- private _getSelectRow;
23
- }
@@ -1,61 +0,0 @@
1
- import { type ItemsPriceFormat } from '../constants/currency';
2
- import { type ItemsBlockConfig } from './nodeConfigUtils';
3
- export type PriceParagraphKind = 'price' | 'originalPrice';
4
- export declare const PRICE_PARAGRAPH_SELECTOR = "p[product-attr=\"price\"], p[product-attr=\"originalPrice\"]";
5
- type AttrMap = Record<string, string | null | undefined>;
6
- export interface PriceParagraphSnapshot {
7
- kind: PriceParagraphKind;
8
- attrs: AttrMap;
9
- text: string;
10
- }
11
- export interface PriceFormatSnapshot {
12
- rootAttrs: AttrMap;
13
- paragraphs: PriceParagraphSnapshot[];
14
- config: Partial<ItemsBlockConfig> | null;
15
- }
16
- export interface PriceTexts {
17
- price: string;
18
- originalPrice: string;
19
- }
20
- export interface PriceFormatOps {
21
- rootSet: Record<string, string>;
22
- paragraphRemove: string[];
23
- configPatch: Partial<ItemsBlockConfig> | null;
24
- texts: PriceTexts | null;
25
- changed: boolean;
26
- }
27
- export interface PlanPriceFormatOptions {
28
- convertLegacy: boolean;
29
- }
30
- export interface FormatDummyPriceInput {
31
- amount: string | number;
32
- format: ItemsPriceFormat;
33
- symbol: string | null | undefined;
34
- alignment: string | null | undefined;
35
- }
36
- export declare function paragraphKindOf(productAttr: string | null | undefined): PriceParagraphKind | null;
37
- export declare function resolvePriceDummyAmounts(config: Pick<Partial<ItemsBlockConfig>, 'type' | 'priceSinglePrice'> | null | undefined): PriceTexts;
38
- export declare function formatItemsDummyPrice({ amount, format, symbol, alignment }: FormatDummyPriceInput): string;
39
- export declare function priceTextsFromConfig(config: Partial<ItemsBlockConfig> | null | undefined): PriceTexts;
40
- /** `text` is decoded DOM text, `html` the rendered markup text (entities allowed). */
41
- export declare function samePriceText(text: string | null | undefined, html: string | null | undefined): boolean;
42
- /** Swaps the whole price text inside the paragraph markup, keeping the style wrappers around it. */
43
- export declare function replacePriceText(innerHtml: string, currentText: string, newText: string): string;
44
- export declare function planPriceFormatOps(snapshot: PriceFormatSnapshot, { convertLegacy }: PlanPriceFormatOptions): PriceFormatOps;
45
- export interface PriceParagraphSource {
46
- kind: PriceParagraphKind;
47
- attr(name: string): string | null | undefined;
48
- text: string;
49
- }
50
- export interface PriceFormatSnapshotSource {
51
- rootAttr(name: string): string | null | undefined;
52
- paragraphs: PriceParagraphSource[];
53
- config: Partial<ItemsBlockConfig> | null;
54
- }
55
- /** Shared snapshot builder so DOM (migrator, repair) and Stripo-node callers read the same attrs. */
56
- export declare function buildPriceFormatSnapshot(source: PriceFormatSnapshotSource): PriceFormatSnapshot;
57
- export declare function readPersistedConfigAttribute(root: Element): Partial<ItemsBlockConfig> | null;
58
- export declare function snapshotPriceFormatFromElement(root: Element): PriceFormatSnapshot;
59
- /** DOM applier for parsed HTML (migrator, module repair). Returns whether anything was written. */
60
- export declare function applyPriceFormatOpsToElement(root: Element, ops: PriceFormatOps): boolean;
61
- export {};