dsh-artifact-studio 0.7.1 → 0.7.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/THIRD_PARTY_NOTICES.md +3 -2
- package/assets/canvas.engine.js +1 -1
- package/client.canvas.js +1 -1
- package/client.doc.js +79 -67
- package/client.js +3 -3
- package/dist/host/lib/rpc.js +0 -11
- package/dist/host/lib/service.js +0 -19
- package/dist/host/lib/skill.js +10 -2
- package/dist/host/lib/store.js +0 -48
- package/dist/host/lib/tools.js +2 -17
- package/package.json +3 -1
- package/dist/host/lib/editor-leases.js +0 -63
package/client.js
CHANGED
|
@@ -22,10 +22,10 @@ window.__ModuleLoader__.load({
|
|
|
22
22
|
`);var fa="<script>addEventListener('message',function(e){if(e.source!==parent||e.data!=='dsh-artifact-print')return;addEventListener('afterprint',function(){parent.postMessage('dsh-artifact-printed','*')},{once:true});print()})<\/script>";function wr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function io(e){return e.replace(/<meta\b[^>]*http-equiv\s*=\s*["']?refresh["']?[^>]*>/gi,"").replace(/<meta\b[^>]*content\s*=\s*["'][^"']*url\s*=[^>]*>/gi,"")}function Sr(e,t,a,r,n="",o="auto"){let l='<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">'+(a===null?"":`<meta http-equiv="Content-Security-Policy" content="${wr(a)}">`)+`<title>${wr(r)}</title><style data-artifact-tokens>${t}</style>`+n;return`<!doctype html><html${oo(e)?` ${St}="${o}"`:""}><head>${l}</head><body>${io(e)}</body></html>`}var Nr="allow-scripts",so="allow-scripts allow-modals",lo=3e4,co="<script>(function(){var t;document.addEventListener('selectionchange',function(){clearTimeout(t);t=setTimeout(function(){var s=String(getSelection()||'');parent.postMessage({dshArtifactSelection:s.slice(0,4000)},'*')},150)})})()<\/script>",po=4e3;function Mt(e,t,a,r="auto",n=!1){return Sr(e,t,kr,a,n?co:"",r)}function Cr(e){if(e===null||typeof e!="object")return;let t={...e};return typeof t.dshArtifactSelection=="string"?t.dshArtifactSelection.slice(0,po):void 0}function Ir(e){let t=/<\/head>/i.test(e)?e.replace(/<\/head>/i,`${fa}</head>`):`${fa}${e}`,a=URL.createObjectURL(new Blob([t],{type:"text/html"})),r=document.createElement("iframe");r.setAttribute("sandbox",so),r.setAttribute("aria-hidden","true"),r.tabIndex=-1,r.style.cssText="position:fixed;left:-10000px;top:0;width:800px;height:1000px;border:0;";let n=!1,o=()=>{n||(n=!0,clearTimeout(s),window.removeEventListener("message",l),r.remove(),URL.revokeObjectURL(a))},l=g=>{g.source===r.contentWindow&&g.data==="dsh-artifact-printed"&&o()};window.addEventListener("message",l);let s=setTimeout(o,lo);r.addEventListener("load",()=>{r.contentWindow?.postMessage("dsh-artifact-print","*")},{once:!0}),r.src=a,document.body.appendChild(r)}var Er={"agent.ask":"Edit with agent","agent.reference":'In artifact "{title}" ({id}, v{version}):',"agent.referenceOld":'In artifact "{title}" ({id}, v{version}, the current version is v{current}):',"agent.added":"Added to your message. Describe the change, then send.","agent.addedTruncated":"Added to your message. The selection was shortened to 2,000 characters.","agent.insertFailed":"The message box is busy, so the request was copied instead.","agent.copied":"Copied. Paste it into a conversation, then send.","agent.copyTitle":"Copy the request","card.creating":"Creating {title}","card.updating":"Updating {title}","card.updatingUntitled":"Updating the artifact","card.openNamed":"Open {title}","tab.codeHint":"Read-only code. Select text to ask the agent about it.","tab.editSource":"Edit code","tab.deleteTitle":"Move to trash?","code.copy":"Copy code","dialog.close":"Close","dialog.done":"Done","design.colorsDark":"Dark colors","panel.layers":"Layers","panel.properties":"Properties","panel.none":"No layers","panel.mixed":"Mixed","panel.expand":"Expand","panel.collapse":"Collapse","panel.show":"Show","panel.hide":"Hide","panel.lock":"Lock","panel.unlock":"Unlock","panel.rename":"Rename layer","panel.x":"X","panel.y":"Y","panel.rotation":"Rotate","panel.radius":"Radius","panel.opacity":"Opacity","panel.visible":"Visible","panel.hidden":"Hidden","panel.family":"Font family","panel.weight":"Weight","panel.fontSize":"Size","panel.w":"W","panel.h":"H","panel.positionSize":"Position and size","panel.appearance":"Appearance","panel.text":"Text","panel.selectLayerHint":"Select a layer to see its properties.","panel.selectTextHint":"Select a text layer to change its font, weight, and size.","layer.parentLine":"{type} in {parent}","layer.type.frame":"Frame","layer.type.section":"Section","layer.type.text":"Text","layer.type.rectangle":"Rectangle","layer.type.ellipse":"Ellipse","layer.type.line":"Line","layer.type.vector":"Vector","layer.type.group":"Group","layer.type.component":"Component","layer.type.instance":"Instance","layer.type.other":"Layer","canvas.viewMode":"View","canvas.editMode":"Edit","canvas.opening":"Opening the canvas\u2026","canvas.startFailed":"The canvas did not start. Showing the saved image.","canvas.empty":"This mockup has no layers yet. Switch to Edit to draw one.","canvas.zoomControls":"Zoom","canvas.zoomOut":"Zoom out","canvas.zoomIn":"Zoom in","canvas.zoomMenu":"Zoom level","canvas.zoomValue":"{percent}%","canvas.inspector":"Inspector","canvas.closeInspector":"Close inspector","canvas.inspectorTabs":"Inspector sections","canvas.editOldVersion":"Old versions open in View only. Restore this version to edit.","agent.quoteDesign":`Layer "{name}"
|
|
23
23
|
Path: {path}
|
|
24
24
|
|
|
25
|
-
Design JSX:`,"agent.quoteCut":"The Design JSX was shortened to {limit} characters.","agent.addedTruncatedDesign":"Added to your message. The layer's code was shortened to 4,000 characters.","canvas.toolbar":"Canvas tools","canvas.tools":"Tool","canvas.select":"Select","canvas.hand":"Hand","canvas.frame":"Frame","canvas.text":"Text","canvas.undo":"Undo","canvas.redo":"Redo","canvas.fit":"Fit","preview.loading":"Rendering the mockup\u2026","preview.retry":"Render again","preview.warnings":"Preview warnings","error.designIconNotFound":"That icon is not in the bundled set. Use an mdi: name from Material Design Icons.","design.display":"Heading font stack","composer.recent":"This project","composer.empty":"No artifacts yet","composer.start":"Start with","composer.all":"All artifacts","gallery.copyPrompt":"Copy prompt","gallery.copyPromptNamed":"Copy the {name} prompt","gallery.promptCopied":"Prompt copied. Paste it into a conversation.","prompt.dashboard":"Dashboard","prompt.dashboardText":"Create an artifact page: a dashboard that shows ","prompt.explainer":"Explainer","prompt.explainerText":"Create an artifact page: a one-page visual explainer of ","prompt.report":"Report","prompt.reportText":"Create an artifact doc: a report about ","prompt.brief":"Project brief","prompt.briefText":"Create an artifact doc: a project brief with context, goal, scope, and open questions for ","filter.type":"Filter by type","tab.mode":"Page view","tab.manualSave":"Page source saves with Save or Ctrl/Cmd+S.","tab.manualSaveDesign":"Mockup source saves with Save or Ctrl/Cmd+S.","tab.versionPicker":"Choose version","tab.currentVersion":"current","tab.allVersions":"All versions","tab.agentUpdate":"Updated to v{version}","tab.viewHistory":"View history","tab.dismiss":"Dismiss","tab.leaveTitle":"Keep your changes?","tab.leaveHint":"Save your changes before continuing, or discard them. Cancel keeps you here.","tab.discardContinue":"Discard and continue","tab.saveContinue":"Save and continue","tab.copyDraft":"Copy my draft","tab.discardReload":"Discard mine and reload","history.close":"Close history","action.copied":"Copied","action.copyFailed":"Copy was blocked. Select the text and copy it manually.","format.toolbar":"Document formatting","format.heading":"Heading","format.bold":"Bold","format.italic":"Italic","format.bulletList":"Bullet list","format.orderedList":"Numbered list","format.codeBlock":"Code block",panel:"Artifacts","action.back":"Back","scope.label":"Scope","scope.all":"All projects","scope.workspace":"This project","scope.library":"Library","type.page":"Page","type.doc":"Document","type.design":"Mockup","type.all":"All types","gallery.search":"Search artifacts","gallery.searchLabel":"Search by title","gallery.create":"New artifact","gallery.newPage":"New page","gallery.newDoc":"New document","gallery.newDesign":"New mockup","gallery.design":"Design system","gallery.refresh":"Refresh","gallery.more":"Show more","gallery.truncated":"Only the first 500 artifacts are scanned.","gallery.failedProjects":"Some sources could not be loaded.","gallery.version":"v{version}","gallery.updated":"Updated {time}","gallery.count":"{count} artifacts","gallery.pinned":"Pinned","gallery.recent":"Recently updated","gallery.coverTitle":"Preview of {title}","gallery.coverFailed":"Preview unavailable","gallery.pin":"Pin {title}","gallery.unpin":"Unpin {title}","gallery.allPinned":"Everything here is pinned.","empty.workspaceTitle":"No artifacts in this project yet","empty.workspaceHint":"Ask the agent for a dashboard, report, or one-pager, or start one here.","empty.allTitle":"No artifacts yet","empty.allHint":"Artifacts from every project and your library appear here.","empty.libraryTitle":"Your library is empty","empty.libraryHint":"Library artifacts follow you to every project. Ask the agent to save one to the library.","empty.noMatch":"Nothing matches that search.","empty.typeMatch":"No {type} artifacts match the filter.","empty.noWorkspace":"Open a session in a workspace to see its artifacts.","empty.loading":"Loading...","create.title":"New {type}","create.name":"Title","create.scope":"Save to","create.submit":"Create","create.cancel":"Cancel","create.untitledPage":"Untitled page","create.untitledDesign":"Untitled mockup","create.untitledDoc":"Untitled document","tab.preview":"Preview","tab.source":"Code","tab.history":"History","tab.export":"Export","tab.reload":"Reload","tab.rename":"Rename","tab.delete":"Move to trash","tab.deleteConfirm":'"{title}" moves to the trash. Its files stay there for 7 days.',"tab.save":"Save","tab.saving":"Saving...","tab.saved":"Saved","tab.readOnly":"Read-only","tab.saveFailed":"Save failed","tab.unsaved":"Unsaved changes","tab.frameTitle":"Artifact preview: {title}","tab.versionOf":"Version {version}","tab.viewingOld":"Viewing version {version}. The current version is {current}.","tab.backToCurrent":"Back to current","tab.restoreThis":"Restore this version","tab.conflictTitle":"This artifact changed","tab.conflictHint":"A newer version was saved while you were editing. Your draft is kept here. Copy it before discarding, then reload the latest version.","tab.deleted":"This artifact is no longer here","tab.deletedHint":"It was moved to the trash or deleted.","tab.close":"Close tab","history.title":"Versions","history.current":"Current","history.byAgent":"Agent","history.byUser":"You","history.restored":"Restored from v{version}","history.created":"Created","history.updated":"Edited","history.empty":"No earlier versions.","export.html":"HTML file","export.png":"PNG image","export.svg":"SVG image","export.fig":"OpenPencil document (.fig)","export.md":"Markdown file","export.docx":"Word document","export.print":"Print or save as PDF","export.done":"Saved {name} to {path}","design.title":"Design system","design.hint":"Pages and documents use these values through CSS variables.","design.source.workspace":"This project overrides the library.","design.source.library":"Inherited from your library.","design.source.default":"Built-in defaults. Save to start your own.","design.name":"Name","design.colors":"Colors","design.color.primary":"Primary","design.color.accent":"Accent","design.color.surface":"Surface","design.color.text":"Text","design.color.muted":"Muted","design.type":"Typography","design.font":"Body font stack","design.mono":"Code font stack","design.radius":"Corner radius","design.radius.sm":"Small","design.radius.md":"Medium","design.radius.lg":"Large","design.notes":"Notes for the agent","design.notesHint":"Tone, layout rules, or brand guidance the agent reads before it designs.","design.saveWorkspace":"Save for this project","design.saveWorkspaceNamed":"Save for {name}","design.saveLibrary":"Save to library","design.clear":"Remove project override","design.saved":"Design system saved","design.preview":"Preview","design.previewHeading":"Quarterly review","design.previewBody":"Revenue grew in every region this quarter.","design.previewButton":"Primary action","card.created":"Created","card.updated":"Updated","card.working":"Writing the artifact...","card.failed":"The artifact was not saved","card.missing":"This result has no artifact details.","composer.label":"Artifacts","error.generic":"Something went wrong. Try again.","error.designInvalid":"The mockup source is not valid.","error.designIcon":"The mockup cannot use that icon.","error.designRender":"The mockup could not be rendered.","error.designTimeout":"The mockup took too long to render.","error.designUnavailable":"This runtime cannot render mockups.","error.unsupportedType":"That action is not available for this artifact.","error.notFound":"This artifact no longer exists.","error.stale":"The artifact changed. Reload to continue.","error.tooLarge":"The content is over the 2 MiB limit.","error.noWorkspace":"This session has no workspace.","error.forbidden":"That path is not allowed.","error.corrupt":"The artifact files are damaged.","error.tokens":"A design value is not valid CSS.","error.library":"The library folder cannot be created.","error.surface":"The artifact panel failed to draw.","error.surfaceHint":"Reload the window. Your artifacts are safe on disk.","action.retry":"Retry","action.reloadWindow":"Reload window","time.justNow":"just now","time.minutes":"{count} min ago","time.hours":"{count} h ago","time.days":"{count} d ago"},Rr={"agent.ask":"\u8BA9\u667A\u80FD\u4F53\u4FEE\u6539","agent.reference":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0Cv{version}\uFF09\u4E2D\uFF1A","agent.referenceOld":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0Cv{version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A v{current}\uFF09\u4E2D\uFF1A","agent.added":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u63CF\u8FF0\u8981\u4FEE\u6539\u7684\u5185\u5BB9\u540E\u53D1\u9001\u3002","agent.addedTruncated":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u9009\u4E2D\u7684\u6587\u672C\u5DF2\u7F29\u77ED\u4E3A 2,000 \u4E2A\u5B57\u7B26\u3002","agent.insertFailed":"\u6D88\u606F\u6846\u6B63\u5FD9\uFF0C\u5DF2\u6539\u4E3A\u590D\u5236\u8BF7\u6C42\u3002","agent.copied":"\u5DF2\u590D\u5236\u3002\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u540E\u53D1\u9001\u3002","agent.copyTitle":"\u590D\u5236\u8BF7\u6C42","card.creating":"\u6B63\u5728\u521B\u5EFA {title}","card.updating":"\u6B63\u5728\u66F4\u65B0 {title}","card.updatingUntitled":"\u6B63\u5728\u66F4\u65B0\u4EA7\u7269","card.openNamed":"\u6253\u5F00 {title}","tab.codeHint":"\u53EA\u8BFB\u4EE3\u7801\u3002\u9009\u4E2D\u6587\u672C\u5373\u53EF\u8BA9\u667A\u80FD\u4F53\u5904\u7406\u3002","tab.editSource":"\u7F16\u8F91\u4EE3\u7801","tab.deleteTitle":"\u79FB\u5230\u56DE\u6536\u7AD9\uFF1F","code.copy":"\u590D\u5236\u4EE3\u7801","dialog.close":"\u5173\u95ED","dialog.done":"\u5B8C\u6210","design.colorsDark":"\u6DF1\u8272\u914D\u8272","panel.layers":"\u56FE\u5C42","panel.properties":"\u5C5E\u6027","panel.none":"\u6CA1\u6709\u56FE\u5C42","panel.mixed":"\u6DF7\u5408","panel.expand":"\u5C55\u5F00","panel.collapse":"\u6298\u53E0","panel.show":"\u663E\u793A","panel.hide":"\u9690\u85CF","panel.lock":"\u9501\u5B9A","panel.unlock":"\u89E3\u9501","panel.rename":"\u91CD\u547D\u540D\u56FE\u5C42","panel.x":"X","panel.y":"Y","panel.rotation":"\u65CB\u8F6C","panel.radius":"\u5706\u89D2","panel.opacity":"\u4E0D\u900F\u660E\u5EA6","panel.visible":"\u53EF\u89C1","panel.hidden":"\u5DF2\u9690\u85CF","panel.family":"\u5B57\u4F53","panel.weight":"\u5B57\u91CD","panel.fontSize":"\u5B57\u53F7","panel.w":"\u5BBD","panel.h":"\u9AD8","panel.positionSize":"\u4F4D\u7F6E\u548C\u5C3A\u5BF8","panel.appearance":"\u5916\u89C2","panel.text":"\u6587\u672C","panel.selectLayerHint":"\u9009\u62E9\u4E00\u4E2A\u56FE\u5C42\u4EE5\u67E5\u770B\u5176\u5C5E\u6027\u3002","panel.selectTextHint":"\u9009\u62E9\u6587\u672C\u56FE\u5C42\u53EF\u4FEE\u6539\u5B57\u4F53\u3001\u5B57\u91CD\u548C\u5B57\u53F7\u3002","layer.parentLine":"{type}\uFF0C\u4F4D\u4E8E {parent}","layer.type.frame":"\u6846\u67B6","layer.type.section":"\u5206\u533A","layer.type.text":"\u6587\u672C","layer.type.rectangle":"\u77E9\u5F62","layer.type.ellipse":"\u692D\u5706","layer.type.line":"\u7EBF","layer.type.vector":"\u77E2\u91CF","layer.type.group":"\u7F16\u7EC4","layer.type.component":"\u7EC4\u4EF6","layer.type.instance":"\u5B9E\u4F8B","layer.type.other":"\u56FE\u5C42","canvas.viewMode":"\u67E5\u770B","canvas.editMode":"\u7F16\u8F91","canvas.opening":"\u6B63\u5728\u6253\u5F00\u753B\u5E03\u2026","canvas.startFailed":"\u753B\u5E03\u672A\u80FD\u542F\u52A8\uFF0C\u73B0\u663E\u793A\u5DF2\u4FDD\u5B58\u7684\u56FE\u7247\u3002","canvas.empty":"\u6B64\u539F\u578B\u8FD8\u6CA1\u6709\u56FE\u5C42\u3002\u5207\u6362\u5230\u7F16\u8F91\u6A21\u5F0F\u5373\u53EF\u7ED8\u5236\u3002","canvas.zoomControls":"\u7F29\u653E","canvas.zoomOut":"\u7F29\u5C0F","canvas.zoomIn":"\u653E\u5927","canvas.zoomMenu":"\u7F29\u653E\u7EA7\u522B","canvas.zoomValue":"{percent}%","canvas.inspector":"\u68C0\u67E5\u5668","canvas.closeInspector":"\u5173\u95ED\u68C0\u67E5\u5668","canvas.inspectorTabs":"\u68C0\u67E5\u5668\u5206\u533A","canvas.editOldVersion":"\u65E7\u7248\u672C\u4EC5\u53EF\u67E5\u770B\u3002\u6062\u590D\u6B64\u7248\u672C\u540E\u624D\u80FD\u7F16\u8F91\u3002","agent.quoteDesign":`\u56FE\u5C42\u201C{name}\u201D
|
|
25
|
+
Design JSX:`,"agent.quoteCut":"The Design JSX was shortened to {limit} characters.","agent.addedTruncatedDesign":"Added to your message. The layer's code was shortened to 4,000 characters.","canvas.toolbar":"Canvas tools","canvas.tools":"Tool","canvas.select":"Select","canvas.hand":"Hand","canvas.frame":"Frame","canvas.text":"Text","canvas.undo":"Undo","canvas.redo":"Redo","canvas.fit":"Fit","preview.loading":"Rendering the mockup\u2026","preview.retry":"Render again","preview.warnings":"Preview warnings","error.designIconNotFound":"That icon is not in the bundled set. Use an mdi: name from Material Design Icons.","design.display":"Heading font stack","composer.recent":"This project","composer.empty":"No artifacts yet","composer.start":"Start with","composer.all":"All artifacts","gallery.copyPrompt":"Copy prompt","gallery.copyPromptNamed":"Copy the {name} prompt","gallery.promptCopied":"Prompt copied. Paste it into a conversation.","prompt.dashboard":"Dashboard","prompt.dashboardText":"Create an artifact page: a dashboard that shows ","prompt.explainer":"Explainer","prompt.explainerText":"Create an artifact page: a one-page visual explainer of ","prompt.report":"Report","prompt.reportText":"Create an artifact doc: a report about ","prompt.brief":"Project brief","prompt.briefText":"Create an artifact doc: a project brief with context, goal, scope, and open questions for ","filter.type":"Filter by type","tab.mode":"Page view","tab.manualSave":"Page source saves with Save or Ctrl/Cmd+S.","tab.manualSaveDesign":"Mockup source saves with Save or Ctrl/Cmd+S.","tab.versionPicker":"Choose version","tab.currentVersion":"current","tab.allVersions":"All versions","tab.agentUpdate":"Updated to v{version}","tab.viewHistory":"View history","tab.dismiss":"Dismiss","tab.leaveTitle":"Unsaved changes","tab.leaveHint":"Save your changes before continuing, or discard them.","tab.leaveDiscard":"Discard","tab.leaveSave":"Save","tab.copyDraft":"Copy my draft","tab.discardReload":"Discard mine and reload","history.close":"Close history","action.copied":"Copied","action.copyFailed":"Copy was blocked. Select the text and copy it manually.","format.toolbar":"Document formatting","format.heading":"Heading","format.bold":"Bold","format.italic":"Italic","format.bulletList":"Bullet list","format.orderedList":"Numbered list","format.codeBlock":"Code block",panel:"Artifacts","action.back":"Back","scope.label":"Scope","scope.all":"All projects","scope.workspace":"This project","scope.library":"Library","type.page":"Page","type.doc":"Document","type.design":"Mockup","type.all":"All types","gallery.search":"Search artifacts","gallery.searchLabel":"Search by title","gallery.create":"New artifact","gallery.newPage":"New page","gallery.newDoc":"New document","gallery.newDesign":"New mockup","gallery.design":"Design system","gallery.refresh":"Refresh","gallery.more":"Show more","gallery.truncated":"Only the first 500 artifacts are scanned.","gallery.failedProjects":"Some sources could not be loaded.","gallery.version":"v{version}","gallery.updated":"Updated {time}","gallery.count":"{count} artifacts","gallery.pinned":"Pinned","gallery.recent":"Recently updated","gallery.coverTitle":"Preview of {title}","gallery.coverFailed":"Preview unavailable","gallery.pin":"Pin {title}","gallery.unpin":"Unpin {title}","gallery.allPinned":"Everything here is pinned.","empty.workspaceTitle":"No artifacts in this project yet","empty.workspaceHint":"Ask the agent for a dashboard, report, or one-pager, or start one here.","empty.allTitle":"No artifacts yet","empty.allHint":"Artifacts from every project and your library appear here.","empty.libraryTitle":"Your library is empty","empty.libraryHint":"Library artifacts follow you to every project. Ask the agent to save one to the library.","empty.noMatch":"Nothing matches that search.","empty.typeMatch":"No {type} artifacts match the filter.","empty.noWorkspace":"Open a session in a workspace to see its artifacts.","empty.loading":"Loading...","create.title":"New {type}","create.name":"Title","create.scope":"Save to","create.submit":"Create","create.cancel":"Cancel","create.untitledPage":"Untitled page","create.untitledDesign":"Untitled mockup","create.untitledDoc":"Untitled document","tab.preview":"Preview","tab.source":"Code","tab.history":"History","tab.export":"Export","tab.reload":"Reload","tab.rename":"Rename","tab.delete":"Move to trash","tab.deleteConfirm":'"{title}" moves to the trash. Its files stay there for 7 days.',"tab.save":"Save","tab.saving":"Saving...","tab.saved":"Saved","tab.readOnly":"Read-only","tab.saveFailed":"Save failed","tab.unsaved":"Unsaved changes","tab.frameTitle":"Artifact preview: {title}","tab.versionOf":"Version {version}","tab.viewingOld":"Viewing version {version}. The current version is {current}.","tab.backToCurrent":"Back to current","tab.restoreThis":"Restore this version","tab.conflictTitle":"This artifact changed","tab.conflictHint":"A newer version was saved while you were editing. Your draft is kept here. Copy it before discarding, then reload the latest version.","tab.deleted":"This artifact is no longer here","tab.deletedHint":"It was moved to the trash or deleted.","tab.close":"Close tab","history.title":"Versions","history.current":"Current","history.byAgent":"Agent","history.byUser":"You","history.restored":"Restored from v{version}","history.created":"Created","history.updated":"Edited","history.empty":"No earlier versions.","export.html":"HTML file","export.png":"PNG image","export.svg":"SVG image","export.fig":"OpenPencil document (.fig)","export.md":"Markdown file","export.docx":"Word document","export.print":"Print or save as PDF","export.done":"Saved {name} to {path}","design.title":"Design system","design.hint":"Pages and documents use these values through CSS variables.","design.source.workspace":"This project overrides the library.","design.source.library":"Inherited from your library.","design.source.default":"Built-in defaults. Save to start your own.","design.name":"Name","design.colors":"Colors","design.color.primary":"Primary","design.color.accent":"Accent","design.color.surface":"Surface","design.color.text":"Text","design.color.muted":"Muted","design.type":"Typography","design.font":"Body font stack","design.mono":"Code font stack","design.radius":"Corner radius","design.radius.sm":"Small","design.radius.md":"Medium","design.radius.lg":"Large","design.notes":"Notes for the agent","design.notesHint":"Tone, layout rules, or brand guidance the agent reads before it designs.","design.saveWorkspace":"Save for this project","design.saveWorkspaceNamed":"Save for {name}","design.saveLibrary":"Save to library","design.clear":"Remove project override","design.saved":"Design system saved","design.preview":"Preview","design.previewHeading":"Quarterly review","design.previewBody":"Revenue grew in every region this quarter.","design.previewButton":"Primary action","card.created":"Created","card.updated":"Updated","card.working":"Writing the artifact...","card.failed":"The artifact was not saved","card.missing":"This result has no artifact details.","composer.label":"Artifacts","error.generic":"Something went wrong. Try again.","error.designInvalid":"The mockup source is not valid.","error.designIcon":"The mockup cannot use that icon.","error.designRender":"The mockup could not be rendered.","error.designTimeout":"The mockup took too long to render.","error.designUnavailable":"This runtime cannot render mockups.","error.unsupportedType":"That action is not available for this artifact.","error.notFound":"This artifact no longer exists.","error.stale":"The artifact changed. Reload to continue.","error.tooLarge":"The content is over the 2 MiB limit.","error.noWorkspace":"This session has no workspace.","error.forbidden":"That path is not allowed.","error.corrupt":"The artifact files are damaged.","error.tokens":"A design value is not valid CSS.","error.library":"The library folder cannot be created.","error.surface":"The artifact panel failed to draw.","error.surfaceHint":"Reload the window. Your artifacts are safe on disk.","action.retry":"Retry","action.reloadWindow":"Reload window","time.justNow":"just now","time.minutes":"{count} min ago","time.hours":"{count} h ago","time.days":"{count} d ago"},Rr={"agent.ask":"\u8BA9\u667A\u80FD\u4F53\u4FEE\u6539","agent.reference":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0Cv{version}\uFF09\u4E2D\uFF1A","agent.referenceOld":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0Cv{version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A v{current}\uFF09\u4E2D\uFF1A","agent.added":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u63CF\u8FF0\u8981\u4FEE\u6539\u7684\u5185\u5BB9\u540E\u53D1\u9001\u3002","agent.addedTruncated":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u9009\u4E2D\u7684\u6587\u672C\u5DF2\u7F29\u77ED\u4E3A 2,000 \u4E2A\u5B57\u7B26\u3002","agent.insertFailed":"\u6D88\u606F\u6846\u6B63\u5FD9\uFF0C\u5DF2\u6539\u4E3A\u590D\u5236\u8BF7\u6C42\u3002","agent.copied":"\u5DF2\u590D\u5236\u3002\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u540E\u53D1\u9001\u3002","agent.copyTitle":"\u590D\u5236\u8BF7\u6C42","card.creating":"\u6B63\u5728\u521B\u5EFA {title}","card.updating":"\u6B63\u5728\u66F4\u65B0 {title}","card.updatingUntitled":"\u6B63\u5728\u66F4\u65B0\u4EA7\u7269","card.openNamed":"\u6253\u5F00 {title}","tab.codeHint":"\u53EA\u8BFB\u4EE3\u7801\u3002\u9009\u4E2D\u6587\u672C\u5373\u53EF\u8BA9\u667A\u80FD\u4F53\u5904\u7406\u3002","tab.editSource":"\u7F16\u8F91\u4EE3\u7801","tab.deleteTitle":"\u79FB\u5230\u56DE\u6536\u7AD9\uFF1F","code.copy":"\u590D\u5236\u4EE3\u7801","dialog.close":"\u5173\u95ED","dialog.done":"\u5B8C\u6210","design.colorsDark":"\u6DF1\u8272\u914D\u8272","panel.layers":"\u56FE\u5C42","panel.properties":"\u5C5E\u6027","panel.none":"\u6CA1\u6709\u56FE\u5C42","panel.mixed":"\u6DF7\u5408","panel.expand":"\u5C55\u5F00","panel.collapse":"\u6298\u53E0","panel.show":"\u663E\u793A","panel.hide":"\u9690\u85CF","panel.lock":"\u9501\u5B9A","panel.unlock":"\u89E3\u9501","panel.rename":"\u91CD\u547D\u540D\u56FE\u5C42","panel.x":"X","panel.y":"Y","panel.rotation":"\u65CB\u8F6C","panel.radius":"\u5706\u89D2","panel.opacity":"\u4E0D\u900F\u660E\u5EA6","panel.visible":"\u53EF\u89C1","panel.hidden":"\u5DF2\u9690\u85CF","panel.family":"\u5B57\u4F53","panel.weight":"\u5B57\u91CD","panel.fontSize":"\u5B57\u53F7","panel.w":"\u5BBD","panel.h":"\u9AD8","panel.positionSize":"\u4F4D\u7F6E\u548C\u5C3A\u5BF8","panel.appearance":"\u5916\u89C2","panel.text":"\u6587\u672C","panel.selectLayerHint":"\u9009\u62E9\u4E00\u4E2A\u56FE\u5C42\u4EE5\u67E5\u770B\u5176\u5C5E\u6027\u3002","panel.selectTextHint":"\u9009\u62E9\u6587\u672C\u56FE\u5C42\u53EF\u4FEE\u6539\u5B57\u4F53\u3001\u5B57\u91CD\u548C\u5B57\u53F7\u3002","layer.parentLine":"{type}\uFF0C\u4F4D\u4E8E {parent}","layer.type.frame":"\u6846\u67B6","layer.type.section":"\u5206\u533A","layer.type.text":"\u6587\u672C","layer.type.rectangle":"\u77E9\u5F62","layer.type.ellipse":"\u692D\u5706","layer.type.line":"\u7EBF","layer.type.vector":"\u77E2\u91CF","layer.type.group":"\u7F16\u7EC4","layer.type.component":"\u7EC4\u4EF6","layer.type.instance":"\u5B9E\u4F8B","layer.type.other":"\u56FE\u5C42","canvas.viewMode":"\u67E5\u770B","canvas.editMode":"\u7F16\u8F91","canvas.opening":"\u6B63\u5728\u6253\u5F00\u753B\u5E03\u2026","canvas.startFailed":"\u753B\u5E03\u672A\u80FD\u542F\u52A8\uFF0C\u73B0\u663E\u793A\u5DF2\u4FDD\u5B58\u7684\u56FE\u7247\u3002","canvas.empty":"\u6B64\u539F\u578B\u8FD8\u6CA1\u6709\u56FE\u5C42\u3002\u5207\u6362\u5230\u7F16\u8F91\u6A21\u5F0F\u5373\u53EF\u7ED8\u5236\u3002","canvas.zoomControls":"\u7F29\u653E","canvas.zoomOut":"\u7F29\u5C0F","canvas.zoomIn":"\u653E\u5927","canvas.zoomMenu":"\u7F29\u653E\u7EA7\u522B","canvas.zoomValue":"{percent}%","canvas.inspector":"\u68C0\u67E5\u5668","canvas.closeInspector":"\u5173\u95ED\u68C0\u67E5\u5668","canvas.inspectorTabs":"\u68C0\u67E5\u5668\u5206\u533A","canvas.editOldVersion":"\u65E7\u7248\u672C\u4EC5\u53EF\u67E5\u770B\u3002\u6062\u590D\u6B64\u7248\u672C\u540E\u624D\u80FD\u7F16\u8F91\u3002","agent.quoteDesign":`\u56FE\u5C42\u201C{name}\u201D
|
|
26
26
|
\u8DEF\u5F84\uFF1A{path}
|
|
27
27
|
|
|
28
|
-
\u8BBE\u8BA1 JSX\uFF1A`,"agent.quoteCut":"\u8BBE\u8BA1 JSX \u5DF2\u7F29\u77ED\u4E3A {limit} \u4E2A\u5B57\u7B26\u3002","agent.addedTruncatedDesign":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u56FE\u5C42\u4EE3\u7801\u5DF2\u7F29\u77ED\u4E3A 4,000 \u4E2A\u5B57\u7B26\u3002","canvas.toolbar":"\u753B\u5E03\u5DE5\u5177","canvas.tools":"\u5DE5\u5177","canvas.select":"\u9009\u62E9","canvas.hand":"\u6293\u624B","canvas.frame":"\u6846\u67B6","canvas.text":"\u6587\u672C","canvas.undo":"\u64A4\u9500","canvas.redo":"\u91CD\u505A","canvas.fit":"\u9002\u5E94","preview.loading":"\u6B63\u5728\u6E32\u67D3\u539F\u578B\u2026","preview.retry":"\u91CD\u65B0\u6E32\u67D3","preview.warnings":"\u9884\u89C8\u8B66\u544A","error.designIconNotFound":"\u8BE5\u56FE\u6807\u4E0D\u5728\u5185\u7F6E\u56FE\u6807\u96C6\u4E2D\u3002\u8BF7\u4F7F\u7528 Material Design Icons \u7684 mdi: \u540D\u79F0\u3002","design.display":"\u6807\u9898\u5B57\u4F53\u6808","composer.recent":"\u5F53\u524D\u9879\u76EE","composer.empty":"\u8FD8\u6CA1\u6709\u4EA7\u7269","composer.start":"\u4ECE\u8FD9\u91CC\u5F00\u59CB","composer.all":"\u5168\u90E8\u4EA7\u7269","gallery.copyPrompt":"\u590D\u5236\u63D0\u793A\u8BCD","gallery.copyPromptNamed":"\u590D\u5236\u201C{name}\u201D\u63D0\u793A\u8BCD","gallery.promptCopied":"\u63D0\u793A\u8BCD\u5DF2\u590D\u5236\u3002\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u5373\u53EF\u3002","prompt.dashboard":"\u4EEA\u8868\u76D8","prompt.dashboardText":"\u521B\u5EFA\u4E00\u4E2A artifact \u9875\u9762\uFF1A\u4E00\u4E2A\u4EEA\u8868\u76D8\uFF0C\u5C55\u793A","prompt.explainer":"\u56FE\u89E3\u8BF4\u660E","prompt.explainerText":"\u521B\u5EFA\u4E00\u4E2A artifact \u9875\u9762\uFF1A\u4E00\u9875\u53EF\u89C6\u5316\u8BF4\u660E\uFF0C\u4E3B\u9898\u662F","prompt.report":"\u62A5\u544A","prompt.reportText":"\u521B\u5EFA\u4E00\u4E2A artifact \u6587\u6863\uFF1A\u4E00\u4EFD\u62A5\u544A\uFF0C\u4E3B\u9898\u662F","prompt.brief":"\u9879\u76EE\u7B80\u4ECB","prompt.briefText":"\u521B\u5EFA\u4E00\u4E2A artifact \u6587\u6863\uFF1A\u4E00\u4EFD\u9879\u76EE\u7B80\u4ECB\uFF0C\u5305\u542B\u80CC\u666F\u3001\u76EE\u6807\u3001\u8303\u56F4\u548C\u5F85\u5B9A\u95EE\u9898\uFF0C\u9879\u76EE\u662F","filter.type":"\u6309\u7C7B\u578B\u7B5B\u9009","tab.mode":"\u9875\u9762\u89C6\u56FE","tab.manualSave":"\u9875\u9762\u6E90\u7801\u9700\u70B9\u51FB\u4FDD\u5B58\u6216\u6309 Ctrl/Cmd+S\u3002","tab.manualSaveDesign":"\u539F\u578B\u6E90\u7801\u9700\u70B9\u51FB\u4FDD\u5B58\u6216\u6309 Ctrl/Cmd+S\u3002","tab.versionPicker":"\u9009\u62E9\u7248\u672C","tab.currentVersion":"\u5F53\u524D","tab.allVersions":"\u5168\u90E8\u7248\u672C","tab.agentUpdate":"\u5DF2\u66F4\u65B0\u5230 v{version}","tab.viewHistory":"\u67E5\u770B\u5386\u53F2","tab.dismiss":"\u5173\u95ED","tab.leaveTitle":"\u4FDD\u7559\u66F4\u6539\uFF1F","tab.leaveHint":"\u7EE7\u7EED\u524D\u4FDD\u5B58\u66F4\u6539\uFF0C\u6216\u653E\u5F03\u66F4\u6539\u3002\u53D6\u6D88\u5C06\u4FDD\u7559\u5F53\u524D\u7F16\u8F91\u3002","tab.discardContinue":"\u653E\u5F03\u5E76\u7EE7\u7EED","tab.saveContinue":"\u4FDD\u5B58\u5E76\u7EE7\u7EED","tab.copyDraft":"\u590D\u5236\u6211\u7684\u8349\u7A3F","tab.discardReload":"\u653E\u5F03\u6211\u7684\u66F4\u6539\u5E76\u91CD\u65B0\u52A0\u8F7D","history.close":"\u5173\u95ED\u5386\u53F2","action.copied":"\u5DF2\u590D\u5236","action.copyFailed":"\u590D\u5236\u88AB\u963B\u6B62\u3002\u8BF7\u9009\u4E2D\u6587\u672C\u540E\u624B\u52A8\u590D\u5236\u3002","format.toolbar":"\u6587\u6863\u683C\u5F0F","format.heading":"\u6807\u9898","format.bold":"\u7C97\u4F53","format.italic":"\u659C\u4F53","format.bulletList":"\u9879\u76EE\u7B26\u53F7\u5217\u8868","format.orderedList":"\u7F16\u53F7\u5217\u8868","format.codeBlock":"\u4EE3\u7801\u5757",panel:"\u4EA7\u7269","action.back":"\u8FD4\u56DE","scope.label":"\u8303\u56F4","scope.all":"\u5168\u90E8\u9879\u76EE","scope.workspace":"\u5F53\u524D\u9879\u76EE","scope.library":"\u8D44\u6599\u5E93","type.page":"\u9875\u9762","type.doc":"\u6587\u6863","type.design":"\u539F\u578B","type.all":"\u5168\u90E8\u7C7B\u578B","gallery.search":"\u641C\u7D22\u4EA7\u7269","gallery.searchLabel":"\u6309\u6807\u9898\u641C\u7D22","gallery.create":"\u65B0\u5EFA\u4EA7\u7269","gallery.newPage":"\u65B0\u5EFA\u9875\u9762","gallery.newDoc":"\u65B0\u5EFA\u6587\u6863","gallery.newDesign":"\u65B0\u5EFA\u539F\u578B","gallery.design":"\u8BBE\u8BA1\u7CFB\u7EDF","gallery.refresh":"\u5237\u65B0","gallery.more":"\u663E\u793A\u66F4\u591A","gallery.truncated":"\u4EC5\u626B\u63CF\u524D 500 \u4E2A\u4EA7\u7269\u3002","gallery.failedProjects":"\u90E8\u5206\u6765\u6E90\u52A0\u8F7D\u5931\u8D25\u3002","gallery.version":"v{version}","gallery.updated":"\u66F4\u65B0\u4E8E {time}","gallery.count":"{count} \u4E2A\u4EA7\u7269","gallery.pinned":"\u5DF2\u7F6E\u9876","gallery.recent":"\u6700\u8FD1\u66F4\u65B0","gallery.coverTitle":"{title} \u7684\u9884\u89C8","gallery.coverFailed":"\u9884\u89C8\u4E0D\u53EF\u7528","gallery.pin":"\u7F6E\u9876 {title}","gallery.unpin":"\u53D6\u6D88\u7F6E\u9876 {title}","gallery.allPinned":"\u8FD9\u91CC\u7684\u4EA7\u7269\u90FD\u5DF2\u7F6E\u9876\u3002","empty.workspaceTitle":"\u672C\u9879\u76EE\u8FD8\u6CA1\u6709\u4EA7\u7269","empty.workspaceHint":"\u8BA9\u667A\u80FD\u4F53\u751F\u6210\u4EEA\u8868\u76D8\u3001\u62A5\u544A\u6216\u5355\u9875\uFF0C\u6216\u5728\u8FD9\u91CC\u65B0\u5EFA\u3002","empty.allTitle":"\u8FD8\u6CA1\u6709\u4EA7\u7269","empty.allHint":"\u8FD9\u91CC\u663E\u793A\u6240\u6709\u9879\u76EE\u548C\u8D44\u6599\u5E93\u4E2D\u7684\u4EA7\u7269\u3002","empty.libraryTitle":"\u8D44\u6599\u5E93\u4E3A\u7A7A","empty.libraryHint":"\u8D44\u6599\u5E93\u4E2D\u7684\u4EA7\u7269\u5728\u6240\u6709\u9879\u76EE\u53EF\u7528\u3002\u8BA9\u667A\u80FD\u4F53\u628A\u4EA7\u7269\u4FDD\u5B58\u5230\u8D44\u6599\u5E93\u3002","empty.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u4EA7\u7269\u3002","empty.typeMatch":"\u6CA1\u6709\u7B26\u5408\u7C7B\u578B\u7B5B\u9009\u7684{type}\u4EA7\u7269\u3002","empty.noWorkspace":"\u5728\u5DE5\u4F5C\u533A\u4E2D\u6253\u5F00\u4F1A\u8BDD\u4EE5\u67E5\u770B\u5176\u4EA7\u7269\u3002","empty.loading":"\u52A0\u8F7D\u4E2D...","create.title":"\u65B0\u5EFA{type}","create.name":"\u6807\u9898","create.scope":"\u4FDD\u5B58\u5230","create.submit":"\u521B\u5EFA","create.cancel":"\u53D6\u6D88","create.untitledPage":"\u672A\u547D\u540D\u9875\u9762","create.untitledDesign":"\u672A\u547D\u540D\u539F\u578B","create.untitledDoc":"\u672A\u547D\u540D\u6587\u6863","tab.preview":"\u9884\u89C8","tab.source":"\u4EE3\u7801","tab.history":"\u5386\u53F2","tab.export":"\u5BFC\u51FA","tab.reload":"\u91CD\u65B0\u52A0\u8F7D","tab.rename":"\u91CD\u547D\u540D","tab.delete":"\u79FB\u5230\u56DE\u6536\u7AD9","tab.deleteConfirm":"\u201C{title}\u201D\u5C06\u79FB\u5230\u56DE\u6536\u7AD9\uFF0C\u6587\u4EF6\u4F1A\u4FDD\u7559 7 \u5929\u3002","tab.save":"\u4FDD\u5B58","tab.saving":"\u6B63\u5728\u4FDD\u5B58...","tab.saved":"\u5DF2\u4FDD\u5B58","tab.readOnly":"\u53EA\u8BFB","tab.saveFailed":"\u4FDD\u5B58\u5931\u8D25","tab.unsaved":"\u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539","tab.frameTitle":"\u4EA7\u7269\u9884\u89C8\uFF1A{title}","tab.versionOf":"\u7248\u672C {version}","tab.viewingOld":"\u6B63\u5728\u67E5\u770B\u7248\u672C {version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A {current}\u3002","tab.backToCurrent":"\u56DE\u5230\u5F53\u524D\u7248\u672C","tab.restoreThis":"\u6062\u590D\u6B64\u7248\u672C","tab.conflictTitle":"\u6B64\u4EA7\u7269\u5DF2\u66F4\u6539","tab.conflictHint":"\u7F16\u8F91\u671F\u95F4\u4FDD\u5B58\u4E86\u66F4\u65B0\u7248\u672C\u3002\u8349\u7A3F\u4ECD\u4FDD\u7559\u5728\u8FD9\u91CC\u3002\u653E\u5F03\u524D\u53EF\u5148\u590D\u5236\u8349\u7A3F\uFF0C\u518D\u91CD\u65B0\u52A0\u8F7D\u6700\u65B0\u7248\u672C\u3002","tab.deleted":"\u6B64\u4EA7\u7269\u5DF2\u4E0D\u5B58\u5728","tab.deletedHint":"\u5B83\u5DF2\u88AB\u79FB\u5230\u56DE\u6536\u7AD9\u6216\u5220\u9664\u3002","tab.close":"\u5173\u95ED\u6807\u7B7E\u9875","history.title":"\u7248\u672C","history.current":"\u5F53\u524D","history.byAgent":"\u667A\u80FD\u4F53","history.byUser":"\u4F60","history.restored":"\u4ECE v{version} \u6062\u590D","history.created":"\u521B\u5EFA","history.updated":"\u7F16\u8F91","history.empty":"\u6CA1\u6709\u66F4\u65E9\u7684\u7248\u672C\u3002","export.html":"HTML \u6587\u4EF6","export.png":"PNG \u56FE\u7247","export.svg":"SVG \u56FE\u7247","export.fig":"OpenPencil \u6587\u6863\uFF08.fig\uFF09","export.md":"Markdown \u6587\u4EF6","export.docx":"Word \u6587\u6863","export.print":"\u6253\u5370\u6216\u53E6\u5B58\u4E3A PDF","export.done":"\u5DF2\u5C06 {name} \u4FDD\u5B58\u5230 {path}","design.title":"\u8BBE\u8BA1\u7CFB\u7EDF","design.hint":"\u9875\u9762\u548C\u6587\u6863\u901A\u8FC7 CSS \u53D8\u91CF\u4F7F\u7528\u8FD9\u4E9B\u503C\u3002","design.source.workspace":"\u672C\u9879\u76EE\u8986\u76D6\u4E86\u8D44\u6599\u5E93\u8BBE\u7F6E\u3002","design.source.library":"\u7EE7\u627F\u81EA\u8D44\u6599\u5E93\u3002","design.source.default":"\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\u4FDD\u5B58\u540E\u5373\u53EF\u81EA\u5B9A\u4E49\u3002","design.name":"\u540D\u79F0","design.colors":"\u989C\u8272","design.color.primary":"\u4E3B\u8272","design.color.accent":"\u5F3A\u8C03\u8272","design.color.surface":"\u5E95\u8272","design.color.text":"\u6587\u5B57","design.color.muted":"\u6B21\u8981","design.type":"\u5B57\u4F53","design.font":"\u6B63\u6587\u5B57\u4F53","design.mono":"\u4EE3\u7801\u5B57\u4F53","design.radius":"\u5706\u89D2","design.radius.sm":"\u5C0F","design.radius.md":"\u4E2D","design.radius.lg":"\u5927","design.notes":"\u7ED9\u667A\u80FD\u4F53\u7684\u8BF4\u660E","design.notesHint":"\u667A\u80FD\u4F53\u8BBE\u8BA1\u524D\u4F1A\u8BFB\u53D6\u7684\u8BED\u6C14\u3001\u6392\u7248\u89C4\u5219\u6216\u54C1\u724C\u89C4\u8303\u3002","design.saveWorkspace":"\u4FDD\u5B58\u5230\u672C\u9879\u76EE","design.saveWorkspaceNamed":"\u4FDD\u5B58\u5230 {name}","design.saveLibrary":"\u4FDD\u5B58\u5230\u8D44\u6599\u5E93","design.clear":"\u79FB\u9664\u9879\u76EE\u8986\u76D6","design.saved":"\u8BBE\u8BA1\u7CFB\u7EDF\u5DF2\u4FDD\u5B58","design.preview":"\u9884\u89C8","design.previewHeading":"\u5B63\u5EA6\u56DE\u987E","design.previewBody":"\u672C\u5B63\u5EA6\u5404\u533A\u57DF\u6536\u5165\u5747\u6709\u589E\u957F\u3002","design.previewButton":"\u4E3B\u8981\u64CD\u4F5C","card.created":"\u5DF2\u521B\u5EFA","card.updated":"\u5DF2\u66F4\u65B0","card.working":"\u6B63\u5728\u5199\u5165\u4EA7\u7269...","card.failed":"\u4EA7\u7269\u672A\u4FDD\u5B58","card.missing":"\u6B64\u7ED3\u679C\u6CA1\u6709\u4EA7\u7269\u4FE1\u606F\u3002","composer.label":"\u4EA7\u7269","error.generic":"\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5\u3002","error.designInvalid":"\u539F\u578B\u6E90\u7801\u65E0\u6548\u3002","error.designIcon":"\u8BE5\u539F\u578B\u65E0\u6CD5\u4F7F\u7528\u6B64\u56FE\u6807\u3002","error.designRender":"\u539F\u578B\u65E0\u6CD5\u6E32\u67D3\u3002","error.designTimeout":"\u539F\u578B\u6E32\u67D3\u8D85\u65F6\u3002","error.designUnavailable":"\u6B64\u8FD0\u884C\u65F6\u65E0\u6CD5\u6E32\u67D3\u539F\u578B\u3002","error.unsupportedType":"\u8BE5\u4EA7\u7269\u4E0D\u652F\u6301\u6B64\u64CD\u4F5C\u3002","error.notFound":"\u6B64\u4EA7\u7269\u5DF2\u4E0D\u5B58\u5728\u3002","error.stale":"\u4EA7\u7269\u5DF2\u66F4\u6539\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u3002","error.tooLarge":"\u5185\u5BB9\u8D85\u8FC7 2 MiB \u4E0A\u9650\u3002","error.noWorkspace":"\u6B64\u4F1A\u8BDD\u6CA1\u6709\u5DE5\u4F5C\u533A\u3002","error.forbidden":"\u4E0D\u5141\u8BB8\u8BBF\u95EE\u8BE5\u8DEF\u5F84\u3002","error.corrupt":"\u4EA7\u7269\u6587\u4EF6\u5DF2\u635F\u574F\u3002","error.tokens":"\u67D0\u4E2A\u8BBE\u8BA1\u503C\u4E0D\u662F\u6709\u6548\u7684 CSS\u3002","error.library":"\u65E0\u6CD5\u521B\u5EFA\u8D44\u6599\u5E93\u6587\u4EF6\u5939\u3002","error.surface":"\u4EA7\u7269\u9762\u677F\u7ED8\u5236\u5931\u8D25\u3002","error.surfaceHint":"\u8BF7\u91CD\u65B0\u52A0\u8F7D\u7A97\u53E3\u3002\u4F60\u7684\u4EA7\u7269\u4ECD\u5B89\u5168\u4FDD\u5B58\u5728\u78C1\u76D8\u4E0A\u3002","action.retry":"\u91CD\u8BD5","action.reloadWindow":"\u91CD\u65B0\u52A0\u8F7D\u7A97\u53E3","time.justNow":"\u521A\u521A","time.minutes":"{count} \u5206\u949F\u524D","time.hours":"{count} \u5C0F\u65F6\u524D","time.days":"{count} \u5929\u524D"};function Lt(e,t,a=Date.now()){let r=Math.max(0,a-Date.parse(t)),n=Math.floor(r/6e4);if(n<1)return e("time.justNow");if(n<60)return e("time.minutes",{count:n});let o=Math.floor(n/60);if(o<24)return e("time.hours",{count:o});let l=Math.floor(o/24);return l<7?e("time.days",{count:l}):new Date(t).toLocaleDateString()}var pe=require("react/jsx-runtime");function uo(e,t){let a=t.source.origin==="agent"?e("history.byAgent"):e("history.byUser"),r=t.source.action==="restore"&&t.source.restoredFrom!==void 0?e("history.restored",{version:t.source.restoredFrom}):t.source.action==="create"?e("history.created"):e("history.updated");return`${a} \xB7 ${r} \xB7 ${Lt(e,t.createdAt)}`}function Ar({t:e,versions:t,failed:a,current:r,selected:n,onSelect:o}){return(0,pe.jsxs)("div",{className:"art-history-body",children:[t===null?(0,pe.jsx)("p",{className:"art-note",children:e("empty.loading")}):null,a?(0,pe.jsx)("p",{className:"art-note",children:e("error.generic")}):null,!a&&t!==null&&t.length<=1?(0,pe.jsx)("p",{className:"art-note",children:e("history.empty")}):null,t?.map(l=>(0,pe.jsxs)("button",{type:"button",className:"art-version","aria-current":l.version===n?"true":void 0,onClick:()=>o(l.version),children:[(0,pe.jsxs)("span",{className:"art-version-top",children:[(0,pe.jsx)("span",{children:e("tab.versionOf",{version:l.version})}),l.version===r?(0,pe.jsx)("span",{className:"art-badge",children:e("history.current")}):null]}),(0,pe.jsx)("span",{className:"art-version-sub",children:uo(e,l)})]},l.version))]})}var ye=require("react");var Ae=require("react/jsx-runtime");function Ot({content:e,designCss:t,title:a,frameTitle:r,dark:n=!1,onSelectionText:o}){let[l,s]=(0,ye.useState)(null),[g,d]=(0,ye.useState)(!1),b=(0,ye.useRef)(0),T=(0,ye.useRef)(null),w=(0,ye.useRef)(o);w.current=o;let c=o!==void 0;return(0,ye.useEffect)(()=>{b.current=0,d(!1);let u=URL.createObjectURL(new Blob([Mt(e,t,a,n?"dark":"light",c)],{type:"text/html"}));return s(u),()=>URL.revokeObjectURL(u)},[e,t,a,n,c]),(0,ye.useEffect)(()=>{if(!c)return;let u=p=>{if(T.current===null||b.current>1||p.source!==T.current.contentWindow)return;let y=Cr(p.data);y!==void 0&&w.current?.(y)};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[c]),g?(0,Ae.jsx)("div",{className:"art-center",role:"alert",children:a}):l===null?null:(0,Ae.jsx)("iframe",{ref:T,className:"art-frame",title:r,sandbox:Nr,referrerPolicy:"no-referrer",src:l,onLoad:()=>{b.current+=1,b.current>1&&d(!0)}},l)}function zr({value:e,readOnly:t,label:a,hint:r,onChange:n,onSave:o,onSelectionText:l}){let s=g=>{t||l?.(g.value.slice(g.selectionStart,g.selectionEnd))};return(0,Ae.jsxs)("div",{className:"art-source-wrap",children:[r===void 0?null:(0,Ae.jsx)("div",{className:"art-code-bar",children:(0,Ae.jsx)("span",{children:r})}),(0,Ae.jsx)("textarea",{className:"art-source","aria-label":a,spellCheck:!1,readOnly:t,value:e,autoFocus:!t,onChange:g=>{n(g.target.value),l?.("")},onSelect:g=>s(g.currentTarget),onMouseUp:g=>s(g.currentTarget),onKeyUp:g=>s(g.currentTarget),onKeyDown:g=>{if((g.ctrlKey||g.metaKey)&&g.key.toLowerCase()==="s"){g.preventDefault(),o();return}if(g.key==="Tab"&&!g.shiftKey&&!t){g.preventDefault();let d=g.currentTarget,b=d.selectionStart,T=d.selectionEnd,w=e.slice(0,b)+" "+e.slice(T);n(w),requestAnimationFrame(()=>d.setSelectionRange(b+2,b+2))}}})]})}function ma(e,t=2e3){let a=e.replace(/\r\n/g,`
|
|
28
|
+
\u8BBE\u8BA1 JSX\uFF1A`,"agent.quoteCut":"\u8BBE\u8BA1 JSX \u5DF2\u7F29\u77ED\u4E3A {limit} \u4E2A\u5B57\u7B26\u3002","agent.addedTruncatedDesign":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u56FE\u5C42\u4EE3\u7801\u5DF2\u7F29\u77ED\u4E3A 4,000 \u4E2A\u5B57\u7B26\u3002","canvas.toolbar":"\u753B\u5E03\u5DE5\u5177","canvas.tools":"\u5DE5\u5177","canvas.select":"\u9009\u62E9","canvas.hand":"\u6293\u624B","canvas.frame":"\u6846\u67B6","canvas.text":"\u6587\u672C","canvas.undo":"\u64A4\u9500","canvas.redo":"\u91CD\u505A","canvas.fit":"\u9002\u5E94","preview.loading":"\u6B63\u5728\u6E32\u67D3\u539F\u578B\u2026","preview.retry":"\u91CD\u65B0\u6E32\u67D3","preview.warnings":"\u9884\u89C8\u8B66\u544A","error.designIconNotFound":"\u8BE5\u56FE\u6807\u4E0D\u5728\u5185\u7F6E\u56FE\u6807\u96C6\u4E2D\u3002\u8BF7\u4F7F\u7528 Material Design Icons \u7684 mdi: \u540D\u79F0\u3002","design.display":"\u6807\u9898\u5B57\u4F53\u6808","composer.recent":"\u5F53\u524D\u9879\u76EE","composer.empty":"\u8FD8\u6CA1\u6709\u4EA7\u7269","composer.start":"\u4ECE\u8FD9\u91CC\u5F00\u59CB","composer.all":"\u5168\u90E8\u4EA7\u7269","gallery.copyPrompt":"\u590D\u5236\u63D0\u793A\u8BCD","gallery.copyPromptNamed":"\u590D\u5236\u201C{name}\u201D\u63D0\u793A\u8BCD","gallery.promptCopied":"\u63D0\u793A\u8BCD\u5DF2\u590D\u5236\u3002\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u5373\u53EF\u3002","prompt.dashboard":"\u4EEA\u8868\u76D8","prompt.dashboardText":"\u521B\u5EFA\u4E00\u4E2A artifact \u9875\u9762\uFF1A\u4E00\u4E2A\u4EEA\u8868\u76D8\uFF0C\u5C55\u793A","prompt.explainer":"\u56FE\u89E3\u8BF4\u660E","prompt.explainerText":"\u521B\u5EFA\u4E00\u4E2A artifact \u9875\u9762\uFF1A\u4E00\u9875\u53EF\u89C6\u5316\u8BF4\u660E\uFF0C\u4E3B\u9898\u662F","prompt.report":"\u62A5\u544A","prompt.reportText":"\u521B\u5EFA\u4E00\u4E2A artifact \u6587\u6863\uFF1A\u4E00\u4EFD\u62A5\u544A\uFF0C\u4E3B\u9898\u662F","prompt.brief":"\u9879\u76EE\u7B80\u4ECB","prompt.briefText":"\u521B\u5EFA\u4E00\u4E2A artifact \u6587\u6863\uFF1A\u4E00\u4EFD\u9879\u76EE\u7B80\u4ECB\uFF0C\u5305\u542B\u80CC\u666F\u3001\u76EE\u6807\u3001\u8303\u56F4\u548C\u5F85\u5B9A\u95EE\u9898\uFF0C\u9879\u76EE\u662F","filter.type":"\u6309\u7C7B\u578B\u7B5B\u9009","tab.mode":"\u9875\u9762\u89C6\u56FE","tab.manualSave":"\u9875\u9762\u6E90\u7801\u9700\u70B9\u51FB\u4FDD\u5B58\u6216\u6309 Ctrl/Cmd+S\u3002","tab.manualSaveDesign":"\u539F\u578B\u6E90\u7801\u9700\u70B9\u51FB\u4FDD\u5B58\u6216\u6309 Ctrl/Cmd+S\u3002","tab.versionPicker":"\u9009\u62E9\u7248\u672C","tab.currentVersion":"\u5F53\u524D","tab.allVersions":"\u5168\u90E8\u7248\u672C","tab.agentUpdate":"\u5DF2\u66F4\u65B0\u5230 v{version}","tab.viewHistory":"\u67E5\u770B\u5386\u53F2","tab.dismiss":"\u5173\u95ED","tab.leaveTitle":"\u672A\u4FDD\u5B58\u7684\u66F4\u6539","tab.leaveHint":"\u7EE7\u7EED\u524D\u4FDD\u5B58\u66F4\u6539\uFF0C\u6216\u653E\u5F03\u5B83\u4EEC\u3002","tab.leaveDiscard":"\u653E\u5F03","tab.leaveSave":"\u4FDD\u5B58","tab.copyDraft":"\u590D\u5236\u6211\u7684\u8349\u7A3F","tab.discardReload":"\u653E\u5F03\u6211\u7684\u66F4\u6539\u5E76\u91CD\u65B0\u52A0\u8F7D","history.close":"\u5173\u95ED\u5386\u53F2","action.copied":"\u5DF2\u590D\u5236","action.copyFailed":"\u590D\u5236\u88AB\u963B\u6B62\u3002\u8BF7\u9009\u4E2D\u6587\u672C\u540E\u624B\u52A8\u590D\u5236\u3002","format.toolbar":"\u6587\u6863\u683C\u5F0F","format.heading":"\u6807\u9898","format.bold":"\u7C97\u4F53","format.italic":"\u659C\u4F53","format.bulletList":"\u9879\u76EE\u7B26\u53F7\u5217\u8868","format.orderedList":"\u7F16\u53F7\u5217\u8868","format.codeBlock":"\u4EE3\u7801\u5757",panel:"\u4EA7\u7269","action.back":"\u8FD4\u56DE","scope.label":"\u8303\u56F4","scope.all":"\u5168\u90E8\u9879\u76EE","scope.workspace":"\u5F53\u524D\u9879\u76EE","scope.library":"\u8D44\u6599\u5E93","type.page":"\u9875\u9762","type.doc":"\u6587\u6863","type.design":"\u539F\u578B","type.all":"\u5168\u90E8\u7C7B\u578B","gallery.search":"\u641C\u7D22\u4EA7\u7269","gallery.searchLabel":"\u6309\u6807\u9898\u641C\u7D22","gallery.create":"\u65B0\u5EFA\u4EA7\u7269","gallery.newPage":"\u65B0\u5EFA\u9875\u9762","gallery.newDoc":"\u65B0\u5EFA\u6587\u6863","gallery.newDesign":"\u65B0\u5EFA\u539F\u578B","gallery.design":"\u8BBE\u8BA1\u7CFB\u7EDF","gallery.refresh":"\u5237\u65B0","gallery.more":"\u663E\u793A\u66F4\u591A","gallery.truncated":"\u4EC5\u626B\u63CF\u524D 500 \u4E2A\u4EA7\u7269\u3002","gallery.failedProjects":"\u90E8\u5206\u6765\u6E90\u52A0\u8F7D\u5931\u8D25\u3002","gallery.version":"v{version}","gallery.updated":"\u66F4\u65B0\u4E8E {time}","gallery.count":"{count} \u4E2A\u4EA7\u7269","gallery.pinned":"\u5DF2\u7F6E\u9876","gallery.recent":"\u6700\u8FD1\u66F4\u65B0","gallery.coverTitle":"{title} \u7684\u9884\u89C8","gallery.coverFailed":"\u9884\u89C8\u4E0D\u53EF\u7528","gallery.pin":"\u7F6E\u9876 {title}","gallery.unpin":"\u53D6\u6D88\u7F6E\u9876 {title}","gallery.allPinned":"\u8FD9\u91CC\u7684\u4EA7\u7269\u90FD\u5DF2\u7F6E\u9876\u3002","empty.workspaceTitle":"\u672C\u9879\u76EE\u8FD8\u6CA1\u6709\u4EA7\u7269","empty.workspaceHint":"\u8BA9\u667A\u80FD\u4F53\u751F\u6210\u4EEA\u8868\u76D8\u3001\u62A5\u544A\u6216\u5355\u9875\uFF0C\u6216\u5728\u8FD9\u91CC\u65B0\u5EFA\u3002","empty.allTitle":"\u8FD8\u6CA1\u6709\u4EA7\u7269","empty.allHint":"\u8FD9\u91CC\u663E\u793A\u6240\u6709\u9879\u76EE\u548C\u8D44\u6599\u5E93\u4E2D\u7684\u4EA7\u7269\u3002","empty.libraryTitle":"\u8D44\u6599\u5E93\u4E3A\u7A7A","empty.libraryHint":"\u8D44\u6599\u5E93\u4E2D\u7684\u4EA7\u7269\u5728\u6240\u6709\u9879\u76EE\u53EF\u7528\u3002\u8BA9\u667A\u80FD\u4F53\u628A\u4EA7\u7269\u4FDD\u5B58\u5230\u8D44\u6599\u5E93\u3002","empty.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u4EA7\u7269\u3002","empty.typeMatch":"\u6CA1\u6709\u7B26\u5408\u7C7B\u578B\u7B5B\u9009\u7684{type}\u4EA7\u7269\u3002","empty.noWorkspace":"\u5728\u5DE5\u4F5C\u533A\u4E2D\u6253\u5F00\u4F1A\u8BDD\u4EE5\u67E5\u770B\u5176\u4EA7\u7269\u3002","empty.loading":"\u52A0\u8F7D\u4E2D...","create.title":"\u65B0\u5EFA{type}","create.name":"\u6807\u9898","create.scope":"\u4FDD\u5B58\u5230","create.submit":"\u521B\u5EFA","create.cancel":"\u53D6\u6D88","create.untitledPage":"\u672A\u547D\u540D\u9875\u9762","create.untitledDesign":"\u672A\u547D\u540D\u539F\u578B","create.untitledDoc":"\u672A\u547D\u540D\u6587\u6863","tab.preview":"\u9884\u89C8","tab.source":"\u4EE3\u7801","tab.history":"\u5386\u53F2","tab.export":"\u5BFC\u51FA","tab.reload":"\u91CD\u65B0\u52A0\u8F7D","tab.rename":"\u91CD\u547D\u540D","tab.delete":"\u79FB\u5230\u56DE\u6536\u7AD9","tab.deleteConfirm":"\u201C{title}\u201D\u5C06\u79FB\u5230\u56DE\u6536\u7AD9\uFF0C\u6587\u4EF6\u4F1A\u4FDD\u7559 7 \u5929\u3002","tab.save":"\u4FDD\u5B58","tab.saving":"\u6B63\u5728\u4FDD\u5B58...","tab.saved":"\u5DF2\u4FDD\u5B58","tab.readOnly":"\u53EA\u8BFB","tab.saveFailed":"\u4FDD\u5B58\u5931\u8D25","tab.unsaved":"\u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539","tab.frameTitle":"\u4EA7\u7269\u9884\u89C8\uFF1A{title}","tab.versionOf":"\u7248\u672C {version}","tab.viewingOld":"\u6B63\u5728\u67E5\u770B\u7248\u672C {version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A {current}\u3002","tab.backToCurrent":"\u56DE\u5230\u5F53\u524D\u7248\u672C","tab.restoreThis":"\u6062\u590D\u6B64\u7248\u672C","tab.conflictTitle":"\u6B64\u4EA7\u7269\u5DF2\u66F4\u6539","tab.conflictHint":"\u7F16\u8F91\u671F\u95F4\u4FDD\u5B58\u4E86\u66F4\u65B0\u7248\u672C\u3002\u8349\u7A3F\u4ECD\u4FDD\u7559\u5728\u8FD9\u91CC\u3002\u653E\u5F03\u524D\u53EF\u5148\u590D\u5236\u8349\u7A3F\uFF0C\u518D\u91CD\u65B0\u52A0\u8F7D\u6700\u65B0\u7248\u672C\u3002","tab.deleted":"\u6B64\u4EA7\u7269\u5DF2\u4E0D\u5B58\u5728","tab.deletedHint":"\u5B83\u5DF2\u88AB\u79FB\u5230\u56DE\u6536\u7AD9\u6216\u5220\u9664\u3002","tab.close":"\u5173\u95ED\u6807\u7B7E\u9875","history.title":"\u7248\u672C","history.current":"\u5F53\u524D","history.byAgent":"\u667A\u80FD\u4F53","history.byUser":"\u4F60","history.restored":"\u4ECE v{version} \u6062\u590D","history.created":"\u521B\u5EFA","history.updated":"\u7F16\u8F91","history.empty":"\u6CA1\u6709\u66F4\u65E9\u7684\u7248\u672C\u3002","export.html":"HTML \u6587\u4EF6","export.png":"PNG \u56FE\u7247","export.svg":"SVG \u56FE\u7247","export.fig":"OpenPencil \u6587\u6863\uFF08.fig\uFF09","export.md":"Markdown \u6587\u4EF6","export.docx":"Word \u6587\u6863","export.print":"\u6253\u5370\u6216\u53E6\u5B58\u4E3A PDF","export.done":"\u5DF2\u5C06 {name} \u4FDD\u5B58\u5230 {path}","design.title":"\u8BBE\u8BA1\u7CFB\u7EDF","design.hint":"\u9875\u9762\u548C\u6587\u6863\u901A\u8FC7 CSS \u53D8\u91CF\u4F7F\u7528\u8FD9\u4E9B\u503C\u3002","design.source.workspace":"\u672C\u9879\u76EE\u8986\u76D6\u4E86\u8D44\u6599\u5E93\u8BBE\u7F6E\u3002","design.source.library":"\u7EE7\u627F\u81EA\u8D44\u6599\u5E93\u3002","design.source.default":"\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\u4FDD\u5B58\u540E\u5373\u53EF\u81EA\u5B9A\u4E49\u3002","design.name":"\u540D\u79F0","design.colors":"\u989C\u8272","design.color.primary":"\u4E3B\u8272","design.color.accent":"\u5F3A\u8C03\u8272","design.color.surface":"\u5E95\u8272","design.color.text":"\u6587\u5B57","design.color.muted":"\u6B21\u8981","design.type":"\u5B57\u4F53","design.font":"\u6B63\u6587\u5B57\u4F53","design.mono":"\u4EE3\u7801\u5B57\u4F53","design.radius":"\u5706\u89D2","design.radius.sm":"\u5C0F","design.radius.md":"\u4E2D","design.radius.lg":"\u5927","design.notes":"\u7ED9\u667A\u80FD\u4F53\u7684\u8BF4\u660E","design.notesHint":"\u667A\u80FD\u4F53\u8BBE\u8BA1\u524D\u4F1A\u8BFB\u53D6\u7684\u8BED\u6C14\u3001\u6392\u7248\u89C4\u5219\u6216\u54C1\u724C\u89C4\u8303\u3002","design.saveWorkspace":"\u4FDD\u5B58\u5230\u672C\u9879\u76EE","design.saveWorkspaceNamed":"\u4FDD\u5B58\u5230 {name}","design.saveLibrary":"\u4FDD\u5B58\u5230\u8D44\u6599\u5E93","design.clear":"\u79FB\u9664\u9879\u76EE\u8986\u76D6","design.saved":"\u8BBE\u8BA1\u7CFB\u7EDF\u5DF2\u4FDD\u5B58","design.preview":"\u9884\u89C8","design.previewHeading":"\u5B63\u5EA6\u56DE\u987E","design.previewBody":"\u672C\u5B63\u5EA6\u5404\u533A\u57DF\u6536\u5165\u5747\u6709\u589E\u957F\u3002","design.previewButton":"\u4E3B\u8981\u64CD\u4F5C","card.created":"\u5DF2\u521B\u5EFA","card.updated":"\u5DF2\u66F4\u65B0","card.working":"\u6B63\u5728\u5199\u5165\u4EA7\u7269...","card.failed":"\u4EA7\u7269\u672A\u4FDD\u5B58","card.missing":"\u6B64\u7ED3\u679C\u6CA1\u6709\u4EA7\u7269\u4FE1\u606F\u3002","composer.label":"\u4EA7\u7269","error.generic":"\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5\u3002","error.designInvalid":"\u539F\u578B\u6E90\u7801\u65E0\u6548\u3002","error.designIcon":"\u8BE5\u539F\u578B\u65E0\u6CD5\u4F7F\u7528\u6B64\u56FE\u6807\u3002","error.designRender":"\u539F\u578B\u65E0\u6CD5\u6E32\u67D3\u3002","error.designTimeout":"\u539F\u578B\u6E32\u67D3\u8D85\u65F6\u3002","error.designUnavailable":"\u6B64\u8FD0\u884C\u65F6\u65E0\u6CD5\u6E32\u67D3\u539F\u578B\u3002","error.unsupportedType":"\u8BE5\u4EA7\u7269\u4E0D\u652F\u6301\u6B64\u64CD\u4F5C\u3002","error.notFound":"\u6B64\u4EA7\u7269\u5DF2\u4E0D\u5B58\u5728\u3002","error.stale":"\u4EA7\u7269\u5DF2\u66F4\u6539\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u3002","error.tooLarge":"\u5185\u5BB9\u8D85\u8FC7 2 MiB \u4E0A\u9650\u3002","error.noWorkspace":"\u6B64\u4F1A\u8BDD\u6CA1\u6709\u5DE5\u4F5C\u533A\u3002","error.forbidden":"\u4E0D\u5141\u8BB8\u8BBF\u95EE\u8BE5\u8DEF\u5F84\u3002","error.corrupt":"\u4EA7\u7269\u6587\u4EF6\u5DF2\u635F\u574F\u3002","error.tokens":"\u67D0\u4E2A\u8BBE\u8BA1\u503C\u4E0D\u662F\u6709\u6548\u7684 CSS\u3002","error.library":"\u65E0\u6CD5\u521B\u5EFA\u8D44\u6599\u5E93\u6587\u4EF6\u5939\u3002","error.surface":"\u4EA7\u7269\u9762\u677F\u7ED8\u5236\u5931\u8D25\u3002","error.surfaceHint":"\u8BF7\u91CD\u65B0\u52A0\u8F7D\u7A97\u53E3\u3002\u4F60\u7684\u4EA7\u7269\u4ECD\u5B89\u5168\u4FDD\u5B58\u5728\u78C1\u76D8\u4E0A\u3002","action.retry":"\u91CD\u8BD5","action.reloadWindow":"\u91CD\u65B0\u52A0\u8F7D\u7A97\u53E3","time.justNow":"\u521A\u521A","time.minutes":"{count} \u5206\u949F\u524D","time.hours":"{count} \u5C0F\u65F6\u524D","time.days":"{count} \u5929\u524D"};function Lt(e,t,a=Date.now()){let r=Math.max(0,a-Date.parse(t)),n=Math.floor(r/6e4);if(n<1)return e("time.justNow");if(n<60)return e("time.minutes",{count:n});let o=Math.floor(n/60);if(o<24)return e("time.hours",{count:o});let l=Math.floor(o/24);return l<7?e("time.days",{count:l}):new Date(t).toLocaleDateString()}var pe=require("react/jsx-runtime");function uo(e,t){let a=t.source.origin==="agent"?e("history.byAgent"):e("history.byUser"),r=t.source.action==="restore"&&t.source.restoredFrom!==void 0?e("history.restored",{version:t.source.restoredFrom}):t.source.action==="create"?e("history.created"):e("history.updated");return`${a} \xB7 ${r} \xB7 ${Lt(e,t.createdAt)}`}function Ar({t:e,versions:t,failed:a,current:r,selected:n,onSelect:o}){return(0,pe.jsxs)("div",{className:"art-history-body",children:[t===null?(0,pe.jsx)("p",{className:"art-note",children:e("empty.loading")}):null,a?(0,pe.jsx)("p",{className:"art-note",children:e("error.generic")}):null,!a&&t!==null&&t.length<=1?(0,pe.jsx)("p",{className:"art-note",children:e("history.empty")}):null,t?.map(l=>(0,pe.jsxs)("button",{type:"button",className:"art-version","aria-current":l.version===n?"true":void 0,onClick:()=>o(l.version),children:[(0,pe.jsxs)("span",{className:"art-version-top",children:[(0,pe.jsx)("span",{children:e("tab.versionOf",{version:l.version})}),l.version===r?(0,pe.jsx)("span",{className:"art-badge",children:e("history.current")}):null]}),(0,pe.jsx)("span",{className:"art-version-sub",children:uo(e,l)})]},l.version))]})}var ye=require("react");var Ae=require("react/jsx-runtime");function Ot({content:e,designCss:t,title:a,frameTitle:r,dark:n=!1,onSelectionText:o}){let[l,s]=(0,ye.useState)(null),[g,d]=(0,ye.useState)(!1),b=(0,ye.useRef)(0),T=(0,ye.useRef)(null),w=(0,ye.useRef)(o);w.current=o;let c=o!==void 0;return(0,ye.useEffect)(()=>{b.current=0,d(!1);let u=URL.createObjectURL(new Blob([Mt(e,t,a,n?"dark":"light",c)],{type:"text/html"}));return s(u),()=>URL.revokeObjectURL(u)},[e,t,a,n,c]),(0,ye.useEffect)(()=>{if(!c)return;let u=p=>{if(T.current===null||b.current>1||p.source!==T.current.contentWindow)return;let y=Cr(p.data);y!==void 0&&w.current?.(y)};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[c]),g?(0,Ae.jsx)("div",{className:"art-center",role:"alert",children:a}):l===null?null:(0,Ae.jsx)("iframe",{ref:T,className:"art-frame",title:r,sandbox:Nr,referrerPolicy:"no-referrer",src:l,onLoad:()=>{b.current+=1,b.current>1&&d(!0)}},l)}function zr({value:e,readOnly:t,label:a,hint:r,onChange:n,onSave:o,onSelectionText:l}){let s=g=>{t||l?.(g.value.slice(g.selectionStart,g.selectionEnd))};return(0,Ae.jsxs)("div",{className:"art-source-wrap",children:[r===void 0?null:(0,Ae.jsx)("div",{className:"art-code-bar",children:(0,Ae.jsx)("span",{children:r})}),(0,Ae.jsx)("textarea",{className:"art-source","aria-label":a,spellCheck:!1,readOnly:t,value:e,autoFocus:!t,onChange:g=>{n(g.target.value),l?.("")},onSelect:g=>s(g.currentTarget),onMouseUp:g=>s(g.currentTarget),onKeyUp:g=>s(g.currentTarget),onKeyDown:g=>{if((g.ctrlKey||g.metaKey)&&g.key.toLowerCase()==="s"){g.preventDefault(),o();return}if(g.key==="Tab"&&!g.shiftKey&&!t){g.preventDefault();let d=g.currentTarget,b=d.selectionStart,T=d.selectionEnd,w=e.slice(0,b)+" "+e.slice(T);n(w),requestAnimationFrame(()=>d.setSelectionRange(b+2,b+2))}}})]})}function ma(e,t=2e3){let a=e.replace(/\r\n/g,`
|
|
29
29
|
`).replace(/[ \t]+\n/g,`
|
|
30
30
|
`).replace(/\n{3,}/g,`
|
|
31
31
|
|
|
@@ -35,7 +35,7 @@ Design JSX:`,"agent.quoteCut":"The Design JSX was shortened to {limit} character
|
|
|
35
35
|
`).map(a=>`> ${a}`).join(`
|
|
36
36
|
`)}
|
|
37
37
|
|
|
38
|
-
${t}`}var Pr=require("react"),Mr="data-ds-dark-theme";function fo(){return typeof document<"u"&&document.body?.hasAttribute(Mr)===!0}function mo(e){if(typeof document>"u"||document.body===null)return()=>{};let t=new MutationObserver(e);return t.observe(document.body,{attributes:!0,attributeFilter:[Mr]}),()=>t.disconnect()}function Ye(){return(0,Pr.useSyncExternalStore)(mo,fo,()=>!1)}var i=require("react/jsx-runtime");function He({label:e,icon:t,onClick:a,pressed:r,disabled:n,buttonRef:o}){return(0,i.jsx)(h.Tooltip,{label:e,side:"bottom",portal:!0,children:(0,i.jsx)(h.Button,{ref:o,size:"sm",className:"art-icon-button","aria-label":e,"aria-pressed":r,disabled:n,onClick:a,children:t})})}function go({quote:e,askLabel:t,dismissLabel:a,onAsk:r,onDismiss:n}){return(0,i.jsxs)("div",{className:"art-selection-bar",role:"toolbar","aria-label":t,children:[(0,i.jsx)("span",{className:"art-selection-quote",title:e,children:e}),(0,i.jsx)(h.Button,{size:"sm",variant:"primary",icon:(0,i.jsx)(h.IconSparkleRegular,{size:14}),onClick:r,children:t}),(0,i.jsx)(He,{label:a,icon:(0,i.jsx)(h.IconCloseOutlineRegular,{size:14}),onClick:n})]})}function yo({t:e,layer:t,askLabel:a,dismissLabel:r,onAsk:n,onDismiss:o}){let l=pa(e,t.type);return(0,i.jsxs)("div",{className:"art-selection-bar art-layer-bar",role:"toolbar","aria-label":a,children:[(0,i.jsx)("span",{className:"art-layer-bar-glyph","aria-hidden":"true",children:Dt(t.type)}),(0,i.jsxs)("span",{className:"art-layer-bar-text",children:[(0,i.jsx)("span",{className:"art-layer-bar-name",title:t.name,children:t.name}),(0,i.jsx)("span",{className:"art-layer-bar-sub",children:t.parentName===""?l:e("layer.parentLine",{type:l,parent:t.parentName})})]}),(0,i.jsx)(h.Button,{size:"sm",variant:"primary",icon:(0,i.jsx)(h.IconSparkleRegular,{size:14}),onClick:n,children:a}),(0,i.jsx)(He,{label:r,icon:(0,i.jsx)(h.IconCloseOutlineRegular,{size:14}),onClick:o})]})}function bo({label:e,closeLabel:t,overlay:a,onClose:r,head:n,children:o}){let l=(0,k.useRef)(null);return(0,k.useEffect)(()=>{l.current?.querySelector("[data-drawer-initial]")?.focus()??l.current?.querySelector(".art-version, button")?.focus()},[e]),(0,k.useEffect)(()=>{if(!a)return;let s=g=>{let d=l.current;d===null||g.target instanceof Node&&d.contains(g.target)||d.querySelector("button")?.focus()};return document.addEventListener("focusin",s),()=>document.removeEventListener("focusin",s)},[a]),(0,i.jsxs)("div",{className:"art-drawer-layer","data-overlay":a?"true":void 0,children:[a?(0,i.jsx)("div",{className:"art-drawer-scrim","aria-hidden":"true",onPointerDown:r}):null,(0,i.jsxs)("aside",{ref:l,className:"art-drawer",role:"dialog","aria-modal":a?"true":void 0,"aria-label":e,onKeyDown:s=>{if(s.key==="Escape"){s.preventDefault(),s.stopPropagation(),r();return}if(s.key!=="Tab"||!a)return;let g=[...l.current?.querySelectorAll("button:not(:disabled)")??[]],d=g[0],b=g[g.length-1];d===void 0||b===void 0||(s.shiftKey&&document.activeElement===d?(s.preventDefault(),b.focus()):!s.shiftKey&&document.activeElement===b&&(s.preventDefault(),d.focus()))},children:[(0,i.jsxs)("div",{className:"art-drawer-head",children:[n??(0,i.jsx)("h2",{children:e}),(0,i.jsx)(He,{label:t,icon:(0,i.jsx)(h.IconCloseOutlineRegular,{size:14}),onClick:r})]}),(0,i.jsx)("div",{className:"art-drawer-body",children:o})]})]})}function ba(e){let t=e.useTabInfo(),a=Ee(t.tab.contentId??t.tab.navigation?.address),r=e.useWorkspaces(n=>n.items.find(o=>a?.scope==="workspace"&&o.workspaceId===a.workspaceId)?.title);return a===void 0?(0,i.jsx)("section",{className:"art-root",children:(0,i.jsx)("p",{className:"art-note",children:e.t("error.notFound")})}):(0,i.jsx)(Or,{t:e.t,address:a,useTabInfo:e.useTabInfo,onBack:t.tab.actions?.close,workspaceName:r,inputActions:e.inputActions},q(a))}function Lr({t:e,address:t,onBack:a,workspaceName:r}){return(0,i.jsx)(Or,{t:e,address:t,onBack:a,workspaceName:r,back:!0},q(t))}var ho=()=>{};function Or({t:e,address:t,useTabInfo:a,onBack:r,workspaceName:n,back:o,inputActions:l}){let{model:s,state:g}=tr(t),{payload:d,draft:b,saving:T,conflict:w,failure:c,failureMessage:u}=g,p=s.where,y=t.id,z=Ye(),[N,j]=(0,k.useState)("view"),[D,_]=(0,k.useState)(!1),[C,L]=(0,k.useState)(!1),[B,I]=(0,k.useState)(!1),[H,W]=(0,k.useState)("layers"),[V,Pe]=(0,k.useState)(null),[R,S]=(0,k.useState)(null),[G,ae]=(0,k.useState)([]),[Me,ft]=(0,k.useState)(null),[mt,$t]=(0,k.useState)(0),[Wt,ln]=(0,k.useState)(!1),[Ca,Gt]=(0,k.useState)(null),[cn,Ia]=(0,k.useState)(!1),[Ze,Le]=(0,k.useState)(!1),[re,Ue]=(0,k.useState)(null),[be,oe]=(0,k.useState)(null),[dn,gt]=(0,k.useState)(!1),[qt,Ea]=(0,k.useState)(""),[Kt,Je]=(0,k.useState)(null),[pn,yt]=(0,k.useState)(!1),[ue,Ie]=(0,k.useState)(!1),[$e,he]=(0,k.useState)(null),[Ra,Yt]=(0,k.useState)(null),[Aa,et]=(0,k.useState)(null),ve=(0,k.useRef)(0),bt=(0,k.useRef)(null),za=(0,k.useRef)(null),Da=(0,k.useRef)(null),Qt=(0,k.useRef)(!1),ht=Za(y),Pa=(a??ho)();(0,k.useEffect)(()=>{d!==null&&ht>d.version&&b===null&&!T&&!w&&et(ht),s.externalVersion(ht)},[ht,s,T,d?.version,b,w]),(0,k.useEffect)(()=>{w&&et(null)},[w]),(0,k.useEffect)(()=>{he(null),ae([])},[d?.version,re?.version,g.revision]),(0,k.useEffect)(()=>{if(V===null){S(null);return}return S(V.getSnapshot()),V.subscribe(S)},[V]);let Ma=re!==null;(0,k.useEffect)(()=>{Ma&&N==="edit"&&(j("view"),I(!1))},[Ma,N]);let un=d!==null,We=(0,k.useCallback)(()=>{let f=bt.current,A=f===null?0:f.clientWidth;ln(A>0?A<=600:window.innerWidth<=600)},[]);(0,k.useEffect)(()=>{let f=bt.current;if(f===null)return;We();let A=new ResizeObserver(We);return A.observe(f),window.addEventListener("resize",We),()=>{A.disconnect(),window.removeEventListener("resize",We)}},[un,We]);let Oe=(0,k.useCallback)(f=>{s.getSnapshot().draft!==null||s.getSnapshot().saving?Je({run:f}):f()},[s]),Xt=(0,k.useCallback)(()=>{++ve.current,Le(!1),Ue(null),he(null),oe(null),et(null)},[]),vt=(0,k.useCallback)(async()=>{Xt(),await s.discardAndReload()},[s,Xt]);(0,k.useEffect)(()=>Pa?.tab.actions?.bindCommands({refresh:()=>Oe(vt)}),[Pa?.tab.actions,Oe,vt]),(0,k.useEffect)(()=>{if(d?.manifest.type!=="doc"||b===null||w||T)return;let f=setTimeout(()=>void s.save(),1200);return()=>clearTimeout(f)},[b,w,T,s,d?.manifest.type]),(0,k.useEffect)(()=>{if(!C||d===null)return;let f=new AbortController;return Gt(null),Ia(!1),U.history(p,y,f.signal).then(A=>{f.signal.aborted||Gt(A.versions)}).catch(()=>{f.signal.aborted||Ia(!0)}),()=>f.abort()},[C,d?.version,s]),(0,k.useEffect)(()=>()=>{++ve.current},[]),(0,k.useEffect)(()=>{if(C){Qt.current=!0;return}Qt.current&&(Qt.current=!1,Da.current?.focus())},[C]),(0,k.useEffect)(()=>{if(N!=="source"||d?.manifest.type!=="page")return;let f=()=>{let A=za.current,te=window.getSelection();if(A===null||te===null||te.anchorNode===null||!A.contains(te.anchorNode))return;let rt=ma(te.toString());he(rt.text===""?null:rt)};return document.addEventListener("selectionchange",f),()=>document.removeEventListener("selectionchange",f)},[N,d?.manifest.type]);let fn=(0,k.useCallback)(f=>Pe(f),[]),mn=(0,k.useCallback)(f=>ae(f),[]),gn=(0,k.useCallback)(f=>ft(f),[]),yn=()=>I(!1),La=()=>{++ve.current,Le(!1),Ue(null),L(!1)},Zt=()=>{We(),++ve.current,Le(!1),Ue(null),oe(null),I(!1),L(!0)},Oa=async f=>{let A=++ve.current;if(oe(null),he(null),f===d?.version){Le(!1),Ue(null);return}Le(!0);try{let te=await U.get(p,y,f);A===ve.current&&Ue(te)}catch(te){A===ve.current&&Q(e(J(Z(te))))}finally{A===ve.current&&Le(!1)}},Fa=async()=>Ze?null:re!==null?re.version:await s.save()?s.getSnapshot().payload?.version??null:null,ja=async f=>{if(!ue){Ie(!0);try{let A=await Fa();if(A===null)return;if(f==="print")Ir((await U.printable(p,y,A)).html);else{let te=await U.exportFile(p,y,f,A);Ya(te),Q(e("export.done",{name:te.fileName,path:te.path}))}}catch(A){Q(e(J(Z(A))))}finally{Ie(!1)}}},bn=async()=>{qt.trim()===""||T||await s.save(qt.trim())&>(!1)},hn=async()=>{if(re===null||ue)return;let f=re.version;Oe(async()=>{Ie(!0);try{let A=await U.restore(p,y,f,s.getSnapshot().payload?.version??0);je(y,A.manifest.version),we(),Xt(),await s.load()}catch(A){Q(e(J(Z(A))))}finally{Ie(!1)}})},Jt=async(f,A)=>{try{await navigator.clipboard.writeText(f),Q(e(A))}catch{Yt(f)}},tt=async(f,A="agent.addedTruncated")=>{if(!(ue||w||Ze||d===null)){Ie(!0);try{let te=await Fa();if(te===null)return;let rt=s.getSnapshot().payload??d,aa=Dr(e,{title:rt.manifest.title,id:y,version:te,current:rt.version}),xt=f?.text??"";if(he(null),ae([]),V?.clearSelection(),l===void 0){await Jt(ya(xt,aa),"agent.copied");return}if((xt===""||l.insertQuote(xt))&&l.insertText(aa,l.captureInsertion())){Q(e(f?.truncated===!0?A:"agent.added"));return}await Jt(ya(xt,aa),"agent.insertFailed")}finally{Ie(!1)}}},ea=(0,k.useCallback)(f=>{let A=ma(f);he(A.text===""?null:A)},[]),vn=async()=>{if(be==="version"){oe(null);return}if(d!==null){try{let f=await U.history(p,y);Gt(f.versions)}catch(f){Q(e(J(Z(f))));return}oe("version")}};if(d===null)return(0,i.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",ref:bt,children:(0,i.jsxs)("div",{className:"art-center",role:c===void 0?"status":"alert",children:[(0,i.jsx)("p",{className:"art-center-hint",children:e(c===void 0?"empty.loading":J(c))}),(0,i.jsxs)("div",{className:"art-center-actions",children:[c===void 0?null:(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>void s.load(),children:e("action.retry")}),r===void 0?null:(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:r,children:e("tab.close")})]})]})});let Y=d.manifest.type,at=re?.content??b??d.content,ce=re!==null,ta=re?.version??d.version,xn=e(T?"tab.saving":w?"tab.conflictTitle":Ze?"empty.loading":re!==null?"tab.readOnly":c!==void 0?"tab.saveFailed":b!==null?"tab.unsaved":"tab.saved"),wn=w||c!==void 0&&!T?"error":T?"warn":void 0,kn=t.scope==="workspace"?n??t.workspaceId:e("scope.library"),Tn=N==="source"&&!ce&&(D||b!==null),Ba=[..._a[Y].map(f=>({id:f,label:e(`export.${f}`)})),...Y==="design"?[]:[{type:"separator",id:"export-gap"},{id:"print",label:e("export.print")}]],Ha=f=>{oe(null),ja(f==="print"?"print":f)},Sn=[...Wt?[...Ba,{type:"separator",id:"more-gap"}]:[],{id:"rename",label:e("tab.rename")},{id:"reload",label:e("tab.reload")},{type:"separator",id:"danger-gap"},{id:"delete",label:e("tab.delete"),danger:!0}],Nn=f=>{oe(null),f==="rename"?(Ea(d.manifest.title),gt(!0)):f==="reload"?Oe(vt):f==="delete"?yt(!0):Ha(f)},Cn=[...(Ca??[]).map(f=>({id:"v"+f.version,label:e("tab.versionOf",{version:f.version})+(f.version===d.version?" \xB7 "+e("tab.currentVersion"):"")})),{type:"separator",id:"versions-gap"},{id:"all",label:e("tab.allVersions")}],In=f=>{oe(null),f==="all"?Zt():Oa(Number(f.slice(1)))},En=(0,i.jsx)(h.Button,{size:"sm",variant:"primary",className:"art-ask",icon:(0,i.jsx)(h.IconSparkleRegular,{size:14}),disabled:ue||w||Ze,onClick:()=>{if(Y==="design"){let f=V?.quoteSelection();if(f!=null){tt(ga(e,f),"agent.addedTruncatedDesign");return}}tt($e)},children:e("agent.ask")});return(0,i.jsxs)("section",{className:"art-root","data-dsh-artifact-studio":"","data-artifact-id":y,"aria-busy":ue,ref:bt,children:[(0,i.jsxs)("header",{className:"art-header art-editor-header",children:[(0,i.jsxs)("div",{className:"art-heading",children:[!o||r===void 0?null:(0,i.jsx)(He,{label:e("action.back"),icon:(0,i.jsx)(h.IconChevronLeftOutlineRegular,{size:16}),onClick:()=>Oe(r)}),(0,i.jsxs)("div",{className:"art-identity",children:[(0,i.jsx)("h1",{className:"art-title",title:d.manifest.title,children:d.manifest.title}),(0,i.jsxs)("div",{className:"art-meta",children:[(0,i.jsxs)("span",{className:"art-meta-text",children:[kn,t.scope==="workspace"?" \xB7 "+e("scope.workspace"):null]}),(0,i.jsx)("span",{className:"art-meta-dot","aria-hidden":"true",children:"\xB7"}),(0,i.jsx)(h.Menu,{open:be==="version",onClose:()=>oe(null),items:Cn,onSelect:In,portal:!0,autoFocus:!0,anchor:(0,i.jsxs)("button",{type:"button",className:"art-version-button","aria-label":e("tab.versionPicker"),"aria-haspopup":"menu","aria-expanded":be==="version",onClick:()=>void vn(),children:[e("gallery.version",{version:ta}),(0,i.jsx)(h.IconChevronDownOutlineRegular,{size:12})]})}),(0,i.jsx)("span",{className:"art-meta-dot","aria-hidden":"true",children:"\xB7"}),(0,i.jsx)("span",{className:"art-save-status","data-tone":wn,"aria-live":"polite",children:xn})]})]})]}),(0,i.jsxs)("div",{className:"art-actions art-editor-actions",children:[Y==="doc"?null:(0,i.jsx)(h.SegmentedControl,{id:"art-mode-"+y,className:"art-segment",label:e("tab.mode"),value:N,options:Y==="design"?[{value:"view",label:e("canvas.viewMode")},{value:"edit",label:e("canvas.editMode"),disabled:ce,title:ce?e("canvas.editOldVersion"):void 0},{value:"source",label:e("tab.source")}]:[{value:"view",label:e("tab.preview")},{value:"source",label:e("tab.source")}],onChange:f=>{j(f),he(null),I(Y==="design"&&f==="edit"&&!ce)}}),Y==="design"&&N==="edit"&&!ce?(0,i.jsx)(He,{label:e("canvas.inspector"),icon:(0,i.jsx)(h.IconSlidersTwoOutlineRegular,{size:16}),pressed:B,onClick:()=>{B?I(!1):(L(!1),I(!0))}}):null,b===null||ce?null:(0,i.jsx)(He,{label:e("tab.save"),icon:(0,i.jsx)(h.IconSaveOutlineRegular,{size:16}),disabled:w,onClick:()=>void s.save()}),(0,i.jsx)(He,{buttonRef:Da,label:e("tab.history"),icon:(0,i.jsx)(h.IconClockOutlineRegular,{size:16}),pressed:C,onClick:()=>{C?La():Zt()}}),Wt?null:(0,i.jsx)(h.Menu,{open:be==="export",onClose:()=>oe(null),items:Ba,onSelect:Ha,align:"end",portal:!0,autoFocus:!0,anchor:(0,i.jsx)(h.Button,{size:"sm",icon:(0,i.jsx)(h.IconDownloadOutlineRegular,{size:14}),"aria-label":e("tab.export"),"aria-haspopup":"menu","aria-expanded":be==="export",disabled:ue||Ze,onClick:()=>oe(be==="export"?null:"export"),children:e("tab.export")})}),En,(0,i.jsx)(h.Menu,{open:be==="more",onClose:()=>oe(null),items:Sn,onSelect:Nn,align:"end",portal:!0,autoFocus:!0,anchor:(0,i.jsx)(h.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.more"),"aria-haspopup":"menu","aria-expanded":be==="more",onClick:()=>oe(be==="more"?null:"more"),children:(0,i.jsx)(h.IconEllipsisOutlineRegular,{size:14})})})]})]}),dn?(0,i.jsxs)("form",{className:"art-inline-form",onSubmit:f=>{f.preventDefault(),bn()},children:[(0,i.jsx)("input",{"aria-label":e("tab.rename"),value:qt,maxLength:120,autoFocus:!0,onChange:f=>Ea(f.target.value),onKeyDown:f=>{f.key==="Escape"&>(!1)}}),(0,i.jsx)(h.Button,{type:"submit",size:"sm",variant:"primary",disabled:T||w,children:e("tab.save")}),(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>gt(!1),children:e("create.cancel")})]}):null,Aa===null?null:(0,i.jsxs)("div",{className:"art-bar",role:"status",children:[(0,i.jsx)("span",{children:e("tab.agentUpdate",{version:Aa})}),(0,i.jsxs)("span",{className:"art-bar-actions",children:[(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>{et(null),Zt()},children:e("tab.viewHistory")}),(0,i.jsx)(h.Button,{size:"sm",onClick:()=>et(null),children:e("tab.dismiss")})]})]}),w?(0,i.jsxs)("div",{className:"art-bar","data-tone":"warn",role:"alert",children:[(0,i.jsxs)("span",{className:"art-bar-text",children:[(0,i.jsx)("strong",{children:e("tab.conflictTitle")}),(0,i.jsx)("span",{children:e("tab.conflictHint")})]}),(0,i.jsxs)("span",{className:"art-bar-actions",children:[(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>void Jt(b??"","action.copied"),children:e("tab.copyDraft")}),(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>Oe(vt),children:e("tab.discardReload")})]})]}):null,!w&&c!==void 0?(0,i.jsxs)("div",{className:"art-bar","data-tone":"error",role:"alert",children:[(0,i.jsx)("span",{children:u??e(J(c))}),(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>void s.save(),children:e("action.retry")})]}):null,re===null?null:(0,i.jsxs)("div",{className:"art-bar",role:"status",children:[(0,i.jsx)("span",{children:e("tab.viewingOld",{version:re.version,current:d.version})}),(0,i.jsxs)("span",{className:"art-bar-actions",children:[(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>{++ve.current,Le(!1),Ue(null),he(null)},children:e("tab.backToCurrent")}),(0,i.jsx)(h.Button,{size:"sm",variant:"outline",disabled:ue,onClick:()=>void hn(),children:e("tab.restoreThis")})]})]}),Y!=="design"||Me===null?null:(0,i.jsxs)("div",{className:"art-bar","data-tone":"error",role:"alert",children:[(0,i.jsx)("span",{children:e("canvas.startFailed")}),(0,i.jsx)("span",{className:"art-bar-actions",children:(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>{ft(null),$t(f=>f+1)},children:e("action.retry")})})]}),(0,i.jsxs)("div",{className:"art-body",children:[(0,i.jsxs)("div",{className:"art-stage",role:Y==="doc"?void 0:"tabpanel",id:Y==="doc"?void 0:"art-mode-"+y+"-"+N+"-panel","aria-labelledby":Y==="doc"?void 0:"art-mode-"+y+"-"+N,children:[Y==="page"&&$e!==null&&!C?(0,i.jsx)(go,{quote:$e.text,askLabel:e("agent.ask"),dismissLabel:e("tab.dismiss"),onAsk:()=>void tt($e),onDismiss:()=>he(null)}):null,Y==="design"&&N!=="source"&&!ce&&G[0]!==void 0?(0,i.jsx)(yo,{t:e,layer:G[0],askLabel:e("agent.ask"),dismissLabel:e("tab.dismiss"),onAsk:()=>{let f=V?.quoteSelection();f!=null&&tt(ga(e,f),"agent.addedTruncatedDesign")},onDismiss:()=>V?.clearSelection()}):null,Y==="doc"?(0,i.jsx)(Pt,{markdown:at,revision:(re?.version??0)+":"+g.revision,editable:!ce&&!w,label:d.manifest.title,loadingLabel:e("empty.loading"),failedLabel:e("error.generic"),design:d.design,dark:z,t:e,onChange:f=>s.edit(f),onSave:()=>void s.save(),onSelectionText:ea,selectionAction:$e===null?null:(0,i.jsx)(h.Button,{size:"sm",variant:"primary",icon:(0,i.jsx)(h.IconSparkleRegular,{size:14}),onMouseDown:f=>f.preventDefault(),onClick:()=>void tt($e),children:e("agent.ask")})}):N!=="source"?Y==="design"?ce?(0,i.jsx)(ua,{t:e,where:p,id:y,version:ta,title:d.manifest.title}):(0,i.jsx)(br,{t:e,source:at,revision:"0:"+g.revision,title:d.manifest.title,mode:N==="edit"?"edit":"view",onChange:f=>s.edit(f),onSave:()=>void s.save(),onFailure:gn,onHandle:fn,onSelection:mn,attempt:mt,fallback:(0,i.jsx)(ua,{t:e,where:p,id:y,version:ta,title:d.manifest.title})}):(0,i.jsx)(Ot,{content:at,designCss:d.designCss,title:d.manifest.title,frameTitle:e("tab.frameTitle",{title:d.manifest.title}),dark:z,onSelectionText:ea}):Tn?(0,i.jsx)(zr,{value:at,readOnly:!1,label:e("tab.source"),hint:e(Y==="design"?"tab.manualSaveDesign":"tab.manualSave"),onChange:f=>s.edit(f),onSave:()=>void s.save(),onSelectionText:ea}):(0,i.jsxs)("div",{className:"art-code",ref:za,children:[(0,i.jsxs)("div",{className:"art-code-bar",children:[(0,i.jsx)("span",{children:e(ce?"tab.readOnly":"tab.codeHint")}),ce?null:(0,i.jsx)(h.Button,{size:"sm",variant:"outline",icon:(0,i.jsx)(h.IconEditOutlineRegular,{size:14}),onClick:()=>_(!0),children:e("tab.editSource")})]}),(0,i.jsx)(h.CodeBlock,{code:at,lang:Y==="design"?"jsx":"html",lineNumbers:!0,showHeader:!1,wrap:!0,className:"art-code-block",copyLabel:e("code.copy"),copiedLabel:e("action.copied")})]})]}),!C&&!B?null:(0,i.jsx)(bo,{label:e(C?"history.title":"canvas.inspector"),closeLabel:e(C?"history.close":"canvas.closeInspector"),overlay:Wt,onClose:C?La:yn,head:C?void 0:(0,i.jsx)(h.SegmentedTabs,{className:"art-inspector-tabs",items:[{value:"layers",label:e("panel.layers"),id:"art-inspector-"+y+"-layers-tab",panelId:"art-inspector-"+y+"-layers"},{value:"properties",label:e("panel.properties"),id:"art-inspector-"+y+"-properties-tab",panelId:"art-inspector-"+y+"-properties"}],value:H,onChange:W,label:e("canvas.inspectorTabs"),size:"sm"}),children:C?(0,i.jsx)(Ar,{t:e,versions:Ca,failed:cn,current:d.version,selected:re?.version??d.version,onSelect:f=>void Oa(f)}):(0,i.jsx)("div",{className:"art-inspector",role:"tabpanel",id:"art-inspector-"+y+"-"+H,"aria-labelledby":"art-inspector-"+y+"-"+H+"-tab",children:(0,i.jsx)(hr,{t:e,handle:V,snapshot:R,tab:H})})})]}),(0,i.jsx)(h.Modal,{open:Kt!==null,onClose:()=>Je(null),title:e("tab.leaveTitle"),closeLabel:e("dialog.close"),description:e(w?"tab.conflictHint":"tab.leaveHint"),footer:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Button,{variant:"outline",disabled:ue,onClick:()=>Je(null),children:e("create.cancel")}),(0,i.jsx)(h.Button,{variant:"outline",disabled:T||ue,onClick:()=>{let f=Kt?.run;Je(null),f!==void 0&&s.discardAndReload().then(f)},children:e("tab.discardContinue")}),(0,i.jsx)(h.Button,{variant:"primary",disabled:w||ue,onClick:async()=>{Ie(!0);let f=await s.save();Ie(!1);let A=Kt?.run;f&&A!==void 0&&(Je(null),await A())},children:e("tab.saveContinue")})]}),children:c===void 0?null:(0,i.jsx)("p",{className:"art-modal-error",role:"alert",children:u??e(J(c))})}),(0,i.jsx)(h.Modal,{open:pn,onClose:()=>yt(!1),title:e("tab.deleteTitle"),closeLabel:e("dialog.close"),description:e("tab.deleteConfirm",{title:d.manifest.title}),footer:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:()=>yt(!1),children:e("create.cancel")}),(0,i.jsx)(h.Button,{variant:"primary",onClick:()=>{yt(!1),Oe(async()=>{try{await U.remove(p,y),we(),r?.()}catch(f){Q(e(J(Z(f))))}})},children:e("tab.delete")})]})}),(0,i.jsx)(h.Modal,{open:Ra!==null,onClose:()=>Yt(null),title:e("agent.copyTitle"),closeLabel:e("dialog.close"),description:e("action.copyFailed"),footer:(0,i.jsx)(h.Button,{variant:"primary",onClick:()=>Yt(null),children:e("dialog.done")}),children:(0,i.jsx)("textarea",{className:"art-fallback",readOnly:!0,value:Ra??"","aria-label":e("agent.copyTitle"),onFocus:f=>f.currentTarget.select()})})]})}var Fr=Ln(require("react"),1),jr=require("@deepseek-ai/dsh-client-ui-primitives"),Ve=require("react/jsx-runtime"),Ft=class extends Fr.default.Component{constructor(t){super(t),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,Ve.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",children:(0,Ve.jsxs)("div",{className:"art-center",role:"alert",children:[(0,Ve.jsx)("p",{className:"art-center-title",children:this.props.title}),(0,Ve.jsx)("p",{className:"art-center-hint",children:this.props.hint}),(0,Ve.jsx)(jr.Button,{size:"sm",variant:"outline",onClick:()=>window.location.reload(),children:this.props.reloadLabel})]})}):this.props.children}};var jt=require("react"),Qe=require("@deepseek-ai/dsh-client-ui-primitives");var Se={sidebarRight:null,layout:null};var M=require("react/jsx-runtime");function vo(e){if(e===null||typeof e!="object")return null;let t={...e},{id:a,type:r,title:n,version:o,workspaceId:l}=t;if(t.kind!=="artifact"||typeof a!="string"||typeof n!="string"||typeof o!="number"||r!=="page"&&r!=="doc"&&r!=="design")return null;let s=Ua(a);return s===void 0?null:s==="workspace"?typeof l!="string"||l===""?null:{id:a,type:r,title:n,version:o,address:{scope:s,workspaceId:l,id:a}}:{id:a,type:r,title:n,version:o,address:{scope:s,id:a}}}function xo(e){return Array.isArray(e)?e.map(t=>{if(t===null||typeof t!="object")return"";let a={...t};return a.type==="text"&&typeof a.text=="string"?a.text:""}).filter(t=>t!=="").join(`
|
|
38
|
+
${t}`}var Pr=require("react"),Mr="data-ds-dark-theme";function fo(){return typeof document<"u"&&document.body?.hasAttribute(Mr)===!0}function mo(e){if(typeof document>"u"||document.body===null)return()=>{};let t=new MutationObserver(e);return t.observe(document.body,{attributes:!0,attributeFilter:[Mr]}),()=>t.disconnect()}function Ye(){return(0,Pr.useSyncExternalStore)(mo,fo,()=>!1)}var i=require("react/jsx-runtime");function He({label:e,icon:t,onClick:a,pressed:r,disabled:n,buttonRef:o}){return(0,i.jsx)(h.Tooltip,{label:e,side:"bottom",portal:!0,children:(0,i.jsx)(h.Button,{ref:o,size:"sm",className:"art-icon-button","aria-label":e,"aria-pressed":r,disabled:n,onClick:a,children:t})})}function go({quote:e,askLabel:t,dismissLabel:a,onAsk:r,onDismiss:n}){return(0,i.jsxs)("div",{className:"art-selection-bar",role:"toolbar","aria-label":t,children:[(0,i.jsx)("span",{className:"art-selection-quote",title:e,children:e}),(0,i.jsx)(h.Button,{size:"sm",variant:"primary",icon:(0,i.jsx)(h.IconSparkleRegular,{size:14}),onClick:r,children:t}),(0,i.jsx)(He,{label:a,icon:(0,i.jsx)(h.IconCloseOutlineRegular,{size:14}),onClick:n})]})}function yo({t:e,layer:t,askLabel:a,dismissLabel:r,onAsk:n,onDismiss:o}){let l=pa(e,t.type);return(0,i.jsxs)("div",{className:"art-selection-bar art-layer-bar",role:"toolbar","aria-label":a,children:[(0,i.jsx)("span",{className:"art-layer-bar-glyph","aria-hidden":"true",children:Dt(t.type)}),(0,i.jsxs)("span",{className:"art-layer-bar-text",children:[(0,i.jsx)("span",{className:"art-layer-bar-name",title:t.name,children:t.name}),(0,i.jsx)("span",{className:"art-layer-bar-sub",children:t.parentName===""?l:e("layer.parentLine",{type:l,parent:t.parentName})})]}),(0,i.jsx)(h.Button,{size:"sm",variant:"primary",icon:(0,i.jsx)(h.IconSparkleRegular,{size:14}),onClick:n,children:a}),(0,i.jsx)(He,{label:r,icon:(0,i.jsx)(h.IconCloseOutlineRegular,{size:14}),onClick:o})]})}function bo({label:e,closeLabel:t,overlay:a,onClose:r,head:n,children:o}){let l=(0,k.useRef)(null);return(0,k.useEffect)(()=>{l.current?.querySelector("[data-drawer-initial]")?.focus()??l.current?.querySelector(".art-version, button")?.focus()},[e]),(0,k.useEffect)(()=>{if(!a)return;let s=g=>{let d=l.current;d===null||g.target instanceof Node&&d.contains(g.target)||d.querySelector("button")?.focus()};return document.addEventListener("focusin",s),()=>document.removeEventListener("focusin",s)},[a]),(0,i.jsxs)("div",{className:"art-drawer-layer","data-overlay":a?"true":void 0,children:[a?(0,i.jsx)("div",{className:"art-drawer-scrim","aria-hidden":"true",onPointerDown:r}):null,(0,i.jsxs)("aside",{ref:l,className:"art-drawer",role:"dialog","aria-modal":a?"true":void 0,"aria-label":e,onKeyDown:s=>{if(s.key==="Escape"){s.preventDefault(),s.stopPropagation(),r();return}if(s.key!=="Tab"||!a)return;let g=[...l.current?.querySelectorAll("button:not(:disabled)")??[]],d=g[0],b=g[g.length-1];d===void 0||b===void 0||(s.shiftKey&&document.activeElement===d?(s.preventDefault(),b.focus()):!s.shiftKey&&document.activeElement===b&&(s.preventDefault(),d.focus()))},children:[(0,i.jsxs)("div",{className:"art-drawer-head",children:[n??(0,i.jsx)("h2",{children:e}),(0,i.jsx)(He,{label:t,icon:(0,i.jsx)(h.IconCloseOutlineRegular,{size:14}),onClick:r})]}),(0,i.jsx)("div",{className:"art-drawer-body",children:o})]})]})}function ba(e){let t=e.useTabInfo(),a=Ee(t.tab.contentId??t.tab.navigation?.address),r=e.useWorkspaces(n=>n.items.find(o=>a?.scope==="workspace"&&o.workspaceId===a.workspaceId)?.title);return a===void 0?(0,i.jsx)("section",{className:"art-root",children:(0,i.jsx)("p",{className:"art-note",children:e.t("error.notFound")})}):(0,i.jsx)(Or,{t:e.t,address:a,useTabInfo:e.useTabInfo,onBack:t.tab.actions?.close,workspaceName:r,inputActions:e.inputActions},q(a))}function Lr({t:e,address:t,onBack:a,workspaceName:r}){return(0,i.jsx)(Or,{t:e,address:t,onBack:a,workspaceName:r,back:!0},q(t))}var ho=()=>{};function Or({t:e,address:t,useTabInfo:a,onBack:r,workspaceName:n,back:o,inputActions:l}){let{model:s,state:g}=tr(t),{payload:d,draft:b,saving:T,conflict:w,failure:c,failureMessage:u}=g,p=s.where,y=t.id,z=Ye(),[N,j]=(0,k.useState)("view"),[D,_]=(0,k.useState)(!1),[C,L]=(0,k.useState)(!1),[B,I]=(0,k.useState)(!1),[H,W]=(0,k.useState)("layers"),[V,Pe]=(0,k.useState)(null),[R,S]=(0,k.useState)(null),[G,ae]=(0,k.useState)([]),[Me,ft]=(0,k.useState)(null),[mt,$t]=(0,k.useState)(0),[Wt,ln]=(0,k.useState)(!1),[Ca,Gt]=(0,k.useState)(null),[cn,Ia]=(0,k.useState)(!1),[Ze,Le]=(0,k.useState)(!1),[re,Ue]=(0,k.useState)(null),[be,oe]=(0,k.useState)(null),[dn,gt]=(0,k.useState)(!1),[qt,Ea]=(0,k.useState)(""),[Kt,Je]=(0,k.useState)(null),[pn,yt]=(0,k.useState)(!1),[ue,Ie]=(0,k.useState)(!1),[$e,he]=(0,k.useState)(null),[Ra,Yt]=(0,k.useState)(null),[Aa,et]=(0,k.useState)(null),ve=(0,k.useRef)(0),bt=(0,k.useRef)(null),za=(0,k.useRef)(null),Da=(0,k.useRef)(null),Qt=(0,k.useRef)(!1),ht=Za(y),Pa=(a??ho)();(0,k.useEffect)(()=>{d!==null&&ht>d.version&&b===null&&!T&&!w&&et(ht),s.externalVersion(ht)},[ht,s,T,d?.version,b,w]),(0,k.useEffect)(()=>{w&&et(null)},[w]),(0,k.useEffect)(()=>{he(null),ae([])},[d?.version,re?.version,g.revision]),(0,k.useEffect)(()=>{if(V===null){S(null);return}return S(V.getSnapshot()),V.subscribe(S)},[V]);let Ma=re!==null;(0,k.useEffect)(()=>{Ma&&N==="edit"&&(j("view"),I(!1))},[Ma,N]);let un=d!==null,We=(0,k.useCallback)(()=>{let f=bt.current,A=f===null?0:f.clientWidth;ln(A>0?A<=600:window.innerWidth<=600)},[]);(0,k.useEffect)(()=>{let f=bt.current;if(f===null)return;We();let A=new ResizeObserver(We);return A.observe(f),window.addEventListener("resize",We),()=>{A.disconnect(),window.removeEventListener("resize",We)}},[un,We]);let Oe=(0,k.useCallback)(f=>{s.getSnapshot().draft!==null||s.getSnapshot().saving?Je({run:f}):f()},[s]),Xt=(0,k.useCallback)(()=>{++ve.current,Le(!1),Ue(null),he(null),oe(null),et(null)},[]),vt=(0,k.useCallback)(async()=>{Xt(),await s.discardAndReload()},[s,Xt]);(0,k.useEffect)(()=>Pa?.tab.actions?.bindCommands({refresh:()=>Oe(vt)}),[Pa?.tab.actions,Oe,vt]),(0,k.useEffect)(()=>{if(d?.manifest.type!=="doc"||b===null||w||T)return;let f=setTimeout(()=>void s.save(),1200);return()=>clearTimeout(f)},[b,w,T,s,d?.manifest.type]),(0,k.useEffect)(()=>{if(!C||d===null)return;let f=new AbortController;return Gt(null),Ia(!1),U.history(p,y,f.signal).then(A=>{f.signal.aborted||Gt(A.versions)}).catch(()=>{f.signal.aborted||Ia(!0)}),()=>f.abort()},[C,d?.version,s]),(0,k.useEffect)(()=>()=>{++ve.current},[]),(0,k.useEffect)(()=>{if(C){Qt.current=!0;return}Qt.current&&(Qt.current=!1,Da.current?.focus())},[C]),(0,k.useEffect)(()=>{if(N!=="source"||d?.manifest.type!=="page")return;let f=()=>{let A=za.current,te=window.getSelection();if(A===null||te===null||te.anchorNode===null||!A.contains(te.anchorNode))return;let rt=ma(te.toString());he(rt.text===""?null:rt)};return document.addEventListener("selectionchange",f),()=>document.removeEventListener("selectionchange",f)},[N,d?.manifest.type]);let fn=(0,k.useCallback)(f=>Pe(f),[]),mn=(0,k.useCallback)(f=>ae(f),[]),gn=(0,k.useCallback)(f=>ft(f),[]),yn=()=>I(!1),La=()=>{++ve.current,Le(!1),Ue(null),L(!1)},Zt=()=>{We(),++ve.current,Le(!1),Ue(null),oe(null),I(!1),L(!0)},Oa=async f=>{let A=++ve.current;if(oe(null),he(null),f===d?.version){Le(!1),Ue(null);return}Le(!0);try{let te=await U.get(p,y,f);A===ve.current&&Ue(te)}catch(te){A===ve.current&&Q(e(J(Z(te))))}finally{A===ve.current&&Le(!1)}},Fa=async()=>Ze?null:re!==null?re.version:await s.save()?s.getSnapshot().payload?.version??null:null,ja=async f=>{if(!ue){Ie(!0);try{let A=await Fa();if(A===null)return;if(f==="print")Ir((await U.printable(p,y,A)).html);else{let te=await U.exportFile(p,y,f,A);Ya(te),Q(e("export.done",{name:te.fileName,path:te.path}))}}catch(A){Q(e(J(Z(A))))}finally{Ie(!1)}}},bn=async()=>{qt.trim()===""||T||await s.save(qt.trim())&>(!1)},hn=async()=>{if(re===null||ue)return;let f=re.version;Oe(async()=>{Ie(!0);try{let A=await U.restore(p,y,f,s.getSnapshot().payload?.version??0);je(y,A.manifest.version),we(),Xt(),await s.load()}catch(A){Q(e(J(Z(A))))}finally{Ie(!1)}})},Jt=async(f,A)=>{try{await navigator.clipboard.writeText(f),Q(e(A))}catch{Yt(f)}},tt=async(f,A="agent.addedTruncated")=>{if(!(ue||w||Ze||d===null)){Ie(!0);try{let te=await Fa();if(te===null)return;let rt=s.getSnapshot().payload??d,aa=Dr(e,{title:rt.manifest.title,id:y,version:te,current:rt.version}),xt=f?.text??"";if(he(null),ae([]),V?.clearSelection(),l===void 0){await Jt(ya(xt,aa),"agent.copied");return}if((xt===""||l.insertQuote(xt))&&l.insertText(aa,l.captureInsertion())){Q(e(f?.truncated===!0?A:"agent.added"));return}await Jt(ya(xt,aa),"agent.insertFailed")}finally{Ie(!1)}}},ea=(0,k.useCallback)(f=>{let A=ma(f);he(A.text===""?null:A)},[]),vn=async()=>{if(be==="version"){oe(null);return}if(d!==null){try{let f=await U.history(p,y);Gt(f.versions)}catch(f){Q(e(J(Z(f))));return}oe("version")}};if(d===null)return(0,i.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",ref:bt,children:(0,i.jsxs)("div",{className:"art-center",role:c===void 0?"status":"alert",children:[(0,i.jsx)("p",{className:"art-center-hint",children:e(c===void 0?"empty.loading":J(c))}),(0,i.jsxs)("div",{className:"art-center-actions",children:[c===void 0?null:(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>void s.load(),children:e("action.retry")}),r===void 0?null:(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:r,children:e("tab.close")})]})]})});let Y=d.manifest.type,at=re?.content??b??d.content,ce=re!==null,ta=re?.version??d.version,xn=e(T?"tab.saving":w?"tab.conflictTitle":Ze?"empty.loading":re!==null?"tab.readOnly":c!==void 0?"tab.saveFailed":b!==null?"tab.unsaved":"tab.saved"),wn=w||c!==void 0&&!T?"error":T?"warn":void 0,kn=t.scope==="workspace"?n??t.workspaceId:e("scope.library"),Tn=N==="source"&&!ce&&(D||b!==null),Ba=[..._a[Y].map(f=>({id:f,label:e(`export.${f}`)})),...Y==="design"?[]:[{type:"separator",id:"export-gap"},{id:"print",label:e("export.print")}]],Ha=f=>{oe(null),ja(f==="print"?"print":f)},Sn=[...Wt?[...Ba,{type:"separator",id:"more-gap"}]:[],{id:"rename",label:e("tab.rename")},{id:"reload",label:e("tab.reload")},{type:"separator",id:"danger-gap"},{id:"delete",label:e("tab.delete"),danger:!0}],Nn=f=>{oe(null),f==="rename"?(Ea(d.manifest.title),gt(!0)):f==="reload"?Oe(vt):f==="delete"?yt(!0):Ha(f)},Cn=[...(Ca??[]).map(f=>({id:"v"+f.version,label:e("tab.versionOf",{version:f.version})+(f.version===d.version?" \xB7 "+e("tab.currentVersion"):"")})),{type:"separator",id:"versions-gap"},{id:"all",label:e("tab.allVersions")}],In=f=>{oe(null),f==="all"?Zt():Oa(Number(f.slice(1)))},En=(0,i.jsx)(h.Button,{size:"sm",variant:"primary",className:"art-ask",icon:(0,i.jsx)(h.IconSparkleRegular,{size:14}),disabled:ue||w||Ze,onClick:()=>{if(Y==="design"){let f=V?.quoteSelection();if(f!=null){tt(ga(e,f),"agent.addedTruncatedDesign");return}}tt($e)},children:e("agent.ask")});return(0,i.jsxs)("section",{className:"art-root","data-dsh-artifact-studio":"","data-artifact-id":y,"aria-busy":ue,ref:bt,children:[(0,i.jsxs)("header",{className:"art-header art-editor-header",children:[(0,i.jsxs)("div",{className:"art-heading",children:[!o||r===void 0?null:(0,i.jsx)(He,{label:e("action.back"),icon:(0,i.jsx)(h.IconChevronLeftOutlineRegular,{size:16}),onClick:()=>Oe(r)}),(0,i.jsxs)("div",{className:"art-identity",children:[(0,i.jsx)("h1",{className:"art-title",title:d.manifest.title,children:d.manifest.title}),(0,i.jsxs)("div",{className:"art-meta",children:[(0,i.jsxs)("span",{className:"art-meta-text",children:[kn,t.scope==="workspace"?" \xB7 "+e("scope.workspace"):null]}),(0,i.jsx)("span",{className:"art-meta-dot","aria-hidden":"true",children:"\xB7"}),(0,i.jsx)(h.Menu,{open:be==="version",onClose:()=>oe(null),items:Cn,onSelect:In,portal:!0,autoFocus:!0,anchor:(0,i.jsxs)("button",{type:"button",className:"art-version-button","aria-label":e("tab.versionPicker"),"aria-haspopup":"menu","aria-expanded":be==="version",onClick:()=>void vn(),children:[e("gallery.version",{version:ta}),(0,i.jsx)(h.IconChevronDownOutlineRegular,{size:12})]})}),(0,i.jsx)("span",{className:"art-meta-dot","aria-hidden":"true",children:"\xB7"}),(0,i.jsx)("span",{className:"art-save-status","data-tone":wn,"aria-live":"polite",children:xn})]})]})]}),(0,i.jsxs)("div",{className:"art-actions art-editor-actions",children:[Y==="doc"?null:(0,i.jsx)(h.SegmentedControl,{id:"art-mode-"+y,className:"art-segment",label:e("tab.mode"),value:N,options:Y==="design"?[{value:"view",label:e("canvas.viewMode")},{value:"edit",label:e("canvas.editMode"),disabled:ce,title:ce?e("canvas.editOldVersion"):void 0},{value:"source",label:e("tab.source")}]:[{value:"view",label:e("tab.preview")},{value:"source",label:e("tab.source")}],onChange:f=>{j(f),he(null),I(Y==="design"&&f==="edit"&&!ce)}}),Y==="design"&&N==="edit"&&!ce?(0,i.jsx)(He,{label:e("canvas.inspector"),icon:(0,i.jsx)(h.IconSlidersTwoOutlineRegular,{size:16}),pressed:B,onClick:()=>{B?I(!1):(L(!1),I(!0))}}):null,b===null||ce?null:(0,i.jsx)(He,{label:e("tab.save"),icon:(0,i.jsx)(h.IconSaveOutlineRegular,{size:16}),disabled:w,onClick:()=>void s.save()}),(0,i.jsx)(He,{buttonRef:Da,label:e("tab.history"),icon:(0,i.jsx)(h.IconClockOutlineRegular,{size:16}),pressed:C,onClick:()=>{C?La():Zt()}}),Wt?null:(0,i.jsx)(h.Menu,{open:be==="export",onClose:()=>oe(null),items:Ba,onSelect:Ha,align:"end",portal:!0,autoFocus:!0,anchor:(0,i.jsx)(h.Button,{size:"sm",icon:(0,i.jsx)(h.IconDownloadOutlineRegular,{size:14}),"aria-label":e("tab.export"),"aria-haspopup":"menu","aria-expanded":be==="export",disabled:ue||Ze,onClick:()=>oe(be==="export"?null:"export"),children:e("tab.export")})}),En,(0,i.jsx)(h.Menu,{open:be==="more",onClose:()=>oe(null),items:Sn,onSelect:Nn,align:"end",portal:!0,autoFocus:!0,anchor:(0,i.jsx)(h.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.more"),"aria-haspopup":"menu","aria-expanded":be==="more",onClick:()=>oe(be==="more"?null:"more"),children:(0,i.jsx)(h.IconEllipsisOutlineRegular,{size:14})})})]})]}),dn?(0,i.jsxs)("form",{className:"art-inline-form",onSubmit:f=>{f.preventDefault(),bn()},children:[(0,i.jsx)("input",{"aria-label":e("tab.rename"),value:qt,maxLength:120,autoFocus:!0,onChange:f=>Ea(f.target.value),onKeyDown:f=>{f.key==="Escape"&>(!1)}}),(0,i.jsx)(h.Button,{type:"submit",size:"sm",variant:"primary",disabled:T||w,children:e("tab.save")}),(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>gt(!1),children:e("create.cancel")})]}):null,Aa===null?null:(0,i.jsxs)("div",{className:"art-bar",role:"status",children:[(0,i.jsx)("span",{children:e("tab.agentUpdate",{version:Aa})}),(0,i.jsxs)("span",{className:"art-bar-actions",children:[(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>{et(null),Zt()},children:e("tab.viewHistory")}),(0,i.jsx)(h.Button,{size:"sm",onClick:()=>et(null),children:e("tab.dismiss")})]})]}),w?(0,i.jsxs)("div",{className:"art-bar","data-tone":"warn",role:"alert",children:[(0,i.jsxs)("span",{className:"art-bar-text",children:[(0,i.jsx)("strong",{children:e("tab.conflictTitle")}),(0,i.jsx)("span",{children:e("tab.conflictHint")})]}),(0,i.jsxs)("span",{className:"art-bar-actions",children:[(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>void Jt(b??"","action.copied"),children:e("tab.copyDraft")}),(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>Oe(vt),children:e("tab.discardReload")})]})]}):null,!w&&c!==void 0?(0,i.jsxs)("div",{className:"art-bar","data-tone":"error",role:"alert",children:[(0,i.jsx)("span",{children:u??e(J(c))}),(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>void s.save(),children:e("action.retry")})]}):null,re===null?null:(0,i.jsxs)("div",{className:"art-bar",role:"status",children:[(0,i.jsx)("span",{children:e("tab.viewingOld",{version:re.version,current:d.version})}),(0,i.jsxs)("span",{className:"art-bar-actions",children:[(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>{++ve.current,Le(!1),Ue(null),he(null)},children:e("tab.backToCurrent")}),(0,i.jsx)(h.Button,{size:"sm",variant:"outline",disabled:ue,onClick:()=>void hn(),children:e("tab.restoreThis")})]})]}),Y!=="design"||Me===null?null:(0,i.jsxs)("div",{className:"art-bar","data-tone":"error",role:"alert",children:[(0,i.jsx)("span",{children:e("canvas.startFailed")}),(0,i.jsx)("span",{className:"art-bar-actions",children:(0,i.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>{ft(null),$t(f=>f+1)},children:e("action.retry")})})]}),(0,i.jsxs)("div",{className:"art-body",children:[(0,i.jsxs)("div",{className:"art-stage",role:Y==="doc"?void 0:"tabpanel",id:Y==="doc"?void 0:"art-mode-"+y+"-"+N+"-panel","aria-labelledby":Y==="doc"?void 0:"art-mode-"+y+"-"+N,children:[Y==="page"&&$e!==null&&!C?(0,i.jsx)(go,{quote:$e.text,askLabel:e("agent.ask"),dismissLabel:e("tab.dismiss"),onAsk:()=>void tt($e),onDismiss:()=>he(null)}):null,Y==="design"&&N!=="source"&&!ce&&G[0]!==void 0?(0,i.jsx)(yo,{t:e,layer:G[0],askLabel:e("agent.ask"),dismissLabel:e("tab.dismiss"),onAsk:()=>{let f=V?.quoteSelection();f!=null&&tt(ga(e,f),"agent.addedTruncatedDesign")},onDismiss:()=>V?.clearSelection()}):null,Y==="doc"?(0,i.jsx)(Pt,{markdown:at,revision:(re?.version??0)+":"+g.revision,editable:!ce&&!w,label:d.manifest.title,loadingLabel:e("empty.loading"),failedLabel:e("error.generic"),design:d.design,dark:z,t:e,onChange:f=>s.edit(f),onSave:()=>void s.save(),onSelectionText:ea,selectionAction:$e===null?null:(0,i.jsx)(h.Button,{size:"sm",variant:"primary",icon:(0,i.jsx)(h.IconSparkleRegular,{size:14}),onMouseDown:f=>f.preventDefault(),onClick:()=>void tt($e),children:e("agent.ask")})}):N!=="source"?Y==="design"?ce?(0,i.jsx)(ua,{t:e,where:p,id:y,version:ta,title:d.manifest.title}):(0,i.jsx)(br,{t:e,source:at,revision:"0:"+g.revision,title:d.manifest.title,mode:N==="edit"?"edit":"view",onChange:f=>s.edit(f),onSave:()=>void s.save(),onFailure:gn,onHandle:fn,onSelection:mn,attempt:mt,fallback:(0,i.jsx)(ua,{t:e,where:p,id:y,version:ta,title:d.manifest.title})}):(0,i.jsx)(Ot,{content:at,designCss:d.designCss,title:d.manifest.title,frameTitle:e("tab.frameTitle",{title:d.manifest.title}),dark:z,onSelectionText:ea}):Tn?(0,i.jsx)(zr,{value:at,readOnly:!1,label:e("tab.source"),hint:e(Y==="design"?"tab.manualSaveDesign":"tab.manualSave"),onChange:f=>s.edit(f),onSave:()=>void s.save(),onSelectionText:ea}):(0,i.jsxs)("div",{className:"art-code",ref:za,children:[(0,i.jsxs)("div",{className:"art-code-bar",children:[(0,i.jsx)("span",{children:e(ce?"tab.readOnly":"tab.codeHint")}),ce?null:(0,i.jsx)(h.Button,{size:"sm",variant:"outline",icon:(0,i.jsx)(h.IconEditOutlineRegular,{size:14}),onClick:()=>_(!0),children:e("tab.editSource")})]}),(0,i.jsx)(h.CodeBlock,{code:at,lang:Y==="design"?"jsx":"html",lineNumbers:!0,showHeader:!1,wrap:!0,className:"art-code-block",copyLabel:e("code.copy"),copiedLabel:e("action.copied")})]})]}),!C&&!B?null:(0,i.jsx)(bo,{label:e(C?"history.title":"canvas.inspector"),closeLabel:e(C?"history.close":"canvas.closeInspector"),overlay:Wt,onClose:C?La:yn,head:C?void 0:(0,i.jsx)(h.SegmentedTabs,{className:"art-inspector-tabs",items:[{value:"layers",label:e("panel.layers"),id:"art-inspector-"+y+"-layers-tab",panelId:"art-inspector-"+y+"-layers"},{value:"properties",label:e("panel.properties"),id:"art-inspector-"+y+"-properties-tab",panelId:"art-inspector-"+y+"-properties"}],value:H,onChange:W,label:e("canvas.inspectorTabs"),size:"sm"}),children:C?(0,i.jsx)(Ar,{t:e,versions:Ca,failed:cn,current:d.version,selected:re?.version??d.version,onSelect:f=>void Oa(f)}):(0,i.jsx)("div",{className:"art-inspector",role:"tabpanel",id:"art-inspector-"+y+"-"+H,"aria-labelledby":"art-inspector-"+y+"-"+H+"-tab",children:(0,i.jsx)(hr,{t:e,handle:V,snapshot:R,tab:H})})})]}),(0,i.jsx)(h.Modal,{open:Kt!==null,onClose:()=>Je(null),title:e("tab.leaveTitle"),closeLabel:e("dialog.close"),description:e(w?"tab.conflictHint":"tab.leaveHint"),footer:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Button,{variant:"outline",disabled:ue,onClick:()=>Je(null),children:e("create.cancel")}),(0,i.jsx)(h.Button,{variant:"outline",disabled:T||ue,onClick:()=>{let f=Kt?.run;Je(null),f!==void 0&&s.discardAndReload().then(f)},children:e("tab.leaveDiscard")}),(0,i.jsx)(h.Button,{variant:"primary",disabled:w||ue,onClick:async()=>{Ie(!0);let f=await s.save();Ie(!1);let A=Kt?.run;f&&A!==void 0&&(Je(null),await A())},children:e("tab.leaveSave")})]}),children:c===void 0?null:(0,i.jsx)("p",{className:"art-modal-error",role:"alert",children:u??e(J(c))})}),(0,i.jsx)(h.Modal,{open:pn,onClose:()=>yt(!1),title:e("tab.deleteTitle"),closeLabel:e("dialog.close"),description:e("tab.deleteConfirm",{title:d.manifest.title}),footer:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:()=>yt(!1),children:e("create.cancel")}),(0,i.jsx)(h.Button,{variant:"primary",onClick:()=>{yt(!1),Oe(async()=>{try{await U.remove(p,y),we(),r?.()}catch(f){Q(e(J(Z(f))))}})},children:e("tab.delete")})]})}),(0,i.jsx)(h.Modal,{open:Ra!==null,onClose:()=>Yt(null),title:e("agent.copyTitle"),closeLabel:e("dialog.close"),description:e("action.copyFailed"),footer:(0,i.jsx)(h.Button,{variant:"primary",onClick:()=>Yt(null),children:e("dialog.done")}),children:(0,i.jsx)("textarea",{className:"art-fallback",readOnly:!0,value:Ra??"","aria-label":e("agent.copyTitle"),onFocus:f=>f.currentTarget.select()})})]})}var Fr=Ln(require("react"),1),jr=require("@deepseek-ai/dsh-client-ui-primitives"),Ve=require("react/jsx-runtime"),Ft=class extends Fr.default.Component{constructor(t){super(t),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,Ve.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",children:(0,Ve.jsxs)("div",{className:"art-center",role:"alert",children:[(0,Ve.jsx)("p",{className:"art-center-title",children:this.props.title}),(0,Ve.jsx)("p",{className:"art-center-hint",children:this.props.hint}),(0,Ve.jsx)(jr.Button,{size:"sm",variant:"outline",onClick:()=>window.location.reload(),children:this.props.reloadLabel})]})}):this.props.children}};var jt=require("react"),Qe=require("@deepseek-ai/dsh-client-ui-primitives");var Se={sidebarRight:null,layout:null};var M=require("react/jsx-runtime");function vo(e){if(e===null||typeof e!="object")return null;let t={...e},{id:a,type:r,title:n,version:o,workspaceId:l}=t;if(t.kind!=="artifact"||typeof a!="string"||typeof n!="string"||typeof o!="number"||r!=="page"&&r!=="doc"&&r!=="design")return null;let s=Ua(a);return s===void 0?null:s==="workspace"?typeof l!="string"||l===""?null:{id:a,type:r,title:n,version:o,address:{scope:s,workspaceId:l,id:a}}:{id:a,type:r,title:n,version:o,address:{scope:s,id:a}}}function xo(e){return Array.isArray(e)?e.map(t=>{if(t===null||typeof t!="object")return"";let a={...t};return a.type==="text"&&typeof a.text=="string"?a.text:""}).filter(t=>t!=="").join(`
|
|
39
39
|
`).trim():""}function wo(e){if(e===null||typeof e!="object")return;let t={...e};return typeof t.title=="string"&&t.title.trim()!==""?t.title.trim():void 0}var Br=new Set;function ha({t:e,phase:t,toolName:a,block:r}){let n=t==="result"&&r?.isError!==!0?vo(r?.meta):null,o=(0,jt.useRef)(t!=="result");t!=="result"&&(o.current=!0);let l=a==="artifact_update";if((0,jt.useEffect)(()=>{if(n===null)return;xe(n.id,n.title),je(n.id,n.version),we();let g=n.id+":"+n.version;!o.current||Br.has(g)||(Br.add(g),Se.sidebarRight?.openResource(q(n.address)))},[n?.id,n?.version,n?.title]),t!=="result"){let g=wo(r?.args),d=g===void 0?e(l?"card.updatingUntitled":"card.working"):e(l?"card.updating":"card.creating",{title:g});return(0,M.jsxs)("div",{className:"art-card","data-artifact-card":"working",children:[(0,M.jsx)("span",{className:"art-card-icon",children:(0,M.jsx)(fe,{})}),(0,M.jsx)("span",{className:"art-card-text",children:(0,M.jsx)(Qe.TextShimmer,{active:!0,className:"art-card-title",children:(0,M.jsx)("span",{role:"status",children:d})})}),(0,M.jsx)(Qe.StateDot,{state:"ongoing"})]})}if(r?.isError===!0)return(0,M.jsxs)("div",{className:"art-card","data-artifact-card":"error",children:[(0,M.jsx)("span",{className:"art-card-icon","data-tone":"error",children:(0,M.jsx)(fe,{})}),(0,M.jsxs)("span",{className:"art-card-text",children:[(0,M.jsx)("span",{className:"art-card-title",children:e("card.failed")}),(0,M.jsx)("span",{className:"art-card-sub","data-tone":"error",children:xo(r.content)})]})]});if(n===null)return(0,M.jsxs)("div",{className:"art-card","data-artifact-card":"missing",children:[(0,M.jsx)("span",{className:"art-card-icon",children:(0,M.jsx)(fe,{})}),(0,M.jsx)("span",{className:"art-card-sub",children:e("card.missing")})]});let s=q(n.address);return(0,M.jsxs)("button",{type:"button",className:"art-card art-card-open","data-artifact-card":"ready","data-artifact-id":n.id,"aria-label":e("card.openNamed",{title:n.title}),onClick:()=>Se.sidebarRight?.openResource(s),children:[(0,M.jsx)("span",{className:"art-card-icon",children:n.type==="page"?(0,M.jsx)(fe,{}):n.type==="doc"?(0,M.jsx)(Te,{}):(0,M.jsx)(Be,{})}),(0,M.jsxs)("span",{className:"art-card-text",children:[(0,M.jsx)("span",{className:"art-card-title",title:n.title,children:n.title}),(0,M.jsxs)("span",{className:"art-card-sub",children:[e(l?"card.updated":"card.created")," \xB7 ",e(`type.${n.type}`)," \xB7 ",e("gallery.version",{version:n.version}),n.address.scope==="library"?" \xB7 "+e("scope.library"):""]})]}),(0,M.jsx)("span",{className:"art-card-go","aria-hidden":"true",children:(0,M.jsx)(Qe.IconChevronRightOutlineRegular,{size:14})})]})}var dt=require("react"),Bt=require("@deepseek-ai/dsh-client-ui-primitives");var Hr=require("react");function Vr({sessionId:e,useSessions:t,useWorkspaces:a}){let r=a(o=>o.items),n=t(o=>o.byId[e]);return(0,Hr.useMemo)(()=>{let o=typeof n?.cwd=="string"?n.cwd:null,l=r.find(s=>s.sessionIds?.includes(e))??r.find(s=>o!==null&&(o===s.path||o.startsWith(`${s.path}/`)))??null;return{root:o??l?.path??null,workspaceId:l?.workspaceId??null}},[r,n,e])}var ct="dsh-artifact-studio/artifact",va="artifact",Xe="dsh-artifact-studio-panel";var ze=require("react/jsx-runtime"),ko=6,xa=["dashboard","explainer","report","brief"];function To(e,t){let a=e.filter(n=>n.source.sessionId===t),r=e.filter(n=>n.source.sessionId!==t);return[...a,...r].slice(0,ko)}function _r(e){let{t,sessionId:a,inputActions:r}=e,o=Vr(e).workspaceId,l=Rt(),[s,g]=(0,dt.useState)(!1),[d,b]=(0,dt.useState)(null);(0,dt.useEffect)(()=>{if(!s||o===null)return;let u=new AbortController;return U.list({scope:"workspace",workspaceId:o},{},u.signal).then(p=>{u.signal.aborted||b(To(p.items,a))}).catch(()=>{u.signal.aborted||b([])}),()=>u.abort()},[s,o,a,l]);let T=o===null?[{type:"label",id:"no-workspace",text:t("empty.noWorkspace")}]:d===null?[{type:"label",id:"loading",text:t("empty.loading")}]:d.length===0?[{type:"label",id:"empty",text:t("composer.empty")}]:d.map(u=>({id:"open:"+u.id,label:u.title,icon:u.type==="page"?(0,ze.jsx)(fe,{size:14}):u.type==="doc"?(0,ze.jsx)(Te,{size:14}):(0,ze.jsx)(Be,{size:14})})),w=[{type:"label",id:"recent",text:t("composer.recent")},...T,...r===void 0?[]:[{type:"separator",id:"start-gap"},{type:"label",id:"start",text:t("composer.start")},...xa.map(u=>({id:"prompt:"+u,label:t(`prompt.${u}`)}))],{type:"separator",id:"all-gap"},{id:"all",label:t("composer.all")}];return(0,ze.jsx)(Bt.Menu,{open:s,onClose:()=>g(!1),items:w,onSelect:u=>{if(g(!1),u==="all"){Se.layout?.selectPanel(Xe);return}if(u.startsWith("prompt:")&&r!==void 0){r.insertText(t(`prompt.${u.slice(7)}Text`),r.captureInsertion());return}let p=d?.find(y=>"open:"+y.id===u);p===void 0||o===null||(xe(p.id,p.title),Se.sidebarRight?.openResource(q({scope:"workspace",workspaceId:o,id:p.id})))},side:"top",portal:!0,autoFocus:!0,anchor:(0,ze.jsx)(Bt.Tooltip,{label:t("composer.label"),side:"top",portal:!0,children:(0,ze.jsx)("button",{type:"button",className:"art-composer","aria-label":t("composer.label"),"aria-haspopup":"menu","aria-expanded":s,onClick:()=>g(u=>!u),children:(0,ze.jsx)(At,{})})})})}var ee=require("react");var O=require("react"),P=require("@deepseek-ai/dsh-client-ui-primitives");var Ne=require("react"),Ht=require("@deepseek-ai/dsh-client-ui-primitives");var E=require("react/jsx-runtime"),So=["sm","md","lg"],No=e=>`<!doctype html><html><head><meta name="color-scheme" content="light dark"><style>
|
|
40
40
|
body { margin: 0; padding: 20px; font-family: var(--artifact-font-family); background: var(--artifact-color-surface); color: var(--artifact-color-text); }
|
|
41
41
|
h2 { margin: 0 0 6px; font-family: var(--artifact-font-display); font-size: var(--artifact-font-size-4); letter-spacing: -0.02em; }
|
package/dist/host/lib/rpc.js
CHANGED
|
@@ -4,9 +4,6 @@ import { fieldsOf, optionalEdits, optionalInteger, optionalScope, optionalString
|
|
|
4
4
|
export const ENDPOINTS = [
|
|
5
5
|
'list',
|
|
6
6
|
'get',
|
|
7
|
-
'openEditor',
|
|
8
|
-
'closeEditor',
|
|
9
|
-
'move',
|
|
10
7
|
'create',
|
|
11
8
|
'update',
|
|
12
9
|
'delete',
|
|
@@ -53,14 +50,6 @@ async function dispatch(service, endpoint, fields) {
|
|
|
53
50
|
});
|
|
54
51
|
case 'get':
|
|
55
52
|
return service.read(target, requiredString(fields, 'id'), optionalInteger(fields, 'version'));
|
|
56
|
-
case 'openEditor':
|
|
57
|
-
await service.openEditor(target, requiredString(fields, 'id'), requiredString(fields, 'token'));
|
|
58
|
-
return { ok: true };
|
|
59
|
-
case 'closeEditor':
|
|
60
|
-
await service.closeEditor(target, requiredString(fields, 'id'), requiredString(fields, 'token'));
|
|
61
|
-
return { ok: true };
|
|
62
|
-
case 'move':
|
|
63
|
-
return { manifest: await service.move(target, requiredString(fields, 'id'), requiredString(fields, 'destinationWorkspaceId'), requiredInteger(fields, 'baseVersion'), requiredString(fields, 'token')) };
|
|
64
53
|
case 'create':
|
|
65
54
|
return {
|
|
66
55
|
manifest: await service.create(target, {
|
package/dist/host/lib/service.js
CHANGED
|
@@ -5,7 +5,6 @@ import { PAGE_CSP, composePage } from '../../render.js';
|
|
|
5
5
|
import { DesignRenderer, PREVIEW_MAX_SIDE } from './design-render.js';
|
|
6
6
|
import { clearWorkspaceDesignSystem, resolveDesignSystem, saveDesignSystem } from './design-system.js';
|
|
7
7
|
import { ArtifactError } from './errors.js';
|
|
8
|
-
import { acquireEditor, releaseEditor } from './editor-leases.js';
|
|
9
8
|
import { docToHtml, writeExport } from './export.js';
|
|
10
9
|
import { assertWithin, withLock, writeAtomic } from './fsutil.js';
|
|
11
10
|
import { assertPlainFile, libraryRoot, requireWorkspace, workspaceRoot, workspaceRootExisting } from './paths.js';
|
|
@@ -176,24 +175,6 @@ export class ArtifactService {
|
|
|
176
175
|
async restore(target, id, version, source, baseVersion) {
|
|
177
176
|
return this.store.restore(await this.root(target, id), id, version, source, baseVersion);
|
|
178
177
|
}
|
|
179
|
-
async openEditor(target, id, token) {
|
|
180
|
-
const root = await this.root(target, id);
|
|
181
|
-
const key = path.join(root.root, id);
|
|
182
|
-
await acquireEditor(key, token, async () => { await this.store.manifest(root, id); });
|
|
183
|
-
}
|
|
184
|
-
async closeEditor(target, id, token) {
|
|
185
|
-
const root = await this.root(target, id);
|
|
186
|
-
await releaseEditor(path.join(root.root, id), token);
|
|
187
|
-
}
|
|
188
|
-
async move(target, id, destinationWorkspaceId, baseVersion, ownToken) {
|
|
189
|
-
if (scopeOfId(id) !== 'workspace' || target.workspaceId === undefined || destinationWorkspaceId === target.workspaceId) {
|
|
190
|
-
throw new ArtifactError('artifact/bad-request', 'Choose a different workspace for a workspace artifact.');
|
|
191
|
-
}
|
|
192
|
-
requireWorkspace(this.registry, destinationWorkspaceId);
|
|
193
|
-
const source = await this.root({ scope: 'workspace', workspaceId: target.workspaceId }, id);
|
|
194
|
-
const destination = await this.root({ scope: 'workspace', workspaceId: destinationWorkspaceId });
|
|
195
|
-
return this.store.move(source, destination, id, baseVersion, ownToken);
|
|
196
|
-
}
|
|
197
178
|
async history(target, id) {
|
|
198
179
|
return this.store.history(await this.root(target, id), id);
|
|
199
180
|
}
|
package/dist/host/lib/skill.js
CHANGED
|
@@ -16,8 +16,10 @@ Use \`artifact_create\` when the user asks for an artifact, an artifact page, an
|
|
|
16
16
|
## Pick the type
|
|
17
17
|
|
|
18
18
|
- \`doc\` for prose: reports, briefs, plans, specs, notes. It is Markdown, edited in a rich-text editor, and exported to Word, Markdown, and HTML. Use headings, short paragraphs, lists, tables, task lists, quotes, and fenced code. Do not paste HTML into a doc.
|
|
19
|
-
- \`page\` for anything visual or interactive: dashboards, one-pagers, explainers, calculators, diagrams, prototypes.
|
|
20
|
-
- \`design\` for a layout the user will open on a canvas: UI mockups, layout explorations, and screens that export as PNG, SVG, or a \`.fig\` document.
|
|
19
|
+
- \`page\` for anything visual or interactive: dashboards, one-pagers, explainers, calculators, diagrams, and clickable prototypes the user asks for as a page.
|
|
20
|
+
- \`design\` for a layout the user will open on a canvas: UI mockups, wireframes, layout explorations, and screens that export as PNG, SVG, or a \`.fig\` document.
|
|
21
|
+
|
|
22
|
+
A request for a mockup or a wireframe always gets \`design\`, even when it shows a flow. Draw each step of the flow as its own frame. If the user offers both, such as "a page or a mockup", make a mockup. Use \`page\` for a mockup only when the user asks for a page or for something clickable. Never title or describe a page as a mockup.
|
|
21
23
|
|
|
22
24
|
## Designs (OpenPencil Design JSX)
|
|
23
25
|
|
|
@@ -37,6 +39,12 @@ Call this artifact a mockup when you talk to the user. The tools still take type
|
|
|
37
39
|
- The stored artifact is the JSX source. Send the complete source as \`content\` when you update a design. The host compiles and validates before saving, so a compile error refuses the write and returns the compiler message.
|
|
38
40
|
- Export is PNG, SVG, or \`.fig\`. The user can open the \`.fig\` in OpenPencil for a full canvas editor.
|
|
39
41
|
|
|
42
|
+
### When a design write fails
|
|
43
|
+
|
|
44
|
+
- A compile, icon, or validation error names a problem in your source. Fix the source and try again.
|
|
45
|
+
- Any other error, such as "The design renderer stopped" or a missing module, is a fault in the plugin, not in your source. Stop and show the user the exact error.
|
|
46
|
+
- Never switch to a \`page\` or a \`doc\` to work around a failed design. Do it only when the user tells you to.
|
|
47
|
+
|
|
40
48
|
## The page sandbox
|
|
41
49
|
|
|
42
50
|
A page renders in an opaque-origin iframe with every network request blocked.
|
package/dist/host/lib/store.js
CHANGED
|
@@ -3,7 +3,6 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { CONTENT_FILE, ID_PATTERN, MAX_LIST_LIMIT, MAX_TITLE, isArtifactType, isManifest, isVersionSource } from '../../contract.js';
|
|
5
5
|
import { ArtifactError, errnoCode } from './errors.js';
|
|
6
|
-
import { assertNoEditors } from './editor-leases.js';
|
|
7
6
|
import { assertWithin, withLock, writeAtomic } from './fsutil.js';
|
|
8
7
|
import { artifactDir, assertPlainFile } from './paths.js';
|
|
9
8
|
export const DEFAULT_LIMITS = {
|
|
@@ -490,53 +489,6 @@ export class ArtifactStore {
|
|
|
490
489
|
const items = filtered.slice(offset, offset + limit);
|
|
491
490
|
return { items, total: filtered.length, hasMore: offset + items.length < filtered.length, truncated };
|
|
492
491
|
}
|
|
493
|
-
/** Transfer saved files under source and destination locks. */
|
|
494
|
-
async move(source, destination, id, baseVersion, ownToken) {
|
|
495
|
-
if (source.scope !== 'workspace' || destination.scope !== 'workspace' || source.root === destination.root) {
|
|
496
|
-
throw new ArtifactError('artifact/bad-request', 'Choose a different workspace.');
|
|
497
|
-
}
|
|
498
|
-
const dir = await artifactDir(source, id);
|
|
499
|
-
const target = path.join(destination.root, id);
|
|
500
|
-
await assertWithin(destination.root, target);
|
|
501
|
-
const first = dir < target ? dir : target;
|
|
502
|
-
const second = dir < target ? target : dir;
|
|
503
|
-
return withLock(first, () => withLock(second, async () => {
|
|
504
|
-
await assertNoEditors(dir, ownToken);
|
|
505
|
-
const manifest = await this.readManifest(dir);
|
|
506
|
-
if (manifest.version !== baseVersion) {
|
|
507
|
-
throw new ArtifactError('artifact/stale-version', 'The artifact changed before it could be moved.', { current: manifest.version, baseVersion });
|
|
508
|
-
}
|
|
509
|
-
try {
|
|
510
|
-
await fs.lstat(target);
|
|
511
|
-
throw new ArtifactError('artifact/bad-request', 'The destination already contains this artifact.', { id });
|
|
512
|
-
}
|
|
513
|
-
catch (error) {
|
|
514
|
-
if (error instanceof ArtifactError || errnoCode(error) !== 'ENOENT')
|
|
515
|
-
throw error;
|
|
516
|
-
}
|
|
517
|
-
const inspect = async (entry) => {
|
|
518
|
-
await assertWithin(source.root, entry);
|
|
519
|
-
const stat = await fs.lstat(entry);
|
|
520
|
-
if (stat.isSymbolicLink() || (!stat.isFile() && !stat.isDirectory())) {
|
|
521
|
-
throw new ArtifactError('artifact/forbidden-path', 'An artifact contains an unsafe file.');
|
|
522
|
-
}
|
|
523
|
-
if (stat.isDirectory())
|
|
524
|
-
for (const name of await fs.readdir(entry))
|
|
525
|
-
await inspect(path.join(entry, name));
|
|
526
|
-
};
|
|
527
|
-
await inspect(dir);
|
|
528
|
-
await assertWithin(destination.root, target);
|
|
529
|
-
try {
|
|
530
|
-
await fs.rename(dir, target);
|
|
531
|
-
}
|
|
532
|
-
catch (error) {
|
|
533
|
-
if (errnoCode(error) === 'EXDEV')
|
|
534
|
-
throw new ArtifactError('artifact/storage-failure', 'Source and destination must be on the same filesystem. The artifact was not moved.');
|
|
535
|
-
throw error;
|
|
536
|
-
}
|
|
537
|
-
return manifest;
|
|
538
|
-
}));
|
|
539
|
-
}
|
|
540
492
|
/**
|
|
541
493
|
* Move an artifact into the scope's trash, then sweep trash entries past retention.
|
|
542
494
|
* @param root the scope root.
|
package/dist/host/lib/tools.js
CHANGED
|
@@ -167,7 +167,7 @@ export function createTools(host) {
|
|
|
167
167
|
additionalProperties: false,
|
|
168
168
|
required: ['type', 'title', 'content'],
|
|
169
169
|
properties: {
|
|
170
|
-
type: { type: 'string', enum: ['page', 'doc', 'design'], description: 'page for HTML, doc for Markdown, design for OpenPencil Design JSX. For a design, load the artifact-design skill first: no imports, no HTML.' },
|
|
170
|
+
type: { type: 'string', enum: ['page', 'doc', 'design'], description: 'page for HTML, doc for Markdown, design for OpenPencil Design JSX. A mockup or wireframe is always design. For a design, load the artifact-design skill first: no imports, no HTML. If a design fails for a reason other than its source, report the error; never redo it as a page.' },
|
|
171
171
|
title: { type: 'string', description: 'Short title, 1 to 120 characters.' },
|
|
172
172
|
content: { type: 'string', description: 'The full HTML document, Markdown text, or Design JSX source, up to 2 MiB.' },
|
|
173
173
|
scope: SCOPE_PARAM,
|
|
@@ -312,21 +312,6 @@ export function createTools(host) {
|
|
|
312
312
|
return { ...summary(manifest, target), warnings };
|
|
313
313
|
},
|
|
314
314
|
};
|
|
315
|
-
const move = {
|
|
316
|
-
name: 'artifact_move',
|
|
317
|
-
description: 'Move a saved workspace artifact to another registered workspace. Ask the user first. Close all editors for the artifact before moving it.',
|
|
318
|
-
parameters: { type: 'object', additionalProperties: false, required: ['id', 'destinationWorkspaceId', 'baseVersion'], properties: {
|
|
319
|
-
id: { type: 'string' }, destinationWorkspaceId: { type: 'string' }, baseVersion: { type: 'integer' },
|
|
320
|
-
} },
|
|
321
|
-
output: { schema: SUMMARY_SCHEMA, render: (_args, value) => [{ type: 'text', text: 'Moved artifact: ' + String(record(value).id) + ' to workspace ' + String(record(value).workspaceId) }] },
|
|
322
|
-
async execute(args, exec) {
|
|
323
|
-
const fields = fieldsOf(args);
|
|
324
|
-
const target = await targetFor(host, exec, undefined);
|
|
325
|
-
const destinationWorkspaceId = requiredString(fields, 'destinationWorkspaceId');
|
|
326
|
-
const manifest = await service.move(target, requiredString(fields, 'id'), destinationWorkspaceId, requiredInteger(fields, 'baseVersion'));
|
|
327
|
-
return summary(manifest, { scope: 'workspace', workspaceId: destinationWorkspaceId });
|
|
328
|
-
},
|
|
329
|
-
};
|
|
330
315
|
const list = {
|
|
331
316
|
name: 'artifact_list',
|
|
332
317
|
description: 'List artifacts in this project or the profile library, newest first, at most 50 per call.',
|
|
@@ -460,5 +445,5 @@ export function createTools(host) {
|
|
|
460
445
|
return { scope: saved.scope, tokens: JSON.stringify(saved.tokens, null, 2) };
|
|
461
446
|
},
|
|
462
447
|
};
|
|
463
|
-
return [create, read, update,
|
|
448
|
+
return [create, read, update, list, remove, exportTool, designRead, designUpdate];
|
|
464
449
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-artifact-studio",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first artifacts for DeepSeek Harness: the agent creates pages and documents as versioned files, and you open, edit, restore, and export them beside the chat.",
|
|
6
6
|
"keywords": [
|
|
@@ -63,11 +63,13 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@open-pencil/core": "0.16.0",
|
|
66
|
+
"@open-pencil/scene-graph": "0.16.0",
|
|
66
67
|
"docx": "9.15.3",
|
|
67
68
|
"marked": "^17.0.1"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@iconify-json/mdi": "1.2.3",
|
|
72
|
+
"@open-pencil/design-jsx": "0.16.0",
|
|
71
73
|
"@open-pencil/vue": "0.16.0",
|
|
72
74
|
"@tiptap/core": "3.33.1",
|
|
73
75
|
"@tiptap/extension-list": "^3.33.1",
|