clitrigger 0.2.20 → 0.2.22

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.
@@ -1 +1 @@
1
- import{t as b,M as d,N as u,v as l,z as x,B as g,K as C,Z as h,r as m,T as v,j as i,q as j,P as y,U as E,o as S,s as O,f as P,G as T,D as F}from"./index-vTvGYIx2.js";var I=m.memo(({isEmpty:t,onSave:o,Components:s,dict:e})=>i.jsx(s.Generic.Toolbar.Root,{className:F("bn-action-toolbar","bn-comment-actions"),variant:"action-toolbar",children:i.jsx(s.Generic.Toolbar.Button,{className:"bn-button",mainTooltip:e.comments.save_button_text,variant:"compact",isDisabled:t,onClick:o,children:e.comments.save_button_text})}));function U(){let t=d(),o=u(l),s=x(),e=g(),r=C({trailingBlock:!1,dictionary:{...e,placeholders:{emptyDocument:e.placeholders.new_comment}},schema:o.commentEditorSchema||h}),c=m.useCallback(async()=>{await o.createThread({initialComment:{body:r.document}}),o.stopPendingComment(),t.transact(a=>{a.setSelection(v.create(a.doc,a.selection.to))}),t.focus()},[o,r,t]);return i.jsx(s.Comments.Card,{className:"bn-thread",children:i.jsx(j,{autoFocus:!0,editable:!0,editor:r,actions:({isFocused:a,isEmpty:n})=>i.jsx(I,{isFocused:a,isEmpty:n,onSave:c,Components:s,dict:e})})})}var N=b({default:()=>_});function _(t){let o=d(),s=u(l),e=y(l,{editor:o,selector:n=>n.pendingComment}),r=E({editor:o,selector:({editor:n})=>e?{from:n.prosemirrorState.selection.from,to:n.prosemirrorState.selection.to}:void 0}),c=m.useMemo(()=>{var n,p;return{...t.floatingUIOptions,useFloatingOptions:{open:!!e,onOpenChange:f=>{f||(s.stopPendingComment(),o.focus())},placement:"bottom",middleware:[S(10),O(),P()],...(n=t.floatingUIOptions)==null?void 0:n.useFloatingOptions},focusManagerProps:{disabled:!1},elementProps:{style:{zIndex:60},...(p=t.floatingUIOptions)==null?void 0:p.elementProps}}},[s,o,e,t.floatingUIOptions]),a=t.floatingComposer||U;return i.jsx(T,{position:r,portalElement:t.portalElement,...c,children:i.jsx(a,{})})}export{N as n,U as r,_ as t};
1
+ import{t as b,M as d,N as u,v as l,z as x,B as g,K as C,Z as h,r as m,T as v,j as i,q as j,P as y,U as E,o as S,s as O,f as P,G as T,D as F}from"./index-Cx9MASRL.js";var I=m.memo(({isEmpty:t,onSave:o,Components:s,dict:e})=>i.jsx(s.Generic.Toolbar.Root,{className:F("bn-action-toolbar","bn-comment-actions"),variant:"action-toolbar",children:i.jsx(s.Generic.Toolbar.Button,{className:"bn-button",mainTooltip:e.comments.save_button_text,variant:"compact",isDisabled:t,onClick:o,children:e.comments.save_button_text})}));function U(){let t=d(),o=u(l),s=x(),e=g(),r=C({trailingBlock:!1,dictionary:{...e,placeholders:{emptyDocument:e.placeholders.new_comment}},schema:o.commentEditorSchema||h}),c=m.useCallback(async()=>{await o.createThread({initialComment:{body:r.document}}),o.stopPendingComment(),t.transact(a=>{a.setSelection(v.create(a.doc,a.selection.to))}),t.focus()},[o,r,t]);return i.jsx(s.Comments.Card,{className:"bn-thread",children:i.jsx(j,{autoFocus:!0,editable:!0,editor:r,actions:({isFocused:a,isEmpty:n})=>i.jsx(I,{isFocused:a,isEmpty:n,onSave:c,Components:s,dict:e})})})}var N=b({default:()=>_});function _(t){let o=d(),s=u(l),e=y(l,{editor:o,selector:n=>n.pendingComment}),r=E({editor:o,selector:({editor:n})=>e?{from:n.prosemirrorState.selection.from,to:n.prosemirrorState.selection.to}:void 0}),c=m.useMemo(()=>{var n,p;return{...t.floatingUIOptions,useFloatingOptions:{open:!!e,onOpenChange:f=>{f||(s.stopPendingComment(),o.focus())},placement:"bottom",middleware:[S(10),O(),P()],...(n=t.floatingUIOptions)==null?void 0:n.useFloatingOptions},focusManagerProps:{disabled:!1},elementProps:{style:{zIndex:60},...(p=t.floatingUIOptions)==null?void 0:p.elementProps}}},[s,o,e,t.floatingUIOptions]),a=t.floatingComposer||U;return i.jsx(T,{position:r,portalElement:t.portalElement,...c,children:i.jsx(a,{})})}export{N as n,U as r,_ as t};