@designcrowd/library.brand-page 6.0.18 → 6.0.19-ast-btns
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/lib/src/{CreatedOnBrandCrowd-de-de-CIrk6Brm.js → CreatedOnBrandCrowd-de-de-BrIpxgMF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CvXk0moH.js → CreatedOnBrandCrowd-en-us-DQDv2DBf.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BhtZbjjU.js → CreatedOnBrandCrowd-es-es-BadaUjK1.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-B6TD57O-.js → CreatedOnBrandCrowd-fr-ca-DbrUAAGP.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-B6TD57O-.js → CreatedOnBrandCrowd-fr-fr-DbrUAAGP.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-Bto0xOtS.js → CreatedOnBrandCrowd-pt-br-Cy41WPcW.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-Bto0xOtS.js → CreatedOnBrandCrowd-pt-pt-Cy41WPcW.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-2h2W3y5z.js → CreatedOnDcom-de-de-D6UvcWQ5.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-D6Jgk6yv.js → CreatedOnDcom-en-us-DKUOQjj3.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-sBCqYQIm.js → CreatedOnDcom-es-es-CftpM7Vk.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-C8hg5hTU.js → CreatedOnDcom-fr-ca-DcCQzJDA.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-_DP1Umyh.js → CreatedOnDcom-fr-fr-Bodcymjw.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-BdwYAy5p.js → CreatedOnDcom-pt-br-B1OmeM4X.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-Bm1NHVaH.js → CreatedOnDcom-pt-pt-CGx-k757.js} +1 -1
- package/lib/src/brand-page/components/button/decorative-button-styles.d.ts +5 -0
- package/lib/src/brand-page/components/button/decorative-button-styles.js +13 -0
- package/lib/src/brand-page/components/button/paper-button-mask.d.ts +1 -0
- package/lib/src/brand-page/components/button/paper-button-mask.js +8 -0
- package/lib/src/brand-page/components/collapsible/Collapsible.mixin.d.ts +11 -0
- package/lib/src/brand-page/components/collapsible/Collapsible.mixin.js +10 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +1 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +7 -0
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +5 -0
- package/lib/src/brand-page/components/payment/Payment.mixin.js +5 -0
- package/lib/src/brand-page/models/index.d.ts +1 -0
- package/lib/src/brand-page/models/payment.model.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-19.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-19.js +48 -0
- package/lib/src/brand-page/utils/migration.util.js +9 -0
- package/lib/src/brand-page/utils/view-model.util.js +1 -0
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +32 -1
- package/lib/src/brand-page-maker/default-getters/contact-form-background-color.default-getter.d.ts +8 -0
- package/lib/src/brand-page-maker/default-getters/contact-form-background-color.default-getter.js +16 -0
- package/lib/src/brand-page-maker/default-getters/index.d.ts +1 -0
- package/lib/src/brand-page-maker/default-getters/index.js +1 -0
- package/lib/src/brand-page-maker/models/button-styles-config.js +15 -3
- package/lib/src/brand-page-maker/models/content-settings.js +3 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +72 -69
- package/lib/src/css/library.brand-page-brandPage.min.css +72 -69
- package/lib/src/css/library.brand-page-designCom.min.css +72 -69
- package/lib/src/css/library.brand-page-preview.min.css +72 -69
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-CPTMajMv.js → lib-ce4Vsuiu.js} +30228 -30028
- package/lib/src/metadata-builder/builders/section-rules/banner-section.rules.js +6 -0
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +1 -1
- package/package.json +1 -1
- package/src/brand-page/components/button/ButtonStyleWrapper.vue +92 -41
- package/src/brand-page/components/button/ButtonStyleWrapper.vue.test.ts +164 -0
- package/src/brand-page/components/button/decorative-button-styles.ts +16 -0
- package/src/brand-page/components/button/paper-button-mask.ts +8 -0
- package/src/brand-page/components/collapsible/Collapsible.mixin.ts +11 -0
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +10 -0
- package/src/brand-page/components/contact-form/ContactForm.vue +88 -39
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +6 -0
- package/src/brand-page/components/mailing-list/MailingList.vue +18 -10
- package/src/brand-page/components/payment/Payment.mixin.ts +6 -0
- package/src/brand-page/components/payment/Payment.vue +43 -24
- package/src/brand-page/components/payment/RequestPaymentStripe.vue +26 -22
- package/src/brand-page/components/shop/Shop.vue +15 -6
- package/src/brand-page/models/index.ts +1 -0
- package/src/brand-page/models/payment.model.ts +2 -0
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -3
- package/src/brand-page/utils/migration/migration-19.test.ts +120 -0
- package/src/brand-page/utils/migration/migration-19.ts +67 -0
- package/src/brand-page/utils/migration.util.ts +10 -0
- package/src/brand-page/utils/view-model.util.ts +1 -0
- package/src/brand-page-maker/constants/config-settings-constant.ts +32 -0
- package/src/brand-page-maker/default-getters/contact-form-background-color.default-getter.ts +23 -0
- package/src/brand-page-maker/default-getters/index.ts +1 -0
- package/src/brand-page-maker/models/button-styles-config.ts +15 -3
- package/src/brand-page-maker/models/content-settings.ts +3 -0
- package/src/metadata-builder/builders/section-rules/banner-section.rules.ts +6 -0
- package/src/metadata-builder/parsers/section-tool-arguments.ts +7 -1
- package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +13 -0
- package/src/shared/style-settings/components/StyleSettings.vue +1 -0
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
:title="title"
|
|
31
31
|
:title-style="viewModel.titleStyle"
|
|
32
32
|
:button-styles="viewModel.buttonStyles.style"
|
|
33
|
+
:background-style="viewModel.backgroundStyle"
|
|
33
34
|
:can-collapse="canCollapse"
|
|
34
35
|
:context="context"
|
|
35
36
|
:class="{ 'contact-container': context.isBrandSite }"
|
|
@@ -80,17 +81,25 @@
|
|
|
80
81
|
{{ value.error }}
|
|
81
82
|
</p>
|
|
82
83
|
</div>
|
|
83
|
-
<
|
|
84
|
+
<ButtonStyleWrapper
|
|
84
85
|
v-if="isSubmitButtonVisible"
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
:selected-button-style-id="
|
|
87
|
+
viewModel.buttonStyles.selectedButtonStyleId
|
|
88
|
+
"
|
|
89
|
+
:icon-color="viewModel.buttonStyles.style.backgroundColor"
|
|
90
|
+
:no-margin="true"
|
|
87
91
|
>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
<button
|
|
93
|
+
class="tw-block tw-border-0 tw-mt-4 tw-py-2 tw-select-none tw-text-base tw-text-center tw-w-full hover:tw-cursor-pointer"
|
|
94
|
+
:style="submitButtonStyle"
|
|
95
|
+
>
|
|
96
|
+
<TextWrapper
|
|
97
|
+
:text-style="submitButtonTextStyle"
|
|
98
|
+
:text="viewModel.buttonText"
|
|
99
|
+
class="tw-text-center tw-text-base"
|
|
100
|
+
/>
|
|
101
|
+
</button>
|
|
102
|
+
</ButtonStyleWrapper>
|
|
94
103
|
</div>
|
|
95
104
|
<div v-else class="tw-w-full tw-flex tw-justify-center">
|
|
96
105
|
<Loader />
|
|
@@ -184,18 +193,30 @@
|
|
|
184
193
|
</p>
|
|
185
194
|
</div>
|
|
186
195
|
<div class="tw-flex tw-w-full tw-justify-center tw-col-span-2">
|
|
187
|
-
<
|
|
196
|
+
<ButtonStyleWrapper
|
|
188
197
|
v-if="isSubmitButtonVisible"
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
198
|
+
:selected-button-style-id="
|
|
199
|
+
viewModel.buttonStyles.selectedButtonStyleId
|
|
200
|
+
"
|
|
201
|
+
:icon-color="viewModel.buttonStyles.style.backgroundColor"
|
|
202
|
+
:full-width="isMobileDevice"
|
|
203
|
+
:no-margin="true"
|
|
192
204
|
>
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
:
|
|
196
|
-
class="
|
|
197
|
-
|
|
198
|
-
|
|
205
|
+
<button
|
|
206
|
+
class="tw-block tw-border-0 tw-py-2 tw-select-none tw-text-base tw-text-center tw-w-fit hover:tw-cursor-pointer tw-px-8 tw-py-3 c-button-full"
|
|
207
|
+
:style="submitButtonStyle"
|
|
208
|
+
:class="{
|
|
209
|
+
'tw-w-full': isMobileDevice,
|
|
210
|
+
'tw-min-w-[120px]': isDecorativeSubmitStyle,
|
|
211
|
+
}"
|
|
212
|
+
>
|
|
213
|
+
<TextWrapper
|
|
214
|
+
:text-style="submitButtonTextStyle"
|
|
215
|
+
:text="viewModel.buttonText"
|
|
216
|
+
class="tw-text-center tw-text-base"
|
|
217
|
+
/>
|
|
218
|
+
</button>
|
|
219
|
+
</ButtonStyleWrapper>
|
|
199
220
|
</div>
|
|
200
221
|
</div>
|
|
201
222
|
<div v-else class="tw-w-full tw-flex tw-justify-center">
|
|
@@ -296,18 +317,30 @@
|
|
|
296
317
|
</p>
|
|
297
318
|
</div>
|
|
298
319
|
<div class="tw-flex tw-w-full tw-justify-start tw-col-span-2">
|
|
299
|
-
<
|
|
320
|
+
<ButtonStyleWrapper
|
|
300
321
|
v-if="isSubmitButtonVisible"
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
322
|
+
:selected-button-style-id="
|
|
323
|
+
viewModel.buttonStyles.selectedButtonStyleId
|
|
324
|
+
"
|
|
325
|
+
:icon-color="viewModel.buttonStyles.style.backgroundColor"
|
|
326
|
+
:full-width="isMobileDevice"
|
|
327
|
+
:no-margin="true"
|
|
304
328
|
>
|
|
305
|
-
<
|
|
306
|
-
|
|
307
|
-
:
|
|
308
|
-
class="
|
|
309
|
-
|
|
310
|
-
|
|
329
|
+
<button
|
|
330
|
+
class="tw-block tw-border-0 tw-py-2 tw-select-none tw-text-base tw-text-center tw-w-fit hover:tw-cursor-pointer tw-px-8 tw-py-3 c-button-full"
|
|
331
|
+
:style="submitButtonStyle"
|
|
332
|
+
:class="{
|
|
333
|
+
'tw-w-full': isMobileDevice,
|
|
334
|
+
'tw-min-w-[120px]': isDecorativeSubmitStyle,
|
|
335
|
+
}"
|
|
336
|
+
>
|
|
337
|
+
<TextWrapper
|
|
338
|
+
:text-style="submitButtonTextStyle"
|
|
339
|
+
:text="viewModel.buttonText"
|
|
340
|
+
class="tw-text-center tw-text-base"
|
|
341
|
+
/>
|
|
342
|
+
</button>
|
|
343
|
+
</ButtonStyleWrapper>
|
|
311
344
|
</div>
|
|
312
345
|
</div>
|
|
313
346
|
<p v-if="hasSubmitError" class="tw-text-center tw-mt-2 form-error">
|
|
@@ -426,18 +459,32 @@
|
|
|
426
459
|
<div
|
|
427
460
|
class="tw-flex tw-w-full tw-justify-start tw-col-span-2"
|
|
428
461
|
>
|
|
429
|
-
<
|
|
462
|
+
<ButtonStyleWrapper
|
|
430
463
|
v-if="isSubmitButtonVisible"
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
464
|
+
:selected-button-style-id="
|
|
465
|
+
viewModel.buttonStyles.selectedButtonStyleId
|
|
466
|
+
"
|
|
467
|
+
:icon-color="
|
|
468
|
+
viewModel.buttonStyles.style.backgroundColor
|
|
469
|
+
"
|
|
470
|
+
:full-width="isMobileDevice"
|
|
471
|
+
:no-margin="true"
|
|
434
472
|
>
|
|
435
|
-
<
|
|
436
|
-
|
|
437
|
-
:
|
|
438
|
-
class="
|
|
439
|
-
|
|
440
|
-
|
|
473
|
+
<button
|
|
474
|
+
class="tw-block tw-border-0 tw-py-2 tw-select-none tw-text-base tw-text-center tw-w-fit hover:tw-cursor-pointer tw-px-8 tw-py-3 c-button-full"
|
|
475
|
+
:style="submitButtonStyle"
|
|
476
|
+
:class="{
|
|
477
|
+
'tw-w-full': isMobileDevice,
|
|
478
|
+
'tw-min-w-[120px]': isDecorativeSubmitStyle,
|
|
479
|
+
}"
|
|
480
|
+
>
|
|
481
|
+
<TextWrapper
|
|
482
|
+
:text-style="submitButtonTextStyle"
|
|
483
|
+
:text="viewModel.buttonText"
|
|
484
|
+
class="tw-text-center tw-text-base"
|
|
485
|
+
/>
|
|
486
|
+
</button>
|
|
487
|
+
</ButtonStyleWrapper>
|
|
441
488
|
</div>
|
|
442
489
|
</div>
|
|
443
490
|
<div v-else class="tw-w-full tw-flex tw-justify-center">
|
|
@@ -476,6 +523,7 @@ import Collapsible from '../collapsible/Collapsible.vue';
|
|
|
476
523
|
import MailingListMixin from './ContactForm.mixin.ts';
|
|
477
524
|
import Media from '../media/Media.vue';
|
|
478
525
|
import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
526
|
+
import ButtonStyleWrapper from '../button/ButtonStyleWrapper.vue';
|
|
479
527
|
import RecaptchaDisclosure from '../recaptcha-disclosure/RecaptchaDisclosure.vue';
|
|
480
528
|
|
|
481
529
|
export default {
|
|
@@ -486,6 +534,7 @@ export default {
|
|
|
486
534
|
Loader,
|
|
487
535
|
Media,
|
|
488
536
|
TextWrapper,
|
|
537
|
+
ButtonStyleWrapper,
|
|
489
538
|
RecaptchaDisclosure,
|
|
490
539
|
},
|
|
491
540
|
mixins: [MailingListMixin],
|
|
@@ -126,6 +126,12 @@ export default defineComponent({
|
|
|
126
126
|
buttonStyle.borderRadius = '24px';
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
// Own background colour decouples the container from the button fill (BP-5800).
|
|
130
|
+
if (this.viewModel.backgroundStyle?.backgroundColor) {
|
|
131
|
+
buttonStyle.backgroundColor =
|
|
132
|
+
this.viewModel.backgroundStyle.backgroundColor;
|
|
133
|
+
}
|
|
134
|
+
|
|
129
135
|
return buttonStyle;
|
|
130
136
|
},
|
|
131
137
|
|
|
@@ -46,17 +46,23 @@
|
|
|
46
46
|
<p v-if="hasEmailError" class="form-error">
|
|
47
47
|
{{ emailError }}
|
|
48
48
|
</p>
|
|
49
|
-
<
|
|
50
|
-
:style="
|
|
51
|
-
:
|
|
52
|
-
|
|
53
|
-
:class="{
|
|
54
|
-
'tw-cursor-pointer hover:tw-underline': !isFormDisabled,
|
|
55
|
-
'tw-cursor-wait': isSubmitting,
|
|
56
|
-
}"
|
|
49
|
+
<ButtonStyleWrapper
|
|
50
|
+
:selected-button-style-id="viewModel.styles.selectedButtonStyleId"
|
|
51
|
+
:icon-color="viewModel.styles.style.backgroundColor"
|
|
52
|
+
:no-margin="true"
|
|
57
53
|
>
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
<button
|
|
55
|
+
:style="buttonStyle"
|
|
56
|
+
:disabled="isFormDisabled"
|
|
57
|
+
class="tw-w-full tw-py-4 tw-mt-4 tw-block tw-text-center tw-text-base tw-border-0"
|
|
58
|
+
:class="{
|
|
59
|
+
'tw-cursor-pointer hover:tw-underline': !isFormDisabled,
|
|
60
|
+
'tw-cursor-wait': isSubmitting,
|
|
61
|
+
}"
|
|
62
|
+
>
|
|
63
|
+
{{ buttonText }}
|
|
64
|
+
</button>
|
|
65
|
+
</ButtonStyleWrapper>
|
|
60
66
|
<p v-if="hasSubmitError" class="tw-text-center tw-mt-2 form-error">
|
|
61
67
|
{{ submitError }}
|
|
62
68
|
</p>
|
|
@@ -74,12 +80,14 @@
|
|
|
74
80
|
import { TextInput } from '@designcrowd/fe-shared-lib';
|
|
75
81
|
import MailingListMixin from './MailingList.mixin.ts';
|
|
76
82
|
import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
83
|
+
import ButtonStyleWrapper from '../button/ButtonStyleWrapper.vue';
|
|
77
84
|
import RecaptchaDisclosure from '../recaptcha-disclosure/RecaptchaDisclosure.vue';
|
|
78
85
|
|
|
79
86
|
export default {
|
|
80
87
|
components: {
|
|
81
88
|
TextInput,
|
|
82
89
|
TextWrapper,
|
|
90
|
+
ButtonStyleWrapper,
|
|
83
91
|
RecaptchaDisclosure,
|
|
84
92
|
},
|
|
85
93
|
mixins: [MailingListMixin],
|
|
@@ -126,6 +126,12 @@ export default defineComponent({
|
|
|
126
126
|
buttonStyle.borderRadius = '26px';
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
// Own background colour decouples the container from the button fill (BP-5800).
|
|
130
|
+
if (this.viewModel.backgroundStyle?.backgroundColor) {
|
|
131
|
+
buttonStyle.backgroundColor =
|
|
132
|
+
this.viewModel.backgroundStyle.backgroundColor;
|
|
133
|
+
}
|
|
134
|
+
|
|
129
135
|
return buttonStyle;
|
|
130
136
|
},
|
|
131
137
|
|
|
@@ -49,22 +49,31 @@
|
|
|
49
49
|
<slot name="payment-options" />
|
|
50
50
|
|
|
51
51
|
<!-- TODO: Calculate or constant disabled background colour -->
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
<ButtonStyleWrapper
|
|
53
|
+
:selected-button-style-id="
|
|
54
|
+
viewModel.buttonStyles.selectedButtonStyleId
|
|
55
|
+
"
|
|
56
|
+
:icon-color="viewModel.buttonStyles.style.backgroundColor"
|
|
57
|
+
:no-margin="true"
|
|
55
58
|
:disabled="!isPaymentOptionSelectionContinueEnabled"
|
|
56
|
-
:class="{
|
|
57
|
-
'hover:tw-cursor-pointer': isPaymentOptionSelectionContinueEnabled,
|
|
58
|
-
'tw-opacity-50': !isPaymentOptionSelectionContinueEnabled,
|
|
59
|
-
}"
|
|
60
|
-
@click="onPaymentOptionSelectionContinueClick"
|
|
61
59
|
>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
<button
|
|
61
|
+
class="tw-w-full tw-py-4 tw-mt-4 tw-block tw-text-center tw-text-base tw-border-0"
|
|
62
|
+
:style="continueButtonStyle"
|
|
63
|
+
:disabled="!isPaymentOptionSelectionContinueEnabled"
|
|
64
|
+
:class="{
|
|
65
|
+
'hover:tw-cursor-pointer':
|
|
66
|
+
isPaymentOptionSelectionContinueEnabled,
|
|
67
|
+
}"
|
|
68
|
+
@click="onPaymentOptionSelectionContinueClick"
|
|
69
|
+
>
|
|
70
|
+
<TextWrapper
|
|
71
|
+
:text-style="viewModel.buttonTextStyle"
|
|
72
|
+
:text="commonTr(`continue`)"
|
|
73
|
+
class="tw-select-none"
|
|
74
|
+
/>
|
|
75
|
+
</button>
|
|
76
|
+
</ButtonStyleWrapper>
|
|
68
77
|
</div>
|
|
69
78
|
<!-- End payment option selection state -->
|
|
70
79
|
|
|
@@ -90,17 +99,25 @@
|
|
|
90
99
|
element="p"
|
|
91
100
|
class="tw-text-center"
|
|
92
101
|
/>
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
102
|
+
<ButtonStyleWrapper
|
|
103
|
+
:selected-button-style-id="
|
|
104
|
+
viewModel.buttonStyles.selectedButtonStyleId
|
|
105
|
+
"
|
|
106
|
+
:icon-color="viewModel.buttonStyles.style.backgroundColor"
|
|
107
|
+
:no-margin="true"
|
|
97
108
|
>
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
<button
|
|
110
|
+
class="tw-block tw-border-0 tw-mt-4 tw-py-2 tw-select-none tw-text-base tw-text-center tw-w-full hover:tw-cursor-pointer"
|
|
111
|
+
:style="continueButtonStyle"
|
|
112
|
+
@click="onDoneButtonClick"
|
|
113
|
+
>
|
|
114
|
+
<TextWrapper
|
|
115
|
+
:text-style="viewModel.buttonTextStyle"
|
|
116
|
+
:text="commonTr(`done`)"
|
|
117
|
+
class="tw-select-none"
|
|
118
|
+
/>
|
|
119
|
+
</button>
|
|
120
|
+
</ButtonStyleWrapper>
|
|
104
121
|
</div>
|
|
105
122
|
</div>
|
|
106
123
|
</section>
|
|
@@ -110,6 +127,7 @@ import { Icon, Loader } from '@designcrowd/fe-shared-lib';
|
|
|
110
127
|
import RequestPaymentStripe from './RequestPaymentStripe.vue';
|
|
111
128
|
import PaymentMixin from './Payment.mixin.ts';
|
|
112
129
|
import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
130
|
+
import ButtonStyleWrapper from '../button/ButtonStyleWrapper.vue';
|
|
113
131
|
import { commonTr, paymentTr } from '@src/composables/useTranslate';
|
|
114
132
|
|
|
115
133
|
export default {
|
|
@@ -118,6 +136,7 @@ export default {
|
|
|
118
136
|
Loader,
|
|
119
137
|
RequestPaymentStripe,
|
|
120
138
|
TextWrapper,
|
|
139
|
+
ButtonStyleWrapper,
|
|
121
140
|
},
|
|
122
141
|
mixins: [PaymentMixin],
|
|
123
142
|
setup() {
|
|
@@ -96,25 +96,33 @@
|
|
|
96
96
|
<!-- End Error Message -->
|
|
97
97
|
|
|
98
98
|
<!-- Start Pay Button -->
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
:style="payButtonStyle"
|
|
106
|
-
:value="submitButtonMessage"
|
|
99
|
+
<!-- payButtonStyle inverts the palette (bg = text colour), so the
|
|
100
|
+
decoration colour is buttonStyles.style.color, not backgroundColor. -->
|
|
101
|
+
<ButtonStyleWrapper
|
|
102
|
+
:selected-button-style-id="props.buttonStyles.selectedButtonStyleId"
|
|
103
|
+
:icon-color="props.buttonStyles.style.color"
|
|
104
|
+
:no-margin="true"
|
|
107
105
|
:disabled="!isSubmitButtonEnabled"
|
|
108
|
-
@click="onSubmitPaymentClick"
|
|
109
106
|
>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
107
|
+
<button
|
|
108
|
+
class="tw-block tw-border-0 tw-my-4 tw-py-2 tw-text-base tw-text-center tw-w-full"
|
|
109
|
+
:class="{
|
|
110
|
+
'hover:tw-cursor-pointer': isSubmitButtonEnabled,
|
|
111
|
+
}"
|
|
112
|
+
:style="payButtonStyle"
|
|
113
|
+
:value="submitButtonMessage"
|
|
114
|
+
:disabled="!isSubmitButtonEnabled"
|
|
115
|
+
@click="onSubmitPaymentClick"
|
|
116
|
+
>
|
|
117
|
+
{{
|
|
118
|
+
requestPaymentStripeTr('proceedToPayment', {
|
|
119
|
+
CURRENCY_SYMBOL: currencySymbol,
|
|
120
|
+
AMOUNT: amount,
|
|
121
|
+
CURRENCY_CODE: currencyCode,
|
|
122
|
+
})
|
|
123
|
+
}}
|
|
124
|
+
</button>
|
|
125
|
+
</ButtonStyleWrapper>
|
|
118
126
|
<!-- End Pay Button -->
|
|
119
127
|
|
|
120
128
|
<!-- Start T&C -->
|
|
@@ -146,6 +154,7 @@ import { Icon, TextInput, Loader } from '@designcrowd/fe-shared-lib';
|
|
|
146
154
|
import validator from 'validator';
|
|
147
155
|
import IconStripe from '../icon/IconStripe.vue';
|
|
148
156
|
import PaymentShippingAddress from '../shop/PaymentShippingAddress.vue';
|
|
157
|
+
import ButtonStyleWrapper from '../button/ButtonStyleWrapper.vue';
|
|
149
158
|
import { debug, debugError } from '../../../utils/debug.util';
|
|
150
159
|
import * as constants from '../../constants';
|
|
151
160
|
import {
|
|
@@ -507,9 +516,4 @@ onMounted(() => {
|
|
|
507
516
|
@apply tw-text-xs;
|
|
508
517
|
color: #f21b3f;
|
|
509
518
|
}
|
|
510
|
-
|
|
511
|
-
.pay-button-disabled {
|
|
512
|
-
opacity: 0.5 !important;
|
|
513
|
-
pointer-events: none;
|
|
514
|
-
}
|
|
515
519
|
</style>
|
|
@@ -55,14 +55,22 @@
|
|
|
55
55
|
<p v-else class="tw-text-center tw-text-base tw-my-4">
|
|
56
56
|
{{ shopTr(`noProducts`) }}
|
|
57
57
|
</p>
|
|
58
|
-
<
|
|
58
|
+
<ButtonStyleWrapper
|
|
59
59
|
v-if="viewModel.products.length >= 1"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
:selected-button-style-id="
|
|
61
|
+
viewModel.buttonStyles.selectedButtonStyleId
|
|
62
|
+
"
|
|
63
|
+
:icon-color="viewModel.buttonStyles.style.backgroundColor"
|
|
64
|
+
:no-margin="true"
|
|
63
65
|
>
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
+
<button
|
|
67
|
+
class="tw-mt-4 tw-block tw-w-full tw-border-0 tw-py-3 tw-select-none tw-text-base hover:tw-cursor-pointer tw-rounded"
|
|
68
|
+
:style="buttonStyle"
|
|
69
|
+
@click="onShowCartModal"
|
|
70
|
+
>
|
|
71
|
+
<TextWrapper :text-style="buttonTextStyle" :text="viewCartText" />
|
|
72
|
+
</button>
|
|
73
|
+
</ButtonStyleWrapper>
|
|
66
74
|
</div>
|
|
67
75
|
</div>
|
|
68
76
|
<div
|
|
@@ -124,6 +132,7 @@ import ThumbnailDisplay from './ThumbnailDisplay.vue';
|
|
|
124
132
|
import FeaturedDisplay from './FeaturedDisplay.vue';
|
|
125
133
|
import ProductDetailModal from './ProductDetailModal.vue';
|
|
126
134
|
import CartModal from './CartModal.vue';
|
|
135
|
+
import ButtonStyleWrapper from '../button/ButtonStyleWrapper.vue';
|
|
127
136
|
import { computed, onMounted, reactive } from 'vue';
|
|
128
137
|
import {
|
|
129
138
|
PAYMENT_OPTION_DISPLAY_TYPES,
|
|
@@ -147,6 +147,7 @@ export interface RequestPaymentContent extends Content {
|
|
|
147
147
|
descriptionStyle?: TextStyleDeclaration;
|
|
148
148
|
itemTextStyle: TextStyleDeclaration;
|
|
149
149
|
buttonTextStyle?: TextStyleDeclaration;
|
|
150
|
+
backgroundStyle?: BrandPageCssStyle;
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
export interface ShopContentConfig extends PaymentConfig {
|
|
@@ -191,6 +192,7 @@ export interface SupportMeContent extends Content {
|
|
|
191
192
|
descriptionStyle: TextStyleDeclaration;
|
|
192
193
|
buttonTextStyle: TextStyleDeclaration;
|
|
193
194
|
itemTextStyle: TextStyleDeclaration;
|
|
195
|
+
backgroundStyle?: BrandPageCssStyle;
|
|
194
196
|
}
|
|
195
197
|
|
|
196
198
|
export interface CreateStripePaymentIntentResponse {
|
|
@@ -463,7 +463,7 @@ exports[`migration.util > Banner Contents - text Align and Font Family should no
|
|
|
463
463
|
},
|
|
464
464
|
},
|
|
465
465
|
"userPromptContentKey": undefined,
|
|
466
|
-
"v":
|
|
466
|
+
"v": 19,
|
|
467
467
|
},
|
|
468
468
|
"useOldLogoRenderSize": true,
|
|
469
469
|
}
|
|
@@ -916,7 +916,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
916
916
|
},
|
|
917
917
|
},
|
|
918
918
|
"userPromptContentKey": undefined,
|
|
919
|
-
"v":
|
|
919
|
+
"v": 19,
|
|
920
920
|
},
|
|
921
921
|
"useOldLogoRenderSize": true,
|
|
922
922
|
}
|
|
@@ -1376,7 +1376,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
1376
1376
|
},
|
|
1377
1377
|
},
|
|
1378
1378
|
"userPromptContentKey": undefined,
|
|
1379
|
-
"v":
|
|
1379
|
+
"v": 19,
|
|
1380
1380
|
},
|
|
1381
1381
|
"useOldLogoRenderSize": true,
|
|
1382
1382
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest';
|
|
2
|
+
import { migration19 } from './migration-19';
|
|
3
|
+
import type { MigrationData } from '../migration.util';
|
|
4
|
+
import { BRAND_PAGE_TYPES } from '../../models';
|
|
5
|
+
|
|
6
|
+
const BUTTON_FILL = 'rgb(255, 222, 89)';
|
|
7
|
+
|
|
8
|
+
const createMigrationData = (brandPageModel: any): MigrationData => ({
|
|
9
|
+
brandPageModel,
|
|
10
|
+
useOldLogoRenderSize: false,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const modelWith = (
|
|
14
|
+
contents: any[],
|
|
15
|
+
buttonFill: string | undefined = BUTTON_FILL,
|
|
16
|
+
brandPageType: string = BRAND_PAGE_TYPES.default,
|
|
17
|
+
) => ({
|
|
18
|
+
brandPageType,
|
|
19
|
+
styles: { buttonStyles: { style: { backgroundColor: buttonFill } } },
|
|
20
|
+
pages: [{ contents }],
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('migration19', () => {
|
|
24
|
+
test('seeds backgroundColor from the button fill for each container-backed block when unset', async () => {
|
|
25
|
+
const model = modelWith([
|
|
26
|
+
{ type: 'contact-form' },
|
|
27
|
+
{ type: 'mailing-list' },
|
|
28
|
+
{ type: 'request-payment' },
|
|
29
|
+
{ type: 'support-me' },
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
const result = await migration19(createMigrationData(model));
|
|
33
|
+
|
|
34
|
+
(result.brandPageModel as any).pages[0].contents.forEach((c: any) => {
|
|
35
|
+
expect(c.backgroundStyle.backgroundColor).toBe(BUTTON_FILL);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('does not override a backgroundColor that is already set', async () => {
|
|
40
|
+
const model = modelWith([
|
|
41
|
+
{
|
|
42
|
+
type: 'mailing-list',
|
|
43
|
+
backgroundStyle: { backgroundColor: 'rgb(1, 2, 3)' },
|
|
44
|
+
},
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
const result = await migration19(createMigrationData(model));
|
|
48
|
+
|
|
49
|
+
expect(
|
|
50
|
+
(result.brandPageModel as any).pages[0].contents[0].backgroundStyle
|
|
51
|
+
.backgroundColor,
|
|
52
|
+
).toBe('rgb(1, 2, 3)');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('does NOT seed contact-form on brand-site (its own backgroundStyle already applies there)', async () => {
|
|
56
|
+
const model = modelWith(
|
|
57
|
+
[{ type: 'contact-form' }],
|
|
58
|
+
BUTTON_FILL,
|
|
59
|
+
BRAND_PAGE_TYPES.brandSite,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const result = await migration19(createMigrationData(model));
|
|
63
|
+
|
|
64
|
+
expect(
|
|
65
|
+
(result.brandPageModel as any).pages[0].contents[0].backgroundStyle,
|
|
66
|
+
).toBeUndefined();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('still seeds mailing-list on brand-site (button-fill container on every type)', async () => {
|
|
70
|
+
const model = modelWith(
|
|
71
|
+
[{ type: 'mailing-list' }],
|
|
72
|
+
BUTTON_FILL,
|
|
73
|
+
BRAND_PAGE_TYPES.brandSite,
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const result = await migration19(createMigrationData(model));
|
|
77
|
+
|
|
78
|
+
expect(
|
|
79
|
+
(result.brandPageModel as any).pages[0].contents[0].backgroundStyle
|
|
80
|
+
.backgroundColor,
|
|
81
|
+
).toBe(BUTTON_FILL);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test('leaves out-of-scope content types untouched', async () => {
|
|
85
|
+
const model = modelWith([{ type: 'banner-section' }, { type: 'text' }]);
|
|
86
|
+
|
|
87
|
+
const result = await migration19(createMigrationData(model));
|
|
88
|
+
|
|
89
|
+
(result.brandPageModel as any).pages[0].contents.forEach((c: any) => {
|
|
90
|
+
expect(c.backgroundStyle).toBeUndefined();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('is a no-op when the button fill colour is undefined', async () => {
|
|
95
|
+
const model = {
|
|
96
|
+
styles: { buttonStyles: { style: {} } },
|
|
97
|
+
pages: [{ contents: [{ type: 'mailing-list' }] }],
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const result = await migration19(createMigrationData(model));
|
|
101
|
+
|
|
102
|
+
expect(
|
|
103
|
+
(result.brandPageModel as any).pages[0].contents[0].backgroundStyle,
|
|
104
|
+
).toBeUndefined();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('preserves other backgroundStyle keys when seeding', async () => {
|
|
108
|
+
const model = modelWith([
|
|
109
|
+
{ type: 'mailing-list', backgroundStyle: { opacity: '0.5' } },
|
|
110
|
+
]);
|
|
111
|
+
|
|
112
|
+
const result = await migration19(createMigrationData(model));
|
|
113
|
+
|
|
114
|
+
const bg = (result.brandPageModel as any).pages[0].contents[0]
|
|
115
|
+
.backgroundStyle;
|
|
116
|
+
|
|
117
|
+
expect(bg.backgroundColor).toBe(BUTTON_FILL);
|
|
118
|
+
expect(bg.opacity).toBe('0.5');
|
|
119
|
+
});
|
|
120
|
+
});
|