@forgedevstack/ink 1.1.4 → 1.1.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.6
4
+
5
+ ### Added
6
+ - Demo autocomplete phrase hints for common short prefixes (e.g. `Hi, How`)
7
+
8
+ ### Changed
9
+ - Portal consumers should register OpenAI / ink-server providers for real ghost suggestions
10
+
11
+ ## 1.1.5
12
+
13
+ ### Added
14
+ - Editor variants chrome (`simple` / `agent` / `docx` / `notion-like` shells)
15
+
16
+ ### Note
17
+ - npm: `@forgedevstack/ink@1.1.5` published to fill the version gap (dist-tag `historical`; `latest` remains 1.1.6)
18
+ - Portal/CMS dashboard track continued into **1.1.6**
19
+
3
20
  ## 1.1.4
4
21
 
5
22
  ### Added
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),r=require("react"),O=require("../../constants/numbers.cjs"),I=require("../../constants/toolbar.const.cjs"),A=require("../../constants/toolbarMenu.const.cjs"),yt=require("../../constants/colorMode.const.cjs"),_e=require("../../constants/keyboard.const.cjs"),Ke=require("../../constants/fonts.const.cjs"),Xe=require("../../constants/lists.const.cjs"),x=require("../../constants/findReplaceMenu.const.cjs"),je=require("../../constants/blocks.const.cjs"),f=require("../../constants/defaults.const.cjs"),Io=require("../../constants/aiModels.const.cjs");require("../../constants/openai.const.cjs");const vt=require("../../constants/defaultIcons.cjs"),a=require("../../constants/contextMenu.const.cjs"),go=require("../../utils/cn.utils.cjs"),Ro=require("../../utils/typo.utils.cjs"),qt=require("../../utils/id.utils.cjs"),M=require("../../utils/table.utils.cjs"),m=require("../../utils/blocks.utils.cjs"),H=require("../../utils/trackChanges.utils.cjs"),We=require("../../utils/comments.utils.cjs"),Ve=require("../../utils/history.utils.cjs"),Kt=require("../../utils/slash.utils.cjs"),v=require("../../utils/premium.utils.cjs"),Ge=require("../../utils/paste.utils.cjs"),Xt=require("../../utils/memory.utils.cjs"),bo=require("../../utils/findReplace.utils.cjs"),Ze=require("../../utils/selection.utils.cjs"),$=require("../../utils/toolbarStorage.utils.cjs"),Ao=require("../../common-components/Button/Button.cjs"),jt=require("../../common-components/ContextMenu/ContextMenu.cjs"),d=require("./helpers/format.utils.cjs"),ho=require("../../plugins/ai/aiPlugin.cjs"),g=require("./components/ToolbarButton/ToolbarButton.cjs"),Te=require("./components/ToolbarDropdown/ToolbarDropdown.cjs"),Wt=require("./components/ToolbarColorPicker/ToolbarColorPicker.cjs"),Bo=require("./components/CommentsPanel/CommentsPanel.cjs"),So=require("./components/AiPanel/AiPanel.cjs"),Do=require("./components/AiAutocomplete/AiAutocomplete.cjs"),Vt=require("./components/AiAutocomplete/AiAutocomplete.const.cjs"),Ye=require("./components/AiAutocomplete/AiAutocomplete.utils.cjs"),Mo=require("./components/BlockHandles/BlockHandles.cjs"),Ee=require("./components/BlockHandles/BlockHandles.const.cjs"),ko=require("./components/InlineToolbar/InlineToolbar.cjs"),fe=require("./components/InlineToolbar/InlineToolbar.const.cjs"),Gt=require("./components/InlineToolbar/InlineToolbar.utils.cjs"),Uo=require("./components/SlashMenu/SlashMenu.cjs"),Po=require("./components/TrackChangesBar/TrackChangesBar.cjs"),xo=require("./components/SignPad/SignPad.cjs"),Ho=require("./components/FindReplace/FindReplace.cjs"),wo=require("./components/ToolbarCustomize/ToolbarCustomize.cjs"),ze=()=>{const h=window.getSelection();if(!h||h.rangeCount===O.NUMBER_ZERO)return"";const N=h.getRangeAt(O.NUMBER_ZERO),B=document.createElement("div");return B.appendChild(N.cloneContents()),B.innerHTML},p=h=>{h==null||h.focus({preventScroll:!0})},Fo=h=>{var Ht;const{value:N,defaultValue:B="",onChange:S,placeholder:$e=f.INK_PLACEHOLDER_DEFAULT,disabled:i=!1,readOnly:c=!1,minHeight:Oe=O.INK_MIN_HEIGHT,maxHeight:Ce,toolbar:ie=f.INK_DEFAULT_TOOLBAR,className:Zt="",testId:Yt,allowImagePaste:Qe=!0,showCharCount:Je=!1,charCountMax:et,typoAutoFix:zt=!0,variant:$t=f.INK_DEFAULT_VARIANT,chrome:Qt=f.INK_DEFAULT_CHROME,colorMode:tt=yt.INK_DEFAULT_COLOR_MODE,features:Jt,author:q=f.INK_DEFAULT_AUTHOR,trackChanges:Q,onTrackChangesChange:me,trackChangesEnabled:ce,onTrackChangesEnabledChange:pe,comments:J,onCommentsChange:Le,showCommentsPanel:ee,onShowCommentsPanelChange:Ne,ai:E,slashCommands:en,tableRows:tn=f.INK_TABLE_DEFAULT_ROWS,tableCols:nn=f.INK_TABLE_DEFAULT_COLS,premium:on,theme:rn,icons:nt,pasteMode:sn="plain",onImageUpload:ot,wysiwyg:ln=!1,keepInMemory:K=!1,memoryKey:X,onToolbarChange:Ie,toolbarHidden:j,onToolbarHiddenChange:ge,style:cn,...an}=h,T={...f.INK_DEFAULT_FEATURES,...Jt},W=v.resolveInkPremium(on),un=v.hasInkPremiumFeature(W,"icons"),dn=v.hasInkPremiumFeature(W,"theme"),_n=v.hasInkPremiumFeature(W,"richPaste"),Tn=v.hasInkPremiumFeature(W,"imageUpload"),En=v.hasInkPremiumFeature(W,"wysiwyg")&&ln,C=un&&nt?{...vt.INK_DEFAULT_ICONS,...nt}:vt.INK_DEFAULT_ICONS,fn=dn?v.themeTokensToStyle(rn):{},On=_n&&sn==="rich",n=r.useRef(null),te=r.useRef(new Ve.InkHistoryStack(N??B)),V=r.useRef(null),w=r.useRef(null),[rt,Cn]=r.useState(new Set),[mn,st]=r.useState("p"),[pn,Ln]=r.useState(0),[Nn,In]=r.useState(O.INK_DEFAULT_TEXT_COLOR),[gn,Rn]=r.useState(O.INK_DEFAULT_HIGHLIGHT_COLOR),[G,lt]=r.useState(ce??!1),[bn,it]=r.useState(Q??[]),[An,ct]=r.useState(J??[]),[hn,at]=r.useState(ee??!1),[ut,Re]=r.useState(!!(E!=null&&E.enabled&&E.openOnInit)),[ae,Bn]=r.useState(!1),dt=r.useRef(!1),[k,ne]=r.useState({visible:!1,suggestion:"",top:O.NUMBER_ZERO,left:O.NUMBER_ZERO}),oe=r.useRef(null),Z=r.useRef(O.NUMBER_ZERO),[_t,Sn]=r.useState(""),[Dn,Mn]=r.useState(0),[kn,Tt]=r.useState(!1),[Un,ue]=r.useState([]),[Et,Pn]=r.useState({top:0,left:0}),[ft,be]=r.useState(!1),[Ae,de]=r.useState(!1),[xn,Hn]=r.useState(x.FIND_REPLACE_FOCUS_FIND),[wn,Fn]=r.useState(Ke.FONT_VALUE_SYSTEM),[yn,Ot]=r.useState(Xe.LIST_VALUE_BULLET),[vn,qn]=r.useState(x.FIND_REPLACE_FOCUS_FIND),[he,Be]=r.useState({open:!1,x:O.NUMBER_ZERO,y:O.NUMBER_ZERO}),[Kn,Ct]=r.useState(!1),[Se,De]=r.useState({open:!1,x:O.NUMBER_ZERO,y:O.NUMBER_ZERO}),[Me,Y]=r.useState({open:!1,top:O.NUMBER_ZERO,left:O.NUMBER_ZERO}),[ke,mt]=r.useState(()=>$.readToolbarItems(K,X)??ie),[Xn,pt]=r.useState(()=>j!==void 0?j:$.readToolbarHidden(K,X)??!1),[jn,Lt]=r.useState(!1),Nt=r.useRef(!0),Wn=ie.join(","),U=Q??bn,re=J??An,Ue=ee??hn,It=en??T.slash,gt=j??Xn,Rt=ie,Vn=$.listCustomizableToolbarOptions(Rt),Pe=tt===yt.COLOR_MODE_SYSTEM?void 0:tt,xe=!!(T.ai&&(E!=null&&E.enabled)&&E.autocomplete!==!1&&!i&&!c),He=()=>{oe.current!==null&&(window.clearTimeout(oe.current),oe.current=null)},D=()=>{He(),Z.current+=1,ne(e=>e.visible||e.suggestion?{visible:!1,suggestion:"",top:O.NUMBER_ZERO,left:O.NUMBER_ZERO}:e)},Gn=()=>{if(!xe||ae||!n.current){D();return}const e=window.getSelection();if(!e||!e.isCollapsed){D();return}He(),ne(o=>o.visible||o.suggestion?{...o,visible:!1,suggestion:""}:o);const t=(E==null?void 0:E.providerId)||Io.INK_AI_DEMO_PROVIDER_ID;oe.current=window.setTimeout(()=>{if(oe.current=null,!n.current||dt.current)return;const o=window.getSelection();if(!o||!o.isCollapsed)return;const s=Ye.getTextBeforeCaret(n.current),u=Ye.getCaretPositionInRoot(n.current);if(!s.trim()||!u)return;const L=Z.current+1;Z.current=L;const b=n.current.innerHTML;ho.inkAi.runProvider(t,{capability:"autocomplete",html:b,prompt:s,modelId:E==null?void 0:E.modelId}).then(y=>{var Ft;if(L!==Z.current)return;const P=((Ft=y.text)==null?void 0:Ft.trim())||"";if(!P){ne({visible:!1,suggestion:"",top:O.NUMBER_ZERO,left:O.NUMBER_ZERO});return}const wt=n.current&&Ye.getCaretPositionInRoot(n.current)||u;ne({visible:!0,suggestion:P,top:wt.top,left:wt.left})}).catch(()=>{L===Z.current&&ne({visible:!1,suggestion:"",top:O.NUMBER_ZERO,left:O.NUMBER_ZERO})})},Vt.AI_AUTOCOMPLETE_DEBOUNCE_MS)};r.useEffect(()=>()=>{He(),Z.current+=1},[]),r.useEffect(()=>{dt.current=ae,ae&&D()},[ae]),r.useEffect(()=>{ce!==void 0&&lt(ce)},[ce]),r.useEffect(()=>{Q&&it(Q)},[Q]),r.useEffect(()=>{J&&ct(J)},[J]),r.useEffect(()=>{ee!==void 0&&at(ee)},[ee]),r.useEffect(()=>{j!==void 0&&pt(j)},[j]),r.useEffect(()=>{if(Nt.current){Nt.current=!1;return}mt(ie)},[Wn]),r.useEffect(()=>{if(!n.current||N===void 0||N===V.current)return;if(n.current.innerHTML===N){V.current=N;return}const e=document.activeElement===n.current;Ze.withPreservedSelection(e?n.current:null,()=>{n.current&&(n.current.innerHTML=N)}),V.current=N},[N]),r.useEffect(()=>{if(!n.current)return;const e=K?Xt.readInkMemory(X):"";if(e){n.current.innerHTML=e,V.current=e,te.current=new Ve.InkHistoryStack(e),S==null||S(e);return}N===void 0&&B&&(n.current.innerHTML=B,V.current=B,te.current=new Ve.InkHistoryStack(B),S==null||S(B))},[]);const we=e=>{var t;te.current.push(e),V.current=e,S==null||S(e),K&&Xt.writeInkMemory(e,X),Je&&n.current&&Ln(((t=n.current.textContent)==null?void 0:t.length)??0)},F=e=>{n.current&&(Ze.withPreservedSelection(n.current,()=>{n.current&&(n.current.innerHTML=e)}),we(e))},Fe=e=>{pt(e),ge==null||ge(e),$.writeToolbarHidden(e,K,X)},Zn=e=>{mt(e),Ie==null||Ie(e),$.writeToolbarItems(e,K,X)},Yn=(e,t)=>{if(e===A.TOOLBAR_OPTION_DIVIDER)return;const o=new Set(ke.filter(s=>s!==A.TOOLBAR_OPTION_DIVIDER));t?o.add(e):o.delete(e),Zn($.buildVisibleToolbarItems(Rt,o))},se=e=>{it(e),me==null||me(e)},ye=e=>{ct(e),Le==null||Le(e)},ve=e=>{at(e),Ne==null||Ne(e)},zn=e=>{lt(e),pe==null||pe(e)},$n=()=>{if(i||c){Y(u=>u.open?{...u,open:!1}:u);return}const e=window.getSelection();if(!e||e.isCollapsed||e.rangeCount===0||!Gt.selectionIsInsideElement(e,n.current)){Y(u=>u.open?{...u,open:!1}:u);return}const o=e.getRangeAt(0).getBoundingClientRect();if(o.width===0&&o.height===0){Y(u=>u.open?{...u,open:!1}:u);return}const s=Gt.clampInlineToolbarPosition({selectionRect:o,toolbarWidth:fe.INLINE_TOOLBAR_ESTIMATED_WIDTH_PX,toolbarHeight:fe.INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX,viewport:{width:window.innerWidth,height:window.innerHeight},gap:fe.INLINE_TOOLBAR_GAP_PX,edgePadding:fe.INLINE_TOOLBAR_EDGE_PADDING_PX});Y({open:!0,top:s.top,left:s.left})},le=()=>{Cn(d.getActiveFormats());const e=d.queryCommandValue("formatBlock");if(e&&st(e.toLowerCase().replace(/[<>]/g,"")),Ot(d.detectListType()),Sn(ze()),$n(),!n.current||!T.blocks)return;const t=window.getSelection(),o=(t==null?void 0:t.anchorNode)??null,s=m.getBlockElement(o,n.current);if(m.markActiveBlock(n.current,s),s){const u=n.current.getBoundingClientRect(),L=s.getBoundingClientRect();Mn(L.top-u.top+n.current.scrollTop),Tt(!0)}else Tt(!1)},_=()=>{var t,o,s;if(!n.current)return;let e=n.current.innerHTML;if(G&&T.trackChanges){const u=window.getSelection();if(u&&!u.isCollapsed){const L=ze();if(L){const b=H.createTrackChange("delete",L,q);se([...U,b]),Qn(b.id),e=n.current.innerHTML}}}if(we(e),le(),It&&n.current){const u=((o=(t=window.getSelection())==null?void 0:t.anchorNode)==null?void 0:o.textContent)??"",L=Kt.extractSlashQuery(u);if(L!==null){ue(Kt.filterSlashCommands(L));const b=(s=window.getSelection())==null?void 0:s.getRangeAt(0);if(b&&n.current){const y=b.getBoundingClientRect(),P=n.current.getBoundingClientRect();Pn({top:y.bottom-P.top+8,left:y.left-P.left})}}else ue([])}xe?Gn():D()},bt=()=>{const e=k.suggestion;if(!e){D();return}p(n.current),d.execCommand(Vt.AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT,e),D(),_()},Qn=e=>{const t=window.getSelection();if(!t||t.rangeCount===0)return;const o=ze();o&&d.insertHTML(H.wrapDeleteHtml(o,e))},Jn=()=>{if(!n.current||!zt||!T.typoAutoFix||i||c)return;const e=n.current.innerHTML,t=Ro.applyTypoAutoFix(e);t.html!==e&&(Ze.withPreservedSelection(n.current,()=>{n.current&&(n.current.innerHTML=t.html)}),we(t.html))},R=e=>{if(i||c)return;if(p(n.current),e==="clearFormat"){d.clearFormatDeep(),_();return}if(e==="directionLtr"&&n.current){d.setBlockDirection(n.current,je.DIR_LTR),_();return}if(e==="directionRtl"&&n.current){d.setBlockDirection(n.current,je.DIR_RTL),_();return}if(e==="superscript"||e==="subscript"){d.execCommand(e),_();return}const t=f.INK_BUTTON_CONFIG[e];t&&(t.value?d.execCommand(t.command,t.value):d.execCommand(t.command),_())},eo=e=>{i||c||(p(n.current),d.execCommand("formatBlock",e),st(e),_())},to=e=>{i||c||(p(n.current),d.applyFontFamily(e),Fn(e),_())},no=e=>{i||c||(p(n.current),d.applyListType(e),Ot(e),_())},At=e=>{Hn(e),qn(e),de(!0)},oo=e=>{if(i||c)return;const t=e===x.FIND_REPLACE_VALUE_REPLACE?x.FIND_REPLACE_FOCUS_REPLACE:x.FIND_REPLACE_FOCUS_FIND;At(t)},qe=()=>{if(i||c)return;const e=window.prompt("Enter URL:","https://");e&&(p(n.current),d.insertLink(e),_())},ht=async e=>Tn&&ot?ot(e):d.fileToDataUrl(e),ro=async()=>{if(i||c)return;const e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=async()=>{var s;const t=(s=e.files)==null?void 0:s[0];if(!t)return;const o=await ht(t);p(n.current),d.insertImage(o,t.name),_()},e.click()},Bt=()=>{if(i||c||!T.table)return;p(n.current);const e=M.buildTableHtml(tn,nn);if(G&&T.trackChanges){const t=H.createTrackChange("insert",e,q);se([...U,t]),d.insertHTML(H.wrapInsertHtml(e,t.id))}else d.insertHTML(e);_()},St=()=>{const e=te.current.undo();if(e===null||!n.current){d.execCommand("undo"),_();return}F(e)},Dt=()=>{const e=te.current.redo();if(e===null||!n.current){d.execCommand("redo"),_();return}F(e)},so=e=>{i||c||(e.preventDefault(),De(t=>t.open?{...t,open:!1}:t),Ct(!!(T.table&&M.getTableCellFromSelection())),Be({open:!0,x:e.clientX,y:e.clientY}))},lo=e=>{i||c||(e.preventDefault(),Be(t=>t.open?{...t,open:!1}:t),De({open:!0,x:e.clientX,y:e.clientY}))},Mt=()=>{if(i||c||!T.comments)return;const e=window.prompt("Comment:");if(!(e!=null&&e.trim()))return;const t=qt.createInkId("hl");if(p(n.current),!We.wrapSelectionAsComment(t))return;const s=We.createCommentThread(q,e.trim(),t);ye([s,...re]),ve(!0),_()},io=[{id:A.TOOLBAR_CONTEXT_MENU_ID_CUSTOMIZE,label:A.TOOLBAR_CONTEXT_MENU_LABEL_CUSTOMIZE,onSelect:()=>Lt(!0)},{id:A.TOOLBAR_CONTEXT_MENU_ID_HIDE,label:A.TOOLBAR_CONTEXT_MENU_LABEL_HIDE,onSelect:()=>Fe(!0)}],z=e=>{const t=M.getTableCellFromSelection();!t||!T.table||e(t)&&_()},co=[...T.table&&Kn?[{id:a.CONTEXT_MENU_ID_TABLE_ROW_ABOVE,label:a.CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE,onSelect:()=>z(e=>M.insertTableRow(e,"before"))},{id:a.CONTEXT_MENU_ID_TABLE_ROW_BELOW,label:a.CONTEXT_MENU_LABEL_TABLE_ROW_BELOW,onSelect:()=>z(e=>M.insertTableRow(e,"after"))},{id:a.CONTEXT_MENU_ID_TABLE_COL_LEFT,label:a.CONTEXT_MENU_LABEL_TABLE_COL_LEFT,onSelect:()=>z(e=>M.insertTableColumn(e,"before"))},{id:a.CONTEXT_MENU_ID_TABLE_COL_RIGHT,label:a.CONTEXT_MENU_LABEL_TABLE_COL_RIGHT,onSelect:()=>z(e=>M.insertTableColumn(e,"after"))},{id:a.CONTEXT_MENU_ID_TABLE_DELETE_ROW,label:a.CONTEXT_MENU_LABEL_TABLE_DELETE_ROW,onSelect:()=>z(e=>M.deleteTableRow(e))},{id:a.CONTEXT_MENU_ID_TABLE_DELETE_COL,label:a.CONTEXT_MENU_LABEL_TABLE_DELETE_COL,onSelect:()=>z(e=>M.deleteTableColumn(e))}]:[],{id:a.CONTEXT_MENU_ID_BOLD,label:a.CONTEXT_MENU_LABEL_BOLD,onSelect:()=>R("bold")},{id:a.CONTEXT_MENU_ID_ITALIC,label:a.CONTEXT_MENU_LABEL_ITALIC,onSelect:()=>R("italic")},{id:a.CONTEXT_MENU_ID_UNDERLINE,label:a.CONTEXT_MENU_LABEL_UNDERLINE,onSelect:()=>R("underline")},{id:a.CONTEXT_MENU_ID_STRIKE,label:a.CONTEXT_MENU_LABEL_STRIKE,onSelect:()=>R("strikethrough")},{id:a.CONTEXT_MENU_ID_HEADING,label:a.CONTEXT_MENU_LABEL_HEADING,onSelect:()=>R("heading2")},{id:a.CONTEXT_MENU_ID_BULLET,label:a.CONTEXT_MENU_LABEL_BULLET,onSelect:()=>R("bulletList")},{id:a.CONTEXT_MENU_ID_ORDERED,label:a.CONTEXT_MENU_LABEL_ORDERED,onSelect:()=>R("orderedList")},{id:a.CONTEXT_MENU_ID_LINK,label:a.CONTEXT_MENU_LABEL_LINK,onSelect:()=>qe()},{id:a.CONTEXT_MENU_ID_CLEAR,label:a.CONTEXT_MENU_LABEL_CLEAR,onSelect:()=>R("clearFormat")},{id:a.CONTEXT_MENU_ID_FIND,label:a.CONTEXT_MENU_LABEL_FIND,disabled:!T.findReplace,onSelect:()=>de(!0)},{id:a.CONTEXT_MENU_ID_SIGNATURE,label:a.CONTEXT_MENU_LABEL_SIGNATURE,disabled:!T.signature,onSelect:()=>be(!0)},{id:a.CONTEXT_MENU_ID_COMMENT,label:a.CONTEXT_MENU_LABEL_COMMENT,disabled:!T.comments,onSelect:()=>Mt()},...gt?[{id:A.CONTEXT_MENU_ID_SHOW_TOOLBAR,label:A.CONTEXT_MENU_LABEL_SHOW_TOOLBAR,onSelect:()=>Fe(!1)}]:[]],kt=e=>{if(!n.current)return;const t=H.acceptTrackChangeInHtml(n.current.innerHTML,e);F(t),se(U.map(o=>o.id===e?{...o,accepted:!0}:o))},Ut=e=>{if(!n.current)return;const t=H.rejectTrackChangeInHtml(n.current.innerHTML,e);F(t),se(U.map(o=>o.id===e?{...o,rejected:!0}:o))},Pt=async e=>{const t=await ht(e),o=`<img src="${t}" alt="" style="max-width:100%;height:auto;" />`;if(G&&T.trackChanges){const s=H.createTrackChange("insert",o,q);se([...U,s]),d.insertHTML(H.wrapInsertHtml(o,s.id))}else d.insertImage(t);_()},ao=async e=>{if(i||c)return;const t=e.clipboardData;if(!t)return;if(On){const s=Ge.extractClipboardHtml(t);if(s){e.preventDefault();const L=Ge.sanitizePastedHtml(s);L&&(d.insertHTML(L),_());const b=t.items;if(Qe&&b)for(const y of Array.from(b)){if(!y.type.startsWith("image/"))continue;const P=y.getAsFile();P&&await Pt(P)}return}const u=Ge.extractClipboardText(t);if(u){e.preventDefault(),d.insertHTML(u.replace(/\n/g,"<br />")),_();return}}if(!Qe)return;const o=t.items;if(o)for(const s of Array.from(o)){if(!s.type.startsWith("image/"))continue;e.preventDefault();const u=s.getAsFile();u&&await Pt(u)}},uo=e=>{R(e)},_o=e=>{if(e.key===_e.KEY_TAB&&k.visible&&k.suggestion){e.preventDefault(),bt();return}if(e.key===_e.KEY_ENTER){D();return}if(d.tryConvertMarkdownListPrefix(e.nativeEvent)){_();return}if(e.key===_e.KEY_ESCAPE){if(k.visible){e.preventDefault(),D();return}ue([]),Y(t=>t.open?{...t,open:!1}:t)}(e.metaKey||e.ctrlKey)&&e.key===_e.KEY_Z&&(e.preventDefault(),e.shiftKey?Dt():St())},To=e=>{var o;p(n.current);const t=window.getSelection();if((o=t==null?void 0:t.anchorNode)!=null&&o.textContent){const u=t.anchorNode.textContent.replace(/(?:^|\s)\/[^\s]*$/," ");t.anchorNode.nodeType===Node.TEXT_NODE&&(t.anchorNode.textContent=u)}switch(ue([]),e.insert){case"heading1":d.execCommand("formatBlock","h1");break;case"heading2":d.execCommand("formatBlock","h2");break;case"bulletList":d.execCommand("insertUnorderedList");break;case"orderedList":d.execCommand("insertOrderedList");break;case"table":Bt();return;case"ai":Re(!0);break}_()},xt=e=>{if(!n.current)return;const t=window.getSelection(),o=m.getBlockElement((t==null?void 0:t.anchorNode)??null,n.current);o&&m.moveBlock(o,e)&&(_(),le())},Eo=e=>{if(!n.current)return;const t=window.getSelection(),o=m.getBlockElement((t==null?void 0:t.anchorNode)??null,n.current),s=n.current.querySelector(`.${f.INK_CLASS_BLOCK_ACTIVE}`),u=o??(s instanceof HTMLElement?s:null);if(!u){e.preventDefault();return}w.current=u,m.clearBlockDragClasses(n.current),m.markActiveBlock(n.current,u),m.markDraggingBlock(u),e.dataTransfer.setData(Ee.BLOCK_HANDLES_DRAG_MIME,Ee.BLOCK_HANDLES_DRAG_PAYLOAD),e.dataTransfer.effectAllowed=Ee.BLOCK_HANDLES_DRAG_EFFECT_MOVE},fo=e=>{if(!n.current||!w.current)return;e.preventDefault(),e.dataTransfer.dropEffect=Ee.BLOCK_HANDLES_DRAG_EFFECT_MOVE;const t=m.getBlockElement(e.target,n.current);if(!t||t===w.current){m.markDropTarget(n.current,null,null);return}const o=m.resolveDropPosition(e.clientY,t);m.markDropTarget(n.current,t,o)},Oo=e=>{if(!n.current||!w.current)return;e.preventDefault();const t=m.getBlockElement(e.target,n.current),o=w.current;t&&t!==o&&(m.resolveDropPosition(e.clientY,t)===je.BLOCK_DROP_POSITION_BEFORE?m.reorderBlockBefore(o,t):m.reorderBlockAfter(o,t))&&(_(),le()),m.clearBlockDragClasses(n.current),w.current=null},Co=()=>{n.current&&m.clearBlockDragClasses(n.current),w.current=null},mo=(e,t)=>{if(e==="divider")return l.jsx("span",{className:f.INK_CLASS_DIVIDER},`divider-${t}`);if(e==="headingDropdown")return l.jsx(Te.ToolbarDropdown,{title:"Heading",options:f.INK_HEADING_OPTIONS,value:mn||"p",disabled:i||c,onChange:eo},"heading");if(e===I.TOOLBAR_OPTION_FONT_DROPDOWN)return l.jsx(Te.ToolbarDropdown,{title:Ke.FONT_DROPDOWN_TITLE,options:Ke.INK_FONT_OPTIONS,value:wn,disabled:i||c,onChange:to},I.TOOLBAR_OPTION_FONT_DROPDOWN);if(e===I.TOOLBAR_OPTION_LIST_DROPDOWN)return l.jsx(Te.ToolbarDropdown,{title:Xe.LIST_DROPDOWN_TITLE,options:Xe.INK_LIST_OPTIONS,value:yn,disabled:i||c,onChange:no},I.TOOLBAR_OPTION_LIST_DROPDOWN);if(e==="textColor")return l.jsx(Wt.ToolbarColorPicker,{title:"Text color",type:"text",value:Nn,disabled:i||c,onChange:s=>{p(n.current),d.setTextColor(s),In(s),_()}},"textColor");if(e==="highlightColor")return l.jsx(Wt.ToolbarColorPicker,{title:"Highlight color",type:"highlight",value:gn,disabled:i||c,onChange:s=>{p(n.current),d.setHighlightColor(s),Rn(s),_()}},"highlightColor");if(e==="link")return l.jsx(g.ToolbarButton,{icon:C.link,title:"Insert link",disabled:i||c,onClick:qe},"link");if(e==="image")return l.jsx(g.ToolbarButton,{icon:C.image,title:"Insert image",disabled:i||c,onClick:()=>{ro()}},"image");if(e==="table")return T.table?l.jsx(g.ToolbarButton,{icon:C.table,title:"Insert table",disabled:i||c,onClick:Bt},"table"):null;if(e===I.TOOLBAR_OPTION_SIGNATURE)return T.signature?l.jsx(g.ToolbarButton,{icon:C.signature,title:"Sign pad",active:ft,disabled:i||c,onClick:()=>be(!0)},I.TOOLBAR_OPTION_SIGNATURE):null;if(e===I.TOOLBAR_OPTION_FIND_REPLACE)return T.findReplace?l.jsx(g.ToolbarButton,{icon:C.findReplace,title:"Find and replace",active:Ae,disabled:i||c,onClick:()=>{Ae?de(!1):At(x.FIND_REPLACE_FOCUS_FIND)}},I.TOOLBAR_OPTION_FIND_REPLACE):null;if(e===I.TOOLBAR_OPTION_FIND_REPLACE_DROPDOWN)return T.findReplace?l.jsx(Te.ToolbarDropdown,{title:x.FIND_REPLACE_DROPDOWN_TITLE,options:x.INK_FIND_REPLACE_OPTIONS,value:vn,disabled:i||c,onChange:oo},I.TOOLBAR_OPTION_FIND_REPLACE_DROPDOWN):null;if(e===I.TOOLBAR_OPTION_HORIZONTAL_RULE)return T.horizontalRule?l.jsx(g.ToolbarButton,{icon:C.horizontalRule,title:"Horizontal rule",disabled:i||c,onClick:()=>{p(n.current),d.insertHTML("<hr />"),_()}},I.TOOLBAR_OPTION_HORIZONTAL_RULE):null;if(e==="undo")return l.jsx(g.ToolbarButton,{icon:C.undo,title:"Undo",disabled:i||c,onClick:St},"undo");if(e==="redo")return l.jsx(g.ToolbarButton,{icon:C.redo,title:"Redo",disabled:i||c,onClick:Dt},"redo");if(e==="trackChanges")return T.trackChanges?l.jsx(g.ToolbarButton,{icon:C.trackChanges,title:"Track changes",active:G,disabled:i||c,onClick:()=>zn(!G)},"trackChanges"):null;if(e==="comments")return T.comments?l.jsx(g.ToolbarButton,{icon:C.comments,title:"Comments",active:Ue,disabled:i||c,onClick:()=>{Ue?ve(!1):Mt()}},"comments"):null;if(e==="ai")return!T.ai||!(E!=null&&E.enabled)?null:l.jsx(g.ToolbarButton,{icon:C.ai,title:"Ink AI",active:ut,disabled:i||c,onClick:()=>Re(s=>!s)},"ai");const o=f.INK_BUTTON_CONFIG[e];return o?l.jsx(g.ToolbarButton,{icon:C[e]??e.slice(0,1).toUpperCase(),title:o.title,active:rt.has(e),disabled:i||c,onClick:()=>R(e)},e):null},po=typeof Oe=="number"?`${Oe}px`:Oe,Lo=typeof Ce=="number"?`${Ce}px`:Ce,No=!!(E!=null&&E.enabled&&ut);return l.jsxs("div",{className:go.cn(f.INK_CLASS_ROOT,Zt),"data-testid":Yt,"data-disabled":i||void 0,"data-variant":$t,"data-chrome":Qt,"data-color-mode":Pe,"data-premium":W.active||void 0,"data-wysiwyg":En||void 0,style:{...fn,...cn},...an,children:[gt?l.jsx("div",{className:f.INK_CLASS_TOOLBAR_SHOW,children:l.jsx(Ao.Button,{type:"button","aria-label":A.TOOLBAR_SHOW_CONTROL_ARIA_LABEL,onClick:()=>Fe(!1),children:A.TOOLBAR_SHOW_CONTROL_LABEL})}):l.jsx("div",{className:f.INK_CLASS_TOOLBAR,role:"toolbar","aria-label":"Ink formatting toolbar",onContextMenu:lo,children:ke.map(mo)}),l.jsx(wo.ToolbarCustomize,{open:jn,options:Vn,visibleItems:ke,onToggle:Yn,onClose:()=>Lt(!1)}),l.jsx(xo.SignPad,{open:ft,onClose:()=>be(!1),onConfirm:e=>{p(n.current),d.insertImage(e),_()}}),l.jsx(Ho.FindReplace,{open:Ae,focusField:xn,onClose:()=>de(!1),onReplace:(e,t,o)=>{if(!n.current)return;const s=bo.replaceInHtml(n.current.innerHTML,e,t,o);F(s)}}),G&&T.trackChanges?l.jsx(Po.TrackChangesBar,{changes:U,onAccept:kt,onReject:Ut,onAcceptAll:()=>U.forEach(e=>kt(e.id)),onRejectAll:()=>U.forEach(e=>Ut(e.id))}):null,l.jsxs("div",{className:f.INK_CLASS_SHELL,children:[l.jsxs("div",{className:f.INK_CLASS_BODY,children:[T.blocks?l.jsx(Mo.BlockHandles,{visible:kn&&!i&&!c,top:Dn,onMoveUp:()=>xt("up"),onMoveDown:()=>xt("down"),onDragStart:Eo}):null,l.jsx("div",{ref:n,className:f.INK_CLASS_CONTENT,contentEditable:!i&&!c,role:"textbox","aria-multiline":"true","aria-placeholder":$e,"data-placeholder":$e,suppressContentEditableWarning:!0,style:{minHeight:po,maxHeight:Lo},onInput:_,onBlur:Jn,onKeyUp:le,onKeyDown:_o,onMouseUp:le,onContextMenu:so,onDragOver:fo,onDrop:Oo,onDragEnd:Co,onPaste:e=>{ao(e)}}),It?l.jsx(Uo.SlashMenu,{items:Un,top:Et.top,left:Et.left,onSelect:To}):null,xe?l.jsx(Do.AiAutocomplete,{suggestion:k.suggestion,position:{top:k.top,left:k.left},visible:k.visible,onAccept:bt,onDismiss:D}):null,l.jsx(ko.InlineToolbar,{open:Me.open,top:Me.top,left:Me.left,icons:{bold:C.bold,italic:C.italic,underline:C.underline,code:C.code,link:C.link,clearFormat:C.clearFormat},activeFormats:rt,disabled:i||c,onFormat:uo,onLink:qe,onClose:()=>Y(e=>({...e,open:!1}))}),l.jsx(jt.ContextMenu,{open:he.open,x:he.x,y:he.y,items:co,colorMode:Pe,onClose:()=>{Ct(!1),Be(e=>({...e,open:!1}))}}),l.jsx(jt.ContextMenu,{open:Se.open,x:Se.x,y:Se.y,items:io,colorMode:Pe,onClose:()=>De(e=>({...e,open:!1}))})]}),Ue&&T.comments?l.jsx(Bo.CommentsPanel,{comments:re,author:q,onClose:()=>ve(!1),onResolve:e=>{const t=re.find(o=>o.id===e);ye(re.map(o=>o.id===e?{...o,resolved:!0}:o)),t&&n.current&&F(We.removeCommentMark(n.current.innerHTML,t.highlightId))},onAddReply:(e,t)=>{ye(re.map(o=>o.id===e?{...o,replies:[...o.replies,{id:qt.createInkId("reply"),author:q,body:t,timestamp:Date.now()}]}:o))}}):null,No&&E?l.jsx(So.AiPanel,{config:E,documentHtml:((Ht=n.current)==null?void 0:Ht.innerHTML)??N??"",selectionHtml:_t,onBusyChange:Bn,onClose:()=>Re(!1),onApplyHtml:e=>{if(p(n.current),_t)d.insertHTML(e);else{F(e);return}_()}}):null]}),Je?l.jsxs("div",{className:f.INK_CLASS_FOOTER,children:[pn,et?` / ${et}`:""]}):null]})};exports.InkEditor=Fo;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),r=require("react"),O=require("../../constants/numbers.cjs"),I=require("../../constants/toolbar.const.cjs"),A=require("../../constants/toolbarMenu.const.cjs"),vt=require("../../constants/colorMode.const.cjs"),_e=require("../../constants/keyboard.const.cjs"),Ke=require("../../constants/fonts.const.cjs"),Xe=require("../../constants/lists.const.cjs"),x=require("../../constants/findReplaceMenu.const.cjs"),je=require("../../constants/blocks.const.cjs"),f=require("../../constants/defaults.const.cjs"),Io=require("../../constants/aiModels.const.cjs");require("../../constants/openai.const.cjs");const qt=require("../../constants/defaultIcons.cjs"),a=require("../../constants/contextMenu.const.cjs"),go=require("../../utils/cn.utils.cjs"),Ao=require("../../utils/typo.utils.cjs"),Kt=require("../../utils/id.utils.cjs"),M=require("../../utils/table.utils.cjs"),m=require("../../utils/blocks.utils.cjs"),H=require("../../utils/trackChanges.utils.cjs"),We=require("../../utils/comments.utils.cjs"),Ve=require("../../utils/history.utils.cjs"),Xt=require("../../utils/slash.utils.cjs"),v=require("../../utils/premium.utils.cjs"),Ge=require("../../utils/paste.utils.cjs"),jt=require("../../utils/memory.utils.cjs"),Ro=require("../../utils/findReplace.utils.cjs"),Ze=require("../../utils/selection.utils.cjs"),$=require("../../utils/toolbarStorage.utils.cjs"),bo=require("../../common-components/Button/Button.cjs"),Wt=require("../../common-components/ContextMenu/ContextMenu.cjs"),d=require("./helpers/format.utils.cjs"),ho=require("../../plugins/ai/aiPlugin.cjs"),g=require("./components/ToolbarButton/ToolbarButton.cjs"),Te=require("./components/ToolbarDropdown/ToolbarDropdown.cjs"),Vt=require("./components/ToolbarColorPicker/ToolbarColorPicker.cjs"),Bo=require("./components/CommentsPanel/CommentsPanel.cjs"),So=require("./components/AiPanel/AiPanel.cjs"),Do=require("./components/AiAutocomplete/AiAutocomplete.cjs"),Gt=require("./components/AiAutocomplete/AiAutocomplete.const.cjs"),Ye=require("./components/AiAutocomplete/AiAutocomplete.utils.cjs"),Mo=require("./components/BlockHandles/BlockHandles.cjs"),Ee=require("./components/BlockHandles/BlockHandles.const.cjs"),ko=require("./components/InlineToolbar/InlineToolbar.cjs"),fe=require("./components/InlineToolbar/InlineToolbar.const.cjs"),Zt=require("./components/InlineToolbar/InlineToolbar.utils.cjs"),Uo=require("./components/SlashMenu/SlashMenu.cjs"),Po=require("./components/TrackChangesBar/TrackChangesBar.cjs"),xo=require("./components/SignPad/SignPad.cjs"),Ho=require("./components/FindReplace/FindReplace.cjs"),wo=require("./components/ToolbarCustomize/ToolbarCustomize.cjs"),ze=()=>{const h=window.getSelection();if(!h||h.rangeCount===O.NUMBER_ZERO)return"";const N=h.getRangeAt(O.NUMBER_ZERO),B=document.createElement("div");return B.appendChild(N.cloneContents()),B.innerHTML},p=h=>{h==null||h.focus({preventScroll:!0})},Fo=h=>{var wt;const{value:N,defaultValue:B="",onChange:S,placeholder:$e=f.INK_PLACEHOLDER_DEFAULT,disabled:i=!1,readOnly:c=!1,minHeight:Oe=O.INK_MIN_HEIGHT,maxHeight:Ce,toolbar:ie=f.INK_DEFAULT_TOOLBAR,className:Yt="",testId:zt,allowImagePaste:Qe=!0,showCharCount:Je=!1,charCountMax:et,typoAutoFix:$t=!0,variant:tt=f.INK_DEFAULT_VARIANT,chrome:Qt=f.INK_DEFAULT_CHROME,colorMode:nt=vt.INK_DEFAULT_COLOR_MODE,features:Jt,author:q=f.INK_DEFAULT_AUTHOR,trackChanges:Q,onTrackChangesChange:me,trackChangesEnabled:ce,onTrackChangesEnabledChange:pe,comments:J,onCommentsChange:Le,showCommentsPanel:ee,onShowCommentsPanelChange:Ne,ai:E,slashCommands:en,tableRows:tn=f.INK_TABLE_DEFAULT_ROWS,tableCols:nn=f.INK_TABLE_DEFAULT_COLS,premium:on,theme:rn,icons:ot,pasteMode:sn="plain",onImageUpload:rt,wysiwyg:ln=!1,keepInMemory:K=!1,memoryKey:X,onToolbarChange:Ie,toolbarHidden:j,onToolbarHiddenChange:ge,style:cn,...an}=h,T={...f.INK_DEFAULT_FEATURES,...Jt},W=v.resolveInkPremium(on),un=v.hasInkPremiumFeature(W,"icons"),dn=v.hasInkPremiumFeature(W,"theme"),_n=v.hasInkPremiumFeature(W,"richPaste"),Tn=v.hasInkPremiumFeature(W,"imageUpload"),En=v.hasInkPremiumFeature(W,"wysiwyg")&&ln,C=un&&ot?{...qt.INK_DEFAULT_ICONS,...ot}:qt.INK_DEFAULT_ICONS,fn=dn?v.themeTokensToStyle(rn):{},On=_n&&sn==="rich",n=r.useRef(null),te=r.useRef(new Ve.InkHistoryStack(N??B)),V=r.useRef(null),w=r.useRef(null),[st,Cn]=r.useState(new Set),[mn,lt]=r.useState("p"),[pn,Ln]=r.useState(0),[Nn,In]=r.useState(O.INK_DEFAULT_TEXT_COLOR),[gn,An]=r.useState(O.INK_DEFAULT_HIGHLIGHT_COLOR),[G,it]=r.useState(ce??!1),[Rn,ct]=r.useState(Q??[]),[bn,at]=r.useState(J??[]),[hn,ut]=r.useState(ee??!1),[dt,Ae]=r.useState(!!(E!=null&&E.enabled&&E.openOnInit)),[ae,Bn]=r.useState(!1),_t=r.useRef(!1),[k,ne]=r.useState({visible:!1,suggestion:"",top:O.NUMBER_ZERO,left:O.NUMBER_ZERO}),oe=r.useRef(null),Z=r.useRef(O.NUMBER_ZERO),[Tt,Sn]=r.useState(""),[Dn,Mn]=r.useState(0),[kn,Et]=r.useState(!1),[Un,ue]=r.useState([]),[ft,Pn]=r.useState({top:0,left:0}),[Ot,Re]=r.useState(!1),[be,de]=r.useState(!1),[xn,Hn]=r.useState(x.FIND_REPLACE_FOCUS_FIND),[wn,Fn]=r.useState(Ke.FONT_VALUE_SYSTEM),[yn,Ct]=r.useState(Xe.LIST_VALUE_BULLET),[vn,qn]=r.useState(x.FIND_REPLACE_FOCUS_FIND),[he,Be]=r.useState({open:!1,x:O.NUMBER_ZERO,y:O.NUMBER_ZERO}),[Kn,mt]=r.useState(!1),[Se,De]=r.useState({open:!1,x:O.NUMBER_ZERO,y:O.NUMBER_ZERO}),[Me,Y]=r.useState({open:!1,top:O.NUMBER_ZERO,left:O.NUMBER_ZERO}),[ke,pt]=r.useState(()=>$.readToolbarItems(K,X)??ie),[Xn,Lt]=r.useState(()=>j!==void 0?j:$.readToolbarHidden(K,X)??!1),[jn,Nt]=r.useState(!1),It=r.useRef(!0),Wn=ie.join(","),U=Q??Rn,re=J??bn,Ue=ee??hn,gt=en??T.slash,At=j??Xn,Rt=ie,Vn=$.listCustomizableToolbarOptions(Rt),Pe=nt===vt.COLOR_MODE_SYSTEM?void 0:nt,xe=!!(T.ai&&(E!=null&&E.enabled)&&E.autocomplete!==!1&&!i&&!c),He=()=>{oe.current!==null&&(window.clearTimeout(oe.current),oe.current=null)},D=()=>{He(),Z.current+=1,ne(e=>e.visible||e.suggestion?{visible:!1,suggestion:"",top:O.NUMBER_ZERO,left:O.NUMBER_ZERO}:e)},Gn=()=>{if(!xe||ae||!n.current){D();return}const e=window.getSelection();if(!e||!e.isCollapsed){D();return}He(),ne(o=>o.visible||o.suggestion?{...o,visible:!1,suggestion:""}:o);const t=(E==null?void 0:E.providerId)||Io.INK_AI_DEMO_PROVIDER_ID;oe.current=window.setTimeout(()=>{if(oe.current=null,!n.current||_t.current)return;const o=window.getSelection();if(!o||!o.isCollapsed)return;const s=Ye.getTextBeforeCaret(n.current),u=Ye.getCaretPositionInRoot(n.current);if(!s.trim()||!u)return;const L=Z.current+1;Z.current=L;const b=n.current.innerHTML;ho.inkAi.runProvider(t,{capability:"autocomplete",html:b,prompt:s,modelId:E==null?void 0:E.modelId}).then(y=>{var yt;if(L!==Z.current)return;const P=((yt=y.text)==null?void 0:yt.trim())||"";if(!P){ne({visible:!1,suggestion:"",top:O.NUMBER_ZERO,left:O.NUMBER_ZERO});return}const Ft=n.current&&Ye.getCaretPositionInRoot(n.current)||u;ne({visible:!0,suggestion:P,top:Ft.top,left:Ft.left})}).catch(()=>{L===Z.current&&ne({visible:!1,suggestion:"",top:O.NUMBER_ZERO,left:O.NUMBER_ZERO})})},Gt.AI_AUTOCOMPLETE_DEBOUNCE_MS)};r.useEffect(()=>()=>{He(),Z.current+=1},[]),r.useEffect(()=>{_t.current=ae,ae&&D()},[ae]),r.useEffect(()=>{ce!==void 0&&it(ce)},[ce]),r.useEffect(()=>{Q&&ct(Q)},[Q]),r.useEffect(()=>{J&&at(J)},[J]),r.useEffect(()=>{ee!==void 0&&ut(ee)},[ee]),r.useEffect(()=>{j!==void 0&&Lt(j)},[j]),r.useEffect(()=>{if(It.current){It.current=!1;return}pt(ie)},[Wn]),r.useEffect(()=>{if(!n.current||N===void 0||N===V.current)return;if(n.current.innerHTML===N){V.current=N;return}const e=document.activeElement===n.current;Ze.withPreservedSelection(e?n.current:null,()=>{n.current&&(n.current.innerHTML=N)}),V.current=N},[N]),r.useEffect(()=>{if(!n.current)return;const e=K?jt.readInkMemory(X):"";if(e){n.current.innerHTML=e,V.current=e,te.current=new Ve.InkHistoryStack(e),S==null||S(e);return}N===void 0&&B&&(n.current.innerHTML=B,V.current=B,te.current=new Ve.InkHistoryStack(B),S==null||S(B))},[]);const we=e=>{var t;te.current.push(e),V.current=e,S==null||S(e),K&&jt.writeInkMemory(e,X),Je&&n.current&&Ln(((t=n.current.textContent)==null?void 0:t.length)??0)},F=e=>{n.current&&(Ze.withPreservedSelection(n.current,()=>{n.current&&(n.current.innerHTML=e)}),we(e))},Fe=e=>{Lt(e),ge==null||ge(e),$.writeToolbarHidden(e,K,X)},Zn=e=>{pt(e),Ie==null||Ie(e),$.writeToolbarItems(e,K,X)},Yn=(e,t)=>{if(e===A.TOOLBAR_OPTION_DIVIDER)return;const o=new Set(ke.filter(s=>s!==A.TOOLBAR_OPTION_DIVIDER));t?o.add(e):o.delete(e),Zn($.buildVisibleToolbarItems(Rt,o))},se=e=>{ct(e),me==null||me(e)},ye=e=>{at(e),Le==null||Le(e)},ve=e=>{ut(e),Ne==null||Ne(e)},zn=e=>{it(e),pe==null||pe(e)},$n=()=>{if(i||c){Y(u=>u.open?{...u,open:!1}:u);return}const e=window.getSelection();if(!e||e.isCollapsed||e.rangeCount===0||!Zt.selectionIsInsideElement(e,n.current)){Y(u=>u.open?{...u,open:!1}:u);return}const o=e.getRangeAt(0).getBoundingClientRect();if(o.width===0&&o.height===0){Y(u=>u.open?{...u,open:!1}:u);return}const s=Zt.clampInlineToolbarPosition({selectionRect:o,toolbarWidth:fe.INLINE_TOOLBAR_ESTIMATED_WIDTH_PX,toolbarHeight:fe.INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX,viewport:{width:window.innerWidth,height:window.innerHeight},gap:fe.INLINE_TOOLBAR_GAP_PX,edgePadding:fe.INLINE_TOOLBAR_EDGE_PADDING_PX});Y({open:!0,top:s.top,left:s.left})},le=()=>{Cn(d.getActiveFormats());const e=d.queryCommandValue("formatBlock");if(e&&lt(e.toLowerCase().replace(/[<>]/g,"")),Ct(d.detectListType()),Sn(ze()),$n(),!n.current||!T.blocks)return;const t=window.getSelection(),o=(t==null?void 0:t.anchorNode)??null,s=m.getBlockElement(o,n.current);if(m.markActiveBlock(n.current,s),s){const u=n.current.getBoundingClientRect(),L=s.getBoundingClientRect();Mn(L.top-u.top+n.current.scrollTop),Et(!0)}else Et(!1)},_=()=>{var t,o,s;if(!n.current)return;let e=n.current.innerHTML;if(G&&T.trackChanges){const u=window.getSelection();if(u&&!u.isCollapsed){const L=ze();if(L){const b=H.createTrackChange("delete",L,q);se([...U,b]),Qn(b.id),e=n.current.innerHTML}}}if(we(e),le(),gt&&n.current){const u=((o=(t=window.getSelection())==null?void 0:t.anchorNode)==null?void 0:o.textContent)??"",L=Xt.extractSlashQuery(u);if(L!==null){ue(Xt.filterSlashCommands(L));const b=(s=window.getSelection())==null?void 0:s.getRangeAt(0);if(b&&n.current){const y=b.getBoundingClientRect(),P=n.current.getBoundingClientRect();Pn({top:y.bottom-P.top+8,left:y.left-P.left})}}else ue([])}xe?Gn():D()},bt=()=>{const e=k.suggestion;if(!e){D();return}p(n.current),d.execCommand(Gt.AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT,e),D(),_()},Qn=e=>{const t=window.getSelection();if(!t||t.rangeCount===0)return;const o=ze();o&&d.insertHTML(H.wrapDeleteHtml(o,e))},Jn=()=>{if(!n.current||!$t||!T.typoAutoFix||i||c)return;const e=n.current.innerHTML,t=Ao.applyTypoAutoFix(e);t.html!==e&&(Ze.withPreservedSelection(n.current,()=>{n.current&&(n.current.innerHTML=t.html)}),we(t.html))},R=e=>{if(i||c)return;if(p(n.current),e==="clearFormat"){d.clearFormatDeep(),_();return}if(e==="directionLtr"&&n.current){d.setBlockDirection(n.current,je.DIR_LTR),_();return}if(e==="directionRtl"&&n.current){d.setBlockDirection(n.current,je.DIR_RTL),_();return}if(e==="superscript"||e==="subscript"){d.execCommand(e),_();return}const t=f.INK_BUTTON_CONFIG[e];t&&(t.value?d.execCommand(t.command,t.value):d.execCommand(t.command),_())},eo=e=>{i||c||(p(n.current),d.execCommand("formatBlock",e),lt(e),_())},to=e=>{i||c||(p(n.current),d.applyFontFamily(e),Fn(e),_())},no=e=>{i||c||(p(n.current),d.applyListType(e),Ct(e),_())},ht=e=>{Hn(e),qn(e),de(!0)},oo=e=>{if(i||c)return;const t=e===x.FIND_REPLACE_VALUE_REPLACE?x.FIND_REPLACE_FOCUS_REPLACE:x.FIND_REPLACE_FOCUS_FIND;ht(t)},qe=()=>{if(i||c)return;const e=window.prompt("Enter URL:","https://");e&&(p(n.current),d.insertLink(e),_())},Bt=async e=>Tn&&rt?rt(e):d.fileToDataUrl(e),ro=async()=>{if(i||c)return;const e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=async()=>{var s;const t=(s=e.files)==null?void 0:s[0];if(!t)return;const o=await Bt(t);p(n.current),d.insertImage(o,t.name),_()},e.click()},St=()=>{if(i||c||!T.table)return;p(n.current);const e=M.buildTableHtml(tn,nn);if(G&&T.trackChanges){const t=H.createTrackChange("insert",e,q);se([...U,t]),d.insertHTML(H.wrapInsertHtml(e,t.id))}else d.insertHTML(e);_()},Dt=()=>{const e=te.current.undo();if(e===null||!n.current){d.execCommand("undo"),_();return}F(e)},Mt=()=>{const e=te.current.redo();if(e===null||!n.current){d.execCommand("redo"),_();return}F(e)},so=e=>{i||c||(e.preventDefault(),De(t=>t.open?{...t,open:!1}:t),mt(!!(T.table&&M.getTableCellFromSelection())),Be({open:!0,x:e.clientX,y:e.clientY}))},lo=e=>{i||c||(e.preventDefault(),Be(t=>t.open?{...t,open:!1}:t),De({open:!0,x:e.clientX,y:e.clientY}))},kt=()=>{if(i||c||!T.comments)return;const e=window.prompt("Comment:");if(!(e!=null&&e.trim()))return;const t=Kt.createInkId("hl");if(p(n.current),!We.wrapSelectionAsComment(t))return;const s=We.createCommentThread(q,e.trim(),t);ye([s,...re]),ve(!0),_()},io=[{id:A.TOOLBAR_CONTEXT_MENU_ID_CUSTOMIZE,label:A.TOOLBAR_CONTEXT_MENU_LABEL_CUSTOMIZE,onSelect:()=>Nt(!0)},{id:A.TOOLBAR_CONTEXT_MENU_ID_HIDE,label:A.TOOLBAR_CONTEXT_MENU_LABEL_HIDE,onSelect:()=>Fe(!0)}],z=e=>{const t=M.getTableCellFromSelection();!t||!T.table||e(t)&&_()},co=[...T.table&&Kn?[{id:a.CONTEXT_MENU_ID_TABLE_ROW_ABOVE,label:a.CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE,onSelect:()=>z(e=>M.insertTableRow(e,"before"))},{id:a.CONTEXT_MENU_ID_TABLE_ROW_BELOW,label:a.CONTEXT_MENU_LABEL_TABLE_ROW_BELOW,onSelect:()=>z(e=>M.insertTableRow(e,"after"))},{id:a.CONTEXT_MENU_ID_TABLE_COL_LEFT,label:a.CONTEXT_MENU_LABEL_TABLE_COL_LEFT,onSelect:()=>z(e=>M.insertTableColumn(e,"before"))},{id:a.CONTEXT_MENU_ID_TABLE_COL_RIGHT,label:a.CONTEXT_MENU_LABEL_TABLE_COL_RIGHT,onSelect:()=>z(e=>M.insertTableColumn(e,"after"))},{id:a.CONTEXT_MENU_ID_TABLE_DELETE_ROW,label:a.CONTEXT_MENU_LABEL_TABLE_DELETE_ROW,onSelect:()=>z(e=>M.deleteTableRow(e))},{id:a.CONTEXT_MENU_ID_TABLE_DELETE_COL,label:a.CONTEXT_MENU_LABEL_TABLE_DELETE_COL,onSelect:()=>z(e=>M.deleteTableColumn(e))}]:[],{id:a.CONTEXT_MENU_ID_BOLD,label:a.CONTEXT_MENU_LABEL_BOLD,onSelect:()=>R("bold")},{id:a.CONTEXT_MENU_ID_ITALIC,label:a.CONTEXT_MENU_LABEL_ITALIC,onSelect:()=>R("italic")},{id:a.CONTEXT_MENU_ID_UNDERLINE,label:a.CONTEXT_MENU_LABEL_UNDERLINE,onSelect:()=>R("underline")},{id:a.CONTEXT_MENU_ID_STRIKE,label:a.CONTEXT_MENU_LABEL_STRIKE,onSelect:()=>R("strikethrough")},{id:a.CONTEXT_MENU_ID_HEADING,label:a.CONTEXT_MENU_LABEL_HEADING,onSelect:()=>R("heading2")},{id:a.CONTEXT_MENU_ID_BULLET,label:a.CONTEXT_MENU_LABEL_BULLET,onSelect:()=>R("bulletList")},{id:a.CONTEXT_MENU_ID_ORDERED,label:a.CONTEXT_MENU_LABEL_ORDERED,onSelect:()=>R("orderedList")},{id:a.CONTEXT_MENU_ID_LINK,label:a.CONTEXT_MENU_LABEL_LINK,onSelect:()=>qe()},{id:a.CONTEXT_MENU_ID_CLEAR,label:a.CONTEXT_MENU_LABEL_CLEAR,onSelect:()=>R("clearFormat")},{id:a.CONTEXT_MENU_ID_FIND,label:a.CONTEXT_MENU_LABEL_FIND,disabled:!T.findReplace,onSelect:()=>de(!0)},{id:a.CONTEXT_MENU_ID_SIGNATURE,label:a.CONTEXT_MENU_LABEL_SIGNATURE,disabled:!T.signature,onSelect:()=>Re(!0)},{id:a.CONTEXT_MENU_ID_COMMENT,label:a.CONTEXT_MENU_LABEL_COMMENT,disabled:!T.comments,onSelect:()=>kt()},...At?[{id:A.CONTEXT_MENU_ID_SHOW_TOOLBAR,label:A.CONTEXT_MENU_LABEL_SHOW_TOOLBAR,onSelect:()=>Fe(!1)}]:[]],Ut=e=>{if(!n.current)return;const t=H.acceptTrackChangeInHtml(n.current.innerHTML,e);F(t),se(U.map(o=>o.id===e?{...o,accepted:!0}:o))},Pt=e=>{if(!n.current)return;const t=H.rejectTrackChangeInHtml(n.current.innerHTML,e);F(t),se(U.map(o=>o.id===e?{...o,rejected:!0}:o))},xt=async e=>{const t=await Bt(e),o=`<img src="${t}" alt="" style="max-width:100%;height:auto;" />`;if(G&&T.trackChanges){const s=H.createTrackChange("insert",o,q);se([...U,s]),d.insertHTML(H.wrapInsertHtml(o,s.id))}else d.insertImage(t);_()},ao=async e=>{if(i||c)return;const t=e.clipboardData;if(!t)return;if(On){const s=Ge.extractClipboardHtml(t);if(s){e.preventDefault();const L=Ge.sanitizePastedHtml(s);L&&(d.insertHTML(L),_());const b=t.items;if(Qe&&b)for(const y of Array.from(b)){if(!y.type.startsWith("image/"))continue;const P=y.getAsFile();P&&await xt(P)}return}const u=Ge.extractClipboardText(t);if(u){e.preventDefault(),d.insertHTML(u.replace(/\n/g,"<br />")),_();return}}if(!Qe)return;const o=t.items;if(o)for(const s of Array.from(o)){if(!s.type.startsWith("image/"))continue;e.preventDefault();const u=s.getAsFile();u&&await xt(u)}},uo=e=>{R(e)},_o=e=>{if(e.key===_e.KEY_TAB&&k.visible&&k.suggestion){e.preventDefault(),bt();return}if(e.key===_e.KEY_ENTER){D();return}if(d.tryConvertMarkdownListPrefix(e.nativeEvent)){_();return}if(e.key===_e.KEY_ESCAPE){if(k.visible){e.preventDefault(),D();return}ue([]),Y(t=>t.open?{...t,open:!1}:t)}(e.metaKey||e.ctrlKey)&&e.key===_e.KEY_Z&&(e.preventDefault(),e.shiftKey?Mt():Dt())},To=e=>{var o;p(n.current);const t=window.getSelection();if((o=t==null?void 0:t.anchorNode)!=null&&o.textContent){const u=t.anchorNode.textContent.replace(/(?:^|\s)\/[^\s]*$/," ");t.anchorNode.nodeType===Node.TEXT_NODE&&(t.anchorNode.textContent=u)}switch(ue([]),e.insert){case"heading1":d.execCommand("formatBlock","h1");break;case"heading2":d.execCommand("formatBlock","h2");break;case"bulletList":d.execCommand("insertUnorderedList");break;case"orderedList":d.execCommand("insertOrderedList");break;case"table":St();return;case"ai":Ae(!0);break}_()},Ht=e=>{if(!n.current)return;const t=window.getSelection(),o=m.getBlockElement((t==null?void 0:t.anchorNode)??null,n.current);o&&m.moveBlock(o,e)&&(_(),le())},Eo=e=>{if(!n.current)return;const t=window.getSelection(),o=m.getBlockElement((t==null?void 0:t.anchorNode)??null,n.current),s=n.current.querySelector(`.${f.INK_CLASS_BLOCK_ACTIVE}`),u=o??(s instanceof HTMLElement?s:null);if(!u){e.preventDefault();return}w.current=u,m.clearBlockDragClasses(n.current),m.markActiveBlock(n.current,u),m.markDraggingBlock(u),e.dataTransfer.setData(Ee.BLOCK_HANDLES_DRAG_MIME,Ee.BLOCK_HANDLES_DRAG_PAYLOAD),e.dataTransfer.effectAllowed=Ee.BLOCK_HANDLES_DRAG_EFFECT_MOVE},fo=e=>{if(!n.current||!w.current)return;e.preventDefault(),e.dataTransfer.dropEffect=Ee.BLOCK_HANDLES_DRAG_EFFECT_MOVE;const t=m.getBlockElement(e.target,n.current);if(!t||t===w.current){m.markDropTarget(n.current,null,null);return}const o=m.resolveDropPosition(e.clientY,t);m.markDropTarget(n.current,t,o)},Oo=e=>{if(!n.current||!w.current)return;e.preventDefault();const t=m.getBlockElement(e.target,n.current),o=w.current;t&&t!==o&&(m.resolveDropPosition(e.clientY,t)===je.BLOCK_DROP_POSITION_BEFORE?m.reorderBlockBefore(o,t):m.reorderBlockAfter(o,t))&&(_(),le()),m.clearBlockDragClasses(n.current),w.current=null},Co=()=>{n.current&&m.clearBlockDragClasses(n.current),w.current=null},mo=(e,t)=>{if(e==="divider")return l.jsx("span",{className:f.INK_CLASS_DIVIDER},`divider-${t}`);if(e==="headingDropdown")return l.jsx(Te.ToolbarDropdown,{title:"Heading",options:f.INK_HEADING_OPTIONS,value:mn||"p",disabled:i||c,onChange:eo},"heading");if(e===I.TOOLBAR_OPTION_FONT_DROPDOWN)return l.jsx(Te.ToolbarDropdown,{title:Ke.FONT_DROPDOWN_TITLE,options:Ke.INK_FONT_OPTIONS,value:wn,disabled:i||c,onChange:to},I.TOOLBAR_OPTION_FONT_DROPDOWN);if(e===I.TOOLBAR_OPTION_LIST_DROPDOWN)return l.jsx(Te.ToolbarDropdown,{title:Xe.LIST_DROPDOWN_TITLE,options:Xe.INK_LIST_OPTIONS,value:yn,disabled:i||c,onChange:no},I.TOOLBAR_OPTION_LIST_DROPDOWN);if(e==="textColor")return l.jsx(Vt.ToolbarColorPicker,{title:"Text color",type:"text",value:Nn,disabled:i||c,onChange:s=>{p(n.current),d.setTextColor(s),In(s),_()}},"textColor");if(e==="highlightColor")return l.jsx(Vt.ToolbarColorPicker,{title:"Highlight color",type:"highlight",value:gn,disabled:i||c,onChange:s=>{p(n.current),d.setHighlightColor(s),An(s),_()}},"highlightColor");if(e==="link")return l.jsx(g.ToolbarButton,{icon:C.link,title:"Insert link",disabled:i||c,onClick:qe},"link");if(e==="image")return l.jsx(g.ToolbarButton,{icon:C.image,title:"Insert image",disabled:i||c,onClick:()=>{ro()}},"image");if(e==="table")return T.table?l.jsx(g.ToolbarButton,{icon:C.table,title:"Insert table",disabled:i||c,onClick:St},"table"):null;if(e===I.TOOLBAR_OPTION_SIGNATURE)return T.signature?l.jsx(g.ToolbarButton,{icon:C.signature,title:"Sign pad",active:Ot,disabled:i||c,onClick:()=>Re(!0)},I.TOOLBAR_OPTION_SIGNATURE):null;if(e===I.TOOLBAR_OPTION_FIND_REPLACE)return T.findReplace?l.jsx(g.ToolbarButton,{icon:C.findReplace,title:"Find and replace",active:be,disabled:i||c,onClick:()=>{be?de(!1):ht(x.FIND_REPLACE_FOCUS_FIND)}},I.TOOLBAR_OPTION_FIND_REPLACE):null;if(e===I.TOOLBAR_OPTION_FIND_REPLACE_DROPDOWN)return T.findReplace?l.jsx(Te.ToolbarDropdown,{title:x.FIND_REPLACE_DROPDOWN_TITLE,options:x.INK_FIND_REPLACE_OPTIONS,value:vn,disabled:i||c,onChange:oo},I.TOOLBAR_OPTION_FIND_REPLACE_DROPDOWN):null;if(e===I.TOOLBAR_OPTION_HORIZONTAL_RULE)return T.horizontalRule?l.jsx(g.ToolbarButton,{icon:C.horizontalRule,title:"Horizontal rule",disabled:i||c,onClick:()=>{p(n.current),d.insertHTML("<hr />"),_()}},I.TOOLBAR_OPTION_HORIZONTAL_RULE):null;if(e==="undo")return l.jsx(g.ToolbarButton,{icon:C.undo,title:"Undo",disabled:i||c,onClick:Dt},"undo");if(e==="redo")return l.jsx(g.ToolbarButton,{icon:C.redo,title:"Redo",disabled:i||c,onClick:Mt},"redo");if(e==="trackChanges")return T.trackChanges?l.jsx(g.ToolbarButton,{icon:C.trackChanges,title:"Track changes",active:G,disabled:i||c,onClick:()=>zn(!G)},"trackChanges"):null;if(e==="comments")return T.comments?l.jsx(g.ToolbarButton,{icon:C.comments,title:"Comments",active:Ue,disabled:i||c,onClick:()=>{Ue?ve(!1):kt()}},"comments"):null;if(e==="ai")return!T.ai||!(E!=null&&E.enabled)?null:l.jsx(g.ToolbarButton,{icon:C.ai,title:"Ink AI",active:dt,disabled:i||c,onClick:()=>Ae(s=>!s)},"ai");const o=f.INK_BUTTON_CONFIG[e];return o?l.jsx(g.ToolbarButton,{icon:C[e]??e.slice(0,1).toUpperCase(),title:o.title,active:st.has(e),disabled:i||c,onClick:()=>R(e)},e):null},po=typeof Oe=="number"?`${Oe}px`:Oe,Lo=typeof Ce=="number"?`${Ce}px`:Ce,No=!!(E!=null&&E.enabled&&dt);return l.jsxs("div",{className:go.cn(f.INK_CLASS_ROOT,Yt),"data-testid":zt,"data-disabled":i||void 0,"data-variant":tt,"data-chrome":Qt,"data-color-mode":Pe,"data-premium":W.active||void 0,"data-wysiwyg":En||void 0,style:{...fn,...cn},...an,children:[At?l.jsx("div",{className:f.INK_CLASS_TOOLBAR_SHOW,children:l.jsx(bo.Button,{type:"button","aria-label":A.TOOLBAR_SHOW_CONTROL_ARIA_LABEL,onClick:()=>Fe(!1),children:A.TOOLBAR_SHOW_CONTROL_LABEL})}):l.jsx("div",{className:f.INK_CLASS_TOOLBAR,role:"toolbar","aria-label":"Ink formatting toolbar",onContextMenu:lo,children:ke.map(mo)}),l.jsx(wo.ToolbarCustomize,{open:jn,options:Vn,visibleItems:ke,onToggle:Yn,onClose:()=>Nt(!1)}),l.jsx(xo.SignPad,{open:Ot,onClose:()=>Re(!1),onConfirm:e=>{p(n.current),d.insertImage(e),_()}}),l.jsx(Ho.FindReplace,{open:be,focusField:xn,onClose:()=>de(!1),onReplace:(e,t,o)=>{if(!n.current)return;const s=Ro.replaceInHtml(n.current.innerHTML,e,t,o);F(s)}}),G&&T.trackChanges?l.jsx(Po.TrackChangesBar,{changes:U,onAccept:Ut,onReject:Pt,onAcceptAll:()=>U.forEach(e=>Ut(e.id)),onRejectAll:()=>U.forEach(e=>Pt(e.id))}):null,tt==="agent"?l.jsx("div",{className:"Ink-Editor__agent-bar",role:"status",children:A.AGENT_BAR_PLACEHOLDER}):null,l.jsxs("div",{className:f.INK_CLASS_SHELL,children:[l.jsxs("div",{className:f.INK_CLASS_BODY,children:[T.blocks?l.jsx(Mo.BlockHandles,{visible:kn&&!i&&!c,top:Dn,onMoveUp:()=>Ht("up"),onMoveDown:()=>Ht("down"),onDragStart:Eo}):null,l.jsx("div",{ref:n,className:f.INK_CLASS_CONTENT,contentEditable:!i&&!c,role:"textbox","aria-multiline":"true","aria-placeholder":$e,"data-placeholder":$e,suppressContentEditableWarning:!0,style:{minHeight:po,maxHeight:Lo},onInput:_,onBlur:Jn,onKeyUp:le,onKeyDown:_o,onMouseUp:le,onContextMenu:so,onDragOver:fo,onDrop:Oo,onDragEnd:Co,onPaste:e=>{ao(e)}}),gt?l.jsx(Uo.SlashMenu,{items:Un,top:ft.top,left:ft.left,onSelect:To}):null,xe?l.jsx(Do.AiAutocomplete,{suggestion:k.suggestion,position:{top:k.top,left:k.left},visible:k.visible,onAccept:bt,onDismiss:D}):null,l.jsx(ko.InlineToolbar,{open:Me.open,top:Me.top,left:Me.left,icons:{bold:C.bold,italic:C.italic,underline:C.underline,code:C.code,link:C.link,clearFormat:C.clearFormat},activeFormats:st,disabled:i||c,onFormat:uo,onLink:qe,onClose:()=>Y(e=>({...e,open:!1}))}),l.jsx(Wt.ContextMenu,{open:he.open,x:he.x,y:he.y,items:co,colorMode:Pe,onClose:()=>{mt(!1),Be(e=>({...e,open:!1}))}}),l.jsx(Wt.ContextMenu,{open:Se.open,x:Se.x,y:Se.y,items:io,colorMode:Pe,onClose:()=>De(e=>({...e,open:!1}))})]}),Ue&&T.comments?l.jsx(Bo.CommentsPanel,{comments:re,author:q,onClose:()=>ve(!1),onResolve:e=>{const t=re.find(o=>o.id===e);ye(re.map(o=>o.id===e?{...o,resolved:!0}:o)),t&&n.current&&F(We.removeCommentMark(n.current.innerHTML,t.highlightId))},onAddReply:(e,t)=>{ye(re.map(o=>o.id===e?{...o,replies:[...o.replies,{id:Kt.createInkId("reply"),author:q,body:t,timestamp:Date.now()}]}:o))}}):null,No&&E?l.jsx(So.AiPanel,{config:E,documentHtml:((wt=n.current)==null?void 0:wt.innerHTML)??N??"",selectionHtml:Tt,onBusyChange:Bn,onClose:()=>Ae(!1),onApplyHtml:e=>{if(p(n.current),Tt)d.insertHTML(e);else{F(e);return}_()}}):null]}),Je?l.jsxs("div",{className:f.INK_CLASS_FOOTER,children:[pn,et?` / ${et}`:""]}):null]})};exports.InkEditor=Fo;
@@ -1 +1 @@
1
- {"version":3,"file":"InkEditor.d.ts","sourceRoot":"","sources":["../../../src/components/InkEditor/InkEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,EAAE,EAMR,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAEV,cAAc,EAIf,MAAM,aAAa,CAAC;AAiNrB,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA87CxC,CAAC"}
1
+ {"version":3,"file":"InkEditor.d.ts","sourceRoot":"","sources":["../../../src/components/InkEditor/InkEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,EAAE,EAMR,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAEV,cAAc,EAIf,MAAM,aAAa,CAAC;AAkNrB,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAm8CxC,CAAC"}