@deot/vc 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.
@@ -18574,23 +18574,16 @@ var Vc = (function (exports, vue) {
18574
18574
  .ql-snow .ql-font-size.ql-picker .ql-picker-label[data-value="${fontSize}"]:before {
18575
18575
  content: "${fontSize}"
18576
18576
  }`;
18577
- pre += `.ql-editor .ql-font-size-${fontSize} {
18578
- font-size: ${fontSize};
18579
- }`;
18580
18577
  return pre;
18581
18578
  }, "");
18582
18579
  return style(code, { id });
18583
18580
  };
18584
18581
  const insertLineHeightStyle = (value, id) => {
18585
18582
  const code = value.reduce((pre, lineHeight) => {
18586
- const classLineHeightValue = +lineHeight * 10;
18587
- pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${classLineHeightValue}"]:before,
18588
- .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${classLineHeightValue}"]:before {
18583
+ pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${lineHeight}"]:before,
18584
+ .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${lineHeight}"]:before {
18589
18585
  content: "${+lineHeight}"
18590
18586
  }`;
18591
- pre += `.ql-editor .ql-line-height-${classLineHeightValue} {
18592
- line-height: ${+lineHeight};
18593
- }`;
18594
18587
  return pre;
18595
18588
  }, "");
18596
18589
  return style(code, { id });
@@ -18601,9 +18594,6 @@ var Vc = (function (exports, vue) {
18601
18594
  .ql-snow .ql-letter-spacing.ql-picker .ql-picker-label[data-value="${letterSpacing}"]:before {
18602
18595
  content: "${letterSpacing}"
18603
18596
  }`;
18604
- pre += `.ql-editor .ql-letter-spacing-${letterSpacing} {
18605
- letter-spacing: ${letterSpacing};
18606
- }`;
18607
18597
  return pre;
18608
18598
  }, "");
18609
18599
  return style(code, { id });
@@ -18787,9 +18777,8 @@ var Vc = (function (exports, vue) {
18787
18777
  "selected": true
18788
18778
  }, null);
18789
18779
  }
18790
- const v = key === "line-height" ? +it * 10 : it;
18791
18780
  return vue.createVNode("option", {
18792
- "value": `${v}`
18781
+ "value": `${it}`
18793
18782
  }, null);
18794
18783
  })]);
18795
18784
  }
@@ -18802,19 +18791,22 @@ var Vc = (function (exports, vue) {
18802
18791
  if (Array.isArray(item)) {
18803
18792
  return insertStyle(item);
18804
18793
  }
18794
+ let key = item;
18795
+ let value = [];
18805
18796
  if (typeof item === "object") {
18806
- const [key, value] = Object.entries(item)[0];
18807
- const options = value.length && value || toolbarDefaultsMap[key];
18808
- if (key === "font-size") {
18809
- insertFontSizeStyle(options, styleId);
18810
- } else if (key === "line-height") {
18811
- insertLineHeightStyle(options, lineHeightStyleId);
18812
- } else if (key === "letter-spacing") {
18813
- insertLetterSpacingStyle(options, letterSpacingStyleId);
18814
- }
18797
+ [key, value] = Object.entries(item)[0];
18798
+ }
18799
+ value = value.length && value || toolbarDefaultsMap[key];
18800
+ if (key === "font-size" && Array.isArray(value)) {
18801
+ insertFontSizeStyle(value, styleId);
18802
+ } else if (key === "line-height") {
18803
+ insertLineHeightStyle(value, lineHeightStyleId);
18804
+ } else if (key === "letter-spacing") {
18805
+ insertLetterSpacingStyle(value, letterSpacingStyleId);
18815
18806
  }
18816
18807
  });
18817
18808
  };
18809
+ const handlePrevent = (e) => e.preventDefault();
18818
18810
  vue.onMounted(() => {
18819
18811
  insertStyle(buttons.value);
18820
18812
  });
@@ -18825,7 +18817,8 @@ var Vc = (function (exports, vue) {
18825
18817
  });
18826
18818
  return () => {
18827
18819
  return vue.createVNode("div", {
18828
- "id": props2.elementId
18820
+ "id": props2.elementId,
18821
+ "onClick": handlePrevent
18829
18822
  }, [renderButtonGroup(buttons.value), slots?.extend?.()]);
18830
18823
  };
18831
18824
  }
@@ -18889,20 +18882,19 @@ var Vc = (function (exports, vue) {
18889
18882
  };
18890
18883
  const registerLineHeight = (quillInstance) => {
18891
18884
  const lineHeight = toolbarDefaultsMap["line-height"];
18892
- const whitelist = lineHeight.map((i) => String(+i * 10));
18893
18885
  const Parchment = quillInstance.import("parchment");
18894
- const lineHeightStyle = new Parchment.ClassAttributor(
18886
+ const lineHeightStyle = new Parchment.StyleAttributor(
18887
+ "line-height",
18895
18888
  "line-height",
18896
- "ql-line-height",
18897
- { scope: Parchment.Scope.INLINE, whitelist }
18889
+ { scope: Parchment.Scope.INLINE, whitelist: lineHeight }
18898
18890
  );
18899
18891
  quillInstance.register({ "formats/line-height": lineHeightStyle }, true);
18900
18892
  };
18901
18893
  const registerLetterSpacing = (quillInstance) => {
18902
18894
  const Parchment = quillInstance.import("parchment");
18903
- const letterSpacingStyle = new Parchment.ClassAttributor(
18895
+ const letterSpacingStyle = new Parchment.StyleAttributor(
18896
+ "letter-spacing",
18904
18897
  "letter-spacing",
18905
- "ql-letter-spacing",
18906
18898
  {
18907
18899
  scope: Parchment.Scope.INLINE,
18908
18900
  whitelist: toolbarDefaultsMap["letter-spacing"]
@@ -19571,18 +19563,12 @@ var Vc = (function (exports, vue) {
19571
19563
  const registerFontSize = (editor) => {
19572
19564
  const Parchment = editor.import("parchment");
19573
19565
  const fontSize = toolbarDefaultsMap["font-size"];
19574
- const SizeClass = new Parchment.ClassAttributor("font-size", "ql-font-size", {
19575
- scope: Parchment.Scope.INLINE,
19576
- whitelist: fontSize
19577
- });
19578
19566
  const SizeStyle = new Parchment.StyleAttributor("font-size", "font-size", {
19579
19567
  scope: Parchment.Scope.INLINE,
19580
19568
  whitelist: fontSize
19581
19569
  });
19582
19570
  editor.register({
19583
- "formats/font-size": SizeClass,
19584
- "attributors/class/font-size": SizeClass,
19585
- "attributors/style/font-size": SizeStyle
19571
+ "formats/font-size": SizeStyle
19586
19572
  }, true);
19587
19573
  };
19588
19574
  const registerExtends = (e) => {
@@ -19635,6 +19621,7 @@ var Vc = (function (exports, vue) {
19635
19621
  const Editor$1 = /* @__PURE__ */ vue.defineComponent({
19636
19622
  name: COMPONENT_NAME$14,
19637
19623
  props: props$M,
19624
+ defaults: defaults$3,
19638
19625
  emits: ["ready", "blur", "focus", "input", "update:modelValue", "change"],
19639
19626
  setup(props2, {
19640
19627
  slots,
@@ -18577,23 +18577,16 @@
18577
18577
  .ql-snow .ql-font-size.ql-picker .ql-picker-label[data-value="${fontSize}"]:before {
18578
18578
  content: "${fontSize}"
18579
18579
  }`;
18580
- pre += `.ql-editor .ql-font-size-${fontSize} {
18581
- font-size: ${fontSize};
18582
- }`;
18583
18580
  return pre;
18584
18581
  }, "");
