@useinsider/guido 3.16.0 → 3.17.0-beta.3e9d6e7
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 -0
- package/dist/@types/config/schemas.js +12 -6
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +63 -61
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +67 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +55 -0
- package/dist/composables/useCustomInterfaceAppearance.js +19 -16
- package/dist/composables/useRecommendation.js +43 -35
- package/dist/composables/useStripo.js +30 -29
- package/dist/config/migrator/itemsBlockMigrator.js +1 -1
- package/dist/config/migrator/recommendationMigrator.js +6 -4
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/recommendationBlock.js +25 -23
- package/dist/enums/recommendation.js +17 -17
- package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +13 -11
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +115 -87
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +132 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +198 -51
- package/dist/extensions/Blocks/Recommendation/utils/productIds.js +6 -0
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index-Dc9AygoZ.js +526 -0
- package/dist/node_modules/@useinsider/design-system-organisms/dist/index.js +9345 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InAccordion.js +174 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBasicTextInput.js +381 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBox.js +236 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBulkActions.js +70 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButton.js +350 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButtonV2.js +371 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCheckBox.js +152 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InChips.js +141 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCustomDropDown.js +1047 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDataTableV2.js +96050 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDatePicker.js +2042 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDrawer.js +166 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDropDown.js +1098 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InIcons.js +55 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InInfoBox.js +265 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLinks.js +184 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLoading.js +50 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InModals.js +453 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InNoData.js +145 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InOnPageMessage.js +176 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InProgress.js +266 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InRadioButton.js +114 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSegments.js +200 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSelect.js +451 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSkeleton.js +49 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InStatusText.js +119 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTabs.js +4309 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTagsText.js +129 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTextInput.js +503 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToasts.js +253 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToggle.js +107 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltip.js +134 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltipV2.js +464 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_commonjsHelpers.BItOPCY9.js +28 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_plugin-vue2_normalizer.WQT2Fc8L.js +23 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/clickOutside.qP9M0QCm.js +29 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/helpers.CgHNyjAJ.js +109 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/index.Bw_06igr.js +2339 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/localLocalesMixin.DYMhydo2.js +16 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/useLocalLocales.Ckuhy7d-.js +17 -0
- package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/vue-property-decorator.BtlM7Epa.js +188 -0
- package/dist/services/recommendationApi.js +77 -28
- package/dist/src/@types/config/schemas.d.ts +12 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBox.vue.d.ts +24 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +12 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +37 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +210 -10
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +6 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +43 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +171 -0
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/templatePreparation.js +37 -34
- package/package.json +2 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
const n = `/* Recommendation Strategy section of the recommendation block's settings panel
|
|
2
|
+
(SD-149105). Scoped to the section's own classes/ids so nothing leaks into
|
|
3
|
+
other blocks' controls. Measurements come from the Figma frames
|
|
4
|
+
4880:44449 (empty) and 4826:7513 (assigned). */
|
|
5
|
+
|
|
6
|
+
.strategy-control-header {
|
|
7
|
+
padding: 16px 16px 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.strategy-control-title {
|
|
11
|
+
margin: 0;
|
|
12
|
+
color: var(--guido-color-gray-800);
|
|
13
|
+
font-size: 16px;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
line-height: 24px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.strategy-control-description-row {
|
|
19
|
+
padding: 8px 16px 16px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.strategy-control-description {
|
|
23
|
+
margin: 0;
|
|
24
|
+
color: var(--guido-color-gray-600);
|
|
25
|
+
font-size: 13px;
|
|
26
|
+
line-height: 16px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.strategy-control-description a {
|
|
30
|
+
color: var(--guido-color-primary-500);
|
|
31
|
+
text-decoration: underline;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Assign + Create are two fixed 180px columns, left-aligned — not a stretched
|
|
35
|
+
half-and-half. The ancestor is load-bearing: it out-specifies the editor's own
|
|
36
|
+
\`.container.two-columns\` grid, which otherwise wins and leaves the CTAs uneven. */
|
|
37
|
+
.recommendation-controls-container .container.strategy-control-cta-row {
|
|
38
|
+
grid-template-columns: repeat(2, minmax(0, 180px));
|
|
39
|
+
justify-content: start;
|
|
40
|
+
gap: 16px;
|
|
41
|
+
padding: 0 16px 16px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* The editor's grid does not stretch its items and the visible pill is the inner
|
|
45
|
+
\`.button\`, not the \`ue-button\` host — so both need the width or the two CTAs
|
|
46
|
+
come out sized to their own captions. */
|
|
47
|
+
.strategy-control-cta {
|
|
48
|
+
width: 100%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.strategy-control-cta > .button {
|
|
52
|
+
display: flex;
|
|
53
|
+
gap: 8px;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
width: 100%;
|
|
56
|
+
min-height: 40px;
|
|
57
|
+
border: none;
|
|
58
|
+
border-radius: 4px;
|
|
59
|
+
font-size: 15px;
|
|
60
|
+
font-weight: 400;
|
|
61
|
+
line-height: 24px;
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Primary action: tinted fill, brand-coloured label (not a solid blue button). */
|
|
66
|
+
.strategy-control-cta.accent > .button {
|
|
67
|
+
background-color: var(--guido-color-primary-100);
|
|
68
|
+
color: var(--guido-color-primary-500);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.strategy-control-cta.accent > .button:hover:not(:disabled, .disabled) {
|
|
72
|
+
background-color: var(--guido-color-primary-100);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Secondary action keeps full contrast while disabled — the round trip ships
|
|
76
|
+
in a later phase, but the design shows it as a normal grey button. */
|
|
77
|
+
.strategy-control-cta.primary > .button:disabled,
|
|
78
|
+
.strategy-control-cta.primary > .button.disabled {
|
|
79
|
+
opacity: 1;
|
|
80
|
+
background-color: var(--guido-color-neutral-200);
|
|
81
|
+
color: var(--guido-color-gray-800);
|
|
82
|
+
cursor: default;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* The assigned strategy's name sits in a band that spans the whole panel, so it
|
|
86
|
+
carries its own 16px inset instead of inheriting the section's. */
|
|
87
|
+
.strategy-control-name-band {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
min-height: 48px;
|
|
91
|
+
padding: 0 16px;
|
|
92
|
+
background-color: var(--guido-color-gray-0);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.strategy-control-name {
|
|
96
|
+
color: var(--guido-color-gray-800);
|
|
97
|
+
font-size: 15px;
|
|
98
|
+
font-weight: 600;
|
|
99
|
+
line-height: 24px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.strategy-control-actions {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
padding: 16px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.strategy-control-action {
|
|
109
|
+
display: inline-flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
padding: 0;
|
|
112
|
+
border: none;
|
|
113
|
+
background: none;
|
|
114
|
+
font-size: 15px;
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
line-height: 24px;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* The label carries the gap on both sides, which is also what separates Change
|
|
121
|
+
from Remove — matching the design's button wrappers. */
|
|
122
|
+
.strategy-control-action > span {
|
|
123
|
+
padding: 0 8px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Icons are masks rather than inline SVG — Stripo rebuilds the control markup
|
|
127
|
+
through Angular, which recreates <svg> outside the SVG namespace so it never
|
|
128
|
+
paints. A mask is a background, so it survives that round trip. */
|
|
129
|
+
.strategy-control-action::before,
|
|
130
|
+
.strategy-control-cta.accent > .button::before {
|
|
131
|
+
content: '';
|
|
132
|
+
flex: none;
|
|
133
|
+
width: 24px;
|
|
134
|
+
height: 24px;
|
|
135
|
+
background-color: currentcolor;
|
|
136
|
+
mask-repeat: no-repeat;
|
|
137
|
+
mask-position: center;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* The design system's \`line-change\` glyph fills its 24px box; the 20px glyphs
|
|
141
|
+
are centred inside the same box, as the design draws them. */
|
|
142
|
+
.strategy-control-action--change::before {
|
|
143
|
+
mask-size: 24px 24px;
|
|
144
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M17.768 11.694a1.03 1.03 0 0 1-1.465 0 1.051 1.051 0 0 1 0-1.478L17.51 9H9a1 1 0 1 1 0-2h8.509l-1.206-1.216a1.051 1.051 0 0 1 0-1.478 1.03 1.03 0 0 1 1.465 0l2.929 2.955c.404.408.404 1.07 0 1.478l-2.93 2.955zM3.303 15.261a1.051 1.051 0 0 0 0 1.478l2.93 2.955a1.03 1.03 0 0 0 1.464 0 1.051 1.051 0 0 0 0-1.478L6.49 17H15a1 1 0 1 0 0-2H6.491l1.206-1.216a1.051 1.051 0 0 0 0-1.478 1.03 1.03 0 0 0-1.465 0l-2.929 2.955z'/%3E%3C/svg%3E");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.strategy-control-action--remove::before {
|
|
148
|
+
mask-size: 20px 20px;
|
|
149
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M15.97 7H16.09C16.3342 7.02199 16.5619 7.13294 16.7296 7.31178C16.8974 7.49062 16.9936 7.72487 17 7.97V8.09L16.24 16.36C16.1547 17.3188 15.7266 18.2147 15.0341 18.8833C14.3416 19.552 13.4312 19.9484 12.47 20L12.26 20.01H7.74C6.77775 20.0102 5.84767 19.6635 5.12033 19.0335C4.39298 18.4035 3.91712 17.5324 3.78 16.58L3.76 16.38L3 8.08C2.9803 7.94999 2.9864 7.81738 3.01796 7.68973C3.04951 7.56207 3.1059 7.44189 3.1839 7.33603C3.34143 7.12224 3.57744 6.97978 3.84 6.94C4.10256 6.90022 4.37018 6.96637 4.58397 7.1239C4.68983 7.2019 4.77929 7.29999 4.84724 7.41256C4.91519 7.52514 4.9603 7.64999 4.98 7.78L5 7.9L5.75 16.17C5.78903 16.644 5.99569 17.0886 6.3329 17.4239C6.67011 17.7593 7.1158 17.9636 7.59 18L7.74 18.01H12.26C12.7328 18.0094 13.1901 17.8413 13.5507 17.5356C13.9113 17.2299 14.152 16.8063 14.23 16.34L14.25 16.19L15 7.92C15.022 7.67577 15.1329 7.44813 15.3118 7.28036C15.4906 7.11258 15.7249 7.01637 15.97 7.01V7ZM8 9C8.24568 8.99822 8.48341 9.08695 8.66785 9.24926C8.85229 9.41157 8.97052 9.63609 9 9.88V15C9.00788 15.1313 8.98982 15.2629 8.94684 15.3873C8.90387 15.5116 8.83682 15.6262 8.74953 15.7247C8.66225 15.8231 8.55643 15.9034 8.43812 15.9609C8.31981 16.0185 8.19132 16.0521 8.06 16.06C7.79478 16.0759 7.53411 15.9858 7.33532 15.8095C7.13653 15.6332 7.01591 15.3852 7 15.12V10C7 9.73478 7.10536 9.48043 7.29289 9.29289C7.48043 9.10536 7.73478 9 8 9ZM12 9C12.2457 8.99822 12.4834 9.08695 12.6679 9.24926C12.8523 9.41157 12.9705 9.63609 13 9.88V15C13.0159 15.2652 12.9258 15.5259 12.7495 15.7247C12.5732 15.9235 12.3252 16.0441 12.06 16.06C11.7948 16.0759 11.5341 15.9858 11.3353 15.8095C11.1365 15.6332 11.0159 15.3852 11 15.12V10C11 9.73478 11.1054 9.48043 11.2929 9.29289C11.4804 9.10536 11.7348 9 12 9ZM3 6C2.73478 6.01591 2.47411 5.92582 2.27532 5.74953C2.07653 5.57325 1.95591 5.32522 1.94 5.06C1.92409 4.79478 2.01418 4.53411 2.19047 4.33532C2.36675 4.13653 2.61478 4.01591 2.88 4H6.23L6.66 2.3C6.8129 1.67693 7.16151 1.11929 7.65466 0.708933C8.14781 0.298574 8.75952 0.0571152 9.4 0.02H10.45C11.0881 0.0203866 11.7094 0.224211 12.2237 0.60186C12.7381 0.979509 13.1186 1.51131 13.31 2.12L13.36 2.28L13.79 3.99H17C17.2652 3.97409 17.5259 4.06418 17.7247 4.24047C17.9235 4.41675 18.0441 4.66478 18.06 4.93C18.0759 5.19522 17.9858 5.45589 17.8095 5.65468C17.6332 5.85347 17.3852 5.97409 17.12 5.99H3V6ZM10.44 2.03H9.57C9.36856 2.0306 9.17199 2.09201 9.00605 2.20621C8.8401 2.32041 8.71252 2.48206 8.64 2.67L8.6 2.78L8.3 4H11.72L11.42 2.78C11.3746 2.60092 11.2805 2.4379 11.1481 2.30905C11.0157 2.18019 10.8502 2.09053 10.67 2.05L10.55 2.03H10.45H10.44Z'/%3E%3C/svg%3E");
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.strategy-control-cta.accent > .button::before {
|
|
153
|
+
mask-size: 20px 20px;
|
|
154
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C10.2457 3.99823 10.4834 4.08695 10.6679 4.24926C10.8523 4.41157 10.9705 4.63609 11 4.88V9H15C15.2652 8.98409 15.5259 9.07418 15.7247 9.25047C15.9235 9.42675 16.0441 9.67478 16.06 9.94C16.0759 10.2052 15.9858 10.4659 15.8095 10.6647C15.6332 10.8635 15.3852 10.9841 15.12 11H11V15C11.0159 15.2652 10.9258 15.5259 10.7495 15.7247C10.5732 15.9235 10.3252 16.0441 10.06 16.06C9.79478 16.0759 9.53411 15.9858 9.33532 15.8095C9.13653 15.6332 9.01591 15.3852 9 15.12V11H5C4.73478 11.0159 4.47411 10.9258 4.27532 10.7495C4.07653 10.5732 3.95591 10.3252 3.94 10.06C3.92409 9.79478 4.01418 9.53411 4.19047 9.33532C4.36675 9.13653 4.61478 9.01591 4.88 9H9V5C9 4.73478 9.10536 4.48043 9.29289 4.29289C9.48043 4.10536 9.73478 4 10 4Z'/%3E%3C/svg%3E");
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.strategy-control-action--change {
|
|
158
|
+
color: var(--guido-color-primary-500);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.strategy-control-action--remove {
|
|
162
|
+
color: var(--guido-color-danger-500);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.strategy-control-action:hover {
|
|
166
|
+
text-decoration: underline;
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
export {
|
|
170
|
+
n as default
|
|
171
|
+
};
|
package/dist/utils/dateUtil.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { DEFAULT_LOCALE as
|
|
2
|
-
const
|
|
1
|
+
import { DEFAULT_LOCALE as n, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
|
|
2
|
+
const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 && !Number.isNaN(Number(t)) ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
|
|
3
3
|
const t = window.l10n;
|
|
4
|
-
return (t == null ? void 0 : t.locale) ===
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
return (t == null ? void 0 : t.locale) === a ? n : (t == null ? void 0 : t.locale) || n;
|
|
5
|
+
}, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
|
|
6
|
+
const t = window.l10n;
|
|
7
|
+
return (t == null ? void 0 : t.timezone) || u || c;
|
|
8
|
+
}, D = (t, e = s(), r = f()) => {
|
|
9
|
+
const o = {
|
|
10
|
+
year: "numeric",
|
|
11
|
+
month: "2-digit",
|
|
12
|
+
day: "2-digit",
|
|
13
|
+
timeZone: r
|
|
14
|
+
}, i = m(t);
|
|
15
|
+
return new Intl.DateTimeFormat(e, o).format(i);
|
|
16
|
+
}, T = (t) => {
|
|
8
17
|
if (!t)
|
|
9
18
|
return "";
|
|
10
19
|
const e = new Date(t);
|
|
@@ -16,9 +25,13 @@ const i = (t) => {
|
|
|
16
25
|
second: "2-digit",
|
|
17
26
|
hour12: !1
|
|
18
27
|
}).format(e);
|
|
19
|
-
},
|
|
28
|
+
}, h = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
|
|
20
29
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
m as convertToDateObject,
|
|
31
|
+
T as formatPatchDate,
|
|
32
|
+
D as formatShortDate,
|
|
33
|
+
h as isAfterDate,
|
|
34
|
+
u as localTz,
|
|
35
|
+
s as locale,
|
|
36
|
+
f as timezone
|
|
24
37
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
3
|
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
-
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as
|
|
4
|
+
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
5
|
import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
6
|
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
7
|
import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
@@ -11,20 +11,20 @@ import { useEditorStore as z } from "../stores/editor.js";
|
|
|
11
11
|
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
12
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
13
|
function O(m) {
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
const o =
|
|
14
|
+
const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
|
|
15
|
+
return i.forEach((s) => {
|
|
16
|
+
const o = s.getAttribute(A.PAGE_LIST);
|
|
17
17
|
o && t.push(...R(o));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
20
20
|
async function M(m) {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
22
|
+
if (n.length === 0)
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const i = C();
|
|
25
|
+
n.forEach((t) => {
|
|
26
26
|
var r, l, g, f, c;
|
|
27
|
-
const
|
|
27
|
+
const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
|
|
28
28
|
if (!Number.isFinite(o))
|
|
29
29
|
return;
|
|
30
30
|
const p = t.getAttribute("esd-ext-config");
|
|
@@ -42,24 +42,27 @@ async function M(m) {
|
|
|
42
42
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
43
43
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
44
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
45
|
-
strategy: L(e.strategy) ||
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
strategy: L(e.strategy) || a.strategy,
|
|
46
|
+
// esd-ext-config is the source of truth for the assigned RRS —
|
|
47
|
+
// a strategy-backed block must survive save/reopen from it alone.
|
|
48
|
+
strategyId: e.strategyId ?? a.strategyId,
|
|
49
|
+
language: e.language ?? a.language,
|
|
50
|
+
size: e.size ?? a.size,
|
|
48
51
|
// Spread the default arrays so each block gets a fresh reference
|
|
49
52
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
50
|
-
productIds: e.productIds ?? [...
|
|
51
|
-
filters: e.filters ?? [...
|
|
52
|
-
shuffleProducts: e.shuffleProducts ??
|
|
53
|
+
productIds: e.productIds ?? [...a.productIds],
|
|
54
|
+
filters: e.filters ?? [...a.filters],
|
|
55
|
+
shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
|
|
53
56
|
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
|
|
54
57
|
currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
|
|
55
58
|
currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
|
|
56
59
|
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
|
|
57
60
|
currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
|
|
58
61
|
};
|
|
59
|
-
|
|
62
|
+
i.seedBlockUrlConfig(o, h);
|
|
60
63
|
});
|
|
61
64
|
try {
|
|
62
|
-
await
|
|
65
|
+
await i.fetchRecommendationCreateData();
|
|
63
66
|
} catch (t) {
|
|
64
67
|
console.warn(
|
|
65
68
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
@@ -68,39 +71,39 @@ async function M(m) {
|
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
const Z = () => {
|
|
71
|
-
const m = N(), u = z(),
|
|
74
|
+
const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
72
75
|
return {
|
|
73
76
|
prepareTemplateDetails: async () => {
|
|
74
77
|
let { html: r, css: l, syncModulesIds: g = [] } = await t();
|
|
75
78
|
if (e("linkTrackingIds"))
|
|
76
79
|
try {
|
|
77
|
-
const { html:
|
|
78
|
-
u.trackIdSessionFloor =
|
|
79
|
-
} catch (
|
|
80
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
80
|
+
const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
|
|
81
|
+
u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
|
|
82
|
+
} catch (S) {
|
|
83
|
+
console.error("Tracking-id step failed, saving anyway:", S);
|
|
81
84
|
}
|
|
82
|
-
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await
|
|
85
|
+
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
|
|
83
86
|
minimize: !0,
|
|
84
87
|
resetDataSavedFlag: !1
|
|
85
88
|
});
|
|
86
|
-
|
|
87
|
-
const { compiledHtml:
|
|
89
|
+
n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
|
|
90
|
+
const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
|
|
88
91
|
return console.debug("HTML Compilation Stats:", {
|
|
89
|
-
originalSize:
|
|
90
|
-
compiledSize:
|
|
91
|
-
reduction: `${
|
|
92
|
-
appliedRules:
|
|
93
|
-
executionTime: `${
|
|
92
|
+
originalSize: y.originalSize,
|
|
93
|
+
compiledSize: y.compiledSize,
|
|
94
|
+
reduction: `${y.reductionPercentage.toFixed(2)}%`,
|
|
95
|
+
appliedRules: w,
|
|
96
|
+
executionTime: `${y.executionTime.toFixed(2)}ms`
|
|
94
97
|
}), {
|
|
95
|
-
dynamicContentList:
|
|
96
|
-
compiledHtml:
|
|
98
|
+
dynamicContentList: E,
|
|
99
|
+
compiledHtml: I,
|
|
97
100
|
rawHtml: r,
|
|
98
101
|
css: l,
|
|
99
|
-
ampHtml:
|
|
102
|
+
ampHtml: D,
|
|
100
103
|
ampErrors: T,
|
|
101
104
|
modules: g.map(Number),
|
|
102
105
|
recommendation: {
|
|
103
|
-
campaignUrls:
|
|
106
|
+
campaignUrls: P.recommendationCampaignUrls,
|
|
104
107
|
configs: {}
|
|
105
108
|
},
|
|
106
109
|
unsubscribe: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.0-beta.3e9d6e7",
|
|
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",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@stripoinc/ui-editor-extensions": "3.9.0",
|
|
51
|
+
"@useinsider/design-system-organisms": "0.0.3-beta.fc2c160",
|
|
51
52
|
"@useinsider/design-system-vue": "1.5.0",
|
|
52
53
|
"@vueuse/core": "11.3.0",
|
|
53
54
|
"lodash-es": "4.17.21",
|