@zipify/wysiwyg 1.0.0-dev.90 → 1.0.0-dev.91

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/wysiwyg.css CHANGED
@@ -369,11 +369,11 @@
369
369
  overscroll-behavior: contain;
370
370
  }
371
371
 
372
- .zw-field[data-v-20ee36c3] {
372
+ .zw-field[data-v-7bbd0125] {
373
373
  display: flex;
374
374
  flex-direction: column;
375
375
  }
376
- .zw-field__input[data-v-20ee36c3] {
376
+ .zw-field__input[data-v-7bbd0125] {
377
377
  --border-color: rgb(var(--zw-color-n60));
378
378
  --text-color: rgb(var(--zw-color-n85));
379
379
 
@@ -384,53 +384,49 @@
384
384
  outline: none;
385
385
  padding: 6px;
386
386
  line-height: var(--zw-line-height-xxs);
387
- transition: 0.1s border ease-out, 0.1s color ease-out;
388
- will-change: border, color;
389
387
  }
390
- .zw-field__input[data-v-20ee36c3]:hover {
388
+ .zw-field__input[data-v-7bbd0125]:hover {
391
389
  --border-color: rgb(var(--zw-color-n80));
392
390
  --text-color: rgb(var(--zw-color-n85));
393
391
  }
394
- .zw-field__input[data-v-20ee36c3]:focus,
395
- .zw-field__input[data-v-20ee36c3]:focus-within {
392
+ .zw-field__input[data-v-7bbd0125]:focus,
393
+ .zw-field__input[data-v-7bbd0125]:focus-within {
396
394
  --border-color: rgb(var(--zw-color-white));
397
395
  --text-color: rgb(var(--zw-color-white));
398
396
  }
399
- .zw-field__label[data-v-20ee36c3] {
397
+ .zw-field__label[data-v-7bbd0125] {
400
398
  display: inline-block;
401
399
  font-size: var(--zw-font-size-xxs);
402
400
  padding-bottom: var(--zw-offset-xxs);
403
401
  line-height: var(--zw-line-height-xxs);
404
402
  }
405
- .zw-field__label--error[data-v-20ee36c3] {
403
+ .zw-field__label--error[data-v-7bbd0125] {
406
404
  font-size: var(--zw-font-size-xxs);
407
405
  margin: var(--zw-offset-xxs) 0 0;
408
406
  color: rgb(var(--zw-color-red));
409
407
  }
410
408
 
411
- .zw-checkbox[data-v-c9d1da12] {
409
+ .zw-checkbox[data-v-15e487f5] {
412
410
  display: inline-flex;
413
411
  align-items: center;
414
412
  position: relative;
415
413
  cursor: pointer;
416
414
  padding: var(--zw-offset-xxs) var(--zw-offset-xxs) var(--zw-offset-xxs) 0;
417
415
  }
418
- .zw-checkbox__field + .zw-checkbox__indicator[data-v-c9d1da12] {
416
+ .zw-checkbox__field + .zw-checkbox__indicator[data-v-15e487f5] {
419
417
  color: var(--zw-color-n200);
420
418
  box-shadow: inset 0 0 0 2px currentColor;
421
419
  }
422
- .zw-checkbox:hover .zw-checkbox__indicator[data-v-c9d1da12],
423
- .zw-checkbox:focus .zw-checkbox__indicator[data-v-c9d1da12],
424
- .zw-checkbox:focus-within .zw-checkbox__indicator[data-v-c9d1da12] {
420
+ .zw-checkbox:hover .zw-checkbox__indicator[data-v-15e487f5] {
425
421
  box-shadow: inset 0 0 0 2px rgb(var(--zw-color-green));
426
422
  }
427
- .zw-checkbox__field:checked + .zw-checkbox__indicator[data-v-c9d1da12] {
423
+ .zw-checkbox__field:checked + .zw-checkbox__indicator[data-v-15e487f5] {
428
424
  color: rgb(var(--zw-color-green))
429
425
  }
430
- .zw-checkbox .zw-checkbox__field:checked + .zw-checkbox__indicator[data-v-c9d1da12] {
426
+ .zw-checkbox .zw-checkbox__field:checked + .zw-checkbox__indicator[data-v-15e487f5] {
431
427
  background-color: rgb(var(--zw-color-green));
432
428
  }
433
- .zw-checkbox .zw-checkbox__indicator[data-v-c9d1da12]::after {
429
+ .zw-checkbox .zw-checkbox__indicator[data-v-15e487f5]::after {
434
430
  content: "";
435
431
  display: block;
436
432
  height: 16px;
@@ -442,16 +438,16 @@
442
438
  background-size: 16px;
443
439
  background-position: center center;
444
440
  }
445
- .zw-checkbox__field:not(:checked) + .zw-checkbox__indicator[data-v-c9d1da12]::after {
441
+ .zw-checkbox__field:not(:checked) + .zw-checkbox__indicator[data-v-15e487f5]::after {
446
442
  transform: scale(0);
447
443
  }
448
- .zw-checkbox__field[data-v-c9d1da12] {
444
+ .zw-checkbox__field[data-v-15e487f5] {
449
445
  position: absolute;
450
446
  opacity: 0;
451
447
  height: 0;
452
448
  width: 0;
453
449
  }
454
- .zw-checkbox__label[data-v-c9d1da12] {
450
+ .zw-checkbox__label[data-v-15e487f5] {
455
451
  font-size: var(--zw-font-size-xs);
456
452
  }
457
453
 
@@ -525,19 +521,19 @@
525
521
  line-height: var(--zw-line-height-xxs);
526
522
  }
527
523
 
528
- .zw-style-preset-control[data-v-39d20a0e] {
524
+ .zw-style-preset-control[data-v-2893d64e] {
529
525
  display: flex;
530
526
  align-items: center;
531
527
  }
532
- .zw-style-preset-control__dropdown[data-v-39d20a0e] {
528
+ .zw-style-preset-control__dropdown[data-v-2893d64e] {
533
529
  width: 96px;
534
530
  }
535
- .zw-style-preset-control__reset[data-v-39d20a0e] {
531
+ .zw-style-preset-control__reset[data-v-2893d64e] {
536
532
  color: rgb(var(--zw-color-n70));
537
533
  }
538
- .zw-style-preset-control__reset[data-v-39d20a0e]:not(:disabled):hover,
539
- .zw-style-preset-control__reset[data-v-39d20a0e]:not(:disabled):focus,
540
- .zw-style-preset-control__reset[data-v-39d20a0e]:not(:disabled):focus-within {
534
+ .zw-style-preset-control__reset[data-v-2893d64e]:not(:disabled):hover,
535
+ .zw-style-preset-control__reset[data-v-2893d64e]:not(:disabled):focus,
536
+ .zw-style-preset-control__reset[data-v-2893d64e]:not(:disabled):focus-within {
541
537
  color: rgb(var(--zw-color-white));
542
538
  }
543
539
 
@@ -576,49 +572,47 @@
576
572
  margin-left: var(--zw-offset-sm);
577
573
  }
578
574
 
579
- .zpa-list-control[data-v-ce2b1130] {
575
+ .zpa-list-control[data-v-2eeb2252] {
580
576
  display: flex;
581
577
  }
582
- .zpa-list-control[data-v-ce2b1130]:hover {
578
+ .zpa-list-control[data-v-2eeb2252]:hover {
583
579
  color: rgb(var(--zw-color-white));
584
580
  background-color: rgb(var(--zw-color-n5));
585
581
  }
586
- .zw-list-control__activator[data-v-ce2b1130] {
582
+ .zw-list-control__activator[data-v-2eeb2252] {
587
583
  padding: 0 var(--zw-offset-xs);
588
584
  }
589
- .zw-list-control__option[data-v-ce2b1130] {
585
+ .zw-list-control__option[data-v-2eeb2252] {
590
586
  padding: 0 var(--zw-offset-xs);
591
587
  display: flex;
592
588
  }
593
589
 
594
- .zw-link-modal-header[data-v-0a202ba4] {
590
+ .zw-link-modal-header[data-v-7dbfe03f] {
595
591
  display: flex;
596
592
  align-items: center;
597
593
  justify-content: space-between;
598
594
  padding: var(--zw-offset-sm);
599
595
  border-bottom: 2px solid rgb(var(--zw-color-n5));
600
596
  }
601
- .zw-link-modal-header__title[data-v-0a202ba4] {
597
+ .zw-link-modal-header__title[data-v-7dbfe03f] {
602
598
  text-transform: uppercase;
603
599
  font-weight: var(--zw-font-weight-semibold);
604
600
  font-size: var(--zw-font-size-xxs);
605
601
  color: rgb(var(--zw-color-white));
606
602
  }
607
- .zw-link-modal-header__unlink-icon[data-v-0a202ba4] {
603
+ .zw-link-modal-header__unlink-icon[data-v-7dbfe03f] {
608
604
  margin-right: var(--zw-offset-xxs);
609
605
  }
610
- .zw-link-modal-header__unlink-button[data-v-0a202ba4] {
606
+ .zw-link-modal-header__unlink-button[data-v-7dbfe03f] {
611
607
  color: rgb(var(--zw-color-n80));
612
608
  font-size: var(--zw-font-size-xxs);
613
- transition: 0.1s opacity ease-out, 0.1s color ease-out;
614
- will-change: opacity, color;
609
+ transition: 0.1s opacity ease-out;
610
+ will-change: opacity;
615
611
  }
616
- .zw-link-modal-header__unlink-button[data-v-0a202ba4]:disabled {
612
+ .zw-link-modal-header__unlink-button[data-v-7dbfe03f]:disabled {
617
613
  opacity: 0.35;
618
614
  }
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 {
615
+ .zw-link-modal-header__unlink-button[data-v-7dbfe03f]:hover {
622
616
  color: rgb(var(--zw-color-white));
623
617
  }
624
618
 
package/dist/wysiwyg.mjs CHANGED
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { computed, ref, watch, inject, onUnmounted, nextTick, provide, onMounted, toRef, reactive } from "vue";
7
+ import { computed, ref, watch, inject, onUnmounted, nextTick, provide, onMounted, toRef, unref, reactive } from "vue";
8
8
  import { ColorModel, ZipifyColorPicker } from "@zipify/colorpicker";
9
9
  function OrderedMap(content) {
10
10
  this.content = content;
@@ -19903,7 +19903,7 @@ var __component__$y = /* @__PURE__ */ normalizeComponent(
19903
19903
  staticRenderFns$y,
19904
19904
  false,
19905
19905
  __vue2_injectStyles$y,
19906
- "20ee36c3",
19906
+ "7bbd0125",
19907
19907
  null,
19908
19908
  null
19909
19909
  );
@@ -19965,7 +19965,7 @@ var __component__$x = /* @__PURE__ */ normalizeComponent(
19965
19965
  staticRenderFns$x,
19966
19966
  false,
19967
19967
  __vue2_injectStyles$x,
19968
- "c9d1da12",
19968
+ "15e487f5",
19969
19969
  null,
19970
19970
  null
19971
19971
  );
@@ -20683,11 +20683,11 @@ const __vue2_script$p = {
20683
20683
  const preset = editor.commands.getPreset();
20684
20684
  const customization = editor.commands.getPresetCustomization();
20685
20685
  const isCustomized = computed(() => {
20686
- const { attributes, marks } = customization.value;
20686
+ const { attributes, marks } = unref(customization);
20687
20687
  return !!attributes.length || !!marks.length;
20688
20688
  });
20689
20689
  const options = computed(() => {
20690
- return presets.value.map((preset2) => ({
20690
+ return unref(presets).map((preset2) => ({
20691
20691
  id: preset2.id,
20692
20692
  title: preset2.name
20693
20693
  }));
@@ -20712,7 +20712,7 @@ var __component__$p = /* @__PURE__ */ normalizeComponent(
20712
20712
  staticRenderFns$p,
20713
20713
  false,
20714
20714
  __vue2_injectStyles$p,
20715
- "39d20a0e",
20715
+ "2893d64e",
20716
20716
  null,
20717
20717
  null
20718
20718
  );
@@ -20876,7 +20876,7 @@ const __vue2_script$n = {
20876
20876
  setup() {
20877
20877
  const editor = inject(InjectionTokens$1.EDITOR);
20878
20878
  const font = editor.commands.getFont();
20879
- const options = computed(() => font.value.weights.map((style2) => ({ id: style2 })));
20879
+ const options = computed(() => unref(font).weights.map((style2) => ({ id: style2 })));
20880
20880
  const currentValue = editor.commands.getFontWeight();
20881
20881
  const apply2 = (value) => editor.chain().focus().applyFontWeight(value).run();
20882
20882
  return {
@@ -21249,7 +21249,7 @@ const __vue2_script$i = {
21249
21249
  },
21250
21250
  setup() {
21251
21251
  const editor = inject(InjectionTokens$1.EDITOR);
21252
- const currentValue = computed(() => editor.commands.isUnderline().value);
21252
+ const currentValue = editor.commands.isUnderline();
21253
21253
  const apply2 = () => editor.chain().focus().toggleUnderline().run();
21254
21254
  return {
21255
21255
  currentValue,
@@ -21901,10 +21901,10 @@ const __vue2_script$b = {
21901
21901
  setup() {
21902
21902
  const editor = inject(InjectionTokens$1.EDITOR);
21903
21903
  const selectionValue = editor.commands.getListType();
21904
- const isList2 = computed(() => !!selectionValue.value);
21905
- const currentValue = computed(() => selectionValue.value || "none");
21904
+ const isList2 = computed(() => !!unref(selectionValue));
21905
+ const currentValue = computed(() => unref(selectionValue) || "none");
21906
21906
  const recentListType = ref(ListTypes.DISC);
21907
- const isCurrentListSelected = computed(() => selectionValue.value === recentListType.value);
21907
+ const isCurrentListSelected = computed(() => unref(selectionValue) === recentListType.value);
21908
21908
  const currentIcon = computed(() => `list-${recentListType.value}`);
21909
21909
  const apply2 = (type) => {
21910
21910
  recentListType.value = type;
@@ -21928,7 +21928,7 @@ var __component__$b = /* @__PURE__ */ normalizeComponent(
21928
21928
  staticRenderFns$b,
21929
21929
  false,
21930
21930
  __vue2_injectStyles$b,
21931
- "ce2b1130",
21931
+ "2eeb2252",
21932
21932
  null,
21933
21933
  null
21934
21934
  );
@@ -22045,7 +22045,7 @@ var __component__$9 = /* @__PURE__ */ normalizeComponent(
22045
22045
  staticRenderFns$9,
22046
22046
  false,
22047
22047
  __vue2_injectStyles$9,
22048
- "0a202ba4",
22048
+ "7dbfe03f",
22049
22049
  null,
22050
22050
  null
22051
22051
  );
@@ -22876,7 +22876,7 @@ const FontFamily = Mark.create({
22876
22876
  applyFontFamily: createCommand(({ commands: commands2 }, value) => {
22877
22877
  commands2.setMark(this.name, { value });
22878
22878
  const font = commands2.findFontByName(value);
22879
- let fontWeight = commands2.getFontWeight().value;
22879
+ let fontWeight = unref(commands2.getFontWeight());
22880
22880
  if (!font.isWeightSupported(fontWeight)) {
22881
22881
  fontWeight = font.findClosestWeight(fontWeight);
22882
22882
  commands2.applyFontWeight(fontWeight);
@@ -22887,7 +22887,7 @@ const FontFamily = Mark.create({
22887
22887
  }),
22888
22888
  getFont: createCommand(({ commands: commands2 }) => {
22889
22889
  const fontFamily = commands2.getFontFamily();
22890
- return computed(() => commands2.findFontByName(fontFamily.value));
22890
+ return computed(() => commands2.findFontByName(unref(fontFamily)));
22891
22891
  }),
22892
22892
  findFontByName: createCommand((_, name) => {
22893
22893
  return this.options.fonts.find((font) => font.name === name);
@@ -22896,12 +22896,12 @@ const FontFamily = Mark.create({
22896
22896
  const defaultValue = commands2.getDefaultFontFamily();
22897
22897
  return computed(() => {
22898
22898
  var _a, _b;
22899
- return (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a.value) != null ? _b : defaultValue.value;
22899
+ return (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a.value) != null ? _b : unref(defaultValue);
22900
22900
  });
22901
22901
  }),
22902
22902
  getDefaultFontFamily: createCommand(({ commands: commands2 }) => {
22903
22903
  const preset = commands2.getPreset();
22904
- return computed(() => preset.value.common.font_family);
22904
+ return computed(() => unref(preset).common.font_family);
22905
22905
  })
22906
22906
  };
22907
22907
  },
@@ -23018,7 +23018,7 @@ const StylePreset = Extension.create({
23018
23018
  isRequired: false,
23019
23019
  default: { id: this.options.defaultId },
23020
23020
  parseHTML: (element) => {
23021
- const presets = this.options.presets.value || this.options.presets;
23021
+ const presets = unref(this.options.presets);
23022
23022
  if (element.parentElement.tagName === "LI")
23023
23023
  return null;
23024
23024
  for (const { id: id2, node, fallbackClass } of presets) {
@@ -23054,11 +23054,11 @@ const StylePreset = Extension.create({
23054
23054
  getPreset: createCommand(({ commands: commands2 }) => {
23055
23055
  const selection = commands2.getBlockAttributes("preset", { id: this.options.defaultId });
23056
23056
  const presets = commands2.getPresetList();
23057
- return computed(() => findPresetById(presets.value, selection.value.id));
23057
+ return computed(() => findPresetById(unref(presets), unref(selection).id));
23058
23058
  }),
23059
23059
  applyPreset: createCommand(({ commands: commands2, chain }, presetId) => {
23060
23060
  var _a, _b;
23061
- const presets = commands2.getPresetList().value;
23061
+ const presets = unref(commands2.getPresetList());
23062
23062
  const preset = findPresetById(presets, presetId);
23063
23063
  const nodeType = (_b = (_a = preset.node) == null ? void 0 : _a.type) != null ? _b : NodeTypes.PARAGRAPH;
23064
23064
  const attrs = {
@@ -23068,7 +23068,7 @@ const StylePreset = Extension.create({
23068
23068
  attrs.level = preset.node.level;
23069
23069
  }
23070
23070
  for (const textAttribute of TextSettings.attributes) {
23071
- attrs[textAttribute] = commands2.getBlockAttributes(textAttribute).value;
23071
+ attrs[textAttribute] = unref(commands2.getBlockAttributes(textAttribute));
23072
23072
  }
23073
23073
  chain().removeList().setNode(nodeType, attrs).run();
23074
23074
  }),
@@ -23144,14 +23144,14 @@ const FontWeight = Mark.create({
23144
23144
  return {
23145
23145
  applyFontWeight: createCommand(({ commands: commands2 }, value) => {
23146
23146
  commands2.setMark(this.name, { value });
23147
- const font = commands2.getFont().value;
23147
+ const font = unref(commands2.getFont());
23148
23148
  if (!font.isItalicSupported(value)) {
23149
23149
  commands2.removeItalic();
23150
23150
  }
23151
23151
  }),
23152
23152
  toggleBold: createCommand(({ commands: commands2 }) => {
23153
- const currentWeight = commands2.getFontWeight().value;
23154
- const currentFont = commands2.getFont().value;
23153
+ const currentWeight = unref(commands2.getFontWeight());
23154
+ const currentFont = unref(commands2.getFont());
23155
23155
  const isBold = Number(currentWeight) >= 600;
23156
23156
  const wantedWeight = isBold ? "400" : "700";
23157
23157
  const nextWeight = currentFont.findClosestWeight(wantedWeight);
@@ -23159,19 +23159,20 @@ const FontWeight = Mark.create({
23159
23159
  }),
23160
23160
  getFontWeight: createCommand(({ editor, commands: commands2 }) => {
23161
23161
  const defaultValue = commands2.getDefaultFontWeight();
23162
- const font = commands2.getFont();
23162
+ const fontRef = commands2.getFont();
23163
23163
  return computed(() => {
23164
23164
  var _a, _b;
23165
- const weight = (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a.value) != null ? _b : defaultValue.value;
23166
- if (font.value.isWeightSupported(weight)) {
23165
+ const weight = (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a.value) != null ? _b : unref(defaultValue);
23166
+ const font = unref(fontRef);
23167
+ if (font.isWeightSupported(weight)) {
23167
23168
  return weight;
23168
23169
  }
23169
- return font.value.findClosestWeight(weight);
23170
+ return font.findClosestWeight(weight);
23170
23171
  });
23171
23172
  }),
23172
23173
  getDefaultFontWeight: createCommand(({ commands: commands2 }) => {
23173
23174
  const preset = commands2.getPreset();
23174
- return computed(() => preset.value.common.font_weight);
23175
+ return computed(() => unref(preset).common.font_weight);
23175
23176
  })
23176
23177
  };
23177
23178
  },
@@ -23226,25 +23227,25 @@ const FontSize = Mark.create({
23226
23227
  const defaultValue = commands2.getDefaultFontSize();
23227
23228
  return computed(() => {
23228
23229
  var _a, _b;
23229
- return (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a[device.value]) != null ? _b : defaultValue.value;
23230
+ return (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a[unref(device)]) != null ? _b : unref(defaultValue);
23230
23231
  });
23231
23232
  }),
23232
23233
  getDefaultFontSize: createCommand(({ commands: commands2 }) => {
23233
23234
  const device = commands2.getDevice();
23234
23235
  const preset = commands2.getPreset();
23235
- return computed(() => preset.value[device.value].font_size.replace("px", ""));
23236
+ return computed(() => unref(preset)[unref(device)].font_size.replace("px", ""));
23236
23237
  }),
23237
23238
  applyFontSize: createCommand(({ commands: commands2 }, value) => {
23238
- const device = commands2.getDevice().value;
23239
+ const device = unref(commands2.getDevice());
23239
23240
  commands2.setMark(this.name, { [device]: value });
23240
23241
  }),
23241
23242
  increaseFontSize: createCommand(({ commands: commands2 }) => {
23242
- const size2 = Number(commands2.getFontSize().value);
23243
+ const size2 = Number(unref(commands2.getFontSize()));
23243
23244
  const nextSize = Math.min(size2 + 1, this.options.maxSize);
23244
23245
  commands2.applyFontSize(String(nextSize));
23245
23246
  }),
23246
23247
  decreaseFontSize: createCommand(({ commands: commands2 }) => {
23247
- const size2 = Number(commands2.getFontSize().value);
23248
+ const size2 = Number(unref(commands2.getFontSize()));
23248
23249
  const nextSize = Math.max(size2 - 1, this.options.minSize);
23249
23250
  commands2.applyFontSize(String(nextSize));
23250
23251
  })
@@ -23258,7 +23259,7 @@ const FontSize = Mark.create({
23258
23259
  const parseSize = (value) => {
23259
23260
  if (!value)
23260
23261
  return null;
23261
- const wrapperEl = this.options.wrapperRef.value || this.options.wrapperRef;
23262
+ const wrapperEl = unref(this.options.wrapperRef);
23262
23263
  const converted = convertFontSize(value, wrapperEl);
23263
23264
  return String(converted);
23264
23265
  };
@@ -23300,12 +23301,12 @@ const FontColor = Mark.create({
23300
23301
  const defaultValue = commands2.getDefaultFontColor();
23301
23302
  return computed(() => {
23302
23303
  var _a, _b;
23303
- return (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a.value) != null ? _b : defaultValue.value;
23304
+ return (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a.value) != null ? _b : unref(defaultValue);
23304
23305
  });
23305
23306
  }),
23306
23307
  getDefaultFontColor: createCommand(({ commands: commands2 }) => {
23307
23308
  const preset = commands2.getPreset();
23308
- return computed(() => preset.value.common.color);
23309
+ return computed(() => unref(preset).common.color);
23309
23310
  }),
23310
23311
  applyFontColor: createCommand(({ commands: commands2 }, value) => {
23311
23312
  commands2.setMark(this.name, { value });
@@ -23383,25 +23384,25 @@ const FontStyle = Mark.create({
23383
23384
  const defaultValue = commands2.getDefaultFontStyle();
23384
23385
  return computed(() => {
23385
23386
  var _a, _b;
23386
- return (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a.italic) != null ? _b : defaultValue.value.italic;
23387
+ return (_b = (_a = editor.getAttributes(this.name)) == null ? void 0 : _a.italic) != null ? _b : unref(defaultValue).italic;
23387
23388
  });
23388
23389
  }),
23389
23390
  isItalicAvailable: createCommand(({ commands: commands2 }) => {
23390
23391
  const font = commands2.getFont();
23391
23392
  const fontWeight = commands2.getFontWeight();
23392
- return computed(() => font.value.isItalicSupported(fontWeight.value));
23393
+ return computed(() => unref(font).isItalicSupported(unref(fontWeight)));
23393
23394
  }),
23394
23395
  getDefaultFontStyle: createCommand(({ commands: commands2 }) => {
23395
23396
  const preset = commands2.getPreset();
23396
23397
  return computed(() => ({
23397
- italic: preset.value.common.font_style === "italic"
23398
+ italic: unref(preset).common.font_style === "italic"
23398
23399
  }));
23399
23400
  }),
23400
23401
  toggleItalic: createCommand(({ commands: commands2 }) => {
23401
- const isItalicAvailable = this.editor.commands.isItalicAvailable();
23402
- if (!isItalicAvailable.value)
23402
+ const isItalicAvailable = unref(this.editor.commands.isItalicAvailable());
23403
+ if (!isItalicAvailable)
23403
23404
  return;
23404
- commands2.isItalic().value ? commands2.removeItalic() : commands2.applyItalic();
23405
+ unref(commands2.isItalic()) ? commands2.removeItalic() : commands2.applyItalic();
23405
23406
  }),
23406
23407
  applyItalic: createCommand(({ commands: commands2 }) => {
23407
23408
  commands2.setMark(this.name, { italic: true });
@@ -23447,11 +23448,11 @@ const TextDecoration = Mark.create({
23447
23448
  return {
23448
23449
  isUnderline: createCommand(({ commands: commands2, editor }) => {
23449
23450
  const decoration = commands2.getTextDecoration();
23450
- return computed(() => editor.isActive("link") || decoration.value.underline);
23451
+ return computed(() => editor.isActive("link") || unref(decoration).underline);
23451
23452
  }),
23452
23453
  isStrikeThrough: createCommand(({ commands: commands2 }) => {
23453
23454
  const decoration = commands2.getTextDecoration();
23454
- return computed(() => decoration.value.strike_through);
23455
+ return computed(() => unref(decoration).strike_through);
23455
23456
  }),
23456
23457
  getTextDecoration: createCommand(({ editor, commands: commands2 }) => {
23457
23458
  const defaultValue = commands2.getDefaultTextDecoration();
@@ -23459,15 +23460,15 @@ const TextDecoration = Mark.create({
23459
23460
  var _a, _b, _c;
23460
23461
  const attrs = (_a = editor.getAttributes(this.name)) != null ? _a : {};
23461
23462
  return {
23462
- underline: (_b = attrs.underline) != null ? _b : defaultValue.value.underline,
23463
- strike_through: (_c = attrs.strike_through) != null ? _c : defaultValue.value.strike_through
23463
+ underline: (_b = attrs.underline) != null ? _b : unref(defaultValue).underline,
23464
+ strike_through: (_c = attrs.strike_through) != null ? _c : unref(defaultValue).strike_through
23464
23465
  };
23465
23466
  });
23466
23467
  }),
23467
23468
  getDefaultTextDecoration: createCommand(({ commands: commands2 }) => {
23468
23469
  const preset = commands2.getPreset();
23469
23470
  return computed(() => {
23470
- const decoration = preset.value.common.text_decoration;
23471
+ const decoration = unref(preset).common.text_decoration;
23471
23472
  return {
23472
23473
  underline: decoration.includes("underline"),
23473
23474
  strike_through: decoration.includes("line-through")
@@ -23483,7 +23484,7 @@ const TextDecoration = Mark.create({
23483
23484
  commands2.toggleTextDecoration("strike_through");
23484
23485
  }),
23485
23486
  toggleTextDecoration: createCommand(({ commands: commands2 }, name) => {
23486
- const isEnabled = commands2.getTextDecoration().value[name];
23487
+ const isEnabled = unref(commands2.getTextDecoration())[name];
23487
23488
  isEnabled ? commands2.removeTextDecoration(name) : commands2.applyTextDecoration(name);
23488
23489
  }),
23489
23490
  applyTextDecoration: createCommand(({ commands: commands2 }, name) => {
@@ -23491,7 +23492,7 @@ const TextDecoration = Mark.create({
23491
23492
  }),
23492
23493
  removeTextDecoration: createCommand(({ commands: commands2 }, name) => {
23493
23494
  const mark = {
23494
- ...commands2.getTextDecoration().value,
23495
+ ...unref(commands2.getTextDecoration()),
23495
23496
  [name]: false
23496
23497
  };
23497
23498
  const isRemoveMark = !mark.underline && !mark.strike_through;
@@ -23621,7 +23622,7 @@ const Alignment = Extension.create({
23621
23622
  addCommands() {
23622
23623
  return {
23623
23624
  applyAlignment: createCommand(({ commands: commands2 }, value) => {
23624
- const device = commands2.getDevice().value;
23625
+ const device = unref(commands2.getDevice());
23625
23626
  commands2.setBlockAttributes(this.name, { [device]: value }, DEFAULTS$1);
23626
23627
  }),
23627
23628
  getAlignment: createCommand(({ commands: commands2 }) => {
@@ -23630,13 +23631,13 @@ const Alignment = Extension.create({
23630
23631
  const defaultValue = commands2.getDefaultAlignment();
23631
23632
  return computed(() => {
23632
23633
  var _a, _b;
23633
- return (_b = (_a = attribute.value) == null ? void 0 : _a[device.value]) != null ? _b : defaultValue.value;
23634
+ return (_b = (_a = unref(attribute)) == null ? void 0 : _a[unref(device)]) != null ? _b : unref(defaultValue);
23634
23635
  });
23635
23636
  }),
23636
23637
  getDefaultAlignment: createCommand(({ commands: commands2 }) => {
23637
23638
  const device = commands2.getDevice();
23638
23639
  const preset = commands2.getPreset();
23639
- return computed(() => preset.value[device.value].alignment);
23640
+ return computed(() => unref(preset)[unref(device)].alignment);
23640
23641
  })
23641
23642
  };
23642
23643
  },
@@ -23671,7 +23672,7 @@ const LineHeight = Extension.create({
23671
23672
  const value = element.style.lineHeight;
23672
23673
  if (!value)
23673
23674
  return null;
23674
- const wrapperEl = this.options.wrapperRef.value || this.options.wrapperRef;
23675
+ const wrapperEl = unref(this.options.wrapperRef);
23675
23676
  const converted = convertLineHeight(value, element, wrapperEl);
23676
23677
  return { desktop: converted, tablet: converted, mobile: converted };
23677
23678
  },
@@ -23697,16 +23698,16 @@ const LineHeight = Extension.create({
23697
23698
  const defaultValue = commands2.getDefaultLineHeight();
23698
23699
  return computed(() => {
23699
23700
  var _a, _b;
23700
- return (_b = (_a = attribute.value) == null ? void 0 : _a[device.value]) != null ? _b : defaultValue.value;
23701
+ return (_b = (_a = unref(attribute)) == null ? void 0 : _a[unref(device)]) != null ? _b : unref(defaultValue);
23701
23702
  });
23702
23703
  }),
23703
23704
  getDefaultLineHeight: createCommand(({ commands: commands2 }) => {
23704
23705
  const device = commands2.getDevice();
23705
23706
  const preset = commands2.getPreset();
23706
- return computed(() => preset.value[device.value].line_height);
23707
+ return computed(() => unref(preset)[unref(device)].line_height);
23707
23708
  }),
23708
23709
  applyLineHeight: createCommand(({ commands: commands2 }, value) => {
23709
- const device = commands2.getDevice().value;
23710
+ const device = unref(commands2.getDevice());
23710
23711
  commands2.setBlockAttributes(this.name, { [device]: value }, DEFAULTS);
23711
23712
  })
23712
23713
  };
@@ -23803,11 +23804,11 @@ const List = Node$1.create({
23803
23804
  const attribute = commands2.getBlockAttributes("bullet", { type: null });
23804
23805
  return computed(() => {
23805
23806
  var _a;
23806
- return (_a = attribute.value.type) != null ? _a : null;
23807
+ return (_a = unref(attribute).type) != null ? _a : null;
23807
23808
  });
23808
23809
  }),
23809
23810
  applyList: createCommand(({ commands: commands2, chain }, type) => {
23810
- const currentType = commands2.getListType().value;
23811
+ const currentType = unref(commands2.getListType());
23811
23812
  if (currentType === type) {
23812
23813
  commands2.applyDefaultPreset();
23813
23814
  return;
@@ -24840,7 +24841,7 @@ const Link = Link$1.extend({
24840
24841
  if (!href.startsWith("#"))
24841
24842
  return LinkDestinations.URL;
24842
24843
  const id2 = href.replace("#", "");
24843
- const blocks = this.options.pageBlocks.value || this.options.pageBlocks;
24844
+ const blocks = unref(this.options.pageBlocks);
24844
24845
  const block = blocks.find((block2) => block2.id === parseInt(id2));
24845
24846
  return block ? LinkDestinations.BLOCK : LinkDestinations.URL;
24846
24847
  }
@@ -25583,7 +25584,7 @@ const NodeProcessor = Extension.create({
25583
25584
  return {
25584
25585
  setBlockAttributes: createCommand(({ commands: commands2 }, name, attrs, defaults2 = {}) => {
25585
25586
  var _a;
25586
- const current = (_a = commands2.getBlockAttributes(name).value) != null ? _a : {};
25587
+ const current = (_a = unref(commands2.getBlockAttributes(name))) != null ? _a : {};
25587
25588
  for (const type of NodeTypes.blocks) {
25588
25589
  commands2.updateAttributes(type, {
25589
25590
  [name]: { ...defaults2, ...current, ...attrs }
@@ -45,9 +45,7 @@ export default {
45
45
  box-shadow: inset 0 0 0 2px currentColor;
46
46
  }
47
47
 
48
- .zw-checkbox:hover .zw-checkbox__indicator,
49
- .zw-checkbox:focus .zw-checkbox__indicator,
50
- .zw-checkbox:focus-within .zw-checkbox__indicator {
48
+ .zw-checkbox:hover .zw-checkbox__indicator {
51
49
  box-shadow: inset 0 0 0 2px rgb(var(--zw-color-green));
52
50
  }
53
51
 
@@ -78,8 +78,6 @@ export default {
78
78
  outline: none;
79
79
  padding: 6px;
80
80
  line-height: var(--zw-line-height-xxs);
81
- transition: 0.1s border ease-out, 0.1s color ease-out;
82
- will-change: border, color;
83
81
  }
84
82
 
85
83
  .zw-field__input:hover {
@@ -8,7 +8,7 @@
8
8
  </template>
9
9
 
10
10
  <script>
11
- import { computed, inject } from 'vue';
11
+ import { computed, inject, unref } from 'vue';
12
12
  import { InjectionTokens } from '../../../injectionTokens';
13
13
  import { Dropdown } from '../../base';
14
14
  import { tooltip } from '../../../directives';
@@ -28,7 +28,7 @@ export default {
28
28
  const editor = inject(InjectionTokens.EDITOR);
29
29
  const font = editor.commands.getFont();
30
30
 
31
- const options = computed(() => font.value.weights.map((style) => ({ id: style })));
31
+ const options = computed(() => unref(font).weights.map((style) => ({ id: style })));
32
32
  const currentValue = editor.commands.getFontWeight();
33
33
 
34
34
  const apply = (value) => editor.chain().focus().applyFontWeight(value).run();
@@ -45,7 +45,7 @@
45
45
  </template>
46
46
 
47
47
  <script>
48
- import { computed, inject, ref } from 'vue';
48
+ import { computed, inject, ref, unref } from 'vue';
49
49
  import { InjectionTokens } from '../../../injectionTokens';
50
50
  import { Dropdown, DropdownOption, Button, Icon } from '../../base';
51
51
  import { ListTypes } from '../../../enums';
@@ -73,10 +73,10 @@ export default {
73
73
  setup() {
74
74
  const editor = inject(InjectionTokens.EDITOR);
75
75
  const selectionValue = editor.commands.getListType();
76
- const isList = computed(() => !!selectionValue.value);
77
- const currentValue = computed(() => selectionValue.value || 'none');
76
+ const isList = computed(() => !!unref(selectionValue));
77
+ const currentValue = computed(() => unref(selectionValue) || 'none');
78
78
  const recentListType = ref(ListTypes.DISC);
79
- const isCurrentListSelected = computed(() => selectionValue.value === recentListType.value);
79
+ const isCurrentListSelected = computed(() => unref(selectionValue) === recentListType.value);
80
80
 
81
81
  const currentIcon = computed(() => `list-${recentListType.value}`);
82
82
 
@@ -21,7 +21,7 @@
21
21
  </template>
22
22
 
23
23
  <script>
24
- import { computed, inject } from 'vue';
24
+ import { computed, inject, unref } from 'vue';
25
25
  import { InjectionTokens } from '../../../injectionTokens';
26
26
  import { Dropdown, Button, Icon } from '../../base';
27
27
  import { tooltip } from '../../../directives';
@@ -50,13 +50,13 @@ export default {
50
50
  const customization = editor.commands.getPresetCustomization();
51
51
 
52
52
  const isCustomized = computed(() => {
53
- const { attributes, marks } = customization.value;
53
+ const { attributes, marks } = unref(customization);
54
54
 
55
55
  return !!attributes.length || !!marks.length;
56
56
  });
57
57
 
58
58
  const options = computed(() => {
59
- return presets.value.map((preset) => ({
59
+ return unref(presets).map((preset) => ({
60
60
  id: preset.id,
61
61
  title: preset.name
62
62
  }));
@@ -11,7 +11,7 @@
11
11
  </template>
12
12
 
13
13
  <script>
14
- import { inject, computed } from 'vue';
14
+ import { inject } from 'vue';
15
15
  import { Button, Icon } from '../../base';
16
16
  import { InjectionTokens } from '../../../injectionTokens';
17
17
  import { tooltip } from '../../../directives';
@@ -31,7 +31,7 @@ export default {
31
31
  setup() {
32
32
  const editor = inject(InjectionTokens.EDITOR);
33
33
 
34
- const currentValue = computed(() => editor.commands.isUnderline().value);
34
+ const currentValue = editor.commands.isUnderline();
35
35
  const apply = () => editor.chain().focus().toggleUnderline().run();
36
36
 
37
37
  return {
@@ -53,16 +53,14 @@ export default {
53
53
  .zw-link-modal-header__unlink-button {
54
54
  color: rgb(var(--zw-color-n80));
55
55
  font-size: var(--zw-font-size-xxs);
56
- transition: 0.1s opacity ease-out, 0.1s color ease-out;
57
- will-change: opacity, color;
56
+ transition: 0.1s opacity ease-out;
57
+ will-change: opacity;
58
58
  }
59
59
 
60
60
  .zw-link-modal-header__unlink-button:disabled {
61
61
  opacity: 0.35;
62
62
  }
63
63
 
64
- .zw-link-modal-header__unlink-button:focus,
65
- .zw-link-modal-header__unlink-button:focus-within,
66
64
  .zw-link-modal-header__unlink-button:hover {
67
65
  color: rgb(var(--zw-color-white));
68
66
  }
@@ -1,5 +1,5 @@
1
1
  import { Extension } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { convertAlignment, createCommand, createKeyboardShortcut, renderInlineSetting } from '../utils';
4
4
  import { Alignments, NodeTypes, TextSettings } from '../enums';
5
5
 
@@ -56,7 +56,7 @@ export const Alignment = Extension.create({
56
56
  addCommands() {
57
57
  return {
58
58
  applyAlignment: createCommand(({ commands }, value) => {
59
- const device = commands.getDevice().value;
59
+ const device = unref(commands.getDevice());
60
60
 
61
61
  commands.setBlockAttributes(this.name, { [device]: value }, DEFAULTS);
62
62
  }),
@@ -66,14 +66,14 @@ export const Alignment = Extension.create({
66
66
  const device = commands.getDevice();
67
67
  const defaultValue = commands.getDefaultAlignment();
68
68
 
69
- return computed(() => attribute.value?.[device.value] ?? defaultValue.value);
69
+ return computed(() => unref(attribute)?.[unref(device)] ?? unref(defaultValue));
70
70
  }),
71
71
 
72
72
  getDefaultAlignment: createCommand(({ commands }) => {
73
73
  const device = commands.getDevice();
74
74
  const preset = commands.getPreset();
75
75
 
76
- return computed(() => preset.value[device.value].alignment);
76
+ return computed(() => unref(preset)[unref(device)].alignment);
77
77
  })
78
78
  };
79
79
  },
@@ -1,5 +1,5 @@
1
1
  import { Mark } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { convertColor, createCommand, renderMark } from '../utils';
4
4
  import { TextSettings } from '../enums';
5
5
 
@@ -15,13 +15,13 @@ export const FontColor = Mark.create({
15
15
  getFontColor: createCommand(({ commands, editor }) => {
16
16
  const defaultValue = commands.getDefaultFontColor();
17
17
 
18
- return computed(() => editor.getAttributes(this.name)?.value ?? defaultValue.value);
18
+ return computed(() => editor.getAttributes(this.name)?.value ?? unref(defaultValue));
19
19
  }),
20
20
 
21
21
  getDefaultFontColor: createCommand(({ commands }) => {
22
22
  const preset = commands.getPreset();
23
23
 
24
- return computed(() => preset.value.common.color);
24
+ return computed(() => unref(preset).common.color);
25
25
  }),
26
26
 
27
27
  applyFontColor: createCommand(({ commands }, value) => {
@@ -1,5 +1,5 @@
1
1
  import { Mark } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { createCommand, renderMark } from '../utils';
4
4
  import { TextSettings } from '../enums';
5
5
 
@@ -21,7 +21,7 @@ export const FontFamily = Mark.create({
21
21
  commands.setMark(this.name, { value });
22
22
 
23
23
  const font = commands.findFontByName(value);
24
- let fontWeight = commands.getFontWeight().value;
24
+ let fontWeight = unref(commands.getFontWeight());
25
25
 
26
26
  if (!font.isWeightSupported(fontWeight)) {
27
27
  fontWeight = font.findClosestWeight(fontWeight);
@@ -36,7 +36,7 @@ export const FontFamily = Mark.create({
36
36
  getFont: createCommand(({ commands }) => {
37
37
  const fontFamily = commands.getFontFamily();
38
38
 
39
- return computed(() => commands.findFontByName(fontFamily.value));
39
+ return computed(() => commands.findFontByName(unref(fontFamily)));
40
40
  }),
41
41
 
42
42
  findFontByName: createCommand((_, name) => {
@@ -46,13 +46,13 @@ export const FontFamily = Mark.create({
46
46
  getFontFamily: createCommand(({ editor, commands }) => {
47
47
  const defaultValue = commands.getDefaultFontFamily();
48
48
 
49
- return computed(() => editor.getAttributes(this.name)?.value ?? defaultValue.value);
49
+ return computed(() => editor.getAttributes(this.name)?.value ?? unref(defaultValue));
50
50
  }),
51
51
 
52
52
  getDefaultFontFamily: createCommand(({ commands }) => {
53
53
  const preset = commands.getPreset();
54
54
 
55
- return computed(() => preset.value.common.font_family);
55
+ return computed(() => unref(preset).common.font_family);
56
56
  })
57
57
  };
58
58
  },
@@ -1,5 +1,5 @@
1
1
  import { Mark } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { convertFontSize, createCommand, createKeyboardShortcut, renderMark } from '../utils';
4
4
  import { TextSettings } from '../enums';
5
5
 
@@ -25,31 +25,31 @@ export const FontSize = Mark.create({
25
25
  const device = commands.getDevice();
26
26
  const defaultValue = commands.getDefaultFontSize();
27
27
 
28
- return computed(() => editor.getAttributes(this.name)?.[device.value] ?? defaultValue.value);
28
+ return computed(() => editor.getAttributes(this.name)?.[unref(device)] ?? unref(defaultValue));
29
29
  }),
30
30
 
31
31
  getDefaultFontSize: createCommand(({ commands }) => {
32
32
  const device = commands.getDevice();
33
33
  const preset = commands.getPreset();
34
34
 
35
- return computed(() => preset.value[device.value].font_size.replace('px', ''));
35
+ return computed(() => unref(preset)[unref(device)].font_size.replace('px', ''));
36
36
  }),
37
37
 
38
38
  applyFontSize: createCommand(({ commands }, value) => {
39
- const device = commands.getDevice().value;
39
+ const device = unref(commands.getDevice());
40
40
 
41
41
  commands.setMark(this.name, { [device]: value });
42
42
  }),
43
43
 
44
44
  increaseFontSize: createCommand(({ commands }) => {
45
- const size = Number(commands.getFontSize().value);
45
+ const size = Number(unref(commands.getFontSize()));
46
46
  const nextSize = Math.min(size + 1, this.options.maxSize);
47
47
 
48
48
  commands.applyFontSize(String(nextSize));
49
49
  }),
50
50
 
51
51
  decreaseFontSize: createCommand(({ commands }) => {
52
- const size = Number(commands.getFontSize().value);
52
+ const size = Number(unref(commands.getFontSize()));
53
53
  const nextSize = Math.max(size - 1, this.options.minSize);
54
54
 
55
55
  commands.applyFontSize(String(nextSize));
@@ -66,7 +66,7 @@ export const FontSize = Mark.create({
66
66
  const parseSize = (value) => {
67
67
  if (!value) return null;
68
68
 
69
- const wrapperEl = this.options.wrapperRef.value || this.options.wrapperRef;
69
+ const wrapperEl = unref(this.options.wrapperRef);
70
70
  const converted = convertFontSize(value, wrapperEl);
71
71
 
72
72
  return String(converted);
@@ -1,5 +1,5 @@
1
1
  import { Mark } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { createCommand, createKeyboardShortcut, renderMark } from '../utils';
4
4
  import { TextSettings } from '../enums';
5
5
 
@@ -15,30 +15,30 @@ export const FontStyle = Mark.create({
15
15
  isItalic: createCommand(({ editor, commands }) => {
16
16
  const defaultValue = commands.getDefaultFontStyle();
17
17
 
18
- return computed(() => editor.getAttributes(this.name)?.italic ?? defaultValue.value.italic);
18
+ return computed(() => editor.getAttributes(this.name)?.italic ?? unref(defaultValue).italic);
19
19
  }),
20
20
 
21
21
  isItalicAvailable: createCommand(({ commands }) => {
22
22
  const font = commands.getFont();
23
23
  const fontWeight = commands.getFontWeight();
24
24
 
25
- return computed(() => font.value.isItalicSupported(fontWeight.value));
25
+ return computed(() => unref(font).isItalicSupported(unref(fontWeight)));
26
26
  }),
27
27
 
28
28
  getDefaultFontStyle: createCommand(({ commands }) => {
29
29
  const preset = commands.getPreset();
30
30
 
31
31
  return computed(() => ({
32
- italic: preset.value.common.font_style === 'italic'
32
+ italic: unref(preset).common.font_style === 'italic'
33
33
  }));
34
34
  }),
35
35
 
36
36
  toggleItalic: createCommand(({ commands }) => {
37
- const isItalicAvailable = this.editor.commands.isItalicAvailable();
37
+ const isItalicAvailable = unref(this.editor.commands.isItalicAvailable());
38
38
 
39
- if (!isItalicAvailable.value) return;
39
+ if (!isItalicAvailable) return;
40
40
 
41
- commands.isItalic().value ? commands.removeItalic() : commands.applyItalic();
41
+ unref(commands.isItalic()) ? commands.removeItalic() : commands.applyItalic();
42
42
  }),
43
43
 
44
44
  applyItalic: createCommand(({ commands }) => {
@@ -1,5 +1,5 @@
1
1
  import { Mark } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { createCommand, createKeyboardShortcut, renderMark } from '../utils';
4
4
  import { TextSettings } from '../enums';
5
5
 
@@ -14,7 +14,7 @@ export const FontWeight = Mark.create({
14
14
  return {
15
15
  applyFontWeight: createCommand(({ commands }, value) => {
16
16
  commands.setMark(this.name, { value });
17
- const font = commands.getFont().value;
17
+ const font = unref(commands.getFont());
18
18
 
19
19
  if (!font.isItalicSupported(value)) {
20
20
  commands.removeItalic();
@@ -22,8 +22,8 @@ export const FontWeight = Mark.create({
22
22
  }),
23
23
 
24
24
  toggleBold: createCommand(({ commands }) => {
25
- const currentWeight = commands.getFontWeight().value;
26
- const currentFont = commands.getFont().value;
25
+ const currentWeight = unref(commands.getFontWeight());
26
+ const currentFont = unref(commands.getFont());
27
27
  const isBold = Number(currentWeight) >= 600;
28
28
  const wantedWeight = isBold ? '400' : '700';
29
29
  const nextWeight = currentFont.findClosestWeight(wantedWeight);
@@ -33,23 +33,24 @@ export const FontWeight = Mark.create({
33
33
 
34
34
  getFontWeight: createCommand(({ editor, commands }) => {
35
35
  const defaultValue = commands.getDefaultFontWeight();
36
- const font = commands.getFont();
36
+ const fontRef = commands.getFont();
37
37
 
38
38
  return computed(() => {
39
- const weight = editor.getAttributes(this.name)?.value ?? defaultValue.value;
39
+ const weight = editor.getAttributes(this.name)?.value ?? unref(defaultValue);
40
+ const font = unref(fontRef);
40
41
 
41
- if (font.value.isWeightSupported(weight)) {
42
+ if (font.isWeightSupported(weight)) {
42
43
  return weight;
43
44
  }
44
45
 
45
- return font.value.findClosestWeight(weight);
46
+ return font.findClosestWeight(weight);
46
47
  });
47
48
  }),
48
49
 
49
50
  getDefaultFontWeight: createCommand(({ commands }) => {
50
51
  const preset = commands.getPreset();
51
52
 
52
- return computed(() => preset.value.common.font_weight);
53
+ return computed(() => unref(preset).common.font_weight);
53
54
  })
54
55
  };
55
56
  },
@@ -1,5 +1,5 @@
1
1
  import { Extension } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { createCommand, renderInlineSetting, convertLineHeight } from '../utils';
4
4
  import { NodeTypes, TextSettings } from '../enums';
5
5
 
@@ -33,7 +33,7 @@ export const LineHeight = Extension.create({
33
33
 
34
34
  if (!value) return null;
35
35
 
36
- const wrapperEl = this.options.wrapperRef.value || this.options.wrapperRef;
36
+ const wrapperEl = unref(this.options.wrapperRef);
37
37
  const converted = convertLineHeight(value, element, wrapperEl);
38
38
 
39
39
  return { desktop: converted, tablet: converted, mobile: converted };
@@ -61,18 +61,18 @@ export const LineHeight = Extension.create({
61
61
  const device = commands.getDevice();
62
62
  const defaultValue = commands.getDefaultLineHeight();
63
63
 
64
- return computed(() => attribute.value?.[device.value] ?? defaultValue.value);
64
+ return computed(() => unref(attribute)?.[unref(device)] ?? unref(defaultValue));
65
65
  }),
66
66
 
67
67
  getDefaultLineHeight: createCommand(({ commands }) => {
68
68
  const device = commands.getDevice();
69
69
  const preset = commands.getPreset();
70
70
 
71
- return computed(() => preset.value[device.value].line_height);
71
+ return computed(() => unref(preset)[unref(device)].line_height);
72
72
  }),
73
73
 
74
74
  applyLineHeight: createCommand(({ commands }, value) => {
75
- const device = commands.getDevice().value;
75
+ const device = unref(commands.getDevice());
76
76
 
77
77
  commands.setBlockAttributes(this.name, { [device]: value }, DEFAULTS);
78
78
  })
@@ -1,4 +1,5 @@
1
1
  import Base from '@tiptap/extension-link';
2
+ import { unref } from 'vue';
2
3
  import { createCommand } from '../utils';
3
4
  import { LinkDestinations, LinkTargets } from '../enums';
4
5
 
@@ -32,13 +33,14 @@ export const Link = Base.extend({
32
33
 
33
34
  destination: {
34
35
  default: LinkDestinations.URL,
36
+
35
37
  parseHTML: (element) => {
36
38
  const href = element.getAttribute('href');
37
39
 
38
40
  if (!href.startsWith('#')) return LinkDestinations.URL;
39
41
 
40
42
  const id = href.replace('#', '');
41
- const blocks = this.options.pageBlocks.value || this.options.pageBlocks;
43
+ const blocks = unref(this.options.pageBlocks);
42
44
  const block = blocks.find((block) => block.id === parseInt(id));
43
45
 
44
46
  return block ? LinkDestinations.BLOCK : LinkDestinations.URL;
@@ -1,5 +1,5 @@
1
1
  import { Extension } from '@tiptap/vue-2';
2
- import { computed, toRef } from 'vue';
2
+ import { computed, toRef, unref } from 'vue';
3
3
  import { Heading } from '@tiptap/extension-heading';
4
4
  import { createCommand } from '../utils';
5
5
  import { Devices, NodeTypes, TextSettings } from '../enums';
@@ -35,7 +35,7 @@ export const StylePreset = Extension.create({
35
35
  default: { id: this.options.defaultId },
36
36
 
37
37
  parseHTML: (element) => {
38
- const presets = this.options.presets.value || this.options.presets;
38
+ const presets = unref(this.options.presets);
39
39
 
40
40
  if (element.parentElement.tagName === 'LI') return null;
41
41
 
@@ -79,11 +79,11 @@ export const StylePreset = Extension.create({
79
79
  const selection = commands.getBlockAttributes('preset', { id: this.options.defaultId });
80
80
  const presets = commands.getPresetList();
81
81
 
82
- return computed(() => findPresetById(presets.value, selection.value.id));
82
+ return computed(() => findPresetById(unref(presets), unref(selection).id));
83
83
  }),
84
84
 
85
85
  applyPreset: createCommand(({ commands, chain }, presetId) => {
86
- const presets = commands.getPresetList().value;
86
+ const presets = unref(commands.getPresetList());
87
87
  const preset = findPresetById(presets, presetId);
88
88
  const nodeType = preset.node?.type ?? NodeTypes.PARAGRAPH;
89
89
 
@@ -96,7 +96,7 @@ export const StylePreset = Extension.create({
96
96
  }
97
97
 
98
98
  for (const textAttribute of TextSettings.attributes) {
99
- attrs[textAttribute] = commands.getBlockAttributes(textAttribute).value;
99
+ attrs[textAttribute] = unref(commands.getBlockAttributes(textAttribute));
100
100
  }
101
101
 
102
102
  chain().removeList().setNode(nodeType, attrs).run();
@@ -1,5 +1,5 @@
1
1
  import { Mark } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { createCommand, createKeyboardShortcut, renderMark } from '../utils';
4
4
  import { TextSettings } from '../enums';
5
5
 
@@ -16,13 +16,13 @@ export const TextDecoration = Mark.create({
16
16
  isUnderline: createCommand(({ commands, editor }) => {
17
17
  const decoration = commands.getTextDecoration();
18
18
 
19
- return computed(() => editor.isActive('link') || decoration.value.underline);
19
+ return computed(() => editor.isActive('link') || unref(decoration).underline);
20
20
  }),
21
21
 
22
22
  isStrikeThrough: createCommand(({ commands }) => {
23
23
  const decoration = commands.getTextDecoration();
24
24
 
25
- return computed(() => decoration.value.strike_through);
25
+ return computed(() => unref(decoration).strike_through);
26
26
  }),
27
27
 
28
28
  getTextDecoration: createCommand(({ editor, commands }) => {
@@ -32,8 +32,8 @@ export const TextDecoration = Mark.create({
32
32
  const attrs = editor.getAttributes(this.name) ?? {};
33
33
 
34
34
  return {
35
- underline: attrs.underline ?? defaultValue.value.underline,
36
- strike_through: attrs.strike_through ?? defaultValue.value.strike_through
35
+ underline: attrs.underline ?? unref(defaultValue).underline,
36
+ strike_through: attrs.strike_through ?? unref(defaultValue).strike_through
37
37
  };
38
38
  });
39
39
  }),
@@ -42,7 +42,7 @@ export const TextDecoration = Mark.create({
42
42
  const preset = commands.getPreset();
43
43
 
44
44
  return computed(() => {
45
- const decoration = preset.value.common.text_decoration;
45
+ const decoration = unref(preset).common.text_decoration;
46
46
 
47
47
  return {
48
48
  underline: decoration.includes('underline'),
@@ -62,7 +62,7 @@ export const TextDecoration = Mark.create({
62
62
  }),
63
63
 
64
64
  toggleTextDecoration: createCommand(({ commands }, name) => {
65
- const isEnabled = commands.getTextDecoration().value[name];
65
+ const isEnabled = unref(commands.getTextDecoration())[name];
66
66
 
67
67
  isEnabled ? commands.removeTextDecoration(name) : commands.applyTextDecoration(name);
68
68
  }),
@@ -73,7 +73,7 @@ export const TextDecoration = Mark.create({
73
73
 
74
74
  removeTextDecoration: createCommand(({ commands }, name) => {
75
75
  const mark = {
76
- ...commands.getTextDecoration().value,
76
+ ...unref(commands.getTextDecoration()),
77
77
  [name]: false
78
78
  };
79
79
  const isRemoveMark = !mark.underline && !mark.strike_through;
@@ -1,5 +1,5 @@
1
1
  import { Extension } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { createCommand } from '../../utils';
4
4
  import { NodeTypes } from '../../enums';
5
5
 
@@ -9,7 +9,7 @@ export const NodeProcessor = Extension.create({
9
9
  addCommands() {
10
10
  return {
11
11
  setBlockAttributes: createCommand(({ commands }, name, attrs, defaults = {}) => {
12
- const current = commands.getBlockAttributes(name).value ?? {};
12
+ const current = unref(commands.getBlockAttributes(name)) ?? {};
13
13
 
14
14
  for (const type of NodeTypes.blocks) {
15
15
  commands.updateAttributes(type, {
@@ -1,5 +1,5 @@
1
1
  import { Node, wrappingInputRule } from '@tiptap/vue-2';
2
- import { computed } from 'vue';
2
+ import { computed, unref } from 'vue';
3
3
  import { createCommand } from '../../utils';
4
4
  import { ListTypes, NodeTypes } from '../../enums';
5
5
  import { ListItem } from './ListItem';
@@ -70,11 +70,11 @@ export const List = Node.create({
70
70
  getListType: createCommand(({ commands }) => {
71
71
  const attribute = commands.getBlockAttributes('bullet', { type: null });
72
72
 
73
- return computed(() => attribute.value.type ?? null);
73
+ return computed(() => unref(attribute).type ?? null);
74
74
  }),
75
75
 
76
76
  applyList: createCommand(({ commands, chain }, type) => {
77
- const currentType = commands.getListType().value;
77
+ const currentType = unref(commands.getListType());
78
78
 
79
79
  // Remove List
80
80
  if (currentType === type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipify/wysiwyg",
3
- "version": "1.0.0-dev.90",
3
+ "version": "1.0.0-dev.91",
4
4
  "description": "Zipify modification of TipTap text editor",
5
5
  "main": "dist/wysiwyg.mjs",
6
6
  "repository": {