18585
18582
  return style(code, { id });
18586
18583
  };
18587
18584
  const insertLineHeightStyle = (value, id) => {
18588
18585
  const code = value.reduce((pre, lineHeight) => {
18589
- const classLineHeightValue = +lineHeight * 10;
18590
- pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${classLineHeightValue}"]:before,
18591
- .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${classLineHeightValue}"]:before {
18586
+ pre += `.ql-snow .ql-line-height.ql-picker .ql-picker-item[data-value="${lineHeight}"]:before,
18587
+ .ql-snow .ql-line-height.ql-picker .ql-picker-label[data-value="${lineHeight}"]:before {
18592
18588
  content: "${+lineHeight}"
18593
18589
  }`;
18594
- pre += `.ql-editor .ql-line-height-${classLineHeightValue} {
18595
- line-height: ${+lineHeight};
18596
- }`;
18597
18590
  return pre;
18598
18591
  }, "");
18599
18592
  return style(code, { id });
@@ -18604,9 +18597,6 @@
18604
18597
  .ql-snow .ql-letter-spacing.ql-picker .ql-picker-label[data-value="${letterSpacing}"]:before {
18605
18598
  content: "${letterSpacing}"
18606
18599
  }`;
18607
- pre += `.ql-editor .ql-letter-spacing-${letterSpacing} {
18608
- letter-spacing: ${letterSpacing};
18609
- }`;
18610
18600
  return pre;
18611
18601
  }, "");
18612
18602
  return style(code, { id });
@@ -18790,9 +18780,8 @@
18790
18780
  "selected": true
18791
18781
  }, null);
18792
18782
  }
18793
- const v = key === "line-height" ? +it * 10 : it;
18794
18783
  return vue.createVNode("option", {
18795
- "value": `${v}`
18784
+ "value": `${it}`
18796
18785
  }, null);
18797
18786
  })]);
18798
18787
  }
@@ -18805,19 +18794,22 @@
18805
18794
  if (Array.isArray(item)) {
18806
18795
  return insertStyle(item);
18807
18796
  }
18797
+ let key = item;
18798
+ let value = [];
18808
18799
  if (typeof item === "object") {
18809
- const [key, value] = Object.entries(item)[0];
18810
- const options = value.length && value || toolbarDefaultsMap[key];
18811
- if (key === "font-size") {
18812
- insertFontSizeStyle(options, styleId);
18813
- } else if (key === "line-height") {
18814
- insertLineHeightStyle(options, lineHeightStyleId);
18815
- } else if (key === "letter-spacing") {
18816
- insertLetterSpacingStyle(options, letterSpacingStyleId);
18817
- }
18800
+ [key, value] = Object.entries(item)[0];
18801
+ }
18802
+ value = value.length && value || toolbarDefaultsMap[key];
18803
+ if (key === "font-size" && Array.isArray(value)) {
18804
+ insertFontSizeStyle(value, styleId);
18805
+ } else if (key === "line-height") {
18806
+ insertLineHeightStyle(value, lineHeightStyleId);
18807
+ } else if (key === "letter-spacing") {
18808
+ insertLetterSpacingStyle(value, letterSpacingStyleId);
18818
18809
  }
18819
18810
  });
18820
18811
  };
18812
+ const handlePrevent = (e) => e.preventDefault();
18821
18813
  vue.onMounted(() => {
18822
18814
  insertStyle(buttons.value);
18823
18815
  });
@@ -18828,7 +18820,8 @@
18828
18820
  });
18829
18821
  return () => {
18830
18822
  return vue.createVNode("div", {
18831
- "id": props2.elementId
18823
+ "id": props2.elementId,
18824
+ "onClick": handlePrevent
18832
18825
  }, [renderButtonGroup(buttons.value), slots?.extend?.()]);
18833
18826
  };
18834
18827
  }
@@ -18892,20 +18885,19 @@
18892
18885
  };
18893
18886
  const registerLineHeight = (quillInstance) => {
18894
18887
  const lineHeight = toolbarDefaultsMap["line-height"];
18895
- const whitelist = lineHeight.map((i) => String(+i * 10));
18896
18888
  const Parchment = quillInstance.import("parchment");
18897
- const lineHeightStyle = new Parchment.ClassAttributor(
18889
+ const lineHeightStyle = new Parchment.StyleAttributor(
18890
+ "line-height",
18898
18891
  "line-height",
18899
- "ql-line-height",
18900
- { scope: Parchment.Scope.INLINE, whitelist }
18892
+ { scope: Parchment.Scope.INLINE, whitelist: lineHeight }
18901
18893
  );
18902
18894
  quillInstance.register({ "formats/line-height": lineHeightStyle }, true);
18903
18895
  };
18904
18896
  const registerLetterSpacing = (quillInstance) => {
18905
18897
  const Parchment = quillInstance.import("parchment");
18906
- const letterSpacingStyle = new Parchment.ClassAttributor(
18898
+ const letterSpacingStyle = new Parchment.StyleAttributor(
18899
+ "letter-spacing",
18907
18900
  "letter-spacing",
18908
- "ql-letter-spacing",
18909
18901
  {
18910
18902
  scope: Parchment.Scope.INLINE,
18911
18903
  whitelist: toolbarDefaultsMap["letter-spacing"]
@@ -19574,18 +19566,12 @@
19574
19566
  const registerFontSize = (editor) => {
19575
19567
  const Parchment = editor.import("parchment");
19576
19568
  const fontSize = toolbarDefaultsMap["font-size"];
19577
- const SizeClass = new Parchment.ClassAttributor("font-size", "ql-font-size", {
19578
- scope: Parchment.Scope.INLINE,
19579
- whitelist: fontSize
19580
- });
19581
19569
  const SizeStyle = new Parchment.StyleAttributor("font-size", "font-size", {
19582
19570
  scope: Parchment.Scope.INLINE,
19583
19571
  whitelist: fontSize
19584
19572
  });
19585
19573
  editor.register({
19586
- "formats/font-size": SizeClass,
19587
- "attributors/class/font-size": SizeClass,
19588
- "attributors/style/font-size": SizeStyle
19574
+ "formats/font-size": SizeStyle
19589
19575
  }, true);
19590
19576
  };
19591
19577
  const registerExtends = (e) => {
@@ -19638,6 +19624,7 @@
19638
19624
  const Editor$1 = /* @__PURE__ */ vue.defineComponent({
19639
19625
  name: COMPONENT_NAME$14,
19640
19626
  props: props$M,
19627
+ defaults: defaults$3,
19641
19628
  emits: ["ready", "blur", "focus", "input", "update:modelValue", "change"],
19642
19629
  setup(props2, {
19643
19630
  slots,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/vc",
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",
@@ -19,9 +19,9 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@deot/vc-components": "^1.0.55",
23
- "@deot/vc-hooks": "^1.0.55",
24
- "@deot/vc-shared": "^1.0.55"
22
+ "@deot/vc-components": "^1.0.57",
23
+ "@deot/vc-hooks": "^1.0.57",
24
+ "@deot/vc-shared": "^1.0.57"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "vue": "*"