@deot/vc-components 1.0.55 → 1.0.57

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/dist/index.cjs CHANGED
@@ -10091,23 +10091,16 @@ const insertFontSizeStyle = (value, id) => {
10091
10091
  .ql-snow .ql-font-size.ql-picker .ql-picker-label[data-value="${fontSize}"]:before {
10092
10092
  content: "${fontSize}"
10093
10093
  }`;
10094
- pre += `.ql-editor .ql-font-size-${fontSize} {
10095
- font-size: ${fontSize};
10096
- }`;
10097
10094
  return pre;
10098
10095
  }, "");
10099
10096
  return Load__namespace.style(code, { id });
10100
10097
  };
10101
10098
  const insertLineHeightStyle = (value, id) => {
10102
10099
  const code = value.reduce((pre, lineHeight) => {
10103
- const classLineHeightValue = +lineHeight * 10;
10104
- pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${classLineHeightValue}"]:before,
10105
- .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${classLineHeightValue}"]:before {
10100
+ pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${lineHeight}"]:before,
10101
+ .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${lineHeight}"]:before {
10106
10102
  content: "${+lineHeight}"
10107
10103
  }`;
10108
- pre += `.ql-editor .ql-line-height-${classLineHeightValue} {
10109
- line-height: ${+lineHeight};
10110
- }`;
10111
10104
  return pre;
10112
10105
  }, "");
10113
10106
  return Load__namespace.style(code, { id });
