@editora/plugins 1.0.8 → 1.0.9

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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -0
  3. package/dist/approval-workflow.cjs.js +447 -0
  4. package/dist/approval-workflow.esm.js +1070 -0
  5. package/dist/blocks-library.cjs.js +442 -0
  6. package/dist/blocks-library.esm.js +1317 -0
  7. package/dist/citations.cjs.js +548 -0
  8. package/dist/citations.esm.js +1457 -0
  9. package/dist/conditional-content.cjs.js +626 -0
  10. package/dist/conditional-content.esm.js +1360 -0
  11. package/dist/content-rules.cjs.js +408 -0
  12. package/dist/content-rules.esm.js +1093 -0
  13. package/dist/data-binding.cjs.js +321 -0
  14. package/dist/data-binding.esm.js +913 -0
  15. package/dist/doc-schema.cjs.js +398 -0
  16. package/dist/doc-schema.esm.js +1310 -0
  17. package/dist/enterprise.cjs.js +1 -0
  18. package/dist/enterprise.esm.js +56 -0
  19. package/dist/index.cjs.js +1 -1
  20. package/dist/index.esm.js +109 -81
  21. package/dist/mentions.cjs.js +105 -0
  22. package/dist/mentions.esm.js +726 -0
  23. package/dist/page-break.cjs.js +2 -2
  24. package/dist/page-break.esm.js +32 -32
  25. package/dist/pii-redaction.cjs.js +436 -0
  26. package/dist/pii-redaction.esm.js +1377 -0
  27. package/dist/preview.cjs.js +3 -3
  28. package/dist/preview.esm.js +29 -29
  29. package/dist/slash-commands.cjs.js +90 -0
  30. package/dist/slash-commands.esm.js +752 -0
  31. package/dist/smart-paste.cjs.js +398 -0
  32. package/dist/smart-paste.esm.js +1388 -0
  33. package/dist/track-changes.cjs.js +77 -0
  34. package/dist/track-changes.esm.js +755 -0
  35. package/dist/translation-workflow.cjs.js +626 -0
  36. package/dist/translation-workflow.esm.js +1718 -0
  37. package/dist/version-diff.cjs.js +362 -0
  38. package/dist/version-diff.esm.js +768 -0
  39. package/index.d.ts +798 -0
  40. package/package.json +104 -5
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./mentions.cjs.js"),t=require("./track-changes.cjs.js"),o=require("./version-diff.cjs.js"),l=require("./conditional-content.cjs.js"),r=require("./data-binding.cjs.js"),g=require("./content-rules.cjs.js"),u=require("./citations.cjs.js"),s=require("./approval-workflow.cjs.js"),c=require("./pii-redaction.cjs.js"),P=require("./smart-paste.cjs.js"),m=require("./blocks-library.cjs.js"),C=require("./doc-schema.cjs.js"),d=require("./translation-workflow.cjs.js"),p=require("./slash-commands.cjs.js"),M=require("./spell-check.cjs.js"),T=require("./a11y-checker.cjs.js"),f=require("./comments.cjs.js"),q=require("./merge-tag.cjs.js"),e=require("./template.cjs.js"),n=require("./media-manager.cjs.js"),i=require("./index-tqLTHcO6.js");exports.MentionPlugin=a.MentionPlugin;exports.TrackChangesPlugin=t.TrackChangesPlugin;exports.VersionDiffPlugin=o.VersionDiffPlugin;exports.ConditionalContentPlugin=l.ConditionalContentPlugin;exports.DataBindingPlugin=r.DataBindingPlugin;exports.ContentRulesPlugin=g.ContentRulesPlugin;exports.CitationsPlugin=u.CitationsPlugin;exports.ApprovalWorkflowPlugin=s.ApprovalWorkflowPlugin;exports.PIIRedactionPlugin=c.PIIRedactionPlugin;exports.SmartPastePlugin=P.SmartPastePlugin;exports.BlocksLibraryPlugin=m.BlocksLibraryPlugin;exports.DocSchemaPlugin=C.DocSchemaPlugin;exports.TranslationWorkflowPlugin=d.TranslationWorkflowPlugin;exports.SlashCommandsPlugin=p.SlashCommandsPlugin;exports.SpellCheckPlugin=M.SpellCheckPlugin;exports.A11yCheckerPlugin=T.A11yCheckerPlugin;exports.CommentsPlugin=f.CommentsPlugin;exports.MergeTagPlugin=q.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=n.MediaManagerPlugin;exports.getMediaManagerConfig=n.getMediaManagerConfig;exports.setMediaManagerConfig=n.setMediaManagerConfig;exports.DocumentManagerPlugin=i.DocumentManagerPlugin;exports.getDocumentManagerConfig=i.getDocumentManagerConfig;exports.setDocumentManagerConfig=i.setDocumentManagerConfig;
@@ -0,0 +1,56 @@
1
+ import { MentionPlugin as r } from "./mentions.esm.js";
2
+ import { TrackChangesPlugin as n } from "./track-changes.esm.js";
3
+ import { VersionDiffPlugin as i } from "./version-diff.esm.js";
4
+ import { ConditionalContentPlugin as l } from "./conditional-content.esm.js";
5
+ import { DataBindingPlugin as p } from "./data-binding.esm.js";
6
+ import { ContentRulesPlugin as u } from "./content-rules.esm.js";
7
+ import { CitationsPlugin as s } from "./citations.esm.js";
8
+ import { ApprovalWorkflowPlugin as C } from "./approval-workflow.esm.js";
9
+ import { PIIRedactionPlugin as M } from "./pii-redaction.esm.js";
10
+ import { SmartPastePlugin as d } from "./smart-paste.esm.js";
11
+ import { BlocksLibraryPlugin as h } from "./blocks-library.esm.js";
12
+ import { DocSchemaPlugin as E } from "./doc-schema.esm.js";
13
+ import { TranslationWorkflowPlugin as y } from "./translation-workflow.esm.js";
14
+ import { SlashCommandsPlugin as B } from "./slash-commands.esm.js";
15
+ import { SpellCheckPlugin as R } from "./spell-check.esm.js";
16
+ import { A11yCheckerPlugin as w } from "./a11y-checker.esm.js";
17
+ import { CommentsPlugin as W } from "./comments.esm.js";
18
+ import { MergeTagPlugin as z } from "./merge-tag.esm.js";
19
+ import { PREDEFINED_TEMPLATES as N, TemplatePlugin as V, addCustomTemplate as _, getAllTemplates as j, getTemplateCategories as q, getTemplatesByCategory as G, sanitizeTemplate as H, searchTemplates as J, validateTemplate as K } from "./template.esm.js";
20
+ import { MediaManagerPlugin as Q, getMediaManagerConfig as U, setMediaManagerConfig as X } from "./media-manager.esm.js";
21
+ import { D as Z, g as $, s as ee } from "./index-BFsKNTTj.mjs";
22
+ export {
23
+ w as A11yCheckerPlugin,
24
+ C as ApprovalWorkflowPlugin,
25
+ h as BlocksLibraryPlugin,
26
+ s as CitationsPlugin,
27
+ W as CommentsPlugin,
28
+ l as ConditionalContentPlugin,
29
+ u as ContentRulesPlugin,
30
+ p as DataBindingPlugin,
31
+ E as DocSchemaPlugin,
32
+ Z as DocumentManagerPlugin,
33
+ Q as MediaManagerPlugin,
34
+ r as MentionPlugin,
35
+ z as MergeTagPlugin,
36
+ M as PIIRedactionPlugin,
37
+ N as PREDEFINED_TEMPLATES,
38
+ B as SlashCommandsPlugin,
39
+ d as SmartPastePlugin,
40
+ R as SpellCheckPlugin,
41
+ V as TemplatePlugin,
42
+ n as TrackChangesPlugin,
43
+ y as TranslationWorkflowPlugin,
44
+ i as VersionDiffPlugin,
45
+ _ as addCustomTemplate,
46
+ j as getAllTemplates,
47
+ $ as getDocumentManagerConfig,
48
+ U as getMediaManagerConfig,
49
+ q as getTemplateCategories,
50
+ G as getTemplatesByCategory,
51
+ H as sanitizeTemplate,
52
+ J as searchTemplates,
53
+ ee as setDocumentManagerConfig,
54
+ X as setMediaManagerConfig,
55
+ K as validateTemplate
56
+ };
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./heading.cjs.js"),r=require("./bold.cjs.js"),g=require("./italic.cjs.js"),u=require("./underline.cjs.js"),o=require("./strikethrough.cjs.js"),a=require("./list.cjs.js"),s=require("./checklist.cjs.js"),c=require("./history.cjs.js"),P=require("./link.cjs.js"),m=require("./blockquote.cjs.js"),d=require("./clear-formatting.cjs.js"),C=require("./code.cjs.js"),q=require("./table.cjs.js"),p=require("./font-size.cjs.js"),h=require("./font-family.cjs.js"),T=require("./text-alignment.cjs.js"),M=require("./text-color.cjs.js"),k=require("./background-color.cjs.js"),f=require("./line-height.cjs.js"),b=require("./indent.cjs.js"),A=require("./direction.cjs.js"),F=require("./capitalization.cjs.js"),S=require("./math.cjs.js"),y=require("./special-characters.cjs.js"),E=require("./emojis.cjs.js"),D=require("./embed-iframe.cjs.js"),B=require("./anchor.cjs.js"),n=require("./media-manager.cjs.js"),l=require("./index-tqLTHcO6.js"),H=require("./preview.cjs.js"),I=require("./fullscreen.cjs.js"),z=require("./print.cjs.js"),L=require("./page-break.cjs.js"),v=require("./footnote.cjs.js"),x=require("./code-sample.cjs.js"),G=require("./merge-tag.cjs.js"),e=require("./template.cjs.js"),j=require("./comments.cjs.js"),U=require("./spell-check.cjs.js"),_=require("./a11y-checker.cjs.js"),i=require("./shared-config.cjs.js");exports.HeadingPlugin=t.HeadingPlugin;exports.BoldPlugin=r.BoldPlugin;exports.ItalicPlugin=g.ItalicPlugin;exports.UnderlinePlugin=u.UnderlinePlugin;exports.StrikethroughPlugin=o.StrikethroughPlugin;exports.ListPlugin=a.ListPlugin;exports.ChecklistPlugin=s.ChecklistPlugin;exports.HistoryPlugin=c.HistoryPlugin;exports.LinkPlugin=P.LinkPlugin;exports.BlockquotePlugin=m.BlockquotePlugin;exports.ClearFormattingPlugin=d.ClearFormattingPlugin;exports.CodePlugin=C.CodePlugin;exports.TablePlugin=q.TablePlugin;exports.FontSizePlugin=p.FontSizePlugin;exports.FontFamilyPlugin=h.FontFamilyPlugin;exports.TextAlignmentPlugin=T.TextAlignmentPlugin;exports.TextColorPlugin=M.TextColorPlugin;exports.BackgroundColorPlugin=k.BackgroundColorPlugin;exports.LineHeightPlugin=f.LineHeightPlugin;exports.IndentPlugin=b.IndentPlugin;exports.DirectionPlugin=A.DirectionPlugin;exports.CapitalizationPlugin=F.CapitalizationPlugin;exports.MathPlugin=S.MathPlugin;exports.SpecialCharactersPlugin=y.SpecialCharactersPlugin;exports.EmojisPlugin=E.EmojisPlugin;exports.EmbedIframePlugin=D.EmbedIframePlugin;exports.AnchorPlugin=B.AnchorPlugin;exports.MediaManagerPlugin=n.MediaManagerPlugin;exports.getMediaManagerConfig=n.getMediaManagerConfig;exports.setMediaManagerConfig=n.setMediaManagerConfig;exports.DocumentManagerPlugin=l.DocumentManagerPlugin;exports.getDocumentManagerConfig=l.getDocumentManagerConfig;exports.setDocumentManagerConfig=l.setDocumentManagerConfig;exports.PreviewPlugin=H.PreviewPlugin;exports.FullscreenPlugin=I.FullscreenPlugin;exports.PrintPlugin=z.PrintPlugin;exports.PageBreakPlugin=L.PageBreakPlugin;exports.FootnotePlugin=v.FootnotePlugin;exports.CodeSamplePlugin=x.CodeSamplePlugin;exports.MergeTagPlugin=G.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=j.CommentsPlugin;exports.SpellCheckPlugin=U.SpellCheckPlugin;exports.A11yCheckerPlugin=_.A11yCheckerPlugin;exports.buildApiUrl=i.buildApiUrl;exports.getGlobalApiConfig=i.getGlobalApiConfig;exports.getGlobalApiHeaders=i.getGlobalApiHeaders;exports.setGlobalApiConfig=i.setGlobalApiConfig;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./heading.cjs.js"),r=require("./bold.cjs.js"),o=require("./italic.cjs.js"),u=require("./underline.cjs.js"),g=require("./strikethrough.cjs.js"),a=require("./list.cjs.js"),s=require("./checklist.cjs.js"),P=require("./history.cjs.js"),c=require("./link.cjs.js"),m=require("./blockquote.cjs.js"),d=require("./clear-formatting.cjs.js"),C=require("./code.cjs.js"),q=require("./table.cjs.js"),p=require("./font-size.cjs.js"),h=require("./font-family.cjs.js"),k=require("./text-alignment.cjs.js"),T=require("./text-color.cjs.js"),f=require("./background-color.cjs.js"),M=require("./line-height.cjs.js"),b=require("./indent.cjs.js"),S=require("./direction.cjs.js"),A=require("./capitalization.cjs.js"),D=require("./math.cjs.js"),y=require("./special-characters.cjs.js"),B=require("./emojis.cjs.js"),F=require("./embed-iframe.cjs.js"),E=require("./anchor.cjs.js"),I=require("./mentions.cjs.js"),v=require("./track-changes.cjs.js"),L=require("./version-diff.cjs.js"),w=require("./conditional-content.cjs.js"),H=require("./data-binding.cjs.js"),z=require("./content-rules.cjs.js"),R=require("./citations.cjs.js"),x=require("./approval-workflow.cjs.js"),G=require("./pii-redaction.cjs.js"),W=require("./smart-paste.cjs.js"),j=require("./blocks-library.cjs.js"),U=require("./doc-schema.cjs.js"),_=require("./translation-workflow.cjs.js"),N=require("./slash-commands.cjs.js"),n=require("./media-manager.cjs.js"),t=require("./index-tqLTHcO6.js"),V=require("./preview.cjs.js"),O=require("./fullscreen.cjs.js"),J=require("./print.cjs.js"),K=require("./page-break.cjs.js"),Q=require("./footnote.cjs.js"),X=require("./code-sample.cjs.js"),Y=require("./merge-tag.cjs.js"),e=require("./template.cjs.js"),Z=require("./comments.cjs.js"),$=require("./spell-check.cjs.js"),ee=require("./a11y-checker.cjs.js"),i=require("./shared-config.cjs.js");exports.HeadingPlugin=l.HeadingPlugin;exports.BoldPlugin=r.BoldPlugin;exports.ItalicPlugin=o.ItalicPlugin;exports.UnderlinePlugin=u.UnderlinePlugin;exports.StrikethroughPlugin=g.StrikethroughPlugin;exports.ListPlugin=a.ListPlugin;exports.ChecklistPlugin=s.ChecklistPlugin;exports.HistoryPlugin=P.HistoryPlugin;exports.LinkPlugin=c.LinkPlugin;exports.BlockquotePlugin=m.BlockquotePlugin;exports.ClearFormattingPlugin=d.ClearFormattingPlugin;exports.CodePlugin=C.CodePlugin;exports.TablePlugin=q.TablePlugin;exports.FontSizePlugin=p.FontSizePlugin;exports.FontFamilyPlugin=h.FontFamilyPlugin;exports.TextAlignmentPlugin=k.TextAlignmentPlugin;exports.TextColorPlugin=T.TextColorPlugin;exports.BackgroundColorPlugin=f.BackgroundColorPlugin;exports.LineHeightPlugin=M.LineHeightPlugin;exports.IndentPlugin=b.IndentPlugin;exports.DirectionPlugin=S.DirectionPlugin;exports.CapitalizationPlugin=A.CapitalizationPlugin;exports.MathPlugin=D.MathPlugin;exports.SpecialCharactersPlugin=y.SpecialCharactersPlugin;exports.EmojisPlugin=B.EmojisPlugin;exports.EmbedIframePlugin=F.EmbedIframePlugin;exports.AnchorPlugin=E.AnchorPlugin;exports.MentionPlugin=I.MentionPlugin;exports.TrackChangesPlugin=v.TrackChangesPlugin;exports.VersionDiffPlugin=L.VersionDiffPlugin;exports.ConditionalContentPlugin=w.ConditionalContentPlugin;exports.DataBindingPlugin=H.DataBindingPlugin;exports.ContentRulesPlugin=z.ContentRulesPlugin;exports.CitationsPlugin=R.CitationsPlugin;exports.ApprovalWorkflowPlugin=x.ApprovalWorkflowPlugin;exports.PIIRedactionPlugin=G.PIIRedactionPlugin;exports.SmartPastePlugin=W.SmartPastePlugin;exports.BlocksLibraryPlugin=j.BlocksLibraryPlugin;exports.DocSchemaPlugin=U.DocSchemaPlugin;exports.TranslationWorkflowPlugin=_.TranslationWorkflowPlugin;exports.SlashCommandsPlugin=N.SlashCommandsPlugin;exports.MediaManagerPlugin=n.MediaManagerPlugin;exports.getMediaManagerConfig=n.getMediaManagerConfig;exports.setMediaManagerConfig=n.setMediaManagerConfig;exports.DocumentManagerPlugin=t.DocumentManagerPlugin;exports.getDocumentManagerConfig=t.getDocumentManagerConfig;exports.setDocumentManagerConfig=t.setDocumentManagerConfig;exports.PreviewPlugin=V.PreviewPlugin;exports.FullscreenPlugin=O.FullscreenPlugin;exports.PrintPlugin=J.PrintPlugin;exports.PageBreakPlugin=K.PageBreakPlugin;exports.FootnotePlugin=Q.FootnotePlugin;exports.CodeSamplePlugin=X.CodeSamplePlugin;exports.MergeTagPlugin=Y.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=Z.CommentsPlugin;exports.SpellCheckPlugin=$.SpellCheckPlugin;exports.A11yCheckerPlugin=ee.A11yCheckerPlugin;exports.buildApiUrl=i.buildApiUrl;exports.getGlobalApiConfig=i.getGlobalApiConfig;exports.getGlobalApiHeaders=i.getGlobalApiHeaders;exports.setGlobalApiConfig=i.setGlobalApiConfig;
package/dist/index.esm.js CHANGED
@@ -1,99 +1,127 @@
1
- import { HeadingPlugin as r } from "./heading.esm.js";
1
+ import { HeadingPlugin as e } from "./heading.esm.js";
2
2
  import { BoldPlugin as i } from "./bold.esm.js";
