@jpmorganchase/mosaic-content-editor-plugin 0.1.0-beta.85 → 0.1.0-beta.86
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-D52GUU7B.js → chunk-4WQY35WP.js} +1 -1
- package/dist/{chunk-NVIOZAGI.js → chunk-A4MK7DWC.js} +1 -1
- package/dist/chunk-ALTQB32G.js +1 -0
- package/dist/{chunk-D3DKHTOM.js → chunk-ASSMGKX7.js} +1 -1
- package/dist/chunk-C4YKRNTE.js +1 -0
- package/dist/{chunk-YNDZSSVG.js → chunk-EJNETIR7.js} +1 -1
- package/dist/chunk-GPQMMCD6.js +1 -0
- package/dist/chunk-HYJBQWTN.js +1 -0
- package/dist/{chunk-D6HBLMCI.js → chunk-NMUKAFKJ.js} +1 -1
- package/dist/{chunk-7U5DZAEZ.js → chunk-O33BGIHC.js} +1 -1
- package/dist/chunk-S4GWHJPA.js +1 -0
- package/dist/components/ContentEditor.js +1 -1
- package/dist/components/Editor.js +1 -1
- package/dist/components/PersistEditDialog/index.js +1 -1
- package/dist/components/Toolbar/InsertBlockDropdown.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.css.d.ts +6 -6
- package/dist/plugins/TableActionMenuPlugin.js +1 -1
- package/dist/theme/index.css.js +1 -1
- package/dist/theme/index.js +1 -1
- package/package.json +13 -16
- package/dist/chunk-ASAOLXHV.js +0 -1
- package/dist/chunk-CJ3SO6PL.js +0 -1
- package/dist/chunk-PXUVNH4P.js +0 -1
- package/dist/chunk-YQC6J6PL.js +0 -1
- package/dist/chunk-ZFWSNE72.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-NMUKAFKJ.js";import{c as b}from"./chunk-S4GWHJPA.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 as E}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-O33BGIHC.js";import{a as y}from"./chunk-ALTQB32G.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-C4YKRNTE.js";import{a as h}from"./chunk-ASSMGKX7.js";import{a as k}from"./chunk-QKOQTH4L.js";import{a as P}from"./chunk-RO6ARCLZ.js";import{a as b}from"./chunk-4WQY35WP.js";import{b as S}from"./chunk-S4GWHJPA.js";import{a as T}from"./chunk-FKL4ZGDB.js";import{a as g}from"./chunk-HYJBQWTN.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 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 o,{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?o.createElement(o.Fragment,null,o.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."),o.createElement("br",null),o.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=e=>{t(e),e||(q("EDIT"),n(null),a([]))},x=()=>{h(!1)},H=e=>{d(e||"Sorry - an unexpected error has occurred"),n(null),a([]),t(!1)},A=e=>{n(e.message?.links?.self[0]?.href||e),t(!1)},L=e=>{a(u=>[...u,e])},{sendWorkflowProgressMessage:N}=b(p,H,L,A),W=()=>{t(!0),n(null),d(null);try{E.update(()=>{let e=O(P);if(e&&m&&l){let{sid:u,displayName:B,email:F}=m;N(JSON.stringify({user:{sid:u,name:B,email:F},route:g.route,markdown:e,name:"save"}),T(`${u.toLowerCase()} - save`))}})}catch{d("Sorry - an unexpected error has occurred"),n(null),t(!1),a([])}};return o.createElement(k,{onOpenChange:h,open:p,status:i?"error":M},o.createElement(J,{className:D.title,header:r?"Pull Request Created Successfully":"Save Changes"}),o.createElement(U,null,(s||i)&&!r&&o.createElement(y,{error:i,progress:I}),o.createElement(_,{isRaising:s,prHref:r,error:i}),!s&&r&&o.createElement($,{href:r,target:"_blank"},"A Pull Request for your changes has been created")),o.createElement(V,null,o.createElement(v,{disabled:s,onClick:x},r?"Done":"Cancel"),o.createElement(v,{disabled:l===void 0||s||r!==null,onClick:W,variant:"cta"},"Raise Pull Request")))};export{ne as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-EJNETIR7.js";var l={paragraph:e.paragraph,quote:e.quote,link:e.link,table:e.table,tableCell:e.tableCell,tableCellHeader:e.tableHeader,tableRow:e.tableRow,text:{bold:e.bold,italic:e.italic,strikethrough:e.strikeThrough,underline:e.underline,underlineStrikethrough:e.underlineStrikeThrough}},r=l;export{r 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,$getElementForTableNode 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 H,useInteractions as j}from"@floating-ui/react";var q=[{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 z({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:q,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}=j([H(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(z,{editor:t,tableCellNode:e,onComplete:v}))}export{le as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var u={bold:"_16n1zmy0",italic:"_16n1zmy1",underline:"_16n1zmy2",strikeThrough:"_16n1zmy3",underlineStrikeThrough:"_16n1zmy4",link:"pdl72e4 pdl72e5 pdl72e6 pdl72e7 _1loq8ls2 _1loq8ls1
|
|
1
|
+
var u={bold:"_16n1zmy0",italic:"_16n1zmy1",underline:"_16n1zmy2",strikeThrough:"_16n1zmy3",underlineStrikeThrough:"_16n1zmy4",link:"pdl72e4 pdl72e5 pdl72e6 pdl72e7 _1loq8ls2 _1loq8ls1 _651s9q2c _651s9q2i _651s9q2v _651s9q2w _651s9q32 _651s9q3f",paragraph:"_1az2uze1 _1az2uze7 _1az2uze9 _1az2uzea pdl72e4 pdl72e5 pdl72e6 pdl72e7",quote:"_1td1ted1 _1lx6g9221 _1lx6g92g _1lx6g9210 _1lx6g921c _1lx6g921k pdl72e4 pdl72e5 pdl72e6 pdl72e7 pdl72ee0 pdl72ee1 pdl72ee2 pdl72ee3",table:"u4bxikj u4bxik0 u4bxik5 u4bxika u4bxikf pdl72e4 pdl72e5 pdl72e6 pdl72e7",tableCell:"q99eu4i _1az2uze3 _1az2uze7 _1az2uze9 _1az2uzea pdl72e4 pdl72e5 pdl72e6 pdl72e7 pdl72e7o pdl72e7p pdl72e7q pdl72e7r pdl72eb8 pdl72eb9 pdl72eba pdl72ebb pdl72ed4 pdl72ed5 pdl72ed6 pdl72ed7 pdl72e9k pdl72e9l pdl72e9m pdl72e9n q99eu40 q99eu45 q99eu4a q99eu4f fxs0xn ueedq71k ueedq71l ueedq71m ueedq71n ueedq71o ueedq71p ueedq71q ueedq71r ueedq77c ueedq784 ueedq78 ueedq79 ueedq7a ueedq7b ueedq7c ueedq7d ueedq7e ueedq7f _16n1zmy9",tableHeader:"_1klzrv10 _1az2uze2 _1az2uze6 _1az2uze9 _1az2uzea pdl72e4 pdl72e5 pdl72e6 pdl72e7 pdl72e7o pdl72e7p pdl72e7q pdl72e7r pdl72eb8 pdl72eb9 pdl72eba pdl72ebb pdl72ed4 pdl72ed5 pdl72ed6 pdl72ed7 pdl72e9k pdl72e9l pdl72e9m pdl72e9n",tableRow:"fxs0xn ueedq71k ueedq71l ueedq71m ueedq71n ueedq71o ueedq71p ueedq71q ueedq71r ueedq77c ueedq784 ueedq71xc ueedq71xd ueedq71xe ueedq71xf ueedq71xg ueedq71xh ueedq71xi ueedq71xj ueedq78 ueedq79 ueedq7a ueedq7b ueedq7c ueedq7d ueedq7e ueedq7f _16n1zmyc"};export{u 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{$setBlocksType 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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as t from"react";import{RichTextPlugin as o}from"@lexical/react/LexicalRichTextPlugin";import{ContentEditable as r}from"@lexical/react/LexicalContentEditable";import{LexicalErrorBoundary as e}from"@lexical/react/LexicalErrorBoundary";var i=()=>t.createElement(o,{contentEditable:t.createElement(r,null),placeholder:t.createElement("div",null,"Enter some text..."),ErrorBoundary:e}),m=i;export{m 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-GPQMMCD6.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 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-
|
|
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-NMUKAFKJ.js";import{c as p}from"./chunk-S4GWHJPA.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 C}from"./chunk-WZYDYWT3.js";import{a as k}from"./chunk-HIIAB4W2.js";import{a as I}from"./chunk-3QIETKQW.js";import{e as f}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{$createTextNode as U,$getSelection as j,$insertNodes as Y,$isRangeSelection as z,$isTextNode as J,COMMAND_PRIORITY_EDITOR as Q,createCommand as X}from"lexical";import Z,{useCallback as R,useEffect as ee}from"react";import e,{useEffect as P,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 B,DialogActions as w,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")}),pe=()=>{let{isInsertingLink:t,setIsInsertingLink:r}=f();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:i}=f(),[o,s]=F(v),[a,l]=F(),m=n=>{i(n),n||(l(void 0),s(v))},g=()=>{m(!1)};P(()=>{t.getEditorState().read(()=>{if(r){let n=q();if(H(n)){let d=n.getTextContent();s(u=>({...u,text:d}))}}})},[t,r]);let x=n=>{let d=n.inner.reduce((u,{path:c,message:O})=>({...u,[c]:O}),{});l(d)},L=n=>{let{name:d,value:u}=n.target,c={...o,[d]:u};b.validateAt(d,c,{abortEarly:!1}).then(()=>{l({...a,[d]:void 0})},x),s(c)},M=async()=>{b.validate(o,{abortEarly:!1}).then(()=>{let n={url:o?.url,text:o?.text};t.dispatchCommand(p,n),g()},x)};return e.createElement(k,{onOpenChange:m,open:r},e.createElement(K,{header:"Insert Link"}),e.createElement(B,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(w,null,e.createElement(N,{onClick:g},"Cancel"),e.createElement(N,{variant:"cta",onClick:M},"Insert")))};var p=X();function te(){let[t]=G(),r=R(({url:i,text:o})=>{t.update(()=>{let s=j();if(z(s)&&i!==void 0&&o!==void 0){let a=s.focus.getNode();if(J(a))t.dispatchCommand(W,i);else{let l=V(i),m=U(o);m.setFormat(s.focus.getNode().getFormat()),l.append(m),Y([l]),l.selectEnd()}}})},[t]);ee(()=>t.registerCommand(p,i=>(r(i),!0),Q),[t,r])}function Ne(){return te(),Z.createElement(y,null)}export{p as a,Ne as b,pe as c,y as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-HYJBQWTN.js";export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"../chunk-
|
|
1
|
+
import{b as a}from"../chunk-A4MK7DWC.js";import"../chunk-O33BGIHC.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-ALTQB32G.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-C4YKRNTE.js";import"../chunk-B3KKU2QV.js";import"../chunk-6YPAVQF4.js";import"../chunk-ASSMGKX7.js";import"../chunk-EJNETIR7.js";import"../chunk-PC66Q33O.js";import"../chunk-QKOQTH4L.js";import"../chunk-FW7CHFWO.js";import"../chunk-3LGZ7Z7G.js";import"../chunk-RO6ARCLZ.js";import"../chunk-4WQY35WP.js";import"../chunk-NMUKAFKJ.js";import"../chunk-SOMQOHNT.js";import"../chunk-GPQMMCD6.js";import"../chunk-S4GWHJPA.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-HYJBQWTN.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-ALTQB32G.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-GPQMMCD6.js";export{a as InsertBlockDropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,d as b}from"../../chunk-
|
|
1
|
+
import{c as a,d as b}from"../../chunk-S4GWHJPA.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-NMUKAFKJ.js";import"../../chunk-SOMQOHNT.js";import"../../chunk-GPQMMCD6.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-O33BGIHC.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-NMUKAFKJ.js";import"../../chunk-SOMQOHNT.js";import"../../chunk-GPQMMCD6.js";import"../../chunk-S4GWHJPA.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-A4MK7DWC.js";import"./chunk-O33BGIHC.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-ALTQB32G.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-C4YKRNTE.js";import"./chunk-B3KKU2QV.js";import"./chunk-6YPAVQF4.js";import"./chunk-ASSMGKX7.js";import"./chunk-EJNETIR7.js";import"./chunk-PC66Q33O.js";import"./chunk-QKOQTH4L.js";import"./chunk-FW7CHFWO.js";import"./chunk-3LGZ7Z7G.js";import"./chunk-RO6ARCLZ.js";import"./chunk-4WQY35WP.js";import"./chunk-NMUKAFKJ.js";import"./chunk-SOMQOHNT.js";import"./chunk-GPQMMCD6.js";import"./chunk-S4GWHJPA.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-HYJBQWTN.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-4WQY35WP.js";import"../chunk-NMUKAFKJ.js";import"../chunk-SOMQOHNT.js";import"../chunk-GPQMMCD6.js";import"../chunk-S4GWHJPA.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-S4GWHJPA.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-A4MK7DWC.js";import"../chunk-O33BGIHC.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-ALTQB32G.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-C4YKRNTE.js";import"../chunk-B3KKU2QV.js";import"../chunk-6YPAVQF4.js";import"../chunk-ASSMGKX7.js";import"../chunk-EJNETIR7.js";import"../chunk-PC66Q33O.js";import"../chunk-QKOQTH4L.js";import"../chunk-FW7CHFWO.js";import"../chunk-3LGZ7Z7G.js";import"../chunk-RO6ARCLZ.js";import"../chunk-4WQY35WP.js";import"../chunk-NMUKAFKJ.js";import"../chunk-SOMQOHNT.js";import"../chunk-GPQMMCD6.js";import"../chunk-S4GWHJPA.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-HYJBQWTN.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};
|
|
@@ -9,8 +9,8 @@ export declare const outlineProperties: {
|
|
|
9
9
|
[x: `var(--${string})`]: {
|
|
10
10
|
defaultClass: string;
|
|
11
11
|
conditions: {
|
|
12
|
-
lightMode: string;
|
|
13
12
|
darkMode: string;
|
|
13
|
+
lightMode: string;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
};
|
|
@@ -20,15 +20,15 @@ export declare const outlineProperties: {
|
|
|
20
20
|
dashed: {
|
|
21
21
|
defaultClass: string;
|
|
22
22
|
conditions: {
|
|
23
|
-
lightMode: string;
|
|
24
23
|
darkMode: string;
|
|
24
|
+
lightMode: string;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
solid: {
|
|
28
28
|
defaultClass: string;
|
|
29
29
|
conditions: {
|
|
30
|
-
lightMode: string;
|
|
31
30
|
darkMode: string;
|
|
31
|
+
lightMode: string;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
};
|
|
@@ -38,22 +38,22 @@ export declare const outlineProperties: {
|
|
|
38
38
|
medium: {
|
|
39
39
|
defaultClass: string;
|
|
40
40
|
conditions: {
|
|
41
|
-
lightMode: string;
|
|
42
41
|
darkMode: string;
|
|
42
|
+
lightMode: string;
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
thick: {
|
|
46
46
|
defaultClass: string;
|
|
47
47
|
conditions: {
|
|
48
|
-
lightMode: string;
|
|
49
48
|
darkMode: string;
|
|
49
|
+
lightMode: string;
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
thin: {
|
|
53
53
|
defaultClass: string;
|
|
54
54
|
conditions: {
|
|
55
|
-
lightMode: string;
|
|
56
55
|
darkMode: string;
|
|
56
|
+
lightMode: string;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-C4YKRNTE.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/dist/theme/index.css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-EJNETIR7.js";export{a as default};
|
package/dist/theme/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-ASSMGKX7.js";import"../chunk-EJNETIR7.js";export{a as default};
|
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.86",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "",
|
|
7
7
|
"repository": {
|
|
@@ -35,32 +35,29 @@
|
|
|
35
35
|
"dev": "node ../../scripts/bundle.js watch"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
39
|
-
"@testing-library/react": "^13.4.0",
|
|
40
|
-
"@testing-library/user-event": "^14.0.0",
|
|
41
38
|
"typescript": "^4.8.3"
|
|
42
39
|
},
|
|
43
40
|
"dependencies": {
|
|
44
|
-
"@jpmorganchase/mosaic-components": "^0.1.0-beta.
|
|
45
|
-
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.
|
|
41
|
+
"@jpmorganchase/mosaic-components": "^0.1.0-beta.86",
|
|
42
|
+
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.86",
|
|
46
43
|
"@salt-ds/core": "^1.33.0",
|
|
47
44
|
"@salt-ds/icons": "^1.12.1",
|
|
48
45
|
"@salt-ds/lab": "1.0.0-alpha.50",
|
|
49
46
|
"@salt-ds/theme": "^1.19.0",
|
|
50
47
|
"@floating-ui/react": "^0.26.6",
|
|
51
|
-
"@lexical/code": "^0.
|
|
52
|
-
"@lexical/link": "^0.
|
|
53
|
-
"@lexical/list": "^0.
|
|
54
|
-
"@lexical/rich-text": "^0.
|
|
55
|
-
"@lexical/table": "^0.
|
|
56
|
-
"@lexical/react": "^0.
|
|
57
|
-
"@lexical/selection": "^0.
|
|
58
|
-
"@lexical/utils": "^0.
|
|
59
|
-
"@lexical/markdown": "^0.
|
|
48
|
+
"@lexical/code": "^0.17.1",
|
|
49
|
+
"@lexical/link": "^0.17.1",
|
|
50
|
+
"@lexical/list": "^0.17.1",
|
|
51
|
+
"@lexical/rich-text": "^0.17.1",
|
|
52
|
+
"@lexical/table": "^0.17.1",
|
|
53
|
+
"@lexical/react": "^0.17.1",
|
|
54
|
+
"@lexical/selection": "^0.17.1",
|
|
55
|
+
"@lexical/utils": "^0.17.1",
|
|
56
|
+
"@lexical/markdown": "^0.17.1",
|
|
60
57
|
"@vanilla-extract/css": "^1.6.0",
|
|
61
58
|
"clsx": "^2.0.0",
|
|
62
59
|
"gray-matter": "^4.0.3",
|
|
63
|
-
"lexical": "^0.
|
|
60
|
+
"lexical": "^0.17.1",
|
|
64
61
|
"react-split": "^2.0.14",
|
|
65
62
|
"lodash-es": "^4.17.21",
|
|
66
63
|
"md5": "*",
|
package/dist/chunk-ASAOLXHV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-CJ3SO6PL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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};
|
package/dist/chunk-PXUVNH4P.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"react";import{RichTextPlugin as o}from"@lexical/react/LexicalRichTextPlugin";import{ContentEditable as r}from"@lexical/react/LexicalContentEditable";import e from"@lexical/react/LexicalErrorBoundary";var i=()=>t.createElement(o,{contentEditable:t.createElement(r,null),placeholder:t.createElement("div",null,"Enter some text..."),ErrorBoundary:e}),m=i;export{m as a};
|
package/dist/chunk-YQC6J6PL.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";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};
|
package/dist/chunk-ZFWSNE72.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 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};
|