@@ -10118,9 +10111,6 @@ const insertLetterSpacingStyle = (value, id) => {
10118
10111
  .ql-snow .ql-letter-spacing.ql-picker .ql-picker-label[data-value="${letterSpacing}"]:before {
10119
10112
  content: "${letterSpacing}"
10120
10113
  }`;
10121
- pre += `.ql-editor .ql-letter-spacing-${letterSpacing} {
10122
- letter-spacing: ${letterSpacing};
10123
- }`;
10124
10114
  return pre;
10125
10115
  }, "");
10126
10116
  return Load__namespace.style(code, { id });
@@ -10308,9 +10298,8 @@ const EditorToolbar = /* @__PURE__ */ vue.defineComponent({
10308
10298
  "selected": true
10309
10299
  }, null);
10310
10300
  }
10311
- const v = key === 'line-height' ? +it * 10 : it;
10312
10301
  return vue.createVNode("option", {
10313
- "value": `${v}`
10302
+ "value": `${it}`
10314
10303
  }, null);
10315
10304
  })]);
10316
10305
  }
@@ -10323,19 +10312,22 @@ const EditorToolbar = /* @__PURE__ */ vue.defineComponent({
10323
10312
  if (Array.isArray(item)) {
10324
10313
  return insertStyle(item);
10325
10314
  }
10315
+ let key = item;
10316
+ let value = [];
10326
10317
  if (typeof item === 'object') {
10327
- const [key, value] = Object.entries(item)[0];
10328
- const options = value.length && value || toolbarDefaultsMap[key];
10329
- if (key === 'font-size') {
10330
- insertFontSizeStyle(options, styleId);
10331
- } else if (key === 'line-height') {
10332
- insertLineHeightStyle(options, lineHeightStyleId);
10333
- } else if (key === 'letter-spacing') {
10334
- insertLetterSpacingStyle(options, letterSpacingStyleId);
10335
- }
10318
+ [key, value] = Object.entries(item)[0];
10319
+ }
10320
+ value = value.length && value || toolbarDefaultsMap[key];
10321
+ if (key === 'font-size' && Array.isArray(value)) {
10322
+ insertFontSizeStyle(value, styleId);
10323
+ } else if (key === 'line-height') {
10324
+ insertLineHeightStyle(value, lineHeightStyleId);
10325
+ } else if (key === 'letter-spacing') {
10326
+ insertLetterSpacingStyle(value, letterSpacingStyleId);
10336
10327
  }
10337
10328
  });
10338
10329
  };
10330
+ const handlePrevent = e => e.preventDefault();
10339
10331
  vue.onMounted(() => {
10340
10332
  insertStyle(buttons.value);
10341
10333
  });
@@ -10346,7 +10338,8 @@ const EditorToolbar = /* @__PURE__ */ vue.defineComponent({
10346
10338
  });
10347
10339
  return () => {
10348
10340
  return vue.createVNode("div", {
10349
- "id": props.elementId
10341
+ "id": props.elementId,
10342
+ "onClick": handlePrevent
10350
10343
  }, [renderButtonGroup(buttons.value), slots?.extend?.()]);
10351
10344
  };
10352
10345
  }
@@ -10413,21 +10406,20 @@ const registerAudioBlot = (quillInstance) => {
10413
10406
 
10414
10407
  const registerLineHeight = (quillInstance) => {
10415
10408
  const lineHeight = toolbarDefaultsMap["line-height"];
10416
- const whitelist = lineHeight.map((i) => String(+i * 10));
10417
10409
  const Parchment = quillInstance.import("parchment");
10418
- const lineHeightStyle = new Parchment.ClassAttributor(
10410
+ const lineHeightStyle = new Parchment.StyleAttributor(
10411
+ "line-height",
10419
10412
  "line-height",
10420
- "ql-line-height",
10421
- { scope: Parchment.Scope.INLINE, whitelist }
10413
+ { scope: Parchment.Scope.INLINE, whitelist: lineHeight }
10422
10414
  );
10423
10415
  quillInstance.register({ "formats/line-height": lineHeightStyle }, true);
10424
10416
  };
10425
10417
 
10426
10418
  const registerLetterSpacing = (quillInstance) => {
10427
10419
  const Parchment = quillInstance.import("parchment");
10428
- const letterSpacingStyle = new Parchment.ClassAttributor(
10420
+ const letterSpacingStyle = new Parchment.StyleAttributor(
10421
+ "letter-spacing",
10429
10422
  "letter-spacing",
10430
- "ql-letter-spacing",
10431
10423
  {
10432
10424
  scope: Parchment.Scope.INLINE,
10433
10425
  whitelist: toolbarDefaultsMap["letter-spacing"]
@@ -11111,18 +11103,12 @@ const registerEventModule = (QuillClass) => {
11111
11103
  const registerFontSize = (editor) => {
11112
11104
  const Parchment = editor.import("parchment");
11113
11105
  const fontSize = toolbarDefaultsMap["font-size"];
11114
- const SizeClass = new Parchment.ClassAttributor("font-size", "ql-font-size", {
11115
- scope: Parchment.Scope.INLINE,
11116
- whitelist: fontSize
11117
- });
11118
11106
  const SizeStyle = new Parchment.StyleAttributor("font-size", "font-size", {
11119
11107
  scope: Parchment.Scope.INLINE,
11120
11108
  whitelist: fontSize
11121
11109
  });
11122
11110
  editor.register({
11123
- "formats/font-size": SizeClass,
11124
- "attributors/class/font-size": SizeClass,
11125
- "attributors/style/font-size": SizeStyle
11111
+ "formats/font-size": SizeStyle
11126
11112
  }, true);
11127
11113
  };
11128
11114
 
@@ -11180,6 +11166,7 @@ const COMPONENT_NAME$14 = 'vc-editor';
11180
11166
  const Editor = /* @__PURE__ */ vue.defineComponent({
11181
11167
  name: COMPONENT_NAME$14,
11182
11168
  props: props$M,
11169
+ defaults,
11183
11170
  emits: ['ready', 'blur', 'focus', 'input', 'update:modelValue', 'change'],
11184
11171
  setup(props, {
11185
11172
  slots,
@@ -16544,23 +16544,16 @@ var VcComponents = (function (exports, vue) {
16544
16544
  .ql-snow .ql-font-size.ql-picker .ql-picker-label[data-value="${fontSize}"]:before {
16545
16545
  content: "${fontSize}"
16546
16546
  }`;
16547
- pre += `.ql-editor .ql-font-size-${fontSize} {
16548
- font-size: ${fontSize};
16549
- }`;
16550
16547
  return pre;
16551
16548
  }, "");
16552
16549
  return style(code, { id });
16553
16550
  };
