@zipify/wysiwyg 1.1.1-0 → 1.1.1

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.
Files changed (164) hide show
  1. package/dist/cli.js +2 -2
  2. package/dist/wysiwyg.css +11 -11
  3. package/dist/wysiwyg.mjs +46 -53
  4. package/lib/components/toolbar/controls/link/LinkControl.vue +4 -5
  5. package/lib/components/toolbar/controls/link/LinkControlHeader.vue +2 -2
  6. package/lib/components/toolbar/controls/link/__tests__/LinkControl.test.js +1 -1
  7. package/lib/components/toolbar/controls/link/__tests__/LinkControlHeader.test.js +1 -1
  8. package/lib/components/toolbar/controls/link/composables/useLink.js +5 -7
  9. package/lib/enums/TextSettings.js +0 -2
  10. package/lib/extensions/Alignment.js +10 -8
  11. package/lib/extensions/FontSize.js +8 -3
  12. package/lib/extensions/FontStyle.js +2 -2
  13. package/lib/extensions/LineHeight.js +10 -4
  14. package/lib/extensions/Link.js +15 -13
  15. package/lib/extensions/TextDecoration.js +13 -12
  16. package/lib/extensions/__tests__/FontFamily.test.js +6 -7
  17. package/lib/extensions/__tests__/FontWeight.test.js +10 -11
  18. package/lib/extensions/__tests__/TextDecoration.test.js +42 -73
  19. package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +3 -3
  20. package/lib/extensions/__tests__/__snapshots__/FontFamily.test.js.snap +0 -18
  21. package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +9 -9
  22. package/lib/extensions/__tests__/__snapshots__/FontStyle.test.js.snap +0 -16
  23. package/lib/extensions/__tests__/__snapshots__/LineHeight.test.js.snap +5 -5
  24. package/lib/extensions/__tests__/__snapshots__/TextDecoration.test.js.snap +43 -0
  25. package/lib/services/NodeFactory.js +4 -1
  26. package/node_modules_lambda/acorn-globals/node_modules/.bin/acorn +4 -0
  27. package/node_modules_lambda/acorn-globals/node_modules/acorn/CHANGELOG.md +620 -0
  28. package/node_modules_lambda/acorn-globals/node_modules/acorn/LICENSE +21 -0
  29. package/node_modules_lambda/acorn-globals/node_modules/acorn/README.md +269 -0
  30. package/node_modules_lambda/acorn-globals/node_modules/acorn/bin/acorn +4 -0
  31. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.d.ts +209 -0
  32. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js +5186 -0
  33. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js.map +1 -0
  34. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs +5155 -0
  35. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.d.ts +2 -0
  36. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.map +1 -0
  37. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/bin.js +64 -0
  38. package/node_modules_lambda/acorn-globals/node_modules/acorn/package.json +35 -0
  39. package/node_modules_lambda/cssstyle/node_modules/cssom/LICENSE.txt +20 -0
  40. package/node_modules_lambda/cssstyle/node_modules/cssom/README.mdown +67 -0
  41. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSDocumentRule.js +39 -0
  42. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSFontFaceRule.js +36 -0
  43. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSHostRule.js +37 -0
  44. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSImportRule.js +132 -0
  45. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframeRule.js +37 -0
  46. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframesRule.js +39 -0
  47. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSMediaRule.js +41 -0
  48. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSOM.js +3 -0
  49. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSRule.js +43 -0
  50. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleDeclaration.js +148 -0
  51. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleRule.js +190 -0
  52. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleSheet.js +88 -0
  53. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSSupportsRule.js +36 -0
  54. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValue.js +43 -0
  55. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValueExpression.js +344 -0
  56. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MatcherList.js +62 -0
  57. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MediaList.js +61 -0
  58. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/StyleSheet.js +17 -0
  59. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/clone.js +82 -0
  60. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/index.js +21 -0
  61. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/parse.js +464 -0
  62. package/node_modules_lambda/cssstyle/node_modules/cssom/package.json +18 -0
  63. package/node_modules_lambda/data-urls/node_modules/whatwg-url/LICENSE.txt +21 -0
  64. package/node_modules_lambda/data-urls/node_modules/whatwg-url/README.md +106 -0
  65. package/node_modules_lambda/data-urls/node_modules/whatwg-url/index.js +27 -0
  66. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/Function.js +42 -0
  67. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL-impl.js +209 -0
  68. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL.js +442 -0
  69. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams-impl.js +130 -0
  70. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams.js +472 -0
  71. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/VoidFunction.js +26 -0
  72. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/encoding.js +16 -0
  73. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/infra.js +26 -0
  74. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/percent-encoding.js +142 -0
  75. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/url-state-machine.js +1244 -0
  76. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/urlencoded.js +106 -0
  77. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/utils.js +190 -0
  78. package/node_modules_lambda/data-urls/node_modules/whatwg-url/package.json +58 -0
  79. package/node_modules_lambda/data-urls/node_modules/whatwg-url/webidl2js-wrapper.js +7 -0
  80. package/node_modules_lambda/escodegen/node_modules/estraverse/.jshintrc +16 -0
  81. package/node_modules_lambda/escodegen/node_modules/estraverse/LICENSE.BSD +19 -0
  82. package/node_modules_lambda/escodegen/node_modules/estraverse/README.md +153 -0
  83. package/node_modules_lambda/escodegen/node_modules/estraverse/estraverse.js +805 -0
  84. package/node_modules_lambda/escodegen/node_modules/estraverse/gulpfile.js +70 -0
  85. package/node_modules_lambda/escodegen/node_modules/estraverse/package.json +40 -0
  86. package/node_modules_lambda/escodegen/node_modules/levn/LICENSE +22 -0
  87. package/node_modules_lambda/escodegen/node_modules/levn/README.md +196 -0
  88. package/node_modules_lambda/escodegen/node_modules/levn/lib/cast.js +298 -0
  89. package/node_modules_lambda/escodegen/node_modules/levn/lib/coerce.js +285 -0
  90. package/node_modules_lambda/escodegen/node_modules/levn/lib/index.js +22 -0
  91. package/node_modules_lambda/escodegen/node_modules/levn/lib/parse-string.js +113 -0
  92. package/node_modules_lambda/escodegen/node_modules/levn/lib/parse.js +102 -0
  93. package/node_modules_lambda/escodegen/node_modules/levn/package.json +47 -0
  94. package/node_modules_lambda/escodegen/node_modules/optionator/CHANGELOG.md +56 -0
  95. package/node_modules_lambda/escodegen/node_modules/optionator/LICENSE +22 -0
  96. package/node_modules_lambda/escodegen/node_modules/optionator/README.md +238 -0
  97. package/node_modules_lambda/escodegen/node_modules/optionator/lib/help.js +260 -0
  98. package/node_modules_lambda/escodegen/node_modules/optionator/lib/index.js +465 -0
  99. package/node_modules_lambda/escodegen/node_modules/optionator/lib/util.js +54 -0
  100. package/node_modules_lambda/escodegen/node_modules/optionator/package.json +44 -0
  101. package/node_modules_lambda/escodegen/node_modules/prelude-ls/CHANGELOG.md +99 -0
  102. package/node_modules_lambda/escodegen/node_modules/prelude-ls/LICENSE +22 -0
  103. package/node_modules_lambda/escodegen/node_modules/prelude-ls/README.md +15 -0
  104. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Func.js +65 -0
  105. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/List.js +686 -0
  106. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Num.js +130 -0
  107. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Obj.js +154 -0
  108. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Str.js +92 -0
  109. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/index.js +178 -0
  110. package/node_modules_lambda/escodegen/node_modules/prelude-ls/package.json +52 -0
  111. package/node_modules_lambda/escodegen/node_modules/source-map/CHANGELOG.md +301 -0
  112. package/node_modules_lambda/escodegen/node_modules/source-map/LICENSE +28 -0
  113. package/node_modules_lambda/escodegen/node_modules/source-map/README.md +742 -0
  114. package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.debug.js +3234 -0
  115. package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.js +3233 -0
  116. package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js +2 -0
  117. package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js.map +1 -0
  118. package/node_modules_lambda/escodegen/node_modules/source-map/lib/array-set.js +121 -0
  119. package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64-vlq.js +140 -0
  120. package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64.js +67 -0
  121. package/node_modules_lambda/escodegen/node_modules/source-map/lib/binary-search.js +111 -0
  122. package/node_modules_lambda/escodegen/node_modules/source-map/lib/mapping-list.js +79 -0
  123. package/node_modules_lambda/escodegen/node_modules/source-map/lib/quick-sort.js +114 -0
  124. package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-consumer.js +1145 -0
  125. package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-generator.js +425 -0
  126. package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-node.js +413 -0
  127. package/node_modules_lambda/escodegen/node_modules/source-map/lib/util.js +488 -0
  128. package/node_modules_lambda/escodegen/node_modules/source-map/package.json +73 -0
  129. package/node_modules_lambda/escodegen/node_modules/source-map/source-map.d.ts +98 -0
  130. package/node_modules_lambda/escodegen/node_modules/source-map/source-map.js +8 -0
  131. package/node_modules_lambda/escodegen/node_modules/type-check/LICENSE +22 -0
  132. package/node_modules_lambda/escodegen/node_modules/type-check/README.md +210 -0
  133. package/node_modules_lambda/escodegen/node_modules/type-check/lib/check.js +126 -0
  134. package/node_modules_lambda/escodegen/node_modules/type-check/lib/index.js +16 -0
  135. package/node_modules_lambda/escodegen/node_modules/type-check/lib/parse-type.js +196 -0
  136. package/node_modules_lambda/escodegen/node_modules/type-check/package.json +40 -0
  137. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/.github/dependabot.yml +11 -0
  138. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/Changelog.md +212 -0
  139. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/LICENSE +21 -0
  140. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/README.md +130 -0
  141. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
  142. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
  143. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/index.js +23 -0
  144. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js +198 -0
  145. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  146. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  147. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
  148. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  149. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  150. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  151. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  152. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  153. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  154. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  155. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  156. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js +197 -0
  157. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf32.js +319 -0
  158. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js +290 -0
  159. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  160. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.d.ts +41 -0
  161. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.js +180 -0
  162. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/streams.js +109 -0
  163. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/package.json +44 -0
  164. package/package.json +1 -1