3
- import { ItalicPlugin as n } from "./italic.esm.js";
3
+ import { ItalicPlugin as l } from "./italic.esm.js";
4
4
  import { UnderlinePlugin as m } from "./underline.esm.js";
5
5
  import { StrikethroughPlugin as a } from "./strikethrough.esm.js";
6
- import { ListPlugin as f } from "./list.esm.js";
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
- import { LinkPlugin as c } from "./link.esm.js";
10
- import { BlockquotePlugin as M } from "./blockquote.esm.js";
11
- import { ClearFormattingPlugin as A } from "./clear-formatting.esm.js";
9
+ import { LinkPlugin as d } from "./link.esm.js";
10
+ import { BlockquotePlugin as h } from "./blockquote.esm.js";
11
+ import { ClearFormattingPlugin as k } from "./clear-formatting.esm.js";
12
12
  import { CodePlugin as D } from "./code.esm.js";
13
- import { TablePlugin as F } from "./table.esm.js";
14
- import { FontSizePlugin as S } from "./font-size.esm.js";
15
- import { FontFamilyPlugin as B } from "./font-family.esm.js";
16
- import { TextAlignmentPlugin as I } from "./text-alignment.esm.js";
17
- import { TextColorPlugin as z } from "./text-color.esm.js";
18
- import { BackgroundColorPlugin as v } from "./background-color.esm.js";
19
- import { LineHeightPlugin as j } from "./line-height.esm.js";
20
- import { IndentPlugin as w } from "./indent.esm.js";
21
- import { DirectionPlugin as R } from "./direction.esm.js";
22
- import { CapitalizationPlugin as J } from "./capitalization.esm.js";
23
- import { MathPlugin as O } from "./math.esm.js";
24
- import { SpecialCharactersPlugin as V } from "./special-characters.esm.js";
13
+ import { TablePlugin as b } from "./table.esm.js";
14
+ import { FontSizePlugin as E } from "./font-size.esm.js";
15
+ import { FontFamilyPlugin as y } from "./font-family.esm.js";
16
+ import { TextAlignmentPlugin as L } from "./text-alignment.esm.js";
17
+ import { TextColorPlugin as v } from "./text-color.esm.js";
18
+ import { BackgroundColorPlugin as z } from "./background-color.esm.js";
19
+ import { LineHeightPlugin as R } from "./line-height.esm.js";
20
+ import { IndentPlugin as W } from "./indent.esm.js";
21
+ import { DirectionPlugin as q } from "./direction.esm.js";
22
+ import { CapitalizationPlugin as V } from "./capitalization.esm.js";
23
+ import { MathPlugin as J } from "./math.esm.js";
24
+ import { SpecialCharactersPlugin as O } from "./special-characters.esm.js";
25
25
  import { EmojisPlugin as X } from "./emojis.esm.js";
