reactjs-tiptap-editor 0.3.19 → 0.3.21

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 (244) hide show
  1. package/lib/{ActionMenuButton-BPq-R8E7.cjs → ActionMenuButton-BTFBZyG2.cjs} +1 -1
  2. package/lib/{ActionMenuButton-DCACoSG3.js → ActionMenuButton-DXwnYZhJ.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +28 -28
  5. package/lib/Attachment.d.ts +28 -28
  6. package/lib/Attachment.js +3 -3
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +28 -28
  9. package/lib/Blockquote.d.ts +28 -28
  10. package/lib/Blockquote.js +2 -2
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +28 -28
  13. package/lib/Bold.d.ts +28 -28
  14. package/lib/Bold.js +2 -2
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +28 -28
  17. package/lib/BulletList.d.ts +28 -28
  18. package/lib/BulletList.js +2 -2
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +28 -28
  21. package/lib/Clear.d.ts +28 -28
  22. package/lib/Clear.js +2 -2
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +28 -28
  25. package/lib/Code.d.ts +28 -28
  26. package/lib/Code.js +2 -2
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +28 -28
  29. package/lib/CodeBlock.d.ts +28 -28
  30. package/lib/CodeBlock.js +3 -3
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +28 -28
  33. package/lib/CodeView.d.ts +28 -28
  34. package/lib/CodeView.js +2 -2
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +28 -28
  37. package/lib/Color.d.ts +28 -28
  38. package/lib/Color.js +3 -3
  39. package/lib/Document.cjs +1 -1
  40. package/lib/Document.d.cts +28 -28
  41. package/lib/Document.d.ts +28 -28
  42. package/lib/Document.js +1 -1
  43. package/lib/{Drawer-Dwx9V0Xb.cjs → Drawer-BrHHs2E9.cjs} +1 -1
  44. package/lib/{Drawer-Qh1zEBl3.js → Drawer-CVuwyG50.js} +3 -3
  45. package/lib/Drawer.cjs +1 -1
  46. package/lib/Drawer.d.cts +28 -28
  47. package/lib/Drawer.d.ts +28 -28
  48. package/lib/Drawer.js +4 -4
  49. package/lib/Emoji.cjs +1 -1
  50. package/lib/Emoji.d.cts +28 -28
  51. package/lib/Emoji.d.ts +28 -28
  52. package/lib/Emoji.js +4 -4
  53. package/lib/{Excalidraw-BP_-zWZH.cjs → Excalidraw-Be_GDV4Q.cjs} +1 -1
  54. package/lib/{Excalidraw-DD3P3ClH.js → Excalidraw-frMX4K62.js} +3 -3
  55. package/lib/Excalidraw.cjs +1 -1
  56. package/lib/Excalidraw.d.cts +28 -28
  57. package/lib/Excalidraw.d.ts +28 -28
  58. package/lib/Excalidraw.js +3 -3
  59. package/lib/ExportPdf.cjs +1 -1
  60. package/lib/ExportPdf.d.cts +28 -28
  61. package/lib/ExportPdf.d.ts +28 -28
  62. package/lib/ExportPdf.js +2 -2
  63. package/lib/ExportWord.cjs +1 -1
  64. package/lib/ExportWord.d.cts +28 -28
  65. package/lib/ExportWord.d.ts +28 -28
  66. package/lib/ExportWord.js +2 -2
  67. package/lib/FontFamily.cjs +1 -1
  68. package/lib/FontFamily.d.cts +28 -28
  69. package/lib/FontFamily.d.ts +28 -28
  70. package/lib/FontFamily.js +4 -4
  71. package/lib/FontSize.cjs +1 -1
  72. package/lib/FontSize.d.cts +28 -28
  73. package/lib/FontSize.d.ts +28 -28
  74. package/lib/FontSize.js +3 -3
  75. package/lib/FormatPainter.cjs +1 -1
  76. package/lib/FormatPainter.d.cts +28 -28
  77. package/lib/FormatPainter.d.ts +28 -28
  78. package/lib/FormatPainter.js +2 -2
  79. package/lib/Heading.cjs +1 -1
  80. package/lib/Heading.d.cts +28 -28
  81. package/lib/Heading.d.ts +28 -28
  82. package/lib/Heading.js +3 -3
  83. package/lib/Highlight.cjs +1 -1
  84. package/lib/Highlight.d.cts +28 -28
  85. package/lib/Highlight.d.ts +28 -28
  86. package/lib/Highlight.js +2 -2
  87. package/lib/History.cjs +1 -1
  88. package/lib/History.d.cts +28 -28
  89. package/lib/History.d.ts +28 -28
  90. package/lib/History.js +2 -2
  91. package/lib/HorizontalRule.cjs +1 -1
  92. package/lib/HorizontalRule.d.cts +28 -28
  93. package/lib/HorizontalRule.d.ts +28 -28
  94. package/lib/HorizontalRule.js +2 -2
  95. package/lib/Iframe.cjs +1 -1
  96. package/lib/Iframe.d.cts +28 -28
  97. package/lib/Iframe.d.ts +28 -28
  98. package/lib/Iframe.js +3 -3
  99. package/lib/Image.cjs +1 -1
  100. package/lib/Image.d.cts +28 -28
  101. package/lib/Image.d.ts +28 -28
  102. package/lib/Image.js +3 -3
  103. package/lib/ImageGif.cjs +1 -1
  104. package/lib/ImageGif.d.cts +28 -28
  105. package/lib/ImageGif.d.ts +28 -28
  106. package/lib/ImageGif.js +3 -3
  107. package/lib/ImportWord.cjs +74 -74
  108. package/lib/ImportWord.d.cts +28 -28
  109. package/lib/ImportWord.d.ts +28 -28
  110. package/lib/ImportWord.js +5015 -4998
  111. package/lib/Indent.cjs +1 -1
  112. package/lib/Indent.d.cts +28 -28
  113. package/lib/Indent.d.ts +28 -28
  114. package/lib/Indent.js +2 -2
  115. package/lib/Italic.cjs +1 -1
  116. package/lib/Italic.d.cts +28 -28
  117. package/lib/Italic.d.ts +28 -28
  118. package/lib/Italic.js +2 -2
  119. package/lib/Katex.cjs +1 -1
  120. package/lib/Katex.d.cts +28 -28
  121. package/lib/Katex.d.ts +28 -28
  122. package/lib/Katex.js +4 -4
  123. package/lib/LineHeight.cjs +1 -1
  124. package/lib/LineHeight.d.cts +28 -28
  125. package/lib/LineHeight.d.ts +28 -28
  126. package/lib/LineHeight.js +2 -2
  127. package/lib/Link.cjs +1 -1
  128. package/lib/Link.d.cts +28 -28
  129. package/lib/Link.d.ts +28 -28
  130. package/lib/Link.js +2 -2
  131. package/lib/ListItem.cjs +1 -1
  132. package/lib/ListItem.d.cts +28 -28
  133. package/lib/ListItem.d.ts +28 -28
  134. package/lib/ListItem.js +1 -1
  135. package/lib/Mention.cjs +1 -1
  136. package/lib/Mention.d.cts +28 -28
  137. package/lib/Mention.d.ts +28 -28
  138. package/lib/Mention.js +123 -91
  139. package/lib/Mermaid.cjs +1 -1
  140. package/lib/Mermaid.d.cts +28 -28
  141. package/lib/Mermaid.d.ts +28 -28
  142. package/lib/Mermaid.js +4 -4
  143. package/lib/MoreMark.cjs +1 -1
  144. package/lib/MoreMark.d.cts +28 -28
  145. package/lib/MoreMark.d.ts +28 -28
  146. package/lib/MoreMark.js +3 -3
  147. package/lib/MultiColumn.cjs +1 -1
  148. package/lib/MultiColumn.d.cts +28 -28
  149. package/lib/MultiColumn.d.ts +28 -28
  150. package/lib/MultiColumn.js +2 -2
  151. package/lib/OrderedList.cjs +1 -1
  152. package/lib/OrderedList.d.cts +28 -28
  153. package/lib/OrderedList.d.ts +28 -28
  154. package/lib/OrderedList.js +2 -2
  155. package/lib/RichTextEditor-CAxwVWUE.cjs +137 -0
  156. package/lib/{RichTextEditor-DIvPROxl.js → RichTextEditor-DjTnd5Uu.js} +1607 -1603
  157. package/lib/SearchAndReplace.cjs +1 -1
  158. package/lib/SearchAndReplace.d.cts +28 -28
  159. package/lib/SearchAndReplace.d.ts +28 -28
  160. package/lib/SearchAndReplace.js +2 -2
  161. package/lib/Selection.cjs +1 -1
  162. package/lib/Selection.d.cts +28 -28
  163. package/lib/Selection.d.ts +28 -28
  164. package/lib/Selection.js +1 -1
  165. package/lib/SlashCommand.cjs +1 -1
  166. package/lib/SlashCommand.d.cts +28 -28
  167. package/lib/SlashCommand.d.ts +28 -28
  168. package/lib/SlashCommand.js +4 -4
  169. package/lib/Strike.cjs +1 -1
  170. package/lib/Strike.d.cts +28 -28
  171. package/lib/Strike.d.ts +28 -28
  172. package/lib/Strike.js +2 -2
  173. package/lib/SubAndSuperScript.cjs +1 -1
  174. package/lib/SubAndSuperScript.d.cts +28 -28
  175. package/lib/SubAndSuperScript.d.ts +28 -28
  176. package/lib/SubAndSuperScript.js +3 -3
  177. package/lib/Table.cjs +1 -1
  178. package/lib/Table.d.cts +28 -28
  179. package/lib/Table.d.ts +28 -28
  180. package/lib/Table.js +2 -2
  181. package/lib/TableOfContent.cjs +1 -1
  182. package/lib/TableOfContent.d.cts +28 -28
  183. package/lib/TableOfContent.d.ts +28 -28
  184. package/lib/TableOfContent.js +3 -3
  185. package/lib/TaskList.cjs +1 -1
  186. package/lib/TaskList.d.cts +28 -28
  187. package/lib/TaskList.d.ts +28 -28
  188. package/lib/TaskList.js +37 -33
  189. package/lib/TextAlign.cjs +1 -1
  190. package/lib/TextAlign.d.cts +28 -28
  191. package/lib/TextAlign.d.ts +28 -28
  192. package/lib/TextAlign.js +2 -2
  193. package/lib/TextBubble.cjs +1 -1
  194. package/lib/TextBubble.d.cts +28 -28
  195. package/lib/TextBubble.d.ts +28 -28
  196. package/lib/TextBubble.js +2 -2
  197. package/lib/TextDirection.cjs +1 -1
  198. package/lib/TextDirection.d.cts +28 -28
  199. package/lib/TextDirection.d.ts +28 -28
  200. package/lib/TextDirection.js +2 -2
  201. package/lib/TextUnderline.cjs +1 -1
  202. package/lib/TextUnderline.d.cts +28 -28
  203. package/lib/TextUnderline.d.ts +28 -28
  204. package/lib/TextUnderline.js +2 -2
  205. package/lib/TrailingNode.cjs +1 -1
  206. package/lib/TrailingNode.d.cts +28 -28
  207. package/lib/TrailingNode.d.ts +28 -28
  208. package/lib/TrailingNode.js +1 -1
  209. package/lib/{Twitter-Bl5HyIX0.cjs → Twitter-V0OzBT_E.cjs} +1 -1
  210. package/lib/{Twitter-raSi7ATg.js → Twitter-dRxbZOad.js} +3 -3
  211. package/lib/Twitter.cjs +1 -1
  212. package/lib/Twitter.d.cts +28 -28
  213. package/lib/Twitter.d.ts +28 -28
  214. package/lib/Twitter.js +3 -3
  215. package/lib/Video.cjs +1 -1
  216. package/lib/Video.d.cts +28 -28
  217. package/lib/Video.d.ts +28 -28
  218. package/lib/Video.js +2 -2
  219. package/lib/bubble-extra.cjs +2 -2
  220. package/lib/bubble-extra.d.cts +28 -28
  221. package/lib/bubble-extra.d.ts +28 -28
  222. package/lib/bubble-extra.js +25 -25
  223. package/lib/{dom-dataset-Cuy-pIfj.cjs → dom-dataset-Byuf1YmW.cjs} +5 -5
  224. package/lib/{dom-dataset-CHDbKz5J.js → dom-dataset-Di3tIRrR.js} +94 -83
  225. package/lib/index-BI-IcZcN.cjs +1 -0
  226. package/lib/{index-CSvnpArE.cjs → index-ByRfqzMr.cjs} +2 -2
  227. package/lib/{index-DIPntess.js → index-C1fzuXpN.js} +1 -1
  228. package/lib/index-CbQQFj2T.js +133 -0
  229. package/lib/{index-BWx1Mchx.js → index-DI9T3iLd.js} +243 -243
  230. package/lib/{index-CrxasX7b.cjs → index-DclQSrIx.cjs} +1 -1
  231. package/lib/{index-DEFQHExY.js → index-LUL9mqY4.js} +1 -1
  232. package/lib/{index-h9_SDuwc.cjs → index-Z4b9rzn-.cjs} +1 -1
  233. package/lib/index.cjs +1 -1
  234. package/lib/index.d.cts +28 -28
  235. package/lib/index.d.ts +28 -28
  236. package/lib/index.js +5 -5
  237. package/lib/locale-bundle.d.cts +28 -28
  238. package/lib/locale-bundle.d.ts +28 -28
  239. package/lib/{textarea-DnBlTntN.js → textarea-6c8drwXJ.js} +1 -1
  240. package/lib/{textarea-DgXP0XRK.cjs → textarea-BsJTSgT-.cjs} +1 -1
  241. package/package.json +67 -67
  242. package/lib/RichTextEditor-DszaQdvS.cjs +0 -141
  243. package/lib/index-Cyh1yoFk.cjs +0 -1
  244. package/lib/index-oQutU45z.js +0 -129
@@ -1 +0,0 @@
1
- "use strict";const q=require("./index-CSvnpArE.cjs");function U(B){var c;const{char:_,allowSpaces:C,allowToIncludeChar:E,allowedPrefixes:f,startOfLine:D,$position:d}=B,I=C&&!E,g=q.escapeForRegEx(_),M=new RegExp(`\\s${g}$`),v=D?"^":"",R=E?"":g,k=I?new RegExp(`${v}${g}.*?(?=\\s${R}|$)`,"gm"):new RegExp(`${v}(?:^)?${g}[^\\s${R}]*`,"gm"),r=((c=d.nodeBefore)===null||c===void 0?void 0:c.isText)&&d.nodeBefore.text;if(!r)return null;const e=d.pos-r.length,o=Array.from(r.matchAll(k)).pop();if(!o||o.input===void 0||o.index===void 0)return null;const n=o.input.slice(Math.max(0,o.index-1),o.index),i=new RegExp(`^[${f==null?void 0:f.join("")}\0]?$`).test(n);if(f!==null&&!i)return null;const a=e+o.index;let l=a+o[0].length;return I&&M.test(r.slice(l-1,l+1))&&(o[0]+=" ",l+=1),a<d.pos&&l>=d.pos?{range:{from:a,to:l},query:o[0].slice(_.length),text:o[0]}:null}const j=new q.PluginKey("suggestion");function L({pluginKey:B=j,editor:c,char:_="@",allowSpaces:C=!1,allowToIncludeChar:E=!1,allowedPrefixes:f=[" "],startOfLine:D=!1,decorationTag:d="span",decorationClass:I="suggestion",command:g=()=>null,items:M=()=>[],render:v=()=>({}),allow:R=()=>!0,findSuggestionMatch:k=U}){let r;const e=v==null?void 0:v(),o=new q.Plugin({key:B,view(){return{update:async(n,i)=>{var a,l,u,p,m,y,x;const t=(a=this.key)===null||a===void 0?void 0:a.getState(i),s=(l=this.key)===null||l===void 0?void 0:l.getState(n.state),S=t.active&&s.active&&t.range.from!==s.range.from,b=!t.active&&s.active,F=t.active&&!s.active,A=!b&&!F&&t.query!==s.query,$=b||S&&A,P=A||S,K=F||S&&A;if(!$&&!P&&!K)return;const h=K&&!$?t:s,O=n.dom.querySelector(`[data-decoration-id="${h.decorationId}"]`);r={editor:c,range:h.range,query:h.query,text:h.text,items:[],command:w=>g({editor:c,range:h.range,props:w}),decorationNode:O,clientRect:O?()=>{var w;const{decorationId:T}=(w=this.key)===null||w===void 0?void 0:w.getState(c.state),N=n.dom.querySelector(`[data-decoration-id="${T}"]`);return(N==null?void 0:N.getBoundingClientRect())||null}:null},$&&((u=e==null?void 0:e.onBeforeStart)===null||u===void 0||u.call(e,r)),P&&((p=e==null?void 0:e.onBeforeUpdate)===null||p===void 0||p.call(e,r)),(P||$)&&(r.items=await M({editor:c,query:h.query})),K&&((m=e==null?void 0:e.onExit)===null||m===void 0||m.call(e,r)),P&&((y=e==null?void 0:e.onUpdate)===null||y===void 0||y.call(e,r)),$&&((x=e==null?void 0:e.onStart)===null||x===void 0||x.call(e,r))},destroy:()=>{var n;r&&((n=e==null?void 0:e.onExit)===null||n===void 0||n.call(e,r))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,i,a,l){const{isEditable:u}=c,{composing:p}=c.view,{selection:m}=n,{empty:y,from:x}=m,t={...i};if(t.composing=p,u&&(y||c.view.composing)){(x<i.range.from||x>i.range.to)&&!p&&!i.composing&&(t.active=!1);const s=k({char:_,allowSpaces:C,allowToIncludeChar:E,allowedPrefixes:f,startOfLine:D,$position:m.$from}),S=`id_${Math.floor(Math.random()*4294967295)}`;s&&R({editor:c,state:l,range:s.range,isActive:i.active})?(t.active=!0,t.decorationId=i.decorationId?i.decorationId:S,t.range=s.range,t.query=s.query,t.text=s.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,i){var a;const{active:l,range:u}=o.getState(n.state);return l&&((a=e==null?void 0:e.onKeyDown)===null||a===void 0?void 0:a.call(e,{view:n,event:i,range:u}))||!1},decorations(n){const{active:i,range:a,decorationId:l}=o.getState(n);return i?q.DecorationSet.create(n.doc,[q.Decoration.inline(a.from,a.to,{nodeName:d,class:I,"data-decoration-id":l})]):null}}});return o}exports.Suggestion=L;
@@ -1,129 +0,0 @@
1
- import { a as T, P as U, D as j, b as L, e as z } from "./index-BWx1Mchx.js";
2
- function G(R) {
3
- var s;
4
- const { char: q, allowSpaces: D, allowToIncludeChar: _, allowedPrefixes: f, startOfLine: B, $position: d } = R, E = D && !_, g = z(q), C = new RegExp(`\\s${g}$`), v = B ? "^" : "", I = _ ? "" : g, M = E ? new RegExp(`${v}${g}.*?(?=\\s${I}|$)`, "gm") : new RegExp(`${v}(?:^)?${g}[^\\s${I}]*`, "gm"), r = ((s = d.nodeBefore) === null || s === void 0 ? void 0 : s.isText) && d.nodeBefore.text;
5
- if (!r)
6
- return null;
7
- const e = d.pos - r.length, o = Array.from(r.matchAll(M)).pop();
8
- if (!o || o.input === void 0 || o.index === void 0)
9
- return null;
10
- const n = o.input.slice(Math.max(0, o.index - 1), o.index), i = new RegExp(`^[${f == null ? void 0 : f.join("")}\0]?$`).test(n);
11
- if (f !== null && !i)
12
- return null;
13
- const a = e + o.index;
14
- let l = a + o[0].length;
15
- return E && C.test(r.slice(l - 1, l + 1)) && (o[0] += " ", l += 1), a < d.pos && l >= d.pos ? {
16
- range: {
17
- from: a,
18
- to: l
19
- },
20
- query: o[0].slice(q.length),
21
- text: o[0]
22
- } : null;
23
- }
24
- const H = new T("suggestion");
25
- function Q({ pluginKey: R = H, editor: s, char: q = "@", allowSpaces: D = !1, allowToIncludeChar: _ = !1, allowedPrefixes: f = [" "], startOfLine: B = !1, decorationTag: d = "span", decorationClass: E = "suggestion", command: g = () => null, items: C = () => [], render: v = () => ({}), allow: I = () => !0, findSuggestionMatch: M = G }) {
26
- let r;
27
- const e = v == null ? void 0 : v(), o = new U({
28
- key: R,
29
- view() {
30
- return {
31
- update: async (n, i) => {
32
- var a, l, u, p, m, y, x;
33
- const t = (a = this.key) === null || a === void 0 ? void 0 : a.getState(i), c = (l = this.key) === null || l === void 0 ? void 0 : l.getState(n.state), S = t.active && c.active && t.range.from !== c.range.from, b = !t.active && c.active, N = t.active && !c.active, k = !b && !N && t.query !== c.query, $ = b || S && k, P = k || S, A = N || S && k;
34
- if (!$ && !P && !A)
35
- return;
36
- const h = A && !$ ? t : c, F = n.dom.querySelector(`[data-decoration-id="${h.decorationId}"]`);
37
- r = {
38
- editor: s,
39
- range: h.range,
40
- query: h.query,
41
- text: h.text,
42
- items: [],
43
- command: (w) => g({
44
- editor: s,
45
- range: h.range,
46
- props: w
47
- }),
48
- decorationNode: F,
49
- // virtual node for popper.js or tippy.js
50
- // this can be used for building popups without a DOM node
51
- clientRect: F ? () => {
52
- var w;
53
- const { decorationId: O } = (w = this.key) === null || w === void 0 ? void 0 : w.getState(s.state), K = n.dom.querySelector(`[data-decoration-id="${O}"]`);
54
- return (K == null ? void 0 : K.getBoundingClientRect()) || null;
55
- } : null
56
- }, $ && ((u = e == null ? void 0 : e.onBeforeStart) === null || u === void 0 || u.call(e, r)), P && ((p = e == null ? void 0 : e.onBeforeUpdate) === null || p === void 0 || p.call(e, r)), (P || $) && (r.items = await C({
57
- editor: s,
58
- query: h.query
59
- })), A && ((m = e == null ? void 0 : e.onExit) === null || m === void 0 || m.call(e, r)), P && ((y = e == null ? void 0 : e.onUpdate) === null || y === void 0 || y.call(e, r)), $ && ((x = e == null ? void 0 : e.onStart) === null || x === void 0 || x.call(e, r));
60
- },
61
- destroy: () => {
62
- var n;
63
- r && ((n = e == null ? void 0 : e.onExit) === null || n === void 0 || n.call(e, r));
64
- }
65
- };
66
- },
67
- state: {
68
- // Initialize the plugin's internal state.
69
- init() {
70
- return {
71
- active: !1,
72
- range: {
73
- from: 0,
74
- to: 0
75
- },
76
- query: null,
77
- text: null,
78
- composing: !1
79
- };
80
- },
81
- // Apply changes to the plugin state from a view transaction.
82
- apply(n, i, a, l) {
83
- const { isEditable: u } = s, { composing: p } = s.view, { selection: m } = n, { empty: y, from: x } = m, t = { ...i };
84
- if (t.composing = p, u && (y || s.view.composing)) {
85
- (x < i.range.from || x > i.range.to) && !p && !i.composing && (t.active = !1);
86
- const c = M({
87
- char: q,
88
- allowSpaces: D,
89
- allowToIncludeChar: _,
90
- allowedPrefixes: f,
91
- startOfLine: B,
92
- $position: m.$from
93
- }), S = `id_${Math.floor(Math.random() * 4294967295)}`;
94
- c && I({
95
- editor: s,
96
- state: l,
97
- range: c.range,
98
- isActive: i.active
99
- }) ? (t.active = !0, t.decorationId = i.decorationId ? i.decorationId : S, t.range = c.range, t.query = c.query, t.text = c.text) : t.active = !1;
100
- } else
101
- t.active = !1;
102
- return t.active || (t.decorationId = null, t.range = { from: 0, to: 0 }, t.query = null, t.text = null), t;
103
- }
104
- },
105
- props: {
106
- // Call the keydown hook if suggestion is active.
107
- handleKeyDown(n, i) {
108
- var a;
109
- const { active: l, range: u } = o.getState(n.state);
110
- return l && ((a = e == null ? void 0 : e.onKeyDown) === null || a === void 0 ? void 0 : a.call(e, { view: n, event: i, range: u })) || !1;
111
- },
112
- // Setup decorator on the currently active suggestion.
113
- decorations(n) {
114
- const { active: i, range: a, decorationId: l } = o.getState(n);
115
- return i ? j.create(n.doc, [
116
- L.inline(a.from, a.to, {
117
- nodeName: d,
118
- class: E,
119
- "data-decoration-id": l
120
- })
121
- ]) : null;
122
- }
123
- }
124
- });
125
- return o;
126
- }
127
- export {
128
- Q as S
129
- };