16554
16551
  const insertLineHeightStyle = (value, id) => {
16555
16552
  const code = value.reduce((pre, lineHeight) => {
16556
- const classLineHeightValue = +lineHeight * 10;
16557
- pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${classLineHeightValue}"]:before,
16558
- .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${classLineHeightValue}"]:before {
16553
+ pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${lineHeight}"]:before,
16554
+ .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${lineHeight}"]:before {
16559
16555
  content: "${+lineHeight}"
16560
16556
  }`;
16561
- pre += `.ql-editor .ql-line-height-${classLineHeightValue} {
16562
- line-height: ${+lineHeight};
16563
- }`;
16564
16557
  return pre;
16565
16558
  }, "");
16566
16559
  return style(code, { id });
@@ -16571,9 +16564,6 @@ var VcComponents = (function (exports, vue) {
16571
16564
  .ql-snow .ql-letter-spacing.ql-picker .ql-picker-label[data-value="${letterSpacing}"]:before {
16572
16565
  content: "${letterSpacing}"
16573
16566
  }`;
16574
- pre += `.ql-editor .ql-letter-spacing-${letterSpacing} {
16575
- letter-spacing: ${letterSpacing};
16576
- }`;
16577
16567
  return pre;
16578
16568
  }, "");
16579
16569
  return style(code, { id });
@@ -16761,9 +16751,8 @@ var VcComponents = (function (exports, vue) {
16761
16751
  "selected": true
16762
16752
  }, null);
16763
16753
  }
16764
- const v = key === 'line-height' ? +it * 10 : it;
16765
16754
  return vue.createVNode("option", {
16766
- "value": `${v}`
16755
+ "value": `${it}`
16767
16756
  }, null);
16768
16757
  })]);
16769
16758
  }
@@ -16776,19 +16765,22 @@ var VcComponents = (function (exports, vue) {
16776
16765
  if (Array.isArray(item)) {
16777
16766
  return insertStyle(item);
16778
16767
  }
16768
+ let key = item;
16769
+ let value = [];
16779
16770
  if (typeof item === 'object') {
16780
- const [key, value] = Object.entries(item)[0];
16781
- const options = value.length && value || toolbarDefaultsMap[key];
16782
- if (key === 'font-size') {
16783
- insertFontSizeStyle(options, styleId);
16784
- } else if (key === 'line-height') {
16785
- insertLineHeightStyle(options, lineHeightStyleId);
16786
- } else if (key === 'letter-spacing') {
16787
- insertLetterSpacingStyle(options, letterSpacingStyleId);
16788
- }
16771
+ [key, value] = Object.entries(item)[0];
16772
+ }
16773
+ value = value.length && value || toolbarDefaultsMap[key];
16774
+ if (key === 'font-size' && Array.isArray(value)) {
16775
+ insertFontSizeStyle(value, styleId);
16776
+ } else if (key === 'line-height') {
16777
+ insertLineHeightStyle(value, lineHeightStyleId);
16778
+ } else if (key === 'letter-spacing') {
16779
+ insertLetterSpacingStyle(value, letterSpacingStyleId);
16789
16780
  }
16790
16781
  });
16791
16782
  };
16783
+ const handlePrevent = e => e.preventDefault();
16792
16784
  vue.onMounted(() => {
16793
16785
  insertStyle(buttons.value);
16794
16786
  });
@@ -16799,7 +16791,8 @@ var VcComponents = (function (exports, vue) {
16799
16791
  });
16800
16792
  return () => {
16801
16793
  return vue.createVNode("div", {
16802
- "id": props.elementId
16794
+ "id": props.elementId,
16795
+ "onClick": handlePrevent
16803
16796
  }, [renderButtonGroup(buttons.value), slots?.extend?.()]);
16804
16797
  };
16805
16798
  }
