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.
- package/lib/{ActionMenuButton-BPq-R8E7.cjs → ActionMenuButton-BTFBZyG2.cjs} +1 -1
- package/lib/{ActionMenuButton-DCACoSG3.js → ActionMenuButton-DXwnYZhJ.js} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +28 -28
- package/lib/Attachment.d.ts +28 -28
- package/lib/Attachment.js +3 -3
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +28 -28
- package/lib/Blockquote.d.ts +28 -28
- package/lib/Blockquote.js +2 -2
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +28 -28
- package/lib/Bold.d.ts +28 -28
- package/lib/Bold.js +2 -2
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +28 -28
- package/lib/BulletList.d.ts +28 -28
- package/lib/BulletList.js +2 -2
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +28 -28
- package/lib/Clear.d.ts +28 -28
- package/lib/Clear.js +2 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +28 -28
- package/lib/Code.d.ts +28 -28
- package/lib/Code.js +2 -2
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +28 -28
- package/lib/CodeBlock.d.ts +28 -28
- package/lib/CodeBlock.js +3 -3
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +28 -28
- package/lib/CodeView.d.ts +28 -28
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +28 -28
- package/lib/Color.d.ts +28 -28
- package/lib/Color.js +3 -3
- package/lib/Document.cjs +1 -1
- package/lib/Document.d.cts +28 -28
- package/lib/Document.d.ts +28 -28
- package/lib/Document.js +1 -1
- package/lib/{Drawer-Dwx9V0Xb.cjs → Drawer-BrHHs2E9.cjs} +1 -1
- package/lib/{Drawer-Qh1zEBl3.js → Drawer-CVuwyG50.js} +3 -3
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +28 -28
- package/lib/Drawer.d.ts +28 -28
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +28 -28
- package/lib/Emoji.d.ts +28 -28
- package/lib/Emoji.js +4 -4
- package/lib/{Excalidraw-BP_-zWZH.cjs → Excalidraw-Be_GDV4Q.cjs} +1 -1
- package/lib/{Excalidraw-DD3P3ClH.js → Excalidraw-frMX4K62.js} +3 -3
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +28 -28
- package/lib/Excalidraw.d.ts +28 -28
- package/lib/Excalidraw.js +3 -3
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +28 -28
- package/lib/ExportPdf.d.ts +28 -28
- package/lib/ExportPdf.js +2 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +28 -28
- package/lib/ExportWord.d.ts +28 -28
- package/lib/ExportWord.js +2 -2
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +28 -28
- package/lib/FontFamily.d.ts +28 -28
- package/lib/FontFamily.js +4 -4
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +28 -28
- package/lib/FontSize.d.ts +28 -28
- package/lib/FontSize.js +3 -3
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +28 -28
- package/lib/FormatPainter.d.ts +28 -28
- package/lib/FormatPainter.js +2 -2
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +28 -28
- package/lib/Heading.d.ts +28 -28
- package/lib/Heading.js +3 -3
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +28 -28
- package/lib/Highlight.d.ts +28 -28
- package/lib/Highlight.js +2 -2
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +28 -28
- package/lib/History.d.ts +28 -28
- package/lib/History.js +2 -2
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +28 -28
- package/lib/HorizontalRule.d.ts +28 -28
- package/lib/HorizontalRule.js +2 -2
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +28 -28
- package/lib/Iframe.d.ts +28 -28
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +28 -28
- package/lib/Image.d.ts +28 -28
- package/lib/Image.js +3 -3
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +28 -28
- package/lib/ImageGif.d.ts +28 -28
- package/lib/ImageGif.js +3 -3
- package/lib/ImportWord.cjs +74 -74
- package/lib/ImportWord.d.cts +28 -28
- package/lib/ImportWord.d.ts +28 -28
- package/lib/ImportWord.js +5015 -4998
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +28 -28
- package/lib/Indent.d.ts +28 -28
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +28 -28
- package/lib/Italic.d.ts +28 -28
- package/lib/Italic.js +2 -2
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +28 -28
- package/lib/Katex.d.ts +28 -28
- package/lib/Katex.js +4 -4
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +28 -28
- package/lib/LineHeight.d.ts +28 -28
- package/lib/LineHeight.js +2 -2
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +28 -28
- package/lib/Link.d.ts +28 -28
- package/lib/Link.js +2 -2
- package/lib/ListItem.cjs +1 -1
- package/lib/ListItem.d.cts +28 -28
- package/lib/ListItem.d.ts +28 -28
- package/lib/ListItem.js +1 -1
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +28 -28
- package/lib/Mention.d.ts +28 -28
- package/lib/Mention.js +123 -91
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.d.cts +28 -28
- package/lib/Mermaid.d.ts +28 -28
- package/lib/Mermaid.js +4 -4
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +28 -28
- package/lib/MoreMark.d.ts +28 -28
- package/lib/MoreMark.js +3 -3
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +28 -28
- package/lib/MultiColumn.d.ts +28 -28
- package/lib/MultiColumn.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +28 -28
- package/lib/OrderedList.d.ts +28 -28
- package/lib/OrderedList.js +2 -2
- package/lib/RichTextEditor-CAxwVWUE.cjs +137 -0
- package/lib/{RichTextEditor-DIvPROxl.js → RichTextEditor-DjTnd5Uu.js} +1607 -1603
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +28 -28
- package/lib/SearchAndReplace.d.ts +28 -28
- package/lib/SearchAndReplace.js +2 -2
- package/lib/Selection.cjs +1 -1
- package/lib/Selection.d.cts +28 -28
- package/lib/Selection.d.ts +28 -28
- package/lib/Selection.js +1 -1
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +28 -28
- package/lib/SlashCommand.d.ts +28 -28
- package/lib/SlashCommand.js +4 -4
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +28 -28
- package/lib/Strike.d.ts +28 -28
- package/lib/Strike.js +2 -2
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +28 -28
- package/lib/SubAndSuperScript.d.ts +28 -28
- package/lib/SubAndSuperScript.js +3 -3
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +28 -28
- package/lib/Table.d.ts +28 -28
- package/lib/Table.js +2 -2
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +28 -28
- package/lib/TableOfContent.d.ts +28 -28
- package/lib/TableOfContent.js +3 -3
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +28 -28
- package/lib/TaskList.d.ts +28 -28
- package/lib/TaskList.js +37 -33
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +28 -28
- package/lib/TextAlign.d.ts +28 -28
- package/lib/TextAlign.js +2 -2
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +28 -28
- package/lib/TextBubble.d.ts +28 -28
- package/lib/TextBubble.js +2 -2
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +28 -28
- package/lib/TextDirection.d.ts +28 -28
- package/lib/TextDirection.js +2 -2
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +28 -28
- package/lib/TextUnderline.d.ts +28 -28
- package/lib/TextUnderline.js +2 -2
- package/lib/TrailingNode.cjs +1 -1
- package/lib/TrailingNode.d.cts +28 -28
- package/lib/TrailingNode.d.ts +28 -28
- package/lib/TrailingNode.js +1 -1
- package/lib/{Twitter-Bl5HyIX0.cjs → Twitter-V0OzBT_E.cjs} +1 -1
- package/lib/{Twitter-raSi7ATg.js → Twitter-dRxbZOad.js} +3 -3
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +28 -28
- package/lib/Twitter.d.ts +28 -28
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +28 -28
- package/lib/Video.d.ts +28 -28
- package/lib/Video.js +2 -2
- package/lib/bubble-extra.cjs +2 -2
- package/lib/bubble-extra.d.cts +28 -28
- package/lib/bubble-extra.d.ts +28 -28
- package/lib/bubble-extra.js +25 -25
- package/lib/{dom-dataset-Cuy-pIfj.cjs → dom-dataset-Byuf1YmW.cjs} +5 -5
- package/lib/{dom-dataset-CHDbKz5J.js → dom-dataset-Di3tIRrR.js} +94 -83
- package/lib/index-BI-IcZcN.cjs +1 -0
- package/lib/{index-CSvnpArE.cjs → index-ByRfqzMr.cjs} +2 -2
- package/lib/{index-DIPntess.js → index-C1fzuXpN.js} +1 -1
- package/lib/index-CbQQFj2T.js +133 -0
- package/lib/{index-BWx1Mchx.js → index-DI9T3iLd.js} +243 -243
- package/lib/{index-CrxasX7b.cjs → index-DclQSrIx.cjs} +1 -1
- package/lib/{index-DEFQHExY.js → index-LUL9mqY4.js} +1 -1
- package/lib/{index-h9_SDuwc.cjs → index-Z4b9rzn-.cjs} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +28 -28
- package/lib/index.d.ts +28 -28
- package/lib/index.js +5 -5
- package/lib/locale-bundle.d.cts +28 -28
- package/lib/locale-bundle.d.ts +28 -28
- package/lib/{textarea-DnBlTntN.js → textarea-6c8drwXJ.js} +1 -1
- package/lib/{textarea-DgXP0XRK.cjs → textarea-BsJTSgT-.cjs} +1 -1
- package/package.json +67 -67
- package/lib/RichTextEditor-DszaQdvS.cjs +0 -141
- package/lib/index-Cyh1yoFk.cjs +0 -1
- package/lib/index-oQutU45z.js +0 -129
package/lib/index-Cyh1yoFk.cjs
DELETED
|
@@ -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;
|
package/lib/index-oQutU45z.js
DELETED
|
@@ -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
|
-
};
|