@lancom/shared 0.0.290 → 0.0.292
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/assets/js/utils/fabric-helper.js +3 -3
- package/assets/js/utils/fonts-helper.js +2 -0
- package/components/checkout/cart/cart.vue +5 -2
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +108 -106
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/font-family_select/font-family-select.vue +6 -2
- package/components/editor/editor_product_details/editor-product-details.vue +6 -3
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +2 -2
- package/package.json +1 -1
- package/store/index.js +3 -1
|
@@ -338,8 +338,9 @@ export default class FabricHelper {
|
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
object.on('changed', () => {
|
|
341
|
-
|
|
342
|
-
|
|
341
|
+
this.dispatch('setField', { field: 'copy', value: object.text });
|
|
342
|
+
this.dispatch('setField', { field: 'boundingRect', value: object.getBoundingRect() });
|
|
343
|
+
this.dispatch('setDeleteButtonPosition', object.oCoords.tr);
|
|
343
344
|
// if (/\n/g.test(object.text || '')) {
|
|
344
345
|
// this.discardActiveObjects();
|
|
345
346
|
// object.text = object.text.replace(/\n/g, '');
|
|
@@ -348,7 +349,6 @@ export default class FabricHelper {
|
|
|
348
349
|
// this.dispatch('setDeleteButtonPosition', object.oCoords.tr);
|
|
349
350
|
// // this.checkBoundingIntersection(object);
|
|
350
351
|
// }
|
|
351
|
-
this.dispatch('setDeleteButtonPosition', object.oCoords.tr);
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
354
|
/*
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import Vue from 'vue';
|
|
7
7
|
|
|
8
8
|
const fontsLoadList = {};
|
|
9
|
+
export const fontsLoadedList = {};
|
|
9
10
|
|
|
10
11
|
export const FONTS_LANGS = {
|
|
11
12
|
ENG: 'eng',
|
|
@@ -82,6 +83,7 @@ export const loadFont = alias => new Promise((resolve, reject) => {
|
|
|
82
83
|
|
|
83
84
|
fontsLoadList[font.name].then(loadedFace => {
|
|
84
85
|
document.fonts.add(loadedFace);
|
|
86
|
+
Vue.set(fontsLoadedList, font.name, true);
|
|
85
87
|
resolve(getFormattedFont(alias));
|
|
86
88
|
}).catch(error => console.warn(error));
|
|
87
89
|
});
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<postcode-select
|
|
27
27
|
:suburb="suburb"
|
|
28
28
|
:labelless="true"
|
|
29
|
-
:only-postcode="
|
|
29
|
+
:only-postcode="onlyPostcode"
|
|
30
30
|
:placeholder="postcodeLabel"
|
|
31
31
|
:label-text="postcodeInfoLabel"
|
|
32
32
|
@select="handleSuburbChange" />
|
|
@@ -92,8 +92,11 @@ export default {
|
|
|
92
92
|
filters: { price },
|
|
93
93
|
mixins: [CartMixin],
|
|
94
94
|
computed: {
|
|
95
|
-
...mapGetters(['MESSAGES']),
|
|
95
|
+
...mapGetters(['MESSAGES', 'SETTINGS']),
|
|
96
96
|
...mapGetters('cart', ['isEmpty', 'cartPricingError', 'cartPricing', 'cartPricingCalculating', 'entities']),
|
|
97
|
+
onlyPostcode() {
|
|
98
|
+
return !!this.SETTINGS.CART_ONLY_POSTCODE;
|
|
99
|
+
},
|
|
97
100
|
postcodeLabel() {
|
|
98
101
|
return this.MESSAGES.CART_POSTCODE || 'Postcode';
|
|
99
102
|
},
|
|
@@ -27,121 +27,123 @@
|
|
|
27
27
|
placeholder="Your text here"
|
|
28
28
|
:class="{ filled: copy }"></textarea>
|
|
29
29
|
</validation-provider>
|
|
30
|
-
<div
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<div class="EditorLayerFormText__align-options">
|
|
37
|
-
<div
|
|
38
|
-
class="EditorLayerFormText__align-option ripple"
|
|
39
|
-
:class="{ active: textAlign === 'left' }"
|
|
40
|
-
@click="textAlign = 'left'">
|
|
41
|
-
<i class="icon-align-left"></i>
|
|
42
|
-
</div>
|
|
43
|
-
<div
|
|
44
|
-
class="EditorLayerFormText__align-option ripple"
|
|
45
|
-
:class="{ active: textAlign === 'center' }"
|
|
46
|
-
@click="textAlign = 'center'">
|
|
47
|
-
<i class="icon-align-center"></i>
|
|
30
|
+
<div>
|
|
31
|
+
<div
|
|
32
|
+
v-if="copy.includes('\n')"
|
|
33
|
+
class="form-row">
|
|
34
|
+
<div class="form-label">
|
|
35
|
+
Align text
|
|
48
36
|
</div>
|
|
49
|
-
<div
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
<div class="EditorLayerFormText__align-options">
|
|
38
|
+
<div
|
|
39
|
+
class="EditorLayerFormText__align-option ripple"
|
|
40
|
+
:class="{ active: textAlign === 'left' }"
|
|
41
|
+
@click="textAlign = 'left'">
|
|
42
|
+
<i class="icon-align-left"></i>
|
|
43
|
+
</div>
|
|
44
|
+
<div
|
|
45
|
+
class="EditorLayerFormText__align-option ripple"
|
|
46
|
+
:class="{ active: textAlign === 'center' }"
|
|
47
|
+
@click="textAlign = 'center'">
|
|
48
|
+
<i class="icon-align-center"></i>
|
|
49
|
+
</div>
|
|
50
|
+
<div
|
|
51
|
+
class="EditorLayerFormText__align-option ripple"
|
|
52
|
+
:class="{ active: textAlign === 'right' }"
|
|
53
|
+
@click="textAlign = 'right'">
|
|
54
|
+
<i class="icon-align-right"></i>
|
|
55
|
+
</div>
|
|
54
56
|
</div>
|
|
55
57
|
</div>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@select="selectFont" />
|
|
62
|
-
<input
|
|
63
|
-
type="text"
|
|
64
|
-
:value="fontFamily"
|
|
65
|
-
:class="{ 'filled': fontFamily }"
|
|
66
|
-
class="form-hidden-validator form-field" />
|
|
67
|
-
</div>
|
|
68
|
-
<div class="form-row--cols low-dense">
|
|
69
|
-
<div class="form-col col-half">
|
|
70
|
-
<label class="form-label">
|
|
71
|
-
Text color
|
|
72
|
-
</label>
|
|
73
|
-
<color-picker v-model="fill" />
|
|
74
|
-
</div>
|
|
75
|
-
<div class="form-col col-half">
|
|
76
|
-
<label
|
|
77
|
-
for="fontSize"
|
|
78
|
-
class="form-label">
|
|
79
|
-
Text size
|
|
80
|
-
</label>
|
|
81
|
-
<i
|
|
82
|
-
class="icon-minus form-icon-left EditorLayerFormText__field-action"
|
|
83
|
-
@click="decreaseFontSize">
|
|
84
|
-
</i>
|
|
58
|
+
<div class="form-row low-dense">
|
|
59
|
+
<font-family-select
|
|
60
|
+
v-model="fontFamily"
|
|
61
|
+
@input="selectFont"
|
|
62
|
+
@select="selectFont" />
|
|
85
63
|
<input
|
|
86
|
-
id="fontSize"
|
|
87
|
-
ref="fontSize"
|
|
88
|
-
v-model.number="fontSize"
|
|
89
|
-
name="fontSize"
|
|
90
64
|
type="text"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
class="
|
|
94
|
-
@click="increaseFontSize">
|
|
95
|
-
</i>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
<div class="form-row--cols low-dense">
|
|
99
|
-
<div class="form-col col-half">
|
|
100
|
-
<label class="form-label EditorLayerFormText__label-with-checkbox">
|
|
101
|
-
<span>
|
|
102
|
-
Outline color
|
|
103
|
-
</span>
|
|
104
|
-
<Checkbox v-model="enableOutline" />
|
|
105
|
-
</label>
|
|
106
|
-
<color-picker
|
|
107
|
-
v-if="enableOutline"
|
|
108
|
-
v-model="stroke">
|
|
109
|
-
</color-picker>
|
|
65
|
+
:value="fontFamily"
|
|
66
|
+
:class="{ 'filled': fontFamily }"
|
|
67
|
+
class="form-hidden-validator form-field" />
|
|
110
68
|
</div>
|
|
111
|
-
<div
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
69
|
+
<div class="form-row--cols low-dense">
|
|
70
|
+
<div class="form-col col-half">
|
|
71
|
+
<label class="form-label">
|
|
72
|
+
Text color
|
|
73
|
+
</label>
|
|
74
|
+
<color-picker v-model="fill" />
|
|
75
|
+
</div>
|
|
76
|
+
<div class="form-col col-half">
|
|
77
|
+
<label
|
|
78
|
+
for="fontSize"
|
|
79
|
+
class="form-label">
|
|
80
|
+
Text size
|
|
81
|
+
</label>
|
|
82
|
+
<i
|
|
83
|
+
class="icon-minus form-icon-left EditorLayerFormText__field-action"
|
|
84
|
+
@click="decreaseFontSize">
|
|
85
|
+
</i>
|
|
86
|
+
<input
|
|
87
|
+
id="fontSize"
|
|
88
|
+
ref="fontSize"
|
|
89
|
+
v-model.number="fontSize"
|
|
90
|
+
name="fontSize"
|
|
91
|
+
type="text"
|
|
92
|
+
class="form-field icon-inside-lr filled centered labelless" />
|
|
93
|
+
<i
|
|
94
|
+
class="icon-plus form-icon-right EditorLayerFormText__field-action"
|
|
95
|
+
@click="increaseFontSize">
|
|
96
|
+
</i>
|
|
97
|
+
</div>
|
|
134
98
|
</div>
|
|
135
|
-
<div
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
99
|
+
<div class="form-row--cols low-dense">
|
|
100
|
+
<div class="form-col col-half">
|
|
101
|
+
<label class="form-label EditorLayerFormText__label-with-checkbox">
|
|
102
|
+
<span>
|
|
103
|
+
Outline color
|
|
104
|
+
</span>
|
|
105
|
+
<Checkbox v-model="enableOutline" />
|
|
106
|
+
</label>
|
|
107
|
+
<color-picker
|
|
108
|
+
v-if="enableOutline"
|
|
109
|
+
v-model="stroke">
|
|
110
|
+
</color-picker>
|
|
111
|
+
</div>
|
|
112
|
+
<div
|
|
113
|
+
v-if="enableOutline"
|
|
114
|
+
class="form-col col-half">
|
|
115
|
+
<label
|
|
116
|
+
for="fontSize"
|
|
117
|
+
class="form-label">
|
|
118
|
+
Outline weight
|
|
119
|
+
</label>
|
|
120
|
+
<i
|
|
121
|
+
class="icon-minus form-icon-left EditorLayerFormText__field-action"
|
|
122
|
+
@click="decreaseStrokeWidth">
|
|
123
|
+
</i>
|
|
124
|
+
<input
|
|
125
|
+
id="strokeWidth"
|
|
126
|
+
ref="strokeWidth"
|
|
127
|
+
v-model.number="strokeWidth"
|
|
128
|
+
name="strokeWidth"
|
|
129
|
+
type="text"
|
|
130
|
+
class="form-field icon-inside-lr filled centered labelless" />
|
|
131
|
+
<i
|
|
132
|
+
class="icon-plus form-icon-right EditorLayerFormText__field-action"
|
|
133
|
+
@click="increaseStrokeWidth">
|
|
134
|
+
</i>
|
|
135
|
+
</div>
|
|
136
|
+
<div
|
|
137
|
+
v-else
|
|
138
|
+
class="form-col col-half">
|
|
139
|
+
|
|
140
|
+
</div>
|
|
139
141
|
</div>
|
|
142
|
+
<editor-layer-common-fields
|
|
143
|
+
:layer="layer"
|
|
144
|
+
@set-layer-field="data => $emit('set-layer-field', data)">
|
|
145
|
+
</editor-layer-common-fields>
|
|
140
146
|
</div>
|
|
141
|
-
<editor-layer-common-fields
|
|
142
|
-
:layer="layer"
|
|
143
|
-
@set-layer-field="data => $emit('set-layer-field', data)">
|
|
144
|
-
</editor-layer-common-fields>
|
|
145
147
|
</div>
|
|
146
148
|
</validation-observer>
|
|
147
149
|
</div>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
:style="{
|
|
37
37
|
fontFamily: props.option.label
|
|
38
38
|
}">
|
|
39
|
-
{{ props.option | selectedFontLabel }}
|
|
39
|
+
<spinner v-if="!isLoadedFont" /> {{ props.option | selectedFontLabel }}
|
|
40
40
|
</span>
|
|
41
41
|
</multiselect>
|
|
42
42
|
</div>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
<script>
|
|
47
47
|
import Multiselect from 'vue-multiselect';
|
|
48
|
-
import { availableFonts, FONTS_LANGS, FONTS_LANGS_LIST, loadFont } from '@lancom/shared/assets/js/utils/fonts-helper';
|
|
48
|
+
import { availableFonts, FONTS_LANGS, FONTS_LANGS_LIST, loadFont, fontsLoadedList } from '@lancom/shared/assets/js/utils/fonts-helper';
|
|
49
49
|
|
|
50
50
|
export default {
|
|
51
51
|
name: 'FontFamilySelect',
|
|
@@ -72,6 +72,7 @@ export default {
|
|
|
72
72
|
},
|
|
73
73
|
data() {
|
|
74
74
|
return {
|
|
75
|
+
fontsLoadedList,
|
|
75
76
|
currentValue: null,
|
|
76
77
|
isSelected: false,
|
|
77
78
|
isOpen: false,
|
|
@@ -80,6 +81,9 @@ export default {
|
|
|
80
81
|
};
|
|
81
82
|
},
|
|
82
83
|
computed: {
|
|
84
|
+
isLoadedFont() {
|
|
85
|
+
return !this.model || !!this.fontsLoadedList[this.model.label];
|
|
86
|
+
},
|
|
83
87
|
model: {
|
|
84
88
|
get() {
|
|
85
89
|
return this.value;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<div class="EditorProductDetails__header-info">
|
|
13
13
|
<div class="EditorProductDetails__header-row">
|
|
14
14
|
<span
|
|
15
|
-
v-if="
|
|
15
|
+
v-if="defaultSimpleProductPricing"
|
|
16
16
|
class="lc_regular16 lc_grey1">
|
|
17
17
|
From {{ currency.isoCode }}
|
|
18
18
|
<v-popover
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
popover-class="tooltip popover white"
|
|
23
23
|
class="EditorProductDetails__discounts-table">
|
|
24
24
|
<span class="lc_semibold22 lc_black EditorProductDetails__dashed-underline">
|
|
25
|
-
{{
|
|
25
|
+
{{ defaultSimpleProductPricing[0].price | priceWithTax(pricingSettings, currency) }}
|
|
26
26
|
</span>
|
|
27
27
|
<template slot="popover">
|
|
28
|
-
<pricing-discounts-table :prices="
|
|
28
|
+
<pricing-discounts-table :prices="defaultSimpleProductPricing" />
|
|
29
29
|
</template>
|
|
30
30
|
</v-popover>
|
|
31
31
|
</span>
|
|
@@ -118,6 +118,9 @@ export default {
|
|
|
118
118
|
'pricingSettings',
|
|
119
119
|
'country'
|
|
120
120
|
]),
|
|
121
|
+
defaultSimpleProductPricing() {
|
|
122
|
+
return (this.isPrintPricing ? this.defaultSimpleProduct?.pricing : this.defaultSimpleProduct?.unprintedPricing);
|
|
123
|
+
},
|
|
121
124
|
productAvailableInCurrentCountry() {
|
|
122
125
|
const { countries } = this.product;
|
|
123
126
|
return !(countries || []).length || countries.includes(this.country._id);
|
|
@@ -230,11 +230,11 @@ export default {
|
|
|
230
230
|
this.fabricHelper.scaleWorkspace({ width: size, height: size });
|
|
231
231
|
},
|
|
232
232
|
initEventsListeners() {
|
|
233
|
-
document.addEventListener('mousedown', this.onDocumentStartClick);
|
|
233
|
+
// document.addEventListener('mousedown', this.onDocumentStartClick);
|
|
234
234
|
window.addEventListener('resize', this.onResize);
|
|
235
235
|
},
|
|
236
236
|
clearEventsListeners() {
|
|
237
|
-
document.removeEventListener('mousedown', this.onDocumentStartClick);
|
|
237
|
+
// document.removeEventListener('mousedown', this.onDocumentStartClick);
|
|
238
238
|
window.removeEventListener('resize', this.onResize);
|
|
239
239
|
},
|
|
240
240
|
onDocumentStartClick({ target }) {
|
package/package.json
CHANGED
package/store/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import api from '@lancom/shared/assets/js/api';
|
|
2
2
|
import { saveStatePlugin, loadState } from '@lancom/shared/plugins/save-state';
|
|
3
3
|
import { MESSAGES, COUNTRIES_MESSAGES } from '@/messages';
|
|
4
|
+
import { SETTINGS, COUNTRIES_SETTINGS } from '@/settings';
|
|
4
5
|
const cookieparser = process.server ? require('cookieparser') : undefined;
|
|
5
6
|
const CLOSED_NOTIFICATION = 'lancom-closed-notification-1.0';
|
|
6
7
|
import { getShopCountrySettings } from '@lancom/shared/assets/js/utils/shop';
|
|
@@ -41,7 +42,8 @@ export const getters = {
|
|
|
41
42
|
displayPricingWithTax: ({ pricing }) => !!pricing?.displayPricingWithTax,
|
|
42
43
|
screenPrintsPrices: ({ pricing }) => pricing?.screenPrintsPrices || {},
|
|
43
44
|
depositInfo: ({ depositInfo }) => depositInfo || {},
|
|
44
|
-
MESSAGES: ({ country }) => ({ ...MESSAGES, ...(COUNTRIES_MESSAGES[country?.isoCode] || {}) })
|
|
45
|
+
MESSAGES: ({ country }) => ({ ...MESSAGES, ...(COUNTRIES_MESSAGES[country?.isoCode] || {}) }),
|
|
46
|
+
SETTINGS: ({ country }) => ({ ...SETTINGS, ...(COUNTRIES_SETTINGS[country?.isoCode] || {}) })
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
export const actions = {
|