package/dist/wysiwyg.css CHANGED
@@ -591,34 +591,34 @@
591
591
  display: flex;
592
592
  }
593
593
 
594
- .zw-link-modal-header[data-v-aa42e2ce] {
594
+ .zw-link-modal-header[data-v-0a202ba4] {
595
595
  display: flex;
596
596
  align-items: center;
597
597
  justify-content: space-between;
598
598
  padding: var(--zw-offset-sm);
599
599
  border-bottom: 2px solid rgb(var(--zw-color-n5));
600
600
  }
601
- .zw-link-modal-header__title[data-v-aa42e2ce] {
601
+ .zw-link-modal-header__title[data-v-0a202ba4] {
602
602
  text-transform: uppercase;
603
603
  font-weight: var(--zw-font-weight-semibold);
604
604
  font-size: var(--zw-font-size-xxs);
605
605
  color: rgb(var(--zw-color-white));
606
606
  }
607
- .zw-link-modal-header__unlink-icon[data-v-aa42e2ce] {
607
+ .zw-link-modal-header__unlink-icon[data-v-0a202ba4] {
608
608
  margin-right: var(--zw-offset-xxs);
609
609
  }
610
- .zw-link-modal-header__unlink-button[data-v-aa42e2ce] {
610
+ .zw-link-modal-header__unlink-button[data-v-0a202ba4] {
611
611
  color: rgb(var(--zw-color-n80));
612
612
  font-size: var(--zw-font-size-xxs);
613
613
  transition: 0.1s opacity ease-out, 0.1s color ease-out;
614
614
  will-change: opacity, color;
615
615
  }
616
- .zw-link-modal-header__unlink-button[data-v-aa42e2ce]:disabled {
616
+ .zw-link-modal-header__unlink-button[data-v-0a202ba4]:disabled {
617
617
  opacity: 0.35;
618
618
  }
619
- .zw-link-modal-header__unlink-button[data-v-aa42e2ce]:focus,
620
- .zw-link-modal-header__unlink-button[data-v-aa42e2ce]:focus-within,
621
- .zw-link-modal-header__unlink-button[data-v-aa42e2ce]:hover {
619
+ .zw-link-modal-header__unlink-button[data-v-0a202ba4]:focus,
620
+ .zw-link-modal-header__unlink-button[data-v-0a202ba4]:focus-within,
621
+ .zw-link-modal-header__unlink-button[data-v-0a202ba4]:hover {
622
622
  color: rgb(var(--zw-color-white));
623
623
  }
624
624
 
@@ -627,13 +627,13 @@
627
627
  justify-content: flex-end;
628
628
  }
629
629
 
630
- .zw-link-modal[data-v-74b3b43a] {
630
+ .zw-link-modal[data-v-28e9497e] {
631
631
  width: 266px;
632
632
  }
633
- .zw-link-modal__body[data-v-74b3b43a] {
633
+ .zw-link-modal__body[data-v-28e9497e] {
634
634
  padding: var(--zw-offset-sm);
635
635
  }
636
- [data-v-74b3b43a] .zw-link-modal-dropdown__option {
636
+ [data-v-28e9497e] .zw-link-modal-dropdown__option {
637
637
  width: 234px;
638
638
  }
639
639
 
package/dist/wysiwyg.mjs CHANGED
@@ -13986,8 +13986,6 @@ const TextSettings = Object.freeze({
13986
13986
  TEXT_DECORATION: "text_decoration",
13987
13987
  SUPERSCRIPT: "superscript",
13988
13988
  MARGIN: "margin",
13989
- LINK: "link",
13990
- STYLE_PRESET: "style_preset",
13991
13989
  get attributes() {
13992
13990
  return [
13993
13991
  this.ALIGNMENT,
@@ -19754,7 +19752,7 @@ class NodeFactory {
19754
19752
  return { type, attrs };
19755
19753
  }
19756
19754
  static populateAllDevices(value) {
19757
- return { mobile: value, tablet: value, desktop: value };
19755
+ return { mobile: null, tablet: value, desktop: value };
19758
19756
  }
19759
19757
  }
19760
19758
  const dataStorage = /* @__PURE__ */ new WeakMap();
@@ -22090,7 +22088,7 @@ const __vue2_script$9 = {
22090
22088
  components: { Icon, Button },
22091
22089
  setup(_, { emit }) {
22092
22090
  const editor = inject(InjectionTokens$1.EDITOR);
22093
- const isLink = editor.commands.isLink();
22091
+ const isLink = computed(() => editor.isActive("link"));
22094
22092
  const removeLink = () => emit("remove-link");
22095
22093
  return { isLink, removeLink };
22096
22094
  }
@@ -22102,7 +22100,7 @@ var __component__$9 = /* @__PURE__ */ normalizeComponent(
22102
22100
  staticRenderFns$9,
22103
22101
  false,
22104
22102
  __vue2_injectStyles$9,
22105
- "aa42e2ce",
22103
+ "0a202ba4",
22106
22104
  null,
22107
22105
  null
22108
22106
  );
@@ -22177,12 +22175,11 @@ function useLink() {
22177
22175
  linkData.value.target = isChecked ? LinkTargets.BLANK : LinkTargets.SELF;
22178
22176
  }
22179
22177
  function prepareInitialFields() {
22180
- const link = editor.getAttributes(TextSettings.LINK);
22181
22178
  linkData.value.text = editor.commands.getSelectedText();
22182
- currentDestination.value.id = link.destination || LinkDestinations.URL;
22183
- linkData.value.target = link.target || LinkTargets.SELF;
22184
- if (link.href) {
22185
- destinationHrefs.value[currentDestination.value.id] = link.href;
22179
+ currentDestination.value.id = editor.getAttributes("link").destination || LinkDestinations.URL;
22180
+ linkData.value.target = editor.getAttributes("link").target || LinkTargets.SELF;
22181
+ if (editor.getAttributes("link").href) {
22182
+ destinationHrefs.value[currentDestination.value.id] = editor.getAttributes("link").href;
22186
22183
  }
22187
22184
  }
22188
22185
  function resetDestinations() {
@@ -22593,7 +22590,7 @@ const __vue2_script$4 = {
22593
22590
  urlValidator.reset();
22594
22591
  };
22595
22592
  const onBeforeOpened = () => {
22596
- editor.commands.extendMarkRange(TextSettings.LINK);
22593
+ editor.commands.extendMarkRange("link");
22597
22594
  resetErrors();
22598
22595
  link.prepareInitialFields();
22599
22596
  };
@@ -22602,8 +22599,7 @@ const __vue2_script$4 = {
22602
22599
  wrapperRef,
22603
22600
  modalRef
22604
22601
  });
22605
- const isLink = editor.commands.isLink();
22606
- const isActive2 = computed(() => toggler.isOpened.value || unref(isLink));
22602
+ const isActive2 = computed(() => toggler.isOpened.value || editor.isActive("link"));
22607
22603
  const updateLinkText = (value) => {
22608
22604
  resetErrors();
22609
22605
  link.updateText(value);
@@ -22643,7 +22639,7 @@ var __component__$4 = /* @__PURE__ */ normalizeComponent(
22643
22639
  staticRenderFns$4,
22644
22640
  false,
22645
22641
  __vue2_injectStyles$4,
22646
- "74b3b43a",
22642
+ "28e9497e",
22647
22643
  null,
22648
22644
  null
22649
22645
  );
@@ -23295,8 +23291,7 @@ const FontSize = Mark.create({
23295
23291
  return computed(() => unref(preset)[unref(device)].font_size.replace("px", ""));
23296
23292
  }),
23297
23293
  applyFontSize: createCommand(({ commands: commands2 }, value) => {
23298
- const device = unref(commands2.getDevice());
23299
- commands2.setMark(this.name, { [device]: value });
23294
+ commands2.setMark(this.name, { desktop: value, tablet: value, mobile: null });
23300
23295
  }),
23301
23296
  increaseFontSize: createCommand(({ commands: commands2 }) => {
23302
23297
  const size2 = Number(unref(commands2.getFontSize()));
@@ -23335,7 +23330,7 @@ const FontSize = Mark.create({
23335
23330
  style: "font-size",
23336
23331
  getAttrs: (input) => {
23337
23332
  const value = parseSize(input);
23338
- return { desktop: value, tablet: value, mobile: value };
23333
+ return { desktop: value, tablet: value, mobile: null };
23339
23334
  }
23340
23335
  }
23341
23336
  ];
@@ -23467,7 +23462,7 @@ const FontStyle = Mark.create({
23467
23462
  commands2.setMark(this.name, { italic: true });
23468
23463
  }),
23469
23464
  removeItalic: createCommand(({ commands: commands2 }) => {
23470
- commands2.setMark(this.name, { italic: false });
23465
+ commands2.unsetMark(this.name);
23471
23466
  })
23472
23467
  };
23473
23468
  },
@@ -23493,22 +23488,21 @@ const FontStyle = Mark.create({
23493
23488
  ];
23494
23489
  },
23495
23490
  renderHTML({ HTMLAttributes: attrs }) {
23496
- const font_style = attrs.italic ? "italic" : "normal";
23491
+ const font_style = attrs.italic ? "italic" : null;
23497
23492
  return renderMark({ font_style });
23498
23493
  }
23499
23494
  });
23500
23495
  const TextDecoration = Mark.create({
23501
23496
  name: TextSettings.TEXT_DECORATION,
23502
- priority: 1e3,
23503
23497
  addAttributes: () => ({
23504
23498
  underline: { default: false },
23505
23499
  strike_through: { default: false }
23506
23500
  }),
23507
23501
  addCommands() {
23508
23502
  return {
23509
- isUnderline: createCommand(({ commands: commands2 }) => {
23503
+ isUnderline: createCommand(({ commands: commands2, editor }) => {
23510
23504
  const decoration = commands2.getTextDecoration();
23511
- return computed(() => unref(decoration).underline);
23505
+ return computed(() => editor.isActive("link") || unref(decoration).underline);
23512
23506
  }),
23513
23507
  isStrikeThrough: createCommand(({ commands: commands2 }) => {
23514
23508
  const decoration = commands2.getTextDecoration();
@@ -23527,20 +23521,17 @@ const TextDecoration = Mark.create({
23527
23521
  }),
23528
23522
  getDefaultTextDecoration: createCommand(({ commands: commands2 }) => {
23529
23523
  const preset = commands2.getPreset();
23530
- const isLink = commands2.isLink();
23531
- const linkPreset = commands2.getLinkPreset();
23532
23524
  return computed(() => {
23533
- const decoration = [
23534
- unref(preset).common.text_decoration,
23535
- unref(isLink) ? unref(linkPreset).common.text_decoration : ""
23536
- ].join(" ");
23525
+ const decoration = unref(preset).common.text_decoration;
23537
23526
  return {
23538
23527
  underline: decoration.includes("underline"),
23539
23528
  strike_through: decoration.includes("line-through")
23540
23529
  };
23541
23530
  });
23542
23531
  }),
23543
- toggleUnderline: createCommand(({ commands: commands2 }) => {
23532
+ toggleUnderline: createCommand(({ commands: commands2, editor }) => {
23533
+ if (editor.isActive("link"))
23534
+ return;
23544
23535
  commands2.toggleTextDecoration("underline");
23545
23536
  }),
23546
23537
  toggleStrikeThrough: createCommand(({ commands: commands2 }) => {
@@ -23554,7 +23545,12 @@ const TextDecoration = Mark.create({
23554
23545
  commands2.setMark(this.name, { [name]: true });
23555
23546
  }),
23556
23547
  removeTextDecoration: createCommand(({ commands: commands2 }, name) => {
23557
- commands2.setMark(this.name, { ...unref(commands2.getTextDecoration()), [name]: false });
23548
+ const mark = {
23549
+ ...unref(commands2.getTextDecoration()),
23550
+ [name]: false
23551
+ };
23552
+ const isRemoveMark = !mark.underline && !mark.strike_through;
23553
+ isRemoveMark ? commands2.unsetMark(this.name) : commands2.setMark(this.name, mark);
23558
23554
  })
23559
23555
  };
23560
23556
  },
@@ -23606,8 +23602,6 @@ const TextDecoration = Mark.create({
23606
23602
  decorations.push("underline");
23607
23603
  if (attrs.strike_through)
23608
23604
  decorations.push("line-through");
23609
- if (!decorations.length)
23610
- decorations.push("none");
23611
23605
  return renderMark({ text_decoration: decorations.join(" ") });
23612
23606
  }
23613
23607
  });
@@ -23653,16 +23647,12 @@ const Alignment = Extension.create({
23653
23647
  parseHTML({ style: style2 }) {
23654
23648
  const textAlign = convertAlignment(style2.textAlign);
23655
23649
  if (textAlign) {
23656
- return {
23657
- desktop: textAlign,
23658
- tablet: textAlign,
23659
- mobile: textAlign
23660
- };
23650
+ return { desktop: textAlign, tablet: textAlign, mobile: null };
23661
23651
  }
23662
- const mobile = style2.getPropertyValue("--zw-text-align-mobile") || null;
23652
+ const mobile = null;
23663
23653
  const tablet = style2.getPropertyValue("--zw-text-align-tablet") || null;
23664
23654
  const desktop = style2.getPropertyValue("--zw-text-align-desktop") || null;
23665
- if (!mobile && !tablet && !desktop)
23655
+ if (!tablet && !desktop)
23666
23656
  return null;
23667
23657
  return { desktop, tablet, mobile };
23668
23658
  },
@@ -23682,8 +23672,7 @@ const Alignment = Extension.create({
23682
23672
  addCommands() {
23683
23673
  return {
23684
23674
  applyAlignment: createCommand(({ commands: commands2 }, value) => {
23685
- const device = unref(commands2.getDevice());
23686
- commands2.setBlockAttributes(this.name, { [device]: value }, DEFAULTS$1);
23675
+ commands2.setBlockAttributes(this.name, { desktop: value, tablet: value, mobile: null }, DEFAULTS$1);
23687
23676
  }),
23688
23677
  getAlignment: createCommand(({ commands: commands2 }) => {
23689
23678
  const attribute = commands2.getBlockAttributes(this.name, DEFAULTS$1);
@@ -23724,7 +23713,7 @@ const LineHeight = Extension.create({
23724
23713
  isRequired: false,
23725
23714
  parseHTML: (element) => {
23726
23715
  if (element.matches('[style*="--zw-line-height"]')) {
23727
- const mobile = element.style.getPropertyValue("--zw-line-height-mobile") || null;
23716
+ const mobile = null;
23728
23717
  const tablet = element.style.getPropertyValue("--zw-line-height-tablet") || null;
23729
23718
  const desktop = element.style.getPropertyValue("--zw-line-height-desktop") || null;
23730
23719
  return { mobile, tablet, desktop };
@@ -23734,7 +23723,7 @@ const LineHeight = Extension.create({
23734
23723
  return null;
23735
23724
  const wrapperEl = unref(this.options.wrapperRef);
23736
23725
  const converted = convertLineHeight(value, element, wrapperEl);
23737
- return { desktop: converted, tablet: converted, mobile: converted };
23726
+ return { desktop: converted, tablet: converted, mobile: null };
23738
23727
  },
23739
23728
  renderHTML(attrs) {
23740
23729
  if (!attrs.line_height)
@@ -23767,8 +23756,7 @@ const LineHeight = Extension.create({
23767
23756
  return computed(() => unref(preset)[unref(device)].line_height);
23768
23757
  }),
23769
23758
  applyLineHeight: createCommand(({ commands: commands2 }, value) => {
23770
- const device = unref(commands2.getDevice());
23771
- commands2.setBlockAttributes(this.name, { [device]: value }, DEFAULTS);
23759
+ commands2.setBlockAttributes(this.name, { desktop: value, tablet: value, mobile: null }, DEFAULTS);
23772
23760
  })
23773
23761
  };
23774
23762
  }
@@ -24871,7 +24859,7 @@ const Link$1 = Mark.create({
24871
24859
  }
24872
24860
  });
24873
24861
  const Link = Link$1.extend({
24874
- name: TextSettings.LINK,
24862
+ name: "link",
24875
24863
  addOptions() {
24876
24864
  var _a;
24877
24865
  return {
@@ -24914,14 +24902,19 @@ const Link = Link$1.extend({
24914
24902
  ...(_a = this.parent) == null ? void 0 : _a.call(this),
24915
24903
  applyLink: createCommand(({ commands: commands2, chain }, attributes) => {
24916
24904
  if (!commands2.getSelectedText()) {
24917
- return commands2.insertContent(NodeFactory.text(attributes.text, [
24918
- NodeFactory.mark(TextSettings.LINK, attributes)
24919
- ]));
24905
+ return commands2.insertContent({
24906
+ type: "text",
24907
+ marks: [
24908
+ {
24909
+ type: "link",
24910
+ attrs: { ...attributes }
24911
+ }
24912
+ ],
24913
+ text: attributes.text
24914
+ });
24920
24915
  }
24921
- return chain().setMark(this.name, attributes).transformText(() => attributes.text).extendMarkRange(TextSettings.LINK).run();
24922
- }),
24923
- isLink: createCommand(({ editor }) => computed(() => editor.isActive(TextSettings.LINK))),
24924
- getLinkPreset: createCommand(() => computed(() => this.options.preset))
24916
+ return chain().setMark(this.name, attributes).transformText(() => attributes.text).extendMarkRange("link").run();
24917
+ })
24925
24918
  };
24926
24919
  },
24927
24920
  renderHTML({ HTMLAttributes: attrs }) {
@@ -31,8 +31,8 @@
31
31
  </template>
32
32
 
33
33
  <script>
34
- import { computed, ref, inject, unref } from 'vue';
35
- import { LinkDestinations, TextSettings } from '../../../../enums';
34
+ import { computed, ref, inject } from 'vue';
35
+ import { LinkDestinations } from '../../../../enums';
36
36
  import { InjectionTokens } from '../../../../injectionTokens';
37
37
  import { tooltip } from '../../../../directives';
38
38
  import { useValidator } from '../../../base/composables';
@@ -94,7 +94,7 @@ export default {
94
94
  };
95
95
 
96
96
  const onBeforeOpened = () => {
97
- editor.commands.extendMarkRange(TextSettings.LINK);
97
+ editor.commands.extendMarkRange('link');
98
98
  resetErrors();
99
99
  link.prepareInitialFields();
100
100
  };
@@ -105,8 +105,7 @@ export default {
105
105
  modalRef
106
106
  });
107
107
 
108
- const isLink = editor.commands.isLink();
109
- const isActive = computed(() => toggler.isOpened.value || unref(isLink));
108
+ const isActive = computed(() => toggler.isOpened.value || editor.isActive('link'));
110
109
 
111
110
  const updateLinkText = (value) => {
112
111
  resetErrors();
@@ -10,7 +10,7 @@
10
10
  </template>
11
11
 
12
12
  <script>
13
- import { inject } from 'vue';
13
+ import { computed, inject } from 'vue';
14
14
  import { Icon, Button } from '../../../base';
15
15
  import { InjectionTokens } from '../../../../injectionTokens';
16
16
 
@@ -21,7 +21,7 @@ export default {
21
21
 
22
22
  setup(_, { emit }) {
23
23
  const editor = inject(InjectionTokens.EDITOR);
24
- const isLink = editor.commands.isLink();
24
+ const isLink = computed(() => editor.isActive('link'));
25
25
 
26
26
  const removeLink = () => emit('remove-link');
27
27
 
@@ -7,7 +7,7 @@ import LinkControlApply from '../LinkControlApply';
7
7
  import { LinkControlDestination } from '../destination';
8
8
 
9
9
  const createEditor = (isActive) => ({
10
- commands: { isLink: () => isActive ?? false }
10
+ isActive: () => isActive ?? false
11
11
  });
12
12
 
13
13
  function createComponent({ editor }) {
@@ -4,7 +4,7 @@ import { Button } from '../../../../base';
4
4
  import LinkControlHeader from '../LinkControlHeader';
5
5
 
6
6
  const createEditor = (isActive) => ({
7
- commands: { isLink: () => isActive ?? false }
7
+ isActive: () => isActive ?? false
8
8
  });
9
9
 
10
10
  function createComponent({ editor }) {
@@ -1,5 +1,5 @@
1
1
  import { ref, inject } from 'vue';
2
- import { LinkTargets, LinkDestinations, TextSettings } from '../../../../../enums';
2
+ import { LinkTargets, LinkDestinations } from '../../../../../enums';
3
3
  import { InjectionTokens } from '../../../../../injectionTokens';
4
4
 
5
5
  export function useLink() {
@@ -15,14 +15,12 @@ export function useLink() {
15
15
  }
16
16
 
17
17
  function prepareInitialFields() {
18
- const link = editor.getAttributes(TextSettings.LINK);
19
-
20
18
  linkData.value.text = editor.commands.getSelectedText();
21
- currentDestination.value.id = link.destination || LinkDestinations.URL;
22
- linkData.value.target = link.target || LinkTargets.SELF;
19
+ currentDestination.value.id = editor.getAttributes('link').destination || LinkDestinations.URL;
20
+ linkData.value.target = editor.getAttributes('link').target || LinkTargets.SELF;
23
21
 
24
- if (link.href) {
25
- destinationHrefs.value[currentDestination.value.id] = link.href;
22
+ if (editor.getAttributes('link').href) {
23
+ destinationHrefs.value[currentDestination.value.id] = editor.getAttributes('link').href;
26
24
  }
27
25
  }
28
26
 
@@ -10,8 +10,6 @@ export const TextSettings = Object.freeze({
10
10
  TEXT_DECORATION: 'text_decoration',
11
11
  SUPERSCRIPT: 'superscript',
12
12
  MARGIN: 'margin',
13
- LINK: 'link',
14
- STYLE_PRESET: 'style_preset',
15
13
 
16
14
  get attributes() {
17
15
  return [
@@ -23,14 +23,13 @@ export const Alignment = Extension.create({
23
23
  const textAlign = convertAlignment(style.textAlign);
24
24
 
25
25
  if (textAlign) {
26
- return {
27
- desktop: textAlign,
28
- tablet: textAlign,
29
- mobile: textAlign
30
- };
26
+ // return { desktop: textAlign, tablet: textAlign, mobile: textAlign };
27
+
28
+ // Temporary until release BUILDER_MODES
29
+ return { desktop: textAlign, tablet: textAlign, mobile: null };
31
30
  }
32
31
 
33
- const mobile = style.getPropertyValue('--zw-text-align-mobile') || null;
32
+ const mobile = null; //style.getPropertyValue('--zw-text-align-mobile') || null;
34
33
  const tablet = style.getPropertyValue('--zw-text-align-tablet') || null;
35
34
  const desktop = style.getPropertyValue('--zw-text-align-desktop') || null;
36
35
 
@@ -56,9 +55,12 @@ export const Alignment = Extension.create({
56
55
  addCommands() {
57
56
  return {
58
57
  applyAlignment: createCommand(({ commands }, value) => {
59
- const device = unref(commands.getDevice());
58
+ // const device = unref(commands.getDevice());
59
+ //
60
+ // commands.setBlockAttributes(this.name, { [device]: value }, DEFAULTS);
60
61
 
61
- commands.setBlockAttributes(this.name, { [device]: value }, DEFAULTS);
62
+ // Temporary until release BUILDER_MODES
63
+ commands.setBlockAttributes(this.name, { desktop: value, tablet: value, mobile: null }, DEFAULTS);
62
64
  }),
63
65
 
64
66
  getAlignment: createCommand(({ commands }) => {
@@ -36,9 +36,12 @@ export const FontSize = Mark.create({
36
36
  }),
37
37
 
38
38
  applyFontSize: createCommand(({ commands }, value) => {
39
- const device = unref(commands.getDevice());
39
+ // const device = unref(commands.getDevice());
40
40
 
41
- commands.setMark(this.name, { [device]: value });
41
+ // commands.setMark(this.name, { [device]: value });
42
+
43
+ // Temporary until release BUILDER_MODES
44
+ commands.setMark(this.name, { desktop: value, tablet: value, mobile: null });
42
45
  }),
43
46
 
44
47
  increaseFontSize: createCommand(({ commands }) => {
@@ -88,7 +91,9 @@ export const FontSize = Mark.create({
88
91
  getAttrs: (input) => {
89
92
  const value = parseSize(input);
90
93
 
91
- return { desktop: value, tablet: value, mobile: value };
94
+ // return { desktop: value, tablet: value, mobile: value };
95
+ // Temporary until release BUILDER_MODES
96
+ return { desktop: value, tablet: value, mobile: null };
92
97
  }
93
98
  }
94
99
  ];
@@ -46,7 +46,7 @@ export const FontStyle = Mark.create({
46
46
  }),
47
47
 
48
48
  removeItalic: createCommand(({ commands }) => {
49
- commands.setMark(this.name, { italic: false });
49
+ commands.unsetMark(this.name);
50
50
  })
51
51
  };
52
52
  },
@@ -76,7 +76,7 @@ export const FontStyle = Mark.create({
76
76
  },
77
77
 
78
78
  renderHTML({ HTMLAttributes: attrs }) {
79
- const font_style = attrs.italic ? 'italic' : 'normal';
79
+ const font_style = attrs.italic ? 'italic' : null;
80
80
 
81
81
  return renderMark({ font_style });
82
82
  }
@@ -22,7 +22,7 @@ export const LineHeight = Extension.create({
22
22
 
23
23
  parseHTML: (element) => {
24
24
  if (element.matches('[style*="--zw-line-height"]')) {
25
- const mobile = element.style.getPropertyValue('--zw-line-height-mobile') || null;
25
+ const mobile = null; // element.style.getPropertyValue('--zw-line-height-mobile') || null;
26
26
  const tablet = element.style.getPropertyValue('--zw-line-height-tablet') || null;
27
27
  const desktop = element.style.getPropertyValue('--zw-line-height-desktop') || null;
28
28
 
@@ -36,7 +36,10 @@ export const LineHeight = Extension.create({
36
36
  const wrapperEl = unref(this.options.wrapperRef);
37
37
  const converted = convertLineHeight(value, element, wrapperEl);
38
38
 
39
- return { desktop: converted, tablet: converted, mobile: converted };
39
+ // return { desktop: converted, tablet: converted, mobile: converted };
40
+
41
+ // Temporary until release BUILDER_MODES
42
+ return { desktop: converted, tablet: converted, mobile: null };
40
43
  },
41
44
 
42
45
  renderHTML(attrs) {
@@ -72,9 +75,12 @@ export const LineHeight = Extension.create({
72
75
  }),
73
76
 
74
77
  applyLineHeight: createCommand(({ commands }, value) => {
75
- const device = unref(commands.getDevice());
78
+ // const device = unref(commands.getDevice());
79
+ //
80
+ // commands.setBlockAttributes(this.name, { [device]: value }, DEFAULTS);
76
81
 
77
- commands.setBlockAttributes(this.name, { [device]: value }, DEFAULTS);
82
+ // Temporary until release BUILDER_MODES
83
+ commands.setBlockAttributes(this.name, { desktop: value, tablet: value, mobile: null }, DEFAULTS);
78
84
  })
79
85
  };
80
86
  }
@@ -1,11 +1,10 @@
1
1
  import Base from '@tiptap/extension-link';
2
- import { computed, unref } from 'vue';
2
+ import { unref } from 'vue';
3
3
  import { createCommand } from '../utils';
4
- import { LinkDestinations, LinkTargets, TextSettings } from '../enums';
5
- import { NodeFactory } from '../services';
4
+ import { LinkDestinations, LinkTargets } from '../enums';
6
5
 
7
6
  export const Link = Base.extend({
8
- name: TextSettings.LINK,
7
+ name: 'link',
9
8
 
10
9
  addOptions() {
11
10
  return {
@@ -53,23 +52,26 @@ export const Link = Base.extend({
53
52
  addCommands() {
54
53
  return {
55
54
  ...this.parent?.(),
56
-
57
55
  applyLink: createCommand(({ commands, chain }, attributes) => {
58
56
  if (!commands.getSelectedText()) {
59
- return commands.insertContent(NodeFactory.text(attributes.text, [
60
- NodeFactory.mark(TextSettings.LINK, attributes)
61
- ]));
57
+ return commands.insertContent({
58
+ type: 'text',
59
+ marks: [
60
+ {
61
+ type: 'link',
62
+ attrs: { ...attributes }
63
+ }
64
+ ],
65
+ text: attributes.text
66
+ });
62
67
  }
63
68
 
64
69
  return chain()
65
70
  .setMark(this.name, attributes)
66
71
  .transformText(() => attributes.text)
67
- .extendMarkRange(TextSettings.LINK)
72
+ .extendMarkRange('link')
68
73
  .run();
69
- }),
70
-
71
- isLink: createCommand(({ editor }) => computed(() => editor.isActive(TextSettings.LINK))),
72
- getLinkPreset: createCommand(() => computed(() => this.options.preset))
74
+ })
73
75
  };
74
76
  },
75
77