@jpmorganchase/mosaic-content-editor-plugin 0.1.0-beta.77 → 0.1.0-beta.79
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/dist/chunk-3JPHK3PI.js +1 -0
- package/dist/{chunk-HKW725NN.js → chunk-6C4BVYAQ.js} +1 -1
- package/dist/{chunk-U52GJYI4.js → chunk-7U5DZAEZ.js} +1 -1
- package/dist/chunk-ASAOLXHV.js +1 -0
- package/dist/chunk-B3KKU2QV.js +1 -0
- package/dist/chunk-CJ3SO6PL.js +1 -0
- package/dist/{chunk-JLXXPRWJ.js → chunk-D52GUU7B.js} +1 -1
- package/dist/{chunk-5KRV6UWE.js → chunk-D6HBLMCI.js} +1 -1
- package/dist/{chunk-FUMV5XTB.js → chunk-NVIOZAGI.js} +1 -1
- package/dist/chunk-RKDFX3SE.js +1 -0
- package/dist/chunk-YQC6J6PL.js +1 -0
- package/dist/chunk-ZFWSNE72.js +1 -0
- package/dist/components/ActionMenu/ActionMenu.d.ts +9 -6
- package/dist/components/ActionMenu/ActionMenu.js +1 -1
- package/dist/components/Editor.js +1 -1
- package/dist/components/LinkEditor/LinkEditor.js +1 -1
- package/dist/components/LinkEditor/SaveAdornment.js +1 -1
- package/dist/components/PersistEditDialog/index.js +1 -1
- package/dist/components/Toolbar/InsertBlockDropdown.js +1 -1
- package/dist/components/Toolbar/InsertImage.js +1 -1
- package/dist/components/Toolbar/InsertLink.js +1 -1
- package/dist/components/Toolbar/TextFormatTooltray.js +1 -1
- package/dist/components/Toolbar/Toolbar.js +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins/FloatingToolbarPlugin.js +1 -1
- package/dist/plugins/MarkdownLinkPlugin.js +1 -1
- package/dist/plugins/PreviewPlugin.js +1 -1
- package/dist/plugins/TableActionMenuPlugin.js +1 -1
- package/package.json +7 -7
- package/dist/chunk-55WG3HBR.js +0 -1
- package/dist/chunk-ESKW4XF6.js +0 -1
- package/dist/chunk-NFSXCTUU.js +0 -1
- package/dist/chunk-ROQUYURQ.js +0 -1
- package/dist/chunk-U7COOUR6.js +0 -1
- package/dist/chunk-UFRXMSJP.js +0 -1
- package/dist/chunk-YDLF23AQ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c}from"./chunk-KZXCNQER.js";import{a as I}from"./chunk-YBFKG74H.js";import{a as v}from"./chunk-HIIAB4W2.js";import{a as h}from"./chunk-3QIETKQW.js";import e,{useState as i}from"react";import{useLexicalComposerContext as M}from"@lexical/react/LexicalComposerContext";import{Button as b,Icon as P}from"@jpmorganchase/mosaic-components";import{string as C,object as V}from"yup";import{Input as S,FormField as D,FormFieldLabel as y,FormFieldHelperText as A,DialogHeader as q,DialogContent as w,DialogActions as H}from"@salt-ds/core";var E=V({alt:C().required("Alternative Information is a required field").max(100,"Alternative Information must be fewer than 100 characters"),url:C().required("Url is required").url("Must be a valid Url")}),x={url:"https://"},Q=()=>{let[O]=M(),[s,m]=i(!1),[r,d]=i(x),[n,u]=i(),f=t=>{m(t),t||d(x)},T=()=>m(!0),p=()=>{f(!1)},g=t=>{let o=t.inner.reduce((l,{path:a,message:B})=>({...l,[a]:B}),{});u(o)},F=t=>{let{name:o,value:l}=t.target,a={...r,[o]:l};E.validateAt(o,a,{abortEarly:!1}).then(()=>{u({...n,[o]:void 0})},g),d(a)};return e.createElement(e.Fragment,null,e.createElement(h,{active:s,onClick:T,label:"Insert Image"},e.createElement(P,{name:"addDocument"})),e.createElement(v,{onOpenChange:f,open:s},e.createElement("form",{onSubmit:async t=>{t.preventDefault(),E.validate(r,{abortEarly:!1}).then(()=>{let o={alt:r&&r.alt!==void 0?r.alt:null,url:r&&r.url!==void 0?r.url:null};O.dispatchCommand(I,o),p()},g)},noValidate:!0},e.createElement(q,{header:"Insert Image"}),e.createElement(w,null,e.createElement("div",{className:c.fullWidth},e.createElement(D,{validationStatus:n?.url?"error":void 0},e.createElement(y,null,"Url for image"),e.createElement(S,{value:r?.url,inputProps:{name:"url"},onChange:F}),e.createElement(A,null,n?.url)),e.createElement(D,{validationStatus:n?.alt?"error":void 0},e.createElement(y,null,"Alternative Information (alt)"),e.createElement(S,{value:r?.alt,inputProps:{name:"alt"},onChange:F}),e.createElement(A,null,n?.alt||"Provides alternative information for the image if for some reason it cannot be viewed")))),e.createElement(H,null,e.createElement(b,{onClick:p},"Cancel"),e.createElement(b,{variant:"cta",type:"submit"},"Insert")))))};export{Q as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L}from"./chunk-BFF3MNBV.js";import{a as d}from"./chunk-5YCBSSDA.js";import{a as E}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-BFF3MNBV.js";import{a as d}from"./chunk-5YCBSSDA.js";import{a as E}from"./chunk-RKDFX3SE.js";import{a as C}from"./chunk-G4LBXKDE.js";import{a as g}from"./chunk-YIFLQ5MW.js";import{mergeRegister as K}from"@lexical/utils";import{$getSelection as U,$isRangeSelection as _,COMMAND_PRIORITY_LOW as x,SELECTION_CHANGE_COMMAND as P}from"lexical";import l,{useCallback as T,useEffect as y,useRef as B,useState as f}from"react";import{$isLinkNode as S,TOGGLE_LINK_COMMAND as G}from"@lexical/link";import{useLexicalComposerContext as H}from"@lexical/react/LexicalComposerContext";import{useFloatingUI as $,Input as b}from"@salt-ds/core";import{useDismiss as F,useInteractions as w}from"@floating-ui/react";function re(){let[t]=H(),h=B(null),[n,r]=f(""),[k,s]=f(!1),[I,a]=f(null),c=()=>{r(""),s(!1),a(null)},{context:N,floating:M,reference:m,strategy:O,x:D,y:R}=$({placement:"right",strategy:"absolute",open:n.length>0,onOpenChange:c}),{getFloatingProps:v}=w([F(N,{ancestorScroll:!0})]),o=T(()=>{let e=U();if(_(e)){let i=C(e),p=i.getParent();S(p)?(m(t.getElementByKey(p.getKey())),r(p.getURL()),a(e)):S(i)?(m(t.getElementByKey(i.getKey())),r(i.getURL()),a(e)):c()}return s(!1),!0},[t,m]);y(()=>K(t.registerUpdateListener(({editorState:e})=>{e.read(()=>{o()})}),t.registerCommand(P,()=>(o(),!0),x)),[t,o]),y(()=>{t.getEditorState().read(()=>{o()})},[t,o]);let u=()=>{I!==null&&n!==""&&(t.dispatchCommand(G,n),s(!1))},A=()=>s(!0);return l.createElement(g,{className:d.popper,ref:M,open:n.length>0,style:{top:R??"",left:D??"",position:O},...v({})},k?l.createElement(b,{endAdornment:l.createElement(E,{onSave:u}),ref:h,value:n,onChange:e=>{r(e.target.value)},onKeyDown:e=>{e.key==="Enter"?(e.preventDefault(),u()):e.key==="Escape"&&e.preventDefault()}}):l.createElement(L,{onClick:A}))}export{re as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"./chunk-4B2NDAA2.js";import{a as s}from"./chunk-DLRFTDUZ.js";import{a as d}from"./chunk-
|
|
1
|
+
import{a as l}from"./chunk-4B2NDAA2.js";import{a as s}from"./chunk-DLRFTDUZ.js";import{a as d}from"./chunk-3JPHK3PI.js";import{a as b}from"./chunk-DXTVYP7D.js";import{a as n}from"./chunk-PC66Q33O.js";import{a as m}from"./chunk-FW7CHFWO.js";import{a as e}from"./chunk-D6HBLMCI.js";import{c as p}from"./chunk-ZFWSNE72.js";import{a as T}from"./chunk-7JRJTNUG.js";import{a as r}from"./chunk-GYUEXLD6.js";import{a as t}from"./chunk-3QIETKQW.js";import{c as i}from"./chunk-G57W376H.js";import o from"react";import{Icon as a}from"@jpmorganchase/mosaic-components";var I=()=>{let{canRedo:f,canUndo:y,redoEdit:u,undoEdit:g}=m(),{setPageState:B}=i();return o.createElement(T,{"aria-label":"page editing toolbar"},o.createElement(r,{"aria-label":"history tooltray"},o.createElement(t,{label:"Undo",disabled:!y,onClick:g},o.createElement(a,{name:"undo"})),o.createElement(t,{label:"Redo",disabled:!f,onClick:u},o.createElement(a,{name:"redo"})),o.createElement(l,null)),o.createElement(e,null),o.createElement(r,{"aria-label":"text format tooltray"},o.createElement(p,null),o.createElement(b,null),o.createElement(d,null),o.createElement(s,null),o.createElement(l,null)),o.createElement(r,{"aria-label":"stop editing tooltray",align:"right"},o.createElement(t,{label:"Cancel Editing",onClick:()=>B("VIEW")},o.createElement(a,{name:"delete"})),o.createElement(l,null)),o.createElement(r,{"aria-label":"copy tooltray"},o.createElement(n,null)))},W=I;export{W as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as S}from"./chunk-B3KKU2QV.js";import{a as p}from"./chunk-6YPAVQF4.js";import{a as L}from"./chunk-YIFLQ5MW.js";import x,{useCallback as i,useEffect as M,useState as h}from"react";import{useLexicalComposerContext as D}from"@lexical/react/LexicalComposerContext";import{$getSelection as P,$isRangeSelection as C}from"lexical";import{$deleteTableColumn as N,$getElementGridForTableNode as E,$getTableCellNodeFromLexicalNode as B,$getTableColumnIndexFromTableCellNode as $,$getTableNodeFromLexicalNodeOrThrow as u,$getTableRowIndexFromTableCellNode as F,$insertTableColumn as O,$insertTableRow as U,$isTableCellNode as a,$removeTableRowAtIndex as k}from"@lexical/table";import{useFloatingUI as K}from"@salt-ds/core";import{useDismiss as G,useInteractions as H}from"@floating-ui/react";var j=[{title:"Insert Row Above",icon:"arrowUp"},{title:"Insert Row Below",icon:"arrowDown"},{title:"Insert Column Left",icon:"arrowLeft"},{title:"Insert Column Right",icon:"arrowRight"},{title:"Delete Row",icon:"delete"},{title:"Delete Column",icon:"delete"},{title:"Delete Table",icon:"deleteSolid"}];function q({editor:t,tableCellNode:e,onComplete:o}){let s=n=>{if(!!n){if(n.title==="Delete Row"){f();return}if(n.title==="Insert Row Below"){m(!0);return}if(n.title==="Insert Row Above"){m(!1);return}if(n.title==="Insert Column Left"){d(!1);return}if(n.title==="Insert Column Right"){d(!0);return}if(n.title==="Delete Column"){g();return}n.title==="Delete Table"&&w()}},f=i(()=>{t.update(()=>{if(a(e)){let n=u(e),l=F(e);k(n,l),o()}})},[t,o,e]),m=i(n=>{t.update(()=>{if(a(e)){let l=u(e),c=F(e),r=E(t,l);U(l,c,n,1,r)}o()})},[t,e,o]),d=i(n=>{t.update(()=>{if(a(e)){let l=u(e),c=$(e),r=E(t,l);O(l,c,n,1,r)}o()})},[t,e,o]),g=i(()=>{t.update(()=>{if(a(e)){let n=u(e),l=$(e);N(n,l),o()}})},[t,e,o]),w=i(()=>{t.update(()=>{a(e)&&(u(e).remove(),o())})},[t,e,o]);return x.createElement(S,{items:j,onItemClick:s})}function le(){let[t]=D(),[e,o]=h(null),[s,f]=h(null),{context:m,floating:d,reference:g,strategy:w,x:n,y:l}=K({placement:"right",strategy:"absolute",open:e!==null,onOpenChange:()=>o(null)}),{getFloatingProps:c}=H([G(m,{ancestorScroll:!0})]),r=i(()=>{let T=P(),I=window.getSelection(),{activeElement:y}=document;if(T==null){o(null);return}let A=t.getRootElement();if(C(T)&&A!==null&&I!==null&&A.contains(I.anchorNode)){let R=B(T.anchor.getNode());if(R==null){o(null);return}let b=t.getElementByKey(R.getKey());if(b==null){o(null);return}b.classList.add(...p.focused),o(R),g(b),f(b)}else y||o(null)},[t,g]);M(()=>t.registerUpdateListener(()=>{t.getEditorState().read(()=>{r()})}),[t,r]),M(function(){return s?.classList.add(...p.focused),function(){s?.classList.remove(...p.focused)}},[s?.classList,e]);let v=()=>{f(null),o(null)};return x.createElement(L,{ref:d,open:e!==null,style:{top:l??"",left:n??"",position:w},...c({})},x.createElement(q,{editor:t,tableCellNode:e,onComplete:v}))}export{le as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"react";import{Menu as r,MenuTrigger as u,MenuPanel as m,MenuItem as M}from"@salt-ds/core";import{Icon as o,Button as c}from"@jpmorganchase/mosaic-components";function A({items:t,onItemClick:i}){return n.createElement(r,null,n.createElement(u,null,n.createElement(c,{variant:"secondary","aria-label":"Actions"},n.createElement(o,{name:"menu","aria-hidden":!0}))),n.createElement(m,null,t.map(e=>n.createElement(M,{key:e.title,onClick:()=>i(e)},n.createElement(o,{name:e.icon}),e.title))))}export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import i from"react";import{Dropdown as k,Option as N}from"@salt-ds/core";import{$createCodeNode as d}from"@lexical/code";import{INSERT_ORDERED_LIST_COMMAND as C,INSERT_UNORDERED_LIST_COMMAND as E}from"@lexical/list";import{$createHeadingNode as x,$createQuoteNode as H}from"@lexical/rich-text";import{$wrapNodes as a}from"@lexical/selection";import{$createParagraphNode as D,$getSelection as c,$isRangeSelection as r}from"lexical";var I=o=>o?o.name:"",s=[{name:"Heading 1",type:"h1"},{name:"Heading 2",type:"h2"},{name:"Heading 3",type:"h3"},{name:"Heading 4",type:"h4"},{name:"Heading 5",type:"h5"},{name:"Heading 6",type:"h6"}],p=[{name:"Bulleted List",type:"bullet"},{name:"Code Block",type:"code"},...s,{name:"Numbered List",type:"number"},{name:"Paragraph",type:"paragraph"},{name:"Quote",type:"quote"}];function Q({editor:o,type:l}){let m=t=>{t.type==="paragraph"&&o.update(()=>{let e=c();r(e)&&a(e,()=>D())})},y=t=>{s.findIndex(e=>e.type===t.type)>=0&&o.update(()=>{let e=c();r(e)&&a(e,()=>x(t.type))})},u=t=>{t.type==="bullet"&&o.dispatchCommand(E,void 0)},f=t=>{t.type==="number"&&o.dispatchCommand(C,void 0)},g=t=>{t.type==="quote"&&o.update(()=>{let e=c();r(e)&&a(e,()=>H())})},S=t=>{t.type==="code"&&o.update(()=>{let e=c();if(r(e))if(e.isCollapsed())a(e,()=>d());else{let n=e.getTextContent(),B=d();e.removeText(),e.insertNodes([B]),e.insertRawText(n)}})},T=(t,e)=>{let n=e[0];!n||(m(n),y(n),u(n),f(n),g(n),S(n))},h=p.findIndex(t=>t.type===l);return i.createElement(k,{defaultSelected:[p[h]],valueToString:I,onSelectionChange:T,style:{width:132}},p.map(t=>i.createElement(N,{value:t,key:t.name})))}export{Q as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-D6HBLMCI.js";import{c as b}from"./chunk-ZFWSNE72.js";import{a as u}from"./chunk-YIFLQ5MW.js";import{a as d}from"./chunk-TSWYSURQ.js";import{a as y}from"./chunk-7JRJTNUG.js";import{a as c}from"./chunk-GYUEXLD6.js";import o,{useCallback as U,useEffect as h,useState as T}from"react";import{useLexicalComposerContext as L}from"@lexical/react/LexicalComposerContext";import{mergeRegister as A}from"@lexical/utils";import{$getSelection as B,$isRangeSelection as M,COMMAND_PRIORITY_LOW as R,SELECTION_CHANGE_COMMAND as _}from"lexical";import{flip as k,inline as w,useInteractions as D,useDismiss as $}from"@floating-ui/react";import{useFloatingUI as v}from"@salt-ds/core";function tt(){let[e]=L(),[t,i]=T(null),[m,r]=T(!1),C=t?{middleware:[w(t),k({fallbackPlacements:["bottom-start","top-start"]})]}:{placement:"bottom-start",strategy:"absolute"},{context:P,floating:x,reference:p,strategy:F}=v({placement:"bottom-start",open:m,onOpenChange:r,strategy:"absolute",...C}),{getFloatingProps:I}=D([$(P,{ancestorScroll:!0})]),n=U(()=>{let l=B(),s=window.getSelection(),g=s?.anchorNode?.parentElement;if(M(l)&&g&&!s?.isCollapsed){p(g);let S=s.getRangeAt(0),{x:E,y:O,height:N}=S.getBoundingClientRect();i({x:E,y:O+N}),r(!0)}else i(null),r(!1)},[p]);h(()=>A(e.registerUpdateListener(({editorState:l})=>{l.read(()=>{n()})}),e.registerCommand(_,()=>(n(),!1),R)),[e,n]);let a={position:F};return t&&(a={...a,top:t.y,left:t.x}),o.createElement(u,{ref:x,open:m,style:a,...I({})},o.createElement(y,{"aria-label":"page editing toolbar",className:d.toolbar},o.createElement(f,{floating:!0}),o.createElement(c,{"aria-label":"text format tooltray"},o.createElement(b,null))))}export{tt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-SOMQOHNT.js";import{a as g}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-SOMQOHNT.js";import{a as g}from"./chunk-CJ3SO6PL.js";import{a as d}from"./chunk-GYUEXLD6.js";import{a as m}from"./chunk-3QIETKQW.js";import o,{useCallback as F,useEffect as C,useState as n}from"react";import T from"clsx";import{FORMAT_TEXT_COMMAND as k,SELECTION_CHANGE_COMMAND as A,COMMAND_PRIORITY_CRITICAL as _,$getSelection as x,$isRangeSelection as D}from"lexical";import{useLexicalComposerContext as $}from"@lexical/react/LexicalComposerContext";import{$isListNode as K,ListNode as S}from"@lexical/list";import{$getNearestNodeOfType as w}from"@lexical/utils";import{$isHeadingNode as H}from"@lexical/rich-text";import{$isCodeNode as G}from"@lexical/code";import{Icon as N}from"@jpmorganchase/mosaic-components";function to({floating:I=!1}){let[c]=$(),[s,u]=n(c),[b,h]=n(!1),[B,L]=n(!1),[O,f]=n(!1),[E,y]=n("paragraph"),p=e=>{s.dispatchCommand(k,e)},l=F(()=>{let e=x();if(D(e)){h(e.hasFormat("bold")),L(e.hasFormat("italic")),f(e.hasFormat("code"));let r=e.anchor.getNode(),t=r.getKey()==="root"?r:r.getTopLevelElementOrThrow(),M=t.getKey();if(s.getElementByKey(M)!==null)if(K(t)){let i=w(r,S),v=i?i.getListType():t.getListType();y(v)}else{let i=H(t)?t.getTag():t.getType();i&&y(i),G(t)&&f(!0)}}},[s]);return C(()=>s.registerUpdateListener(({editorState:e})=>{e.read(()=>{l()})}),[s,l]),C(()=>c.registerCommand(A,(e,r)=>(l(),u(r),!1),_),[c,l]),o.createElement(o.Fragment,null,!I&&o.createElement(d,null,o.createElement(g,{editor:s,type:E})),o.createElement(d,null,o.createElement(m,{active:b,onClick:()=>p("bold"),label:"Bold"},o.createElement("span",{className:T(a.icon,a.bold)},"B")),o.createElement(m,{active:B,onClick:()=>p("italic"),label:"Italic"},o.createElement("span",{className:T(a.icon,a.italic)},"I")),o.createElement(m,{active:O,onClick:()=>p("code"),label:"Inline Code"},o.createElement("span",{className:T(a.code)},o.createElement(N,{name:"chevronLeft"}),o.createElement(N,{name:"chevronRight"})))))}export{to as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-7U5DZAEZ.js";import{a as y}from"./chunk-YQC6J6PL.js";import{a as f}from"./chunk-UWF3FV3R.js";import{a as x}from"./chunk-6C4BVYAQ.js";import{a}from"./chunk-M4ISRNFD.js";import{b as w}from"./chunk-YBFKG74H.js";import{a as M}from"./chunk-ASAOLXHV.js";import{a as h}from"./chunk-D3DKHTOM.js";import{a as k}from"./chunk-QKOQTH4L.js";import{a as P}from"./chunk-RO6ARCLZ.js";import{a as b}from"./chunk-D52GUU7B.js";import{b as S}from"./chunk-ZFWSNE72.js";import{a as T}from"./chunk-FKL4ZGDB.js";import{a as g}from"./chunk-PXUVNH4P.js";import{a as n}from"./chunk-NXV7KCC5.js";import{a as C,d as v,f as l}from"./chunk-G57W376H.js";import R from"react";import{$convertToMarkdownString as oo}from"@lexical/markdown";import{OnChangePlugin as ro}from"@lexical/react/LexicalOnChangePlugin";import{debounce as to}from"lodash-es";import o,{useRef as B,useState as D}from"react";import H from"clsx";import j from"gray-matter";import{LexicalComposer as A}from"@lexical/react/LexicalComposer";import{ListPlugin as I}from"@lexical/react/LexicalListPlugin";import{TablePlugin as J}from"@lexical/react/LexicalTablePlugin";import{LinkPlugin as W}from"@lexical/react/LexicalLinkPlugin";import{HistoryPlugin as X}from"@lexical/react/LexicalHistoryPlugin";import{MarkdownShortcutPlugin as q}from"@lexical/react/LexicalMarkdownShortcutPlugin";import G from"react-split";import{$convertFromMarkdownString as K}from"@lexical/markdown";function Q(r){console.error(r)}var V={namespace:"mosaic-content-editor",onError:Q,nodes:P,theme:h},Y=()=>{let r=document.createElement("div");return r.className=n.gutter,r},Z=({components:r,content:e,persistUrl:m,PreviewComponent:i,previewUrl:s,source:p,user:t})=>{let L=C()||p,{setUser:N}=v(),[c,u]=D(!1),U=B(null),{data:d,content:z}=j(e),$=()=>{u(!0),N(t)},O=()=>{u(!1)};return o.createElement(A,{initialConfig:{...V,editorState:()=>K(z,a)}},o.createElement("div",{className:n.root,onFocus:$,onBlur:O},o.createElement("div",{className:n.toolbarContainer},o.createElement(E,null),o.createElement(y,{meta:d,persistUrl:m}),o.createElement(k,null)),o.createElement("div",{className:n.editorRoot},o.createElement(G,{className:n.splitter,cursor:"col-resize",direction:"horizontal",dragInterval:1,expandToMin:!1,gutter:Y,gutterAlign:"center",minSize:100,sizes:[50,50],snapOffset:30},o.createElement(f,{className:H({[n.focused]:c,[n.unfocused]:!c}),ref:U},o.createElement(g,null)),o.createElement(f,null,i&&o.createElement(i,{source:L,meta:d,components:r}))),o.createElement(X,null),o.createElement(I,null),o.createElement(J,null),o.createElement(W,null),o.createElement(q,{transformers:a}),s?o.createElement(F,{previewUrl:s}):null,o.createElement(w,null),o.createElement(S,null),o.createElement(x,null),o.createElement(T,null),o.createElement(b,null),o.createElement(M,null))))},_=Z;async function eo(r,e){return await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"markdown",text:e})})).json()}function no(r){let e=to(r,250,{maxWait:500});return{onChange:i=>{i.read(()=>{let s=oo(a);s&&e(s)})}}}var F=({previewUrl:r})=>{let{setErrorMessage:e,setPreviewContent:m}=l(),i=async p=>{try{if(p){let t=await eo(r,p);!t.error&&t?.source?m(t.source):e(`${t.error?.toUpperCase()}: ${t?.exception}`)}}catch(t){t instanceof Error&&e(`MDX Error: ${t.message}`)}},{onChange:s}=no(i);return R.createElement(ro,{onChange:s,ignoreSelectionChange:!0})};export{F as a,_ as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-3QIETKQW.js";import r from"react";import{Icon as t}from"@jpmorganchase/mosaic-components";var i=({onSave:n})=>r.createElement(o,{onClick:n,"aria-label":"save link changes",disableTooltip:!0,variant:"regular"},r.createElement(t,{name:"save"}));export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as y}from"./chunk-VDGHHU3F.js";import{a as D}from"./chunk-R2MEEU32.js";import{a as P}from"./chunk-M4ISRNFD.js";import{a as b}from"./chunk-3LGZ7Z7G.js";import{a as k}from"./chunk-HIIAB4W2.js";import{c as C,d as S}from"./chunk-G57W376H.js";import e,{useState as f}from"react";import T from"md5";import{useLexicalComposerContext as G}from"@lexical/react/LexicalComposerContext";import{$convertToMarkdownString as O}from"@lexical/markdown";import{Link as $,P2 as w,Button as v}from"@jpmorganchase/mosaic-components";import{DialogHeader as J,DialogContent as U,DialogActions as V}from"@salt-ds/core";var _=({isRaising:g,prHref:l,error:c})=>!g&&!l&&!c?e.createElement(e.Fragment,null,e.createElement(w,null,"The content of this page resides in a Git repository and to update it requires a Pull Request which will be reviewed by the content owners."),e.createElement("br",null),e.createElement(w,null,"Should you decide to stop editing before creating the Pull Request then all changes will be lost.")):null,ne=({meta:g,persistUrl:l})=>{let{pageState:c,setPageState:q}=C(),{user:m}=S(),[E]=G(),[s,t]=f(!1),[r,n]=f(null),[i,d]=f(null),[I,a]=f([]),p=c==="SAVING",M=r!==null?"success":"info",h=o=>{t(o),o||(q("EDIT"),n(null),a([]))},x=()=>{h(!1)},H=o=>{d(o||"Sorry - an unexpected error has occurred"),n(null),a([]),t(!1)},A=o=>{n(o.message?.links?.self[0]?.href),t(!1)},L=o=>{a(u=>[...u,o])},{sendWorkflowProgressMessage:N}=b(p,H,L,A),W=()=>{t(!0),n(null),d(null);try{E.update(()=>{let o=O(P);if(o&&m&&l){let{sid:u,displayName:B,email:F}=m;N(JSON.stringify({user:{sid:u,name:B,email:F},route:g.route,markdown:o,name:"save"}),T(`${u.toLowerCase()} - save`))}})}catch{d("Sorry - an unexpected error has occurred"),n(null),t(!1),a([])}};return e.createElement(k,{onOpenChange:h,open:p,status:i?"error":M},e.createElement(J,{className:D.title,header:r?"Pull Request Created Successfully":"Save Changes"}),e.createElement(U,null,(s||i)&&!r&&e.createElement(y,{error:i,progress:I}),e.createElement(_,{isRaising:s,prHref:r,error:i}),!s&&r&&e.createElement($,{href:r,target:"_blank"},"A Pull Request for your changes has been created")),e.createElement(V,null,e.createElement(v,{disabled:s,onClick:x},r?"Done":"Cancel"),e.createElement(v,{disabled:l===void 0||s||r!==null,onClick:W,variant:"cta"},"Raise Pull Request")))};export{ne as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C}from"./chunk-WZYDYWT3.js";import{a as k}from"./chunk-HIIAB4W2.js";import{a as I}from"./chunk-3QIETKQW.js";import{e as p}from"./chunk-G57W376H.js";import{$createLinkNode as V,TOGGLE_LINK_COMMAND as W}from"@lexical/link";import{useLexicalComposerContext as G}from"@lexical/react/LexicalComposerContext";import{$wrapNodes as U}from"@lexical/selection";import{$createParagraphNode as j,$createTextNode as Y,$getSelection as z,$isRangeSelection as J,$isTextNode as Q,COMMAND_PRIORITY_EDITOR as X,createCommand as Z}from"lexical";import R,{useCallback as ee,useEffect as te}from"react";import e,{useEffect as O,useState as F}from"react";import{useLexicalComposerContext as _}from"@lexical/react/LexicalComposerContext";import{Button as N,Icon as A}from"@jpmorganchase/mosaic-components";import{string as h,object as $}from"yup";import{Input as S,FormField as T,FormFieldLabel as D,FormFieldHelperText as E,DialogContent as w,DialogActions as B,DialogHeader as K}from"@salt-ds/core";import{$getSelection as q,$isRangeSelection as H}from"lexical";var b=$({url:h().required("Url is required"),text:h().required("Text is required").max(100,"Text must be fewer than 100 characters")}),ge=()=>{let{isInsertingLink:t,setIsInsertingLink:r}=p();return e.createElement(I,{active:t,onClick:()=>r(!0),label:"Insert Link"},e.createElement(A,{name:"linked"}))},v={url:"https://",text:""},y=()=>{let[t]=_(),{isInsertingLink:r,setIsInsertingLink:s}=p(),[o,i]=F(v),[a,d]=F(),m=n=>{s(n),n||(d(void 0),i(v))},g=()=>{m(!1)};O(()=>{t.getEditorState().read(()=>{if(r){let n=q();if(H(n)){let l=n.getTextContent();i(u=>({...u,text:l}))}}})},[t,r]);let x=n=>{let l=n.inner.reduce((u,{path:c,message:P})=>({...u,[c]:P}),{});d(l)},L=n=>{let{name:l,value:u}=n.target,c={...o,[l]:u};b.validateAt(l,c,{abortEarly:!1}).then(()=>{d({...a,[l]:void 0})},x),i(c)},M=async()=>{b.validate(o,{abortEarly:!1}).then(()=>{let n={url:o?.url,text:o?.text};t.dispatchCommand(f,n),g()},x)};return e.createElement(k,{onOpenChange:m,open:r},e.createElement(K,{header:"Insert Link"}),e.createElement(w,null,e.createElement("div",{className:C.fullWidth},e.createElement(T,{validationStatus:a?.url?"error":void 0},e.createElement(D,null,"Image URL text"),e.createElement(S,{value:o?.url,inputProps:{name:"url"},onChange:L}),e.createElement(E,null,a?.url)),e.createElement(T,{validationStatus:a?.text?"error":void 0},e.createElement(D,null,"Link Text"),e.createElement(S,{value:o?.text,inputProps:{name:"text"},onChange:L}),e.createElement(E,null,a?.text)))),e.createElement(B,null,e.createElement(N,{onClick:g},"Cancel"),e.createElement(N,{variant:"cta",onClick:M},"Insert")))};var f=Z();function ne(){let[t]=G(),r=ee(({url:s,text:o})=>{t.update(()=>{let i=z();if(J(i)&&s!==void 0&&o!==void 0){let a=i.focus.getNode();if(Q(a))t.dispatchCommand(W,s);else{let d=V(s),m=Y(o);m.setFormat(i.focus.getNode().getFormat()),d.append(m),U(i,()=>d,j())}}})},[t]);te(()=>t.registerCommand(f,s=>(r(s),!0),X),[t,r])}function Se(){return ne(),R.createElement(y,null)}export{f as a,Se as b,ge as c,y as d};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { IconNames } from '@jpmorganchase/mosaic-theme';
|
|
3
|
+
export declare type ActionMenuItem = {
|
|
4
|
+
title: string;
|
|
5
|
+
icon: IconNames;
|
|
6
|
+
};
|
|
7
|
+
export declare type ActionMenuSource = ActionMenuItem[];
|
|
5
8
|
interface ActionMenuProps {
|
|
6
|
-
|
|
7
|
-
onItemClick:
|
|
9
|
+
items: ActionMenuSource;
|
|
10
|
+
onItemClick: (item: ActionMenuItem) => void;
|
|
8
11
|
}
|
|
9
|
-
export declare function ActionMenu({
|
|
12
|
+
export declare function ActionMenu({ items, onItemClick }: ActionMenuProps): JSX.Element;
|
|
10
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-B3KKU2QV.js";export{a as ActionMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"../chunk-
|
|
1
|
+
import{b as a}from"../chunk-NVIOZAGI.js";import"../chunk-7U5DZAEZ.js";import"../chunk-4B2NDAA2.js";import"../chunk-4LQ77YZW.js";import"../chunk-DLRFTDUZ.js";import"../chunk-3JPHK3PI.js";import"../chunk-KZXCNQER.js";import"../chunk-DXTVYP7D.js";import"../chunk-NFA3MZOC.js";import"../chunk-YQC6J6PL.js";import"../chunk-VDGHHU3F.js";import"../chunk-R2MEEU32.js";import"../chunk-UWF3FV3R.js";import"../chunk-KQ2ZCDYD.js";import"../chunk-6C4BVYAQ.js";import"../chunk-BFF3MNBV.js";import"../chunk-5YCBSSDA.js";import"../chunk-RKDFX3SE.js";import"../chunk-6TM3EYFS.js";import"../chunk-M4ISRNFD.js";import"../chunk-ESJNOEFD.js";import"../chunk-WNTJMWYJ.js";import"../chunk-RT5CJ7T5.js";import"../chunk-G4LBXKDE.js";import"../chunk-YBFKG74H.js";import"../chunk-ASAOLXHV.js";import"../chunk-B3KKU2QV.js";import"../chunk-6YPAVQF4.js";import"../chunk-D3DKHTOM.js";import"../chunk-YNDZSSVG.js";import"../chunk-PC66Q33O.js";import"../chunk-QKOQTH4L.js";import"../chunk-FW7CHFWO.js";import"../chunk-3LGZ7Z7G.js";import"../chunk-RO6ARCLZ.js";import"../chunk-D52GUU7B.js";import"../chunk-D6HBLMCI.js";import"../chunk-SOMQOHNT.js";import"../chunk-CJ3SO6PL.js";import"../chunk-ZFWSNE72.js";import"../chunk-WZYDYWT3.js";import"../chunk-YIFLQ5MW.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";import"../chunk-TSWYSURQ.js";import"../chunk-FKL4ZGDB.js";import"../chunk-PXUVNH4P.js";import"../chunk-HIIAB4W2.js";import"../chunk-OW5SK4AJ.js";import"../chunk-NXV7KCC5.js";import"../chunk-ZHZ4E2MI.js";import"../chunk-7JRJTNUG.js";import"../chunk-GYUEXLD6.js";import"../chunk-FH2LMMJT.js";import"../chunk-7LK4O57W.js";import"../chunk-3QIETKQW.js";import"../chunk-Y2A2ULLZ.js";import"../chunk-G57W376H.js";import"../chunk-6X665P47.js";export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-6C4BVYAQ.js";import"../../chunk-BFF3MNBV.js";import"../../chunk-5YCBSSDA.js";import"../../chunk-RKDFX3SE.js";import"../../chunk-G4LBXKDE.js";import"../../chunk-YIFLQ5MW.js";import"../../chunk-XP37MJCS.js";import"../../chunk-P5OBPOC4.js";import"../../chunk-3QIETKQW.js";import"../../chunk-Y2A2ULLZ.js";export{a as LinkEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-RKDFX3SE.js";import"../../chunk-3QIETKQW.js";import"../../chunk-Y2A2ULLZ.js";export{a as SaveAdornment};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-YQC6J6PL.js";import"../../chunk-VDGHHU3F.js";import"../../chunk-R2MEEU32.js";import"../../chunk-6TM3EYFS.js";import"../../chunk-M4ISRNFD.js";import"../../chunk-ESJNOEFD.js";import"../../chunk-WNTJMWYJ.js";import"../../chunk-RT5CJ7T5.js";import"../../chunk-3LGZ7Z7G.js";import"../../chunk-HIIAB4W2.js";import"../../chunk-OW5SK4AJ.js";import"../../chunk-G57W376H.js";export{a as PersistDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-CJ3SO6PL.js";export{a as InsertBlockDropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-3JPHK3PI.js";import"../../chunk-KZXCNQER.js";import"../../chunk-YBFKG74H.js";import"../../chunk-HIIAB4W2.js";import"../../chunk-OW5SK4AJ.js";import"../../chunk-3QIETKQW.js";import"../../chunk-Y2A2ULLZ.js";export{a as InsertImage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,d as b}from"../../chunk-
|
|
1
|
+
import{c as a,d as b}from"../../chunk-ZFWSNE72.js";import"../../chunk-WZYDYWT3.js";import"../../chunk-HIIAB4W2.js";import"../../chunk-OW5SK4AJ.js";import"../../chunk-3QIETKQW.js";import"../../chunk-Y2A2ULLZ.js";import"../../chunk-G57W376H.js";export{a as InsertLinkButton,b as InsertLinkDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-D6HBLMCI.js";import"../../chunk-SOMQOHNT.js";import"../../chunk-CJ3SO6PL.js";import"../../chunk-GYUEXLD6.js";import"../../chunk-FH2LMMJT.js";import"../../chunk-3QIETKQW.js";import"../../chunk-Y2A2ULLZ.js";export{a as TextFormatTooltray};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-7U5DZAEZ.js";import"../../chunk-4B2NDAA2.js";import"../../chunk-4LQ77YZW.js";import"../../chunk-DLRFTDUZ.js";import"../../chunk-3JPHK3PI.js";import"../../chunk-KZXCNQER.js";import"../../chunk-DXTVYP7D.js";import"../../chunk-NFA3MZOC.js";import"../../chunk-YBFKG74H.js";import"../../chunk-PC66Q33O.js";import"../../chunk-FW7CHFWO.js";import"../../chunk-D6HBLMCI.js";import"../../chunk-SOMQOHNT.js";import"../../chunk-CJ3SO6PL.js";import"../../chunk-ZFWSNE72.js";import"../../chunk-WZYDYWT3.js";import"../../chunk-YIFLQ5MW.js";import"../../chunk-XP37MJCS.js";import"../../chunk-P5OBPOC4.js";import"../../chunk-HIIAB4W2.js";import"../../chunk-OW5SK4AJ.js";import"../../chunk-7JRJTNUG.js";import"../../chunk-GYUEXLD6.js";import"../../chunk-FH2LMMJT.js";import"../../chunk-7LK4O57W.js";import"../../chunk-3QIETKQW.js";import"../../chunk-Y2A2ULLZ.js";import"../../chunk-G57W376H.js";export{a as default};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-NVIOZAGI.js";import"./chunk-7U5DZAEZ.js";import"./chunk-4B2NDAA2.js";import"./chunk-4LQ77YZW.js";import"./chunk-DLRFTDUZ.js";import"./chunk-3JPHK3PI.js";import"./chunk-KZXCNQER.js";import"./chunk-DXTVYP7D.js";import"./chunk-NFA3MZOC.js";import"./chunk-YQC6J6PL.js";import"./chunk-VDGHHU3F.js";import"./chunk-R2MEEU32.js";import"./chunk-UWF3FV3R.js";import"./chunk-KQ2ZCDYD.js";import"./chunk-6C4BVYAQ.js";import"./chunk-BFF3MNBV.js";import"./chunk-5YCBSSDA.js";import"./chunk-RKDFX3SE.js";import"./chunk-6TM3EYFS.js";import"./chunk-M4ISRNFD.js";import"./chunk-ESJNOEFD.js";import"./chunk-WNTJMWYJ.js";import"./chunk-RT5CJ7T5.js";import"./chunk-G4LBXKDE.js";import"./chunk-YBFKG74H.js";import"./chunk-ASAOLXHV.js";import"./chunk-B3KKU2QV.js";import"./chunk-6YPAVQF4.js";import"./chunk-D3DKHTOM.js";import"./chunk-YNDZSSVG.js";import"./chunk-PC66Q33O.js";import"./chunk-QKOQTH4L.js";import"./chunk-FW7CHFWO.js";import"./chunk-3LGZ7Z7G.js";import"./chunk-RO6ARCLZ.js";import"./chunk-D52GUU7B.js";import"./chunk-D6HBLMCI.js";import"./chunk-SOMQOHNT.js";import"./chunk-CJ3SO6PL.js";import"./chunk-ZFWSNE72.js";import"./chunk-WZYDYWT3.js";import"./chunk-YIFLQ5MW.js";import"./chunk-XP37MJCS.js";import"./chunk-P5OBPOC4.js";import"./chunk-TSWYSURQ.js";import"./chunk-FKL4ZGDB.js";import"./chunk-PXUVNH4P.js";import"./chunk-HIIAB4W2.js";import"./chunk-OW5SK4AJ.js";import"./chunk-NXV7KCC5.js";import{a as d}from"./chunk-ZHZ4E2MI.js";import"./chunk-7JRJTNUG.js";import"./chunk-GYUEXLD6.js";import"./chunk-FH2LMMJT.js";import"./chunk-7LK4O57W.js";import"./chunk-3QIETKQW.js";import"./chunk-Y2A2ULLZ.js";import{c as a,f as b}from"./chunk-G57W376H.js";import"./chunk-6X665P47.js";export{c as Editor,d as EditorControls,b as useContentEditor,a as usePageState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-D52GUU7B.js";import"../chunk-D6HBLMCI.js";import"../chunk-SOMQOHNT.js";import"../chunk-CJ3SO6PL.js";import"../chunk-ZFWSNE72.js";import"../chunk-WZYDYWT3.js";import"../chunk-YIFLQ5MW.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";import"../chunk-TSWYSURQ.js";import"../chunk-HIIAB4W2.js";import"../chunk-OW5SK4AJ.js";import"../chunk-7JRJTNUG.js";import"../chunk-GYUEXLD6.js";import"../chunk-FH2LMMJT.js";import"../chunk-7LK4O57W.js";import"../chunk-3QIETKQW.js";import"../chunk-Y2A2ULLZ.js";import"../chunk-G57W376H.js";export{a as FloatingToolbarPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-ZFWSNE72.js";import"../chunk-WZYDYWT3.js";import"../chunk-HIIAB4W2.js";import"../chunk-OW5SK4AJ.js";import"../chunk-3QIETKQW.js";import"../chunk-Y2A2ULLZ.js";import"../chunk-G57W376H.js";export{a as INSERT_MARKDOWN_LINK_COMMAND,b as MarkdownLinkPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-NVIOZAGI.js";import"../chunk-7U5DZAEZ.js";import"../chunk-4B2NDAA2.js";import"../chunk-4LQ77YZW.js";import"../chunk-DLRFTDUZ.js";import"../chunk-3JPHK3PI.js";import"../chunk-KZXCNQER.js";import"../chunk-DXTVYP7D.js";import"../chunk-NFA3MZOC.js";import"../chunk-YQC6J6PL.js";import"../chunk-VDGHHU3F.js";import"../chunk-R2MEEU32.js";import"../chunk-UWF3FV3R.js";import"../chunk-KQ2ZCDYD.js";import"../chunk-6C4BVYAQ.js";import"../chunk-BFF3MNBV.js";import"../chunk-5YCBSSDA.js";import"../chunk-RKDFX3SE.js";import"../chunk-6TM3EYFS.js";import"../chunk-M4ISRNFD.js";import"../chunk-ESJNOEFD.js";import"../chunk-WNTJMWYJ.js";import"../chunk-RT5CJ7T5.js";import"../chunk-G4LBXKDE.js";import"../chunk-YBFKG74H.js";import"../chunk-ASAOLXHV.js";import"../chunk-B3KKU2QV.js";import"../chunk-6YPAVQF4.js";import"../chunk-D3DKHTOM.js";import"../chunk-YNDZSSVG.js";import"../chunk-PC66Q33O.js";import"../chunk-QKOQTH4L.js";import"../chunk-FW7CHFWO.js";import"../chunk-3LGZ7Z7G.js";import"../chunk-RO6ARCLZ.js";import"../chunk-D52GUU7B.js";import"../chunk-D6HBLMCI.js";import"../chunk-SOMQOHNT.js";import"../chunk-CJ3SO6PL.js";import"../chunk-ZFWSNE72.js";import"../chunk-WZYDYWT3.js";import"../chunk-YIFLQ5MW.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";import"../chunk-TSWYSURQ.js";import"../chunk-FKL4ZGDB.js";import"../chunk-PXUVNH4P.js";import"../chunk-HIIAB4W2.js";import"../chunk-OW5SK4AJ.js";import"../chunk-NXV7KCC5.js";import"../chunk-ZHZ4E2MI.js";import"../chunk-7JRJTNUG.js";import"../chunk-GYUEXLD6.js";import"../chunk-FH2LMMJT.js";import"../chunk-7LK4O57W.js";import"../chunk-3QIETKQW.js";import"../chunk-Y2A2ULLZ.js";import"../chunk-G57W376H.js";import"../chunk-6X665P47.js";export{a as PreviewPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-ASAOLXHV.js";import"../chunk-B3KKU2QV.js";import"../chunk-6YPAVQF4.js";import"../chunk-YIFLQ5MW.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";export{a as TableActionMenuPlugin};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jpmorganchase/mosaic-content-editor-plugin",
|
|
3
3
|
"description": "Mosaic - In Browser content editing plugin",
|
|
4
|
-
"version": "0.1.0-beta.
|
|
4
|
+
"version": "0.1.0-beta.79",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "",
|
|
7
7
|
"repository": {
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"typescript": "^4.8.3"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@jpmorganchase/mosaic-components": "^0.1.0-beta.
|
|
45
|
-
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.
|
|
46
|
-
"@salt-ds/core": "^1.
|
|
47
|
-
"@salt-ds/icons": "^1.
|
|
48
|
-
"@salt-ds/lab": "1.0.0-alpha.
|
|
49
|
-
"@salt-ds/theme": "^1.
|
|
44
|
+
"@jpmorganchase/mosaic-components": "^0.1.0-beta.79",
|
|
45
|
+
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.79",
|
|
46
|
+
"@salt-ds/core": "^1.30.0",
|
|
47
|
+
"@salt-ds/icons": "^1.12.1",
|
|
48
|
+
"@salt-ds/lab": "1.0.0-alpha.48",
|
|
49
|
+
"@salt-ds/theme": "^1.19.0",
|
|
50
50
|
"@floating-ui/react": "^0.26.6",
|
|
51
51
|
"@lexical/code": "^0.11.1",
|
|
52
52
|
"@lexical/link": "^0.11.1",
|
package/dist/chunk-55WG3HBR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as C}from"./chunk-WZYDYWT3.js";import{a as k}from"./chunk-HIIAB4W2.js";import{a as I}from"./chunk-3QIETKQW.js";import{e as p}from"./chunk-G57W376H.js";import{$createLinkNode as W,TOGGLE_LINK_COMMAND as G}from"@lexical/link";import{useLexicalComposerContext as U}from"@lexical/react/LexicalComposerContext";import{$wrapNodes as j}from"@lexical/selection";import{$createParagraphNode as Y,$createTextNode as z,$getSelection as J,$isRangeSelection as Q,$isTextNode as X,COMMAND_PRIORITY_EDITOR as Z,createCommand as R}from"lexical";import ee,{useCallback as te,useEffect as ne}from"react";import e,{useEffect as O,useState as F}from"react";import{useLexicalComposerContext as B}from"@lexical/react/LexicalComposerContext";import{Button as N,Icon as _}from"@jpmorganchase/mosaic-components";import{string as h,object as A}from"yup";import{Input as S,FormField as T,FormFieldLabel as D,FormFieldHelperText as E,DialogContent as $,DialogActions as w,DialogHeader as K}from"@salt-ds/core";import{ButtonBar as q}from"@salt-ds/lab";import{$getSelection as H,$isRangeSelection as V}from"lexical";var b=A({url:h().required("Url is required"),text:h().required("Text is required").max(100,"Text must be fewer than 100 characters")}),Le=()=>{let{isInsertingLink:t,setIsInsertingLink:r}=p();return e.createElement(I,{active:t,onClick:()=>r(!0),label:"Insert Link"},e.createElement(_,{name:"linked"}))},v={url:"https://",text:""},y=()=>{let[t]=B(),{isInsertingLink:r,setIsInsertingLink:a}=p(),[o,i]=F(v),[s,d]=F(),m=n=>{a(n),n||(d(void 0),i(v))},g=()=>{m(!1)};O(()=>{t.getEditorState().read(()=>{if(r){let n=H();if(V(n)){let l=n.getTextContent();i(u=>({...u,text:l}))}}})},[t,r]);let x=n=>{let l=n.inner.reduce((u,{path:c,message:P})=>({...u,[c]:P}),{});d(l)},L=n=>{let{name:l,value:u}=n.target,c={...o,[l]:u};b.validateAt(l,c,{abortEarly:!1}).then(()=>{d({...s,[l]:void 0})},x),i(c)},M=async()=>{b.validate(o,{abortEarly:!1}).then(()=>{let n={url:o?.url,text:o?.text};t.dispatchCommand(f,n),g()},x)};return e.createElement(k,{onOpenChange:m,open:r},e.createElement(K,{header:"Insert Link"}),e.createElement($,null,e.createElement("div",{className:C.fullWidth},e.createElement(T,{validationStatus:s?.url?"error":void 0},e.createElement(D,null,"Image URL text"),e.createElement(S,{value:o?.url,inputProps:{name:"url"},onChange:L}),e.createElement(E,null,s?.url)),e.createElement(T,{validationStatus:s?.text?"error":void 0},e.createElement(D,null,"Link Text"),e.createElement(S,{value:o?.text,inputProps:{name:"text"},onChange:L}),e.createElement(E,null,s?.text)))),e.createElement(w,null,e.createElement(q,null,e.createElement(N,{onClick:g},"Cancel"),e.createElement(N,{variant:"cta",onClick:M},"Insert"))))};var f=R();function oe(){let[t]=U(),r=te(({url:a,text:o})=>{t.update(()=>{let i=J();if(Q(i)&&a!==void 0&&o!==void 0){let s=i.focus.getNode();if(X(s))t.dispatchCommand(G,a);else{let d=W(a),m=z(o);m.setFormat(i.focus.getNode().getFormat()),d.append(m),j(i,()=>d,Y())}}})},[t]);ne(()=>t.registerCommand(f,a=>(r(a),!0),Z),[t,r])}function De(){return oe(),ee.createElement(y,null)}export{f as a,De as b,Le as c,y as d};
|
package/dist/chunk-ESKW4XF6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import n from"react";import{MenuButton as r}from"@salt-ds/lab";import{Icon as t}from"@jpmorganchase/mosaic-components";function a({initialSource:o,onItemClick:e}){return n.createElement(r,{hideCaret:!0,CascadingMenuProps:{initialSource:o,onItemClick:e}},n.createElement(t,{name:"menu"}))}export{a};
|
package/dist/chunk-NFSXCTUU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk-3QIETKQW.js";import o from"react";import{Icon as r}from"@jpmorganchase/mosaic-components";import{StaticInputAdornment as a}from"@salt-ds/lab";var s=({onSave:t})=>o.createElement(a,null,o.createElement(n,{onClick:t,"aria-label":"save link changes",disableTooltip:!0,variant:"regular"},o.createElement(r,{name:"save"})));export{s as a};
|
package/dist/chunk-ROQUYURQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as L}from"./chunk-ESKW4XF6.js";import{a as T}from"./chunk-6YPAVQF4.js";import{a as S}from"./chunk-YIFLQ5MW.js";import A,{useCallback as i,useEffect as D,useState as M}from"react";import{useLexicalComposerContext as P}from"@lexical/react/LexicalComposerContext";import{$getSelection as C,$isRangeSelection as N}from"lexical";import{$deleteTableColumn as B,$getElementGridForTableNode as h,$getTableCellNodeFromLexicalNode as O,$getTableColumnIndexFromTableCellNode as E,$getTableNodeFromLexicalNodeOrThrow as u,$getTableRowIndexFromTableCellNode as $,$insertTableColumn as U,$insertTableRow as k,$isTableCellNode as a,$removeTableRowAtIndex as K}from"@lexical/table";import{useFloatingUI as G}from"@salt-ds/core";import{useDismiss as H,useInteractions as j}from"@floating-ui/react";import{ArrowDownIcon as q,ArrowLeftIcon as z,ArrowRightIcon as J,ArrowUpIcon as Q,DeleteIcon as y,DeleteSolidIcon as V}from"@salt-ds/icons";var W={menuItems:[{title:"Insert Row Above",icon:Q},{title:"Insert Row Below",icon:q},{title:"Insert Column Left",icon:z},{title:"Insert Column Right",icon:J},{title:"Delete Row",icon:y},{title:"Delete Column",icon:y},{title:"Delete Table",icon:V}]};function X({editor:t,tableCellNode:e,onComplete:o}){let s=n=>{if(!!n){if(n.title==="Delete Row"){f();return}if(n.title==="Insert Row Below"){m(!0);return}if(n.title==="Insert Row Above"){m(!1);return}if(n.title==="Insert Column Left"){d(!1);return}if(n.title==="Insert Column Right"){d(!0);return}if(n.title==="Delete Column"){p();return}n.title==="Delete Table"&&I()}},f=i(()=>{t.update(()=>{if(a(e)){let n=u(e),l=$(e);K(n,l),o()}})},[t,o,e]),m=i(n=>{t.update(()=>{if(a(e)){let l=u(e),c=$(e),r=h(t,l);k(l,c,n,1,r)}o()})},[t,e,o]),d=i(n=>{t.update(()=>{if(a(e)){let l=u(e),c=E(e),r=h(t,l);U(l,c,n,1,r)}o()})},[t,e,o]),p=i(()=>{t.update(()=>{if(a(e)){let n=u(e),l=E(e);B(n,l),o()}})},[t,e,o]),I=i(()=>{t.update(()=>{a(e)&&(u(e).remove(),o())})},[t,e,o]);return A.createElement(L,{initialSource:W,onItemClick:s})}function ae(){let[t]=P(),[e,o]=M(null),[s,f]=M(null),{context:m,floating:d,reference:p,strategy:I,x:n,y:l}=G({placement:"right",strategy:"absolute",open:e!==null,onOpenChange:()=>o(null)}),{getFloatingProps:c}=j([H(m,{ancestorScroll:!0})]),r=i(()=>{let g=C(),w=window.getSelection(),{activeElement:v}=document;if(g==null){o(null);return}let x=t.getRootElement();if(N(g)&&x!==null&&w!==null&&x.contains(w.anchorNode)){let R=O(g.anchor.getNode());if(R==null){o(null);return}let b=t.getElementByKey(R.getKey());if(b==null){o(null);return}b.classList.add(...T.focused),o(R),p(b),f(b)}else v||o(null)},[t,p]);D(()=>t.registerUpdateListener(()=>{t.getEditorState().read(()=>{r()})}),[t,r]),D(function(){return s?.classList.add(...T.focused),function(){s?.classList.remove(...T.focused)}},[s?.classList,e]);let F=()=>{f(null),o(null)};return A.createElement(S,{ref:d,open:e!==null,style:{top:l??"",left:n??"",position:I},...c({})},A.createElement(X,{editor:t,tableCellNode:e,onComplete:F}))}export{ae as a};
|
package/dist/chunk-U7COOUR6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import B from"react";import{Dropdown as N}from"@salt-ds/lab";import{$createCodeNode as p}from"@lexical/code";import{INSERT_ORDERED_LIST_COMMAND as C,INSERT_UNORDERED_LIST_COMMAND as k}from"@lexical/list";import{$createHeadingNode as H,$createQuoteNode as x}from"@lexical/rich-text";import{$wrapNodes as n}from"@lexical/selection";import{$createParagraphNode as E,$getSelection as a,$isRangeSelection as r}from"lexical";var L=o=>o?o.name:"",i=[{name:"Heading 1",type:"h1"},{name:"Heading 2",type:"h2"},{name:"Heading 3",type:"h3"},{name:"Heading 4",type:"h4"},{name:"Heading 5",type:"h5"},{name:"Heading 6",type:"h6"}],c=[{name:"Bulleted List",type:"bullet"},{name:"Code Block",type:"code"},...i,{name:"Numbered List",type:"number"},{name:"Paragraph",type:"paragraph"},{name:"Quote",type:"quote"}];function Q({editor:o,type:d}){let s=t=>{t.type==="paragraph"&&o.update(()=>{let e=a();r(e)&&n(e,()=>E())})},l=t=>{i.findIndex(e=>e.type===t.type)>=0&&o.update(()=>{let e=a();r(e)&&n(e,()=>H(t.type))})},m=t=>{t.type==="bullet"&&o.dispatchCommand(k,void 0)},u=t=>{t.type==="number"&&o.dispatchCommand(C,void 0)},y=t=>{t.type==="quote"&&o.update(()=>{let e=a();r(e)&&n(e,()=>x())})},f=t=>{t.type==="code"&&o.update(()=>{let e=a();if(r(e))if(e.isCollapsed())n(e,()=>p());else{let T=e.getTextContent(),h=p();e.removeText(),e.insertNodes([h]),e.insertRawText(T)}})},g=(t,e)=>{!e||(s(e),l(e),m(e),u(e),y(e),f(e))},S=c.findIndex(t=>t.type===d);return B.createElement(N,{ListProps:{width:200},defaultSelected:c[S],itemToString:L,onSelectionChange:g,source:c,width:132})}export{Q as a};
|
package/dist/chunk-UFRXMSJP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-VDGHHU3F.js";import{a as D}from"./chunk-R2MEEU32.js";import{a as P}from"./chunk-M4ISRNFD.js";import{a as b}from"./chunk-3LGZ7Z7G.js";import{a as k}from"./chunk-HIIAB4W2.js";import{c as C,d as S}from"./chunk-G57W376H.js";import e,{useState as f}from"react";import T from"md5";import{useLexicalComposerContext as G}from"@lexical/react/LexicalComposerContext";import{$convertToMarkdownString as O}from"@lexical/markdown";import{Link as $,P2 as w,Button as v}from"@jpmorganchase/mosaic-components";import{DialogHeader as J,DialogContent as U,DialogActions as V}from"@salt-ds/core";import{ButtonBar as _}from"@salt-ds/lab";var j=({isRaising:g,prHref:l,error:c})=>!g&&!l&&!c?e.createElement(e.Fragment,null,e.createElement(w,null,"The content of this page resides in a Git repository and to update it requires a Pull Request which will be reviewed by the content owners."),e.createElement("br",null),e.createElement(w,null,"Should you decide to stop editing before creating the Pull Request then all changes will be lost.")):null,ie=({meta:g,persistUrl:l})=>{let{pageState:c,setPageState:B}=C(),{user:d}=S(),[q]=G(),[s,t]=f(!1),[r,n]=f(null),[i,m]=f(null),[E,a]=f([]),p=c==="SAVING",I=r!==null?"success":"info",h=o=>{t(o),o||(B("EDIT"),n(null),a([]))},M=()=>{h(!1)},x=o=>{m(o||"Sorry - an unexpected error has occurred"),n(null),a([]),t(!1)},H=o=>{n(o.message?.links?.self[0]?.href),t(!1)},A=o=>{a(u=>[...u,o])},{sendWorkflowProgressMessage:L}=b(p,x,A,H),N=()=>{t(!0),n(null),m(null);try{q.update(()=>{let o=O(P);if(o&&d&&l){let{sid:u,displayName:W,email:F}=d;L(JSON.stringify({user:{sid:u,name:W,email:F},route:g.route,markdown:o,name:"save"}),T(`${u.toLowerCase()} - save`))}})}catch{m("Sorry - an unexpected error has occurred"),n(null),t(!1),a([])}};return e.createElement(k,{onOpenChange:h,open:p,status:i?"error":I},e.createElement(J,{className:D.title,header:r?"Pull Request Created Successfully":"Save Changes"}),e.createElement(U,null,(s||i)&&!r&&e.createElement(y,{error:i,progress:E}),e.createElement(j,{isRaising:s,prHref:r,error:i}),!s&&r&&e.createElement($,{href:r,target:"_blank"},"A Pull Request for your changes has been created")),e.createElement(V,null,e.createElement(_,null,e.createElement(v,{disabled:s,onClick:M},r?"Done":"Cancel"),e.createElement(v,{disabled:l===void 0||s||r!==null,onClick:N,variant:"cta"},"Raise Pull Request"))))};export{ie as a};
|
package/dist/chunk-YDLF23AQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-KZXCNQER.js";import{a as I}from"./chunk-YBFKG74H.js";import{a as v}from"./chunk-HIIAB4W2.js";import{a as h}from"./chunk-3QIETKQW.js";import e,{useState as i}from"react";import{useLexicalComposerContext as M}from"@lexical/react/LexicalComposerContext";import{Button as c,Icon as P}from"@jpmorganchase/mosaic-components";import{string as C,object as V}from"yup";import{Input as S,FormField as D,FormFieldLabel as y,FormFieldHelperText as A,DialogHeader as q,DialogContent as w,DialogActions as H}from"@salt-ds/core";import{ButtonBar as L}from"@salt-ds/lab";var B=V({alt:C().required("Alternative Information is a required field").max(100,"Alternative Information must be fewer than 100 characters"),url:C().required("Url is required").url("Must be a valid Url")}),E={url:"https://"},Y=()=>{let[x]=M(),[s,m]=i(!1),[r,u]=i(E),[n,d]=i(),f=t=>{m(t),t||u(E)},O=()=>m(!0),p=()=>{f(!1)},g=t=>{let o=t.inner.reduce((l,{path:a,message:T})=>({...l,[a]:T}),{});d(o)},F=t=>{let{name:o,value:l}=t.target,a={...r,[o]:l};B.validateAt(o,a,{abortEarly:!1}).then(()=>{d({...n,[o]:void 0})},g),u(a)};return e.createElement(e.Fragment,null,e.createElement(h,{active:s,onClick:O,label:"Insert Image"},e.createElement(P,{name:"addDocument"})),e.createElement(v,{onOpenChange:f,open:s},e.createElement("form",{onSubmit:async t=>{t.preventDefault(),B.validate(r,{abortEarly:!1}).then(()=>{let o={alt:r&&r.alt!==void 0?r.alt:null,url:r&&r.url!==void 0?r.url:null};x.dispatchCommand(I,o),p()},g)},noValidate:!0},e.createElement(q,{header:"Insert Image"}),e.createElement(w,null,e.createElement("div",{className:b.fullWidth},e.createElement(D,{validationStatus:n?.url?"error":void 0},e.createElement(y,null,"Url for image"),e.createElement(S,{value:r?.url,inputProps:{name:"url"},onChange:F}),e.createElement(A,null,n?.url)),e.createElement(D,{validationStatus:n?.alt?"error":void 0},e.createElement(y,null,"Alternative Information (alt)"),e.createElement(S,{value:r?.alt,inputProps:{name:"alt"},onChange:F}),e.createElement(A,null,n?.alt||"Provides alternative information for the image if for some reason it cannot be viewed")))),e.createElement(H,null,e.createElement(L,null,e.createElement(c,{onClick:p},"Cancel"),e.createElement(c,{variant:"cta",type:"submit"},"Insert"))))))};export{Y as a};
|