dsh-drawai 0.3.1 → 0.3.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/lib/client.js CHANGED
@@ -5750,7 +5750,7 @@ window.__ModuleLoader__.load({
5750
5750
  } catch (error) { invalid = error.message }
5751
5751
  return React.createElement('div', { ref: panelRef, tabIndex: props.inline ? undefined : -1, className: props.inline ? 'drawai-video-trace-inline' : 'drawai-video-preview', role: props.inline ? 'group' : 'dialog', 'aria-modal': props.inline ? undefined : true, 'aria-label': '视频分段复刻',
5752
5752
  style: props.inline ? undefined : { alignItems: 'center', justifyContent: 'center' },
5753
- onKeyDown: (event) => { event.stopPropagation(); if (event.key === 'Escape') { if (busy) props.onCancel(); else props.onClose() } },
5753
+ onKeyDown: (event) => { event.stopPropagation(); if (event.key === 'Escape') { if (busy) { if (props.onCancel) props.onCancel() } else props.onClose() } },
5754
5754
  onPointerDown: (event) => event.stopPropagation() },
5755
5755
  React.createElement('div', { className: 'drawai-export-panel', style: props.inline ? undefined : { padding: '20px', width: '360px', maxWidth: '100%', boxSizing: 'border-box', maxHeight: '100%', overflow: 'auto', borderRadius: '12px' } },
5756
5756
  React.createElement('div', { className: 'drawai-popover-title' }, '视频分段复刻'),
@@ -5771,7 +5771,8 @@ window.__ModuleLoader__.load({
5771
5771
  React.createElement('div', { className: 'drawai-export-info' }, '画质、帧率和范围由你决定。提高尺寸、帧率或时长会增加处理时间与文件大小;小视频不放大。原视频保留,结果不含音轨。'),
5772
5772
  job ? React.createElement('div', { role: job.error ? 'alert' : 'status', 'aria-live': 'polite' }, job.message) : null,
5773
5773
  submitError ? React.createElement('div', { role: 'alert', className: 'drawai-err' }, submitError) : null,
5774
- busy ? React.createElement('progress', { value: job.done || 0, max: job.total || 1, 'aria-label': '视频复刻进度', style: { width: '100%' } }) : null,
5774
+ // 排队模式只给 queued/onStart/onClose,提交中 busy=true 但还没有 job:进度条退化为不确定态。
5775
+ busy ? React.createElement('progress', { value: job ? job.done || 0 : undefined, max: job ? job.total || 1 : undefined, 'aria-label': '视频复刻进度', style: { width: '100%' } }) : null,
5775
5776
  job && job.svg ? React.createElement('img', { src: 'data:image/svg+xml,' + encodeURIComponent(job.svg), alt: '最近完成的 SVG 帧', style: { width: '100%', maxHeight: '180px', objectFit: 'contain' } }) : null,
5776
5777
  React.createElement('div', { className: 'drawai-layer-footer' },
5777
5778
  props.inline ? null : React.createElement('button', { type: 'button', className: 'drawai-btn', onClick: busy ? props.onCancel : props.onClose }, busy ? '取消复刻' : '关闭'),
package/lib/index.js CHANGED
@@ -4165,7 +4165,8 @@ function sanitizeNewName(raw) {
4165
4165
  // (format v4 message requires a producer-owned source kind)。
4166
4166
  // 目标形是 `{ kind: 'plugin:<名>' }`(V3→V4 迁移对旧 wrapper 也写成这样),
4167
4167
  // 对 user/message 注入在 V3/V4 都可过;不带 form —— 它只是"环境事实"。
4168
- agent.inject({ role: 'user', content: [{ type: 'text', text: text }], source: { kind: 'plugin:' + name } })
4168
+ // 消息 id 会落到 user/message 的 data.id;缺失会导致持久化后的会话读取校验失败。
4169
+ agent.inject({ id: randomUUID(), role: 'user', content: [{ type: 'text', text: text }], source: { kind: 'plugin:' + name } })
4169
4170
  } catch (error) {
4170
4171
  // 注入失败不该影响画布本身:工具那条回退链还在。
4171
4172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-drawai",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "description": "DSH 右侧栏的可编辑画布 + AI 语义绘图工具(diagram_apply / diagram_read),直接读写原生 .drawio 文件",
6
6
  "license": "MIT",