@editora/plugins 1.1.0 → 1.2.1
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/dist/comments.cjs.js +813 -340
- package/dist/comments.esm.js +1910 -654
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +48 -43
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +56 -51
- package/dist/plugins.css +1 -1
- package/dist/table.cjs.js +3 -3
- package/dist/table.esm.js +154 -154
- package/index.d.ts +63 -1
- package/package.json +1 -1
package/dist/enterprise.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./mentions.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./mentions.cjs.js"),o=require("./track-changes.cjs.js"),r=require("./version-diff.cjs.js"),l=require("./conditional-content.cjs.js"),g=require("./data-binding.cjs.js"),u=require("./content-rules.cjs.js"),s=require("./citations.cjs.js"),m=require("./approval-workflow.cjs.js"),c=require("./pii-redaction.cjs.js"),P=require("./smart-paste.cjs.js"),C=require("./blocks-library.cjs.js"),d=require("./doc-schema.cjs.js"),T=require("./translation-workflow.cjs.js"),p=require("./slash-commands.cjs.js"),M=require("./spell-check.cjs.js"),h=require("./a11y-checker.cjs.js"),n=require("./comments.cjs.js"),f=require("./merge-tag.cjs.js"),e=require("./template.cjs.js"),t=require("./MediaManagerPlugin.native-CycfjOi4.js"),i=require("./index-CtR8olYy.js"),q=require("./collaboration.cjs.js");exports.MentionPlugin=a.MentionPlugin;exports.TrackChangesPlugin=o.TrackChangesPlugin;exports.VersionDiffPlugin=r.VersionDiffPlugin;exports.ConditionalContentPlugin=l.ConditionalContentPlugin;exports.DataBindingPlugin=g.DataBindingPlugin;exports.ContentRulesPlugin=u.ContentRulesPlugin;exports.CitationsPlugin=s.CitationsPlugin;exports.ApprovalWorkflowPlugin=m.ApprovalWorkflowPlugin;exports.PIIRedactionPlugin=c.PIIRedactionPlugin;exports.SmartPastePlugin=P.SmartPastePlugin;exports.BlocksLibraryPlugin=C.BlocksLibraryPlugin;exports.DocSchemaPlugin=d.DocSchemaPlugin;exports.TranslationWorkflowPlugin=T.TranslationWorkflowPlugin;exports.SlashCommandsPlugin=p.SlashCommandsPlugin;exports.SpellCheckPlugin=M.SpellCheckPlugin;exports.A11yCheckerPlugin=h.A11yCheckerPlugin;exports.CommentsPlugin=n.CommentsPlugin;exports.configureComments=n.configureComments;exports.getCommentThreads=n.getCommentThreads;exports.removeCommentThread=n.removeCommentThread;exports.setCommentThreads=n.setCommentThreads;exports.upsertCommentThread=n.upsertCommentThread;exports.MergeTagPlugin=f.MergeTagPlugin;exports.PREDEFINED_TEMPLATES=e.PREDEFINED_TEMPLATES;exports.TemplatePlugin=e.TemplatePlugin;exports.addCustomTemplate=e.addCustomTemplate;exports.getAllTemplates=e.getAllTemplates;exports.getTemplateCategories=e.getTemplateCategories;exports.getTemplatesByCategory=e.getTemplatesByCategory;exports.sanitizeTemplate=e.sanitizeTemplate;exports.searchTemplates=e.searchTemplates;exports.validateTemplate=e.validateTemplate;exports.MediaManagerPlugin=t.MediaManagerPlugin;exports.getMediaManagerConfig=t.getMediaManagerConfig;exports.setMediaManagerConfig=t.setMediaManagerConfig;exports.DocumentManagerPlugin=i.DocumentManagerPlugin;exports.getDocumentManagerConfig=i.getDocumentManagerConfig;exports.setDocumentManagerConfig=i.setDocumentManagerConfig;exports.CollaborationPlugin=q.CollaborationPlugin;
|
package/dist/enterprise.esm.js
CHANGED
|
@@ -1,58 +1,63 @@
|
|
|
1
1
|
import { MentionPlugin as r } from "./mentions.esm.js";
|
|
2
|
-
import { TrackChangesPlugin as
|
|
3
|
-
import { VersionDiffPlugin as
|
|
4
|
-
import { ConditionalContentPlugin as
|
|
2
|
+
import { TrackChangesPlugin as n } from "./track-changes.esm.js";
|
|
3
|
+
import { VersionDiffPlugin as m } from "./version-diff.esm.js";
|
|
4
|
+
import { ConditionalContentPlugin as i } from "./conditional-content.esm.js";
|
|
5
5
|
import { DataBindingPlugin as p } from "./data-binding.esm.js";
|
|
6
|
-
import { ContentRulesPlugin as
|
|
6
|
+
import { ContentRulesPlugin as f } from "./content-rules.esm.js";
|
|
7
7
|
import { CitationsPlugin as P } from "./citations.esm.js";
|
|
8
8
|
import { ApprovalWorkflowPlugin as C } from "./approval-workflow.esm.js";
|
|
9
|
-
import { PIIRedactionPlugin as
|
|
10
|
-
import { SmartPastePlugin as
|
|
11
|
-
import { BlocksLibraryPlugin as
|
|
9
|
+
import { PIIRedactionPlugin as d } from "./pii-redaction.esm.js";
|
|
10
|
+
import { SmartPastePlugin as c } from "./smart-paste.esm.js";
|
|
11
|
+
import { BlocksLibraryPlugin as D } from "./blocks-library.esm.js";
|
|
12
12
|
import { DocSchemaPlugin as E } from "./doc-schema.esm.js";
|
|
13
13
|
import { TranslationWorkflowPlugin as y } from "./translation-workflow.esm.js";
|
|
14
|
-
import { SlashCommandsPlugin as
|
|
15
|
-
import { SpellCheckPlugin as
|
|
16
|
-
import { A11yCheckerPlugin as
|
|
17
|
-
import { CommentsPlugin as L } from "./comments.esm.js";
|
|
18
|
-
import { MergeTagPlugin as
|
|
19
|
-
import { PREDEFINED_TEMPLATES as
|
|
20
|
-
import { M as
|
|
21
|
-
import { D as
|
|
22
|
-
import { CollaborationPlugin as
|
|
14
|
+
import { SlashCommandsPlugin as v } from "./slash-commands.esm.js";
|
|
15
|
+
import { SpellCheckPlugin as I } from "./spell-check.esm.js";
|
|
16
|
+
import { A11yCheckerPlugin as b } from "./a11y-checker.esm.js";
|
|
17
|
+
import { CommentsPlugin as L, configureComments as W, getCommentThreads as z, removeCommentThread as F, setCommentThreads as N, upsertCommentThread as V } from "./comments.esm.js";
|
|
18
|
+
import { MergeTagPlugin as j } from "./merge-tag.esm.js";
|
|
19
|
+
import { PREDEFINED_TEMPLATES as G, TemplatePlugin as H, addCustomTemplate as J, getAllTemplates as K, getTemplateCategories as O, getTemplatesByCategory as Q, sanitizeTemplate as U, searchTemplates as X, validateTemplate as Y } from "./template.esm.js";
|
|
20
|
+
import { M as $, g as ee, s as oe } from "./MediaManagerPlugin.native-DZrmcmnm.mjs";
|
|
21
|
+
import { D as te, g as ne, s as ae } from "./index-Du_Ljqfz.mjs";
|
|
22
|
+
import { CollaborationPlugin as ge } from "./collaboration.esm.js";
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
b as A11yCheckerPlugin,
|
|
25
25
|
C as ApprovalWorkflowPlugin,
|
|
26
|
-
|
|
26
|
+
D as BlocksLibraryPlugin,
|
|
27
27
|
P as CitationsPlugin,
|
|
28
|
-
|
|
28
|
+
ge as CollaborationPlugin,
|
|
29
29
|
L as CommentsPlugin,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
i as ConditionalContentPlugin,
|
|
31
|
+
f as ContentRulesPlugin,
|
|
32
32
|
p as DataBindingPlugin,
|
|
33
33
|
E as DocSchemaPlugin,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
te as DocumentManagerPlugin,
|
|
35
|
+
$ as MediaManagerPlugin,
|
|
36
36
|
r as MentionPlugin,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
j as MergeTagPlugin,
|
|
38
|
+
d as PIIRedactionPlugin,
|
|
39
|
+
G as PREDEFINED_TEMPLATES,
|
|
40
|
+
v as SlashCommandsPlugin,
|
|
41
|
+
c as SmartPastePlugin,
|
|
42
|
+
I as SpellCheckPlugin,
|
|
43
|
+
H as TemplatePlugin,
|
|
44
|
+
n as TrackChangesPlugin,
|
|
45
45
|
y as TranslationWorkflowPlugin,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
m as VersionDiffPlugin,
|
|
47
|
+
J as addCustomTemplate,
|
|
48
|
+
W as configureComments,
|
|
49
|
+
K as getAllTemplates,
|
|
50
|
+
z as getCommentThreads,
|
|
51
|
+
ne as getDocumentManagerConfig,
|
|
52
|
+
ee as getMediaManagerConfig,
|
|
53
|
+
O as getTemplateCategories,
|
|
54
|
+
Q as getTemplatesByCategory,
|
|
55
|
+
F as removeCommentThread,
|
|
56
|
+
U as sanitizeTemplate,
|
|
57
|
+
X as searchTemplates,
|
|
58
|
+
N as setCommentThreads,
|
|
59
|
+
ae as setDocumentManagerConfig,
|
|
60
|
+
oe as setMediaManagerConfig,
|
|
61
|
+
V as upsertCommentThread,
|
|
62
|
+
Y as validateTemplate
|
|
58
63
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./heading.cjs.js"),o=require("./bold.cjs.js"),a=require("./italic.cjs.js"),u=require("./underline.cjs.js"),g=require("./strikethrough.cjs.js"),s=require("./list.cjs.js"),P=require("./checklist.cjs.js"),c=require("./history.cjs.js"),m=require("./link.cjs.js"),d=require("./blockquote.cjs.js"),C=require("./clear-formatting.cjs.js"),q=require("./CodePlugin.native-BwhZsI5v.js"),p=require("./table.cjs.js"),h=require("./font-size.cjs.js"),T=require("./format-painter.cjs.js"),k=require("./font-family.cjs.js"),f=require("./text-alignment.cjs.js"),M=require("./text-color.cjs.js"),b=require("./background-color.cjs.js"),S=require("./line-height.cjs.js"),v=require("./indent.cjs.js"),A=require("./direction.cjs.js"),D=require("./capitalization.cjs.js"),B=require("./math.cjs.js"),E=require("./special-characters.cjs.js"),F=require("./emojis.cjs.js"),y=require("./embed-iframe.cjs.js"),I=require("./anchor.cjs.js"),L=require("./mentions.cjs.js"),R=require("./track-changes.cjs.js"),w=require("./version-diff.cjs.js"),H=require("./conditional-content.cjs.js"),z=require("./data-binding.cjs.js"),U=require("./content-rules.cjs.js"),x=require("./citations.cjs.js"),G=require("./approval-workflow.cjs.js"),W=require("./pii-redaction.cjs.js"),_=require("./smart-paste.cjs.js"),j=require("./blocks-library.cjs.js"),N=require("./doc-schema.cjs.js"),V=require("./translation-workflow.cjs.js"),O=require("./slash-commands.cjs.js"),i=require("./MediaManagerPlugin.native-CycfjOi4.js"),J=require("./media-manager.cjs.js"),t=require("./index-CtR8olYy.js"),K=require("./preview.cjs.js"),Q=require("./fullscreen.cjs.js"),X=require("./print.cjs.js"),Y=require("./page-break.cjs.js"),Z=require("./footnote.cjs.js"),$=require("./code-sample.cjs.js"),ee=require("./merge-tag.cjs.js"),e=require("./template.cjs.js"),n=require("./comments.cjs.js"),ie=require("./collaboration.cjs.js"),ne=require("./spell-check.cjs.js"),re=require("./a11y-checker.cjs.js"),r=require("./shared-config.cjs.js");exports.HeadingPlugin=l.HeadingPlugin;exports.BoldPlugin=o.BoldPlugin;exports.ItalicPlugin=a.ItalicPlugin;exports.UnderlinePlugin=u.UnderlinePlugin;exports.StrikethroughPlugin=g.StrikethroughPlugin;exports.ListPlugin=s.ListPlugin;exports.ChecklistPlugin=P.ChecklistPlugin;exports.HistoryPlugin=c.HistoryPlugin;exports.LinkPlugin=m.LinkPlugin;exports.BlockquotePlugin=d.BlockquotePlugin;exports.ClearFormattingPlugin=C.ClearFormattingPlugin;exports.CodePlugin=q.CodePlugin;exports.TablePlugin=p.TablePlugin;exports.FontSizePlugin=h.FontSizePlugin;exports.FormatPainterPlugin=T.FormatPainterPlugin;exports.FontFamilyPlugin=k.FontFamilyPlugin;exports.TextAlignmentPlugin=f.TextAlignmentPlugin;exports.TextColorPlugin=M.TextColorPlugin;exports.BackgroundColorPlugin=b.BackgroundColorPlugin;exports.LineHeightPlugin=S.LineHeightPlugin;exports.IndentPlugin=v.IndentPlugin;exports.DirectionPlugin=A.DirectionPlugin;exports.CapitalizationPlugin=D.CapitalizationPlugin;exports.MathPlugin=B.MathPlugin;exports.SpecialCharactersPlugin=E.SpecialCharactersPlugin;exports.EmojisPlugin=F.EmojisPlugin;exports.EmbedIframePlugin=y.EmbedIframePlugin;exports.AnchorPlugin=I.AnchorPlugin;exports.MentionPlugin=L.MentionPlugin;exports.TrackChangesPlugin=R.TrackChangesPlugin;exports.VersionDiffPlugin=w.VersionDiffPlugin;exports.ConditionalContentPlugin=H.ConditionalContentPlugin;exports.DataBindingPlugin=z.DataBindingPlugin;exports.ContentRulesPlugin=U.ContentRulesPlugin;exports.CitationsPlugin=x.CitationsPlugin;exports.ApprovalWorkflowPlugin=G.ApprovalWorkflowPlugin;exports.PIIRedactionPlugin=W.PIIRedactionPlugin;exports.SmartPastePlugin=_.SmartPastePlugin;exports.BlocksLibraryPlugin=j.BlocksLibraryPlugin;exports.DocSchemaPlugin=N.DocSchemaPlugin;exports.TranslationWorkflowPlugin=V.TranslationWorkflowPlugin;exports.SlashCommandsPlugin=O.SlashCommandsPlugin;exports.MediaManagerPlugin=i.MediaManagerPlugin;exports.MediaUploadError=i.MediaUploadError;exports.createBase64Provider=i.createBase64Provider;exports.createCallbackProvider=i.createCallbackProvider;exports.createRestProvider=i.createRestProvider;exports.getMediaManagerConfig=i.getMediaManagerConfig;exports.parseEmbedUrl=i.parseEmbedUrl;exports.setMediaManagerConfig=i.setMediaManagerConfig;exports.mediaSlashItems=J.mediaSlashItems;exports.DocumentManagerPlugin=t.DocumentManagerPlugin;exports.getDocumentManagerConfig=t.getDocumentManagerConfig;exports.setDocumentManagerConfig=t.setDocumentManagerConfig;exports.PreviewPlugin=K.PreviewPlugin;exports.FullscreenPlugin=Q.FullscreenPlugin;exports.PrintPlugin=X.PrintPlugin;exports.PageBreakPlugin=Y.PageBreakPlugin;exports.FootnotePlugin=Z.FootnotePlugin;exports.CodeSamplePlugin=$.CodeSamplePlugin;exports.MergeTagPlugin=ee.MergeTagPlugin;exports.PREDEFINED_TEMPLATES=e.PREDEFINED_TEMPLATES;exports.TemplatePlugin=e.TemplatePlugin;exports.addCustomTemplate=e.addCustomTemplate;exports.getAllTemplates=e.getAllTemplates;exports.getTemplateCategories=e.getTemplateCategories;exports.getTemplatesByCategory=e.getTemplatesByCategory;exports.sanitizeTemplate=e.sanitizeTemplate;exports.searchTemplates=e.searchTemplates;exports.validateTemplate=e.validateTemplate;exports.CommentsPlugin=n.CommentsPlugin;exports.configureComments=n.configureComments;exports.getCommentThreads=n.getCommentThreads;exports.removeCommentThread=n.removeCommentThread;exports.setCommentThreads=n.setCommentThreads;exports.upsertCommentThread=n.upsertCommentThread;exports.CollaborationPlugin=ie.CollaborationPlugin;exports.SpellCheckPlugin=ne.SpellCheckPlugin;exports.A11yCheckerPlugin=re.A11yCheckerPlugin;exports.buildApiUrl=r.buildApiUrl;exports.getGlobalApiConfig=r.getGlobalApiConfig;exports.getGlobalApiHeaders=r.getGlobalApiHeaders;exports.setGlobalApiConfig=r.setGlobalApiConfig;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { HeadingPlugin as
|
|
1
|
+
import { HeadingPlugin as r } from "./heading.esm.js";
|
|
2
2
|
import { BoldPlugin as i } from "./bold.esm.js";
|
|
3
3
|
import { ItalicPlugin as l } from "./italic.esm.js";
|
|
4
|
-
import { UnderlinePlugin as
|
|
4
|
+
import { UnderlinePlugin as m } from "./underline.esm.js";
|
|
5
5
|
import { StrikethroughPlugin as p } from "./strikethrough.esm.js";
|
|
6
|
-
import { ListPlugin as
|
|
6
|
+
import { ListPlugin as u } from "./list.esm.js";
|
|
7
7
|
import { ChecklistPlugin as x } from "./checklist.esm.js";
|
|
8
8
|
import { HistoryPlugin as C } from "./history.esm.js";
|
|
9
9
|
import { LinkPlugin as c } from "./link.esm.js";
|
|
10
|
-
import { BlockquotePlugin as
|
|
10
|
+
import { BlockquotePlugin as h } from "./blockquote.esm.js";
|
|
11
11
|
import { ClearFormattingPlugin as k } from "./clear-formatting.esm.js";
|
|
12
12
|
import { C as A } from "./CodePlugin.native-CojLCp6C.mjs";
|
|
13
13
|
import { TablePlugin as S } from "./table.esm.js";
|
|
14
14
|
import { FontSizePlugin as B } from "./font-size.esm.js";
|
|
15
|
-
import { FormatPainterPlugin as
|
|
15
|
+
import { FormatPainterPlugin as v } from "./format-painter.esm.js";
|
|
16
16
|
import { FontFamilyPlugin as y } from "./font-family.esm.js";
|
|
17
17
|
import { TextAlignmentPlugin as H } from "./text-alignment.esm.js";
|
|
18
18
|
import { TextColorPlugin as U } from "./text-color.esm.js";
|
|
@@ -25,43 +25,43 @@ import { MathPlugin as O } from "./math.esm.js";
|
|
|
25
25
|
import { SpecialCharactersPlugin as X } from "./special-characters.esm.js";
|
|
26
26
|
import { EmojisPlugin as Z } from "./emojis.esm.js";
|
|
27
27
|
import { EmbedIframePlugin as oo } from "./embed-iframe.esm.js";
|
|
28
|
-
import { AnchorPlugin as
|
|
28
|
+
import { AnchorPlugin as ro } from "./anchor.esm.js";
|
|
29
29
|
import { MentionPlugin as io } from "./mentions.esm.js";
|
|
30
30
|
import { TrackChangesPlugin as lo } from "./track-changes.esm.js";
|
|
31
|
-
import { VersionDiffPlugin as
|
|
31
|
+
import { VersionDiffPlugin as mo } from "./version-diff.esm.js";
|
|
32
32
|
import { ConditionalContentPlugin as po } from "./conditional-content.esm.js";
|
|
33
|
-
import { DataBindingPlugin as
|
|
33
|
+
import { DataBindingPlugin as uo } from "./data-binding.esm.js";
|
|
34
34
|
import { ContentRulesPlugin as xo } from "./content-rules.esm.js";
|
|
35
35
|
import { CitationsPlugin as Co } from "./citations.esm.js";
|
|
36
36
|
import { ApprovalWorkflowPlugin as To } from "./approval-workflow.esm.js";
|
|
37
|
-
import { PIIRedactionPlugin as
|
|
37
|
+
import { PIIRedactionPlugin as Mo } from "./pii-redaction.esm.js";
|
|
38
38
|
import { SmartPastePlugin as bo } from "./smart-paste.esm.js";
|
|
39
39
|
import { BlocksLibraryPlugin as Do } from "./blocks-library.esm.js";
|
|
40
40
|
import { DocSchemaPlugin as Eo } from "./doc-schema.esm.js";
|
|
41
41
|
import { TranslationWorkflowPlugin as Fo } from "./translation-workflow.esm.js";
|
|
42
|
-
import { SlashCommandsPlugin as
|
|
42
|
+
import { SlashCommandsPlugin as Io } from "./slash-commands.esm.js";
|
|
43
43
|
import { M as Lo, a as Ho, c as Ro, b as Uo, d as wo, g as zo, p as Go, s as Wo } from "./MediaManagerPlugin.native-DZrmcmnm.mjs";
|
|
44
44
|
import { mediaSlashItems as qo } from "./media-manager.esm.js";
|
|
45
45
|
import { D as Vo, g as _o, s as Jo } from "./index-Du_Ljqfz.mjs";
|
|
46
46
|
import { PreviewPlugin as Oo } from "./preview.esm.js";
|
|
47
47
|
import { FullscreenPlugin as Xo } from "./fullscreen.esm.js";
|
|
48
48
|
import { PrintPlugin as Zo } from "./print.esm.js";
|
|
49
|
-
import { PageBreakPlugin as
|
|
50
|
-
import { FootnotePlugin as
|
|
51
|
-
import { CodeSamplePlugin as
|
|
52
|
-
import { MergeTagPlugin as
|
|
53
|
-
import { PREDEFINED_TEMPLATES as
|
|
54
|
-
import { CommentsPlugin as
|
|
55
|
-
import { CollaborationPlugin as
|
|
56
|
-
import { SpellCheckPlugin as
|
|
57
|
-
import { A11yCheckerPlugin as
|
|
58
|
-
import { buildApiUrl as
|
|
49
|
+
import { PageBreakPlugin as oe } from "./page-break.esm.js";
|
|
50
|
+
import { FootnotePlugin as re } from "./footnote.esm.js";
|
|
51
|
+
import { CodeSamplePlugin as ie } from "./code-sample.esm.js";
|
|
52
|
+
import { MergeTagPlugin as le } from "./merge-tag.esm.js";
|
|
53
|
+
import { PREDEFINED_TEMPLATES as me, TemplatePlugin as ge, addCustomTemplate as pe, getAllTemplates as fe, getTemplateCategories as ue, getTemplatesByCategory as Pe, sanitizeTemplate as xe, searchTemplates as se, validateTemplate as Ce } from "./template.esm.js";
|
|
54
|
+
import { CommentsPlugin as ce, configureComments as Te, getCommentThreads as he, removeCommentThread as Me, setCommentThreads as ke, upsertCommentThread as be } from "./comments.esm.js";
|
|
55
|
+
import { CollaborationPlugin as De } from "./collaboration.esm.js";
|
|
56
|
+
import { SpellCheckPlugin as Ee } from "./spell-check.esm.js";
|
|
57
|
+
import { A11yCheckerPlugin as Fe } from "./a11y-checker.esm.js";
|
|
58
|
+
import { buildApiUrl as Ie, getGlobalApiConfig as ye, getGlobalApiHeaders as Le, setGlobalApiConfig as He } from "./shared-config.esm.js";
|
|
59
59
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
Fe as A11yCheckerPlugin,
|
|
61
|
+
ro as AnchorPlugin,
|
|
62
62
|
To as ApprovalWorkflowPlugin,
|
|
63
63
|
z as BackgroundColorPlugin,
|
|
64
|
-
|
|
64
|
+
h as BlockquotePlugin,
|
|
65
65
|
Do as BlocksLibraryPlugin,
|
|
66
66
|
i as BoldPlugin,
|
|
67
67
|
J as CapitalizationPlugin,
|
|
@@ -69,12 +69,12 @@ export {
|
|
|
69
69
|
Co as CitationsPlugin,
|
|
70
70
|
k as ClearFormattingPlugin,
|
|
71
71
|
A as CodePlugin,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
ie as CodeSamplePlugin,
|
|
73
|
+
De as CollaborationPlugin,
|
|
74
|
+
ce as CommentsPlugin,
|
|
75
75
|
po as ConditionalContentPlugin,
|
|
76
76
|
xo as ContentRulesPlugin,
|
|
77
|
-
|
|
77
|
+
uo as DataBindingPlugin,
|
|
78
78
|
V as DirectionPlugin,
|
|
79
79
|
Eo as DocSchemaPlugin,
|
|
80
80
|
Vo as DocumentManagerPlugin,
|
|
@@ -82,57 +82,62 @@ export {
|
|
|
82
82
|
Z as EmojisPlugin,
|
|
83
83
|
y as FontFamilyPlugin,
|
|
84
84
|
B as FontSizePlugin,
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
re as FootnotePlugin,
|
|
86
|
+
v as FormatPainterPlugin,
|
|
87
87
|
Xo as FullscreenPlugin,
|
|
88
|
-
|
|
88
|
+
r as HeadingPlugin,
|
|
89
89
|
C as HistoryPlugin,
|
|
90
90
|
q as IndentPlugin,
|
|
91
91
|
l as ItalicPlugin,
|
|
92
92
|
W as LineHeightPlugin,
|
|
93
93
|
c as LinkPlugin,
|
|
94
|
-
|
|
94
|
+
u as ListPlugin,
|
|
95
95
|
O as MathPlugin,
|
|
96
96
|
Lo as MediaManagerPlugin,
|
|
97
97
|
Ho as MediaUploadError,
|
|
98
98
|
io as MentionPlugin,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
le as MergeTagPlugin,
|
|
100
|
+
Mo as PIIRedactionPlugin,
|
|
101
|
+
me as PREDEFINED_TEMPLATES,
|
|
102
|
+
oe as PageBreakPlugin,
|
|
103
103
|
Oo as PreviewPlugin,
|
|
104
104
|
Zo as PrintPlugin,
|
|
105
|
-
|
|
105
|
+
Io as SlashCommandsPlugin,
|
|
106
106
|
bo as SmartPastePlugin,
|
|
107
107
|
X as SpecialCharactersPlugin,
|
|
108
|
-
|
|
108
|
+
Ee as SpellCheckPlugin,
|
|
109
109
|
p as StrikethroughPlugin,
|
|
110
110
|
S as TablePlugin,
|
|
111
|
-
|
|
111
|
+
ge as TemplatePlugin,
|
|
112
112
|
H as TextAlignmentPlugin,
|
|
113
113
|
U as TextColorPlugin,
|
|
114
114
|
lo as TrackChangesPlugin,
|
|
115
115
|
Fo as TranslationWorkflowPlugin,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
m as UnderlinePlugin,
|
|
117
|
+
mo as VersionDiffPlugin,
|
|
118
|
+
pe as addCustomTemplate,
|
|
119
|
+
Ie as buildApiUrl,
|
|
120
|
+
Te as configureComments,
|
|
120
121
|
Ro as createBase64Provider,
|
|
121
122
|
Uo as createCallbackProvider,
|
|
122
123
|
wo as createRestProvider,
|
|
123
|
-
|
|
124
|
+
fe as getAllTemplates,
|
|
125
|
+
he as getCommentThreads,
|
|
124
126
|
_o as getDocumentManagerConfig,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
ye as getGlobalApiConfig,
|
|
128
|
+
Le as getGlobalApiHeaders,
|
|
127
129
|
zo as getMediaManagerConfig,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
ue as getTemplateCategories,
|
|
131
|
+
Pe as getTemplatesByCategory,
|
|
130
132
|
qo as mediaSlashItems,
|
|
131
133
|
Go as parseEmbedUrl,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
Me as removeCommentThread,
|
|
135
|
+
xe as sanitizeTemplate,
|
|
136
|
+
se as searchTemplates,
|
|
137
|
+
ke as setCommentThreads,
|
|
134
138
|
Jo as setDocumentManagerConfig,
|
|
135
|
-
|
|
139
|
+
He as setGlobalApiConfig,
|
|
136
140
|
Wo as setMediaManagerConfig,
|
|
137
|
-
|
|
141
|
+
be as upsertCommentThread,
|
|
142
|
+
Ce as validateTemplate
|
|
138
143
|
};
|
package/dist/plugins.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rte-table-wrapper{position:relative}.rte-table,table{border-collapse:collapse;width:100%;margin:1rem 0;border:1px solid #ddd;font-size:14px;line-height:1.4;position:relative}.rte-table td,.rte-table th,table td,table th{border:1px solid #ddd;padding:8px 12px;min-width:80px;vertical-align:top;position:relative
|
|
1
|
+
.rte-table-wrapper{position:relative}.rte-table,table{border-collapse:collapse;width:100%;margin:1rem 0;border:1px solid #ddd;font-size:14px;line-height:1.4;position:relative}.rte-table td,.rte-table th,table td,table th{border:1px solid #ddd;padding:8px 12px;min-width:80px;vertical-align:top;position:relative}.rte-table td:focus,.rte-table th:focus,table td:focus,table th:focus{outline:2px solid #007acc;outline-offset:-2px}.rte-table th,table th{background-color:#f8f9fa;font-weight:600;text-align:left}.rte-table td p,table td p{margin:0;padding:0}.rte-table td p:empty:before,table td p:empty:before{content:"";display:inline-block}.rte-table td[contenteditable]:empty:before,table td[contenteditable]:empty:before{content:"Type here...";color:#999;font-style:italic;pointer-events:none}.rte-table tr:hover,table tr:hover{background-color:#f8f9fa}.rte-table td.selected,table td.selected{background-color:#e3f2fd;border-color:#2196f3}.table-toolbar{background:#fff;border:1px solid #d0d0d0;border-radius:4px;box-shadow:0 2px 8px #0000001a;padding:4px;display:flex;align-items:center;gap:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;min-width:max-content}.toolbar-section{display:flex;align-items:center;gap:2px}.toolbar-divider{width:1px;height:20px;background:#e0e0e0;margin:0 4px}.toolbar-icon-btn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid transparent;background:transparent;cursor:pointer;color:#333;border-radius:3px;transition:all .2s ease;flex-shrink:0;font-size:14px;line-height:1}.toolbar-icon-btn svg{width:16px;height:16px}.toolbar-icon-btn:hover:not(:disabled){background:#f0f0f0;border-color:#d0d0d0;color:#06c}.toolbar-icon-btn:active:not(:disabled){background:#e8f0ff;border-color:#06c;transform:scale(.95)}.toolbar-icon-btn:disabled{opacity:.4;cursor:not-allowed;color:#ccc}.toolbar-icon-btn-danger{color:#d32f2f}.toolbar-icon-btn-danger:hover:not(:disabled){background:#fff3f3;border-color:#fcc;color:#d32f2f}.toolbar-icon-btn-danger:active:not(:disabled){background:#ffebee}.toolbar-icon-btn-delete{color:#d32f2f}.toolbar-icon-btn-delete:hover:not(:disabled){background:#fff3f3;border-color:#fcc;color:#d32f2f}.toolbar-icon-btn-delete:active:not(:disabled){background:#ffebee}.resize-handle{opacity:0;transition:all .15s ease}.resize-handle:hover{opacity:1}td:hover>.resize-handle,th:hover>.resize-handle{opacity:1}.table-resize-handle{position:absolute;bottom:-4px;right:-4px;width:12px;height:12px;background:transparent;cursor:nwse-resize;z-index:10;transition:background .15s ease}.table-resize-handle:after{content:"";position:absolute;bottom:0;right:0;width:8px;height:8px;background:#0066cc4d;border-bottom:2px solid #0066cc;border-right:2px solid #0066cc;border-radius:0 0 2px;opacity:0;transition:opacity .15s ease}.table-resize-handle:hover:after{opacity:1}.rte-table:hover .table-resize-handle:after,table:hover .table-resize-handle:after{opacity:1}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table,table){border-color:#607088;background:#24303c;color:#e6eefb}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table td,.rte-table th,table td,table th){border-color:#607088;color:#e6eefb}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table th,table th){background:linear-gradient(180deg,#3b4553,#333d4a);color:#f3f8ff}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table tr:hover,table tr:hover){background-color:#58a6ff1f}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table td.selected,table td.selected){background-color:#58a6ff47;border-color:#79beff}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table td[contenteditable]:empty:before,table td[contenteditable]:empty:before){color:#94a3b8}:is([data-theme=dark],.dark,.editora-theme-dark) .table-toolbar{background:linear-gradient(180deg,#2f3844,#2a323c);border-color:#4d596b;box-shadow:0 8px 20px #00000073}.table-toolbar.rte-theme-dark{background:linear-gradient(180deg,#2f3844,#2a323c);border-color:#4d596b;box-shadow:0 8px 20px #00000073}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-divider{background:#4d596b}.table-toolbar.rte-theme-dark .toolbar-divider{background:#4d596b}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn{color:#d7deea;border-color:transparent}.table-toolbar.rte-theme-dark .toolbar-icon-btn{color:#d7deea;border-color:transparent}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg{color:currentColor}.table-toolbar.rte-theme-dark .toolbar-icon-btn svg{color:currentColor}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [stroke="#000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [stroke="#000000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [stroke=black i]{stroke:currentColor!important}.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [stroke="#000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [stroke="#000000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [stroke=black i]{stroke:currentColor!important}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [fill="#000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [fill="#000000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [fill=black i]{fill:currentColor!important}.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [fill="#000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [fill="#000000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [fill=black i]{fill:currentColor!important}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn:hover:not(:disabled){background:#3a4554;border-color:#607088;color:#f3f8ff}.table-toolbar.rte-theme-dark .toolbar-icon-btn:hover:not(:disabled){background:#3a4554;border-color:#607088;color:#f3f8ff}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn:active:not(:disabled){background:#4a95de;border-color:#67adf4;color:#0f1b2a}.table-toolbar.rte-theme-dark .toolbar-icon-btn:active:not(:disabled){background:#4a95de;border-color:#67adf4;color:#0f1b2a}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn:disabled{color:#7f8ca1}.table-toolbar.rte-theme-dark .toolbar-icon-btn:disabled{color:#7f8ca1}@media(max-width:768px){.rte-table,table{font-size:12px}.rte-table td,.rte-table th,table td,table th{padding:4px 6px;min-width:60px}.table-toolbar{padding:3px;gap:0;max-width:90vw;overflow-x:auto}.toolbar-icon-btn{width:26px;height:26px}.toolbar-divider{height:18px}}@media print{.rte-table,table{border:1px solid #000}.rte-table td,.rte-table th,table td,table th{border:1px solid #000;padding:4px}.table-toolbar{display:none}}
|
package/dist/table.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const $=require("./notify-BkbzMopb.js"),V=require("./editorContainerHelpers-CFbfiOJI.js");let h=null,b=null,B=null,N=null,D=null,q=null,P=null;const H='[data-theme="dark"], .dark, .editora-theme-dark';let E=!1,k=null,O=0,K=0,R=!1,_=0,W=0,X=0,F=0;const ee=new Set(["DIV","P","BLOCKQUOTE","PRE","H1","H2","H3","H4","H5","H6","LI","TD","TH"]);function U(e,t){let n=e;for(;n&&n!==t;){if(n.nodeType===Node.ELEMENT_NODE&&ee.has(n.tagName))return n;n=n.parentNode}return null}function Y(e){const t=e.parentElement;if(t&&t.classList.contains("rte-table-wrapper"))return t;const n=document.createElement("div");return n.className="rte-table-wrapper",t?.insertBefore(n,e),n.appendChild(e),n}const te=()=>{const e=V.findEditorContainerFromSelection(),t=V.getContentElement(e);if(!t)return $.notify("Please place your cursor in the editor before inserting a table"),!1;const n=window.getSelection();if(!n||n.rangeCount===0)return;const o=n.getRangeAt(0),l=document.createElement("table");l.className="rte-table";const r=document.createElement("thead"),a=document.createElement("tr");for(let m=0;m<3;m++){const g=document.createElement("th"),v=document.createElement("p");v.appendChild(document.createElement("br")),g.appendChild(v),a.appendChild(g)}r.appendChild(a);const i=document.createElement("tbody");for(let m=0;m<2;m++){const g=document.createElement("tr");for(let v=0;v<3;v++){const x=document.createElement("td"),A=document.createElement("p");A.appendChild(document.createElement("br")),x.appendChild(A),g.appendChild(x)}i.appendChild(g)}l.appendChild(r),l.appendChild(i);const u=Y(l),d=(m,g,v)=>{if(m!==t)return m;const x=v?g-1:g;return t.childNodes[Math.min(Math.max(x,0),t.childNodes.length-1)]||null},s=d(o.endContainer,o.endOffset,!0),c=d(o.startContainer,o.startOffset,!1),C=s&&U(s,t)||c&&U(c,t);C&&C.parentNode?C.parentNode.insertBefore(u,C.nextSibling):(o.collapse(!1),o.insertNode(u));const L=l.querySelector("th p");if(L){const m=document.createRange();m.setStart(L,0),m.collapse(!0),n.removeAllRanges(),n.addRange(m)}t.focus()},ne=()=>{const e=f();if(!e)return;const{table:t,rowIndex:n}=e,o=document.createElement("tr"),l=t.rows[0]?.cells.length||0;for(let a=0;a<l;a++){const i=document.createElement("td"),u=document.createElement("p");u.innerHTML="<br>",i.appendChild(u),o.appendChild(i)}const r=t.rows[n];r&&r.parentElement?r.parentElement.insertBefore(o,r):t.appendChild(o),p()},oe=()=>{const e=f();if(!e)return;const{table:t,rowIndex:n}=e,o=document.createElement("tr"),l=t.rows[0]?.cells.length||0;for(let r=0;r<l;r++){const a=document.createElement("td"),i=document.createElement("p");i.innerHTML="<br>",a.appendChild(i),o.appendChild(a)}if(n>=t.rows.length-1){const r=t.rows[t.rows.length-1];r&&r.parentElement?r.parentElement.appendChild(o):t.appendChild(o)}else{const r=t.rows[n+1];r.parentElement?.insertBefore(o,r)}p()},re=()=>{const e=f();if(!e)return;const{table:t,colIndex:n}=e;for(let o=0;o<t.rows.length;o++){const l=t.rows[o],r=document.createElement("td"),a=document.createElement("p");a.innerHTML="<br>",r.appendChild(a),n===0?l.insertBefore(r,l.cells[0]):l.insertBefore(r,l.cells[n])}p()},le=()=>{const e=f();if(!e)return;const{table:t,colIndex:n}=e;for(let o=0;o<t.rows.length;o++){const l=t.rows[o],r=document.createElement("td"),a=document.createElement("p");a.innerHTML="<br>",r.appendChild(a),n>=l.cells.length-1?l.appendChild(r):l.insertBefore(r,l.cells[n+1])}p()},ae=()=>{const e=f();if(!e||e.rowCount<=1)return;const{table:t,rowIndex:n,colIndex:o}=e;t.deleteRow(n),Q(t,n,o),p()},ie=()=>{const e=f();if(!e||e.cellCount<=1)return;const{table:t,rowIndex:n,colIndex:o}=e;for(let l=0;l<t.rows.length;l++){const r=t.rows[l];r.cells[o]&&r.deleteCell(o)}Q(t,n,o),p()},de=()=>{const e=f();if(!e)return;const{table:t,rowIndex:n}=e,o=t.rows[n];if(!o)return;const l=o.parentElement?.tagName.toLowerCase()==="thead",r=t.querySelector("thead");if(l){const a=o.parentElement;if(o===a.rows[a.rows.length-1]){const i=t.querySelector("tbody")||t.appendChild(document.createElement("tbody"));i.insertBefore(o,i.firstChild),a.rows.length===0&&a.remove()}else j(o,"td")}else if(!r||o===t.tBodies[0]?.rows[0]){let a=r;a||(a=document.createElement("thead"),t.insertBefore(a,t.firstChild)),a.appendChild(o)}else j(o,"th");p()};function j(e,t){Array.from(e.cells).forEach(n=>{if(n.tagName.toLowerCase()===t)return;const o=document.createElement(t);o.innerHTML=n.innerHTML;for(let l=0;l<n.attributes.length;l++){const r=n.attributes[l];o.setAttribute(r.name,r.value)}n.parentNode?.replaceChild(o,n)})}const se=()=>{const e=f();if(!e)return;const{table:t,colIndex:n}=e;for(let o=0;o<t.rows.length;o++){const l=t.rows[o].cells[n];if(l){const r=l.tagName.toLowerCase()==="th"?"td":"th",a=document.createElement(r);a.innerHTML=l.innerHTML;for(let i=0;i<l.attributes.length;i++){const u=l.attributes[i];a.setAttribute(u.name,u.value)}l.parentNode?.replaceChild(a,l)}}p()},ce=()=>{const e=f();if(!e)return;const t=e.table,n=t.parentElement;n&&n.classList.contains("rte-table-wrapper")?n.remove():t.remove(),document.dispatchEvent(new CustomEvent("tableDeleted"))};function w(e,t){if(!e||!(e instanceof Node))return null;const n=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;return n?n.closest(t):null}function I(e){if(!e)return!1;const t=e.closest("[contenteditable]");return!t||t.getAttribute("contenteditable")==="false"?!1:!t.closest('[data-readonly="true"]')}function ue(){const e=window.getSelection(),t=e&&e.rangeCount>0?e.getRangeAt(0).startContainer:null;return w(t,".rte-content")||(b?b.closest(".rte-content"):null)}function he(e,t,n){const o=window.execEditorCommand||window.executeEditorCommand;if(typeof o=="function")try{o("recordDomTransaction",e,t,n)}catch{}}function G(e){const t=ue();if(t&&!I(t))return;const n=t?t.innerHTML:"";if(e(),!t)return;const o=t.innerHTML;o!==n&&(he(t,n,o),t.dispatchEvent(new Event("input",{bubbles:!0})))}function Q(e,t,n){if(!e.isConnected||e.rows.length===0)return;const o=e.rows[Math.min(t,e.rows.length-1)],l=o.cells[Math.min(n,o.cells.length-1)];if(!l)return;const r=document.createRange(),a=l.querySelector("p, div, li")||l;r.selectNodeContents(a),r.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(r)}const be=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return;const n=e.getRangeAt(0).startContainer;if(!w(n,"table"))return;const o=w(n,"td, th");if(!o)return;const l=o.parentElement;if(!l)return;let r=-1;for(let d=0;d<l.cells.length;d++)if(l.cells[d]===o){r=d;break}if(r===-1||r===l.cells.length-1)return;const a=l.cells[r+1];if(!a)return;const i=(d,s)=>{const c=parseInt(d.getAttribute(s)||"1",10);return Number.isFinite(c)&&c>0?c:1};if(i(o,"rowspan")!==i(a,"rowspan"))return;o.setAttribute("colspan",String(i(o,"colspan")+i(a,"colspan"))),Array.from(a.childNodes).forEach(d=>{o.appendChild(d)}),a.remove(),p()};function f(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const n=e.getRangeAt(0).startContainer,o=w(n,"table");if(!o)return null;let l=0,r=0;const a=w(n,"td, th");if(a){const i=a.parentElement;for(;i&&i!==o.rows[l]&&(l++,!(l>=o.rows.length)););const u=i;if(u){for(let d=0;d<u.cells.length;d++)if(u.cells[d]===a){r=d;break}}}return{table:o,rowIndex:l,colIndex:r,rowCount:o.rows.length,cellCount:o.rows[0]?.cells.length||0}}function p(){if(!h||!b)return;const e=f();if(!e)return;const t=e.rowCount>1,n=e.cellCount>1;Z(t,n)}function me(e){const t=window.getSelection();if(!t)return;const n=document.createRange();(e.textContent??"").trim()===""?(n.selectNodeContents(e.querySelector("p, div")||e),n.collapse(!0)):n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}function fe(e){if(e.key!=="Tab"||e.defaultPrevented||e.ctrlKey||e.metaKey||e.altKey)return;const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=w(t.getRangeAt(0).startContainer,"td, th"),o=n?.closest("table");if(!n||!o||!I(o))return;const l=o.closest("[contenteditable]");if(!l||!(e.target instanceof Node)||!l.contains(e.target))return;const r=Array.from(o.querySelectorAll("th, td")).filter(u=>u.closest("table")===o),a=r.indexOf(n);let i;e.shiftKey?i=r[a-1]:a<r.length-1?i=r[a+1]:(y("addRowBelow"),i=n.parentElement?.nextElementSibling?.querySelector("th, td")),i&&(e.preventDefault(),me(i))}function pe(){B=()=>{const e=f();e&&I(e.table)?ge(e.table):T()},N=e=>{const t=w(e.target,"table"),n=w(e.target,".table-toolbar");!t&&!n&&T()},D=()=>{T()},q=()=>{b&&h&&h.style.display!=="none"&&S(b)},P=()=>{b&&h&&h.style.display!=="none"&&S(b)},document.addEventListener("selectionchange",B),document.addEventListener("keydown",fe),document.addEventListener("mousedown",N),document.addEventListener("tableDeleted",D),window.addEventListener("scroll",q,!0),window.addEventListener("resize",P)}function S(e){if(!h)return;const t=e.getBoundingClientRect(),n=h.getBoundingClientRect(),o=n.height||40,l=n.width||280,r=10;let a=t.top-o-r,i=t.left+t.width/2-l/2;a<r&&(a=t.bottom+r),i<r&&(i=r);const u=window.innerWidth;i+l>u-r&&(i=u-l-r);const d=window.innerHeight;a+o>d-r&&(a=d-o-r),h.style.top=a+"px",h.style.left=i+"px"}function ge(e){b=e,h||(h=ve(),document.body.appendChild(h));const t=!!e.closest(H)||document.body.matches(H)||document.documentElement.matches(H);h.classList.toggle("rte-theme-dark",t),h.style.display="flex",h.style.visibility="hidden",requestAnimationFrame(()=>{S(e),h&&(h.style.visibility="visible")});const n=f();n&&Z(n.rowCount>1,n.cellCount>1),Ce(e)}const M=new Set;function J(){M.forEach(e=>{e.style.position==="relative"&&(e.style.removeProperty("position"),e.getAttribute("style")?.trim()||e.removeAttribute("style"))}),M.clear()}function T(){if(h&&(h.style.display="none"),b){b.querySelectorAll(".resize-handle").forEach(o=>o.remove());const t=b.parentElement,n=t?.classList.contains("rte-table-wrapper")?t.querySelector(".table-resize-handle"):b.querySelector(".table-resize-handle");n&&n.remove()}J(),b=null}function Z(e,t){if(!h)return;const n=h.querySelector('[data-action="deleteRow"]'),o=h.querySelector('[data-action="deleteColumn"]');n&&(n.disabled=!e),o&&(o.disabled=!t)}let z=!1;function we(){if(z||typeof document>"u")return;if(document.getElementById("rte-table-toolbar-styles")){z=!0;return}z=!0;const e=document.createElement("style");e.id="rte-table-toolbar-styles",e.textContent=`
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const $=require("./notify-BkbzMopb.js"),B=require("./editorContainerHelpers-CFbfiOJI.js");let h=null,b=null,V=null,N=null,D=null,q=null,O=null;const H='[data-theme="dark"], .dark, .editora-theme-dark';let E=!1,k=null,P=0,K=0,R=!1,_=0,W=0,X=0,F=0;const ee=new Set(["DIV","P","BLOCKQUOTE","PRE","H1","H2","H3","H4","H5","H6","LI","TD","TH"]);function U(e,t){let o=e;for(;o&&o!==t;){if(o.nodeType===Node.ELEMENT_NODE&&ee.has(o.tagName))return o;o=o.parentNode}return null}function Y(e){const t=e.parentElement;if(t&&t.classList.contains("rte-table-wrapper"))return t;const o=window.getSelection(),{anchorNode:n,anchorOffset:l,focusNode:r,focusOffset:a}=o??{},i=!!o&&!!n&&!!r&&(e.contains(n)||e.contains(r)),c=document.createElement("div");return c.className="rte-table-wrapper",t?.insertBefore(c,e),c.appendChild(e),i&&o&&n&&r&&n.isConnected&&r.isConnected&&o.setBaseAndExtent(n,l??0,r,a??0),c}const te=()=>{const e=B.findEditorContainerFromSelection(),t=B.getContentElement(e);if(!t)return $.notify("Please place your cursor in the editor before inserting a table"),!1;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0),l=document.createElement("table");l.className="rte-table";const r=document.createElement("thead"),a=document.createElement("tr");for(let m=0;m<3;m++){const g=document.createElement("th"),v=document.createElement("p");v.appendChild(document.createElement("br")),g.appendChild(v),a.appendChild(g)}r.appendChild(a);const i=document.createElement("tbody");for(let m=0;m<2;m++){const g=document.createElement("tr");for(let v=0;v<3;v++){const x=document.createElement("td"),A=document.createElement("p");A.appendChild(document.createElement("br")),x.appendChild(A),g.appendChild(x)}i.appendChild(g)}l.appendChild(r),l.appendChild(i);const c=Y(l),d=(m,g,v)=>{if(m!==t)return m;const x=v?g-1:g;return t.childNodes[Math.min(Math.max(x,0),t.childNodes.length-1)]||null},s=d(n.endContainer,n.endOffset,!0),u=d(n.startContainer,n.startOffset,!1),C=s&&U(s,t)||u&&U(u,t);C&&C.parentNode?C.parentNode.insertBefore(c,C.nextSibling):(n.collapse(!1),n.insertNode(c));const L=l.querySelector("th p");if(L){const m=document.createRange();m.setStart(L,0),m.collapse(!0),o.removeAllRanges(),o.addRange(m)}t.focus()},ne=()=>{const e=f();if(!e)return;const{table:t,rowIndex:o}=e,n=document.createElement("tr"),l=t.rows[0]?.cells.length||0;for(let a=0;a<l;a++){const i=document.createElement("td"),c=document.createElement("p");c.innerHTML="<br>",i.appendChild(c),n.appendChild(i)}const r=t.rows[o];r&&r.parentElement?r.parentElement.insertBefore(n,r):t.appendChild(n),p()},oe=()=>{const e=f();if(!e)return;const{table:t,rowIndex:o}=e,n=document.createElement("tr"),l=t.rows[0]?.cells.length||0;for(let r=0;r<l;r++){const a=document.createElement("td"),i=document.createElement("p");i.innerHTML="<br>",a.appendChild(i),n.appendChild(a)}if(o>=t.rows.length-1){const r=t.rows[t.rows.length-1];r&&r.parentElement?r.parentElement.appendChild(n):t.appendChild(n)}else{const r=t.rows[o+1];r.parentElement?.insertBefore(n,r)}p()},re=()=>{const e=f();if(!e)return;const{table:t,colIndex:o}=e;for(let n=0;n<t.rows.length;n++){const l=t.rows[n],r=document.createElement("td"),a=document.createElement("p");a.innerHTML="<br>",r.appendChild(a),o===0?l.insertBefore(r,l.cells[0]):l.insertBefore(r,l.cells[o])}p()},le=()=>{const e=f();if(!e)return;const{table:t,colIndex:o}=e;for(let n=0;n<t.rows.length;n++){const l=t.rows[n],r=document.createElement("td"),a=document.createElement("p");a.innerHTML="<br>",r.appendChild(a),o>=l.cells.length-1?l.appendChild(r):l.insertBefore(r,l.cells[o+1])}p()},ae=()=>{const e=f();if(!e||e.rowCount<=1)return;const{table:t,rowIndex:o,colIndex:n}=e;t.deleteRow(o),Q(t,o,n),p()},ie=()=>{const e=f();if(!e||e.cellCount<=1)return;const{table:t,rowIndex:o,colIndex:n}=e;for(let l=0;l<t.rows.length;l++){const r=t.rows[l];r.cells[n]&&r.deleteCell(n)}Q(t,o,n),p()},de=()=>{const e=f();if(!e)return;const{table:t,rowIndex:o}=e,n=t.rows[o];if(!n)return;const l=n.parentElement?.tagName.toLowerCase()==="thead",r=t.querySelector("thead");if(l){const a=n.parentElement;if(n===a.rows[a.rows.length-1]){const i=t.querySelector("tbody")||t.appendChild(document.createElement("tbody"));i.insertBefore(n,i.firstChild),a.rows.length===0&&a.remove()}else j(n,"td")}else if(!r||n===t.tBodies[0]?.rows[0]){let a=r;a||(a=document.createElement("thead"),t.insertBefore(a,t.firstChild)),a.appendChild(n)}else j(n,"th");p()};function j(e,t){Array.from(e.cells).forEach(o=>{if(o.tagName.toLowerCase()===t)return;const n=document.createElement(t);n.innerHTML=o.innerHTML;for(let l=0;l<o.attributes.length;l++){const r=o.attributes[l];n.setAttribute(r.name,r.value)}o.parentNode?.replaceChild(n,o)})}const se=()=>{const e=f();if(!e)return;const{table:t,colIndex:o}=e;for(let n=0;n<t.rows.length;n++){const l=t.rows[n].cells[o];if(l){const r=l.tagName.toLowerCase()==="th"?"td":"th",a=document.createElement(r);a.innerHTML=l.innerHTML;for(let i=0;i<l.attributes.length;i++){const c=l.attributes[i];a.setAttribute(c.name,c.value)}l.parentNode?.replaceChild(a,l)}}p()},ce=()=>{const e=f();if(!e)return;const t=e.table,o=t.parentElement;o&&o.classList.contains("rte-table-wrapper")?o.remove():t.remove(),document.dispatchEvent(new CustomEvent("tableDeleted"))};function w(e,t){if(!e||!(e instanceof Node))return null;const o=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;return o?o.closest(t):null}function I(e){if(!e)return!1;const t=e.closest("[contenteditable]");return!t||t.getAttribute("contenteditable")==="false"?!1:!t.closest('[data-readonly="true"]')}function ue(){const e=window.getSelection(),t=e&&e.rangeCount>0?e.getRangeAt(0).startContainer:null;return w(t,".rte-content")||(b?b.closest(".rte-content"):null)}function he(e,t,o){const n=window.execEditorCommand||window.executeEditorCommand;if(typeof n=="function")try{n("recordDomTransaction",e,t,o)}catch{}}function G(e){const t=ue();if(t&&!I(t))return;const o=t?t.innerHTML:"";if(e(),!t)return;const n=t.innerHTML;n!==o&&(he(t,o,n),t.dispatchEvent(new Event("input",{bubbles:!0})))}function Q(e,t,o){if(!e.isConnected||e.rows.length===0)return;const n=e.rows[Math.min(t,e.rows.length-1)],l=n.cells[Math.min(o,n.cells.length-1)];if(!l)return;const r=document.createRange(),a=l.querySelector("p, div, li")||l;r.selectNodeContents(a),r.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(r)}const be=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return;const o=e.getRangeAt(0).startContainer;if(!w(o,"table"))return;const n=w(o,"td, th");if(!n)return;const l=n.parentElement;if(!l)return;let r=-1;for(let d=0;d<l.cells.length;d++)if(l.cells[d]===n){r=d;break}if(r===-1||r===l.cells.length-1)return;const a=l.cells[r+1];if(!a)return;const i=(d,s)=>{const u=parseInt(d.getAttribute(s)||"1",10);return Number.isFinite(u)&&u>0?u:1};if(i(n,"rowspan")!==i(a,"rowspan"))return;n.setAttribute("colspan",String(i(n,"colspan")+i(a,"colspan"))),Array.from(a.childNodes).forEach(d=>{n.appendChild(d)}),a.remove(),p()};function f(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const o=e.getRangeAt(0).startContainer,n=w(o,"table");if(!n)return null;let l=0,r=0;const a=w(o,"td, th");if(a){const i=a.parentElement;for(;i&&i!==n.rows[l]&&(l++,!(l>=n.rows.length)););const c=i;if(c){for(let d=0;d<c.cells.length;d++)if(c.cells[d]===a){r=d;break}}}return{table:n,rowIndex:l,colIndex:r,rowCount:n.rows.length,cellCount:n.rows[0]?.cells.length||0}}function p(){if(!h||!b)return;const e=f();if(!e)return;const t=e.rowCount>1,o=e.cellCount>1;Z(t,o)}function me(e){const t=window.getSelection();if(!t)return;const o=document.createRange();(e.textContent??"").trim()===""?(o.selectNodeContents(e.querySelector("p, div")||e),o.collapse(!0)):o.selectNodeContents(e),t.removeAllRanges(),t.addRange(o)}function fe(e){if(e.key!=="Tab"||e.defaultPrevented||e.ctrlKey||e.metaKey||e.altKey)return;const t=window.getSelection();if(!t||t.rangeCount===0)return;const o=w(t.getRangeAt(0).startContainer,"td, th"),n=o?.closest("table");if(!o||!n||!I(n))return;const l=n.closest("[contenteditable]");if(!l||!(e.target instanceof Node)||!l.contains(e.target))return;const r=Array.from(n.querySelectorAll("th, td")).filter(c=>c.closest("table")===n),a=r.indexOf(o);let i;e.shiftKey?i=r[a-1]:a<r.length-1?i=r[a+1]:(y("addRowBelow"),i=o.parentElement?.nextElementSibling?.querySelector("th, td")),i&&(e.preventDefault(),me(i))}function pe(){V=()=>{const e=f();e&&I(e.table)?ge(e.table):T()},N=e=>{const t=w(e.target,"table"),o=w(e.target,".table-toolbar");!t&&!o&&T()},D=()=>{T()},q=()=>{b&&h&&h.style.display!=="none"&&S(b)},O=()=>{b&&h&&h.style.display!=="none"&&S(b)},document.addEventListener("selectionchange",V),document.addEventListener("keydown",fe),document.addEventListener("mousedown",N),document.addEventListener("tableDeleted",D),window.addEventListener("scroll",q,!0),window.addEventListener("resize",O)}function S(e){if(!h)return;const t=e.getBoundingClientRect(),o=h.getBoundingClientRect(),n=o.height||40,l=o.width||280,r=10;let a=t.top-n-r,i=t.left+t.width/2-l/2;a<r&&(a=t.bottom+r),i<r&&(i=r);const c=window.innerWidth;i+l>c-r&&(i=c-l-r);const d=window.innerHeight;a+n>d-r&&(a=d-n-r),h.style.top=a+"px",h.style.left=i+"px"}function ge(e){b=e,h||(h=ve(),document.body.appendChild(h));const t=!!e.closest(H)||document.body.matches(H)||document.documentElement.matches(H);h.classList.toggle("rte-theme-dark",t),h.style.display="flex",h.style.visibility="hidden",requestAnimationFrame(()=>{S(e),h&&(h.style.visibility="visible")});const o=f();o&&Z(o.rowCount>1,o.cellCount>1),Ce(e)}const M=new Set;function J(){M.forEach(e=>{e.style.position==="relative"&&(e.style.removeProperty("position"),e.getAttribute("style")?.trim()||e.removeAttribute("style"))}),M.clear()}function T(){if(h&&(h.style.display="none"),b){b.querySelectorAll(".resize-handle").forEach(n=>n.remove());const t=b.parentElement,o=t?.classList.contains("rte-table-wrapper")?t.querySelector(".table-resize-handle"):b.querySelector(".table-resize-handle");o&&o.remove()}J(),b=null}function Z(e,t){if(!h)return;const o=h.querySelector('[data-action="deleteRow"]'),n=h.querySelector('[data-action="deleteColumn"]');o&&(o.disabled=!e),n&&(n.disabled=!t)}let z=!1;function we(){if(z||typeof document>"u")return;if(document.getElementById("rte-table-toolbar-styles")){z=!0;return}z=!0;const e=document.createElement("style");e.id="rte-table-toolbar-styles",e.textContent=`
|
|
2
2
|
.table-toolbar {
|
|
3
3
|
background: white;
|
|
4
4
|
border: 1px solid #d0d0d0;
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
position: fixed;
|
|
156
156
|
z-index: 1000;
|
|
157
157
|
display: none;
|
|
158
|
-
`,e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Table editing toolbar");const t=s=>{const
|
|
158
|
+
`,e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Table editing toolbar");const t=s=>{const u=document.createElement("button");return u.className="toolbar-icon-btn",s.danger&&u.classList.add("toolbar-icon-btn-danger"),s.delete&&u.classList.add("toolbar-icon-btn-delete"),u.innerHTML=s.icon,u.title=s.title,u.setAttribute("aria-label",s.title),u.setAttribute("type","button"),u.setAttribute("data-action",s.action),u.onclick=()=>y(s.action),u},o=()=>{const s=document.createElement("div");return s.className="toolbar-divider",s},n=(...s)=>{const u=document.createElement("div");return u.className="toolbar-section",s.forEach(C=>u.appendChild(C)),u},l=n(t({icon:Ee(),title:"Add row above (Ctrl+Shift+R)",action:"addRowAbove"}),t({icon:xe(),title:"Add row below",action:"addRowBelow"}),t({icon:He(),title:"Delete row",action:"deleteRow",danger:!0})),r=n(t({icon:Re(),title:"Add column left",action:"addColumnLeft"}),t({icon:Te(),title:"Add column right (Ctrl+Shift+C)",action:"addColumnRight"}),t({icon:ze(),title:"Delete column",action:"deleteColumn",danger:!0})),a=n(t({icon:Se(),title:"Toggle header row",action:"toggleHeaderRow"}),t({icon:Me(),title:"Toggle header column",action:"toggleHeaderColumn"})),i=n(t({icon:Le(),title:"Merge cells (horizontally)",action:"mergeCells"})),c=n(t({icon:Ie(),title:"Delete table",action:"deleteTable",delete:!0}));e.appendChild(l),e.appendChild(o()),e.appendChild(r),e.appendChild(o()),e.appendChild(a),e.appendChild(o()),e.appendChild(i),e.appendChild(o()),e.appendChild(c);const d=s=>{!h||h.style.display==="none"||(s.ctrlKey||s.metaKey)&&s.shiftKey&&(s.key==="r"||s.key==="R"?(s.preventDefault(),y("addRowBelow")):(s.key==="c"||s.key==="C")&&(s.preventDefault(),y("addColumnRight")))};return window.addEventListener("keydown",d),e}function y(e){G(()=>{switch(e){case"addRowAbove":ne();break;case"addRowBelow":oe();break;case"addColumnLeft":re();break;case"addColumnRight":le();break;case"deleteRow":ae();break;case"deleteColumn":ie();break;case"toggleHeaderRow":de();break;case"toggleHeaderColumn":se();break;case"deleteTable":ce();break;case"mergeCells":be();break}})}function Ce(e){const t=Y(e);e.querySelectorAll(".resize-handle").forEach(i=>i.remove());const n=t.querySelector(".table-resize-handle");n&&n.remove(),J();const l=e.querySelector("thead tr, tbody tr:first-child");if(!l)return;const r=l.querySelectorAll("td, th");r.forEach((i,c)=>{if(c===r.length-1)return;const d=document.createElement("div");d.className="resize-handle",d.style.cssText=`
|
|
159
159
|
position: absolute;
|
|
160
160
|
right: -4px;
|
|
161
161
|
top: 0;
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
cursor: col-resize;
|
|
166
166
|
z-index: 10;
|
|
167
167
|
transition: background 0.15s ease;
|
|
168
|
-
`,d.addEventListener("mouseenter",()=>{E||(d.style.background="rgba(0, 102, 204, 0.3)")}),d.addEventListener("mouseleave",()=>{E||(d.style.background="transparent")}),d.addEventListener("mousedown",
|
|
168
|
+
`,d.addEventListener("mouseenter",()=>{E||(d.style.background="rgba(0, 102, 204, 0.3)")}),d.addEventListener("mouseleave",()=>{E||(d.style.background="transparent")}),d.addEventListener("mousedown",u=>{u.preventDefault(),u.stopPropagation(),ye(u,c)});const s=i;s.style.position||(s.style.position="relative",M.add(s)),i.appendChild(d)});const a=document.createElement("div");a.className="table-resize-handle",a.addEventListener("mousedown",i=>{i.preventDefault(),i.stopPropagation(),ke(i)}),t.appendChild(a)}function ye(e,t){if(E=!0,k=t,P=e.clientX,!b)return;const o=b.querySelector("thead tr, tbody tr:first-child");o&&o.cells[t]&&(K=o.cells[t].offsetWidth),document.body.style.cursor="col-resize",document.body.style.userSelect="none";const n=r=>{if(!E||k===null||!b)return;const a=r.clientX-P,i=Math.max(50,K+a);b.querySelectorAll("tr").forEach(d=>{d.cells[k]&&(d.cells[k].style.width=i+"px")})},l=()=>{E=!1,k=null,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",l)}function ke(e){if(!b)return;R=!0,_=e.clientX,W=e.clientY,X=b.offsetWidth,F=b.offsetHeight,document.body.style.cursor="nwse-resize",document.body.style.userSelect="none";const t=n=>{if(!R||!b)return;const l=n.clientX-_,r=n.clientY-W,a=Math.max(200,X+l),i=Math.max(100,F+r);b.style.width=a+"px",b.style.height=i+"px"},o=()=>{R=!1,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",o)}function Ee(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
169
169
|
<path d="M2 7h12V5H2v2zm0 4h12V9H2v2zM8 1v3H5v2h3v3h2V6h3V4h-3V1H8z"/>
|
|
170
170
|
</svg>`}function xe(){return`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
171
171
|
<path d="M2 3h12V1H2v2zm0 4h12V5H2v2zm6 4v3h3v-2h2v-2h-2v-3h-2v3H5v2h3z"/>
|