@@ -16866,21 +16859,20 @@ var VcComponents = (function (exports, vue) {
16866
16859
 
16867
16860
  const registerLineHeight = (quillInstance) => {
16868
16861
  const lineHeight = toolbarDefaultsMap["line-height"];
16869
- const whitelist = lineHeight.map((i) => String(+i * 10));
16870
16862
  const Parchment = quillInstance.import("parchment");
16871
- const lineHeightStyle = new Parchment.ClassAttributor(
16863
+ const lineHeightStyle = new Parchment.StyleAttributor(
16864
+ "line-height",
16872
16865
  "line-height",
16873
- "ql-line-height",
16874
- { scope: Parchment.Scope.INLINE, whitelist }
16866
+ { scope: Parchment.Scope.INLINE, whitelist: lineHeight }
16875
16867
  );
16876
16868
  quillInstance.register({ "formats/line-height": lineHeightStyle }, true);
16877
16869
  };
16878
16870
 
16879
16871
  const registerLetterSpacing = (quillInstance) => {
16880
16872
  const Parchment = quillInstance.import("parchment");
16881
- const letterSpacingStyle = new Parchment.ClassAttributor(
16873
+ const letterSpacingStyle = new Parchment.StyleAttributor(
16874
+ "letter-spacing",
16882
16875
  "letter-spacing",
16883
- "ql-letter-spacing",
16884
16876
  {
16885
16877
  scope: Parchment.Scope.INLINE,
16886
16878
  whitelist: toolbarDefaultsMap["letter-spacing"]
@@ -19522,18 +19514,12 @@ var VcComponents = (function (exports, vue) {
19522
19514
  const registerFontSize = (editor) => {
19523
19515
  const Parchment = editor.import("parchment");
19524
19516
  const fontSize = toolbarDefaultsMap["font-size"];
19525
- const SizeClass = new Parchment.ClassAttributor("font-size", "ql-font-size", {
19526
- scope: Parchment.Scope.INLINE,
19527
- whitelist: fontSize
19528
- });
19529
19517
  const SizeStyle = new Parchment.StyleAttributor("font-size", "font-size", {
19530
19518
  scope: Parchment.Scope.INLINE,
19531
19519
  whitelist: fontSize
19532
19520
  });
19533
19521
  editor.register({
19534
- "formats/font-size": SizeClass,
19535
- "attributors/class/font-size": SizeClass,
19536
- "attributors/style/font-size": SizeStyle
19522
+ "formats/font-size": SizeStyle
19537
19523
  }, true);
19538
19524
  };
19539
19525
 
@@ -19591,6 +19577,7 @@ var VcComponents = (function (exports, vue) {
19591
19577
  const Editor$1 = /* @__PURE__ */ vue.defineComponent({
19592
19578
  name: COMPONENT_NAME$14,
19593
19579
  props: props$M,
19580
+ defaults: defaults$1,
19594
19581
  emits: ['ready', 'blur', 'focus', 'input', 'update:modelValue', 'change'],
19595
19582
  setup(props, {
19596
19583
  slots,
package/dist/index.js CHANGED
@@ -10069,23 +10069,16 @@ const insertFontSizeStyle = (value, id) => {
10069
10069
  .ql-snow .ql-font-size.ql-picker .ql-picker-label[data-value="${fontSize}"]:before {
10070
10070
  content: "${fontSize}"
10071
10071
  }`;
10072
- pre += `.ql-editor .ql-font-size-${fontSize} {
10073
- font-size: ${fontSize};
10074
- }`;
10075
10072
  return pre;
10076
10073
  }, "");
10077
10074
  return Load.style(code, { id });
10078
10075
  };
10079
10076
  const insertLineHeightStyle = (value, id) => {
10080
10077
  const code = value.reduce((pre, lineHeight) => {
10081
- const classLineHeightValue = +lineHeight * 10;
10082
- pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${classLineHeightValue}"]:before,
10083
- .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${classLineHeightValue}"]:before {
10078
+ pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${lineHeight}"]:before,
10079
+ .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${lineHeight}"]:before {
10084
10080
  content: "${+lineHeight}"
10085
10081
  }`;
10086
- pre += `.ql-editor .ql-line-height-${classLineHeightValue} {
10087
- line-height: ${+lineHeight};
10088
- }`;
10089
10082
  return pre;
10090
10083
  }, "");
10091
10084
  return Load.style(code, { id });
@@ -10096,9 +10089,6 @@ const insertLetterSpacingStyle = (value, id) => {
10096
10089
  .ql-snow .ql-letter-spacing.ql-picker .ql-picker-label[data-value="${letterSpacing}"]:before {
10097
10090
  content: "${letterSpacing}"
10098
10091
  }`;
10099
- pre += `.ql-editor .ql-letter-spacing-${letterSpacing} {
10100
- letter-spacing: ${letterSpacing};
10101
- }`;
10102
10092
  return pre;
10103
10093
  }, "");
10104
10094
  return Load.style(code, { id });
@@ -10286,9 +10276,8 @@ const EditorToolbar = /* @__PURE__ */ defineComponent({
10286
10276
  "selected": true
10287
10277
  }, null);
10288
10278
  }
10289
- const v = key === 'line-height' ? +it * 10 : it;
10290
10279
  return createVNode("option", {
10291
- "value": `${v}`
10280
+ "value": `${it}`
10292
10281
  }, null);
10293
10282
  })]);
10294
10283
  }
@@ -10301,19 +10290,22 @@ const EditorToolbar = /* @__PURE__ */ defineComponent({
10301
10290
  if (Array.isArray(item)) {
10302
10291
  return insertStyle(item);
10303
10292
  }
10293
+ let key = item;
10294
+ let value = [];
10304
10295
  if (typeof item === 'object') {
10305
- const [key, value] = Object.entries(item)[0];
10306
- const options = value.length && value || toolbarDefaultsMap[key];
10307
- if (key === 'font-size') {
10308
- insertFontSizeStyle(options, styleId);
10309
- } else if (key === 'line-height') {
10310
- insertLineHeightStyle(options, lineHeightStyleId);
10311
- } else if (key === 'letter-spacing') {
10312
- insertLetterSpacingStyle(options, letterSpacingStyleId);
10313
- }
10296
+ [key, value] = Object.entries(item)[0];
10297
+ }
10298
+ value = value.length && value || toolbarDefaultsMap[key];
10299
+ if (key === 'font-size' && Array.isArray(value)) {
10300
+ insertFontSizeStyle(value, styleId);
10301
+ } else if (key === 'line-height') {
10302
+ insertLineHeightStyle(value, lineHeightStyleId);
10303
+ } else if (key === 'letter-spacing') {
10304
+ insertLetterSpacingStyle(value, letterSpacingStyleId);
10314
10305
  }
10315
10306
  });
10316
10307
  };
10308
+ const handlePrevent = e => e.preventDefault();
10317
10309
  onMounted(() => {
10318
10310
  insertStyle(buttons.value);
10319
10311
  });
@@ -10324,7 +10316,8 @@ const EditorToolbar = /* @__PURE__ */ defineComponent({
10324
10316
  });
10325
10317
  return () => {
10326
10318
  return createVNode("div", {
10327
- "id": props.elementId
10319
+ "id": props.elementId,
10320
+ "onClick": handlePrevent
10328
10321
  }, [renderButtonGroup(buttons.value), slots?.extend?.()]);
10329
10322
  };
10330
10323
  }
@@ -10391,21 +10384,20 @@ const registerAudioBlot = (quillInstance) => {
10391
10384
 
10392
10385
  const registerLineHeight = (quillInstance) => {
10393
10386
  const lineHeight = toolbarDefaultsMap["line-height"];
10394
- const whitelist = lineHeight.map((i) => String(+i * 10));
10395
10387
  const Parchment = quillInstance.import("parchment");
10396
- const lineHeightStyle = new Parchment.ClassAttributor(
10388
+ const lineHeightStyle = new Parchment.StyleAttributor(
10389
+ "line-height",
10397
10390
  "line-height",
10398
- "ql-line-height",
10399
- { scope: Parchment.Scope.INLINE, whitelist }
10391
+ { scope: Parchment.Scope.INLINE, whitelist: lineHeight }
10400
10392
  );
10401
10393
  quillInstance.register({ "formats/line-height": lineHeightStyle }, true);
10402
10394
  };
10403
10395
 
10404
10396
  const registerLetterSpacing = (quillInstance) => {
10405
10397
  const Parchment = quillInstance.import("parchment");
10406
- const letterSpacingStyle = new Parchment.ClassAttributor(
10398
+ const letterSpacingStyle = new Parchment.StyleAttributor(
10399
+ "letter-spacing",
10407
10400
  "letter-spacing",
10408
- "ql-letter-spacing",
10409
10401
  {
10410
10402
  scope: Parchment.Scope.INLINE,
10411
10403
  whitelist: toolbarDefaultsMap["letter-spacing"]
@@ -11089,18 +11081,12 @@ const registerEventModule = (QuillClass) => {
11089
11081
  const registerFontSize = (editor) => {
11090
11082
  const Parchment = editor.import("parchment");
11091
11083
  const fontSize = toolbarDefaultsMap["font-size"];
11092
- const SizeClass = new Parchment.ClassAttributor("font-size", "ql-font-size", {
11093
- scope: Parchment.Scope.INLINE,
11094
- whitelist: fontSize
11095
- });
11096
11084
  const SizeStyle = new Parchment.StyleAttributor("font-size", "font-size", {
11097
11085
  scope: Parchment.Scope.INLINE,
11098
11086
  whitelist: fontSize
11099
11087
  });
11100
11088
  editor.register({
11101
- "formats/font-size": SizeClass,
11102
- "attributors/class/font-size": SizeClass,
11103
- "attributors/style/font-size": SizeStyle
11089
+ "formats/font-size": SizeStyle
11104
11090
  }, true);
11105
11091
  };
11106
11092
 
@@ -11158,6 +11144,7 @@ const COMPONENT_NAME$14 = 'vc-editor';
11158
11144
  const Editor = /* @__PURE__ */ defineComponent({
11159
11145
  name: COMPONENT_NAME$14,
11160
11146
  props: props$M,
11147
+ defaults,
11161
11148
  emits: ['ready', 'blur', 'focus', 'input', 'update:modelValue', 'change'],
11162
11149
  setup(props, {
11163
11150
  slots,
@@ -16547,23 +16547,16 @@
16547
16547
  .ql-snow .ql-font-size.ql-picker .ql-picker-label[data-value="${fontSize}"]:before {
16548
16548
  content: "${fontSize}"
16549
16549
  }`;
16550
- pre += `.ql-editor .ql-font-size-${fontSize} {
16551
- font-size: ${fontSize};
16552
- }`;
16553
16550
  return pre;
16554
16551
  }, "");
16555
16552
  return style(code, { id });
16556
16553
  };
16557
16554
  const insertLineHeightStyle = (value, id) => {
16558
16555
  const code = value.reduce((pre, lineHeight) => {
16559
- const classLineHeightValue = +lineHeight * 10;
16560
- pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${classLineHeightValue}"]:before,
16561
- .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${classLineHeightValue}"]:before {
16556
+ pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${lineHeight}"]:before,
16557
+ .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${lineHeight}"]:before {
16562
16558
  content: "${+lineHeight}"
16563
16559
  }`;
16564
- pre += `.ql-editor .ql-line-height-${classLineHeightValue} {
16565
- line-height: ${+lineHeight};
16566
- }`;
16567
16560
  return pre;
16568
16561
  }, "");
16569
16562
  return style(code, { id });
@@ -16574,9 +16567,6 @@
16574
16567
  .ql-snow .ql-letter-spacing.ql-picker .ql-picker-label[data-value="${letterSpacing}"]:before {
16575
16568
  content: "${letterSpacing}"
16576
16569
  }`;
16577
- pre += `.ql-editor .ql-letter-spacing-${letterSpacing} {
16578
- letter-spacing: ${letterSpacing};
16579
- }`;
16580
16570
  return pre;
16581
16571
  }, "");
16582
16572
  return style(code, { id });
@@ -16764,9 +16754,8 @@
16764
16754
  "selected": true
16765
16755
  }, null);
16766
16756
  }
16767
- const v = key === 'line-height' ? +it * 10 : it;
16768
16757
  return vue.createVNode("option", {
16769
- "value": `${v}`
16758
+ "value": `${it}`
16770
16759
  }, null);
16771
16760
  })]);
16772
16761
  }
@@ -16779,19 +16768,22 @@
16779
16768
  if (Array.isArray(item)) {
16780
16769
  return insertStyle(item);
16781
16770
  }
16771
+ let key = item;
16772
+ let value = [];
16782
16773
  if (typeof item === 'object') {
16783
- const [key, value] = Object.entries(item)[0];
16784
- const options = value.length && value || toolbarDefaultsMap[key];
16785
- if (key === 'font-size') {
16786
- insertFontSizeStyle(options, styleId);
16787
- } else if (key === 'line-height') {
16788
- insertLineHeightStyle(options, lineHeightStyleId);
16789
- } else if (key === 'letter-spacing') {
16790
- insertLetterSpacingStyle(options, letterSpacingStyleId);
16791
- }
16774
+ [key, value] = Object.entries(item)[0];
16775
+ }
16776
+ value = value.length && value || toolbarDefaultsMap[key];
16777
+ if (key === 'font-size' && Array.isArray(value)) {
16778
+ insertFontSizeStyle(value, styleId);
16779
+ } else if (key === 'line-height') {
16780
+ insertLineHeightStyle(value, lineHeightStyleId);
16781
+ } else if (key === 'letter-spacing') {
16782
+ insertLetterSpacingStyle(value, letterSpacingStyleId);
16792
16783
  }
16793
16784
  });
16794
16785
  };
16786
+ const handlePrevent = e => e.preventDefault();
16795
16787
  vue.onMounted(() => {
16796
16788
  insertStyle(buttons.value);
16797
16789
  });
@@ -16802,7 +16794,8 @@
16802
16794
  });
