@editora/plugins 1.0.1 → 1.0.4
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/README.md +173 -110
- package/dist/a11y-checker.cjs.js +109 -0
- package/dist/a11y-checker.esm.js +509 -0
- package/dist/anchor.cjs.js +176 -0
- package/dist/anchor.esm.js +400 -0
- package/dist/background-color.cjs.js +218 -0
- package/dist/background-color.esm.js +482 -0
- package/dist/blockquote.cjs.js +1 -0
- package/dist/blockquote.esm.js +47 -0
- package/dist/bold.cjs.js +1 -0
- package/dist/bold.esm.js +44 -0
- package/dist/capitalization.cjs.js +1 -0
- package/dist/capitalization.esm.js +78 -0
- package/dist/checklist.cjs.js +1 -0
- package/dist/checklist.esm.js +305 -0
- package/dist/clear-formatting.cjs.js +1 -0
- package/dist/clear-formatting.esm.js +138 -0
- package/dist/code-sample.cjs.js +161 -0
- package/dist/code-sample.esm.js +381 -0
- package/dist/code.cjs.js +598 -0
- package/dist/code.esm.js +2034 -0
- package/dist/colorSelectionApply-C0iOfMWb.js +1 -0
- package/dist/colorSelectionApply-D8r_gV32.mjs +63 -0
- package/dist/comments.cjs.js +354 -0
- package/dist/comments.esm.js +692 -0
- package/dist/direction.cjs.js +1 -0
- package/dist/direction.esm.js +129 -0
- package/dist/document-manager.cjs.js +1 -0
- package/dist/document-manager.esm.js +6 -0
- package/dist/{documentManager-D86di_ZO.mjs → documentManager-DRUc1-Cs.mjs} +3 -3
- package/dist/{documentManager-Cw420fPO.js → documentManager-_tQQfQi9.js} +3 -3
- package/dist/editorContainerHelpers-C7kdWnS0.mjs +26 -0
- package/dist/editorContainerHelpers-CFbfiOJI.js +1 -0
- package/dist/embed-iframe.cjs.js +361 -0
- package/dist/embed-iframe.esm.js +556 -0
- package/dist/emojis.cjs.js +284 -0
- package/dist/emojis.esm.js +1080 -0
- package/dist/font-family.cjs.js +1 -0
- package/dist/font-family.esm.js +152 -0
- package/dist/font-size.cjs.js +1 -0
- package/dist/font-size.esm.js +278 -0
- package/dist/footnote.cjs.js +85 -0
- package/dist/footnote.esm.js +397 -0
- package/dist/fullscreen.cjs.js +1 -0
- package/dist/fullscreen.esm.js +73 -0
- package/dist/heading.cjs.js +1 -0
- package/dist/heading.esm.js +63 -0
- package/dist/history.cjs.js +1 -0
- package/dist/history.esm.js +246 -0
- package/dist/indent.cjs.js +1 -0
- package/dist/indent.esm.js +146 -0
- package/dist/index-Bskk414V.mjs +145 -0
- package/dist/index-D3pJyAsj.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-B4xMKvwd.js → index.es-Cz1qItab.js} +1 -1
- package/dist/{index.es-lzohzZmW.mjs → index.es-DEcRmSTY.mjs} +1 -1
- package/dist/index.esm.js +89 -49
- package/dist/italic.cjs.js +1 -0
- package/dist/italic.esm.js +40 -0
- package/dist/line-height.cjs.js +1 -0
- package/dist/line-height.esm.js +145 -0
- package/dist/link.cjs.js +138 -0
- package/dist/link.esm.js +276 -0
- package/dist/list.cjs.js +1 -0
- package/dist/list.esm.js +102 -0
- package/dist/lite.cjs.js +1 -0
- package/dist/lite.esm.js +61 -0
- package/dist/math.cjs.js +45 -0
- package/dist/math.esm.js +249 -0
- package/dist/media-manager.cjs.js +619 -0
- package/dist/media-manager.esm.js +994 -0
- package/dist/merge-tag.cjs.js +93 -0
- package/dist/merge-tag.esm.js +412 -0
- package/dist/page-break.cjs.js +72 -0
- package/dist/page-break.esm.js +295 -0
- package/dist/plugins.css +1 -1
- package/dist/preview.cjs.js +230 -0
- package/dist/preview.esm.js +321 -0
- package/dist/print.cjs.js +254 -0
- package/dist/print.esm.js +309 -0
- package/dist/purify.es-DHhaBdbu.mjs +470 -0
- package/dist/purify.es-T2a3nLiC.js +3 -0
- package/dist/shared-config.cjs.js +1 -0
- package/dist/shared-config.esm.js +30 -0
- package/dist/special-characters.cjs.js +257 -0
- package/dist/special-characters.esm.js +772 -0
- package/dist/spell-check.cjs.js +512 -0
- package/dist/spell-check.esm.js +1013 -0
- package/dist/strikethrough.cjs.js +1 -0
- package/dist/strikethrough.esm.js +71 -0
- package/dist/table.cjs.js +35 -0
- package/dist/table.esm.js +477 -0
- package/dist/template.cjs.js +356 -0
- package/dist/template.esm.js +560 -0
- package/dist/text-alignment.cjs.js +1 -0
- package/dist/text-alignment.esm.js +105 -0
- package/dist/text-color.cjs.js +300 -0
- package/dist/text-color.esm.js +507 -0
- package/dist/underline.cjs.js +1 -0
- package/dist/underline.esm.js +34 -0
- package/index.d.ts +62 -0
- package/package.json +217 -5
- package/LICENSE +0 -21
- package/dist/index-CnEGPLxN.js +0 -3752
- package/dist/index-xwiBh2x6.mjs +0 -11739
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
const g = /* @__PURE__ */ new Set([
|
|
2
|
+
"P",
|
|
3
|
+
"DIV",
|
|
4
|
+
"H1",
|
|
5
|
+
"H2",
|
|
6
|
+
"H3",
|
|
7
|
+
"H4",
|
|
8
|
+
"H5",
|
|
9
|
+
"H6",
|
|
10
|
+
"LI",
|
|
11
|
+
"BLOCKQUOTE",
|
|
12
|
+
"PRE"
|
|
13
|
+
]), l = (e) => g.has(e.tagName) && e.getAttribute("contenteditable") !== "true", h = () => {
|
|
14
|
+
const e = window.getSelection();
|
|
15
|
+
if (e && e.rangeCount > 0) {
|
|
16
|
+
let t = e.getRangeAt(0).startContainer;
|
|
17
|
+
for (; t && t !== document.body; ) {
|
|
18
|
+
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
19
|
+
const r = t;
|
|
20
|
+
if (r.getAttribute("contenteditable") === "true")
|
|
21
|
+
return r;
|
|
22
|
+
}
|
|
23
|
+
t = t.parentNode;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const n = document.activeElement;
|
|
27
|
+
if (n) {
|
|
28
|
+
if (n.getAttribute("contenteditable") === "true")
|
|
29
|
+
return n;
|
|
30
|
+
const t = n.closest('[contenteditable="true"]');
|
|
31
|
+
if (t) return t;
|
|
32
|
+
}
|
|
33
|
+
return document.querySelector('[contenteditable="true"]');
|
|
34
|
+
}, u = (e) => {
|
|
35
|
+
let n = e;
|
|
36
|
+
for (; n && n !== document.body; ) {
|
|
37
|
+
if (n.nodeType === Node.ELEMENT_NODE) {
|
|
38
|
+
const t = n;
|
|
39
|
+
if (l(t)) return t;
|
|
40
|
+
if (t.getAttribute("contenteditable") === "true") break;
|
|
41
|
+
}
|
|
42
|
+
n = n.parentNode;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}, C = (e, n) => {
|
|
46
|
+
const t = [], r = /* @__PURE__ */ new Set(), i = (o) => {
|
|
47
|
+
!o || r.has(o) || n.contains(o) && l(o) && (r.add(o), t.push(o));
|
|
48
|
+
};
|
|
49
|
+
if (e.collapsed)
|
|
50
|
+
return i(u(e.startContainer)), t;
|
|
51
|
+
const s = document.createTreeWalker(
|
|
52
|
+
n,
|
|
53
|
+
NodeFilter.SHOW_ELEMENT,
|
|
54
|
+
{
|
|
55
|
+
acceptNode: (o) => {
|
|
56
|
+
const d = o;
|
|
57
|
+
if (!l(d)) return NodeFilter.FILTER_SKIP;
|
|
58
|
+
if (typeof e.intersectsNode == "function")
|
|
59
|
+
return e.intersectsNode(d) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
60
|
+
const a = document.createRange();
|
|
61
|
+
return a.selectNodeContents(d), e.compareBoundaryPoints(Range.END_TO_START, a) > 0 && e.compareBoundaryPoints(Range.START_TO_END, a) < 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
let c = s.nextNode();
|
|
66
|
+
for (; c; )
|
|
67
|
+
i(c), c = s.nextNode();
|
|
68
|
+
return t.length === 0 && i(u(e.commonAncestorContainer)), t;
|
|
69
|
+
}, T = (e, n) => {
|
|
70
|
+
if (n === e.innerHTML) return;
|
|
71
|
+
const t = window.execEditorCommand || window.executeEditorCommand;
|
|
72
|
+
if (typeof t == "function")
|
|
73
|
+
try {
|
|
74
|
+
t("recordDomTransaction", e, n, e.innerHTML);
|
|
75
|
+
} catch {
|
|
76
|
+
}
|
|
77
|
+
}, f = (e) => {
|
|
78
|
+
const n = h();
|
|
79
|
+
if (!n) return !1;
|
|
80
|
+
const t = window.getSelection();
|
|
81
|
+
if (!t || t.rangeCount === 0) return !1;
|
|
82
|
+
const r = t.getRangeAt(0);
|
|
83
|
+
if (!n.contains(r.commonAncestorContainer)) return !1;
|
|
84
|
+
const i = C(r, n);
|
|
85
|
+
if (i.length === 0) return !1;
|
|
86
|
+
const s = n.innerHTML;
|
|
87
|
+
return i.forEach((c) => {
|
|
88
|
+
e === "rtl" ? c.setAttribute("dir", "rtl") : c.removeAttribute("dir");
|
|
89
|
+
}), T(n, s), n.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
90
|
+
}, E = () => ({
|
|
91
|
+
name: "direction",
|
|
92
|
+
toolbar: [
|
|
93
|
+
{
|
|
94
|
+
label: "Left to Right",
|
|
95
|
+
command: "setDirectionLTR",
|
|
96
|
+
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21 18H3M21 18L18 21M21 18L18 15M13 3V12M13 3H7M13 3C13.4596 3 13.9148 3.0776 14.3394 3.22836C14.764 3.37913 15.1499 3.6001 15.4749 3.87868C15.7999 4.15726 16.0577 4.48797 16.2336 4.85195C16.4095 5.21593 16.5 5.60603 16.5 6C16.5 6.39397 16.4095 6.78407 16.2336 7.14805C16.0577 7.51203 15.7999 7.84274 15.4749 8.12132C15.1499 8.3999 14.764 8.62087 14.3394 8.77164C13.9148 8.9224 13.4596 9 13 9V3ZM9 3V12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',
|
|
97
|
+
shortcut: "Mod-Shift-l"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: "Right to Left",
|
|
101
|
+
command: "setDirectionRTL",
|
|
102
|
+
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M3 18H21M3 18L6 21M3 18L6 15M11 12V3H17M15 3V12M10.5 3C10.0404 3 9.58525 3.0776 9.16061 3.22836C8.73597 3.37913 8.35013 3.6001 8.02513 3.87868C7.70012 4.15726 7.44231 4.48797 7.26642 4.85195C7.09053 5.21593 7 5.60603 7 6C7 6.39397 7.09053 6.78407 7.26642 7.14805C7.44231 7.51203 7.70012 7.84274 8.02513 8.12132C8.35013 8.3999 8.73597 8.62087 9.16061 8.77164C9.58525 8.9224 10.0404 9 10.5 9L10.5 3Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',
|
|
103
|
+
shortcut: "Mod-Shift-r"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
commands: {
|
|
107
|
+
setDirectionLTR: () => {
|
|
108
|
+
try {
|
|
109
|
+
return f(null);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
return console.error("Failed to set LTR direction:", e), !1;
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
setDirectionRTL: () => {
|
|
115
|
+
try {
|
|
116
|
+
return f("rtl");
|
|
117
|
+
} catch (e) {
|
|
118
|
+
return console.error("Failed to set RTL direction:", e), !1;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
keymap: {
|
|
123
|
+
"Mod-Shift-l": "setDirectionLTR",
|
|
124
|
+
"Mod-Shift-r": "setDirectionRTL"
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
export {
|
|
128
|
+
E as DirectionPlugin
|
|
129
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D3pJyAsj.js");exports.DocumentManagerPlugin=e.DocumentManagerPlugin;exports.getDocumentManagerConfig=e.getDocumentManagerConfig;exports.setDocumentManagerConfig=e.setDocumentManagerConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as wv, a as yv, b as bv } from "./index-
|
|
1
|
+
import { g as wv, a as yv, b as bv } from "./index-Bskk414V.mjs";
|
|
2
2
|
var da = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3
3
|
function vv(t) {
|
|
4
4
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
@@ -28560,7 +28560,7 @@ var hl, Pm, Mm, Xd = ["times"];
|
|
|
28560
28560
|
}));
|
|
28561
28561
|
}
|
|
28562
28562
|
function n() {
|
|
28563
|
-
return (Bt.DOMPurify ? Promise.resolve(Bt.DOMPurify) : import("./
|
|
28563
|
+
return (Bt.DOMPurify ? Promise.resolve(Bt.DOMPurify) : import("./purify.es-DHhaBdbu.mjs")).catch((function(s) {
|
|
28564
28564
|
return Promise.reject(new Error("Could not load dompurify: " + s));
|
|
28565
28565
|
})).then((function(s) {
|
|
28566
28566
|
return s.default ? s.default : s;
|
|
@@ -31583,7 +31583,7 @@ function Vm(t) {
|
|
|
31583
31583
|
*/
|
|
31584
31584
|
(function(t) {
|
|
31585
31585
|
function e() {
|
|
31586
|
-
return (Bt.canvg ? Promise.resolve(Bt.canvg) : import("./index.es-
|
|
31586
|
+
return (Bt.canvg ? Promise.resolve(Bt.canvg) : import("./index.es-DEcRmSTY.mjs")).catch((function(n) {
|
|
31587
31587
|
return Promise.reject(new Error("Could not load canvg: " + n));
|
|
31588
31588
|
})).then((function(n) {
|
|
31589
31589
|
return n.default ? n.default : n;
|