@jpmorganchase/mosaic-content-editor-plugin 0.1.0-beta.12 → 0.1.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- @jpmorganchase/mosaic-content-editor-plugin:build: cache hit, replaying output 8f0185f38842ccca
1
+ @jpmorganchase/mosaic-content-editor-plugin:build: cache hit, replaying output ec75f7c783ea6e0e
2
2
  @jpmorganchase/mosaic-content-editor-plugin:build: $ npm-run-all --parallel build:*
3
- @jpmorganchase/mosaic-content-editor-plugin:build: $ node ../../scripts/bundle.js
4
3
  @jpmorganchase/mosaic-content-editor-plugin:build: $ tsc
4
+ @jpmorganchase/mosaic-content-editor-plugin:build: $ node ../../scripts/bundle.js
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @jpmorganchase/mosaic-content-editor-plugin
2
2
 
3
+ ## 0.1.0-beta.14
4
+
5
+ ### Patch Changes
6
+
7
+ - dde3b5a: Feature release
8
+
9
+ - Enhanced generators now have defaults.
10
+ With one command (`yarn mosaic-create-site create`) it will generate a fully working site with both local and remote sources
11
+ - Fix an issue where we could not clone from the master branch of git repos
12
+ - Migrate to Next 13 image
13
+
14
+ - Updated dependencies [dde3b5a]
15
+ - @jpmorganchase/mosaic-components@0.1.0-beta.14
16
+ - @jpmorganchase/mosaic-theme@0.1.0-beta.14
17
+
18
+ ## 0.1.0-beta.13
19
+
20
+ ### Patch Changes
21
+
22
+ - d4da1df: incremental improvements
23
+
24
+ - move colormode into store
25
+ - ensure breadcrumbs and sidebar data is only added to frontmatter for pages which use a layout that has breadcrumbs or a sidebar
26
+ - improve changeset so it can work standalone without a monorepo
27
+ - resolev json5 vulnerability
28
+
29
+ - Updated dependencies [d4da1df]
30
+ - @jpmorganchase/mosaic-components@0.1.0-beta.13
31
+ - @jpmorganchase/mosaic-theme@0.1.0-beta.13
32
+
3
33
  ## 0.1.0-beta.12
4
34
 
5
35
  ### Patch Changes
