@designcrowd/library.brand-page 5.17.17 → 5.17.18-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.
- package/lib/src/{CreatedOnBrandCrowd-de-de-C9P2zdPv.js → CreatedOnBrandCrowd-de-de-D2OCuUBR.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DBtTxqeM.js → CreatedOnBrandCrowd-en-us-CeQE2mrH.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DC5aFDcN.js → CreatedOnBrandCrowd-es-es-GCt5DXs8.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CNiUorYS.js → CreatedOnBrandCrowd-fr-ca-CX2-IOfY.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CNiUorYS.js → CreatedOnBrandCrowd-fr-fr-CX2-IOfY.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CuqWCZLB.js → CreatedOnBrandCrowd-pt-br-BjTeqtuz.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CuqWCZLB.js → CreatedOnBrandCrowd-pt-pt-BjTeqtuz.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DRyCl_4J.js → CreatedOnDcom-de-de-LJRZhI9w.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CV2aCrWr.js → CreatedOnDcom-en-us-CSy4jVVQ.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-2db-EVNQ.js → CreatedOnDcom-es-es-BhFkRbVC.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-hK0aCeAJ.js → CreatedOnDcom-fr-ca-bhu0hPDU.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-cXZK46sf.js → CreatedOnDcom-fr-fr-B1whVvQJ.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DxjyLWyi.js → CreatedOnDcom-pt-br-DtLVtfZK.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-C4KIe_Nv.js → CreatedOnDcom-pt-pt-5CMzJm82.js} +1 -1
- package/lib/src/brand-page/components/button/Button.mixin.d.ts +0 -7
- package/lib/src/brand-page/components/button/Button.mixin.js +0 -41
- package/lib/src/brand-page/constants/font.constants.js +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +3 -2
- package/lib/src/brand-page-maker/models/button-styles-config.js +11 -12
- package/lib/src/css/library.brand-page-brandCrowd.min.css +53 -75
- package/lib/src/css/library.brand-page-brandPage.min.css +53 -75
- package/lib/src/css/library.brand-page-designCom.min.css +53 -75
- package/lib/src/css/library.brand-page-preview.min.css +53 -75
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-DD0QNGsz.js → lib-DdgsfoxJ.js} +7344 -7333
- package/lib/src/shared/font-family-selector/FontFamilySelector.mixin.js +2 -1
- package/package.json +1 -1
- package/src/brand-page/components/button/Button.mixin.ts +0 -37
- package/src/brand-page/components/button/Button.vue +104 -178
- package/src/brand-page/components/button/ButtonStyleWrapper.vue +122 -0
- package/src/brand-page/components/shop/ProductDetailModal.vue +3 -1
- package/src/brand-page/constants/font.constants.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +4 -2
- package/src/brand-page-maker/models/button-styles-config.ts +11 -12
- package/src/shared/font-family-selector/FontFamilySelector.mixin.ts +5 -1
- package/src/shared/font-family-selector/FontPicker.vue +4 -3
- package/src/shared/style-settings/components/StyleSettings.vue +2 -7
|
@@ -37,7 +37,8 @@ export default defineComponent({
|
|
|
37
37
|
},
|
|
38
38
|
methods: {
|
|
39
39
|
getCategoryForFont(fontName) {
|
|
40
|
-
const
|
|
40
|
+
const strippedFontName = fontName?.replace(/^['"]|['"]$/g, '');
|
|
41
|
+
const fontConfig = Object.values(FONT_FAMILY_CONFIGS).find((config) => config.name === strippedFontName);
|
|
41
42
|
return fontConfig?.categories[0] || null;
|
|
42
43
|
},
|
|
43
44
|
onFontFamilyButtonClick(fontFamilyOption) {
|
package/package.json
CHANGED
|
@@ -61,46 +61,9 @@ export default defineComponent({
|
|
|
61
61
|
isModalImageUrlValid(): boolean {
|
|
62
62
|
return isURL(this.viewModel.modalImageUrl);
|
|
63
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
64
|
isBrushStrokeIcon(): boolean {
|
|
71
65
|
return this.viewModel.styles.selectedButtonStyleId === 'BUTTON_STYLE_19';
|
|
72
66
|
},
|
|
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
67
|
href(): string | undefined {
|
|
105
68
|
if (this.isModalUrl) {
|
|
106
69
|
return undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="tw-relative">
|
|
3
|
-
<
|
|
3
|
+
<ButtonStyleWrapper
|
|
4
4
|
v-if="
|
|
5
5
|
(viewModel.buttonLinkType === 'page' ||
|
|
6
6
|
viewModel.clickActionField === 'page') &&
|
|
@@ -8,47 +8,108 @@
|
|
|
8
8
|
"
|
|
9
9
|
class="bp-button tw-mb-4"
|
|
10
10
|
:class="{
|
|
11
|
-
'bp-button-arrow': isArrowIcon,
|
|
12
|
-
'tw-flex tw-justify-center': isBrushStrokeIcon,
|
|
13
11
|
'tw-min-h-14': !isPreview,
|
|
14
|
-
'tw-mb-6': isPaperIcon,
|
|
15
12
|
}"
|
|
13
|
+
:selected-button-style-id="viewModel.styles.selectedButtonStyleId"
|
|
14
|
+
:icon-color="iconColor"
|
|
16
15
|
>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
'bp-icon-brush-left': isBrushStrokeIcon,
|
|
25
|
-
}"
|
|
26
|
-
:style="{
|
|
27
|
-
'--icon-color': iconColor,
|
|
28
|
-
}"
|
|
29
|
-
/>
|
|
30
|
-
<router-link
|
|
31
|
-
class="tw-no-underline"
|
|
32
|
-
:to="{
|
|
33
|
-
name: routes.name,
|
|
34
|
-
params: routes.routeParams,
|
|
35
|
-
}"
|
|
36
|
-
:class="{
|
|
37
|
-
'tw-w-full': isBrushStrokeIcon,
|
|
38
|
-
}"
|
|
39
|
-
>
|
|
40
|
-
<div
|
|
41
|
-
:title="viewModel.title"
|
|
42
|
-
class="c-button tw-py-4 tw-items-center"
|
|
16
|
+
<template #default="{ innerClass }">
|
|
17
|
+
<router-link
|
|
18
|
+
class="tw-no-underline"
|
|
19
|
+
:to="{
|
|
20
|
+
name: routes.name,
|
|
21
|
+
params: routes.routeParams,
|
|
22
|
+
}"
|
|
43
23
|
:class="{
|
|
44
|
-
'
|
|
45
|
-
(!isModalUrl && !isValidUrl) ||
|
|
46
|
-
(isModalUrl && !isModalImageUrlValid),
|
|
47
|
-
'tw-cursor-pointer': isModalUrl && isModalImageUrlValid,
|
|
48
|
-
'tw-w-full tw-px-3': isBrushStrokeIcon,
|
|
49
|
-
'tw-px-5': !isBrushStrokeIcon,
|
|
24
|
+
'tw-w-full': isBrushStrokeIcon,
|
|
50
25
|
}"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
:title="viewModel.title"
|
|
29
|
+
class="c-button tw-py-4 tw-items-center"
|
|
30
|
+
:class="[
|
|
31
|
+
innerClass,
|
|
32
|
+
{
|
|
33
|
+
'c-button--disabled':
|
|
34
|
+
(!isModalUrl && !isValidUrl) ||
|
|
35
|
+
(isModalUrl && !isModalImageUrlValid),
|
|
36
|
+
'tw-cursor-pointer': isModalUrl && isModalImageUrlValid,
|
|
37
|
+
'tw-w-full': isBrushStrokeIcon,
|
|
38
|
+
},
|
|
39
|
+
]"
|
|
40
|
+
:style="buttonStyle"
|
|
41
|
+
@click="onClick"
|
|
42
|
+
>
|
|
43
|
+
<span
|
|
44
|
+
v-if="viewModel.iconUrl"
|
|
45
|
+
class="c-button__icon"
|
|
46
|
+
:class="{ 'c-button__icon-img': isIconImage }"
|
|
47
|
+
style="position: relative"
|
|
48
|
+
:style="iconStyle"
|
|
49
|
+
>
|
|
50
|
+
<slot name="icon">
|
|
51
|
+
<Media
|
|
52
|
+
v-if="isIconImage"
|
|
53
|
+
:image-url="viewModel.iconUrl"
|
|
54
|
+
:color-replacements="viewModel.colorReplacements"
|
|
55
|
+
:media-type="viewModel.mediaType"
|
|
56
|
+
:img-classes="`c-button__icon c-button__icon-img`"
|
|
57
|
+
:display-style="iconStyle"
|
|
58
|
+
:size="viewModel.size"
|
|
59
|
+
:context="context"
|
|
60
|
+
:content-index="contentIndex"
|
|
61
|
+
:alt="`${viewModel.name} img`"
|
|
62
|
+
/>
|
|
63
|
+
<Icon
|
|
64
|
+
v-else
|
|
65
|
+
:is-fill-current="false"
|
|
66
|
+
:name="viewModel.iconUrl"
|
|
67
|
+
size="md"
|
|
68
|
+
class="tw-flex"
|
|
69
|
+
/>
|
|
70
|
+
</slot>
|
|
71
|
+
</span>
|
|
72
|
+
<span
|
|
73
|
+
v-if="!viewModel.iconUrl && !$slots.icon"
|
|
74
|
+
class="c-button__no-icon"
|
|
75
|
+
/>
|
|
76
|
+
<TextWrapper
|
|
77
|
+
class="c-button__label c-button__label--offset-md"
|
|
78
|
+
:text-style="viewModel.titleStyle"
|
|
79
|
+
:text="viewModel.title"
|
|
80
|
+
element="p"
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
</router-link>
|
|
84
|
+
</template>
|
|
85
|
+
</ButtonStyleWrapper>
|
|
86
|
+
<ButtonStyleWrapper
|
|
87
|
+
v-else
|
|
88
|
+
class="bp-button tw-mb-4"
|
|
89
|
+
:class="{
|
|
90
|
+
'tw-min-h-14': !isPreview,
|
|
91
|
+
}"
|
|
92
|
+
:selected-button-style-id="viewModel.styles.selectedButtonStyleId"
|
|
93
|
+
:icon-color="iconColor"
|
|
94
|
+
>
|
|
95
|
+
<template #default="{ innerClass }">
|
|
96
|
+
<a
|
|
97
|
+
:title="viewModel.title"
|
|
98
|
+
:href="href"
|
|
99
|
+
target="_blank"
|
|
100
|
+
class="c-button tw-py-4 tw-items-center"
|
|
101
|
+
:class="[
|
|
102
|
+
innerClass,
|
|
103
|
+
{
|
|
104
|
+
'c-button--disabled':
|
|
105
|
+
(!isModalUrl && !isValidUrl) ||
|
|
106
|
+
(isModalUrl && !isModalImageUrlValid),
|
|
107
|
+
'tw-cursor-pointer': isModalUrl && isModalImageUrlValid,
|
|
108
|
+
'tw-w-full': isBrushStrokeIcon,
|
|
109
|
+
},
|
|
110
|
+
]"
|
|
51
111
|
:style="buttonStyle"
|
|
112
|
+
rel="noopener"
|
|
52
113
|
@click="onClick"
|
|
53
114
|
>
|
|
54
115
|
<span
|
|
@@ -81,7 +142,7 @@
|
|
|
81
142
|
</slot>
|
|
82
143
|
</span>
|
|
83
144
|
<span
|
|
84
|
-
v-if="
|
|
145
|
+
v-if="!$slots.icon && !viewModel.iconUrl"
|
|
85
146
|
class="c-button__no-icon"
|
|
86
147
|
/>
|
|
87
148
|
<TextWrapper
|
|
@@ -90,116 +151,9 @@
|
|
|
90
151
|
:text="viewModel.title"
|
|
91
152
|
element="p"
|
|
92
153
|
/>
|
|
93
|
-
</
|
|
94
|
-
</
|
|
95
|
-
|
|
96
|
-
v-if="isShowIcon"
|
|
97
|
-
:name="isBottomRightIconName"
|
|
98
|
-
:viewBox="isBottomRightIconViewBox"
|
|
99
|
-
:size="isPaperIcon ? 'full' : 'button-icon'"
|
|
100
|
-
:class="{
|
|
101
|
-
'tw-absolute tw-w-full bp-button-paper-bottom': isPaperIcon,
|
|
102
|
-
'bp-icon-brush-right': isBrushStrokeIcon,
|
|
103
|
-
}"
|
|
104
|
-
:style="{
|
|
105
|
-
'--icon-color': iconColor,
|
|
106
|
-
}"
|
|
107
|
-
/>
|
|
108
|
-
</div>
|
|
109
|
-
<div
|
|
110
|
-
v-else
|
|
111
|
-
class="bp-button tw-mb-4"
|
|
112
|
-
:class="{
|
|
113
|
-
'bp-button-arrow': isArrowIcon,
|
|
114
|
-
'tw-flex tw-justify-center': isBrushStrokeIcon,
|
|
115
|
-
'tw-min-h-14': !isPreview,
|
|
116
|
-
'tw-mb-6': isPaperIcon,
|
|
117
|
-
}"
|
|
118
|
-
>
|
|
119
|
-
<IconV2
|
|
120
|
-
v-if="isShowIcon"
|
|
121
|
-
:name="isTopLeftIconName"
|
|
122
|
-
:viewBox="isTopLeftIconViewBox"
|
|
123
|
-
:size="isPaperIcon ? 'full' : 'button-icon'"
|
|
124
|
-
:class="{
|
|
125
|
-
'tw-absolute tw-w-full bp-button-paper-top': isPaperIcon,
|
|
126
|
-
'bp-icon-brush-left': isBrushStrokeIcon,
|
|
127
|
-
}"
|
|
128
|
-
:style="{
|
|
129
|
-
'--icon-color': iconColor,
|
|
130
|
-
}"
|
|
131
|
-
/>
|
|
132
|
-
<a
|
|
133
|
-
:title="viewModel.title"
|
|
134
|
-
:href="href"
|
|
135
|
-
target="_blank"
|
|
136
|
-
class="c-button tw-py-4 tw-items-center"
|
|
137
|
-
:class="{
|
|
138
|
-
'c-button--disabled':
|
|
139
|
-
(!isModalUrl && !isValidUrl) ||
|
|
140
|
-
(isModalUrl && !isModalImageUrlValid),
|
|
141
|
-
'tw-cursor-pointer': isModalUrl && isModalImageUrlValid,
|
|
142
|
-
'tw-w-full tw-px-3': isBrushStrokeIcon,
|
|
143
|
-
'tw-px-5': !isBrushStrokeIcon,
|
|
144
|
-
}"
|
|
145
|
-
:style="buttonStyle"
|
|
146
|
-
rel="noopener"
|
|
147
|
-
@click="onClick"
|
|
148
|
-
>
|
|
149
|
-
<span
|
|
150
|
-
v-if="viewModel.iconUrl"
|
|
151
|
-
class="c-button__icon"
|
|
152
|
-
:class="{ 'c-button__icon-img': isIconImage }"
|
|
153
|
-
style="position: relative"
|
|
154
|
-
:style="iconStyle"
|
|
155
|
-
>
|
|
156
|
-
<slot name="icon">
|
|
157
|
-
<Media
|
|
158
|
-
v-if="isIconImage"
|
|
159
|
-
:image-url="viewModel.iconUrl"
|
|
160
|
-
:color-replacements="viewModel.colorReplacements"
|
|
161
|
-
:media-type="viewModel.mediaType"
|
|
162
|
-
:img-classes="`c-button__icon c-button__icon-img`"
|
|
163
|
-
:display-style="iconStyle"
|
|
164
|
-
:size="viewModel.size"
|
|
165
|
-
:context="context"
|
|
166
|
-
:content-index="contentIndex"
|
|
167
|
-
:alt="`${viewModel.name} img`"
|
|
168
|
-
/>
|
|
169
|
-
<Icon
|
|
170
|
-
v-else
|
|
171
|
-
:is-fill-current="false"
|
|
172
|
-
:name="viewModel.iconUrl"
|
|
173
|
-
size="md"
|
|
174
|
-
class="tw-flex"
|
|
175
|
-
/>
|
|
176
|
-
</slot>
|
|
177
|
-
</span>
|
|
178
|
-
<span
|
|
179
|
-
v-if="!$slots.icon && !viewModel.iconUrl"
|
|
180
|
-
class="c-button__no-icon"
|
|
181
|
-
/>
|
|
182
|
-
<TextWrapper
|
|
183
|
-
class="c-button__label c-button__label--offset-md"
|
|
184
|
-
:text-style="viewModel.titleStyle"
|
|
185
|
-
:text="viewModel.title"
|
|
186
|
-
element="p"
|
|
187
|
-
/>
|
|
188
|
-
</a>
|
|
189
|
-
<IconV2
|
|
190
|
-
v-if="isShowIcon"
|
|
191
|
-
:name="isBottomRightIconName"
|
|
192
|
-
:viewBox="isBottomRightIconViewBox"
|
|
193
|
-
:size="isPaperIcon ? 'full' : 'button-icon'"
|
|
194
|
-
:class="{
|
|
195
|
-
'tw-absolute tw-w-full bp-button-paper-bottom': isPaperIcon,
|
|
196
|
-
'bp-icon-brush-right': isBrushStrokeIcon,
|
|
197
|
-
}"
|
|
198
|
-
:style="{
|
|
199
|
-
'--icon-color': iconColor,
|
|
200
|
-
}"
|
|
201
|
-
/>
|
|
202
|
-
</div>
|
|
154
|
+
</a>
|
|
155
|
+
</template>
|
|
156
|
+
</ButtonStyleWrapper>
|
|
203
157
|
<HashRouteModal
|
|
204
158
|
mode="image"
|
|
205
159
|
:is-hash-route-enabled="false"
|
|
@@ -212,18 +166,19 @@
|
|
|
212
166
|
</section>
|
|
213
167
|
</template>
|
|
214
168
|
<script>
|
|
215
|
-
import { HashRouteModal
|
|
169
|
+
import { HashRouteModal } from '@designcrowd/fe-shared-lib';
|
|
216
170
|
import Icon from '../icon/Icon.vue';
|
|
217
171
|
import ButtonMixin from './Button.mixin.ts';
|
|
172
|
+
import ButtonStyleWrapper from './ButtonStyleWrapper.vue';
|
|
218
173
|
import Media from '../media/Media.vue';
|
|
219
174
|
import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
220
175
|
|
|
221
176
|
export default {
|
|
222
177
|
components: {
|
|
178
|
+
ButtonStyleWrapper,
|
|
223
179
|
Icon,
|
|
224
180
|
HashRouteModal,
|
|
225
181
|
Media,
|
|
226
|
-
IconV2,
|
|
227
182
|
TextWrapper,
|
|
228
183
|
},
|
|
229
184
|
mixins: [ButtonMixin],
|
|
@@ -295,41 +250,12 @@ export default {
|
|
|
295
250
|
height: var(--icon-h);
|
|
296
251
|
}
|
|
297
252
|
|
|
298
|
-
.bp-button-paper-bottom {
|
|
299
|
-
@apply tw-translate-y-[-4%] tw-text-[var(--icon-color)];
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.bp-button-paper-top {
|
|
303
|
-
@apply tw-translate-y-[-10%] tw-text-[var(--icon-color)];
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.bp-icon-brush-left {
|
|
307
|
-
@apply tw-text-[var(--icon-color)] tw-w-8 tw-translate-x-[101%];
|
|
308
|
-
}
|
|
309
|
-
.bp-icon-brush-right {
|
|
310
|
-
@apply tw-text-[var(--icon-color)] tw-w-8 tw-translate-x-[-4%];
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.bp-icon-brush-left :deep(svg) {
|
|
314
|
-
@apply tw-translate-x-[-99%] tw-w-auto;
|
|
315
|
-
}
|
|
316
|
-
.bp-icon-brush-right :deep(svg) {
|
|
317
|
-
@apply tw-w-auto;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.bp-button-arrow,
|
|
321
|
-
.device-wrapper--mobile .bp-button-arrow {
|
|
322
|
-
clip-path: polygon(5% 100%, 0% 50%, 5% 0%, 95% 0%, 100% 50%, 95% 100%);
|
|
323
|
-
}
|
|
324
253
|
.device-wrapper--mobile .c-button__icon {
|
|
325
254
|
margin: 0;
|
|
326
255
|
margin-right: var(--icon-m-r);
|
|
327
256
|
}
|
|
328
257
|
|
|
329
258
|
@media (min-width: 767px) {
|
|
330
|
-
.bp-button-arrow {
|
|
331
|
-
clip-path: polygon(3% 100%, 0% 50%, 3% 0%, 97% 0%, 100% 50%, 97% 100%);
|
|
332
|
-
}
|
|
333
259
|
.c-button__icon {
|
|
334
260
|
margin: 0 var(--icon-m-icon);
|
|
335
261
|
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="bp-style-wrapper"
|
|
4
|
+
:class="{
|
|
5
|
+
'bp-button-arrow': isArrowIcon,
|
|
6
|
+
'tw-flex tw-justify-center tw-w-full': isBrushStrokeIcon,
|
|
7
|
+
'tw-relative': isPaperIcon,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<template v-if="isBrushStrokeIcon">
|
|
11
|
+
<IconV2
|
|
12
|
+
name="button-brushstroke-left"
|
|
13
|
+
view-box="0 0 12 20"
|
|
14
|
+
size="button-icon"
|
|
15
|
+
class="bp-icon-brush-left tw-shrink-0"
|
|
16
|
+
:style="brushLeftStyle"
|
|
17
|
+
/>
|
|
18
|
+
<slot :inner-class="'tw-px-3'" />
|
|
19
|
+
<IconV2
|
|
20
|
+
name="button-brushstroke-right"
|
|
21
|
+
view-box="2 0 12 20"
|
|
22
|
+
size="button-icon"
|
|
23
|
+
class="bp-icon-brush-right tw-shrink-0"
|
|
24
|
+
:style="brushRightStyle"
|
|
25
|
+
/>
|
|
26
|
+
</template>
|
|
27
|
+
<template v-else-if="isPaperIcon">
|
|
28
|
+
<IconV2
|
|
29
|
+
name="button-paper-top"
|
|
30
|
+
view-box="41 0 120 16"
|
|
31
|
+
size="auto"
|
|
32
|
+
class="tw-absolute tw-w-full bp-button-paper-top"
|
|
33
|
+
:style="paperIconStyle"
|
|
34
|
+
/>
|
|
35
|
+
<slot :inner-class="'tw-px-5'" />
|
|
36
|
+
<IconV2
|
|
37
|
+
name="button-paper-bottom"
|
|
38
|
+
view-box="41 0 120 16"
|
|
39
|
+
size="auto"
|
|
40
|
+
class="tw-absolute tw-w-full bp-button-paper-bottom"
|
|
41
|
+
:style="paperIconStyle"
|
|
42
|
+
/>
|
|
43
|
+
</template>
|
|
44
|
+
<template v-else>
|
|
45
|
+
<slot :inner-class="'tw-px-5'" />
|
|
46
|
+
</template>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script setup lang="ts">
|
|
51
|
+
import { computed } from 'vue';
|
|
52
|
+
import { Icon as IconV2 } from '@designcrowd/fe-shared-lib';
|
|
53
|
+
|
|
54
|
+
const props = defineProps<{
|
|
55
|
+
selectedButtonStyleId?: string;
|
|
56
|
+
iconColor?: string;
|
|
57
|
+
}>();
|
|
58
|
+
|
|
59
|
+
const isPaperIcon = computed(
|
|
60
|
+
() => props.selectedButtonStyleId === 'BUTTON_STYLE_21',
|
|
61
|
+
);
|
|
62
|
+
const isArrowIcon = computed(
|
|
63
|
+
() => props.selectedButtonStyleId === 'BUTTON_STYLE_20',
|
|
64
|
+
);
|
|
65
|
+
const isBrushStrokeIcon = computed(
|
|
66
|
+
() => props.selectedButtonStyleId === 'BUTTON_STYLE_19',
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const paperIconStyle = computed(() => ({
|
|
70
|
+
'--icon-color': props.iconColor,
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
const brushLeftStyle = computed(() => ({
|
|
74
|
+
'--icon-color': props.iconColor,
|
|
75
|
+
color: props.iconColor,
|
|
76
|
+
width: '2rem',
|
|
77
|
+
transform: 'translateX(101%)',
|
|
78
|
+
}));
|
|
79
|
+
|
|
80
|
+
const brushRightStyle = computed(() => ({
|
|
81
|
+
'--icon-color': props.iconColor,
|
|
82
|
+
color: props.iconColor,
|
|
83
|
+
width: '2rem',
|
|
84
|
+
transform: 'translateX(-4%)',
|
|
85
|
+
}));
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<style scoped>
|
|
89
|
+
.bp-button-paper-top {
|
|
90
|
+
@apply tw-translate-y-[-10%] tw-text-[var(--icon-color)];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.bp-button-paper-bottom {
|
|
94
|
+
@apply tw-translate-y-[-4%] tw-text-[var(--icon-color)];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.bp-button-paper-top :deep(svg),
|
|
98
|
+
.bp-button-paper-bottom :deep(svg) {
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.bp-icon-brush-left :deep(svg) {
|
|
104
|
+
transform: translateX(-99%);
|
|
105
|
+
width: auto;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.bp-icon-brush-right :deep(svg) {
|
|
109
|
+
width: auto;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.bp-button-arrow,
|
|
113
|
+
.device-wrapper--mobile .bp-button-arrow {
|
|
114
|
+
clip-path: polygon(5% 100%, 0% 50%, 5% 0%, 95% 0%, 100% 50%, 95% 100%);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@media (min-width: 767px) {
|
|
118
|
+
.bp-button-arrow {
|
|
119
|
+
clip-path: polygon(3% 100%, 0% 50%, 3% 0%, 97% 0%, 100% 50%, 97% 100%);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</style>
|
|
@@ -1409,7 +1409,7 @@ export const FONT_FAMILY_CONFIGS: Record<
|
|
|
1409
1409
|
categories: [FONT_FAMILY_CATEGORIES().unique.key],
|
|
1410
1410
|
},
|
|
1411
1411
|
playwriteOsterreich: {
|
|
1412
|
-
name: 'Playwrite
|
|
1412
|
+
name: 'Playwrite AT',
|
|
1413
1413
|
family: 'Playwrite AT',
|
|
1414
1414
|
isPremiumFont: false,
|
|
1415
1415
|
type: 'google',
|
|
@@ -508,8 +508,10 @@ export const useRichTextEditor = (
|
|
|
508
508
|
// retainStyleOnEmptyLine(editor, selection);
|
|
509
509
|
|
|
510
510
|
if (textStyleAttributes && textStyleAttributes.fontFamily) {
|
|
511
|
-
|
|
512
|
-
|
|
511
|
+
const font = textStyleAttributes.fontFamily.replace(/^['"]|['"]$/g, '');
|
|
512
|
+
|
|
513
|
+
selectedFont.value = font;
|
|
514
|
+
fontSettings.selectedFont = font;
|
|
513
515
|
} else {
|
|
514
516
|
selectedFont.value = 'Lato';
|
|
515
517
|
fontSettings.selectedFont = 'Lato';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { BrandPageType, ButtonStyles } from '@brand-page';
|
|
2
|
-
import { BRAND_PAGE_TYPES } from '@brand-page';
|
|
3
2
|
import { ButtonBoxShadowSize, ButtonSoftBoxShadowSize } from '@brand-page';
|
|
4
3
|
|
|
5
4
|
export const ButtonStyleConfigOptions = [
|
|
@@ -78,7 +77,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
78
77
|
iconName: undefined,
|
|
79
78
|
iconViewBox: undefined,
|
|
80
79
|
options: ['buttonFillColor', 'buttonIconColor'],
|
|
81
|
-
brandPageType:
|
|
80
|
+
brandPageType: undefined,
|
|
82
81
|
},
|
|
83
82
|
{
|
|
84
83
|
id: 'BUTTON_STYLE_4',
|
|
@@ -129,7 +128,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
129
128
|
iconName: undefined,
|
|
130
129
|
iconViewBox: undefined,
|
|
131
130
|
options: ['buttonFillColor', 'buttonBorderColor', 'buttonIconColor'],
|
|
132
|
-
brandPageType:
|
|
131
|
+
brandPageType: undefined,
|
|
133
132
|
},
|
|
134
133
|
{
|
|
135
134
|
id: 'BUTTON_STYLE_7',
|
|
@@ -152,7 +151,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
152
151
|
'buttonShadowColor',
|
|
153
152
|
'buttonIconColor',
|
|
154
153
|
],
|
|
155
|
-
brandPageType:
|
|
154
|
+
brandPageType: undefined,
|
|
156
155
|
},
|
|
157
156
|
{
|
|
158
157
|
id: 'BUTTON_STYLE_8',
|
|
@@ -175,7 +174,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
175
174
|
'buttonShadowColor',
|
|
176
175
|
'buttonIconColor',
|
|
177
176
|
],
|
|
178
|
-
brandPageType:
|
|
177
|
+
brandPageType: undefined,
|
|
179
178
|
},
|
|
180
179
|
{
|
|
181
180
|
id: 'BUTTON_STYLE_9',
|
|
@@ -198,7 +197,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
198
197
|
'buttonShadowColor',
|
|
199
198
|
'buttonIconColor',
|
|
200
199
|
],
|
|
201
|
-
brandPageType:
|
|
200
|
+
brandPageType: undefined,
|
|
202
201
|
},
|
|
203
202
|
{
|
|
204
203
|
id: 'BUTTON_STYLE_10',
|
|
@@ -249,7 +248,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
249
248
|
iconName: 'button-dashed-oval',
|
|
250
249
|
iconViewBox: '0 0 60 20',
|
|
251
250
|
options: ['buttonFillColor', 'buttonBorderColor', 'buttonIconColor'],
|
|
252
|
-
brandPageType:
|
|
251
|
+
brandPageType: undefined,
|
|
253
252
|
},
|
|
254
253
|
{
|
|
255
254
|
id: 'BUTTON_STYLE_13',
|
|
@@ -300,7 +299,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
300
299
|
iconName: 'button-doubleline-oval',
|
|
301
300
|
iconViewBox: '0 0 60 20',
|
|
302
301
|
options: ['buttonFillColor', 'buttonBorderColor', 'buttonIconColor'],
|
|
303
|
-
brandPageType:
|
|
302
|
+
brandPageType: undefined,
|
|
304
303
|
},
|
|
305
304
|
{
|
|
306
305
|
id: 'BUTTON_STYLE_16',
|
|
@@ -357,7 +356,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
357
356
|
iconName: 'button-softshadow-oval',
|
|
358
357
|
iconViewBox: '0 0 60 20',
|
|
359
358
|
options: ['buttonFillColor', 'buttonSoftShadowColor', 'buttonIconColor'],
|
|
360
|
-
brandPageType:
|
|
359
|
+
brandPageType: undefined,
|
|
361
360
|
},
|
|
362
361
|
{
|
|
363
362
|
id: 'BUTTON_STYLE_19',
|
|
@@ -374,7 +373,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
374
373
|
iconName: 'button-brushstroke',
|
|
375
374
|
iconViewBox: '0 0 60 20',
|
|
376
375
|
options: ['buttonFillColor', 'buttonIconColor'],
|
|
377
|
-
brandPageType:
|
|
376
|
+
brandPageType: undefined,
|
|
378
377
|
},
|
|
379
378
|
{
|
|
380
379
|
id: 'BUTTON_STYLE_20',
|
|
@@ -391,7 +390,7 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
391
390
|
iconName: 'button-arrow',
|
|
392
391
|
iconViewBox: '0 0 60 20',
|
|
393
392
|
options: ['buttonFillColor', 'buttonIconColor'],
|
|
394
|
-
brandPageType:
|
|
393
|
+
brandPageType: undefined,
|
|
395
394
|
},
|
|
396
395
|
{
|
|
397
396
|
id: 'BUTTON_STYLE_21',
|
|
@@ -408,6 +407,6 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
|
|
|
408
407
|
iconName: 'button-paper',
|
|
409
408
|
iconViewBox: '0 0 60 20',
|
|
410
409
|
options: ['buttonFillColor', 'buttonIconColor'],
|
|
411
|
-
brandPageType:
|
|
410
|
+
brandPageType: undefined,
|
|
412
411
|
},
|
|
413
412
|
];
|
|
@@ -45,8 +45,12 @@ export default defineComponent({
|
|
|
45
45
|
},
|
|
46
46
|
methods: {
|
|
47
47
|
getCategoryForFont(fontName: FontFamilyName): FontFamilyCategory | null {
|
|
48
|
+
const strippedFontName = fontName?.replace(
|
|
49
|
+
/^['"]|['"]$/g,
|
|
50
|
+
'',
|
|
51
|
+
) as FontFamilyName;
|
|
48
52
|
const fontConfig = Object.values(FONT_FAMILY_CONFIGS).find(
|
|
49
|
-
(config) => config.name ===
|
|
53
|
+
(config) => config.name === strippedFontName,
|
|
50
54
|
);
|
|
51
55
|
|
|
52
56
|
return fontConfig?.categories[0] || null;
|