@editora/plugins 1.0.2 → 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 +30 -5
- 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-CYC9totK.mjs → documentManager-DRUc1-Cs.mjs} +3 -3
- package/dist/{documentManager-BGlu3WRB.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-B-to-4j4.js → index.es-Cz1qItab.js} +1 -1
- package/dist/{index.es-BbXJ7tyO.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 +218 -6
- package/LICENSE +0 -21
- package/dist/index-BbORIHoM.mjs +0 -11763
- package/dist/index-C-OCBS_6.js +0 -3753
package/dist/link.cjs.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let a=null,p=!1,l=null;const c='[data-theme="dark"], .dark, .editora-theme-dark',L=e=>{if(!e)return null;let t=e;for(;t;){if(t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="true"||t.hasAttribute("data-editora-content"))return t;t=t.parentElement}return null},w=e=>{if(e){const n=e.startContainer;if((n.nodeType===Node.ELEMENT_NODE?n:n.parentElement)?.closest(c))return!0}return document.activeElement?.closest(c)?!0:document.body.matches(c)||document.documentElement.matches(c)},C=()=>{if(document.getElementById("rte-link-dialog-theme-styles"))return;const e=document.createElement("style");e.id="rte-link-dialog-theme-styles",e.textContent=`
|
|
2
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog {
|
|
3
|
+
background: #1f2937 !important;
|
|
4
|
+
border: 1px solid #4b5563 !important;
|
|
5
|
+
color: #e2e8f0 !important;
|
|
6
|
+
box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6) !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-header {
|
|
10
|
+
border-bottom-color: #3b4657 !important;
|
|
11
|
+
background: #222d3a !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-header h3,
|
|
15
|
+
.link-dialog-overlay.rte-theme-dark label {
|
|
16
|
+
color: #e2e8f0 !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-close {
|
|
20
|
+
color: #94a3b8 !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-close:hover {
|
|
24
|
+
background: #334155 !important;
|
|
25
|
+
color: #f8fafc !important;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-footer {
|
|
30
|
+
border-top-color: #3b4657 !important;
|
|
31
|
+
background: #222d3a !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.link-dialog-overlay.rte-theme-dark input[type='text'],
|
|
35
|
+
.link-dialog-overlay.rte-theme-dark input[type='url'] {
|
|
36
|
+
background: #111827 !important;
|
|
37
|
+
border-color: #4b5563 !important;
|
|
38
|
+
color: #e2e8f0 !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.link-dialog-overlay.rte-theme-dark input[type='text']::placeholder,
|
|
42
|
+
.link-dialog-overlay.rte-theme-dark input[type='url']::placeholder {
|
|
43
|
+
color: #94a3b8 !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.link-dialog-overlay.rte-theme-dark .btn-cancel {
|
|
47
|
+
background: #334155 !important;
|
|
48
|
+
border-color: #4b5563 !important;
|
|
49
|
+
color: #e2e8f0 !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.link-dialog-overlay.rte-theme-dark .btn-cancel:hover {
|
|
53
|
+
background: #475569 !important;
|
|
54
|
+
border-color: #64748b !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.link-dialog-overlay.rte-theme-dark .btn-submit {
|
|
58
|
+
background: #3b82f6 !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.link-dialog-overlay.rte-theme-dark .btn-submit:hover {
|
|
62
|
+
background: #2563eb !important;
|
|
63
|
+
}
|
|
64
|
+
`,document.head.appendChild(e)},T=e=>{if(!a){console.warn("No selection range stored");return}const t=a.startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t,o=L(n);if(o){if(p&&l){l.href=e.url,l.textContent=e.text,l.target=e.target,e.target==="_blank"?l.setAttribute("rel","noopener noreferrer"):l.removeAttribute("rel"),e.title?l.title=e.title:l.removeAttribute("title");const r=document.createRange();r.selectNodeContents(l);const i=window.getSelection();i&&(i.removeAllRanges(),i.addRange(r))}else{const r=document.createElement("a");r.href=e.url,r.textContent=e.text,r.target=e.target,e.target==="_blank"&&r.setAttribute("rel","noopener noreferrer"),e.title&&(r.title=e.title),a.deleteContents(),a.insertNode(r),a.setStartAfter(r),a.setEndAfter(r);const i=window.getSelection();i&&(i.removeAllRanges(),i.addRange(a))}o.focus(),a=null,p=!1,l=null}},b=(e,t)=>{C();const n=document.createElement("div");n.className="link-dialog-overlay",t&&n.classList.add("rte-theme-dark"),n.style.cssText=`
|
|
65
|
+
position: fixed;
|
|
66
|
+
top: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
right: 0;
|
|
69
|
+
bottom: 0;
|
|
70
|
+
background: rgba(0, 0, 0, 0.5);
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
z-index: 10000;
|
|
75
|
+
`;const o=document.createElement("div");o.className="link-dialog",o.style.cssText=`
|
|
76
|
+
background: white;
|
|
77
|
+
border-radius: 8px;
|
|
78
|
+
width: 500px;
|
|
79
|
+
max-width: 90%;
|
|
80
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
|
|
81
|
+
`,o.innerHTML=`
|
|
82
|
+
<div class="link-dialog-header" style="padding: 16px 20px; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center;">
|
|
83
|
+
<h3 style="margin: 0; font-size: 18px;">${e.isEditing?"Edit Link":"Insert Link"}</h3>
|
|
84
|
+
<button class="link-dialog-close" style="background: none; border: none; font-size: 24px; cursor: pointer; padding: 0; width: 30px; height: 30px;">×</button>
|
|
85
|
+
</div>
|
|
86
|
+
<form id="link-form">
|
|
87
|
+
<div class="link-dialog-body" style="padding: 20px;">
|
|
88
|
+
<div class="form-group" style="margin-bottom: 16px;">
|
|
89
|
+
<label for="link-text" style="display: block; margin-bottom: 6px; font-weight: 500;">Link Text:</label>
|
|
90
|
+
<input
|
|
91
|
+
id="link-text"
|
|
92
|
+
type="text"
|
|
93
|
+
value="${e.text||""}"
|
|
94
|
+
placeholder="Enter link text"
|
|
95
|
+
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;"
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
<div class="form-group" style="margin-bottom: 16px;">
|
|
99
|
+
<label for="link-url" style="display: block; margin-bottom: 6px; font-weight: 500;">URL:</label>
|
|
100
|
+
<input
|
|
101
|
+
id="link-url"
|
|
102
|
+
type="url"
|
|
103
|
+
value="${e.url||""}"
|
|
104
|
+
placeholder="https://example.com"
|
|
105
|
+
required
|
|
106
|
+
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;"
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="form-group" style="margin-bottom: 16px;">
|
|
110
|
+
<label for="link-title" style="display: block; margin-bottom: 6px; font-weight: 500;">Title (optional):</label>
|
|
111
|
+
<input
|
|
112
|
+
id="link-title"
|
|
113
|
+
type="text"
|
|
114
|
+
value="${e.title||""}"
|
|
115
|
+
placeholder="Link tooltip text"
|
|
116
|
+
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;"
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="form-group" style="margin-bottom: 0;">
|
|
120
|
+
<label style="display: flex; align-items: center; cursor: pointer;">
|
|
121
|
+
<input
|
|
122
|
+
id="link-target"
|
|
123
|
+
type="checkbox"
|
|
124
|
+
${e.target==="_blank"?"checked":""}
|
|
125
|
+
style="margin-right: 8px;"
|
|
126
|
+
/>
|
|
127
|
+
Open in new window/tab
|
|
128
|
+
</label>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
<div class="link-dialog-footer" style="padding: 12px 20px; border-top: 1px solid #ddd; display: flex; justify-content: flex-end; gap: 10px;">
|
|
132
|
+
<button type="button" class="btn-cancel" style="padding: 8px 16px; border: 1px solid #ccc; background: white; border-radius: 4px; cursor: pointer;">Cancel</button>
|
|
133
|
+
<button type="submit" class="btn-submit" style="padding: 8px 16px; border: none; background: #007bff; color: white; border-radius: 4px; cursor: pointer;">
|
|
134
|
+
${e.isEditing?"Update Link":"Insert Link"}
|
|
135
|
+
</button>
|
|
136
|
+
</div>
|
|
137
|
+
</form>
|
|
138
|
+
`,n.appendChild(o),document.body.appendChild(n);const r=o.querySelector("#link-form"),i=o.querySelector("#link-text"),d=o.querySelector("#link-url"),x=o.querySelector("#link-title"),y=o.querySelector("#link-target"),v=o.querySelector(".link-dialog-close"),E=o.querySelector(".btn-cancel"),s=()=>{document.body.removeChild(n)};v.addEventListener("click",s),E.addEventListener("click",s),n.addEventListener("click",u=>{u.target===n&&s()}),r.addEventListener("submit",u=>{u.preventDefault();const m=d.value.trim();m&&(T({text:i.value.trim()||m,url:m,target:y.checked?"_blank":"_self",title:x.value.trim()||void 0}),s())}),setTimeout(()=>i.focus(),100)},f=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return!1;const t=e.getRangeAt(0).cloneRange();a=t;const n=w(t),o=e.toString()||"",r=t.startContainer,d=(r.nodeType===Node.TEXT_NODE?r.parentElement:r)?.closest("a");return d?(p=!0,l=d,b({text:d.textContent||"",url:d.href,target:d.target||"_self",title:d.title||"",isEditing:!0},n)):(p=!1,l=null,b({text:o,url:"",target:"_self",isEditing:!1},n)),!0},h=()=>(document.execCommand("unlink",!1),!0),g=(e,t)=>{typeof window<"u"&&window.registerEditorCommand?.(e,t)},k=()=>{g("openLinkDialog",f),g("removeLink",h),g("createLink",e=>{e&&document.execCommand("createLink",!1,e)})};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k());const A=()=>({name:"link",marks:{link:{attrs:{href:{},title:{default:null},target:{default:null}},parseDOM:[{tag:"a[href]",getAttrs:e=>({href:e.getAttribute("href"),title:e.getAttribute("title"),target:e.getAttribute("target")})}],toDOM:e=>["a",{href:e.attrs.href,title:e.attrs.title,target:e.attrs.target,rel:e.attrs.target==="_blank"?"noopener noreferrer":null},0]}},toolbar:[{label:"Link",command:"openLinkDialog",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-k"}],commands:{openLinkDialog:f,removeLink:h},keymap:{"Mod-k":"openLinkDialog"}});exports.LinkPlugin=A;
|
package/dist/link.esm.js
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
let a = null, p = !1, l = null;
|
|
2
|
+
const c = '[data-theme="dark"], .dark, .editora-theme-dark', L = (e) => {
|
|
3
|
+
if (!e) return null;
|
|
4
|
+
let t = e;
|
|
5
|
+
for (; t; ) {
|
|
6
|
+
if (t.hasAttribute("contenteditable") && t.getAttribute("contenteditable") === "true" || t.hasAttribute("data-editora-content"))
|
|
7
|
+
return t;
|
|
8
|
+
t = t.parentElement;
|
|
9
|
+
}
|
|
10
|
+
return null;
|
|
11
|
+
}, w = (e) => {
|
|
12
|
+
if (e) {
|
|
13
|
+
const n = e.startContainer;
|
|
14
|
+
if ((n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement)?.closest(c)) return !0;
|
|
15
|
+
}
|
|
16
|
+
return document.activeElement?.closest(c) ? !0 : document.body.matches(c) || document.documentElement.matches(c);
|
|
17
|
+
}, C = () => {
|
|
18
|
+
if (document.getElementById("rte-link-dialog-theme-styles")) return;
|
|
19
|
+
const e = document.createElement("style");
|
|
20
|
+
e.id = "rte-link-dialog-theme-styles", e.textContent = `
|
|
21
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog {
|
|
22
|
+
background: #1f2937 !important;
|
|
23
|
+
border: 1px solid #4b5563 !important;
|
|
24
|
+
color: #e2e8f0 !important;
|
|
25
|
+
box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6) !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-header {
|
|
29
|
+
border-bottom-color: #3b4657 !important;
|
|
30
|
+
background: #222d3a !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-header h3,
|
|
34
|
+
.link-dialog-overlay.rte-theme-dark label {
|
|
35
|
+
color: #e2e8f0 !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-close {
|
|
39
|
+
color: #94a3b8 !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-close:hover {
|
|
43
|
+
background: #334155 !important;
|
|
44
|
+
color: #f8fafc !important;
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.link-dialog-overlay.rte-theme-dark .link-dialog-footer {
|
|
49
|
+
border-top-color: #3b4657 !important;
|
|
50
|
+
background: #222d3a !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.link-dialog-overlay.rte-theme-dark input[type='text'],
|
|
54
|
+
.link-dialog-overlay.rte-theme-dark input[type='url'] {
|
|
55
|
+
background: #111827 !important;
|
|
56
|
+
border-color: #4b5563 !important;
|
|
57
|
+
color: #e2e8f0 !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.link-dialog-overlay.rte-theme-dark input[type='text']::placeholder,
|
|
61
|
+
.link-dialog-overlay.rte-theme-dark input[type='url']::placeholder {
|
|
62
|
+
color: #94a3b8 !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.link-dialog-overlay.rte-theme-dark .btn-cancel {
|
|
66
|
+
background: #334155 !important;
|
|
67
|
+
border-color: #4b5563 !important;
|
|
68
|
+
color: #e2e8f0 !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.link-dialog-overlay.rte-theme-dark .btn-cancel:hover {
|
|
72
|
+
background: #475569 !important;
|
|
73
|
+
border-color: #64748b !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.link-dialog-overlay.rte-theme-dark .btn-submit {
|
|
77
|
+
background: #3b82f6 !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.link-dialog-overlay.rte-theme-dark .btn-submit:hover {
|
|
81
|
+
background: #2563eb !important;
|
|
82
|
+
}
|
|
83
|
+
`, document.head.appendChild(e);
|
|
84
|
+
}, T = (e) => {
|
|
85
|
+
if (!a) {
|
|
86
|
+
console.warn("No selection range stored");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const t = a.startContainer, n = t.nodeType === Node.TEXT_NODE ? t.parentElement : t, o = L(n);
|
|
90
|
+
if (o) {
|
|
91
|
+
if (p && l) {
|
|
92
|
+
l.href = e.url, l.textContent = e.text, l.target = e.target, e.target === "_blank" ? l.setAttribute("rel", "noopener noreferrer") : l.removeAttribute("rel"), e.title ? l.title = e.title : l.removeAttribute("title");
|
|
93
|
+
const r = document.createRange();
|
|
94
|
+
r.selectNodeContents(l);
|
|
95
|
+
const i = window.getSelection();
|
|
96
|
+
i && (i.removeAllRanges(), i.addRange(r));
|
|
97
|
+
} else {
|
|
98
|
+
const r = document.createElement("a");
|
|
99
|
+
r.href = e.url, r.textContent = e.text, r.target = e.target, e.target === "_blank" && r.setAttribute("rel", "noopener noreferrer"), e.title && (r.title = e.title), a.deleteContents(), a.insertNode(r), a.setStartAfter(r), a.setEndAfter(r);
|
|
100
|
+
const i = window.getSelection();
|
|
101
|
+
i && (i.removeAllRanges(), i.addRange(a));
|
|
102
|
+
}
|
|
103
|
+
o.focus(), a = null, p = !1, l = null;
|
|
104
|
+
}
|
|
105
|
+
}, b = (e, t) => {
|
|
106
|
+
C();
|
|
107
|
+
const n = document.createElement("div");
|
|
108
|
+
n.className = "link-dialog-overlay", t && n.classList.add("rte-theme-dark"), n.style.cssText = `
|
|
109
|
+
position: fixed;
|
|
110
|
+
top: 0;
|
|
111
|
+
left: 0;
|
|
112
|
+
right: 0;
|
|
113
|
+
bottom: 0;
|
|
114
|
+
background: rgba(0, 0, 0, 0.5);
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
z-index: 10000;
|
|
119
|
+
`;
|
|
120
|
+
const o = document.createElement("div");
|
|
121
|
+
o.className = "link-dialog", o.style.cssText = `
|
|
122
|
+
background: white;
|
|
123
|
+
border-radius: 8px;
|
|
124
|
+
width: 500px;
|
|
125
|
+
max-width: 90%;
|
|
126
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
|
|
127
|
+
`, o.innerHTML = `
|
|
128
|
+
<div class="link-dialog-header" style="padding: 16px 20px; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center;">
|
|
129
|
+
<h3 style="margin: 0; font-size: 18px;">${e.isEditing ? "Edit Link" : "Insert Link"}</h3>
|
|
130
|
+
<button class="link-dialog-close" style="background: none; border: none; font-size: 24px; cursor: pointer; padding: 0; width: 30px; height: 30px;">×</button>
|
|
131
|
+
</div>
|
|
132
|
+
<form id="link-form">
|
|
133
|
+
<div class="link-dialog-body" style="padding: 20px;">
|
|
134
|
+
<div class="form-group" style="margin-bottom: 16px;">
|
|
135
|
+
<label for="link-text" style="display: block; margin-bottom: 6px; font-weight: 500;">Link Text:</label>
|
|
136
|
+
<input
|
|
137
|
+
id="link-text"
|
|
138
|
+
type="text"
|
|
139
|
+
value="${e.text || ""}"
|
|
140
|
+
placeholder="Enter link text"
|
|
141
|
+
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;"
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="form-group" style="margin-bottom: 16px;">
|
|
145
|
+
<label for="link-url" style="display: block; margin-bottom: 6px; font-weight: 500;">URL:</label>
|
|
146
|
+
<input
|
|
147
|
+
id="link-url"
|
|
148
|
+
type="url"
|
|
149
|
+
value="${e.url || ""}"
|
|
150
|
+
placeholder="https://example.com"
|
|
151
|
+
required
|
|
152
|
+
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;"
|
|
153
|
+
/>
|
|
154
|
+
</div>
|
|
155
|
+
<div class="form-group" style="margin-bottom: 16px;">
|
|
156
|
+
<label for="link-title" style="display: block; margin-bottom: 6px; font-weight: 500;">Title (optional):</label>
|
|
157
|
+
<input
|
|
158
|
+
id="link-title"
|
|
159
|
+
type="text"
|
|
160
|
+
value="${e.title || ""}"
|
|
161
|
+
placeholder="Link tooltip text"
|
|
162
|
+
style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;"
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
<div class="form-group" style="margin-bottom: 0;">
|
|
166
|
+
<label style="display: flex; align-items: center; cursor: pointer;">
|
|
167
|
+
<input
|
|
168
|
+
id="link-target"
|
|
169
|
+
type="checkbox"
|
|
170
|
+
${e.target === "_blank" ? "checked" : ""}
|
|
171
|
+
style="margin-right: 8px;"
|
|
172
|
+
/>
|
|
173
|
+
Open in new window/tab
|
|
174
|
+
</label>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
<div class="link-dialog-footer" style="padding: 12px 20px; border-top: 1px solid #ddd; display: flex; justify-content: flex-end; gap: 10px;">
|
|
178
|
+
<button type="button" class="btn-cancel" style="padding: 8px 16px; border: 1px solid #ccc; background: white; border-radius: 4px; cursor: pointer;">Cancel</button>
|
|
179
|
+
<button type="submit" class="btn-submit" style="padding: 8px 16px; border: none; background: #007bff; color: white; border-radius: 4px; cursor: pointer;">
|
|
180
|
+
${e.isEditing ? "Update Link" : "Insert Link"}
|
|
181
|
+
</button>
|
|
182
|
+
</div>
|
|
183
|
+
</form>
|
|
184
|
+
`, n.appendChild(o), document.body.appendChild(n);
|
|
185
|
+
const r = o.querySelector("#link-form"), i = o.querySelector("#link-text"), d = o.querySelector("#link-url"), x = o.querySelector("#link-title"), y = o.querySelector("#link-target"), v = o.querySelector(".link-dialog-close"), E = o.querySelector(".btn-cancel"), s = () => {
|
|
186
|
+
document.body.removeChild(n);
|
|
187
|
+
};
|
|
188
|
+
v.addEventListener("click", s), E.addEventListener("click", s), n.addEventListener("click", (u) => {
|
|
189
|
+
u.target === n && s();
|
|
190
|
+
}), r.addEventListener("submit", (u) => {
|
|
191
|
+
u.preventDefault();
|
|
192
|
+
const m = d.value.trim();
|
|
193
|
+
m && (T({
|
|
194
|
+
text: i.value.trim() || m,
|
|
195
|
+
url: m,
|
|
196
|
+
target: y.checked ? "_blank" : "_self",
|
|
197
|
+
title: x.value.trim() || void 0
|
|
198
|
+
}), s());
|
|
199
|
+
}), setTimeout(() => i.focus(), 100);
|
|
200
|
+
}, f = () => {
|
|
201
|
+
const e = window.getSelection();
|
|
202
|
+
if (!e || e.rangeCount === 0) return !1;
|
|
203
|
+
const t = e.getRangeAt(0).cloneRange();
|
|
204
|
+
a = t;
|
|
205
|
+
const n = w(t), o = e.toString() || "", r = t.startContainer, d = (r.nodeType === Node.TEXT_NODE ? r.parentElement : r)?.closest("a");
|
|
206
|
+
return d ? (p = !0, l = d, b({
|
|
207
|
+
text: d.textContent || "",
|
|
208
|
+
url: d.href,
|
|
209
|
+
target: d.target || "_self",
|
|
210
|
+
title: d.title || "",
|
|
211
|
+
isEditing: !0
|
|
212
|
+
}, n)) : (p = !1, l = null, b({
|
|
213
|
+
text: o,
|
|
214
|
+
url: "",
|
|
215
|
+
target: "_self",
|
|
216
|
+
isEditing: !1
|
|
217
|
+
}, n)), !0;
|
|
218
|
+
}, h = () => (document.execCommand("unlink", !1), !0), g = (e, t) => {
|
|
219
|
+
typeof window < "u" && window.registerEditorCommand?.(e, t);
|
|
220
|
+
}, k = () => {
|
|
221
|
+
g("openLinkDialog", f), g("removeLink", h), g("createLink", (e) => {
|
|
222
|
+
e && document.execCommand("createLink", !1, e);
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
typeof window < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", k) : k());
|
|
226
|
+
const A = () => ({
|
|
227
|
+
name: "link",
|
|
228
|
+
marks: {
|
|
229
|
+
link: {
|
|
230
|
+
attrs: {
|
|
231
|
+
href: {},
|
|
232
|
+
title: { default: null },
|
|
233
|
+
target: { default: null }
|
|
234
|
+
},
|
|
235
|
+
parseDOM: [
|
|
236
|
+
{
|
|
237
|
+
tag: "a[href]",
|
|
238
|
+
getAttrs: (e) => ({
|
|
239
|
+
href: e.getAttribute("href"),
|
|
240
|
+
title: e.getAttribute("title"),
|
|
241
|
+
target: e.getAttribute("target")
|
|
242
|
+
})
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
toDOM: (e) => [
|
|
246
|
+
"a",
|
|
247
|
+
{
|
|
248
|
+
href: e.attrs.href,
|
|
249
|
+
title: e.attrs.title,
|
|
250
|
+
target: e.attrs.target,
|
|
251
|
+
rel: e.attrs.target === "_blank" ? "noopener noreferrer" : null
|
|
252
|
+
},
|
|
253
|
+
0
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
toolbar: [
|
|
258
|
+
{
|
|
259
|
+
label: "Link",
|
|
260
|
+
command: "openLinkDialog",
|
|
261
|
+
type: "button",
|
|
262
|
+
icon: '<svg width="24" height="24" focusable="false"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"></path></svg>',
|
|
263
|
+
shortcut: "Mod-k"
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
commands: {
|
|
267
|
+
openLinkDialog: f,
|
|
268
|
+
removeLink: h
|
|
269
|
+
},
|
|
270
|
+
keymap: {
|
|
271
|
+
"Mod-k": "openLinkDialog"
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
export {
|
|
275
|
+
A as LinkPlugin
|
|
276
|
+
};
|
package/dist/list.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=()=>m("insertUnorderedList"),u=()=>m("insertOrderedList");function g(){const o=window.getSelection();if(o&&o.rangeCount>0){const n=o.getRangeAt(0).startContainer,e=(n.nodeType===Node.ELEMENT_NODE?n:n.parentElement)?.closest('[contenteditable="true"], .rte-content, .editora-content');if(e)return e}const t=document.activeElement;return t?t.getAttribute("contenteditable")==="true"?t:t.closest('[contenteditable="true"], .rte-content, .editora-content'):null}function f(o){o.querySelectorAll('ul:not([data-type="checklist"]), ol').forEach(n=>{Array.from(n.childNodes).forEach(e=>{if(e.nodeType===Node.TEXT_NODE){const l=(e.textContent||"").trim();if(!l){n.removeChild(e);return}const s=document.createElement("li");s.textContent=l,n.replaceChild(s,e);return}if(!(e instanceof HTMLElement)){n.removeChild(e);return}if(e.tagName==="LI")return;const i=document.createElement("li");for(;e.firstChild;)i.appendChild(e.firstChild);n.replaceChild(i,e)})})}function m(o){const t=g();if(!t)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0);if(!t.contains(r.commonAncestorContainer))return!1;t.focus({preventScroll:!0});const e=document.execCommand(o,!1);return f(t),t.dispatchEvent(new Event("input",{bubbles:!0})),e!==!1}const c=(o,t)=>{typeof window<"u"&&window.registerEditorCommand?.(o,t)},a=()=>{c("toggleBulletList",d),c("toggleOrderedList",u)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a());const h=()=>({name:"list",nodes:{bulletList:{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]},orderedList:{content:"listItem+",group:"block",parseDOM:[{tag:"ol"}],toDOM:()=>["ol",0]},listItem:{content:"paragraph",parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}},toolbar:[{label:"Bullet List",command:"toggleBulletList",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-Shift-8"},{label:"Numbered List",command:"toggleOrderedList",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0 0-.2l-.7.3a.5.5 0 0 1-.7-.3.5.5 0 0 1 .3-.6l.7-.4c.5-.2 1.1 0 1.4.4.3.5.3 1.1-.1 1.5l-1.2.7Zm0 3.7v.5c0 .3.2.5.5.5h1c.3 0 .5.2.5.5s-.2.5-.5.5h-1a1.5 1.5 0 0 1-1.5-1.5v-.5c0-.3.1-.6.3-.8l1.3-1.4c.3-.4.1-.9-.2-1-.1 0-.2 0-.3.2l-.4.5a.5.5 0 0 1-.7.1.5.5 0 0 1-.1-.7l.4-.5c.5-.5 1.2-.6 1.8-.4.6.3 1 .9 1 1.6 0 .4-.2.8-.5 1.1l-1.3 1.4-.3.4Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-Shift-7"}],commands:{toggleBulletList:d,toggleOrderedList:u},keymap:{"Mod-Shift-8":"toggleBulletList","Mod-Shift-7":"toggleOrderedList"}});exports.ListPlugin=h;
|
package/dist/list.esm.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const d = () => m("insertUnorderedList"), u = () => m("insertOrderedList");
|
|
2
|
+
function g() {
|
|
3
|
+
const o = window.getSelection();
|
|
4
|
+
if (o && o.rangeCount > 0) {
|
|
5
|
+
const n = o.getRangeAt(0).startContainer, e = (n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement)?.closest('[contenteditable="true"], .rte-content, .editora-content');
|
|
6
|
+
if (e) return e;
|
|
7
|
+
}
|
|
8
|
+
const t = document.activeElement;
|
|
9
|
+
return t ? t.getAttribute("contenteditable") === "true" ? t : t.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
|
|
10
|
+
}
|
|
11
|
+
function f(o) {
|
|
12
|
+
o.querySelectorAll('ul:not([data-type="checklist"]), ol').forEach((n) => {
|
|
13
|
+
Array.from(n.childNodes).forEach((e) => {
|
|
14
|
+
if (e.nodeType === Node.TEXT_NODE) {
|
|
15
|
+
const l = (e.textContent || "").trim();
|
|
16
|
+
if (!l) {
|
|
17
|
+
n.removeChild(e);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const s = document.createElement("li");
|
|
21
|
+
s.textContent = l, n.replaceChild(s, e);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (!(e instanceof HTMLElement)) {
|
|
25
|
+
n.removeChild(e);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (e.tagName === "LI")
|
|
29
|
+
return;
|
|
30
|
+
const i = document.createElement("li");
|
|
31
|
+
for (; e.firstChild; )
|
|
32
|
+
i.appendChild(e.firstChild);
|
|
33
|
+
n.replaceChild(i, e);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function m(o) {
|
|
38
|
+
const t = g();
|
|
39
|
+
if (!t) return !1;
|
|
40
|
+
const n = window.getSelection();
|
|
41
|
+
if (!n || n.rangeCount === 0) return !1;
|
|
42
|
+
const r = n.getRangeAt(0);
|
|
43
|
+
if (!t.contains(r.commonAncestorContainer)) return !1;
|
|
44
|
+
t.focus({ preventScroll: !0 });
|
|
45
|
+
const e = document.execCommand(o, !1);
|
|
46
|
+
return f(t), t.dispatchEvent(new Event("input", { bubbles: !0 })), e !== !1;
|
|
47
|
+
}
|
|
48
|
+
const c = (o, t) => {
|
|
49
|
+
typeof window < "u" && window.registerEditorCommand?.(o, t);
|
|
50
|
+
}, a = () => {
|
|
51
|
+
c("toggleBulletList", d), c("toggleOrderedList", u);
|
|
52
|
+
};
|
|
53
|
+
typeof window < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", a) : a());
|
|
54
|
+
const h = () => ({
|
|
55
|
+
name: "list",
|
|
56
|
+
nodes: {
|
|
57
|
+
bulletList: {
|
|
58
|
+
content: "listItem+",
|
|
59
|
+
group: "block",
|
|
60
|
+
parseDOM: [{ tag: "ul" }],
|
|
61
|
+
toDOM: () => ["ul", 0]
|
|
62
|
+
},
|
|
63
|
+
orderedList: {
|
|
64
|
+
content: "listItem+",
|
|
65
|
+
group: "block",
|
|
66
|
+
parseDOM: [{ tag: "ol" }],
|
|
67
|
+
toDOM: () => ["ol", 0]
|
|
68
|
+
},
|
|
69
|
+
listItem: {
|
|
70
|
+
content: "paragraph",
|
|
71
|
+
parseDOM: [{ tag: "li" }],
|
|
72
|
+
toDOM: () => ["li", 0]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
toolbar: [
|
|
76
|
+
{
|
|
77
|
+
label: "Bullet List",
|
|
78
|
+
command: "toggleBulletList",
|
|
79
|
+
type: "button",
|
|
80
|
+
icon: '<svg width="24" height="24" focusable="false"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Z" fill-rule="evenodd"></path></svg>',
|
|
81
|
+
shortcut: "Mod-Shift-8"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: "Numbered List",
|
|
85
|
+
command: "toggleOrderedList",
|
|
86
|
+
type: "button",
|
|
87
|
+
icon: '<svg width="24" height="24" focusable="false"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0 0-.2l-.7.3a.5.5 0 0 1-.7-.3.5.5 0 0 1 .3-.6l.7-.4c.5-.2 1.1 0 1.4.4.3.5.3 1.1-.1 1.5l-1.2.7Zm0 3.7v.5c0 .3.2.5.5.5h1c.3 0 .5.2.5.5s-.2.5-.5.5h-1a1.5 1.5 0 0 1-1.5-1.5v-.5c0-.3.1-.6.3-.8l1.3-1.4c.3-.4.1-.9-.2-1-.1 0-.2 0-.3.2l-.4.5a.5.5 0 0 1-.7.1.5.5 0 0 1-.1-.7l.4-.5c.5-.5 1.2-.6 1.8-.4.6.3 1 .9 1 1.6 0 .4-.2.8-.5 1.1l-1.3 1.4-.3.4Z" fill-rule="evenodd"></path></svg>',
|
|
88
|
+
shortcut: "Mod-Shift-7"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
commands: {
|
|
92
|
+
toggleBulletList: d,
|
|
93
|
+
toggleOrderedList: u
|
|
94
|
+
},
|
|
95
|
+
keymap: {
|
|
96
|
+
"Mod-Shift-8": "toggleBulletList",
|
|
97
|
+
"Mod-Shift-7": "toggleOrderedList"
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export {
|
|
101
|
+
h as ListPlugin
|
|
102
|
+
};
|
package/dist/lite.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./heading.cjs.js"),e=require("./bold.cjs.js"),l=require("./italic.cjs.js"),r=require("./underline.cjs.js"),t=require("./strikethrough.cjs.js"),o=require("./list.cjs.js"),u=require("./checklist.cjs.js"),g=require("./history.cjs.js"),P=require("./link.cjs.js"),c=require("./blockquote.cjs.js"),a=require("./clear-formatting.cjs.js"),s=require("./table.cjs.js"),q=require("./font-size.cjs.js"),d=require("./font-family.cjs.js"),h=require("./text-alignment.cjs.js"),k=require("./text-color.cjs.js"),C=require("./background-color.cjs.js"),b=require("./line-height.cjs.js"),p=require("./indent.cjs.js"),F=require("./direction.cjs.js"),A=require("./capitalization.cjs.js"),f=require("./anchor.cjs.js"),m=require("./page-break.cjs.js"),B=require("./footnote.cjs.js"),H=require("./fullscreen.cjs.js"),y=require("./preview.cjs.js"),S=require("./print.cjs.js"),i=require("./shared-config.cjs.js");exports.HeadingPlugin=n.HeadingPlugin;exports.BoldPlugin=e.BoldPlugin;exports.ItalicPlugin=l.ItalicPlugin;exports.UnderlinePlugin=r.UnderlinePlugin;exports.StrikethroughPlugin=t.StrikethroughPlugin;exports.ListPlugin=o.ListPlugin;exports.ChecklistPlugin=u.ChecklistPlugin;exports.HistoryPlugin=g.HistoryPlugin;exports.LinkPlugin=P.LinkPlugin;exports.BlockquotePlugin=c.BlockquotePlugin;exports.ClearFormattingPlugin=a.ClearFormattingPlugin;exports.TablePlugin=s.TablePlugin;exports.FontSizePlugin=q.FontSizePlugin;exports.FontFamilyPlugin=d.FontFamilyPlugin;exports.TextAlignmentPlugin=h.TextAlignmentPlugin;exports.TextColorPlugin=k.TextColorPlugin;exports.BackgroundColorPlugin=C.BackgroundColorPlugin;exports.LineHeightPlugin=b.LineHeightPlugin;exports.IndentPlugin=p.IndentPlugin;exports.DirectionPlugin=F.DirectionPlugin;exports.CapitalizationPlugin=A.CapitalizationPlugin;exports.AnchorPlugin=f.AnchorPlugin;exports.PageBreakPlugin=m.PageBreakPlugin;exports.FootnotePlugin=B.FootnotePlugin;exports.FullscreenPlugin=H.FullscreenPlugin;exports.PreviewPlugin=y.PreviewPlugin;exports.PrintPlugin=S.PrintPlugin;exports.buildApiUrl=i.buildApiUrl;exports.getGlobalApiConfig=i.getGlobalApiConfig;exports.getGlobalApiHeaders=i.getGlobalApiHeaders;exports.setGlobalApiConfig=i.setGlobalApiConfig;
|
package/dist/lite.esm.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { HeadingPlugin as e } from "./heading.esm.js";
|
|
2
|
+
import { BoldPlugin as t } from "./bold.esm.js";
|
|
3
|
+
import { ItalicPlugin as n } from "./italic.esm.js";
|
|
4
|
+
import { UnderlinePlugin as p } from "./underline.esm.js";
|
|
5
|
+
import { StrikethroughPlugin as m } from "./strikethrough.esm.js";
|
|
6
|
+
import { ListPlugin as x } from "./list.esm.js";
|
|
7
|
+
import { ChecklistPlugin as a } from "./checklist.esm.js";
|
|
8
|
+
import { HistoryPlugin as d } from "./history.esm.js";
|
|
9
|
+
import { LinkPlugin as k } from "./link.esm.js";
|
|
10
|
+
import { BlockquotePlugin as A } from "./blockquote.esm.js";
|
|
11
|
+
import { ClearFormattingPlugin as b } from "./clear-formatting.esm.js";
|
|
12
|
+
import { TablePlugin as B } from "./table.esm.js";
|
|
13
|
+
import { FontSizePlugin as G } from "./font-size.esm.js";
|
|
14
|
+
import { FontFamilyPlugin as T } from "./font-family.esm.js";
|
|
15
|
+
import { TextAlignmentPlugin as z } from "./text-alignment.esm.js";
|
|
16
|
+
import { TextColorPlugin as S } from "./text-color.esm.js";
|
|
17
|
+
import { BackgroundColorPlugin as q } from "./background-color.esm.js";
|
|
18
|
+
import { LineHeightPlugin as w } from "./line-height.esm.js";
|
|
19
|
+
import { IndentPlugin as j } from "./indent.esm.js";
|
|
20
|
+
import { DirectionPlugin as J } from "./direction.esm.js";
|
|
21
|
+
import { CapitalizationPlugin as M } from "./capitalization.esm.js";
|
|
22
|
+
import { AnchorPlugin as O } from "./anchor.esm.js";
|
|
23
|
+
import { PageBreakPlugin as R } from "./page-break.esm.js";
|
|
24
|
+
import { FootnotePlugin as W } from "./footnote.esm.js";
|
|
25
|
+
import { FullscreenPlugin as Y } from "./fullscreen.esm.js";
|
|
26
|
+
import { PreviewPlugin as _ } from "./preview.esm.js";
|
|
27
|
+
import { PrintPlugin as oo } from "./print.esm.js";
|
|
28
|
+
import { buildApiUrl as eo, getGlobalApiConfig as io, getGlobalApiHeaders as to, setGlobalApiConfig as lo } from "./shared-config.esm.js";
|
|
29
|
+
export {
|
|
30
|
+
O as AnchorPlugin,
|
|
31
|
+
q as BackgroundColorPlugin,
|
|
32
|
+
A as BlockquotePlugin,
|
|
33
|
+
t as BoldPlugin,
|
|
34
|
+
M as CapitalizationPlugin,
|
|
35
|
+
a as ChecklistPlugin,
|
|
36
|
+
b as ClearFormattingPlugin,
|
|
37
|
+
J as DirectionPlugin,
|
|
38
|
+
T as FontFamilyPlugin,
|
|
39
|
+
G as FontSizePlugin,
|
|
40
|
+
W as FootnotePlugin,
|
|
41
|
+
Y as FullscreenPlugin,
|
|
42
|
+
e as HeadingPlugin,
|
|
43
|
+
d as HistoryPlugin,
|
|
44
|
+
j as IndentPlugin,
|
|
45
|
+
n as ItalicPlugin,
|
|
46
|
+
w as LineHeightPlugin,
|
|
47
|
+
k as LinkPlugin,
|
|
48
|
+
x as ListPlugin,
|
|
49
|
+
R as PageBreakPlugin,
|
|
50
|
+
_ as PreviewPlugin,
|
|
51
|
+
oo as PrintPlugin,
|
|
52
|
+
m as StrikethroughPlugin,
|
|
53
|
+
B as TablePlugin,
|
|
54
|
+
z as TextAlignmentPlugin,
|
|
55
|
+
S as TextColorPlugin,
|
|
56
|
+
p as UnderlinePlugin,
|
|
57
|
+
eo as buildApiUrl,
|
|
58
|
+
io as getGlobalApiConfig,
|
|
59
|
+
to as getGlobalApiHeaders,
|
|
60
|
+
lo as setGlobalApiConfig
|
|
61
|
+
};
|