@@ -1 +1 @@
1
- import{a as D}from"./chunk-YER34KSW.js";import{a as h}from"./chunk-XGBC7YGO.js";import{a as S}from"./chunk-FI57IKHZ.js";import{c as P,d as C}from"./chunk-KE4TEFFN.js";import e,{useState as d}from"react";import{useLexicalComposerContext as T}from"@lexical/react/LexicalComposerContext";import{$convertToMarkdownString as x}from"@lexical/markdown";import{Link as H,P2 as b,Button as w}from"@jpmorganchase/mosaic-components";import{Dialog as B,DialogTitle as E,DialogContent as L,DialogActions as F}from"@salt-ds/lab";var G=({isRaising:i,prHref:a,error:u})=>!i&&!a&&!u?e.createElement(e.Fragment,null,e.createElement(b,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(b,null,"Should you decide to stop editing before creating the Pull Request then all changes will be lost.")):null,Q=({meta:i})=>{let{pageState:a,setPageState:u}=P(),{user:p}=C(),[y]=T(),[r,s]=d(!1),[o,t]=d(null),[n,l]=d(null),k=a==="SAVING",q=o!==null?"success":"info",m=()=>{u("EDIT"),t(null),s(!1)};return e.createElement(B,{onClose:m,open:k,status:n?"error":q,width:"50%"},e.createElement(E,null,o?"Pull Request Created Successfully":"Save Changes"),e.createElement(L,null,(r||n)&&!o&&e.createElement(D,{isRaising:r,error:n}),e.createElement(G,{isRaising:r,prHref:o,error:n}),!r&&o&&e.createElement(H,{href:o,target:"_blank"},"A Pull Request for your changes has been created")),e.createElement(F,null,e.createElement(w,{disabled:r,onClick:m},"Cancel"),e.createElement(w,{disabled:r||o!==null,onClick:()=>{s(!0),t(null),l(null);try{y.update(async()=>{let f=x(h);if(f&&p){let{sid:I,displayName:v,email:A}=p,c=await S({sid:I,name:v,email:A},i.route,f);if(c.ok){let g=await c.json();g.error?(l(g.error),t(null),s(!1)):(t(g?.links?.self[0]?.href),s(!1))}c.status===500&&(l("An unexpected error has occurred."),t(null),s(!1))}})}catch{l("Sorry"),t(null),s(!1)}},variant:"cta"},"Raise Pull Request")))};export{Q as a};
1
+ import{a as D}from"./chunk-YER34KSW.js";import{a as h}from"./chunk-XGBC7YGO.js";import{a as S}from"./chunk-FI57IKHZ.js";import{c as P,d as C}from"./chunk-G57W376H.js";import e,{useState as d}from"react";import{useLexicalComposerContext as T}from"@lexical/react/LexicalComposerContext";import{$convertToMarkdownString as x}from"@lexical/markdown";import{Link as H,P2 as b,Button as w}from"@jpmorganchase/mosaic-components";import{Dialog as B,DialogTitle as E,DialogContent as L,DialogActions as F}from"@salt-ds/lab";var G=({isRaising:i,prHref:a,error:u})=>!i&&!a&&!u?e.createElement(e.Fragment,null,e.createElement(b,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(b,null,"Should you decide to stop editing before creating the Pull Request then all changes will be lost.")):null,Q=({meta:i})=>{let{pageState:a,setPageState:u}=P(),{user:p}=C(),[y]=T(),[r,s]=d(!1),[o,t]=d(null),[n,l]=d(null),k=a==="SAVING",q=o!==null?"success":"info",m=()=>{u("EDIT"),t(null),s(!1)};return e.createElement(B,{onClose:m,open:k,status:n?"error":q,width:"50%"},e.createElement(E,null,o?"Pull Request Created Successfully":"Save Changes"),e.createElement(L,null,(r||n)&&!o&&e.createElement(D,{isRaising:r,error:n}),e.createElement(G,{isRaising:r,prHref:o,error:n}),!r&&o&&e.createElement(H,{href:o,target:"_blank"},"A Pull Request for your changes has been created")),e.createElement(F,null,e.createElement(w,{disabled:r,onClick:m},"Cancel"),e.createElement(w,{disabled:r||o!==null,onClick:()=>{s(!0),t(null),l(null);try{y.update(async()=>{let f=x(h);if(f&&p){let{sid:I,displayName:v,email:A}=p,c=await S({sid:I,name:v,email:A},i.route,f);if(c.ok){let g=await c.json();g.error?(l(g.error),t(null),s(!1)):(t(g?.links?.self[0]?.href),s(!1))}c.status===500&&(l("An unexpected error has occurred."),t(null),s(!1))}})}catch{l("Sorry"),t(null),s(!1)}},variant:"cta"},"Raise Pull Request")))};export{Q as a};
@@ -1 +1 @@
1
- import{a as h}from"./chunk-RUQR4E6N.js";import{a as k}from"./chunk-FYR74YJH.js";import{a as f}from"./chunk-PZQ26XWS.js";import{a as b}from"./chunk-U22HX567.js";import{a as T}from"./chunk-4EAOB7YQ.js";import{a as y}from"./chunk-3FJGHVH5.js";import{a as s}from"./chunk-XGBC7YGO.js";import{a as M}from"./chunk-BXNO7GED.js";import{a as P}from"./chunk-RO6ARCLZ.js";import{a as F}from"./chunk-NLBFMDUH.js";import{a as x}from"./chunk-FKL4ZGDB.js";import{b as w}from"./chunk-YBFKG74H.js";import{b as E,d as S}from"./chunk-7FEXXQT5.js";import{a as g}from"./chunk-WCG3U3X2.js";import{a as t}from"./chunk-NXV7KCC5.js";import{a as C,d as v,f as p}from"./chunk-KE4TEFFN.js";import R from"react";import{$convertToMarkdownString as oo}from"@lexical/markdown";import{OnChangePlugin as ro}from"@lexical/react/LexicalOnChangePlugin";import to from"lodash/debounce";import o,{useRef as I,useState as $}from"react";import A from"classnames";import O from"gray-matter";import{LexicalComposer as U}from"@lexical/react/LexicalComposer";import{ListPlugin as X}from"@lexical/react/LexicalListPlugin";import{TablePlugin as W}from"@lexical/react/LexicalTablePlugin";import{LinkPlugin as j}from"@lexical/react/LexicalLinkPlugin";import{HistoryPlugin as q}from"@lexical/react/LexicalHistoryPlugin";import{MarkdownShortcutPlugin as G}from"@lexical/react/LexicalMarkdownShortcutPlugin";import J 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:y},Y=()=>{let r=document.createElement("div");return r.className=t.gutter,r},Z=({compileMDX:r,content:m,source:a,PreviewComponent:e,user:n,components:l})=>{let i=C()||a,{setUser:N}=v(),[u,d]=$(!1),z=I(null),{data:c,content:D}=O(m),B=()=>{d(!0),N(n)},H=()=>{d(!1)};return o.createElement(U,{initialConfig:{...V,editorState:()=>K(D,s)}},o.createElement("div",{className:t.root,onFocus:B,onBlur:H},o.createElement("div",{className:t.toolbarContainer},o.createElement(h,null),o.createElement(k,{meta:c}),o.createElement(M,null)),o.createElement("div",{className:t.editorRoot},o.createElement(J,{className:t.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:A({[t.focused]:u,[t.unfocused]:!u}),ref:z},o.createElement(g,null)),o.createElement(f,null,e&&o.createElement(e,{source:i,meta:c,components:l}))),o.createElement(q,null),o.createElement(X,null),o.createElement(W,null),o.createElement(j,null),o.createElement(G,{transformers:s}),r&&o.createElement(L,{compileMDX:r}),o.createElement(w,null),o.createElement(E,null),o.createElement(b,null),o.createElement(x,null),o.createElement(F,null),o.createElement(T,null),o.createElement(S,null))))},_=Z;function eo(r){let m=to(r,250,{maxWait:500});return{onChange:e=>{e.read(()=>{let n=oo(s);n&&m(n)})}}}var L=({compileMDX:r})=>{let{setErrorMessage:m,setPreviewContent:a}=p(),e=async l=>{try{let i=await r(l,!1);a(i)}catch(i){i instanceof Error&&m(`MDX Error: ${i.message}`)}},{onChange:n}=eo(e);return R.createElement(ro,{onChange:n,ignoreSelectionChange:!0})};export{L as a,_ as b};
1
+ import{a as h}from"./chunk-R5CYUKUL.js";import{a as k}from"./chunk-23MNBEVR.js";import{a as f}from"./chunk-PZQ26XWS.js";import{a as b}from"./chunk-U22HX567.js";import{a as T}from"./chunk-4EAOB7YQ.js";import{a as y}from"./chunk-3FJGHVH5.js";import{a as s}from"./chunk-XGBC7YGO.js";import{a as M}from"./chunk-YQHKK2ZS.js";import{a as P}from"./chunk-RO6ARCLZ.js";import{a as F}from"./chunk-6CF5IZPG.js";import{a as x}from"./chunk-FKL4ZGDB.js";import{b as w}from"./chunk-YBFKG74H.js";import{b as E,d as S}from"./chunk-OFHNZZ2E.js";import{a as g}from"./chunk-WCG3U3X2.js";import{a as t}from"./chunk-NXV7KCC5.js";import{a as C,d as v,f as p}from"./chunk-G57W376H.js";import R from"react";import{$convertToMarkdownString as oo}from"@lexical/markdown";import{OnChangePlugin as ro}from"@lexical/react/LexicalOnChangePlugin";import to from"lodash/debounce";import o,{useRef as I,useState as $}from"react";import A from"classnames";import O from"gray-matter";import{LexicalComposer as U}from"@lexical/react/LexicalComposer";import{ListPlugin as X}from"@lexical/react/LexicalListPlugin";import{TablePlugin as W}from"@lexical/react/LexicalTablePlugin";import{LinkPlugin as j}from"@lexical/react/LexicalLinkPlugin";import{HistoryPlugin as q}from"@lexical/react/LexicalHistoryPlugin";import{MarkdownShortcutPlugin as G}from"@lexical/react/LexicalMarkdownShortcutPlugin";import J 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:y},Y=()=>{let r=document.createElement("div");return r.className=t.gutter,r},Z=({compileMDX:r,content:m,source:a,PreviewComponent:e,user:n,components:l})=>{let i=C()||a,{setUser:N}=v(),[u,d]=$(!1),z=I(null),{data:c,content:D}=O(m),B=()=>{d(!0),N(n)},H=()=>{d(!1)};return o.createElement(U,{initialConfig:{...V,editorState:()=>K(D,s)}},o.createElement("div",{className:t.root,onFocus:B,onBlur:H},o.createElement("div",{className:t.toolbarContainer},o.createElement(h,null),o.createElement(k,{meta:c}),o.createElement(M,null)),o.createElement("div",{className:t.editorRoot},o.createElement(J,{className:t.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:A({[t.focused]:u,[t.unfocused]:!u}),ref:z},o.createElement(g,null)),o.createElement(f,null,e&&o.createElement(e,{source:i,meta:c,components:l}))),o.createElement(q,null),o.createElement(X,null),o.createElement(W,null),o.createElement(j,null),o.createElement(G,{transformers:s}),r&&o.createElement(L,{compileMDX:r}),o.createElement(w,null),o.createElement(E,null),o.createElement(b,null),o.createElement(x,null),o.createElement(F,null),o.createElement(T,null),o.createElement(S,null))))},_=Z;function eo(r){let m=to(r,250,{maxWait:500});return{onChange:e=>{e.read(()=>{let n=oo(s);n&&m(n)})}}}var L=({compileMDX:r})=>{let{setErrorMessage:m,setPreviewContent:a}=p(),e=async l=>{try{let i=await r(l,!1);a(i)}catch(i){i instanceof Error&&m(`MDX Error: ${i.message}`)}},{onChange:n}=eo(e);return R.createElement(ro,{onChange:n,ignoreSelectionChange:!0})};export{L as a,_ as b};
@@ -1 +1 @@
1
- import{a as c}from"./chunk-QWW5D4V7.js";import{a as f,b as u,c as b,d as y}from"./chunk-ENTOKO6G.js";import{a as d}from"./chunk-4QQTGYY3.js";import{c as S}from"./chunk-7FEXXQT5.js";import o,{useCallback as L,useEffect as N,useState as T}from"react";import{useLexicalComposerContext as A}from"@lexical/react/LexicalComposerContext";import{mergeRegister as M}from"@lexical/utils";import{$getSelection as R,$isRangeSelection as _,COMMAND_PRIORITY_LOW as k,SELECTION_CHANGE_COMMAND as w}from"lexical";import{Toolbar as D,Tooltray as B}from"@salt-ds/lab";import{useFloatingUI as W}from"@salt-ds/lab";function V(){let[e]=A(),[t,i]=T(null),[s,r]=T(!1),P=t?{middleware:[u(t),f({fallbackPlacements:["bottom-start","top-start"]})]}:{placement:"bottom-start",strategy:"absolute"},{context:x,floating:C,reference:m,strategy:F}=W({placement:"bottom-start",open:s,onOpenChange:r,strategy:"absolute",...P}),{getFloatingProps:I}=b([y(x,{ancestorScroll:!0})]),n=L(()=>{let a=R(),p=window.getSelection(),g=p?.anchorNode?.parentElement;if(_(a)&&g){m(g);let E=p.getRangeAt(0),{x:O,y:h,height:U}=E.getBoundingClientRect();i({x:O,y:h+U}),r(!0)}else i(null),r(!1)},[m]);N(()=>M(e.registerUpdateListener(({editorState:a})=>{a.read(()=>{n()})}),e.registerCommand(w,()=>(n(),!1),k)),[e,n]);let l={position:F};return t&&(l={...l,top:t.y,left:t.x}),o.createElement(d,{ref:C,open:s,style:l,...I({})},o.createElement(D,{"aria-label":"page editing toolbar",style:{minWidth:"100px"}},o.createElement(c,{floating:!0}),o.createElement(B,{"aria-label":"text format tooltray"},o.createElement(S,null))))}export{V as a};
1
+ import{a as c}from"./chunk-QWW5D4V7.js";import{a as f,b as u,c as b,d as y}from"./chunk-ENTOKO6G.js";import{a as d}from"./chunk-4QQTGYY3.js";import{c as S}from"./chunk-OFHNZZ2E.js";import o,{useCallback as L,useEffect as N,useState as T}from"react";import{useLexicalComposerContext as A}from"@lexical/react/LexicalComposerContext";import{mergeRegister as M}from"@lexical/utils";import{$getSelection as R,$isRangeSelection as _,COMMAND_PRIORITY_LOW as k,SELECTION_CHANGE_COMMAND as w}from"lexical";import{Toolbar as D,Tooltray as B}from"@salt-ds/lab";import{useFloatingUI as W}from"@salt-ds/lab";function V(){let[e]=A(),[t,i]=T(null),[s,r]=T(!1),P=t?{middleware:[u(t),f({fallbackPlacements:["bottom-start","top-start"]})]}:{placement:"bottom-start",strategy:"absolute"},{context:x,floating:C,reference:m,strategy:F}=W({placement:"bottom-start",open:s,onOpenChange:r,strategy:"absolute",...P}),{getFloatingProps:I}=b([y(x,{ancestorScroll:!0})]),n=L(()=>{let a=R(),p=window.getSelection(),g=p?.anchorNode?.parentElement;if(_(a)&&g){m(g);let E=p.getRangeAt(0),{x:O,y:h,height:U}=E.getBoundingClientRect();i({x:O,y:h+U}),r(!0)}else i(null),r(!1)},[m]);N(()=>M(e.registerUpdateListener(({editorState:a})=>{a.read(()=>{n()})}),e.registerCommand(w,()=>(n(),!1),k)),[e,n]);let l={position:F};return t&&(l={...l,top:t.y,left:t.x}),o.createElement(d,{ref:C,open:s,style:l,...I({})},o.createElement(D,{"aria-label":"page editing toolbar",style:{minWidth:"100px"}},o.createElement(c,{floating:!0}),o.createElement(B,{"aria-label":"text format tooltray"},o.createElement(S,null))))}export{V as a};
@@ -0,0 +1 @@
1
+ import{useCallback as s}from"react";import{create as i}from"zustand";var r={pageState:"VIEW",user:void 0,previewContent:void 0,errorMessage:void 0,isInsertingLink:!1},n=i(e=>({...r,setPageState:t=>e({pageState:t}),startEditing:()=>e({...r,pageState:"EDIT"}),stopEditing:()=>e({pageState:r.pageState}),setPreviewContent:t=>e({pageState:"EDIT",previewContent:t,errorMessage:void 0}),setErrorMessage:t=>e({errorMessage:t,pageState:"ERROR"}),setUser:t=>e({user:t}),setIsInsertingLink:t=>e({isInsertingLink:t})})),g=()=>n(s(e=>e.previewContent,[])),p=()=>n(s(e=>e.setPreviewContent,[])),d=()=>n(s(e=>({pageState:e.pageState,setPageState:e.setPageState,errorMessage:e.errorMessage,setErrorMessage:e.setErrorMessage}),[])),S=()=>n(s(e=>({user:e.user,setUser:e.setUser}),[])),I=()=>n(s(e=>({isInsertingLink:e.isInsertingLink,setIsInsertingLink:e.setIsInsertingLink}),[])),E=n;export{g as a,p as b,d as c,S as d,I as e,E as f};
@@ -1 +1 @@
1
- import{a as L}from"./chunk-WZYDYWT3.js";import{a as I}from"./chunk-7N3YX6NW.js";import{e as f}from"./chunk-KE4TEFFN.js";import{$createLinkNode as K,TOGGLE_LINK_COMMAND as V}from"@lexical/link";import{useLexicalComposerContext as q}from"@lexical/react/LexicalComposerContext";import{$wrapNodes as W}from"@lexical/selection";import{$createParagraphNode as G,$createTextNode as U,$getSelection as j,$isRangeSelection as Y,$isTextNode as z,COMMAND_PRIORITY_EDITOR as H,createCommand as J}from"lexical";import Q,{useCallback as X,useEffect as Z}from"react";import t,{useEffect as E,useState as k}from"react";import{useLexicalComposerContext as F}from"@lexical/react/LexicalComposerContext";import{Button as C,Icon as v}from"@jpmorganchase/mosaic-components";import{string as N,object as M}from"yup";import{FormField as S,Input as h}from"@salt-ds/lab";import{ButtonBar as P,Dialog as B,DialogTitle as _,DialogContent as A,DialogActions as O}from"@salt-ds/lab";import{$getSelection as $,$isRangeSelection as w}from"lexical";var D=M({url:N().required("Url is required"),text:N().required("Text is required").max(10,"Text must be fewer than 100 characters")}),ft=()=>{let{isInsertingLink:e,setIsInsertingLink:o}=f();return t.createElement(I,{active:e,onClick:()=>o(!0),label:"Insert Link"},t.createElement(v,{name:"linked"}))},T={url:"https://"},b=()=>{let[e]=F(),{isInsertingLink:o,setIsInsertingLink:a}=f(),[n,r]=k(T),[s,d]=k(),u=()=>{a(!1),d(void 0),r(T)};E(()=>{e.getEditorState().read(()=>{if(o){let i=$();if(w(i)){let l=i.getTextContent();r(m=>({...m,text:l}))}}})},[e,o]);let g=i=>{let l=i.inner.reduce((m,{path:c,message:y})=>({...m,[c]:y}),{});d(l)},x=(i,l)=>{let{name:m}=i.target,c={...n,[m]:l};D.validateAt(m,c,{abortEarly:!1}).then(()=>{d({...s,[m]:void 0})},g),r(c)};return t.createElement(B,{onClose:u,open:o,width:600},t.createElement("form",{onSubmit:async i=>{i.preventDefault(),D.validate(n,{abortEarly:!1}).then(()=>{let l={url:n?.url,text:n?.text};e.dispatchCommand(p,l),u()},g)},noValidate:!0},t.createElement(_,null,"Insert Link"),t.createElement(A,null,t.createElement("div",{className:L.fullWidth},t.createElement(S,{label:"Image URL text",validationStatus:s?.url?"error":void 0,helperText:s?.url},t.createElement(h,{value:n?.url,inputProps:{name:"url"},onChange:x})),t.createElement(S,{label:"Link text",validationStatus:s?.text?"error":void 0,helperText:s?.text},t.createElement(h,{value:n?.text,inputProps:{name:"text"},onChange:x})))),t.createElement(O,null,t.createElement(P,null,t.createElement(C,{onClick:u},"Cancel"),t.createElement(C,{variant:"cta",type:"submit"},"Insert")))))};var p=J();function R(){let[e]=q(),o=X(({url:a,text:n})=>{e.update(()=>{let r=j();if(Y(r)&&a!==void 0&&n!==void 0){let s=r.focus.getNode();if(z(s))e.dispatchCommand(V,a);else{let d=K(a),u=U(n);u.setFormat(r.focus.getNode().getFormat()),d.append(u),W(r,()=>d,G())}}})},[e]);Z(()=>e.registerCommand(p,a=>(o(a),!0),H),[e,o])}function St(){return R(),Q.createElement(b,null)}export{p as a,St as b,ft as c,b as d};
1
+ import{a as L}from"./chunk-WZYDYWT3.js";import{a as I}from"./chunk-7N3YX6NW.js";import{e as f}from"./chunk-G57W376H.js";import{$createLinkNode as K,TOGGLE_LINK_COMMAND as V}from"@lexical/link";import{useLexicalComposerContext as q}from"@lexical/react/LexicalComposerContext";import{$wrapNodes as W}from"@lexical/selection";import{$createParagraphNode as G,$createTextNode as U,$getSelection as j,$isRangeSelection as Y,$isTextNode as z,COMMAND_PRIORITY_EDITOR as H,createCommand as J}from"lexical";import Q,{useCallback as X,useEffect as Z}from"react";import t,{useEffect as E,useState as k}from"react";import{useLexicalComposerContext as F}from"@lexical/react/LexicalComposerContext";import{Button as C,Icon as v}from"@jpmorganchase/mosaic-components";import{string as N,object as M}from"yup";import{FormField as S,Input as h}from"@salt-ds/lab";import{ButtonBar as P,Dialog as B,DialogTitle as _,DialogContent as A,DialogActions as O}from"@salt-ds/lab";import{$getSelection as $,$isRangeSelection as w}from"lexical";var D=M({url:N().required("Url is required"),text:N().required("Text is required").max(10,"Text must be fewer than 100 characters")}),ft=()=>{let{isInsertingLink:e,setIsInsertingLink:o}=f();return t.createElement(I,{active:e,onClick:()=>o(!0),label:"Insert Link"},t.createElement(v,{name:"linked"}))},T={url:"https://"},b=()=>{let[e]=F(),{isInsertingLink:o,setIsInsertingLink:a}=f(),[n,r]=k(T),[s,d]=k(),u=()=>{a(!1),d(void 0),r(T)};E(()=>{e.getEditorState().read(()=>{if(o){let i=$();if(w(i)){let l=i.getTextContent();r(m=>({...m,text:l}))}}})},[e,o]);let g=i=>{let l=i.inner.reduce((m,{path:c,message:y})=>({...m,[c]:y}),{});d(l)},x=(i,l)=>{let{name:m}=i.target,c={...n,[m]:l};D.validateAt(m,c,{abortEarly:!1}).then(()=>{d({...s,[m]:void 0})},g),r(c)};return t.createElement(B,{onClose:u,open:o,width:600},t.createElement("form",{onSubmit:async i=>{i.preventDefault(),D.validate(n,{abortEarly:!1}).then(()=>{let l={url:n?.url,text:n?.text};e.dispatchCommand(p,l),u()},g)},noValidate:!0},t.createElement(_,null,"Insert Link"),t.createElement(A,null,t.createElement("div",{className:L.fullWidth},t.createElement(S,{label:"Image URL text",validationStatus:s?.url?"error":void 0,helperText:s?.url},t.createElement(h,{value:n?.url,inputProps:{name:"url"},onChange:x})),t.createElement(S,{label:"Link text",validationStatus:s?.text?"error":void 0,helperText:s?.text},t.createElement(h,{value:n?.text,inputProps:{name:"text"},onChange:x})))),t.createElement(O,null,t.createElement(P,null,t.createElement(C,{onClick:u},"Cancel"),t.createElement(C,{variant:"cta",type:"submit"},"Insert")))))};var p=J();function R(){let[e]=q(),o=X(({url:a,text:n})=>{e.update(()=>{let r=j();if(Y(r)&&a!==void 0&&n!==void 0){let s=r.focus.getNode();if(z(s))e.dispatchCommand(V,a);else{let d=K(a),u=U(n);u.setFormat(r.focus.getNode().getFormat()),d.append(u),W(r,()=>d,G())}}})},[e]);Z(()=>e.registerCommand(p,a=>(o(a),!0),H),[e,o])}function St(){return R(),Q.createElement(b,null)}export{p as a,St as b,ft as c,b as d};
@@ -1 +1 @@
1
- import{c as e}from"./chunk-KE4TEFFN.js";import n,{useState as s}from"react";import{Button as r,Icon as i}from"@jpmorganchase/mosaic-components";import{OnChangePlugin as g}from"@lexical/react/LexicalOnChangePlugin";var C=()=>{let{setPageState:t}=e(),[o,a]=s(!0);return n.createElement(n.Fragment,null,n.createElement(g,{onChange:()=>{a(!1)},ignoreSelectionChange:!0}),n.createElement(r,{disabled:o,variant:"cta",onClick:()=>t("SAVING")},n.createElement(i,{name:"save"})," \xA0 Save"))};export{C as a};
1
+ import{c as e}from"./chunk-G57W376H.js";import n,{useState as s}from"react";import{Button as r,Icon as i}from"@jpmorganchase/mosaic-components";import{OnChangePlugin as g}from"@lexical/react/LexicalOnChangePlugin";var C=()=>{let{setPageState:t}=e(),[o,a]=s(!0);return n.createElement(n.Fragment,null,n.createElement(g,{onChange:()=>{a(!1)},ignoreSelectionChange:!0}),n.createElement(r,{disabled:o,variant:"cta",onClick:()=>t("SAVING")},n.createElement(i,{name:"save"})," \xA0 Save"))};export{C as a};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-WTMALWJU.js";import{f as a}from"./chunk-KE4TEFFN.js";import t from"react";import{Icon as b}from"@jpmorganchase/mosaic-components";import{Toolbar as c,Tooltray as g,ToolbarButton as m}from"@salt-ds/lab";var y=({isLoggedIn:l=!1})=>{let{pageState:e,startEditing:i,stopEditing:n}=a(),o=e==="EDIT",s=()=>o?n():i(),d=l?o?"Cancel Editing":"Edit Page":"Login Required to Edit";return t.createElement(c,{"aria-label":"editor-controls",className:r.root},t.createElement(g,{"aria-label":"page editor controls tooltray"},t.createElement(m,{"aria-label":o?"cancel editing":"start editing",onClick:s,disabled:!l,label:d},t.createElement(b,{name:o?"delete":"edit"}))))};export{y as a};
1
+ import{a as r}from"./chunk-WTMALWJU.js";import{f as a}from"./chunk-G57W376H.js";import t from"react";import{Icon as b}from"@jpmorganchase/mosaic-components";import{Toolbar as c,Tooltray as g,ToolbarButton as m}from"@salt-ds/lab";var y=({isLoggedIn:l=!1})=>{let{pageState:e,startEditing:i,stopEditing:n}=a(),o=e==="EDIT",s=()=>o?n():i(),d=l?o?"Cancel Editing":"Edit Page":"Login Required to Edit";return t.createElement(c,{"aria-label":"editor-controls",className:r.root},t.createElement(g,{"aria-label":"page editor controls tooltray"},t.createElement(m,{"aria-label":o?"cancel editing":"start editing",onClick:s,disabled:!l,label:d},t.createElement(b,{name:o?"delete":"edit"}))))};export{y as a};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-ZUGL4RMA.js";import{a as d}from"./chunk-GGJCFLQH.js";import{a as m}from"./chunk-U5U3LMRF.js";import{a as i}from"./chunk-FW7CHFWO.js";import{a as e}from"./chunk-QWW5D4V7.js";import{c as b}from"./chunk-7FEXXQT5.js";import{a as n}from"./chunk-2N4TKE2M.js";import{c as a}from"./chunk-KE4TEFFN.js";import o from"react";import{Toolbar as g,ToolbarButton as t,Tooltray as r}from"@salt-ds/lab";import{Icon as l}from"@jpmorganchase/mosaic-components";var I=()=>{let{canRedo:p,canUndo:T,redoEdit:y,undoEdit:f}=i(),{setPageState:u}=a();return o.createElement(g,{"aria-label":"page editing toolbar",style:{minWidth:"100px"}},o.createElement(r,{"aria-label":"history tooltray"},o.createElement(t,{label:"Undo",disabled:!T,onClick:f},o.createElement(l,{name:"undo"})),o.createElement(t,{label:"Redo",disabled:!p,onClick:y},o.createElement(l,{name:"redo"}))),o.createElement(e,null),o.createElement(r,{"aria-label":"text format tooltray"},o.createElement(b,null),o.createElement(m,null),o.createElement(d,null),o.createElement(s,null)),o.createElement(r,{"aria-label":"stop editing tooltray",alignEnd:!0},o.createElement(t,{label:"Cancel Editing",onClick:()=>u("VIEW")},o.createElement(l,{name:"delete"}))),o.createElement(r,{"aria-label":"copy tooltray","data-pad-start":!0},o.createElement(n,null)))},v=I;export{v as a};
1
+ import{a as s}from"./chunk-ZUGL4RMA.js";import{a as d}from"./chunk-GGJCFLQH.js";import{a as m}from"./chunk-U5U3LMRF.js";import{a as i}from"./chunk-FW7CHFWO.js";import{a as e}from"./chunk-QWW5D4V7.js";import{c as b}from"./chunk-OFHNZZ2E.js";import{a as n}from"./chunk-PC66Q33O.js";import{c as a}from"./chunk-G57W376H.js";import o from"react";import{Toolbar as g,ToolbarButton as t,Tooltray as r}from"@salt-ds/lab";import{Icon as l}from"@jpmorganchase/mosaic-components";var I=()=>{let{canRedo:p,canUndo:T,redoEdit:y,undoEdit:f}=i(),{setPageState:u}=a();return o.createElement(g,{"aria-label":"page editing toolbar",style:{minWidth:"100px"}},o.createElement(r,{"aria-label":"history tooltray"},o.createElement(t,{label:"Undo",disabled:!T,onClick:f},o.createElement(l,{name:"undo"})),o.createElement(t,{label:"Redo",disabled:!p,onClick:y},o.createElement(l,{name:"redo"}))),o.createElement(e,null),o.createElement(r,{"aria-label":"text format tooltray"},o.createElement(b,null),o.createElement(m,null),o.createElement(d,null),o.createElement(s,null)),o.createElement(r,{"aria-label":"stop editing tooltray",alignEnd:!0},o.createElement(t,{label:"Cancel Editing",onClick:()=>u("VIEW")},o.createElement(l,{name:"delete"}))),o.createElement(r,{"aria-label":"copy tooltray","data-pad-start":!0},o.createElement(n,null)))},v=I;export{v as a};
@@ -1 +1 @@
1
- import{c as t}from"./chunk-KE4TEFFN.js";import n from"react";import{Banner as o}from"@salt-ds/lab";var a=()=>{let{pageState:e,errorMessage:r}=t();return e==="ERROR"?n.createElement(o,{announcement:r,status:"error"},r):null},p=a;export{p as a};
1
+ import{c as t}from"./chunk-G57W376H.js";import n from"react";import{Banner as o}from"@salt-ds/lab";var a=()=>{let{pageState:e,errorMessage:r}=t();return e==="ERROR"?n.createElement(o,{announcement:r,status:"error"},r):null},p=a;export{p as a};
@@ -1 +1 @@
1
- import{b as a}from"../chunk-J42KME6A.js";import"../chunk-RUQR4E6N.js";import"../chunk-ZUGL4RMA.js";import"../chunk-GGJCFLQH.js";import"../chunk-KZXCNQER.js";import"../chunk-U5U3LMRF.js";import"../chunk-GWUYDDYS.js";import"../chunk-FYR74YJH.js";import"../chunk-YER34KSW.js";import"../chunk-6TM3EYFS.js";import"../chunk-PZQ26XWS.js";import"../chunk-KQ2ZCDYD.js";import"../chunk-U22HX567.js";import"../chunk-G4LBXKDE.js";import"../chunk-HB6ONQSD.js";import"../chunk-5YCBSSDA.js";import"../chunk-MJUOPD42.js";import"../chunk-4EAOB7YQ.js";import"../chunk-ESKW4XF6.js";import"../chunk-PHAO5PCV.js";import"../chunk-3FJGHVH5.js";import"../chunk-JQUDHJIQ.js";import"../chunk-XGBC7YGO.js";import"../chunk-WNTJMWYJ.js";import"../chunk-ESJNOEFD.js";import"../chunk-RT5CJ7T5.js";import"../chunk-BXNO7GED.js";import"../chunk-FW7CHFWO.js";import"../chunk-RO6ARCLZ.js";import"../chunk-NLBFMDUH.js";import"../chunk-QWW5D4V7.js";import"../chunk-JYGEHLYM.js";import"../chunk-U7COOUR6.js";import"../chunk-ENTOKO6G.js";import"../chunk-4QQTGYY3.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";import"../chunk-FKL4ZGDB.js";import"../chunk-YBFKG74H.js";import"../chunk-7FEXXQT5.js";import"../chunk-WZYDYWT3.js";import"../chunk-7N3YX6NW.js";import"../chunk-FFJYM47T.js";import"../chunk-FI57IKHZ.js";import"../chunk-WCG3U3X2.js";import"../chunk-NXV7KCC5.js";import"../chunk-PVPRWTXB.js";import"../chunk-WTMALWJU.js";import"../chunk-2N4TKE2M.js";import"../chunk-KE4TEFFN.js";export{a as default};
1
+ import{b as a}from"../chunk-2NOKHPAW.js";import"../chunk-R5CYUKUL.js";import"../chunk-ZUGL4RMA.js";import"../chunk-GGJCFLQH.js";import"../chunk-KZXCNQER.js";import"../chunk-U5U3LMRF.js";import"../chunk-GWUYDDYS.js";import"../chunk-23MNBEVR.js";import"../chunk-YER34KSW.js";import"../chunk-6TM3EYFS.js";import"../chunk-PZQ26XWS.js";import"../chunk-KQ2ZCDYD.js";import"../chunk-U22HX567.js";import"../chunk-G4LBXKDE.js";import"../chunk-HB6ONQSD.js";import"../chunk-5YCBSSDA.js";import"../chunk-MJUOPD42.js";import"../chunk-4EAOB7YQ.js";import"../chunk-ESKW4XF6.js";import"../chunk-PHAO5PCV.js";import"../chunk-3FJGHVH5.js";import"../chunk-JQUDHJIQ.js";import"../chunk-XGBC7YGO.js";import"../chunk-WNTJMWYJ.js";import"../chunk-ESJNOEFD.js";import"../chunk-RT5CJ7T5.js";import"../chunk-YQHKK2ZS.js";import"../chunk-FW7CHFWO.js";import"../chunk-RO6ARCLZ.js";import"../chunk-6CF5IZPG.js";import"../chunk-QWW5D4V7.js";import"../chunk-JYGEHLYM.js";import"../chunk-U7COOUR6.js";import"../chunk-ENTOKO6G.js";import"../chunk-4QQTGYY3.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";import"../chunk-FKL4ZGDB.js";import"../chunk-YBFKG74H.js";import"../chunk-OFHNZZ2E.js";import"../chunk-WZYDYWT3.js";import"../chunk-7N3YX6NW.js";import"../chunk-FFJYM47T.js";import"../chunk-FI57IKHZ.js";import"../chunk-WCG3U3X2.js";import"../chunk-NXV7KCC5.js";import"../chunk-PZZKTKIE.js";import"../chunk-WTMALWJU.js";import"../chunk-PC66Q33O.js";import"../chunk-G57W376H.js";export{a as default};
@@ -1 +1 @@
1
- import{a}from"../chunk-PVPRWTXB.js";import"../chunk-WTMALWJU.js";import"../chunk-KE4TEFFN.js";export{a as EditorControls};
1
+ import{a}from"../chunk-PZZKTKIE.js";import"../chunk-WTMALWJU.js";import"../chunk-G57W376H.js";export{a as EditorControls};
@@ -1 +1 @@
1
- import{a}from"../../chunk-FYR74YJH.js";import"../../chunk-YER34KSW.js";import"../../chunk-6TM3EYFS.js";import"../../chunk-XGBC7YGO.js";import"../../chunk-WNTJMWYJ.js";import"../../chunk-ESJNOEFD.js";import"../../chunk-RT5CJ7T5.js";import"../../chunk-FI57IKHZ.js";import"../../chunk-KE4TEFFN.js";export{a as PersistDialog};
1
+ import{a}from"../../chunk-23MNBEVR.js";import"../../chunk-YER34KSW.js";import"../../chunk-6TM3EYFS.js";import"../../chunk-XGBC7YGO.js";import"../../chunk-WNTJMWYJ.js";import"../../chunk-ESJNOEFD.js";import"../../chunk-RT5CJ7T5.js";import"../../chunk-FI57IKHZ.js";import"../../chunk-G57W376H.js";export{a as PersistDialog};
@@ -1 +1 @@
1
- import{a}from"../chunk-2N4TKE2M.js";import"../chunk-KE4TEFFN.js";export{a as SaveButton};
1
+ import{a}from"../chunk-PC66Q33O.js";import"../chunk-G57W376H.js";export{a as SaveButton};
@@ -1 +1 @@
1
- import{a}from"../chunk-BXNO7GED.js";import"../chunk-KE4TEFFN.js";export{a as default};
1
+ import{a}from"../chunk-YQHKK2ZS.js";import"../chunk-G57W376H.js";export{a as default};
@@ -1 +1 @@
1
- import{c as a,d as b}from"../../chunk-7FEXXQT5.js";import"../../chunk-WZYDYWT3.js";import"../../chunk-7N3YX6NW.js";import"../../chunk-FFJYM47T.js";import"../../chunk-KE4TEFFN.js";export{a as InsertLinkButton,b as InsertLinkDialog};
1
+ import{c as a,d as b}from"../../chunk-OFHNZZ2E.js";import"../../chunk-WZYDYWT3.js";import"../../chunk-7N3YX6NW.js";import"../../chunk-FFJYM47T.js";import"../../chunk-G57W376H.js";export{a as InsertLinkButton,b as InsertLinkDialog};
@@ -1 +1 @@
1
- import{a}from"../../chunk-RUQR4E6N.js";import"../../chunk-ZUGL4RMA.js";import"../../chunk-GGJCFLQH.js";import"../../chunk-KZXCNQER.js";import"../../chunk-U5U3LMRF.js";import"../../chunk-GWUYDDYS.js";import"../../chunk-FW7CHFWO.js";import"../../chunk-QWW5D4V7.js";import"../../chunk-JYGEHLYM.js";import"../../chunk-U7COOUR6.js";import"../../chunk-ENTOKO6G.js";import"../../chunk-4QQTGYY3.js";import"../../chunk-XP37MJCS.js";import"../../chunk-P5OBPOC4.js";import"../../chunk-YBFKG74H.js";import"../../chunk-7FEXXQT5.js";import"../../chunk-WZYDYWT3.js";import"../../chunk-7N3YX6NW.js";import"../../chunk-FFJYM47T.js";import"../../chunk-2N4TKE2M.js";import"../../chunk-KE4TEFFN.js";export{a as default};
1
+ import{a}from"../../chunk-R5CYUKUL.js";import"../../chunk-ZUGL4RMA.js";import"../../chunk-GGJCFLQH.js";import"../../chunk-KZXCNQER.js";import"../../chunk-U5U3LMRF.js";import"../../chunk-GWUYDDYS.js";import"../../chunk-FW7CHFWO.js";import"../../chunk-QWW5D4V7.js";import"../../chunk-JYGEHLYM.js";import"../../chunk-U7COOUR6.js";import"../../chunk-ENTOKO6G.js";import"../../chunk-4QQTGYY3.js";import"../../chunk-XP37MJCS.js";import"../../chunk-P5OBPOC4.js";import"../../chunk-YBFKG74H.js";import"../../chunk-OFHNZZ2E.js";import"../../chunk-WZYDYWT3.js";import"../../chunk-7N3YX6NW.js";import"../../chunk-FFJYM47T.js";import"../../chunk-PC66Q33O.js";import"../../chunk-G57W376H.js";export{a as default};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{b as c}from"./chunk-J42KME6A.js";import"./chunk-RUQR4E6N.js";import"./chunk-ZUGL4RMA.js";import"./chunk-GGJCFLQH.js";import"./chunk-KZXCNQER.js";import"./chunk-U5U3LMRF.js";import"./chunk-GWUYDDYS.js";import"./chunk-FYR74YJH.js";import"./chunk-YER34KSW.js";import"./chunk-6TM3EYFS.js";import"./chunk-PZQ26XWS.js";import"./chunk-KQ2ZCDYD.js";import"./chunk-U22HX567.js";import"./chunk-G4LBXKDE.js";import"./chunk-HB6ONQSD.js";import"./chunk-5YCBSSDA.js";import"./chunk-MJUOPD42.js";import"./chunk-4EAOB7YQ.js";import"./chunk-ESKW4XF6.js";import"./chunk-PHAO5PCV.js";import"./chunk-3FJGHVH5.js";import"./chunk-JQUDHJIQ.js";import"./chunk-XGBC7YGO.js";import"./chunk-WNTJMWYJ.js";import"./chunk-ESJNOEFD.js";import"./chunk-RT5CJ7T5.js";import"./chunk-BXNO7GED.js";import"./chunk-FW7CHFWO.js";import"./chunk-RO6ARCLZ.js";import"./chunk-NLBFMDUH.js";import"./chunk-QWW5D4V7.js";import"./chunk-JYGEHLYM.js";import"./chunk-U7COOUR6.js";import"./chunk-ENTOKO6G.js";import"./chunk-4QQTGYY3.js";import"./chunk-XP37MJCS.js";import"./chunk-P5OBPOC4.js";import"./chunk-FKL4ZGDB.js";import"./chunk-YBFKG74H.js";import"./chunk-7FEXXQT5.js";import"./chunk-WZYDYWT3.js";import"./chunk-7N3YX6NW.js";import"./chunk-FFJYM47T.js";import"./chunk-FI57IKHZ.js";import"./chunk-WCG3U3X2.js";import"./chunk-NXV7KCC5.js";import{a as d}from"./chunk-PVPRWTXB.js";import"./chunk-WTMALWJU.js";import"./chunk-2N4TKE2M.js";import{c as a,f as b}from"./chunk-KE4TEFFN.js";export{c as Editor,d as EditorControls,b as useContentEditor,a as usePageState};
1
+ import{b as c}from"./chunk-2NOKHPAW.js";import"./chunk-R5CYUKUL.js";import"./chunk-ZUGL4RMA.js";import"./chunk-GGJCFLQH.js";import"./chunk-KZXCNQER.js";import"./chunk-U5U3LMRF.js";import"./chunk-GWUYDDYS.js";import"./chunk-23MNBEVR.js";import"./chunk-YER34KSW.js";import"./chunk-6TM3EYFS.js";import"./chunk-PZQ26XWS.js";import"./chunk-KQ2ZCDYD.js";import"./chunk-U22HX567.js";import"./chunk-G4LBXKDE.js";import"./chunk-HB6ONQSD.js";import"./chunk-5YCBSSDA.js";import"./chunk-MJUOPD42.js";import"./chunk-4EAOB7YQ.js";import"./chunk-ESKW4XF6.js";import"./chunk-PHAO5PCV.js";import"./chunk-3FJGHVH5.js";import"./chunk-JQUDHJIQ.js";import"./chunk-XGBC7YGO.js";import"./chunk-WNTJMWYJ.js";import"./chunk-ESJNOEFD.js";import"./chunk-RT5CJ7T5.js";import"./chunk-YQHKK2ZS.js";import"./chunk-FW7CHFWO.js";import"./chunk-RO6ARCLZ.js";import"./chunk-6CF5IZPG.js";import"./chunk-QWW5D4V7.js";import"./chunk-JYGEHLYM.js";import"./chunk-U7COOUR6.js";import"./chunk-ENTOKO6G.js";import"./chunk-4QQTGYY3.js";import"./chunk-XP37MJCS.js";import"./chunk-P5OBPOC4.js";import"./chunk-FKL4ZGDB.js";import"./chunk-YBFKG74H.js";import"./chunk-OFHNZZ2E.js";import"./chunk-WZYDYWT3.js";import"./chunk-7N3YX6NW.js";import"./chunk-FFJYM47T.js";import"./chunk-FI57IKHZ.js";import"./chunk-WCG3U3X2.js";import"./chunk-NXV7KCC5.js";import{a as d}from"./chunk-PZZKTKIE.js";import"./chunk-WTMALWJU.js";import"./chunk-PC66Q33O.js";import{c as a,f as b}from"./chunk-G57W376H.js";export{c as Editor,d as EditorControls,b as useContentEditor,a as usePageState};
@@ -1 +1 @@
1
- import{a}from"../chunk-NLBFMDUH.js";import"../chunk-QWW5D4V7.js";import"../chunk-JYGEHLYM.js";import"../chunk-U7COOUR6.js";import"../chunk-ENTOKO6G.js";import"../chunk-4QQTGYY3.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";import"../chunk-7FEXXQT5.js";import"../chunk-WZYDYWT3.js";import"../chunk-7N3YX6NW.js";import"../chunk-FFJYM47T.js";import"../chunk-KE4TEFFN.js";export{a as FloatingToolbarPlugin};
1
+ import{a}from"../chunk-6CF5IZPG.js";import"../chunk-QWW5D4V7.js";import"../chunk-JYGEHLYM.js";import"../chunk-U7COOUR6.js";import"../chunk-ENTOKO6G.js";import"../chunk-4QQTGYY3.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";import"../chunk-OFHNZZ2E.js";import"../chunk-WZYDYWT3.js";import"../chunk-7N3YX6NW.js";import"../chunk-FFJYM47T.js";import"../chunk-G57W376H.js";export{a as FloatingToolbarPlugin};
@@ -1 +1 @@
1
- import{a,b}from"../chunk-7FEXXQT5.js";import"../chunk-WZYDYWT3.js";import"../chunk-7N3YX6NW.js";import"../chunk-FFJYM47T.js";import"../chunk-KE4TEFFN.js";export{a as INSERT_MARKDOWN_LINK_COMMAND,b as MarkdownLinkPlugin};
1
+ import{a,b}from"../chunk-OFHNZZ2E.js";import"../chunk-WZYDYWT3.js";import"../chunk-7N3YX6NW.js";import"../chunk-FFJYM47T.js";import"../chunk-G57W376H.js";export{a as INSERT_MARKDOWN_LINK_COMMAND,b as MarkdownLinkPlugin};
@@ -1 +1 @@
1
- import{a}from"../chunk-J42KME6A.js";import"../chunk-RUQR4E6N.js";import"../chunk-ZUGL4RMA.js";import"../chunk-GGJCFLQH.js";import"../chunk-KZXCNQER.js";import"../chunk-U5U3LMRF.js";import"../chunk-GWUYDDYS.js";import"../chunk-FYR74YJH.js";import"../chunk-YER34KSW.js";import"../chunk-6TM3EYFS.js";import"../chunk-PZQ26XWS.js";import"../chunk-KQ2ZCDYD.js";import"../chunk-U22HX567.js";import"../chunk-G4LBXKDE.js";import"../chunk-HB6ONQSD.js";import"../chunk-5YCBSSDA.js";import"../chunk-MJUOPD42.js";import"../chunk-4EAOB7YQ.js";import"../chunk-ESKW4XF6.js";import"../chunk-PHAO5PCV.js";import"../chunk-3FJGHVH5.js";import"../chunk-JQUDHJIQ.js";import"../chunk-XGBC7YGO.js";import"../chunk-WNTJMWYJ.js";import"../chunk-ESJNOEFD.js";import"../chunk-RT5CJ7T5.js";import"../chunk-BXNO7GED.js";import"../chunk-FW7CHFWO.js";import"../chunk-RO6ARCLZ.js";import"../chunk-NLBFMDUH.js";import"../chunk-QWW5D4V7.js";import"../chunk-JYGEHLYM.js";import"../chunk-U7COOUR6.js";import"../chunk-ENTOKO6G.js";import"../chunk-4QQTGYY3.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";import"../chunk-FKL4ZGDB.js";import"../chunk-YBFKG74H.js";import"../chunk-7FEXXQT5.js";import"../chunk-WZYDYWT3.js";import"../chunk-7N3YX6NW.js";import"../chunk-FFJYM47T.js";import"../chunk-FI57IKHZ.js";import"../chunk-WCG3U3X2.js";import"../chunk-NXV7KCC5.js";import"../chunk-PVPRWTXB.js";import"../chunk-WTMALWJU.js";import"../chunk-2N4TKE2M.js";import"../chunk-KE4TEFFN.js";export{a as PreviewPlugin};
1
+ import{a}from"../chunk-2NOKHPAW.js";import"../chunk-R5CYUKUL.js";import"../chunk-ZUGL4RMA.js";import"../chunk-GGJCFLQH.js";import"../chunk-KZXCNQER.js";import"../chunk-U5U3LMRF.js";import"../chunk-GWUYDDYS.js";import"../chunk-23MNBEVR.js";import"../chunk-YER34KSW.js";import"../chunk-6TM3EYFS.js";import"../chunk-PZQ26XWS.js";import"../chunk-KQ2ZCDYD.js";import"../chunk-U22HX567.js";import"../chunk-G4LBXKDE.js";import"../chunk-HB6ONQSD.js";import"../chunk-5YCBSSDA.js";import"../chunk-MJUOPD42.js";import"../chunk-4EAOB7YQ.js";import"../chunk-ESKW4XF6.js";import"../chunk-PHAO5PCV.js";import"../chunk-3FJGHVH5.js";import"../chunk-JQUDHJIQ.js";import"../chunk-XGBC7YGO.js";import"../chunk-WNTJMWYJ.js";import"../chunk-ESJNOEFD.js";import"../chunk-RT5CJ7T5.js";import"../chunk-YQHKK2ZS.js";import"../chunk-FW7CHFWO.js";import"../chunk-RO6ARCLZ.js";import"../chunk-6CF5IZPG.js";import"../chunk-QWW5D4V7.js";import"../chunk-JYGEHLYM.js";import"../chunk-U7COOUR6.js";import"../chunk-ENTOKO6G.js";import"../chunk-4QQTGYY3.js";import"../chunk-XP37MJCS.js";import"../chunk-P5OBPOC4.js";import"../chunk-FKL4ZGDB.js";import"../chunk-YBFKG74H.js";import"../chunk-OFHNZZ2E.js";import"../chunk-WZYDYWT3.js";import"../chunk-7N3YX6NW.js";import"../chunk-FFJYM47T.js";import"../chunk-FI57IKHZ.js";import"../chunk-WCG3U3X2.js";import"../chunk-NXV7KCC5.js";import"../chunk-PZZKTKIE.js";import"../chunk-WTMALWJU.js";import"../chunk-PC66Q33O.js";import"../chunk-G57W376H.js";export{a as PreviewPlugin};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f}from"../chunk-KE4TEFFN.js";export{f as default,d as useEditorUser,e as useIsInsertingLink,c as usePageState,a as usePreviewContent,b as useSetContent};
1
+ import{a,b,c,d,e,f}from"../chunk-G57W376H.js";export{f as default,d as useEditorUser,e as useIsInsertingLink,c as usePageState,a as usePreviewContent,b as useSetContent};
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.12",
4
+ "version": "0.1.0-beta.14",
5
5
  "license": "Apache-2.0",