26
26
  import { EmbedIframePlugin as Z } from "./embed-iframe.esm.js";
27
- import { AnchorPlugin as ee } from "./anchor.esm.js";
28
- import { MediaManagerPlugin as re, getMediaManagerConfig as te, setMediaManagerConfig as ie } from "./media-manager.esm.js";
29
- import { D as ne, g as ge, s as me } from "./index-BFsKNTTj.mjs";
30
- import { PreviewPlugin as ae } from "./preview.esm.js";
31
- import { FullscreenPlugin as fe } from "./fullscreen.esm.js";
32
- import { PrintPlugin as xe } from "./print.esm.js";
33
- import { PageBreakPlugin as Ce } from "./page-break.esm.js";
34
- import { FootnotePlugin as ce } from "./footnote.esm.js";
35
- import { CodeSamplePlugin as Me } from "./code-sample.esm.js";
36
- import { MergeTagPlugin as Ae } from "./merge-tag.esm.js";
37
- import { PREDEFINED_TEMPLATES as De, TemplatePlugin as Ee, addCustomTemplate as Fe, getAllTemplates as be, getTemplateCategories as Se, getTemplatesByCategory as ye, sanitizeTemplate as Be, searchTemplates as He, validateTemplate as Ie } from "./template.esm.js";
38
- import { CommentsPlugin as ze } from "./comments.esm.js";
39
- import { SpellCheckPlugin as ve } from "./spell-check.esm.js";
40
- import { A11yCheckerPlugin as je } from "./a11y-checker.esm.js";
41
- import { buildApiUrl as we, getGlobalApiConfig as Ne, getGlobalApiHeaders as Re, setGlobalApiConfig as _e } from "./shared-config.esm.js";
27
+ import { AnchorPlugin as oo } from "./anchor.esm.js";
28
+ import { MentionPlugin as eo } from "./mentions.esm.js";
29
+ import { TrackChangesPlugin as io } from "./track-changes.esm.js";
30
+ import { VersionDiffPlugin as lo } from "./version-diff.esm.js";
31
+ import { ConditionalContentPlugin as mo } from "./conditional-content.esm.js";
32
+ import { DataBindingPlugin as ao } from "./data-binding.esm.js";
33
+ import { ContentRulesPlugin as uo } from "./content-rules.esm.js";
34
+ import { CitationsPlugin as xo } from "./citations.esm.js";
35
+ import { ApprovalWorkflowPlugin as Co } from "./approval-workflow.esm.js";
36
+ import { PIIRedactionPlugin as To } from "./pii-redaction.esm.js";
37
+ import { SmartPastePlugin as Mo } from "./smart-paste.esm.js";
38
+ import { BlocksLibraryPlugin as Ao } from "./blocks-library.esm.js";
39
+ import { DocSchemaPlugin as So } from "./doc-schema.esm.js";
40
+ import { TranslationWorkflowPlugin as Bo } from "./translation-workflow.esm.js";
41
+ import { SlashCommandsPlugin as Fo } from "./slash-commands.esm.js";
42
+ import { MediaManagerPlugin as Io, getMediaManagerConfig as Lo, setMediaManagerConfig as Ho } from "./media-manager.esm.js";
43
+ import { D as wo, g as zo, s as Go } from "./index-BFsKNTTj.mjs";
44
+ import { PreviewPlugin as Uo } from "./preview.esm.js";
45
+ import { FullscreenPlugin as jo } from "./fullscreen.esm.js";
46
+ import { PrintPlugin as No } from "./print.esm.js";
47
+ import { PageBreakPlugin as _o } from "./page-break.esm.js";
48
+ import { FootnotePlugin as Ko } from "./footnote.esm.js";
49
+ import { CodeSamplePlugin as Qo } from "./code-sample.esm.js";
50
+ import { MergeTagPlugin as Yo } from "./merge-tag.esm.js";
51
+ import { PREDEFINED_TEMPLATES as $o, TemplatePlugin as or, addCustomTemplate as rr, getAllTemplates as er, getTemplateCategories as tr, getTemplatesByCategory as ir, sanitizeTemplate as nr, searchTemplates as lr, validateTemplate as gr } from "./template.esm.js";
52
+ import { CommentsPlugin as pr } from "./comments.esm.js";
53
+ import { SpellCheckPlugin as fr } from "./spell-check.esm.js";
54
+ import { A11yCheckerPlugin as Pr } from "./a11y-checker.esm.js";
55
+ import { buildApiUrl as sr, getGlobalApiConfig as Cr, getGlobalApiHeaders as cr, setGlobalApiConfig as dr } from "./shared-config.esm.js";
42
56
  export {
43
- je as A11yCheckerPlugin,
44
- ee as AnchorPlugin,
45
- v as BackgroundColorPlugin,
46
- M as BlockquotePlugin,
57
+ Pr as A11yCheckerPlugin,
58
+ oo as AnchorPlugin,
59
+ Co as ApprovalWorkflowPlugin,
60
+ z as BackgroundColorPlugin,
61
+ h as BlockquotePlugin,
62
+ Ao as BlocksLibraryPlugin,
47
63
  i as BoldPlugin,
48
- J as CapitalizationPlugin,
64
+ V as CapitalizationPlugin,
49
65
  x as ChecklistPlugin,
50
- A as ClearFormattingPlugin,
66
+ xo as CitationsPlugin,
67
+ k as ClearFormattingPlugin,
51
68
  D as CodePlugin,
52
- Me as CodeSamplePlugin,
53
- ze as CommentsPlugin,
54
- R as DirectionPlugin,
55
- ne as DocumentManagerPlugin,
69
+ Qo as CodeSamplePlugin,
70
+ pr as CommentsPlugin,
71
+ mo as ConditionalContentPlugin,
72
+ uo as ContentRulesPlugin,
73
+ ao as DataBindingPlugin,
74
+ q as DirectionPlugin,
75
+ So as DocSchemaPlugin,
76
+ wo as DocumentManagerPlugin,
56
77
  Z as EmbedIframePlugin,
57
78
  X as EmojisPlugin,
58
- B as FontFamilyPlugin,
59
- S as FontSizePlugin,
60
- ce as FootnotePlugin,
61
- fe as FullscreenPlugin,
62
- r as HeadingPlugin,
79
+ y as FontFamilyPlugin,
80
+ E as FontSizePlugin,
81
+ Ko as FootnotePlugin,
82
+ jo as FullscreenPlugin,
83
+ e as HeadingPlugin,
63
84
  C as HistoryPlugin,
64
- w as IndentPlugin,
65
- n as ItalicPlugin,
66
- j as LineHeightPlugin,
67
- c as LinkPlugin,
68
- f as ListPlugin,
69
- O as MathPlugin,
70
- re as MediaManagerPlugin,
71
- Ae as MergeTagPlugin,
72
- De as PREDEFINED_TEMPLATES,
73
- Ce as PageBreakPlugin,
74
- ae as PreviewPlugin,
75
- xe as PrintPlugin,
76
- V as SpecialCharactersPlugin,
77
- ve as SpellCheckPlugin,
85
+ W as IndentPlugin,
86
+ l as ItalicPlugin,
87
+ R as LineHeightPlugin,
88
+ d as LinkPlugin,
89
+ u as ListPlugin,
90
+ J as MathPlugin,
91
+ Io as MediaManagerPlugin,
92
+ eo as MentionPlugin,
93
+ Yo as MergeTagPlugin,
94
+ To as PIIRedactionPlugin,
95
+ $o as PREDEFINED_TEMPLATES,
96
+ _o as PageBreakPlugin,
97
+ Uo as PreviewPlugin,
98
+ No as PrintPlugin,
99
+ Fo as SlashCommandsPlugin,
100
+ Mo as SmartPastePlugin,
101
+ O as SpecialCharactersPlugin,
102
+ fr as SpellCheckPlugin,
78
103
  a as StrikethroughPlugin,
79
- F as TablePlugin,
80
- Ee as TemplatePlugin,
81
- I as TextAlignmentPlugin,
82
- z as TextColorPlugin,
104
+ b as TablePlugin,
105
+ or as TemplatePlugin,
106
+ L as TextAlignmentPlugin,
107
+ v as TextColorPlugin,
108
+ io as TrackChangesPlugin,
109
+ Bo as TranslationWorkflowPlugin,
83
110
  m as UnderlinePlugin,
84
- Fe as addCustomTemplate,
85
- we as buildApiUrl,
86
- be as getAllTemplates,
87
- ge as getDocumentManagerConfig,
88
- Ne as getGlobalApiConfig,
89
- Re as getGlobalApiHeaders,
90
- te as getMediaManagerConfig,
91
- Se as getTemplateCategories,
92
- ye as getTemplatesByCategory,
93
- Be as sanitizeTemplate,
94
- He as searchTemplates,
95
- me as setDocumentManagerConfig,
96
- _e as setGlobalApiConfig,
97
- ie as setMediaManagerConfig,
98
- Ie as validateTemplate
111
+ lo as VersionDiffPlugin,
112
+ rr as addCustomTemplate,
113
+ sr as buildApiUrl,
114
+ er as getAllTemplates,
115
+ zo as getDocumentManagerConfig,
116
+ Cr as getGlobalApiConfig,
117
+ cr as getGlobalApiHeaders,
118
+ Lo as getMediaManagerConfig,
119
+ tr as getTemplateCategories,
120
+ ir as getTemplatesByCategory,
121
+ nr as sanitizeTemplate,
122
+ lr as searchTemplates,
123
+ Go as setDocumentManagerConfig,
124
+ dr as setGlobalApiConfig,
125
+ Ho as setMediaManagerConfig,
126
+ gr as validateTemplate
99
127
  };
