@lancom/shared 0.0.312 → 0.0.314

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.
@@ -53,6 +53,7 @@ export class TextLayer extends Layer {
53
53
  stroke = 'rgb(255, 255, 255)';
54
54
  enableOutline = false;
55
55
  strokeWidth = 1;
56
+ charSpacing = 0;
56
57
  paintFirst = 'stroke'; // stroke behind fill
57
58
 
58
59
  constructor(type, colorId, top, left, isEditMode) {
@@ -96,6 +96,30 @@
96
96
  </i>
97
97
  </div>
98
98
  </div>
99
+ <div class="form-row--cols low-dense">
100
+ <div class="form-col col-half">
101
+ <label
102
+ for="fontSize"
103
+ class="form-label">
104
+ Letter Spacing
105
+ </label>
106
+ <i
107
+ class="icon-minus form-icon-left EditorLayerFormText__field-action"
108
+ @click="decreaseCharSpacing">
109
+ </i>
110
+ <input
111
+ id="charSpacing"
112
+ ref="charSpacing"
113
+ v-model.number="charSpacing"
114
+ name="charSpacing"
115
+ type="text"
116
+ class="form-field icon-inside-lr filled centered labelless" />
117
+ <i
118
+ class="icon-plus form-icon-right EditorLayerFormText__field-action"
119
+ @click="increaseCharSpacing">
120
+ </i>
121
+ </div>
122
+ </div>
99
123
  <div class="form-row--cols low-dense">
100
124
  <div class="form-col col-half">
101
125
  <label class="form-label EditorLayerFormText__label-with-checkbox">
@@ -197,6 +221,16 @@ export default {
197
221
  this.$refs.fontSize.value = value;
198
222
  }
199
223
  },
224
+ charSpacing: {
225
+ get() {
226
+ return this.layer.charSpacing || 0;
227
+ },
228
+ set(value) {
229
+ value = inRange(value || 0, -300, 300);
230
+ this.$emit('set-layer-field', { field: 'charSpacing', value });
231
+ this.$refs.charSpacing.value = value;
232
+ }
233
+ },
200
234
  strokeWidth: {
201
235
  get() {
202
236
  return this.layer.strokeWidth;
@@ -224,6 +258,12 @@ export default {
224
258
  decreaseFontSize() {
225
259
  this.fontSize -= 1;
226
260
  },
261
+ increaseCharSpacing() {
262
+ this.charSpacing += 1;
263
+ },
264
+ decreaseCharSpacing() {
265
+ this.charSpacing -= 1;
266
+ },
227
267
  increaseStrokeWidth() {
228
268
  this.strokeWidth += 1;
229
269
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.312",
3
+ "version": "0.0.314",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {