@jpmorganchase/mosaic-content-editor-plugin 0.1.0-beta.71 → 0.1.0-beta.72
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/chunk-55WG3HBR.js +1 -0
- package/dist/chunk-HIIAB4W2.js +1 -0
- package/dist/{chunk-7O2SLISS.js → chunk-JLXXPRWJ.js} +1 -1
- package/dist/{chunk-CBQZGN4Y.js → chunk-U52GJYI4.js} +1 -1
- package/dist/chunk-UFRXMSJP.js +1 -0
- package/dist/{chunk-WOLMNJ7G.js → chunk-X5M73NRM.js} +1 -1
- package/dist/chunk-YDLF23AQ.js +1 -0
- package/dist/components/Dialog.d.ts +1 -1
- package/dist/components/Dialog.js +1 -1
- package/dist/components/Editor.js +1 -1
- package/dist/components/PersistEditDialog/index.js +1 -1
- package/dist/components/Toolbar/InsertImage.js +1 -1
- package/dist/components/Toolbar/InsertLink.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/package.json +6 -6
- package/src/components/Dialog.tsx +1 -1
- package/src/components/PersistEditDialog/index.tsx +6 -4
- package/src/components/Toolbar/InsertImage.tsx +11 -3
- package/src/components/Toolbar/InsertLink.tsx +11 -3
- package/dist/chunk-CXTIKD2Y.js +0 -1
- package/dist/chunk-EPOQVSZ5.js +0 -1
- package/dist/chunk-LQBKKB6A.js +0 -1
- package/dist/chunk-XSZUCLBY.js +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@jpmorganchase/mosaic-content-editor-plugin:build: cache hit, replaying output
|
|
1
|
+
@jpmorganchase/mosaic-content-editor-plugin:build: cache hit, replaying output 6a1d577b57c03ea8
|
|
2
2
|
@jpmorganchase/mosaic-content-editor-plugin:build: $ npm-run-all --parallel build:*
|
|
3
3
|
@jpmorganchase/mosaic-content-editor-plugin:build: $ node ../../scripts/bundle.js
|
|
4
4
|
@jpmorganchase/mosaic-content-editor-plugin:build: $ tsc
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @jpmorganchase/mosaic-content-editor-plugin
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.72
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e5d14ab4: Upgraded Salt packages to:
|
|
8
|
+
|
|
9
|
+
@salt-ds/core@1.22.0
|
|
10
|
+
@salt-ds/lab@1.0.0-alpha.38
|
|
11
|
+
@salt-ds/theme@1.13.1
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [e5d14ab4]
|
|
14
|
+
- @jpmorganchase/mosaic-components@0.1.0-beta.72
|
|
15
|
+
- @jpmorganchase/mosaic-theme@0.1.0-beta.72
|
|
16
|
+
|
|
3
17
|
## 0.1.0-beta.71
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -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 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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-OW5SK4AJ.js";import s from"react";import{Dialog as t}from"@salt-ds/core";import{themeClassName as l}from"@jpmorganchase/mosaic-theme";import i from"clsx";var f=({className:a,...r})=>s.createElement(t,{className:i(l,o.root,a),...r});export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-5KRV6UWE.js";import{c as b}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-5KRV6UWE.js";import{c as b}from"./chunk-55WG3HBR.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 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-YDLF23AQ.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-5KRV6UWE.js";import{c as p}from"./chunk-55WG3HBR.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 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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-U52GJYI4.js";import{a as y}from"./chunk-UFRXMSJP.js";import{a as f}from"./chunk-UWF3FV3R.js";import{a as x}from"./chunk-HKW725NN.js";import{a}from"./chunk-M4ISRNFD.js";import{b as w}from"./chunk-YBFKG74H.js";import{a as M}from"./chunk-ROQUYURQ.js";import{a as h}from"./chunk-3FJGHVH5.js";import{a as k}from"./chunk-QKOQTH4L.js";import{a as P}from"./chunk-RO6ARCLZ.js";import{a as b}from"./chunk-JLXXPRWJ.js";import{b as S}from"./chunk-55WG3HBR.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 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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type DialogProps as SaltDialogProps } from '@salt-ds/
|
|
2
|
+
import { type DialogProps as SaltDialogProps } from '@salt-ds/core';
|
|
3
3
|
interface DialogProps extends SaltDialogProps {
|
|
4
4
|
}
|
|
5
5
|
export declare const Dialog: ({ className, ...props }: DialogProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-HIIAB4W2.js";import"../chunk-OW5SK4AJ.js";export{a as Dialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"../chunk-
|
|
1
|
+
import{b as a}from"../chunk-X5M73NRM.js";import"../chunk-U52GJYI4.js";import"../chunk-4B2NDAA2.js";import"../chunk-4LQ77YZW.js";import"../chunk-DLRFTDUZ.js";import"../chunk-YDLF23AQ.js";import"../chunk-KZXCNQER.js";import"../chunk-DXTVYP7D.js";import"../chunk-NFA3MZOC.js";import"../chunk-UFRXMSJP.js";import"../chunk-VDGHHU3F.js";import"../chunk-R2MEEU32.js";import"../chunk-UWF3FV3R.js";import"../chunk-KQ2ZCDYD.js";import"../chunk-HKW725NN.js";import"../chunk-BFF3MNBV.js";import"../chunk-5YCBSSDA.js";import"../chunk-NFSXCTUU.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-ROQUYURQ.js";import"../chunk-ESKW4XF6.js";import"../chunk-6YPAVQF4.js";import"../chunk-3FJGHVH5.js";import"../chunk-JQUDHJIQ.js";import"../chunk-PC66Q33O.js";import"../chunk-QKOQTH4L.js";import"../chunk-FW7CHFWO.js";import"../chunk-3LGZ7Z7G.js";import"../chunk-RO6ARCLZ.js";import"../chunk-JLXXPRWJ.js";import"../chunk-5KRV6UWE.js";import"../chunk-SOMQOHNT.js";import"../chunk-U7COOUR6.js";import"../chunk-55WG3HBR.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-UFRXMSJP.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-YDLF23AQ.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-55WG3HBR.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-U52GJYI4.js";import"../../chunk-4B2NDAA2.js";import"../../chunk-4LQ77YZW.js";import"../../chunk-DLRFTDUZ.js";import"../../chunk-YDLF23AQ.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-5KRV6UWE.js";import"../../chunk-SOMQOHNT.js";import"../../chunk-U7COOUR6.js";import"../../chunk-55WG3HBR.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-X5M73NRM.js";import"./chunk-U52GJYI4.js";import"./chunk-4B2NDAA2.js";import"./chunk-4LQ77YZW.js";import"./chunk-DLRFTDUZ.js";import"./chunk-YDLF23AQ.js";import"./chunk-KZXCNQER.js";import"./chunk-DXTVYP7D.js";import"./chunk-NFA3MZOC.js";import"./chunk-UFRXMSJP.js";import"./chunk-VDGHHU3F.js";import"./chunk-R2MEEU32.js";import"./chunk-UWF3FV3R.js";import"./chunk-KQ2ZCDYD.js";import"./chunk-HKW725NN.js";import"./chunk-BFF3MNBV.js";import"./chunk-5YCBSSDA.js";import"./chunk-NFSXCTUU.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-ROQUYURQ.js";import"./chunk-ESKW4XF6.js";import"./chunk-6YPAVQF4.js";import"./chunk-3FJGHVH5.js";import"./chunk-JQUDHJIQ.js";import"./chunk-PC66Q33O.js";import"./chunk-QKOQTH4L.js";import"./chunk-FW7CHFWO.js";import"./chunk-3LGZ7Z7G.js";import"./chunk-RO6ARCLZ.js";import"./chunk-JLXXPRWJ.js";import"./chunk-5KRV6UWE.js";import"./chunk-SOMQOHNT.js";import"./chunk-U7COOUR6.js";import"./chunk-55WG3HBR.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-JLXXPRWJ.js";import"../chunk-5KRV6UWE.js";import"../chunk-SOMQOHNT.js";import"../chunk-U7COOUR6.js";import"../chunk-55WG3HBR.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-55WG3HBR.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-X5M73NRM.js";import"../chunk-U52GJYI4.js";import"../chunk-4B2NDAA2.js";import"../chunk-4LQ77YZW.js";import"../chunk-DLRFTDUZ.js";import"../chunk-YDLF23AQ.js";import"../chunk-KZXCNQER.js";import"../chunk-DXTVYP7D.js";import"../chunk-NFA3MZOC.js";import"../chunk-UFRXMSJP.js";import"../chunk-VDGHHU3F.js";import"../chunk-R2MEEU32.js";import"../chunk-UWF3FV3R.js";import"../chunk-KQ2ZCDYD.js";import"../chunk-HKW725NN.js";import"../chunk-BFF3MNBV.js";import"../chunk-5YCBSSDA.js";import"../chunk-NFSXCTUU.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-ROQUYURQ.js";import"../chunk-ESKW4XF6.js";import"../chunk-6YPAVQF4.js";import"../chunk-3FJGHVH5.js";import"../chunk-JQUDHJIQ.js";import"../chunk-PC66Q33O.js";import"../chunk-QKOQTH4L.js";import"../chunk-FW7CHFWO.js";import"../chunk-3LGZ7Z7G.js";import"../chunk-RO6ARCLZ.js";import"../chunk-JLXXPRWJ.js";import"../chunk-5KRV6UWE.js";import"../chunk-SOMQOHNT.js";import"../chunk-U7COOUR6.js";import"../chunk-55WG3HBR.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};
|
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.72",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "",
|
|
7
7
|
"repository": {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"typescript": "^4.8.3"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@jpmorganchase/mosaic-components": "^0.1.0-beta.
|
|
42
|
-
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.
|
|
43
|
-
"@salt-ds/core": "^1.
|
|
41
|
+
"@jpmorganchase/mosaic-components": "^0.1.0-beta.72",
|
|
42
|
+
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.72",
|
|
43
|
+
"@salt-ds/core": "^1.22.0",
|
|
44
44
|
"@salt-ds/icons": "^1.9.1",
|
|
45
|
-
"@salt-ds/lab": "1.0.0-alpha.
|
|
46
|
-
"@salt-ds/theme": "^1.
|
|
45
|
+
"@salt-ds/lab": "1.0.0-alpha.37",
|
|
46
|
+
"@salt-ds/theme": "^1.13.1",
|
|
47
47
|
"@floating-ui/react": "^0.26.6",
|
|
48
48
|
"@lexical/code": "^0.11.1",
|
|
49
49
|
"@lexical/link": "^0.11.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Dialog as SaltDialog, type DialogProps as SaltDialogProps } from '@salt-ds/
|
|
2
|
+
import { Dialog as SaltDialog, type DialogProps as SaltDialogProps } from '@salt-ds/core';
|
|
3
3
|
import { themeClassName } from '@jpmorganchase/mosaic-theme';
|
|
4
4
|
import classnames from 'clsx';
|
|
5
5
|
|
|
@@ -3,7 +3,8 @@ import md5 from 'md5';
|
|
|
3
3
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
4
4
|
import { $convertToMarkdownString } from '@lexical/markdown';
|
|
5
5
|
import { Link, P2, Button } from '@jpmorganchase/mosaic-components';
|
|
6
|
-
import {
|
|
6
|
+
import { DialogHeader, DialogContent, DialogActions } from '@salt-ds/core';
|
|
7
|
+
import { ButtonBar } from '@salt-ds/lab';
|
|
7
8
|
import { SourceWorkflowMessageEvent } from '@jpmorganchase/mosaic-types';
|
|
8
9
|
|
|
9
10
|
import { useEditorUser, usePageState } from '../../store';
|
|
@@ -119,9 +120,10 @@ export const PersistDialog = ({ meta, persistUrl }: PersistDialogProps) => {
|
|
|
119
120
|
|
|
120
121
|
return (
|
|
121
122
|
<Dialog onOpenChange={handleOpenChange} open={open} status={error ? 'error' : state}>
|
|
122
|
-
<
|
|
123
|
-
{
|
|
124
|
-
|
|
123
|
+
<DialogHeader
|
|
124
|
+
className={style.title}
|
|
125
|
+
header={!prHref ? 'Save Changes' : 'Pull Request Created Successfully'}
|
|
126
|
+
/>
|
|
125
127
|
<DialogContent>
|
|
126
128
|
{(isRaising || error) && !prHref && <PersistStatus error={error} progress={progress} />}
|
|
127
129
|
<Info isRaising={isRaising} prHref={prHref} error={error} />
|
|
@@ -2,8 +2,16 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
3
3
|
import { Button, Icon } from '@jpmorganchase/mosaic-components';
|
|
4
4
|
import { string, object } from 'yup';
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
Input,
|
|
7
|
+
FormField,
|
|
8
|
+
FormFieldLabel,
|
|
9
|
+
FormFieldHelperText,
|
|
10
|
+
DialogHeader,
|
|
11
|
+
DialogContent,
|
|
12
|
+
DialogActions
|
|
13
|
+
} from '@salt-ds/core';
|
|
14
|
+
import { ButtonBar } from '@salt-ds/lab';
|
|
7
15
|
|
|
8
16
|
import { ToolbarButton } from './ToolbarButton';
|
|
9
17
|
import { Dialog } from '../Dialog';
|
|
@@ -97,7 +105,7 @@ export const InsertImage = () => {
|
|
|
97
105
|
|
|
98
106
|
<Dialog onOpenChange={handleOpenChange} open={isOpen}>
|
|
99
107
|
<form onSubmit={handleSubmit} noValidate>
|
|
100
|
-
<
|
|
108
|
+
<DialogHeader header="Insert Image" />
|
|
101
109
|
<DialogContent>
|
|
102
110
|
<div className={styles.fullWidth}>
|
|
103
111
|
<FormField validationStatus={errors?.url ? 'error' : undefined}>
|
|
@@ -2,8 +2,16 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
3
3
|
import { Button, Icon } from '@jpmorganchase/mosaic-components';
|
|
4
4
|
import { string, object } from 'yup';
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
Input,
|
|
7
|
+
FormField,
|
|
8
|
+
FormFieldLabel,
|
|
9
|
+
FormFieldHelperText,
|
|
10
|
+
DialogContent,
|
|
11
|
+
DialogActions,
|
|
12
|
+
DialogHeader
|
|
13
|
+
} from '@salt-ds/core';
|
|
14
|
+
import { ButtonBar } from '@salt-ds/lab';
|
|
7
15
|
import { $getSelection, $isRangeSelection } from 'lexical';
|
|
8
16
|
|
|
9
17
|
import { ToolbarButton } from './ToolbarButton';
|
|
@@ -112,7 +120,7 @@ export const InsertLinkDialog = () => {
|
|
|
112
120
|
|
|
113
121
|
return (
|
|
114
122
|
<Dialog onOpenChange={handleOpenChange} open={isInsertingLink}>
|
|
115
|
-
<
|
|
123
|
+
<DialogHeader header="Insert Link" />
|
|
116
124
|
<DialogContent>
|
|
117
125
|
<div className={styles.fullWidth}>
|
|
118
126
|
<FormField validationStatus={errors?.url ? 'error' : undefined}>
|
package/dist/chunk-CXTIKD2Y.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 h}from"./chunk-XSZUCLBY.js";import{a as v}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}from"@salt-ds/core";import{ButtonBar as q,DialogTitle as w,DialogContent as L,DialogActions as N}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[T]=M(),[s,m]=i(!1),[r,u]=i(E),[n,d]=i(),f=t=>{m(t),t||u(E)},x=()=>m(!0),p=()=>{f(!1)},g=t=>{let o=t.inner.reduce((l,{path:a,message:O})=>({...l,[a]:O}),{});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(v,{active:s,onClick:x,label:"Insert Image"},e.createElement(P,{name:"addDocument"})),e.createElement(h,{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};T.dispatchCommand(I,o),p()},g)},noValidate:!0},e.createElement(w,null,"Insert Image"),e.createElement(L,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(N,null,e.createElement(q,null,e.createElement(c,{onClick:p},"Cancel"),e.createElement(c,{variant:"cta",type:"submit"},"Insert"))))))};export{Y as a};
|
package/dist/chunk-EPOQVSZ5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as C}from"./chunk-WZYDYWT3.js";import{a as k}from"./chunk-XSZUCLBY.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 T,FormField as D,FormFieldLabel as S,FormFieldHelperText as E}from"@salt-ds/core";import{ButtonBar as $,DialogTitle as w,DialogContent as K,DialogActions as q}from"@salt-ds/lab";import{$getSelection as V,$isRangeSelection as H}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: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=V();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(w,null,"Insert Link"),e.createElement(K,null,e.createElement("div",{className:C.fullWidth},e.createElement(D,{validationStatus:a?.url?"error":void 0},e.createElement(S,null,"Image URL text"),e.createElement(T,{value:o?.url,inputProps:{name:"url"},onChange:L}),e.createElement(E,null,a?.url)),e.createElement(D,{validationStatus:a?.text?"error":void 0},e.createElement(S,null,"Link Text"),e.createElement(T,{value:o?.text,inputProps:{name:"text"},onChange:L}),e.createElement(E,null,a?.text)))),e.createElement(q,null,e.createElement($,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:s,text:o})=>{t.update(()=>{let i=J();if(Q(i)&&s!==void 0&&o!==void 0){let a=i.focus.getNode();if(X(a))t.dispatchCommand(G,s);else{let d=W(s),m=z(o);m.setFormat(i.focus.getNode().getFormat()),d.append(m),j(i,()=>d,Y())}}})},[t]);ne(()=>t.registerCommand(f,s=>(r(s),!0),Z),[t,r])}function Se(){return oe(),ee.createElement(y,null)}export{f as a,Se as b,Le as c,y as d};
|
package/dist/chunk-LQBKKB6A.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as k}from"./chunk-VDGHHU3F.js";import{a as y}from"./chunk-R2MEEU32.js";import{a as P}from"./chunk-M4ISRNFD.js";import{a as b}from"./chunk-3LGZ7Z7G.js";import{a as D}from"./chunk-XSZUCLBY.js";import{c as C,d as S}from"./chunk-G57W376H.js";import e,{useState as g}from"react";import F 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{ButtonBar as J,DialogTitle as U,DialogContent as V,DialogActions as _}from"@salt-ds/lab";var j=({isRaising:f,prHref:l,error:c})=>!f&&!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,le=({meta:f,persistUrl:l})=>{let{pageState:c,setPageState:B}=C(),{user:p}=S(),[q]=G(),[s,t]=g(!1),[r,n]=g(null),[i,m]=g(null),[E,a]=g([]),d=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)},T=o=>{n(o.message?.links?.self[0]?.href),t(!1)},A=o=>{a(u=>[...u,o])},{sendWorkflowProgressMessage:H}=b(d,x,A,T),L=()=>{t(!0),n(null),m(null);try{q.update(()=>{let o=O(P);if(o&&p&&l){let{sid:u,displayName:N,email:W}=p;H(JSON.stringify({user:{sid:u,name:N,email:W},route:f.route,markdown:o,name:"save"}),F(`${u.toLowerCase()} - save`))}})}catch{m("Sorry - an unexpected error has occurred"),n(null),t(!1),a([])}};return e.createElement(D,{onOpenChange:h,open:d,status:i?"error":I},e.createElement(U,{className:y.title},r?"Pull Request Created Successfully":"Save Changes"),e.createElement(V,null,(s||i)&&!r&&e.createElement(k,{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(_,null,e.createElement(J,null,e.createElement(v,{disabled:s,onClick:M},r?"Done":"Cancel"),e.createElement(v,{disabled:l===void 0||s||r!==null,onClick:L,variant:"cta"},"Raise Pull Request"))))};export{le as a};
|
package/dist/chunk-XSZUCLBY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-OW5SK4AJ.js";import s from"react";import{Dialog as t}from"@salt-ds/lab";import{themeClassName as l}from"@jpmorganchase/mosaic-theme";import i from"clsx";var f=({className:a,...r})=>s.createElement(t,{className:i(l,o.root,a),...r});export{f as a};
|