@designcrowd/library.brand-page 5.17.18 → 5.17.19-ast-btn-styles

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 (63) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-DB6k-SCt.js → CreatedOnBrandCrowd-de-de-BVNCHu2U.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DjMace5m.js → CreatedOnBrandCrowd-en-us-p5JGPJZK.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BefD6S7_.js → CreatedOnBrandCrowd-es-es-B3rvehGG.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-CCgATay-.js → CreatedOnBrandCrowd-fr-ca-Bysd3HDa.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-CCgATay-.js → CreatedOnBrandCrowd-fr-fr-Bysd3HDa.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-Bk5rXo11.js → CreatedOnBrandCrowd-pt-br-BS23K4jd.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-Bk5rXo11.js → CreatedOnBrandCrowd-pt-pt-BS23K4jd.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-Cc-kh38q.js → CreatedOnDcom-de-de-DIjn2Z4g.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-SCsgAQlO.js → CreatedOnDcom-en-us-0gCGoi3k.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-CljIh2tr.js → CreatedOnDcom-es-es-BhNHcidB.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-BxsoG_MD.js → CreatedOnDcom-fr-ca-a4_OqwIb.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-BSllWBS4.js → CreatedOnDcom-fr-fr-85rgy0k0.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-BoFJhKBu.js → CreatedOnDcom-pt-br-B2o0Anb9.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-8iLU3IhZ.js → CreatedOnDcom-pt-pt-DVZg9JdE.js} +1 -1
  15. package/lib/src/brand-page/models/logo.model.d.ts +1 -0
  16. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -1
  17. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +2 -1
  18. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +1 -0
  19. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -1
  20. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -1
  21. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -1
  22. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +1 -1
  23. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -1
  24. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -1
  25. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +1 -1
  26. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +5 -0
  27. package/lib/src/brand-page-maker/models/button-styles-config.js +11 -12
  28. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +2 -1
  29. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +2 -1
  30. package/lib/src/clients/fabric-render-client.d.ts +7 -0
  31. package/lib/src/clients/fabric-render-client.js +6 -3
  32. package/lib/src/css/library.brand-page-brandCrowd.min.css +48 -70
  33. package/lib/src/css/library.brand-page-brandPage.min.css +48 -70
  34. package/lib/src/css/library.brand-page-designCom.min.css +48 -70
  35. package/lib/src/css/library.brand-page-preview.min.css +48 -70
  36. package/lib/src/index.mjs +1 -1
  37. package/lib/src/{lib-CgbGS9G6.js → lib-lXL8NFgQ.js} +17690 -17722
  38. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -1
  39. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
  40. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
  41. package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +5 -3
  42. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +6 -4
  43. package/lib/src/shared/logo-settings/store/editable-logo-store.d.ts +5 -3
  44. package/lib/src/shared/logo-settings/store/editable-logo-store.js +52 -21
  45. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +5 -1
  46. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +10 -4
  47. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -1
  48. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -1
  49. package/package.json +1 -1
  50. package/src/brand-page/components/button/Button.vue +208 -225
  51. package/src/brand-page/components/button/ButtonIcon.vue +46 -0
  52. package/src/brand-page/components/button/ButtonStyleWrapper.vue +122 -0
  53. package/src/brand-page/models/logo.model.ts +1 -0
  54. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +2 -0
  55. package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +5 -0
  56. package/src/brand-page-maker/models/button-styles-config.ts +11 -12
  57. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +3 -0
  58. package/src/clients/fabric-render-client.ts +14 -3
  59. package/src/shared/logo-settings/store/editable-logo-store.ts +67 -18
  60. package/src/shared/style-settings/components/StyleSettings.vue +2 -7
  61. package/lib/src/brand-page/components/button/Button.mixin.d.ts +0 -86
  62. package/lib/src/brand-page/components/button/Button.mixin.js +0 -177
  63. package/src/brand-page/components/button/Button.mixin.ts +0 -192