@@ -0,0 +1,105 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=".rte-content, .editora-content",Y="[data-editora-editor], .rte-editor, .editora-editor, editora-editor",w='.rte-mention[data-mention="true"]',b=':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)',L=new WeakMap,R=new WeakMap;let q=!1,N=!1,T=null,v=0;function Q(e,n){if(n===e.innerHTML)return;const o=window.execEditorCommand||window.executeEditorCommand;if(typeof o=="function")try{o("recordDomTransaction",e,n,e.innerHTML)}catch{}}function U(e){e.dispatchEvent(new Event("input",{bubbles:!0}))}function h(e,n){const o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(n),e.focus({preventScroll:!0}))}function S(e,n){return e.startContainer===n.startContainer&&e.startOffset===n.startOffset&&e.endContainer===n.endContainer&&e.endOffset===n.endOffset}function E(e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const o=n.getRangeAt(0);return e.contains(o.commonAncestorContainer)?o.cloneRange():null}function C(e){Array.from(e.querySelectorAll(w)).forEach(o=>{o.setAttribute("data-mention","true"),o.setAttribute("contenteditable","false"),o.setAttribute("spellcheck","false"),o.setAttribute("draggable","false"),o.classList.add("rte-mention")})}function _(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function ee(e){return e.closest(Y)||e}function M(e){return e?(e.getAttribute("data-theme")||e.getAttribute("theme")||"").toLowerCase()==="dark"?!0:e.classList.contains("dark")||e.classList.contains("editora-theme-dark")||e.classList.contains("rte-theme-dark"):!1}function ne(e){const n=ee(e);if(M(n))return!0;const o=n.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");return M(o)?!0:M(document.documentElement)||M(document.body)}function W(e,n){e.classList.remove("rte-mention-theme-dark"),ne(n)&&e.classList.add("rte-mention-theme-dark")}function te(e){if(e?.contentElement instanceof HTMLElement)return e.contentElement;if(e?.editorElement instanceof HTMLElement){const t=e.editorElement;if(t.matches(g))return t;const r=t.querySelector(g);if(r instanceof HTMLElement)return r}const n=window.getSelection();if(n&&n.rangeCount>0){const t=n.getRangeAt(0).startContainer,i=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest(g);if(i)return i}const o=document.activeElement;if(o){if(o.matches(g))return o;const t=o.closest(g);if(t)return t}return document.querySelector(g)}function x(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function D(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function re(e,n){return n?n.split(".").filter(Boolean).reduce((o,t)=>{if(!(!D(o)&&!Array.isArray(o)))return o[t]},e):e}function oe(e){return e?/\s|[([{"'`]/.test(e):!0}function ie(e){if(!e.collapsed)return null;const n=e.startContainer,o=e.startOffset;if(n.nodeType===Node.TEXT_NODE){const t=n;return{node:t,textBefore:t.data.slice(0,o),caretOffset:o}}if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(o>0){const r=t.childNodes[o-1];if(r&&r.nodeType===Node.TEXT_NODE){const i=r;return{node:i,textBefore:i.data,caretOffset:i.length}}}}return null}function ae(e,n,o){let t=-1,r="";if(n.forEach(a=>{const l=e.lastIndexOf(a);l>t&&(t=l,r=a)}),t<0||!oe(e[t-1]))return null;const i=e.slice(t+1);return/\s/.test(i)||i.length>o?null:{trigger:r,query:i,startOffset:t}}function le(e,n){const o=n.cloneRange();o.collapse(!1);const t=o.getClientRects();if(t.length>0)return t[t.length-1];const r=document.createElement("span");r.textContent="​",r.style.position="relative",o.insertNode(r);const i=r.getBoundingClientRect();return r.remove(),e.normalize(),i}function se(e,n){if(e.panel&&e.list)return;const o=document.createElement("div");o.className="rte-mention-panel",o.style.display="none";const t=document.createElement("div");t.className="rte-mention-list",o.appendChild(t),document.body.appendChild(o),W(o,e.editor),e.panel=o,e.list=t,o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{const i=r.target;if(!i)return;const a=i.closest(".rte-mention-item");if(!a)return;const l=Number(a.getAttribute("data-index"));Number.isFinite(l)&&K(e,n,l)})}function m(e){e.panel&&(e.debounceHandle!==null&&(window.clearTimeout(e.debounceHandle),e.debounceHandle=null),e.abortController&&(e.abortController.abort(),e.abortController=null),e.panel.style.display="none",e.panel.classList.remove("show"),e.isOpen=!1,e.loading=!1,e.items=[],e.activeIndex=0,e.query="",e.replaceRange=null)}function $(e,n){if(!e.panel)return;W(e.panel,e.editor);const o=le(e.editor,n),t=e.panel;t.style.display="block",t.classList.add("show"),t.style.left="0px",t.style.top="0px";const r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight;let l=Math.max(8,Math.min(o.left,i-r.width-8)),s=o.bottom+8;s+r.height>a-8&&(s=Math.max(8,o.top-r.height-8)),t.style.position="fixed",t.style.left=`${l}px`,t.style.top=`${s}px`}function ce(e,n){if(!n)return x(e);const o=e.toLowerCase(),t=n.toLowerCase(),r=o.indexOf(t);if(r<0)return x(e);const i=x(e.slice(0,r)),a=x(e.slice(r,r+n.length)),l=x(e.slice(r+n.length));return`${i}<mark>${a}</mark>${l}`}function B(e,n){if(!e.list)return;const o=e.list;if(o.innerHTML="",e.loading){const t=document.createElement("div");t.className="rte-mention-empty",t.textContent=n.loadingText,o.appendChild(t);return}if(e.items.length===0){const t=document.createElement("div");t.className="rte-mention-empty",t.textContent=e.query.length>0?n.noResultsText:n.emptyStateText,o.appendChild(t);return}e.items.forEach((t,r)=>{const i=document.createElement("button");i.type="button",i.className="rte-mention-item",r===e.activeIndex&&i.classList.add("active"),i.setAttribute("data-index",String(r));const a=n.itemRenderer?n.itemRenderer(t,e.query):`<span class="rte-mention-item-label">${ce(t.label,e.query)}</span>${t.meta?`<span class="rte-mention-item-meta">${x(t.meta)}</span>`:""}`;i.innerHTML=a,o.appendChild(i)})}function G(e,n){const o=new Set,t=[];return e.forEach(r=>{const i=(r.id||"").trim();!i||o.has(i)||(o.add(i),t.push({id:i,label:r.label||i,value:r.value,meta:r.meta}))}),t.slice(0,n)}function ue(e,n){if(e.buildRequest){const c=e.buildRequest(n);return{url:c.url,init:c.init||{}}}const o=(e.method||"GET").toUpperCase(),t=typeof e.headers=="function"?e.headers(n):e.headers||{},r=e.queryParam||"q",i=e.triggerParam||"trigger",a=e.limitParam||"limit",l=e.staticParams||{},s={method:o,headers:{...t},credentials:e.credentials,mode:e.mode,cache:e.cache,signal:n.signal},f=new URL(e.url,window.location.origin);if(o==="GET"||o==="HEAD"){const c=new URLSearchParams(f.search);Object.entries(l).forEach(([d,p])=>c.set(d,String(p))),c.set(r,n.query),c.set(i,n.trigger),c.set(a,String(n.limit)),f.search=c.toString()}else{const c=typeof e.body=="function"?e.body(n):e.body,d={[r]:n.query,[i]:n.trigger,[a]:n.limit,...l},p=c??d;if(D(p)){s.body=JSON.stringify(p);const y=s.headers;!y["Content-Type"]&&!y["content-type"]&&(y["Content-Type"]="application/json")}else s.body=p}return{url:f.toString(),init:s}}async function de(e,n,o,t){const r=n.api;if(!r)return[];e.abortController&&e.abortController.abort();const i=new AbortController;e.abortController=i;const a={query:o,trigger:t,limit:n.maxSuggestions,signal:i.signal},l=Math.max(0,r.timeoutMs??1e4);let s=null;l>0&&(s=window.setTimeout(()=>i.abort(),l));try{const{url:f,init:c}=ue(r,a),d=await fetch(f,{...c,signal:i.signal});if(!d.ok)throw new Error(`Mention API request failed: ${d.status}`);const y=(r.responseType||"json")==="text"?await d.text():await d.json();let O=[];if(r.transformResponse)O=r.transformResponse(y,a)||[];else{const P=re(y,r.responsePath);O=(Array.isArray(P)?P:Array.isArray(y)?y:[]).map((u,J)=>{if(r.mapItem)return r.mapItem(u,J);if(!D(u))return null;const I=String(u.id??u.value??u.key??"").trim();if(!I)return null;const Z=String(u.label??u.name??I).trim();return{id:I,label:Z,value:u.value?String(u.value):void 0,meta:u.meta?String(u.meta):void 0}}).filter(u=>!!u)}return G(O,n.maxSuggestions)}catch(f){return f?.name!=="AbortError"&&r.onError?.(f,a),[]}finally{s!==null&&window.clearTimeout(s),e.abortController===i&&(e.abortController=null)}}async function fe(e,n,o,t){const r=++e.requestId;let i=[];if(n.search){const a=await n.search(o,t);i=Array.isArray(a)?a:[]}else if(n.api)i=await de(e,n,o,t);else{const a=o.toLowerCase();i=n.items.filter(l=>a?l.label.toLowerCase().includes(a)||l.id.toLowerCase().includes(a):!0)}return r!==e.requestId?[]:G(i,n.maxSuggestions)}function me(e,n,o){const t=e.editor;if(C(t),!window.getSelection())return!1;const i=t.innerHTML;let a=e.replaceRange?e.replaceRange.cloneRange():E(t);if(!a||!t.contains(a.commonAncestorContainer)&&(a=E(t),!a))return!1;const l=A(t,a.cloneRange(),"after");S(l,a)||(h(t,l),a=l),a.deleteContents();const s=document.createElement("span");s.className="rte-mention",s.setAttribute("data-mention","true"),s.setAttribute("data-mention-id",o.id),s.setAttribute("contenteditable","false"),s.textContent=o.value||`${e.trigger}${o.label}`,a.insertNode(s);let f=s,c=1;if(n.insertSpaceAfterMention){const p=document.createTextNode(" ");s.after(p),f=p,c=1}const d=document.createRange();return d.setStart(f,c),d.collapse(!0),h(t,d),m(e),C(t),U(t),Q(t,i),!0}function K(e,n,o){if(o<0||o>=e.items.length)return;const t=e.items[o];me(e,n,t)}function pe(e){return e.startContainer!==e.endContainer||e.startContainer.nodeType!==Node.ELEMENT_NODE||e.endOffset-e.startOffset!==1?null:e.startContainer.childNodes[e.startOffset]||null}function ge(e,n){const o=pe(e);return!(o instanceof HTMLElement)||!o.matches(w)||!n.contains(o)?null:o}function V(e,n){const o=ge(e,n);if(o)return o;const r=_(e.startContainer)?.closest(w);if(r&&n.contains(r))return r;const a=_(e.endContainer)?.closest(w);return a&&n.contains(a)?a:null}function A(e,n,o="after"){const t=V(n,e);if(!t)return n;const r=document.createRange();return o==="before"?r.setStartBefore(t):r.setStartAfter(t),r.collapse(!0),r}function j(e,n,o="after"){const t=document.createRange();o==="before"?t.setStartBefore(n):t.setStartAfter(n),t.collapse(!0),h(e,t)}function he(e,n,o){if(!e.collapsed)return null;const t=e.startContainer,r=e.startOffset;let i=null;if(t.nodeType===Node.TEXT_NODE){const a=t;n==="backward"&&r===0?i=a.previousSibling:n==="forward"&&r===a.length&&(i=a.nextSibling)}else if(t.nodeType===Node.ELEMENT_NODE){const a=t;n==="backward"&&r>0?i=a.childNodes[r-1]||null:n==="forward"&&r<a.childNodes.length&&(i=a.childNodes[r]||null)}return!(i instanceof HTMLElement)||!i.matches(w)||!o.contains(i)?null:i}function z(e,n){const o=E(e);if(!o)return!1;const t=he(o,n,e);if(!t)return!1;const r=t.parentNode;if(!r)return!1;const i=e.innerHTML,a=Array.prototype.indexOf.call(r.childNodes,t);t.remove();const l=document.createRange();return l.setStart(r,Math.max(0,a)),l.collapse(!0),h(e,l),U(e),Q(e,i),!0}function X(e,n,o,t,r,i){if(se(e,n),e.query=t,e.trigger=r,e.replaceRange=i.cloneRange(),e.loading=!!(n.api&&!n.search),e.debounceHandle!==null&&(window.clearTimeout(e.debounceHandle),e.debounceHandle=null),!e.panel)return;e.isOpen||(e.panel.style.display="block",e.panel.classList.add("show"),e.isOpen=!0),B(e,n),$(e,o);const a=()=>{e.debounceHandle=null,fe(e,n,t,r).then(s=>{e.loading=!1,e.items=s,e.activeIndex=0,e.panel&&(B(e,n),$(e,o))})},l=n.api&&!n.search?Math.max(0,n.api.debounceMs??180):0;l>0?e.debounceHandle=window.setTimeout(a,l):a()}function ye(e,n){const o=e.editor;C(o);let t=E(o);if(!t||!t.collapsed){m(e);return}const r=A(o,t.cloneRange(),"after");if(!S(r,t)){h(o,r),t=r,m(e);return}const i=ie(t);if(!i){m(e);return}const a=ae(i.textBefore,n.triggerChars,n.maxQueryLength);if(!a){m(e);return}if(a.query.length<n.minChars){m(e);return}const l=t.cloneRange();l.setStart(i.node,a.startOffset),l.setEnd(i.node,i.caretOffset),X(e,n,t,a.query,a.trigger,l)}function F(e,n){if(e.items.length===0)return;const o=e.items.length;if(e.activeIndex=((e.activeIndex+n)%o+o)%o,!e.list)return;const t=Array.from(e.list.querySelectorAll(".rte-mention-item"));t.forEach((i,a)=>i.classList.toggle("active",a===e.activeIndex)),t[e.activeIndex]?.scrollIntoView({block:"nearest"})}function be(e){return{editor:e,panel:null,list:null,replaceRange:null,items:[],activeIndex:0,query:"",trigger:"@",loading:!1,isOpen:!1,requestId:0,debounceHandle:null,abortController:null}}function Ee(e){const n=L.get(e);n&&(n.panel?.parentNode&&n.panel.parentNode.removeChild(n.panel),L.delete(e))}function H(e,n,o){if(R.has(e))return;C(e);const t={beforeInput:r=>{C(e);const i=E(e);if(!i)return;const a=V(i,e);if(!a)return;const l=r.inputType||"";if(l.startsWith("insert")){if(r.preventDefault(),j(e,a,"after"),l==="insertParagraph"||l==="insertLineBreak"){const s=l==="insertLineBreak"?"insertLineBreak":"insertParagraph";document.execCommand(s,!1);return}if(l==="insertText"||l==="insertCompositionText"){const s=r.data||"";if(!s)return;document.execCommand("insertText",!1,s)}}},input:()=>{ye(n,o)},keydown:r=>{if(n.isOpen){if(r.key==="ArrowDown"){r.preventDefault(),F(n,1);return}if(r.key==="ArrowUp"){r.preventDefault(),F(n,-1);return}if(r.key==="Enter"||r.key==="Tab"){r.preventDefault(),K(n,o,n.activeIndex);return}if(r.key==="Escape"){r.preventDefault(),m(n);return}}const i=E(e);if(i){const a=A(e,i.cloneRange(),"after");if(!S(a,i)){if(r.key==="Enter"){r.preventDefault(),h(e,a),document.execCommand("insertParagraph",!1);return}r.key.length===1&&!r.metaKey&&!r.ctrlKey&&!r.altKey&&h(e,a)}}if(r.key==="Backspace"&&z(e,"backward")){r.preventDefault();return}if(r.key==="Delete"&&z(e,"forward")){r.preventDefault();return}},click:r=>{const i=r.target;if(!i)return;const l=(i.nodeType===Node.ELEMENT_NODE?i:i.parentElement)?.closest(w);!l||!e.contains(l)||(r.preventDefault(),r.stopPropagation(),j(e,l,"after"),m(n))},blur:()=>{window.setTimeout(()=>{const r=document.activeElement;n.panel&&r&&n.panel.contains(r)||m(n)},0)},mousedown:r=>{if(!n.isOpen||!n.panel)return;const i=r.target;i&&!n.panel.contains(i)&&!e.contains(i)&&m(n)}};e.addEventListener("beforeinput",t.beforeInput),e.addEventListener("input",t.input),e.addEventListener("keydown",t.keydown),e.addEventListener("click",t.click),e.addEventListener("blur",t.blur),document.addEventListener("mousedown",t.mousedown,!0),R.set(e,t)}function xe(e){const n=R.get(e);n&&(e.removeEventListener("beforeinput",n.beforeInput),e.removeEventListener("input",n.input),e.removeEventListener("keydown",n.keydown),e.removeEventListener("click",n.click),e.removeEventListener("blur",n.blur),document.removeEventListener("mousedown",n.mousedown,!0),R.delete(e))}function we(){if(q||typeof document>"u")return;q=!0;const e=document.createElement("style");e.id="rte-mention-plugin-styles",e.textContent=`
2
+ .rte-mention {
3
+ display: inline-block;
4
+ padding: 0 6px;
5
+ margin: 0 1px;
6
+ border-radius: 10px;
7
+ background: #e8f0ff;
8
+ color: #1d4ed8;
9
+ font-weight: 600;
10
+ line-height: 1.6;
11
+ white-space: nowrap;
12
+ cursor: pointer;
13
+ }
14
+
15
+ .rte-mention-panel {
16
+ width: min(320px, calc(100vw - 16px));
17
+ max-height: min(320px, calc(100vh - 32px));
18
+ overflow: hidden;
19
+ border: 1px solid #d9dfeb;
20
+ border-radius: 3px;
21
+ background: #ffffff;
22
+ box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
23
+ z-index: 2147483646;
24
+ }
25
+
26
+ .rte-mention-list {
27
+ max-height: min(300px, calc(100vh - 56px));
28
+ overflow: auto;
29
+ padding: 0px;
30
+ }
31
+
32
+ .rte-mention-item {
33
+ width: 100%;
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: space-between;
37
+ gap: 12px;
38
+ border: none;
39
+ background: transparent;
40
+ padding: 10px 12px;
41
+ border-radius: 0px;
42
+ color: #0f172a;
43
+ text-align: left;
44
+ cursor: pointer;
45
+ font: inherit;
46
+ }
47
+
48
+ .rte-mention-item:hover,
49
+ .rte-mention-item.active {
50
+ background: #eff6ff;
51
+ color: #1d4ed8;
52
+ }
53
+
54
+ .rte-mention-item-label mark {
55
+ background: rgba(59, 130, 246, 0.16);
56
+ color: inherit;
57
+ padding: 0 2px;
58
+ border-radius: 3px;
59
+ }
60
+
61
+ .rte-mention-item-meta {
62
+ font-size: 12px;
63
+ color: #64748b;
64
+ white-space: nowrap;
65
+ }
66
+
67
+ .rte-mention-empty {
68
+ padding: 12px;
69
+ color: #64748b;
70
+ font-size: 13px;
71
+ text-align: center;
72
+ }
73
+
74
+ ${b} .rte-mention {
75
+ background: rgba(37, 99, 235, 0.25);
76
+ color: #bfdbfe;
77
+ }
78
+
79
+ ${b} .rte-mention-panel,
80
+ .rte-mention-panel.rte-mention-theme-dark {
81
+ border-color: #364152;
82
+ background: #1f2937;
83
+ box-shadow: 0 22px 44px rgba(0, 0, 0, 0.48);
84
+ }
85
+
86
+ ${b} .rte-mention-item,
87
+ .rte-mention-panel.rte-mention-theme-dark .rte-mention-item {
88
+ color: #e5e7eb;
89
+ }
90
+
91
+ ${b} .rte-mention-item:hover,
92
+ ${b} .rte-mention-item.active,
93
+ .rte-mention-panel.rte-mention-theme-dark .rte-mention-item:hover,
94
+ .rte-mention-panel.rte-mention-theme-dark .rte-mention-item.active {
95
+ background: #334155;
96
+ color: #bfdbfe;
97
+ }
98
+
99
+ ${b} .rte-mention-item-meta,
100
+ ${b} .rte-mention-empty,
101
+ .rte-mention-panel.rte-mention-theme-dark .rte-mention-item-meta,
102
+ .rte-mention-panel.rte-mention-theme-dark .rte-mention-empty {
103
+ color: #9ca3af;
104
+ }
105
+ `,document.head.appendChild(e)}function Te(e){const n=(e.triggerChars||["@"]).filter(o=>typeof o=="string"&&o.length>0).map(o=>o[0]);return{triggerChars:n.length>0?n:["@"],minChars:Math.max(0,e.minChars??1),maxQueryLength:Math.max(1,e.maxQueryLength??32),maxSuggestions:Math.max(1,e.maxSuggestions??8),items:e.items||[{id:"john.doe",label:"John Doe",meta:"john@acme.com"},{id:"sarah.lee",label:"Sarah Lee",meta:"sarah@acme.com"},{id:"alex.chen",label:"Alex Chen",meta:"alex@acme.com"}],api:e.api,search:e.search,itemRenderer:e.itemRenderer,emptyStateText:e.emptyStateText||"Type to search mentions",noResultsText:e.noResultsText||"No matching mentions",loadingText:e.loadingText||"Loading...",insertSpaceAfterMention:e.insertSpaceAfterMention!==!1}}function k(e){const n=L.get(e);if(n)return n;const o=be(e);return L.set(e,o),o}function Ce(e){N||(N=!0,T=n=>{const o=n.target;if(!(o instanceof Node))return;const r=(o.nodeType===Node.ELEMENT_NODE?o:o.parentElement)?.closest(g)||null;if(!r)return;const i=k(r);H(r,i,e)},document.addEventListener("focusin",T,!0))}function ve(){!N||!T||(document.removeEventListener("focusin",T,!0),N=!1,T=null)}const Me=(e={})=>{we();const n=Te(e);return{name:"mentions",toolbar:[{label:"Mention",command:"insertMention",icon:'<svg width="24" height="24" focusable="false"><path d="M12.1 4a7.9 7.9 0 0 0-8 8c0 4.4 3.6 8 8 8 1.6 0 3-.4 4.4-1.3.4-.3.5-.9.2-1.3a1 1 0 0 0-1.3-.3 6 6 0 0 1-3.3.9 6 6 0 1 1 6-6v1.6c0 .8-.5 1.4-1.2 1.4-.8 0-1.2-.6-1.2-1.4V12c0-2-1.6-3.5-3.7-3.5s-3.8 1.6-3.8 3.6c0 2 1.7 3.6 3.8 3.6 1 0 1.9-.4 2.6-1 .5 1 1.4 1.6 2.5 1.6 1.8 0 3.2-1.5 3.2-3.4V12A7.9 7.9 0 0 0 12 4Zm0 9.7c-1 0-1.8-.8-1.8-1.7s.8-1.7 1.8-1.7c1 0 1.7.8 1.7 1.7s-.8 1.7-1.7 1.7Z"></path></svg>'}],commands:{insertMention:(o,t)=>{const r=te(t);if(!r)return!1;const i=k(r);H(r,i,n);let a=E(r);a||(a=document.createRange(),a.selectNodeContents(r),a.collapse(!1),h(r,a));const l=A(r,a.cloneRange(),"after");S(l,a)||(h(r,l),a=l),i.query="";const s=a.cloneRange();return i.trigger=n.triggerChars[0],X(i,n,a,"",i.trigger,s),!0}},init:()=>{v+=1,Ce(n),Array.from(document.querySelectorAll(g)).forEach(t=>{const r=k(t);H(t,r,n)})},destroy:()=>{v=Math.max(0,v-1),Array.from(document.querySelectorAll(g)).forEach(t=>{m(k(t)),xe(t),Ee(t)}),v===0&&ve()}}};exports.MentionPlugin=Me;