@augmentd-labs/canvas-web 2.20.2 → 2.20.3
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/assets/{NextShell-WUWeCCO8.js → NextShell-CjpKDJo8.js} +1 -1
- package/dist/assets/{SketchEditor-DDFVXQjy.js → SketchEditor-QHhsUFje.js} +1 -1
- package/dist/assets/{TextDocumentEditor-dT6kIQTU.js → TextDocumentEditor-DokHJlgX.js} +1 -1
- package/dist/assets/{index-DsIO2jKr.js → index-CF2LyRj6.js} +44 -44
- package/dist/assets/{sha256-CZQGtu4R.js → sha256-DHKenB0x.js} +1 -1
- package/dist/assets/{text-documents-gQuR_fRP.js → text-documents-CO7tM3Vd.js} +1 -1
- package/dist/assets/workspace-DEC1Z8Cv.js +1 -0
- package/dist/index.html +4 -4
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/dist/assets/workspace-BHVDRu44.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{wt as t,xt as n}from"./react-DQazvoR7.js";import{Ct as r}from"./ui-BX_B5WCf.js";import{x as i}from"./alert-dialog-C7BWAVBm.js";import{o as a}from"./blobs-Depc3N3o.js";import{Dn as o,Pn as s,hn as c}from"./workspace-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{wt as t,xt as n}from"./react-DQazvoR7.js";import{Ct as r}from"./ui-BX_B5WCf.js";import{x as i}from"./alert-dialog-C7BWAVBm.js";import{o as a}from"./blobs-Depc3N3o.js";import{Dn as o,Pn as s,hn as c}from"./workspace-DEC1Z8Cv.js";import{a as l,c as u,i as d,n as f,o as p,r as m,t as h}from"./text-documents-CO7tM3Vd.js";import{t as g}from"./EditorOverlay-3oRTnifg.js";var _=e(t(),1),v=n();function y({doc:e,workspaceName:t,onSaved:n,onClose:y,onDetails:b}){let{showSuccessToast:x,showErrorToast:S}=a(),C=e.schema===s,w=d(e),T=w&&l(e),E=m(e)??`markdown`,D=u(t,e.id,{mode:`text`,enabled:w&&!T,maxTextLength:f,version:e.checksumArray?.[0]??null}),[O,k]=(0,_.useState)(C?String(e.data?.content??``):``),[A,j]=(0,_.useState)(null),M=`${e.id}:${e.checksumArray?.[0]??``}`;w&&D.text!=null&&A!==M&&(j(M),k(D.text));let[N,P]=(0,_.useState)(!1),F=C||D.text!=null&&!D.loading,I=async()=>{P(!0);try{C?await c(t,{id:e.id,schema:e.schema,schemaVersion:e.schemaVersion,data:{...e.data,content:O}}):await h(t,e,O),x(`Document saved`),window.dispatchEvent(new CustomEvent(`workspace:documents:refresh`)),n()}catch(e){S(e instanceof Error?e.message:`Failed to save document`)}finally{P(!1)}},L=C?String(e.data?.title??`Note`):o(e)||`document-${e.id}`;return(0,v.jsx)(g,{onClose:y,onDetails:b,title:(0,v.jsx)(`span`,{className:`truncate text-sm font-medium`,children:L}),actions:(0,v.jsxs)(i,{size:`sm`,onClick:I,disabled:N||!F||T,children:[(0,v.jsx)(r,{className:`mr-1.5 h-4 w-4`}),N?`Saving…`:`Save`]}),children:(0,v.jsx)(`div`,{className:`flex h-full min-h-0 flex-col px-4 py-4 md:px-8`,children:(0,v.jsx)(`div`,{className:`mx-auto flex min-h-0 w-full max-w-full flex-1 flex-col overflow-auto md:w-[700px] md:min-w-[320px] md:resize-x`,children:T?(0,v.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This file is too large to edit here (`,`>`,Math.round(f/1e3),` kB) — download it instead.`]}):D.error?(0,v.jsx)(`p`,{className:`text-sm text-destructive`,children:D.error}):F?(0,v.jsx)(p,{kind:C?`markdown`:E,value:O,onChange:k,placeholder:C?`Write your note…`:void 0,fill:!0}):(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading content…`})})})})}export{y as default};
|