@editora/plugins 1.2.6 → 1.2.8
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 +14 -12
- package/dist/version-diff.cjs.js +46 -46
- package/dist/version-diff.esm.js +238 -237
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -90,18 +90,20 @@ Create the plugins once, outside the component or with `useMemo`, so the editor
|
|
|
90
90
|
|
|
91
91
|
## Choose an entry point
|
|
92
92
|
|
|
93
|
-
| Import from | You get |
|
|
94
|
-
| --- | --- |
|
|
95
|
-
| `@editora/plugins
|
|
96
|
-
| `@editora/plugins/lite` | The 27 common plugins: formatting, lists, links, tables, colours, fonts, history. |
|
|
97
|
-
| `@editora/plugins/enterprise` | The 22 advanced plugins: review, workflow, structured authoring, import and export. |
|
|
98
|
-
| `@editora/plugins
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
93
|
+
| Import from | You get |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| `@editora/plugins` | All 56 plugins. |
|
|
96
|
+
| `@editora/plugins/lite` | The 27 common plugins: formatting, lists, links, tables, colours, fonts, history. |
|
|
97
|
+
| `@editora/plugins/enterprise` | The 22 advanced plugins: review, workflow, structured authoring, import and export. |
|
|
98
|
+
| `@editora/plugins/<subpath>` | One plugin, such as `@editora/plugins/bold`. |
|
|
99
|
+
|
|
100
|
+
Every entry point tree-shakes: your bundle gets the plugins you import and what they use, whichever entry you import
|
|
101
|
+
them from. `BoldPlugin` costs 3.5 KB (1.5 KB gzipped) from any of them, `TrackChangesPlugin` 20 KB (5.5 KB gzipped), and
|
|
102
|
+
six common plugins (bold, italic, headings, lists, links, history) 42 KB (12.5 KB gzipped). These are measured with
|
|
103
|
+
esbuild and Vite as minified ES modules; a bundler of your own may differ a little. It needs a bundler that reads the
|
|
104
|
+
`sideEffects` field of `package.json` (Vite, Rollup, webpack, esbuild and Parcel do); 1.2.7 and earlier had none, and one
|
|
105
|
+
plugin from the root cost 40 KB gzipped. A plugin's load-time code (global listeners, for example) runs when you import
|
|
106
|
+
that plugin, not when you import another one from the same entry.
|
|
105
107
|
|
|
106
108
|
## Plugin catalog
|
|
107
109
|
|
package/dist/version-diff.cjs.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
2
|
-
`)}function J(e){const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const fe=require("./dialogHelpers-BxSQ7A6M.js"),E=".rte-content, .editora-content",f='[data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark',l="rte-version-diff-overlay",U="rte-version-diff-styles",de={title:"Version Diff",baseline:"Baseline",current:"Current",noChanges:"No changes detected between baseline and current content.",loading:"Preparing diff...",tabInline:"Inline Diff",tabSideBySide:"Side by Side",refresh:"Refresh",setBaseline:"Set Current as Baseline",close:"Close",mode:"Mode",ignoreWhitespace:"Ignore whitespace",largeDocFallback:"Large document fallback mode applied for performance."},K=new WeakMap,V=new WeakMap,O=new WeakMap;let P=0,C=null,I=null,R=null,M=null,S=null,H=null;function c(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ce(e){return{...de,...e||{}}}function N(e,n=!0){if(e?.contentElement instanceof HTMLElement)return e.contentElement;if(e?.editorElement instanceof HTMLElement){const t=e.editorElement;if(t.matches(E))return t;const o=t.querySelector(E);if(o instanceof HTMLElement)return o}const i=window.getSelection();if(i&&i.rangeCount>0){const t=i.getRangeAt(0).startContainer,u=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest(E);if(u)return u}const r=document.activeElement;if(r){if(r.matches(E))return r;const t=r.closest(E);if(t)return t}return H&&H.isConnected?H:n?document.querySelector(E):null}function W(e){return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||e}function j(e){if(!e)return!1;const n=e.getAttribute("data-theme")||e.getAttribute("theme");if(n&&n.toLowerCase()==="dark")return!0;const i=e.classList;return i.contains("dark")||i.contains("editora-theme-dark")||i.contains("rte-theme-dark")}function Y(e){const n=W(e);if(j(n))return!0;const i=n.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");return!!(j(i)||j(document.documentElement)||j(document.body))}function ue(e){const n=document.createElement("textarea");return n.innerHTML=e,n.value}function Z(e){const i=W(e).getAttribute("data-initial-content");return i?ue(i):e.innerHTML}function ee(e){return e.replace(/\r\n?/g,`
|
|
2
|
+
`)}function J(e){const n=document.createElement("div"),i=e.replace(/<br\s*\/?>/gi,`
|
|
3
3
|
`).replace(/<\/(p|div|h1|h2|h3|h4|h5|h6|li|tr|blockquote|pre|section|article)>/gi,`$&
|
|
4
|
-
`);
|
|
4
|
+
`);n.innerHTML=i;const r=n.textContent||"";return ee(r).replace(/\u00a0/g," ").replace(/\n{3,}/g,`
|
|
5
5
|
|
|
6
|
-
`).trim()}function Q(e,i
|
|
6
|
+
`).trim()}function Q(e,n,i){let r=ee(e);if(i&&(r=r.replace(/[ \t]+/g," ").replace(/\n{3,}/g,`
|
|
7
7
|
|
|
8
|
-
`).trim()),!r)return[];if(
|
|
9
|
-
`);if(
|
|
10
|
-
`);return o.forEach((
|
|
11
|
-
`)}),t}function
|
|
12
|
-
`);if(
|
|
8
|
+
`).trim()),!r)return[];if(n==="line")return r.split(`
|
|
9
|
+
`);if(i)return r.split(/\s+/).filter(Boolean);const t=[],o=r.split(`
|
|
10
|
+
`);return o.forEach((u,g)=>{const d=u.split(/[ \t]+/).filter(Boolean);t.push(...d),g<o.length-1&&t.push(`
|
|
11
|
+
`)}),t}function pe(e,n,i){if(e.length===0)return"";if(n==="line")return e.join(`
|
|
12
|
+
`);if(i)return e.join(" ");let r="";for(let t=0;t<e.length;t+=1){const o=e[t];if(o===`
|
|
13
13
|
`){r=r.replace(/[ \t]+$/g,""),r+=`
|
|
14
14
|
`;continue}r.length>0&&!r.endsWith(`
|
|
15
|
-
`)&&(r+=" "),r+=o}return r}function
|
|
16
|
-
`)}function
|
|
15
|
+
`)&&(r+=" "),r+=o}return r}function be(e,n,i){const r=[];return e.forEach(t=>{const o=r[r.length-1];if(o&&o.type===t.type){o.tokens.push(t.token);return}r.push({type:t.type,tokens:[t.token]})}),r.map(t=>({type:t.type,value:pe(t.tokens,n,i),count:t.tokens.length}))}function he(e,n){let i=0;for(;i<e.length&&i<n.length&&e[i]===n[i];)i+=1;let r=e.length-1,t=n.length-1;for(;r>=i&&t>=i&&e[r]===n[t];)r-=1,t-=1;const o=e.slice(0,i),u=r<e.length-1?e.slice(r+1):[],g=i<=r?e.slice(i,r+1):[],d=i<=t?n.slice(i,t+1):[];return{prefix:o,suffix:u,aMiddle:g,bMiddle:d}}function ve(e,n,i,r,t,o){if(e.length===0&&n.length===0)return{segments:[],insertedCount:0,deletedCount:0,equalCount:0,usedFallback:!1};const{prefix:u,suffix:g,aMiddle:d,bMiddle:b}=he(e,n),m=[];u.forEach(a=>m.push({type:"equal",token:a}));const z=d.length*b.length,D=d.length>o||b.length>o||z>t;if(D)d.forEach(a=>m.push({type:"delete",token:a})),b.forEach(a=>m.push({type:"insert",token:a}));else{const a=Array.from({length:d.length+1},()=>new Uint32Array(b.length+1));for(let y=d.length-1;y>=0;y-=1){const A=a[y],B=a[y+1];for(let k=b.length-1;k>=0;k-=1)A[k]=d[y]===b[k]?B[k+1]+1:Math.max(B[k],A[k+1])}let h=0,p=0;for(;h<d.length&&p<b.length;)d[h]===b[p]?(m.push({type:"equal",token:d[h]}),h+=1,p+=1):a[h+1][p]>=a[h][p+1]?(m.push({type:"delete",token:d[h]}),h+=1):(m.push({type:"insert",token:b[p]}),p+=1);for(;h<d.length;)m.push({type:"delete",token:d[h]}),h+=1;for(;p<b.length;)m.push({type:"insert",token:b[p]}),p+=1}g.forEach(a=>m.push({type:"equal",token:a}));const T=be(m,i,r);let q=0,w=0,F=0;return T.forEach(a=>{a.type==="insert"&&(q+=a.count),a.type==="delete"&&(w+=a.count),a.type==="equal"&&(F+=a.count)}),{segments:T,insertedCount:q,deletedCount:w,equalCount:F,usedFallback:D}}function te(e){return c(e.value).replace(/\n/g,`
|
|
16
|
+
`)}function me(e,n){return e.length===0?`<p class="rte-version-diff-empty">${c(n.noChanges)}</p>`:e.map(i=>`<span class="${i.type==="equal"?"rte-version-diff-equal":i.type==="insert"?"rte-version-diff-insert":"rte-version-diff-delete"}">${te(i)}</span>`).join("")}function ge(e,n){if(e.length===0){const t=`<p class="rte-version-diff-empty">${c(n.noChanges)}</p>`;return{baselineHtml:t,currentHtml:t}}const i=[],r=[];return e.forEach(t=>{const o=te(t);if(t.type==="equal"){i.push(`<span class="rte-version-diff-equal">${o}</span>`),r.push(`<span class="rte-version-diff-equal">${o}</span>`);return}if(t.type==="delete"){i.push(`<span class="rte-version-diff-delete">${o}</span>`);return}r.push(`<span class="rte-version-diff-insert">${o}</span>`)}),{baselineHtml:i.join(""),currentHtml:r.join("")}}function ye(e){const n=e.metaKey||e.ctrlKey,r=(typeof e.key=="string"?e.key:"").toLowerCase(),t=typeof e.code=="string"?e.code.toLowerCase():"",o=n&&e.altKey&&!e.shiftKey&&(r==="d"||t==="keyd"),u=!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&(r==="f8"||t==="f8");return o||u}function ke(){if(typeof document>"u"||document.getElementById(U))return;const e=document.createElement("style");e.id=U,e.textContent=`
|
|
17
17
|
.${l} {
|
|
18
18
|
position: fixed;
|
|
19
19
|
inset: 0;
|
|
@@ -222,16 +222,16 @@
|
|
|
222
222
|
font-size: 13px;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
${
|
|
225
|
+
${f} .rte-version-diff-dialog,
|
|
226
226
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-dialog {
|
|
227
227
|
background: #1f2937;
|
|
228
228
|
color: #e5e7eb;
|
|
229
229
|
border-color: #334155;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
${
|
|
233
|
-
${
|
|
234
|
-
${
|
|
232
|
+
${f} .rte-version-diff-header,
|
|
233
|
+
${f} .rte-version-diff-footer,
|
|
234
|
+
${f} .rte-version-diff-tabs,
|
|
235
235
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-header,
|
|
236
236
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-footer,
|
|
237
237
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-tabs {
|
|
@@ -239,14 +239,14 @@
|
|
|
239
239
|
border-color: #334155;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
${
|
|
242
|
+
${f} .rte-version-diff-body,
|
|
243
243
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-body {
|
|
244
244
|
background: #1f2937;
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
${
|
|
248
|
-
${
|
|
249
|
-
${
|
|
247
|
+
${f} .rte-version-diff-select,
|
|
248
|
+
${f} .rte-version-diff-btn,
|
|
249
|
+
${f} .rte-version-diff-tab,
|
|
250
250
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-select,
|
|
251
251
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-btn,
|
|
252
252
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-tab {
|
|
@@ -255,15 +255,15 @@
|
|
|
255
255
|
border-color: #475569;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
${
|
|
258
|
+
${f} .rte-version-diff-close-btn,
|
|
259
259
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-close-btn {
|
|
260
260
|
background: #0f172a;
|
|
261
261
|
border-color: #475569;
|
|
262
262
|
color: #e2e8f0;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
${
|
|
266
|
-
${
|
|
265
|
+
${f} .rte-version-diff-close-btn:hover,
|
|
266
|
+
${f} .rte-version-diff-close-btn:focus-visible,
|
|
267
267
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-close-btn:hover,
|
|
268
268
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-close-btn:focus-visible {
|
|
269
269
|
border-color: #60a5fa;
|
|
@@ -271,15 +271,15 @@
|
|
|
271
271
|
outline: none;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
${
|
|
274
|
+
${f} .rte-version-diff-tab[aria-selected="true"],
|
|
275
275
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-tab[aria-selected="true"] {
|
|
276
276
|
background: #1e3a8a;
|
|
277
277
|
border-color: #3b82f6;
|
|
278
278
|
color: #dbeafe;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
${
|
|
282
|
-
${
|
|
281
|
+
${f} .rte-version-diff-inline,
|
|
282
|
+
${f} .rte-version-diff-side-pane,
|
|
283
283
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-inline,
|
|
284
284
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-side-pane {
|
|
285
285
|
background: #0f172a;
|
|
@@ -287,53 +287,53 @@
|
|
|
287
287
|
color: #e5e7eb;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
${
|
|
291
|
-
${
|
|
292
|
-
${
|
|
290
|
+
${f} .rte-version-diff-pane-title,
|
|
291
|
+
${f} .rte-version-diff-summary,
|
|
292
|
+
${f} .rte-version-diff-empty,
|
|
293
293
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-pane-title,
|
|
294
294
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-summary,
|
|
295
295
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-empty {
|
|
296
296
|
color: #94a3b8;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
${
|
|
299
|
+
${f} .rte-version-diff-insert,
|
|
300
300
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-insert {
|
|
301
301
|
background: rgba(22, 163, 74, 0.25);
|
|
302
302
|
color: #bbf7d0;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
${
|
|
305
|
+
${f} .rte-version-diff-delete,
|
|
306
306
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-delete {
|
|
307
307
|
background: rgba(220, 38, 38, 0.25);
|
|
308
308
|
color: #fecaca;
|
|
309
309
|
}
|
|
310
|
-
:is(${
|
|
310
|
+
:is(${f}) .rte-toolbar-item .rte-toolbar-button[data-command="openVersionDiff"] svg{
|
|
311
311
|
fill: none;
|
|
312
312
|
}
|
|
313
|
-
`,document.head.appendChild(e)}async function
|
|
313
|
+
`,document.head.appendChild(e)}async function xe(e,n,i){if(i!=null)return i;if(typeof n.getBaselineHtml=="function"){const t=W(e),o=await Promise.resolve(n.getBaselineHtml({editor:e,editorRoot:t}));if(typeof o=="string")return o}const r=K.get(e);return typeof r=="string"?r:typeof n.baselineHtml=="string"?n.baselineHtml:re(e)}function re(e){let n=V.get(e);return typeof n!="string"&&(n=Z(e),V.set(e,n)),n}function Ee(e){e.querySelector('button:not([disabled]), select:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')?.focus()}function $e(e,n){if(e.key!=="Tab"||e.defaultPrevented)return;const i=Array.from(n.querySelectorAll('button:not([disabled]), select:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(u=>!u.hasAttribute("disabled"));if(i.length===0)return;const r=i[0],t=i[i.length-1],o=document.activeElement;e.shiftKey&&o===r?(e.preventDefault(),t.focus()):!e.shiftKey&&o===t&&(e.preventDefault(),r.focus())}function ne(){I&&(I(),I=null)}function X(e){!e||V.has(e)||V.set(e,Z(e))}function we(e){return{baselineHtml:e.baselineHtml,getBaselineHtml:e.getBaselineHtml,mode:e.mode||"word",ignoreWhitespace:e.ignoreWhitespace!==!1,maxTokens:Math.max(200,e.maxTokens??1200),maxMatrixSize:Math.max(5e4,e.maxMatrixSize??1e6),labels:ce(e.labels)}}function ie(e,n,i){ne(),H=e,O.set(e,n);const r=document.createElement("div");fe.initDialogOverlay(r),r.className=l,Y(e)&&r.classList.add("rte-version-diff-theme-dark");const t=document.createElement("section");t.className="rte-version-diff-dialog",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-labelledby","rte-version-diff-title");const o=n.labels;let u=i?.mode||n.mode,g=i?.ignoreWhitespace??n.ignoreWhitespace,d="inline";t.innerHTML=`
|
|
314
314
|
<header class="rte-version-diff-header">
|
|
315
|
-
<h2 id="rte-version-diff-title" class="rte-version-diff-title">${
|
|
315
|
+
<h2 id="rte-version-diff-title" class="rte-version-diff-title">${c(o.title)}</h2>
|
|
316
316
|
<div class="rte-version-diff-controls">
|
|
317
317
|
<label>
|
|
318
|
-
<span>${
|
|
319
|
-
<select class="rte-version-diff-select" aria-label="${
|
|
318
|
+
<span>${c(o.mode)}:</span>
|
|
319
|
+
<select class="rte-version-diff-select" aria-label="${c(o.mode)}">
|
|
320
320
|
<option value="word">Word</option>
|
|
321
321
|
<option value="line">Line</option>
|
|
322
322
|
</select>
|
|
323
323
|
</label>
|
|
324
324
|
<label class="rte-version-diff-checkbox">
|
|
325
325
|
<input type="checkbox" class="rte-version-diff-ignore-ws" ${g?"checked":""}>
|
|
326
|
-
${
|
|
326
|
+
${c(o.ignoreWhitespace)}
|
|
327
327
|
</label>
|
|
328
|
-
<button type="button" class="rte-version-diff-btn rte-version-diff-set-baseline" aria-label="${
|
|
329
|
-
<button type="button" class="rte-version-diff-btn" data-action="refresh" aria-label="${
|
|
330
|
-
<button type="button" class="rte-version-diff-btn rte-version-diff-close-btn" data-action="close" aria-label="${
|
|
328
|
+
<button type="button" class="rte-version-diff-btn rte-version-diff-set-baseline" aria-label="${c(o.setBaseline)}">${c(o.setBaseline)}</button>
|
|
329
|
+
<button type="button" class="rte-version-diff-btn" data-action="refresh" aria-label="${c(o.refresh)}">${c(o.refresh)}</button>
|
|
330
|
+
<button type="button" class="rte-version-diff-btn rte-version-diff-close-btn" data-action="close" aria-label="${c(o.close)}">✕</button>
|
|
331
331
|
</div>
|
|
332
332
|
</header>
|
|
333
333
|
|
|
334
334
|
<div class="rte-version-diff-tabs" role="tablist" aria-label="Diff views">
|
|
335
|
-
<button type="button" role="tab" class="rte-version-diff-tab" data-tab="inline" aria-selected="true">${
|
|
336
|
-
<button type="button" role="tab" class="rte-version-diff-tab" data-tab="side" aria-selected="false">${
|
|
335
|
+
<button type="button" role="tab" class="rte-version-diff-tab" data-tab="inline" aria-selected="true">${c(o.tabInline)}</button>
|
|
336
|
+
<button type="button" role="tab" class="rte-version-diff-tab" data-tab="side" aria-selected="false">${c(o.tabSideBySide)}</button>
|
|
337
337
|
</div>
|
|
338
338
|
|
|
339
339
|
<div class="rte-version-diff-body">
|
|
@@ -344,12 +344,12 @@
|
|
|
344
344
|
<section class="rte-version-diff-panel" data-panel="side" role="tabpanel">
|
|
345
345
|
<div class="rte-version-diff-side-grid">
|
|
346
346
|
<div>
|
|
347
|
-
<h3 class="rte-version-diff-pane-title">${
|
|
348
|
-
<div class="rte-version-diff-side-pane" data-side="baseline" aria-label="${
|
|
347
|
+
<h3 class="rte-version-diff-pane-title">${c(o.baseline)}</h3>
|
|
348
|
+
<div class="rte-version-diff-side-pane" data-side="baseline" aria-label="${c(o.baseline)}"></div>
|
|
349
349
|
</div>
|
|
350
350
|
<div>
|
|
351
|
-
<h3 class="rte-version-diff-pane-title">${
|
|
352
|
-
<div class="rte-version-diff-side-pane" data-side="current" aria-label="${
|
|
351
|
+
<h3 class="rte-version-diff-pane-title">${c(o.current)}</h3>
|
|
352
|
+
<div class="rte-version-diff-side-pane" data-side="current" aria-label="${c(o.current)}"></div>
|
|
353
353
|
</div>
|
|
354
354
|
</div>
|
|
355
355
|
</section>
|
|
@@ -359,4 +359,4 @@
|
|
|
359
359
|
<small>Shortcut: Ctrl/Cmd + Alt + D (fallback: F8)</small>
|
|
360
360
|
<small>Esc: close</small>
|
|
361
361
|
</footer>
|
|
362
|
-
`,r.appendChild(t),document.body.appendChild(r);const b=t.querySelector(".rte-version-diff-select");b.value=
|
|
362
|
+
`,r.appendChild(t),document.body.appendChild(r);const b=t.querySelector(".rte-version-diff-select");b.value=u;const m=t.querySelector(".rte-version-diff-ignore-ws"),z=t.querySelector(".rte-version-diff-summary"),D=t.querySelector(".rte-version-diff-inline"),T=t.querySelector('[data-side="baseline"]'),q=t.querySelector('[data-side="current"]');let w=0;const F=()=>{const s=`<p class="rte-version-diff-empty">${c(o.loading)}</p>`;D.innerHTML=s,T.innerHTML=s,q.innerHTML=s,z.textContent=""},a=async s=>{w+=1;const v=w;r.classList.toggle("rte-version-diff-theme-dark",Y(e)),F();const x=e.innerHTML;let $="";try{$=await xe(e,n,s??i?.baselineHtml)}catch{$=K.get(e)??re(e)}if(v!==w||!r.isConnected)return;const oe=J($),se=J(x),ae=Q(oe,u,g),le=Q(se,u,g),L=ve(ae,le,u,g,n.maxMatrixSize,n.maxTokens),_=ge(L.segments,o);D.innerHTML=me(L.segments,o),T.innerHTML=_.baselineHtml,q.innerHTML=_.currentHtml;const G=[`+${L.insertedCount} inserted`,`-${L.deletedCount} deleted`,`${L.equalCount} unchanged`];L.usedFallback&&G.push(o.largeDocFallback),z.textContent=G.join(" | ")},h=s=>{d=s,t.querySelectorAll(".rte-version-diff-tab").forEach(v=>{const x=v.getAttribute("data-tab")===s;v.setAttribute("aria-selected",x?"true":"false"),v.tabIndex=x?0:-1}),t.querySelectorAll(".rte-version-diff-panel").forEach(v=>{v.classList.toggle("active",v.getAttribute("data-panel")===s)})},p=()=>{r.removeEventListener("keydown",B,!0),r.removeEventListener("click",A),document.removeEventListener("keydown",y,!0),r.parentNode&&r.parentNode.removeChild(r),I=null,e.focus({preventScroll:!0})},y=s=>{s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),p())},A=s=>{s.target===r&&p()},B=s=>{if(s.key==="Escape"){s.preventDefault(),p();return}if($e(s,t),s.target&&s.target.classList.contains("rte-version-diff-tab")&&(s.key==="ArrowRight"||s.key==="ArrowLeft")){s.preventDefault();const v=d==="inline"?"side":"inline";h(v),t.querySelector(`.rte-version-diff-tab[data-tab="${v}"]`)?.focus()}};t.addEventListener("click",s=>{const v=s.target,x=v.getAttribute("data-action");if(x==="close"){p();return}if(x==="refresh"){a();return}const $=v.getAttribute("data-tab");($==="inline"||$==="side")&&h($)}),b.addEventListener("change",()=>{u=b.value==="line"?"line":"word",a()}),m.addEventListener("change",()=>{g=m.checked,a()}),t.querySelector(".rte-version-diff-set-baseline").addEventListener("click",()=>{K.set(e,e.innerHTML),a(e.innerHTML)}),r.addEventListener("keydown",B,!0),r.addEventListener("click",A),document.addEventListener("keydown",y,!0),I=p,Ee(t),a()}function Le(e){R=e,!C&&(C=n=>{if(!ye(n))return;if(document.querySelector(`.${l}`)){n.preventDefault();return}if(!!n.target?.closest("input, textarea, select"))return;const t=N(void 0,!1);if(!t||t.getAttribute("contenteditable")==="false")return;n.preventDefault(),n.stopPropagation();const o=O.get(t)||R||e;ie(t,o)},document.addEventListener("keydown",C,!0))}function Ce(){C&&(document.removeEventListener("keydown",C,!0),C=null,R=null)}function Me(){M||(M=e=>{const i=e.target?.closest(E);i&&(H=i,X(i))},document.addEventListener("focusin",M,!0)),S||(S=e=>{const r=e.target?.closest(E);r&&r.getAttribute("contenteditable")!=="false"&&(H=r,X(r))},document.addEventListener("beforeinput",S,!0))}function Se(){M&&(document.removeEventListener("focusin",M,!0),M=null),S&&(document.removeEventListener("beforeinput",S,!0),S=null)}const He=(e={})=>{const n=we(e);return ke(),{name:"versionDiff",toolbar:[{id:"versionDiff",label:"Version Diff",command:"openVersionDiff",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><rect x="3.5" y="4.5" width="7" height="15" rx="1.5" stroke="currentColor" stroke-width="1.8"></rect><rect x="13.5" y="4.5" width="7" height="15" rx="1.5" stroke="currentColor" stroke-width="1.8"></rect><path d="M5.5 12h3" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M15.5 12h3m-1.5-1.5v3" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path></svg>'}],commands:{openVersionDiff:(i,r)=>{const t=N(r);return t?(O.set(t,n),ie(t,n,i),!0):!1},setVersionDiffBaseline:(i,r)=>{const t=N(r);if(!t)return!1;O.set(t,n);const o=typeof i=="string"?i:typeof i?.html=="string"?i.html:t.innerHTML;return K.set(t,o),!0}},keymap:{"Mod-Alt-d":"openVersionDiff","Mod-Alt-D":"openVersionDiff",F8:"openVersionDiff"},init:()=>{P+=1,Le(n),Me()},destroy:()=>{P=Math.max(0,P-1),P===0&&(ne(),Ce(),Se())}}};exports.VersionDiffPlugin=He;
|
package/dist/version-diff.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
const
|
|
1
|
+
import { i as fe } from "./dialogHelpers-BbwpIXD9.mjs";
|
|
2
|
+
const E = ".rte-content, .editora-content", f = '[data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark', l = "rte-version-diff-overlay", U = "rte-version-diff-styles", de = {
|
|
3
3
|
title: "Version Diff",
|
|
4
4
|
baseline: "Baseline",
|
|
5
5
|
current: "Current",
|
|
@@ -13,99 +13,99 @@ const $ = ".rte-content, .editora-content", d = '[data-theme="dark"], .dark, .ed
|
|
|
13
13
|
mode: "Mode",
|
|
14
14
|
ignoreWhitespace: "Ignore whitespace",
|
|
15
15
|
largeDocFallback: "Large document fallback mode applied for performance."
|
|
16
|
-
},
|
|
17
|
-
let
|
|
18
|
-
function
|
|
16
|
+
}, j = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
let K = 0, C = null, I = null, N = null, H = null, M = null, S = null;
|
|
18
|
+
function c(e) {
|
|
19
19
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function ce(e) {
|
|
22
22
|
return {
|
|
23
|
-
...
|
|
23
|
+
...de,
|
|
24
24
|
...e || {}
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function O(e, n = !0) {
|
|
28
28
|
if (e?.contentElement instanceof HTMLElement) return e.contentElement;
|
|
29
29
|
if (e?.editorElement instanceof HTMLElement) {
|
|
30
30
|
const t = e.editorElement;
|
|
31
|
-
if (t.matches(
|
|
32
|
-
const o = t.querySelector(
|
|
31
|
+
if (t.matches(E)) return t;
|
|
32
|
+
const o = t.querySelector(E);
|
|
33
33
|
if (o instanceof HTMLElement) return o;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
const t =
|
|
38
|
-
if (
|
|
35
|
+
const i = window.getSelection();
|
|
36
|
+
if (i && i.rangeCount > 0) {
|
|
37
|
+
const t = i.getRangeAt(0).startContainer, u = (t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement)?.closest(E);
|
|
38
|
+
if (u) return u;
|
|
39
39
|
}
|
|
40
40
|
const r = document.activeElement;
|
|
41
41
|
if (r) {
|
|
42
|
-
if (r.matches(
|
|
43
|
-
const t = r.closest(
|
|
42
|
+
if (r.matches(E)) return r;
|
|
43
|
+
const t = r.closest(E);
|
|
44
44
|
if (t) return t;
|
|
45
45
|
}
|
|
46
|
-
return
|
|
46
|
+
return S && S.isConnected ? S : n ? document.querySelector(E) : null;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function W(e) {
|
|
49
49
|
return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || e;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function P(e) {
|
|
52
52
|
if (!e) return !1;
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
return
|
|
53
|
+
const n = e.getAttribute("data-theme") || e.getAttribute("theme");
|
|
54
|
+
if (n && n.toLowerCase() === "dark") return !0;
|
|
55
|
+
const i = e.classList;
|
|
56
|
+
return i.contains("dark") || i.contains("editora-theme-dark") || i.contains("rte-theme-dark");
|
|
57
57
|
}
|
|
58
58
|
function Y(e) {
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
return !!(
|
|
63
|
-
}
|
|
64
|
-
function de(e) {
|
|
65
|
-
const i = document.createElement("textarea");
|
|
66
|
-
return i.innerHTML = e, i.value;
|
|
59
|
+
const n = W(e);
|
|
60
|
+
if (P(n)) return !0;
|
|
61
|
+
const i = n.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
|
|
62
|
+
return !!(P(i) || P(document.documentElement) || P(document.body));
|
|
67
63
|
}
|
|
68
|
-
function
|
|
69
|
-
const n =
|
|
70
|
-
return n
|
|
64
|
+
function ue(e) {
|
|
65
|
+
const n = document.createElement("textarea");
|
|
66
|
+
return n.innerHTML = e, n.value;
|
|
71
67
|
}
|
|
72
68
|
function Z(e) {
|
|
69
|
+
const i = W(e).getAttribute("data-initial-content");
|
|
70
|
+
return i ? ue(i) : e.innerHTML;
|
|
71
|
+
}
|
|
72
|
+
function ee(e) {
|
|
73
73
|
return e.replace(/\r\n?/g, `
|
|
74
74
|
`);
|
|
75
75
|
}
|
|
76
76
|
function J(e) {
|
|
77
|
-
const
|
|
77
|
+
const n = document.createElement("div"), i = e.replace(/<br\s*\/?>/gi, `
|
|
78
78
|
`).replace(/<\/(p|div|h1|h2|h3|h4|h5|h6|li|tr|blockquote|pre|section|article)>/gi, `$&
|
|
79
79
|
`);
|
|
80
|
-
|
|
81
|
-
const r =
|
|
82
|
-
return
|
|
80
|
+
n.innerHTML = i;
|
|
81
|
+
const r = n.textContent || "";
|
|
82
|
+
return ee(r).replace(/\u00a0/g, " ").replace(/\n{3,}/g, `
|
|
83
83
|
|
|
84
84
|
`).trim();
|
|
85
85
|
}
|
|
86
|
-
function Q(e,
|
|
87
|
-
let r =
|
|
88
|
-
if (
|
|
86
|
+
function Q(e, n, i) {
|
|
87
|
+
let r = ee(e);
|
|
88
|
+
if (i && (r = r.replace(/[ \t]+/g, " ").replace(/\n{3,}/g, `
|
|
89
89
|
|
|
90
90
|
`).trim()), !r) return [];
|
|
91
|
-
if (
|
|
91
|
+
if (n === "line")
|
|
92
92
|
return r.split(`
|
|
93
93
|
`);
|
|
94
|
-
if (
|
|
94
|
+
if (i)
|
|
95
95
|
return r.split(/\s+/).filter(Boolean);
|
|
96
96
|
const t = [], o = r.split(`
|
|
97
97
|
`);
|
|
98
|
-
return o.forEach((
|
|
99
|
-
const
|
|
100
|
-
t.push(...
|
|
98
|
+
return o.forEach((u, g) => {
|
|
99
|
+
const d = u.split(/[ \t]+/).filter(Boolean);
|
|
100
|
+
t.push(...d), g < o.length - 1 && t.push(`
|
|
101
101
|
`);
|
|
102
102
|
}), t;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function pe(e, n, i) {
|
|
105
105
|
if (e.length === 0) return "";
|
|
106
|
-
if (
|
|
106
|
+
if (n === "line") return e.join(`
|
|
107
107
|
`);
|
|
108
|
-
if (
|
|
108
|
+
if (i) return e.join(" ");
|
|
109
109
|
let r = "";
|
|
110
110
|
for (let t = 0; t < e.length; t += 1) {
|
|
111
111
|
const o = e[t];
|
|
@@ -120,7 +120,7 @@ function ce(e, i, n) {
|
|
|
120
120
|
}
|
|
121
121
|
return r;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function be(e, n, i) {
|
|
124
124
|
const r = [];
|
|
125
125
|
return e.forEach((t) => {
|
|
126
126
|
const o = r[r.length - 1];
|
|
@@ -131,90 +131,90 @@ function ue(e, i, n) {
|
|
|
131
131
|
r.push({ type: t.type, tokens: [t.token] });
|
|
132
132
|
}), r.map((t) => ({
|
|
133
133
|
type: t.type,
|
|
134
|
-
value:
|
|
134
|
+
value: pe(t.tokens, n, i),
|
|
135
135
|
count: t.tokens.length
|
|
136
136
|
}));
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
let
|
|
140
|
-
for (;
|
|
141
|
-
|
|
142
|
-
let r = e.length - 1, t =
|
|
143
|
-
for (; r >=
|
|
138
|
+
function he(e, n) {
|
|
139
|
+
let i = 0;
|
|
140
|
+
for (; i < e.length && i < n.length && e[i] === n[i]; )
|
|
141
|
+
i += 1;
|
|
142
|
+
let r = e.length - 1, t = n.length - 1;
|
|
143
|
+
for (; r >= i && t >= i && e[r] === n[t]; )
|
|
144
144
|
r -= 1, t -= 1;
|
|
145
|
-
const o = e.slice(0,
|
|
146
|
-
return { prefix: o, suffix:
|
|
145
|
+
const o = e.slice(0, i), u = r < e.length - 1 ? e.slice(r + 1) : [], g = i <= r ? e.slice(i, r + 1) : [], d = i <= t ? n.slice(i, t + 1) : [];
|
|
146
|
+
return { prefix: o, suffix: u, aMiddle: g, bMiddle: d };
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
if (e.length === 0 &&
|
|
148
|
+
function ve(e, n, i, r, t, o) {
|
|
149
|
+
if (e.length === 0 && n.length === 0)
|
|
150
150
|
return { segments: [], insertedCount: 0, deletedCount: 0, equalCount: 0, usedFallback: !1 };
|
|
151
|
-
const { prefix:
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
|
|
151
|
+
const { prefix: u, suffix: g, aMiddle: d, bMiddle: b } = he(e, n), m = [];
|
|
152
|
+
u.forEach((a) => m.push({ type: "equal", token: a }));
|
|
153
|
+
const z = d.length * b.length, D = d.length > o || b.length > o || z > t;
|
|
154
|
+
if (D)
|
|
155
|
+
d.forEach((a) => m.push({ type: "delete", token: a })), b.forEach((a) => m.push({ type: "insert", token: a }));
|
|
156
156
|
else {
|
|
157
|
-
const a = Array.from({ length:
|
|
158
|
-
for (let y =
|
|
159
|
-
const
|
|
160
|
-
for (let
|
|
161
|
-
|
|
157
|
+
const a = Array.from({ length: d.length + 1 }, () => new Uint32Array(b.length + 1));
|
|
158
|
+
for (let y = d.length - 1; y >= 0; y -= 1) {
|
|
159
|
+
const A = a[y], B = a[y + 1];
|
|
160
|
+
for (let k = b.length - 1; k >= 0; k -= 1)
|
|
161
|
+
A[k] = d[y] === b[k] ? B[k + 1] + 1 : Math.max(B[k], A[k + 1]);
|
|
162
162
|
}
|
|
163
163
|
let h = 0, p = 0;
|
|
164
|
-
for (; h <
|
|
165
|
-
|
|
166
|
-
for (; h <
|
|
167
|
-
m.push({ type: "delete", token:
|
|
164
|
+
for (; h < d.length && p < b.length; )
|
|
165
|
+
d[h] === b[p] ? (m.push({ type: "equal", token: d[h] }), h += 1, p += 1) : a[h + 1][p] >= a[h][p + 1] ? (m.push({ type: "delete", token: d[h] }), h += 1) : (m.push({ type: "insert", token: b[p] }), p += 1);
|
|
166
|
+
for (; h < d.length; )
|
|
167
|
+
m.push({ type: "delete", token: d[h] }), h += 1;
|
|
168
168
|
for (; p < b.length; )
|
|
169
169
|
m.push({ type: "insert", token: b[p] }), p += 1;
|
|
170
170
|
}
|
|
171
171
|
g.forEach((a) => m.push({ type: "equal", token: a }));
|
|
172
|
-
const
|
|
173
|
-
let
|
|
174
|
-
return
|
|
175
|
-
a.type === "insert" && (
|
|
172
|
+
const T = be(m, i, r);
|
|
173
|
+
let q = 0, w = 0, F = 0;
|
|
174
|
+
return T.forEach((a) => {
|
|
175
|
+
a.type === "insert" && (q += a.count), a.type === "delete" && (w += a.count), a.type === "equal" && (F += a.count);
|
|
176
176
|
}), {
|
|
177
|
-
segments:
|
|
178
|
-
insertedCount:
|
|
179
|
-
deletedCount:
|
|
180
|
-
equalCount:
|
|
181
|
-
usedFallback:
|
|
177
|
+
segments: T,
|
|
178
|
+
insertedCount: q,
|
|
179
|
+
deletedCount: w,
|
|
180
|
+
equalCount: F,
|
|
181
|
+
usedFallback: D
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
return
|
|
184
|
+
function te(e) {
|
|
185
|
+
return c(e.value).replace(/\n/g, `
|
|
186
186
|
`);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
return e.length === 0 ? `<p class="rte-version-diff-empty">${
|
|
188
|
+
function me(e, n) {
|
|
189
|
+
return e.length === 0 ? `<p class="rte-version-diff-empty">${c(n.noChanges)}</p>` : e.map((i) => `<span class="${i.type === "equal" ? "rte-version-diff-equal" : i.type === "insert" ? "rte-version-diff-insert" : "rte-version-diff-delete"}">${te(i)}</span>`).join("");
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function ge(e, n) {
|
|
192
192
|
if (e.length === 0) {
|
|
193
|
-
const t = `<p class="rte-version-diff-empty">${
|
|
193
|
+
const t = `<p class="rte-version-diff-empty">${c(n.noChanges)}</p>`;
|
|
194
194
|
return { baselineHtml: t, currentHtml: t };
|
|
195
195
|
}
|
|
196
|
-
const
|
|
196
|
+
const i = [], r = [];
|
|
197
197
|
return e.forEach((t) => {
|
|
198
|
-
const o =
|
|
198
|
+
const o = te(t);
|
|
199
199
|
if (t.type === "equal") {
|
|
200
|
-
|
|
200
|
+
i.push(`<span class="rte-version-diff-equal">${o}</span>`), r.push(`<span class="rte-version-diff-equal">${o}</span>`);
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
if (t.type === "delete") {
|
|
204
|
-
|
|
204
|
+
i.push(`<span class="rte-version-diff-delete">${o}</span>`);
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
207
|
r.push(`<span class="rte-version-diff-insert">${o}</span>`);
|
|
208
208
|
}), {
|
|
209
|
-
baselineHtml:
|
|
209
|
+
baselineHtml: i.join(""),
|
|
210
210
|
currentHtml: r.join("")
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
const
|
|
215
|
-
return o ||
|
|
213
|
+
function ye(e) {
|
|
214
|
+
const n = e.metaKey || e.ctrlKey, r = (typeof e.key == "string" ? e.key : "").toLowerCase(), t = typeof e.code == "string" ? e.code.toLowerCase() : "", o = n && e.altKey && !e.shiftKey && (r === "d" || t === "keyd"), u = !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey && (r === "f8" || t === "f8");
|
|
215
|
+
return o || u;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function ke() {
|
|
218
218
|
if (typeof document > "u" || document.getElementById(U)) return;
|
|
219
219
|
const e = document.createElement("style");
|
|
220
220
|
e.id = U, e.textContent = `
|
|
@@ -426,16 +426,16 @@ function ge() {
|
|
|
426
426
|
font-size: 13px;
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
-
${
|
|
429
|
+
${f} .rte-version-diff-dialog,
|
|
430
430
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-dialog {
|
|
431
431
|
background: #1f2937;
|
|
432
432
|
color: #e5e7eb;
|
|
433
433
|
border-color: #334155;
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
${
|
|
437
|
-
${
|
|
438
|
-
${
|
|
436
|
+
${f} .rte-version-diff-header,
|
|
437
|
+
${f} .rte-version-diff-footer,
|
|
438
|
+
${f} .rte-version-diff-tabs,
|
|
439
439
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-header,
|
|
440
440
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-footer,
|
|
441
441
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-tabs {
|
|
@@ -443,14 +443,14 @@ function ge() {
|
|
|
443
443
|
border-color: #334155;
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
${
|
|
446
|
+
${f} .rte-version-diff-body,
|
|
447
447
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-body {
|
|
448
448
|
background: #1f2937;
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
${
|
|
452
|
-
${
|
|
453
|
-
${
|
|
451
|
+
${f} .rte-version-diff-select,
|
|
452
|
+
${f} .rte-version-diff-btn,
|
|
453
|
+
${f} .rte-version-diff-tab,
|
|
454
454
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-select,
|
|
455
455
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-btn,
|
|
456
456
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-tab {
|
|
@@ -459,15 +459,15 @@ function ge() {
|
|
|
459
459
|
border-color: #475569;
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
-
${
|
|
462
|
+
${f} .rte-version-diff-close-btn,
|
|
463
463
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-close-btn {
|
|
464
464
|
background: #0f172a;
|
|
465
465
|
border-color: #475569;
|
|
466
466
|
color: #e2e8f0;
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
-
${
|
|
470
|
-
${
|
|
469
|
+
${f} .rte-version-diff-close-btn:hover,
|
|
470
|
+
${f} .rte-version-diff-close-btn:focus-visible,
|
|
471
471
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-close-btn:hover,
|
|
472
472
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-close-btn:focus-visible {
|
|
473
473
|
border-color: #60a5fa;
|
|
@@ -475,15 +475,15 @@ function ge() {
|
|
|
475
475
|
outline: none;
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
${
|
|
478
|
+
${f} .rte-version-diff-tab[aria-selected="true"],
|
|
479
479
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-tab[aria-selected="true"] {
|
|
480
480
|
background: #1e3a8a;
|
|
481
481
|
border-color: #3b82f6;
|
|
482
482
|
color: #dbeafe;
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
-
${
|
|
486
|
-
${
|
|
485
|
+
${f} .rte-version-diff-inline,
|
|
486
|
+
${f} .rte-version-diff-side-pane,
|
|
487
487
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-inline,
|
|
488
488
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-side-pane {
|
|
489
489
|
background: #0f172a;
|
|
@@ -491,64 +491,65 @@ function ge() {
|
|
|
491
491
|
color: #e5e7eb;
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
-
${
|
|
495
|
-
${
|
|
496
|
-
${
|
|
494
|
+
${f} .rte-version-diff-pane-title,
|
|
495
|
+
${f} .rte-version-diff-summary,
|
|
496
|
+
${f} .rte-version-diff-empty,
|
|
497
497
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-pane-title,
|
|
498
498
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-summary,
|
|
499
499
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-empty {
|
|
500
500
|
color: #94a3b8;
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
${
|
|
503
|
+
${f} .rte-version-diff-insert,
|
|
504
504
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-insert {
|
|
505
505
|
background: rgba(22, 163, 74, 0.25);
|
|
506
506
|
color: #bbf7d0;
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
${
|
|
509
|
+
${f} .rte-version-diff-delete,
|
|
510
510
|
.${l}.rte-version-diff-theme-dark .rte-version-diff-delete {
|
|
511
511
|
background: rgba(220, 38, 38, 0.25);
|
|
512
512
|
color: #fecaca;
|
|
513
513
|
}
|
|
514
|
-
:is(${
|
|
514
|
+
:is(${f}) .rte-toolbar-item .rte-toolbar-button[data-command="openVersionDiff"] svg{
|
|
515
515
|
fill: none;
|
|
516
516
|
}
|
|
517
517
|
`, document.head.appendChild(e);
|
|
518
518
|
}
|
|
519
|
-
async function
|
|
520
|
-
if (
|
|
521
|
-
if (typeof
|
|
522
|
-
const
|
|
523
|
-
if (typeof
|
|
519
|
+
async function xe(e, n, i) {
|
|
520
|
+
if (i != null) return i;
|
|
521
|
+
if (typeof n.getBaselineHtml == "function") {
|
|
522
|
+
const t = W(e), o = await Promise.resolve(n.getBaselineHtml({ editor: e, editorRoot: t }));
|
|
523
|
+
if (typeof o == "string") return o;
|
|
524
524
|
}
|
|
525
|
-
const r =
|
|
526
|
-
|
|
527
|
-
if (typeof i.baselineHtml == "string") return i.baselineHtml;
|
|
528
|
-
const t = W(e);
|
|
529
|
-
return w.set(e, t), t;
|
|
525
|
+
const r = j.get(e);
|
|
526
|
+
return typeof r == "string" ? r : typeof n.baselineHtml == "string" ? n.baselineHtml : re(e);
|
|
530
527
|
}
|
|
531
|
-
function
|
|
528
|
+
function re(e) {
|
|
529
|
+
let n = R.get(e);
|
|
530
|
+
return typeof n != "string" && (n = Z(e), R.set(e, n)), n;
|
|
531
|
+
}
|
|
532
|
+
function Ee(e) {
|
|
532
533
|
e.querySelector(
|
|
533
534
|
'button:not([disabled]), select:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
534
535
|
)?.focus();
|
|
535
536
|
}
|
|
536
|
-
function
|
|
537
|
+
function $e(e, n) {
|
|
537
538
|
if (e.key !== "Tab" || e.defaultPrevented) return;
|
|
538
|
-
const
|
|
539
|
+
const i = Array.from(n.querySelectorAll(
|
|
539
540
|
'button:not([disabled]), select:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
540
|
-
)).filter((
|
|
541
|
-
if (
|
|
542
|
-
const r =
|
|
541
|
+
)).filter((u) => !u.hasAttribute("disabled"));
|
|
542
|
+
if (i.length === 0) return;
|
|
543
|
+
const r = i[0], t = i[i.length - 1], o = document.activeElement;
|
|
543
544
|
e.shiftKey && o === r ? (e.preventDefault(), t.focus()) : !e.shiftKey && o === t && (e.preventDefault(), r.focus());
|
|
544
545
|
}
|
|
545
|
-
function
|
|
546
|
-
|
|
546
|
+
function ne() {
|
|
547
|
+
I && (I(), I = null);
|
|
547
548
|
}
|
|
548
549
|
function X(e) {
|
|
549
|
-
!e ||
|
|
550
|
+
!e || R.has(e) || R.set(e, Z(e));
|
|
550
551
|
}
|
|
551
|
-
function
|
|
552
|
+
function we(e) {
|
|
552
553
|
return {
|
|
553
554
|
baselineHtml: e.baselineHtml,
|
|
554
555
|
getBaselineHtml: e.getBaselineHtml,
|
|
@@ -556,41 +557,41 @@ function $e(e) {
|
|
|
556
557
|
ignoreWhitespace: e.ignoreWhitespace !== !1,
|
|
557
558
|
maxTokens: Math.max(200, e.maxTokens ?? 1200),
|
|
558
559
|
maxMatrixSize: Math.max(5e4, e.maxMatrixSize ?? 1e6),
|
|
559
|
-
labels:
|
|
560
|
+
labels: ce(e.labels)
|
|
560
561
|
};
|
|
561
562
|
}
|
|
562
|
-
function
|
|
563
|
-
|
|
563
|
+
function ie(e, n, i) {
|
|
564
|
+
ne(), S = e, V.set(e, n);
|
|
564
565
|
const r = document.createElement("div");
|
|
565
|
-
|
|
566
|
+
fe(r), r.className = l, Y(e) && r.classList.add("rte-version-diff-theme-dark");
|
|
566
567
|
const t = document.createElement("section");
|
|
567
568
|
t.className = "rte-version-diff-dialog", t.setAttribute("role", "dialog"), t.setAttribute("aria-modal", "true"), t.setAttribute("aria-labelledby", "rte-version-diff-title");
|
|
568
|
-
const o =
|
|
569
|
-
let
|
|
569
|
+
const o = n.labels;
|
|
570
|
+
let u = i?.mode || n.mode, g = i?.ignoreWhitespace ?? n.ignoreWhitespace, d = "inline";
|
|
570
571
|
t.innerHTML = `
|
|
571
572
|
<header class="rte-version-diff-header">
|
|
572
|
-
<h2 id="rte-version-diff-title" class="rte-version-diff-title">${
|
|
573
|
+
<h2 id="rte-version-diff-title" class="rte-version-diff-title">${c(o.title)}</h2>
|
|
573
574
|
<div class="rte-version-diff-controls">
|
|
574
575
|
<label>
|
|
575
|
-
<span>${
|
|
576
|
-
<select class="rte-version-diff-select" aria-label="${
|
|
576
|
+
<span>${c(o.mode)}:</span>
|
|
577
|
+
<select class="rte-version-diff-select" aria-label="${c(o.mode)}">
|
|
577
578
|
<option value="word">Word</option>
|
|
578
579
|
<option value="line">Line</option>
|
|
579
580
|
</select>
|
|
580
581
|
</label>
|
|
581
582
|
<label class="rte-version-diff-checkbox">
|
|
582
583
|
<input type="checkbox" class="rte-version-diff-ignore-ws" ${g ? "checked" : ""}>
|
|
583
|
-
${
|
|
584
|
+
${c(o.ignoreWhitespace)}
|
|
584
585
|
</label>
|
|
585
|
-
<button type="button" class="rte-version-diff-btn rte-version-diff-set-baseline" aria-label="${
|
|
586
|
-
<button type="button" class="rte-version-diff-btn" data-action="refresh" aria-label="${
|
|
587
|
-
<button type="button" class="rte-version-diff-btn rte-version-diff-close-btn" data-action="close" aria-label="${
|
|
586
|
+
<button type="button" class="rte-version-diff-btn rte-version-diff-set-baseline" aria-label="${c(o.setBaseline)}">${c(o.setBaseline)}</button>
|
|
587
|
+
<button type="button" class="rte-version-diff-btn" data-action="refresh" aria-label="${c(o.refresh)}">${c(o.refresh)}</button>
|
|
588
|
+
<button type="button" class="rte-version-diff-btn rte-version-diff-close-btn" data-action="close" aria-label="${c(o.close)}">✕</button>
|
|
588
589
|
</div>
|
|
589
590
|
</header>
|
|
590
591
|
|
|
591
592
|
<div class="rte-version-diff-tabs" role="tablist" aria-label="Diff views">
|
|
592
|
-
<button type="button" role="tab" class="rte-version-diff-tab" data-tab="inline" aria-selected="true">${
|
|
593
|
-
<button type="button" role="tab" class="rte-version-diff-tab" data-tab="side" aria-selected="false">${
|
|
593
|
+
<button type="button" role="tab" class="rte-version-diff-tab" data-tab="inline" aria-selected="true">${c(o.tabInline)}</button>
|
|
594
|
+
<button type="button" role="tab" class="rte-version-diff-tab" data-tab="side" aria-selected="false">${c(o.tabSideBySide)}</button>
|
|
594
595
|
</div>
|
|
595
596
|
|
|
596
597
|
<div class="rte-version-diff-body">
|
|
@@ -601,12 +602,12 @@ function re(e, i, n) {
|
|
|
601
602
|
<section class="rte-version-diff-panel" data-panel="side" role="tabpanel">
|
|
602
603
|
<div class="rte-version-diff-side-grid">
|
|
603
604
|
<div>
|
|
604
|
-
<h3 class="rte-version-diff-pane-title">${
|
|
605
|
-
<div class="rte-version-diff-side-pane" data-side="baseline" aria-label="${
|
|
605
|
+
<h3 class="rte-version-diff-pane-title">${c(o.baseline)}</h3>
|
|
606
|
+
<div class="rte-version-diff-side-pane" data-side="baseline" aria-label="${c(o.baseline)}"></div>
|
|
606
607
|
</div>
|
|
607
608
|
<div>
|
|
608
|
-
<h3 class="rte-version-diff-pane-title">${
|
|
609
|
-
<div class="rte-version-diff-side-pane" data-side="current" aria-label="${
|
|
609
|
+
<h3 class="rte-version-diff-pane-title">${c(o.current)}</h3>
|
|
610
|
+
<div class="rte-version-diff-side-pane" data-side="current" aria-label="${c(o.current)}"></div>
|
|
610
611
|
</div>
|
|
611
612
|
</div>
|
|
612
613
|
</section>
|
|
@@ -618,116 +619,116 @@ function re(e, i, n) {
|
|
|
618
619
|
</footer>
|
|
619
620
|
`, r.appendChild(t), document.body.appendChild(r);
|
|
620
621
|
const b = t.querySelector(".rte-version-diff-select");
|
|
621
|
-
b.value =
|
|
622
|
-
const m = t.querySelector(".rte-version-diff-ignore-ws"),
|
|
623
|
-
let
|
|
624
|
-
const
|
|
625
|
-
const s = `<p class="rte-version-diff-empty">${
|
|
626
|
-
|
|
622
|
+
b.value = u;
|
|
623
|
+
const m = t.querySelector(".rte-version-diff-ignore-ws"), z = t.querySelector(".rte-version-diff-summary"), D = t.querySelector(".rte-version-diff-inline"), T = t.querySelector('[data-side="baseline"]'), q = t.querySelector('[data-side="current"]');
|
|
624
|
+
let w = 0;
|
|
625
|
+
const F = () => {
|
|
626
|
+
const s = `<p class="rte-version-diff-empty">${c(o.loading)}</p>`;
|
|
627
|
+
D.innerHTML = s, T.innerHTML = s, q.innerHTML = s, z.textContent = "";
|
|
627
628
|
}, a = async (s) => {
|
|
628
|
-
|
|
629
|
-
const v =
|
|
630
|
-
r.classList.toggle("rte-version-diff-theme-dark", Y(e)),
|
|
631
|
-
const
|
|
632
|
-
let
|
|
629
|
+
w += 1;
|
|
630
|
+
const v = w;
|
|
631
|
+
r.classList.toggle("rte-version-diff-theme-dark", Y(e)), F();
|
|
632
|
+
const x = e.innerHTML;
|
|
633
|
+
let $ = "";
|
|
633
634
|
try {
|
|
634
|
-
|
|
635
|
+
$ = await xe(e, n, s ?? i?.baselineHtml);
|
|
635
636
|
} catch {
|
|
636
|
-
|
|
637
|
+
$ = j.get(e) ?? re(e);
|
|
637
638
|
}
|
|
638
|
-
if (v !==
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
639
|
+
if (v !== w || !r.isConnected) return;
|
|
640
|
+
const oe = J($), se = J(x), ae = Q(oe, u, g), le = Q(se, u, g), L = ve(
|
|
641
|
+
ae,
|
|
642
|
+
le,
|
|
643
|
+
u,
|
|
643
644
|
g,
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
), _ =
|
|
647
|
-
|
|
645
|
+
n.maxMatrixSize,
|
|
646
|
+
n.maxTokens
|
|
647
|
+
), _ = ge(L.segments, o);
|
|
648
|
+
D.innerHTML = me(L.segments, o), T.innerHTML = _.baselineHtml, q.innerHTML = _.currentHtml;
|
|
648
649
|
const G = [
|
|
649
|
-
`+${
|
|
650
|
-
`-${
|
|
651
|
-
`${
|
|
650
|
+
`+${L.insertedCount} inserted`,
|
|
651
|
+
`-${L.deletedCount} deleted`,
|
|
652
|
+
`${L.equalCount} unchanged`
|
|
652
653
|
];
|
|
653
|
-
|
|
654
|
+
L.usedFallback && G.push(o.largeDocFallback), z.textContent = G.join(" | ");
|
|
654
655
|
}, h = (s) => {
|
|
655
|
-
|
|
656
|
-
const
|
|
657
|
-
v.setAttribute("aria-selected",
|
|
656
|
+
d = s, t.querySelectorAll(".rte-version-diff-tab").forEach((v) => {
|
|
657
|
+
const x = v.getAttribute("data-tab") === s;
|
|
658
|
+
v.setAttribute("aria-selected", x ? "true" : "false"), v.tabIndex = x ? 0 : -1;
|
|
658
659
|
}), t.querySelectorAll(".rte-version-diff-panel").forEach((v) => {
|
|
659
660
|
v.classList.toggle("active", v.getAttribute("data-panel") === s);
|
|
660
661
|
});
|
|
661
662
|
}, p = () => {
|
|
662
|
-
r.removeEventListener("keydown",
|
|
663
|
+
r.removeEventListener("keydown", B, !0), r.removeEventListener("click", A), document.removeEventListener("keydown", y, !0), r.parentNode && r.parentNode.removeChild(r), I = null, e.focus({ preventScroll: !0 });
|
|
663
664
|
}, y = (s) => {
|
|
664
665
|
s.key === "Escape" && (s.preventDefault(), s.stopPropagation(), p());
|
|
665
|
-
},
|
|
666
|
+
}, A = (s) => {
|
|
666
667
|
s.target === r && p();
|
|
667
|
-
},
|
|
668
|
+
}, B = (s) => {
|
|
668
669
|
if (s.key === "Escape") {
|
|
669
670
|
s.preventDefault(), p();
|
|
670
671
|
return;
|
|
671
672
|
}
|
|
672
|
-
if (
|
|
673
|
+
if ($e(s, t), s.target && s.target.classList.contains("rte-version-diff-tab") && (s.key === "ArrowRight" || s.key === "ArrowLeft")) {
|
|
673
674
|
s.preventDefault();
|
|
674
|
-
const v =
|
|
675
|
+
const v = d === "inline" ? "side" : "inline";
|
|
675
676
|
h(v), t.querySelector(`.rte-version-diff-tab[data-tab="${v}"]`)?.focus();
|
|
676
677
|
}
|
|
677
678
|
};
|
|
678
679
|
t.addEventListener("click", (s) => {
|
|
679
|
-
const v = s.target,
|
|
680
|
-
if (
|
|
680
|
+
const v = s.target, x = v.getAttribute("data-action");
|
|
681
|
+
if (x === "close") {
|
|
681
682
|
p();
|
|
682
683
|
return;
|
|
683
684
|
}
|
|
684
|
-
if (
|
|
685
|
+
if (x === "refresh") {
|
|
685
686
|
a();
|
|
686
687
|
return;
|
|
687
688
|
}
|
|
688
|
-
const
|
|
689
|
-
(
|
|
689
|
+
const $ = v.getAttribute("data-tab");
|
|
690
|
+
($ === "inline" || $ === "side") && h($);
|
|
690
691
|
}), b.addEventListener("change", () => {
|
|
691
|
-
|
|
692
|
+
u = b.value === "line" ? "line" : "word", a();
|
|
692
693
|
}), m.addEventListener("change", () => {
|
|
693
694
|
g = m.checked, a();
|
|
694
695
|
}), t.querySelector(".rte-version-diff-set-baseline").addEventListener("click", () => {
|
|
695
|
-
|
|
696
|
-
}), r.addEventListener("keydown",
|
|
696
|
+
j.set(e, e.innerHTML), a(e.innerHTML);
|
|
697
|
+
}), r.addEventListener("keydown", B, !0), r.addEventListener("click", A), document.addEventListener("keydown", y, !0), I = p, Ee(t), a();
|
|
697
698
|
}
|
|
698
|
-
function
|
|
699
|
-
|
|
700
|
-
if (!
|
|
699
|
+
function Le(e) {
|
|
700
|
+
N = e, !C && (C = (n) => {
|
|
701
|
+
if (!ye(n)) return;
|
|
701
702
|
if (document.querySelector(`.${l}`)) {
|
|
702
|
-
|
|
703
|
+
n.preventDefault();
|
|
703
704
|
return;
|
|
704
705
|
}
|
|
705
|
-
if (!!
|
|
706
|
-
const t =
|
|
706
|
+
if (!!n.target?.closest("input, textarea, select")) return;
|
|
707
|
+
const t = O(void 0, !1);
|
|
707
708
|
if (!t || t.getAttribute("contenteditable") === "false") return;
|
|
708
|
-
|
|
709
|
-
const o =
|
|
710
|
-
|
|
711
|
-
}, document.addEventListener("keydown",
|
|
712
|
-
}
|
|
713
|
-
function we() {
|
|
714
|
-
H && (document.removeEventListener("keydown", H, !0), H = null, V = null);
|
|
715
|
-
}
|
|
716
|
-
function Le() {
|
|
717
|
-
S || (S = (e) => {
|
|
718
|
-
const n = e.target?.closest($);
|
|
719
|
-
n && (D = n, X(n));
|
|
720
|
-
}, document.addEventListener("focusin", S, !0)), M || (M = (e) => {
|
|
721
|
-
const r = e.target?.closest($);
|
|
722
|
-
r && r.getAttribute("contenteditable") !== "false" && (D = r, X(r));
|
|
723
|
-
}, document.addEventListener("beforeinput", M, !0));
|
|
709
|
+
n.preventDefault(), n.stopPropagation();
|
|
710
|
+
const o = V.get(t) || N || e;
|
|
711
|
+
ie(t, o);
|
|
712
|
+
}, document.addEventListener("keydown", C, !0));
|
|
724
713
|
}
|
|
725
714
|
function Ce() {
|
|
726
|
-
|
|
715
|
+
C && (document.removeEventListener("keydown", C, !0), C = null, N = null);
|
|
716
|
+
}
|
|
717
|
+
function He() {
|
|
718
|
+
H || (H = (e) => {
|
|
719
|
+
const i = e.target?.closest(E);
|
|
720
|
+
i && (S = i, X(i));
|
|
721
|
+
}, document.addEventListener("focusin", H, !0)), M || (M = (e) => {
|
|
722
|
+
const r = e.target?.closest(E);
|
|
723
|
+
r && r.getAttribute("contenteditable") !== "false" && (S = r, X(r));
|
|
724
|
+
}, document.addEventListener("beforeinput", M, !0));
|
|
725
|
+
}
|
|
726
|
+
function Me() {
|
|
727
|
+
H && (document.removeEventListener("focusin", H, !0), H = null), M && (document.removeEventListener("beforeinput", M, !0), M = null);
|
|
727
728
|
}
|
|
728
|
-
const
|
|
729
|
-
const
|
|
730
|
-
return
|
|
729
|
+
const De = (e = {}) => {
|
|
730
|
+
const n = we(e);
|
|
731
|
+
return ke(), {
|
|
731
732
|
name: "versionDiff",
|
|
732
733
|
toolbar: [
|
|
733
734
|
{
|
|
@@ -738,16 +739,16 @@ const Se = (e = {}) => {
|
|
|
738
739
|
}
|
|
739
740
|
],
|
|
740
741
|
commands: {
|
|
741
|
-
openVersionDiff: (
|
|
742
|
-
const t =
|
|
743
|
-
return t ? (
|
|
742
|
+
openVersionDiff: (i, r) => {
|
|
743
|
+
const t = O(r);
|
|
744
|
+
return t ? (V.set(t, n), ie(t, n, i), !0) : !1;
|
|
744
745
|
},
|
|
745
|
-
setVersionDiffBaseline: (
|
|
746
|
-
const t =
|
|
746
|
+
setVersionDiffBaseline: (i, r) => {
|
|
747
|
+
const t = O(r);
|
|
747
748
|
if (!t) return !1;
|
|
748
|
-
|
|
749
|
-
const o = typeof
|
|
750
|
-
return
|
|
749
|
+
V.set(t, n);
|
|
750
|
+
const o = typeof i == "string" ? i : typeof i?.html == "string" ? i.html : t.innerHTML;
|
|
751
|
+
return j.set(t, o), !0;
|
|
751
752
|
}
|
|
752
753
|
},
|
|
753
754
|
keymap: {
|
|
@@ -756,13 +757,13 @@ const Se = (e = {}) => {
|
|
|
756
757
|
F8: "openVersionDiff"
|
|
757
758
|
},
|
|
758
759
|
init: () => {
|
|
759
|
-
|
|
760
|
+
K += 1, Le(n), He();
|
|
760
761
|
},
|
|
761
762
|
destroy: () => {
|
|
762
|
-
|
|
763
|
+
K = Math.max(0, K - 1), K === 0 && (ne(), Ce(), Me());
|
|
763
764
|
}
|
|
764
765
|
};
|
|
765
766
|
};
|
|
766
767
|
export {
|
|
767
|
-
|
|
768
|
+
De as VersionDiffPlugin
|
|
768
769
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editora/plugins",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Enterprise plugin suite for Editora rich text editor in React and web apps, including tables, media, workflow, and compliance tooling.",
|
|
5
5
|
"author": "Ajay Kumar <ajaykr089@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
"module": "dist/index.esm.js",
|
|
48
48
|
"types": "index.d.ts",
|
|
49
49
|
"style": "dist/plugins.css",
|
|
50
|
+
"sideEffects": [
|
|
51
|
+
"*.css"
|
|
52
|
+
],
|
|
50
53
|
"exports": {
|
|
51
54
|
".": {
|
|
52
55
|
"types": "./index.d.ts",
|
|
@@ -437,7 +440,7 @@
|
|
|
437
440
|
"verify:citations": "npm run typecheck:build && npm run test:citations && npm run test:content-rules && npm run test:approval-workflow && npm run test:pii-redaction && npm run test:smart-paste && npm run test:blocks-library && npm run test:doc-schema && npm run test:translation-workflow && npm run test:format-painter && npm run test:toolbar-icons && npm run test:dom && npm run build"
|
|
438
441
|
},
|
|
439
442
|
"peerDependencies": {
|
|
440
|
-
"@editora/core": "^1.0
|
|
443
|
+
"@editora/core": "^1.1.0"
|
|
441
444
|
},
|
|
442
445
|
"dependencies": {
|
|
443
446
|
"@editora/light-code-editor": "^1.0.19",
|
|
@@ -445,7 +448,7 @@
|
|
|
445
448
|
"mathjax": "^3.2.2"
|
|
446
449
|
},
|
|
447
450
|
"devDependencies": {
|
|
448
|
-
"@editora/core": "^1.0
|
|
451
|
+
"@editora/core": "^1.1.0",
|
|
449
452
|
"@types/katex": "^0.16.8",
|
|
450
453
|
"dompurify": "^3.4.16",
|
|
451
454
|
"typescript": "^5.0.0",
|