16803
16795
  return () => {
16804
16796
  return vue.createVNode("div", {
16805
- "id": props.elementId
16797
+ "id": props.elementId,
16798
+ "onClick": handlePrevent
16806
16799
  }, [renderButtonGroup(buttons.value), slots?.extend?.()]);
16807
16800
  };
16808
16801
  }
@@ -16869,21 +16862,20 @@
16869
16862
 
16870
16863
  const registerLineHeight = (quillInstance) => {
16871
16864
  const lineHeight = toolbarDefaultsMap["line-height"];
16872
- const whitelist = lineHeight.map((i) => String(+i * 10));
16873
16865
  const Parchment = quillInstance.import("parchment");
16874
- const lineHeightStyle = new Parchment.ClassAttributor(
16866
+ const lineHeightStyle = new Parchment.StyleAttributor(
16867
+ "line-height",
16875
16868
  "line-height",
16876
- "ql-line-height",
16877
- { scope: Parchment.Scope.INLINE, whitelist }
16869
+ { scope: Parchment.Scope.INLINE, whitelist: lineHeight }
16878
16870
  );
16879
16871
  quillInstance.register({ "formats/line-height": lineHeightStyle }, true);
16880
16872
  };
16881
16873
 
16882
16874
  const registerLetterSpacing = (quillInstance) => {
16883
16875
  const Parchment = quillInstance.import("parchment");
16884
- const letterSpacingStyle = new Parchment.ClassAttributor(
16876
+ const letterSpacingStyle = new Parchment.StyleAttributor(
16877
+ "letter-spacing",
16885
16878
  "letter-spacing",
16886
- "ql-letter-spacing",
16887
16879
  {
16888
16880
  scope: Parchment.Scope.INLINE,
16889
16881
  whitelist: toolbarDefaultsMap["letter-spacing"]
@@ -19525,18 +19517,12 @@
19525
19517
  const registerFontSize = (editor) => {
19526
19518
  const Parchment = editor.import("parchment");
19527
19519
  const fontSize = toolbarDefaultsMap["font-size"];
19528
- const SizeClass = new Parchment.ClassAttributor("font-size", "ql-font-size", {
19529
- scope: Parchment.Scope.INLINE,
19530
- whitelist: fontSize
19531
- });
19532
19520
  const SizeStyle = new Parchment.StyleAttributor("font-size", "font-size", {
19533
19521
  scope: Parchment.Scope.INLINE,
19534
19522
  whitelist: fontSize
19535
19523
  });
19536
19524
  editor.register({
19537
- "formats/font-size": SizeClass,
19538
- "attributors/class/font-size": SizeClass,
19539
- "attributors/style/font-size": SizeStyle
19525
+ "formats/font-size": SizeStyle
19540
19526
  }, true);
19541
19527
  };
19542
19528
 
@@ -19594,6 +19580,7 @@
19594
19580
  const Editor$1 = /* @__PURE__ */ vue.defineComponent({
19595
19581
  name: COMPONENT_NAME$14,
19596
19582
  props: props$M,
19583
+ defaults: defaults$1,
19597
19584
  emits: ['ready', 'blur', 'focus', 'input', 'update:modelValue', 'change'],
19598
19585
  setup(props, {
19599
19586
  slots,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/vc-components",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",