@deot/vc 1.0.55 → 1.0.56

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,16 +18791,18 @@ 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
  };
@@ -18889,20 +18880,19 @@ var Vc = (function (exports, vue) {
18889
18880
  };
18890
18881
  const registerLineHeight = (quillInstance) => {
18891
18882
  const lineHeight = toolbarDefaultsMap["line-height"];
18892
- const whitelist = lineHeight.map((i) => String(+i * 10));
18893
18883
  const Parchment = quillInstance.import("parchment");
18894
- const lineHeightStyle = new Parchment.ClassAttributor(
18884
+ const lineHeightStyle = new Parchment.StyleAttributor(
18885
+ "line-height",
18895
18886
  "line-height",
18896
- "ql-line-height",
18897
- { scope: Parchment.Scope.INLINE, whitelist }
18887
+ { scope: Parchment.Scope.INLINE, whitelist: lineHeight }
18898
18888
  );
18899
18889
  quillInstance.register({ "formats/line-height": lineHeightStyle }, true);
18900
18890
  };
18901
18891
  const registerLetterSpacing = (quillInstance) => {
18902
18892
  const Parchment = quillInstance.import("parchment");
18903
- const letterSpacingStyle = new Parchment.ClassAttributor(
18893
+ const letterSpacingStyle = new Parchment.StyleAttributor(
18894
+ "letter-spacing",
18904
18895
  "letter-spacing",
18905
- "ql-letter-spacing",
18906
18896
  {
18907
18897
  scope: Parchment.Scope.INLINE,
18908
18898
  whitelist: toolbarDefaultsMap["letter-spacing"]
@@ -19571,18 +19561,12 @@ var Vc = (function (exports, vue) {
19571
19561
  const registerFontSize = (editor) => {
19572
19562
  const Parchment = editor.import("parchment");
19573
19563
  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
19564
  const SizeStyle = new Parchment.StyleAttributor("font-size", "font-size", {
19579
19565
  scope: Parchment.Scope.INLINE,
19580
19566
  whitelist: fontSize
19581
19567
  });
19582
19568
  editor.register({
19583
- "formats/font-size": SizeClass,
19584
- "attributors/class/font-size": SizeClass,
19585
- "attributors/style/font-size": SizeStyle
19569
+ "formats/font-size": SizeStyle
19586
19570
  }, true);
19587
19571
  };
19588
19572
  const registerExtends = (e) => {
@@ -19635,6 +19619,7 @@ var Vc = (function (exports, vue) {
19635
19619
  const Editor$1 = /* @__PURE__ */ vue.defineComponent({
19636
19620
  name: COMPONENT_NAME$14,
19637
19621
  props: props$M,
19622
+ defaults: defaults$3,
19638
19623
  emits: ["ready", "blur", "focus", "input", "update:modelValue", "change"],
19639
19624
  setup(props2, {
19640
19625
  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,16 +18794,18 @@
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
  };
@@ -18892,20 +18883,19 @@
18892
18883
  };
18893
18884
  const registerLineHeight = (quillInstance) => {
18894
18885
  const lineHeight = toolbarDefaultsMap["line-height"];
18895
- const whitelist = lineHeight.map((i) => String(+i * 10));
18896
18886
  const Parchment = quillInstance.import("parchment");
18897
- const lineHeightStyle = new Parchment.ClassAttributor(
18887
+ const lineHeightStyle = new Parchment.StyleAttributor(
18888
+ "line-height",
18898
18889
  "line-height",
18899
- "ql-line-height",
18900
- { scope: Parchment.Scope.INLINE, whitelist }
18890
+ { scope: Parchment.Scope.INLINE, whitelist: lineHeight }
18901
18891
  );
18902
18892
  quillInstance.register({ "formats/line-height": lineHeightStyle }, true);
18903
18893
  };
18904
18894
  const registerLetterSpacing = (quillInstance) => {
18905
18895
  const Parchment = quillInstance.import("parchment");
18906
- const letterSpacingStyle = new Parchment.ClassAttributor(
18896
+ const letterSpacingStyle = new Parchment.StyleAttributor(
18897
+ "letter-spacing",
18907
18898
  "letter-spacing",
18908
- "ql-letter-spacing",
18909
18899
  {
18910
18900
  scope: Parchment.Scope.INLINE,
18911
18901
  whitelist: toolbarDefaultsMap["letter-spacing"]
@@ -19574,18 +19564,12 @@
19574
19564
  const registerFontSize = (editor) => {
19575
19565
  const Parchment = editor.import("parchment");
19576
19566
  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
19567
  const SizeStyle = new Parchment.StyleAttributor("font-size", "font-size", {
19582
19568
  scope: Parchment.Scope.INLINE,
19583
19569
  whitelist: fontSize
19584
19570
  });
19585
19571
  editor.register({
19586
- "formats/font-size": SizeClass,
19587
- "attributors/class/font-size": SizeClass,
19588
- "attributors/style/font-size": SizeStyle
19572
+ "formats/font-size": SizeStyle
19589
19573
  }, true);
19590
19574
  };
19591
19575
  const registerExtends = (e) => {
@@ -19638,6 +19622,7 @@
19638
19622
  const Editor$1 = /* @__PURE__ */ vue.defineComponent({
19639
19623
  name: COMPONENT_NAME$14,
19640
19624
  props: props$M,
19625
+ defaults: defaults$3,
19641
19626
  emits: ["ready", "blur", "focus", "input", "update:modelValue", "change"],
19642
19627
  setup(props2, {
19643
19628
  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.56",
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.56",
23
+ "@deot/vc-hooks": "^1.0.56",
24
+ "@deot/vc-shared": "^1.0.56"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "vue": "*"