@zipify/wysiwyg 1.0.0-dev.54 → 1.0.0-dev.57
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 +7 -6
- package/lib/components/base/colorPicker/composables/usePickerApi.js +2 -2
- package/lib/extensions/Link.js +2 -1
- package/lib/extensions/list/List.js +1 -2
- package/lib/extensions/list/__tests__/__snapshots__/List.test.js.snap +15 -5
- package/package.json +5 -2
- 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,
|
|
@@ -16870,9 +16872,9 @@ const rB = te.create({
|
|
|
16870
16872
|
r.applyDefaultPreset();
|
|
16871
16873
|
return;
|
|
16872
16874
|
}
|
|
16873
|
-
return e().
|
|
16875
|
+
return e().applyDefaultPreset()._addList(t).run();
|
|
16874
16876
|
}),
|
|
16875
|
-
_addList: O(({ chain: r }, e) => r().
|
|
16877
|
+
_addList: O(({ chain: r }, e) => r().toggleList(ee.LIST, ee.LIST_ITEM).setBlockAttributes("bullet", { type: e }).run()),
|
|
16876
16878
|
removeList: O(({ commands: r }) => {
|
|
16877
16879
|
r.liftListItem(ee.LIST_ITEM);
|
|
16878
16880
|
})
|
|
@@ -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.pageBlocks.value.find((
|
|
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
|
}
|
|
@@ -80,12 +80,11 @@ export const List = Node.create({
|
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
return chain().
|
|
83
|
+
return chain().applyDefaultPreset()._addList(type).run();
|
|
84
84
|
}),
|
|
85
85
|
|
|
86
86
|
_addList: createCommand(({ chain }, type) => {
|
|
87
87
|
return chain()
|
|
88
|
-
.removePreset()
|
|
89
88
|
.toggleList(NodeTypes.LIST, NodeTypes.LIST_ITEM)
|
|
90
89
|
.setBlockAttributes('bullet', { type })
|
|
91
90
|
.run();
|
|
@@ -14,7 +14,9 @@ Object {
|
|
|
14
14
|
"content": Array [
|
|
15
15
|
Object {
|
|
16
16
|
"attrs": Object {
|
|
17
|
-
"preset":
|
|
17
|
+
"preset": Object {
|
|
18
|
+
"id": "regular-1",
|
|
19
|
+
},
|
|
18
20
|
},
|
|
19
21
|
"content": Array [
|
|
20
22
|
Object {
|
|
@@ -49,7 +51,9 @@ Object {
|
|
|
49
51
|
"content": Array [
|
|
50
52
|
Object {
|
|
51
53
|
"attrs": Object {
|
|
52
|
-
"preset":
|
|
54
|
+
"preset": Object {
|
|
55
|
+
"id": "regular-1",
|
|
56
|
+
},
|
|
53
57
|
},
|
|
54
58
|
"content": Array [
|
|
55
59
|
Object {
|
|
@@ -66,7 +70,9 @@ Object {
|
|
|
66
70
|
"content": Array [
|
|
67
71
|
Object {
|
|
68
72
|
"attrs": Object {
|
|
69
|
-
"preset":
|
|
73
|
+
"preset": Object {
|
|
74
|
+
"id": "regular-1",
|
|
75
|
+
},
|
|
70
76
|
},
|
|
71
77
|
"content": Array [
|
|
72
78
|
Object {
|
|
@@ -137,7 +143,9 @@ Object {
|
|
|
137
143
|
"content": Array [
|
|
138
144
|
Object {
|
|
139
145
|
"attrs": Object {
|
|
140
|
-
"preset":
|
|
146
|
+
"preset": Object {
|
|
147
|
+
"id": "regular-1",
|
|
148
|
+
},
|
|
141
149
|
},
|
|
142
150
|
"content": Array [
|
|
143
151
|
Object {
|
|
@@ -154,7 +162,9 @@ Object {
|
|
|
154
162
|
"content": Array [
|
|
155
163
|
Object {
|
|
156
164
|
"attrs": Object {
|
|
157
|
-
"preset":
|
|
165
|
+
"preset": Object {
|
|
166
|
+
"id": "regular-1",
|
|
167
|
+
},
|
|
158
168
|
},
|
|
159
169
|
"content": Array [
|
|
160
170
|
Object {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zipify/wysiwyg",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.57",
|
|
4
4
|
"description": "Zipify modification of TipTap text editor",
|
|
5
5
|
"main": "dist/wysiwyg.mjs",
|
|
6
6
|
"repository": {
|
|
@@ -14,11 +14,14 @@
|
|
|
14
14
|
"url": "https://github.com/ZipifyApps/ZipifyWysiwyg/issues"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"lib:build": "
|
|
17
|
+
"lib:pre-build": "npm run lint:js && npm run lint:css && npm run test:unit",
|
|
18
|
+
"lib:build": "npm run lib:pre-build && vite build --config ./config/vite/lib.config.js",
|
|
18
19
|
"lib:release": "export $(cat ./.env | xargs) && npm run lib:build && release-it",
|
|
19
20
|
"example:start": "NODE_ENV=development vite serve --config ./config/vite/example.config.js",
|
|
20
21
|
"example:build": "NODE_ENV=production vite build --config ./config/vite/example.config.js",
|
|
21
22
|
"test:unit": "jest .",
|
|
23
|
+
"lint:js": "eslint ./lib/**/*.{js,vue}",
|
|
24
|
+
"lint:css": "stylelint ./lib/**/*.{css,vue}",
|
|
22
25
|
"optimize-svg": "svgo --config ./config/svgo.js",
|
|
23
26
|
"gzip": "gzipper compress",
|
|
24
27
|
"prepare": "husky install"
|