@@ -1,192 +0,0 @@
1
- import { defineComponent } from 'vue';
2
- import type { PropType } from 'vue';
3
- import { isEmail, isTel, isURL } from '../../../utils/validator.util';
4
- import ComponentCommonMixin from '../mixins/component-common.mixin';
5
- import type { BrandPageContext } from '@brand-page/models';
6
- import type { ButtonViewModel } from '@brand-page/view-models';
7
- import { findNavItemByPageId } from '@src/brand-page/utils/route.util';
8
-
9
- export default defineComponent({
10
- mixins: [ComponentCommonMixin],
11
- props: {
12
- viewModel: {
13
- type: Object as PropType<ButtonViewModel>,
14
- required: true,
15
- },
16
- context: {
17
- type: Object as PropType<BrandPageContext>,
18
- required: true,
19
- },
20
- contentIndex: {
21
- type: Number,
22
- required: false,
23
- default: undefined,
24
- },
25
- },
26
- data() {
27
- return {
28
- isModalVisible: false,
29
- };
30
- },
31
- computed: {
32
- buttonStyle(): BrandPageCssStyle {
33
- return this.viewModel.styles?.style || {};
34
- },
35
- iconImgStyle(): BrandPageCssStyle {
36
- if (!this.viewModel.styles?.style) {
37
- return {};
38
- }
39
-
40
- const { borderRadius } = this.viewModel.styles.style;
41
-
42
- return {
43
- borderRadius:
44
- !borderRadius || borderRadius === '0'
45
- ? ''
46
- : `calc(${borderRadius} / 2)`,
47
- };
48
- },
49
- isIconImage(): boolean {
50
- return isURL(this.viewModel.iconUrl);
51
- },
52
- iconColor(): string | undefined {
53
- return this.viewModel.styles.style.backgroundColor;
54
- },
55
- iconStyle(): BrandPageCssStyle {
56
- return this.viewModel.styles?.iconStyle || {};
57
- },
58
- isModalUrl(): boolean {
59
- return this.viewModel.clickActionField === 'modalImageUrl';
60
- },
61
- isModalImageUrlValid(): boolean {
62
- return isURL(this.viewModel.modalImageUrl);
63
- },
64
- isPaperIcon(): boolean {
65
- return this.viewModel.styles.selectedButtonStyleId === 'BUTTON_STYLE_21';
66
- },
67
- isArrowIcon(): boolean {
68
- return this.viewModel.styles.selectedButtonStyleId === 'BUTTON_STYLE_20';
69
- },
70
- isBrushStrokeIcon(): boolean {
71
- return this.viewModel.styles.selectedButtonStyleId === 'BUTTON_STYLE_19';
72
- },
73
- isShowIcon(): boolean {
74
- return this.isBrushStrokeIcon || this.isPaperIcon;
75
- },
76
- isTopLeftIconName(): string {
77
- if (this.viewModel.styles.selectedButtonStyleId === 'BUTTON_STYLE_19') {
78
- return 'button-brushstroke-left';
79
- } else {
80
- return 'button-paper-top';
81
- }
82
- },
83
- isBottomRightIconName(): string {
84
- if (this.viewModel.styles.selectedButtonStyleId === 'BUTTON_STYLE_19') {
85
- return 'button-brushstroke-right';
86
- } else {
87
- return 'button-paper-bottom';
88
- }
89
- },
90
- isTopLeftIconViewBox(): string {
91
- if (this.viewModel.styles.selectedButtonStyleId === 'BUTTON_STYLE_19') {
92
- return '0 0 12 20';
93
- } else {
94
- return '41 0 120 16';
95
- }
96
- },
97
- isBottomRightIconViewBox(): string {
98
- if (this.viewModel.styles.selectedButtonStyleId === 'BUTTON_STYLE_19') {
99
- return '2 0 12 20';
100
- } else {
101
- return '41 0 120 16';
102
- }
103
- },
104
- href(): string | undefined {
105
- if (this.isModalUrl) {
106
- return undefined;
107
- }
108
-
109
- if (!this.isValidUrl) {
110
- return '#';
111
- }
112
-
113
- return this.url;
114
- },
115
- isValidUrl(): boolean {
116
- if (
117
- this.viewModel.role === 'banner-section' ||
118
- this.viewModel.role === 'booking-section' ||
119
- this.viewModel.role === 'images-section'
120
- ) {
121
- switch (this.viewModel.buttonLinkType) {
122
- case 'mailTo':
123
- return isEmail(this.viewModel.url as string);
124
- case 'tel':
125
- return isTel(this.viewModel.url);
126
- default:
127
- return isURL(this.viewModel.url as string);
128
- }
129
- }
130
-
131
- switch (this.viewModel.role) {
132
- case 'email':
133
- return isEmail(this.viewModel.url as string);
134
- case 'phone':
135
- return this.viewModel.url !== '';
136
- default:
137
- return isURL(this.viewModel.url as string);
138
- }
139
- },
140
- url(): string {
141
- if (
142
- this.viewModel.role === 'banner-section' ||
143
- this.viewModel.role === 'booking-section' ||
144
- this.viewModel.role === 'images-section'
145
- ) {
146
- switch (this.viewModel.buttonLinkType) {
147
- case 'mailTo':
148
- return `mailto:${this.viewModel.url}`;
149
- case 'tel':
150
- return `tel:${this.viewModel.url}`;
151
- default:
152
- return this.viewModel.url;
153
- }
154
- } else {
155
- switch (this.viewModel.role) {
156
- case 'email':
157
- return `mailto:${this.viewModel.url}`;
158
- case 'phone':
159
- return `tel:${this.viewModel.url}`;
160
- default:
161
- return this.viewModel.url;
162
- }
163
- }
164
- },
165
- routes(): any {
166
- const route = findNavItemByPageId(
167
- this.context.nav.navItems,
168
- this.viewModel.page,
169
- );
170
-
171
- return {
172
- name: route?.routeName || '',
173
- routeParams: route?.routeParams || {},
174
- };
175
- },
176
- },
177
- methods: {
178
- onClicked() {
179
- this.viewModel.onClicked(this.viewModel);
180
- },
181
-
182
- onClick() {
183
- if (this.isModalUrl && this.isModalImageUrlValid) {
184
- this.isModalVisible = true;
185
- }
186
- },
187
-
188
- onCloseModal() {
189
- this.isModalVisible = false;
190
- },
191
- },
192
- });