6
6
  "author": "",
7
7
  "type": "module",
@@ -33,8 +33,8 @@
33
33
  "typescript": "^4.8.3"
34
34
  },
35
35
  "dependencies": {
36
- "@jpmorganchase/mosaic-components": "^0.1.0-beta.12",
37
- "@jpmorganchase/mosaic-theme": "^0.1.0-beta.12",
36
+ "@jpmorganchase/mosaic-components": "^0.1.0-beta.14",
37
+ "@jpmorganchase/mosaic-theme": "^0.1.0-beta.14",
38
38
  "@salt-ds/core": "^1.0.0",
39
39
  "@salt-ds/icons": "^1.0.0",
40
40
  "@salt-ds/lab": "^1.0.0-alpha.0",
@@ -1,5 +1,5 @@
1
1
  import { useCallback } from 'react';
2
- import create from 'zustand';
2
+ import { create } from 'zustand';
3
3
 
4
4
  type PageState = 'VIEW' | 'EDIT' | 'REVIEW' | 'SAVING' | 'ERROR';
5
5
  type UserType = { sid: string; displayName: string; email: string };
@@ -1 +0,0 @@
1
- import{useCallback as s}from"react";import i from"zustand";var r={pageState:"VIEW",user:void 0,previewContent:void 0,errorMessage:void 0,isInsertingLink:!1},n=i(e=>({...r,setPageState:t=>e({pageState:t}),startEditing:()=>e({...r,pageState:"EDIT"}),stopEditing:()=>e({pageState:r.pageState}),setPreviewContent:t=>e({pageState:"EDIT",previewContent:t,errorMessage:void 0}),setErrorMessage:t=>e({errorMessage:t,pageState:"ERROR"}),setUser:t=>e({user:t}),setIsInsertingLink:t=>e({isInsertingLink:t})})),g=()=>n(s(e=>e.previewContent,[])),p=()=>n(s(e=>e.setPreviewContent,[])),d=()=>n(s(e=>({pageState:e.pageState,setPageState:e.setPageState,errorMessage:e.errorMessage,setErrorMessage:e.setErrorMessage}),[])),S=()=>n(s(e=>({user:e.user,setUser:e.setUser}),[])),I=()=>n(s(e=>({isInsertingLink:e.isInsertingLink,setIsInsertingLink:e.setIsInsertingLink}),[])),E=n;export{g as a,p as b,d as c,S as d,I as e,E as f};