@zipify/wysiwyg 1.0.0-dev.53 → 1.0.0-dev.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,8 +4,6 @@ import { resolvePath } from './settings';
4
4
 
5
5
  export default defineConfig({
6
6
  build: {
7
- sourcemap: true,
8
-
9
7
  lib: {
10
8
  entry: resolvePath('./lib/index.js'),
11
9
  fileName: 'wysiwyg',
package/dist/wysiwyg.mjs CHANGED
@@ -13994,13 +13994,15 @@ function iN({ pickerRef: r, initialColorRef: e, onClosed: t, onBeforeOpened: n }
13994
13994
  n(), i.value = e.value, r.value.open(r.value.$el);
13995
13995
  }
13996
13996
  function a() {
13997
- r.value.close(i.value), t(i.value);
13997
+ var c;
13998
+ (c = r.value) == null || c.close(i.value), t(i.value);
13998
13999
  }
13999
14000
  function l() {
14000
14001
  o.value ? a() : s();
14001
14002
  }
14002
14003
  function u() {
14003
- i.value = e.value, r.value.close(i.value);
14004
+ var c;
14005
+ i.value = e.value, (c = r.value) == null || c.close(i.value);
14004
14006
  }
14005
14007
  return {
14006
14008
  isOpened: o,
@@ -16183,7 +16185,7 @@ const rB = te.create({
16183
16185
  isRequired: !1,
16184
16186
  default: { id: this.options.defaultId },
16185
16187
  parseHTML: (r) => {
16186
- const e = this.options.presets;
16188
+ const e = this.options.presets.value || this.options.presets;
16187
16189
  if (r.parentElement.tagName === "LI")
16188
16190
  return null;
16189
16191
  for (const { id: t, node: n, fallbackClass: i } of e) {
@@ -17429,7 +17431,7 @@ const $B = je.create({
17429
17431
  if (!e.startsWith("#"))
17430
17432
  return ht.URL;
17431
17433
  const t = e.replace("#", "");
17432
- return this.options.pageBlocksRef.value.find((i) => i.id === parseInt(t)) ? ht.BLOCK : ht.URL;
17434
+ return (this.options.pageBlocks.value || this.options.pageBlocks).find((o) => o.id === parseInt(t)) ? ht.BLOCK : ht.URL;
17433
17435
  }
17434
17436
  }
17435
17437
  };
@@ -18302,4 +18304,3 @@ const SL = /* @__PURE__ */ function() {
18302
18304
  export {
18303
18305
  SL as Wysiwyg
18304
18306
  };
18305
- //# sourceMappingURL=wysiwyg.mjs.map
@@ -11,7 +11,7 @@ export function usePickerApi({ pickerRef, initialColorRef, onClosed, onBeforeOpe
11
11
  }
12
12
 
13
13
  function close() {
14
- pickerRef.value.close(editingColor.value);
14
+ pickerRef.value?.close(editingColor.value);
15
15
  onClosed(editingColor.value);
16
16
  }
17
17
 
@@ -21,7 +21,7 @@ export function usePickerApi({ pickerRef, initialColorRef, onClosed, onBeforeOpe
21
21
 
22
22
  function cancel() {
23
23
  editingColor.value = initialColorRef.value;
24
- pickerRef.value.close(editingColor.value);
24
+ pickerRef.value?.close(editingColor.value);
25
25
  }
26
26
 
27
27
  return {
@@ -38,7 +38,8 @@ export const Link = Base.extend({
38
38
  if (!href.startsWith('#')) return LinkDestinations.URL;
39
39
 
40
40
  const id = href.replace('#', '');
41
- const block = this.options.pageBlocksRef.value.find((block) => block.id === parseInt(id));
41
+ const blocks = this.options.pageBlocks.value || this.options.pageBlocks;
42
+ const block = blocks.find((block) => block.id === parseInt(id));
42
43
 
43
44
  return block ? LinkDestinations.BLOCK : LinkDestinations.URL;
44
45
  }
@@ -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;
38
+ const presets = this.options.presets.value || this.options.presets;
39
39
 
40
40
  if (element.parentElement.tagName === 'LI') return null;
41
41
 
@@ -12,7 +12,7 @@ function createEditor({ content }) {
12
12
  Link.configure({
13
13
  preset: 'link',
14
14
  baseClass: 'zw ts-',
15
- pageBlocksRef: ref([{ id: 987654 }])
15
+ pageBlocks: ref([{ id: 987654 }])
16
16
  })
17
17
  )
18
18
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipify/wysiwyg",
3
- "version": "1.0.0-dev.53",
3
+ "version": "1.0.0-dev.56",
4
4
  "description": "Zipify modification of TipTap text editor",
5
5
  "main": "dist/wysiwyg.mjs",
6
6
  "repository": {