@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.
- package/config/vite/lib.config.js +0 -2
- package/dist/wysiwyg.mjs +6 -5
- package/lib/components/base/colorPicker/composables/usePickerApi.js +2 -2
- package/lib/extensions/Link.js +2 -1
- package/lib/extensions/StylePreset.js +1 -1
- package/lib/extensions/__tests__/Link.test.js +1 -1
- package/package.json +1 -1
- package/dist/wysiwyg.mjs.map +0 -1
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
|
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
|
|
24
|
+
pickerRef.value?.close(editingColor.value);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
return {
|
package/lib/extensions/Link.js
CHANGED
|
@@ -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
|
|
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
|
|