@lincyaw/workbench 0.2.0-rc.117 → 0.2.0-rc.119
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/package.json +4 -4
- package/src/MediaClipEditor.tsx +3 -3
- package/src/StepProductionEditor.tsx +1 -1
- package/src/approvals.tsx +1 -1
- package/src/base-controls.tsx +26 -5
- package/src/components.tsx +10 -3
- package/src/document-editor/BlockNoteSurface.tsx +1 -1
- package/src/document-editor/ComponentPropertiesDialog.tsx +6 -6
- package/src/document-editor/DocumentComments.tsx +2 -3
- package/src/document-editor/NarrationEditor.tsx +1 -1
- package/src/document-editor/style.css +1 -2
- package/src/messages.ts +0 -2
- package/src/panels/DocumentView.tsx +13 -16
- package/src/panels/DocumentVoiceDialog.tsx +1 -1
- package/src/panels/HistoryPanel.tsx +2 -3
- package/src/panels/McpSettingsPanel.tsx +1 -1
- package/src/panels/PreviewPanel.tsx +3 -3
- package/src/panels/ProductionPanel.tsx +3 -3
- package/src/panels/ProductionRecordingRange.tsx +2 -2
- package/src/panels/SourceDocumentPanel.tsx +3 -3
- package/src/panels/SpeechSettingsPanel.tsx +2 -2
- package/src/panels/VoicePreviewDialog.tsx +1 -1
- package/src/panels/VoiceoverDialog.tsx +1 -1
- package/src/styles.css +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincyaw/workbench",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.119",
|
|
4
4
|
"description": "Presmium's workbench panels in React (the documents, a document edited on its rendered page with comments and version history) with the workspace service's client and the preview protocol's workbench side; @lincyaw/dsh places them in presmium studio (experimental)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"@tiptap/pm": "3.32.0",
|
|
56
56
|
"katex": "0.18.10",
|
|
57
57
|
"react-resizable-panels": "4.14.5",
|
|
58
|
-
"@lincyaw/design": "1.0.0-rc.
|
|
59
|
-
"@lincyaw/kernel": "1.0.0-rc.
|
|
58
|
+
"@lincyaw/design": "1.0.0-rc.118",
|
|
59
|
+
"@lincyaw/kernel": "1.0.0-rc.118"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"react": "^18.3.1",
|
|
@@ -67,6 +67,6 @@
|
|
|
67
67
|
"@types/react-dom": "18.3.7",
|
|
68
68
|
"react": "^18.3.1",
|
|
69
69
|
"react-dom": "^18.3.1",
|
|
70
|
-
"@lincyaw/compiler": "1.0.0-rc.
|
|
70
|
+
"@lincyaw/compiler": "1.0.0-rc.118"
|
|
71
71
|
}
|
|
72
72
|
}
|
package/src/MediaClipEditor.tsx
CHANGED
|
@@ -110,12 +110,12 @@ export function MediaClipEditor(props: MediaClipEditorProps) {
|
|
|
110
110
|
<div className="pm-ui-media-clip-editor__actions">
|
|
111
111
|
<PmButton density={density} variant="primary" loading={busy === 'apply'} disabled={disabled || Boolean(busy) || !props.canApply || review || !valid} onClick={submit}>{selectedClipId ? t.apply : t.add}</PmButton>
|
|
112
112
|
<PmButton density={density} disabled={disabled || !inspected} onClick={() => change({ clip: { ...clip, sourceRange: { startMs: 0, endMs: inspected!.durationMs } }, startText: undefined, endText: undefined })}>{t.restore}</PmButton>
|
|
113
|
-
{selectedClipId && <PmButton density={density}
|
|
113
|
+
{selectedClipId && <PmButton density={density} loading={busy === 'remove'} disabled={disabled || Boolean(busy) || originalRemoved} onClick={props.onRemove}>{t.remove}</PmButton>}
|
|
114
114
|
</div>
|
|
115
115
|
</>}
|
|
116
|
-
{originalRemoved ? <PmNotice tone="warn">{t.removed}</PmNotice> : review ? <PmNotice tone="warn"
|
|
116
|
+
{originalRemoved ? <PmNotice tone="warn">{t.removed}</PmNotice> : review ? <PmNotice tone="warn" action={<PmButton density={density} disabled={disabled || Boolean(busy) || !props.canApply || !inspected} onClick={props.onReview}>{t.check}</PmButton>}>{t.review}</PmNotice>
|
|
117
117
|
: clip.assetId && !props.canApply && !busy && <span className="pm-ui-field__hint">{t.unavailable}</span>}
|
|
118
|
-
{props.failure && <PmNotice tone="danger"
|
|
118
|
+
{props.failure && <PmNotice tone="danger" action={<PmButton density={density} disabled={disabled || Boolean(busy)} onClick={props.retryImport ? props.onRetryImport : props.onRead}>{props.retryImport ? t.retryImport : t.retry}</PmButton>}>{props.failure}</PmNotice>}
|
|
119
119
|
{props.storageFailed && <PmNotice tone="warn">{t.storageFailed}</PmNotice>}
|
|
120
120
|
{props.pending && !props.failure && <span className="pm-ui-field__hint" role="status">{t.pending}</span>}
|
|
121
121
|
{props.status && <span className="pm-ui-field__hint" role="status">{props.status}</span>}
|
|
@@ -113,7 +113,7 @@ export function StepProductionEditor({ document, stepId, locale, readOnly, advan
|
|
|
113
113
|
return <section className="pm-ui-step-production" contentEditable={false} data-step-production={stepId} aria-label={t.timing}
|
|
114
114
|
onFocus={() => { onInteraction?.(); onPause() }} onKeyDown={event => event.stopPropagation()} onPointerDown={event => event.stopPropagation()}>
|
|
115
115
|
{advanced && <div className="pm-ui-step-production__heading"><span className="pm-ui-field__label">{t.timing}</span>
|
|
116
|
-
<PmButton small variant="
|
|
116
|
+
<PmButton small variant="text" disabled={readOnly || !hasStepTiming && !drafts?.minimumHoldMs && !drafts?.trailingPauseMs} title={t.restoreHint} onClick={() => { onDraft?.('minimumHoldMs', undefined); onDraft?.('trailingPauseMs', undefined); apply({ narrationStart: null, minimumHoldMs: null, trailingPauseMs: null }) }}>{t.restore}</PmButton>
|
|
117
117
|
</div>}
|
|
118
118
|
{!advanced ? <PmField group label={t.start} density="compact" hint={mixed ? t.mixed : undefined}>
|
|
119
119
|
<div className="pm-ui-step-production__actions"><PmSegmented label={t.start} value={mixed ? '' : narrations[0]?.value ?? start.value ?? 'with-animation'} options={options} disabled={readOnly} onChange={value => apply({ narrationStart: value as 'with-animation' | 'after-animation' })} /></div>
|
package/src/approvals.tsx
CHANGED
|
@@ -43,7 +43,7 @@ export function WorkbenchApprovals({ density = 'compact' }: { density?: 'compact
|
|
|
43
43
|
}
|
|
44
44
|
return (
|
|
45
45
|
<PmPopover open={open} onOpenChange={setOpen} label={t.approvalsTitle} name="pmw-approvals" trigger={
|
|
46
|
-
<PmButton data-approval-trigger="" variant="
|
|
46
|
+
<PmButton data-approval-trigger="" variant="primary" density={density}>{t.approvals(pending.length)}</PmButton>
|
|
47
47
|
}>
|
|
48
48
|
<h2 className="pmw-approvals__heading">{t.approvalsTitle}</h2>
|
|
49
49
|
<ul className="pmw-approvals__list">
|
package/src/base-controls.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ICONS } from '@lincyaw/design'
|
|
2
2
|
import type { IconName } from '@lincyaw/design'
|
|
3
3
|
import * as Tooltip from '@radix-ui/react-tooltip'
|
|
4
|
-
import { createElement, forwardRef } from 'react'
|
|
4
|
+
import { createElement, forwardRef, useEffect, useRef, useState } from 'react'
|
|
5
5
|
import type { ButtonHTMLAttributes, ReactNode } from 'react'
|
|
6
6
|
|
|
7
7
|
const cls = (...names: (string | false | undefined | null)[]) => names.filter(Boolean).join(' ')
|
|
@@ -14,7 +14,7 @@ export function PmIcon({ name, size: _size, strokeWidth = 1.7 }: { name: IconNam
|
|
|
14
14
|
)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export type ButtonVariant = 'default' | 'primary' | '
|
|
17
|
+
export type ButtonVariant = 'default' | 'primary' | 'ghost' | 'text' | 'danger'
|
|
18
18
|
|
|
19
19
|
export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> & { type?: 'button' | 'submit' | 'reset' }
|
|
20
20
|
export type ControlDensity = 'compact' | 'regular' | 'touch'
|
|
@@ -28,11 +28,32 @@ export const PmButton = forwardRef<HTMLButtonElement, ButtonProps & ControlProps
|
|
|
28
28
|
)
|
|
29
29
|
})
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
const TOOLTIP_DELAY = 500
|
|
32
|
+
const TOOLTIP_SKIP = 300
|
|
33
|
+
let tooltipClosedAt = 0
|
|
34
|
+
|
|
35
|
+
/** A pointer shows the tooltip after 500 ms, keyboard focus at once; within 300 ms of one closing, the next opens at
|
|
36
|
+
* once, so moving along a toolbar does not wait again. The timing is shared by every tooltip on the page. */
|
|
32
37
|
export function PmTooltip({ label, shortcut, children }: { label: string, shortcut?: string, children: ReactNode }) {
|
|
38
|
+
const [open, setOpen] = useState(false)
|
|
39
|
+
const shown = useRef(false)
|
|
40
|
+
const pointer = useRef(false)
|
|
41
|
+
const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)
|
|
42
|
+
useEffect(() => () => clearTimeout(timer.current), [])
|
|
43
|
+
const change = (next: boolean) => {
|
|
44
|
+
clearTimeout(timer.current)
|
|
45
|
+
if (!next) {
|
|
46
|
+
if (shown.current) tooltipClosedAt = Date.now()
|
|
47
|
+
shown.current = false
|
|
48
|
+
setOpen(false)
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
const wait = pointer.current && Date.now() - tooltipClosedAt > TOOLTIP_SKIP ? TOOLTIP_DELAY : 0
|
|
52
|
+
timer.current = setTimeout(() => { shown.current = true; setOpen(true) }, wait)
|
|
53
|
+
}
|
|
33
54
|
return (
|
|
34
|
-
<Tooltip.Provider delayDuration={
|
|
35
|
-
<Tooltip.Root><Tooltip.Trigger asChild>{children}</Tooltip.Trigger><Tooltip.Portal><div className="pm-ui-tooltip-layer"><Tooltip.Content className="pm-ui-tooltip pm-ui" side="bottom" sideOffset={6} collisionPadding={8}>
|
|
55
|
+
<Tooltip.Provider delayDuration={0} skipDelayDuration={0}>
|
|
56
|
+
<Tooltip.Root open={open} onOpenChange={change}><Tooltip.Trigger asChild onPointerEnter={() => { pointer.current = true }} onPointerLeave={() => { pointer.current = false }}>{children}</Tooltip.Trigger><Tooltip.Portal><div className="pm-ui-tooltip-layer"><Tooltip.Content className="pm-ui-tooltip pm-ui" side="bottom" sideOffset={6} collisionPadding={8}>
|
|
36
57
|
{label}{shortcut && <kbd className="pm-ui-shortcut">{shortcut}</kbd>}
|
|
37
58
|
</Tooltip.Content></div></Tooltip.Portal></Tooltip.Root>
|
|
38
59
|
</Tooltip.Provider>
|
package/src/components.tsx
CHANGED
|
@@ -422,8 +422,15 @@ export function PmSkeleton({ label, shape = 'document' }: { label: string, shape
|
|
|
422
422
|
)
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
const NOTICE_ICONS = { neutral: 'info', accent: 'info', ok: 'check', warn: 'warning', danger: 'warning' } as const satisfies Record<string, IconName>
|
|
426
|
+
|
|
427
|
+
/** A tone icon, the message, and an optional action at the end (a button or a group of buttons). */
|
|
428
|
+
export function PmNotice({ tone = 'neutral', action, children }: { tone?: keyof typeof NOTICE_ICONS, action?: ReactNode, children?: ReactNode }) {
|
|
429
|
+
return <div className={cls('pm-ui-notice', tone !== 'neutral' && `pm-ui-notice--${tone}`)} role={tone === 'danger' ? 'alert' : 'status'}>
|
|
430
|
+
<span className="pm-ui-notice__icon"><PmIcon name={NOTICE_ICONS[tone]} /></span>
|
|
431
|
+
<div className="pm-ui-notice__message">{children}</div>
|
|
432
|
+
{action && <div className="pm-ui-notice__action">{action}</div>}
|
|
433
|
+
</div>
|
|
427
434
|
}
|
|
428
435
|
|
|
429
436
|
export interface RangeProps {
|
|
@@ -621,7 +628,7 @@ export function PmTimeline({ label, tracks, labels, durationMs, durationStatus,
|
|
|
621
628
|
onChange={event => { const segment = pickerSegments.find(segment => segment.id === event.target.value); if (segment && !cannotSeek) onSelectSegment?.(segmentPicker.track, segment) }}>
|
|
622
629
|
<option value="">{segmentPicker.placeholder}</option>{pickerSegments.map(segment => <option key={segment.id} value={segment.id} disabled={segment.disabled}>{timelineTime(segment.startMs!)} · {segment.label}</option>)}
|
|
623
630
|
</PmSelect></div>}
|
|
624
|
-
{showSteps && <div className="pm-ui-timeline__steps">{steps.map(segment => <PmButton key={segment.stepId} density={density} disabled={blocked || segment.disabled} aria-pressed={segment.stepId === selectedStepId}
|
|
631
|
+
{showSteps && <div className="pm-ui-timeline__steps">{steps.map(segment => <PmButton key={segment.stepId} density={density} disabled={blocked || segment.disabled} aria-pressed={segment.stepId === selectedStepId} onClick={() => onSelectStep(segment.stepId!)}>{segment.label}</PmButton>)}</div>}
|
|
625
632
|
{(excluded || !tracks.some(track => track.segments.length)) && <PmNotice>{excluded?.notice ?? labels.empty}</PmNotice>}
|
|
626
633
|
{notice && <PmNotice>{notice}</PmNotice>}
|
|
627
634
|
<p id={hintId} className="pm-ui-sr-only">{labels.seekHint}</p>
|
|
@@ -201,7 +201,7 @@ export function BlockNoteSurface(props: BlockNoteSurfaceProps) {
|
|
|
201
201
|
}}
|
|
202
202
|
onCompositionStart={() => current.current.onComposition?.(true)}
|
|
203
203
|
onCompositionEnd={() => queueMicrotask(() => current.current.onComposition?.(false))}>
|
|
204
|
-
{fileErrors?.identity === props.identity && <PmNotice tone="danger"><
|
|
204
|
+
{fileErrors?.identity === props.identity && <PmNotice tone="danger" action={<PmIconButton small icon="close" label={fileMessages.dismiss} onClick={() => setFileErrors(undefined)} />}><ul className="pm-document-editor__file-errors">{fileErrors.failures.map((failure, index) => <li key={index}>{failure.name} · {fileMessages[failure.kind]}</li>)}</ul></PmNotice>}
|
|
205
205
|
<BlockNoteView editor={editor} editable={!props.readOnly} theme={DOCUMENT_EDITOR_THEME} formattingToolbar={false} slashMenu={false} linkToolbar={false} sideMenu={false} tableHandles={false} renderEditor={false} comments={false}
|
|
206
206
|
onChange={() => current.current.onChange(editor.document, editor)}
|
|
207
207
|
onSelectionChange={() => current.current.onSelection?.(documentSelection(editor))}>
|
|
@@ -229,10 +229,10 @@ export function ComponentPropertiesDialog({ identity, blockId, stepId, onClose }
|
|
|
229
229
|
{error && !((stale || materialStale || source?.error) && error === t.changed) && <PmNotice tone="danger">{error}</PmNotice>}
|
|
230
230
|
{!ready && error && <PmButton disabled={busy || !source} onClick={() => void retrySource()}>{t.retry}</PmButton>}
|
|
231
231
|
{!ready && !error && <PmNotice>{t.loading}</PmNotice>}
|
|
232
|
-
{ready && source?.error && <PmNotice tone="warn"
|
|
232
|
+
{ready && source?.error && <PmNotice tone="warn" action={<PmButton small disabled={busy} onClick={() => void retrySource()}>{t.retry}</PmButton>}>{t.changed}</PmNotice>}
|
|
233
233
|
{ready && (!document || block?.type !== 'component' || !definition) && <PmNotice tone="warn">{t.missing}</PmNotice>}
|
|
234
234
|
{ready && document && definition && block?.type === 'component' && page === 'materials' && <>
|
|
235
|
-
{materialStale && <PmNotice tone="warn"
|
|
235
|
+
{materialStale && <PmNotice tone="warn" action={<PmButton small disabled={!clean || busy} onClick={() => { if (canonical) { setMaterial(value => value && { ...value, source: canonical }); setError(undefined) } }}>{t.recheck}</PmButton>}>{t.changed}</PmNotice>}
|
|
236
236
|
<ComponentMaterials document={document} blockId={blockId} selected={material?.definitionId ?? block.definitionId} disabled={busy}
|
|
237
237
|
messages={t} onSelect={definitionId => setMaterial(value => ({ definitionId, source: value?.source ?? canonical! }))}
|
|
238
238
|
onLocate={id => { locateOnClose.current = true; close(); workbench.revealDocumentComponent(id, identity) }} />
|
|
@@ -241,8 +241,8 @@ export function ComponentPropertiesDialog({ identity, blockId, stepId, onClose }
|
|
|
241
241
|
<PmSelect label={t.scope} value={scope} onChange={event => { setScope(event.currentTarget.value as 'base' | 'step'); setError(undefined); setValidation(undefined) }}>
|
|
242
242
|
<option value="base">{t.base}</option><option value="step" disabled={!stepId}>{t.step}</option>
|
|
243
243
|
</PmSelect>
|
|
244
|
-
{stale && <PmNotice tone="warn"
|
|
245
|
-
{stored && (stale || error) && <PmButton small variant="
|
|
244
|
+
{stale && <PmNotice tone="warn" action={<PmButton small disabled={!clean || busy} onClick={recheck}>{t.recheck}</PmButton>}>{t.changed}</PmNotice>}
|
|
245
|
+
{stored && (stale || error) && <PmButton small variant="text" disabled={busy} onClick={() => void discardLocal()}>{t.discardChanges}</PmButton>}
|
|
246
246
|
{preview.effect && <span>{t.impact(preview.effect.affected.steps.length)}{scope === 'base' ? ` · ${t.preserved}` : ''}</span>}
|
|
247
247
|
{preview.error && <PmNotice tone="danger">{preview.error}</PmNotice>}
|
|
248
248
|
{bank?.status(target) === 'session-only' && <PmNotice tone="warn">{t.storage}</PmNotice>}
|
|
@@ -265,9 +265,9 @@ export function ComponentPropertiesDialog({ identity, blockId, stepId, onClose }
|
|
|
265
265
|
else { const reset = applyDocumentComponentAction(document, { type: 'component.step-parameters.reset', blockId, stepId: target.stepId! }).content; keep(effectiveComponentParameters(reset, blockId, target.stepId).parameters, false, true) }
|
|
266
266
|
} catch (error) { setError(message(error, t)) }
|
|
267
267
|
}}>{draft.reset ? t.edit : t.reset}</PmButton>}
|
|
268
|
-
<PmButton variant="
|
|
268
|
+
<PmButton variant="text" onClick={enterMaterials}>{t.materials}</PmButton>
|
|
269
269
|
</div>
|
|
270
|
-
{backupError && <PmNotice tone="warn"
|
|
270
|
+
{backupError && <PmNotice tone="warn" action={<PmButton small onClick={() => setBackupRead(value => value + 1)}>{t.retry}</PmButton>}>{t.storageRead}</PmNotice>}
|
|
271
271
|
{Boolean(backups?.unreadable) && <PmNotice tone="warn">{t.unreadable}</PmNotice>}
|
|
272
272
|
{Boolean(backups?.candidates.length) && <div className="component-properties__backups">
|
|
273
273
|
<PmSelect label={t.backup} value={backupIndex} disabled={backupBusy} onChange={event => setBackupIndex(Number(event.currentTarget.value))}>
|
|
@@ -195,12 +195,11 @@ export function DraftChoices({ candidates, disabled, onRecover, onDiscard, previ
|
|
|
195
195
|
try { await action(candidate) } finally { setBusy(false) }
|
|
196
196
|
}
|
|
197
197
|
if (!candidates.length) return null
|
|
198
|
-
return <PmNotice tone="accent"
|
|
198
|
+
return <PmNotice tone="accent" action={<>{onRecover && <PmButton small variant="primary" disabled={!candidate || disabled || busy || candidate.storage === 'session' || canRecover && !canRecover(candidate)} loading={busy} onClick={() => void act(onRecover)}>{t.commentRecover}</PmButton>}
|
|
199
|
+
<PmButton small disabled={!candidate || disabled || busy} onClick={() => void act(onDiscard)}>{t.commentDiscard}</PmButton></>}><PmSelect label={t.commentDrafts} value={candidate ? selected : ''} disabled={disabled || busy} onChange={event => setSelected(event.target.value)}>
|
|
199
200
|
<option value="">{t.commentChooseDraft}</option>{candidates.map(value => <option key={referenceKey(value)} value={referenceKey(value)}>{new Date(value.updatedAt).toLocaleString(context?.locale)} · {isNewCommentDraft(value.target) ? t.commentNewDraft : value.target.commentId ? t.commentEditDraft : t.commentReplyDraft}{value.storage === 'session' ? ` · ${t.commentSessionOnly}` : ''}</option>)}
|
|
200
201
|
</PmSelect>{candidate && preview && <DraftPreview candidate={candidate} />}
|
|
201
202
|
{candidate && unavailableMessage && canRecover && !canRecover(candidate) && <PmNotice tone="warn">{unavailableMessage}</PmNotice>}
|
|
202
|
-
<span className="pmw-notice__actions">{onRecover && <PmButton small variant="primary" disabled={!candidate || disabled || busy || candidate.storage === 'session' || canRecover && !canRecover(candidate)} loading={busy} onClick={() => void act(onRecover)}>{t.commentRecover}</PmButton>}
|
|
203
|
-
<PmButton small disabled={!candidate || disabled || busy} onClick={() => void act(onDiscard)}>{t.commentDiscard}</PmButton></span>
|
|
204
203
|
</PmNotice>
|
|
205
204
|
}
|
|
206
205
|
|
|
@@ -131,7 +131,7 @@ function NarrationSurface<T>(props: NarrationEditorProps<T>) {
|
|
|
131
131
|
<BlockNoteView editor={editor} editable={!props.readOnly} theme={DOCUMENT_EDITOR_THEME} formattingToolbar={false} sideMenu={false} slashMenu={false} linkToolbar={false} comments={false} onChange={change}>
|
|
132
132
|
{props.blockMenu && <SideMenuController sideMenu={NarrationSideMenu} />}
|
|
133
133
|
</BlockNoteView>
|
|
134
|
-
{props.advanced !== false && <div className="pm-ui-narration-editor__actions"><PmButton small variant="
|
|
134
|
+
{props.advanced !== false && <div className="pm-ui-narration-editor__actions"><PmButton small variant="text" disabled={props.readOnly} onClick={() => { setDisplay(editor.getSelectedText()); setSpoken(''); setOpen(true) }}>{t.pronunciation}</PmButton></div>}
|
|
135
135
|
<PmDialog open={open} label={t.pronunciation} closeLabel={t.cancel} onClose={() => setOpen(false)} actions={<>
|
|
136
136
|
<PmButton small onClick={() => setOpen(false)}>{t.cancel}</PmButton>
|
|
137
137
|
<PmButton small variant="primary" disabled={!display} onClick={() => { editor.insertInlineContent([{ type: 'narrationAtom', props: { kind: 'pronunciation', display, spoken, cueId: '', payload: '' } }], { updateSelection: true }); setOpen(false); editor.focus() }}>{t.done}</PmButton>
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
.pm-document-editor__end { flex: 1 0 auto; min-height: var(--pm-space-4); }
|
|
4
4
|
.pm-document-editor__end[data-editable] { cursor: text; }
|
|
5
5
|
.pm-document-editor .bn-block-content[data-page-end]:has(.ProseMirror-trailingBreak:only-child)::after { content: attr(data-placeholder); }
|
|
6
|
-
.pm-document-editor__file-errors {
|
|
7
|
-
.pm-document-editor__file-errors ul { flex: 1; min-width: 0; margin: 0; padding-inline-start: var(--pm-space-4); overflow-wrap: anywhere; }
|
|
6
|
+
.pm-document-editor__file-errors { margin: 0; padding-inline-start: var(--pm-space-4); overflow-wrap: anywhere; }
|
|
8
7
|
.pm-document-editor .pm-document-editor__page-title { margin-block: var(--pm-space-5) var(--pm-space-3); font-family: var(--pm-font-sans); font-size: var(--pm-text-title); font-weight: var(--pm-weight-semibold); line-height: var(--pm-leading-tight); }
|
|
9
8
|
.pm-document-editor__atom { flex: 1; width: 100%; min-width: 0; }
|
|
10
9
|
.pm-document-editor .bn-block-content[data-content-type='presmiumAtom'] > * { flex: 1; width: 100%; min-width: 0; }
|
package/src/messages.ts
CHANGED
|
@@ -203,7 +203,6 @@ const zh = {
|
|
|
203
203
|
readDocument: '阅读与运行',
|
|
204
204
|
editDocument: '返回编辑',
|
|
205
205
|
readingFailed: '无法准备文稿阅读视图。请确认文稿已保存,并查看诊断后重试。',
|
|
206
|
-
video: '视频',
|
|
207
206
|
videoHint: '讲授视频的效果:幻灯片、配音、字幕与动画按时间播放,修改内容后随即更新',
|
|
208
207
|
videoFile: '视频文件',
|
|
209
208
|
noVideoFile: '尚未导出',
|
|
@@ -573,7 +572,6 @@ const en: WorkbenchMessages = {
|
|
|
573
572
|
readDocument: 'Read and Run',
|
|
574
573
|
editDocument: 'Back to Editing',
|
|
575
574
|
readingFailed: 'Couldn’t prepare the document reading view. Confirm the document is saved, check the diagnostics, then try again.',
|
|
576
|
-
video: 'Video',
|
|
577
575
|
videoHint: 'The lecture video as it will look: the slides, voiceover, captions, and animations on its timeline, updated as you edit',
|
|
578
576
|
videoFile: 'Video file',
|
|
579
577
|
noVideoFile: 'Not exported yet',
|
|
@@ -381,15 +381,13 @@ function DocumentToolbar({ narrow, presentButton, framed, onBack, actions, aside
|
|
|
381
381
|
</>}
|
|
382
382
|
<SaveStatus />
|
|
383
383
|
<span className="pmw-spacer" />
|
|
384
|
-
{!narrow && <>
|
|
385
|
-
{capabilities?.production !== false && <PmToolbarButton asChild><PmButton small icon="arrange" loading={changingView} disabled={busy || !hasStep} onClick={onProduction}>{t.video}</PmButton></PmToolbarButton>}
|
|
386
|
-
{capabilities?.narration !== false && <PmToolbarButton asChild><PmIconButton small icon="captions" label={t.documentNarration} hint={t.documentNarrationHint} aria-pressed={aside === 'narration'} disabled={!hasStep} onClick={() => onAside('narration')} /></PmToolbarButton>}
|
|
387
|
-
</>}
|
|
388
|
-
{!compactCommands && <PmToolbarButton asChild><PmIconButton small icon="comment" label={commentsLabel} aria-pressed={aside === 'comments'} onClick={() => onAside('comments')} /></PmToolbarButton>}
|
|
389
|
-
{!narrow && <span className="pmw-toolbar__history"><PmToolbarButton asChild><PmIconButton small icon="versions" label={historyLabel} aria-pressed={aside === 'history'} onClick={() => onAside('history')} /></PmToolbarButton>{(draftCount > 0 || draftReadFailure) && <PmBadge tone={draftReadFailure ? 'warn' : 'neutral'}>{draftCount || <PmIcon name="warning" />}</PmBadge>}</span>}
|
|
390
|
-
<span className="pmw-toolbar__divider" aria-hidden="true" />
|
|
391
384
|
<PmToolbarButton asChild><PmIconButton small icon="eye" label={t.readDocument} disabled={blocked || changingView} onClick={onRead} /></PmToolbarButton>
|
|
392
385
|
<PmToolbarButton asChild><PmIconButton ref={presentButton} small icon="slides" label={t.present} hint={preparing || changingView ? t.presentationPreparing : timingDrafts ? t.timingDraftPending : blocked ? t.presentationPending : t.presentHint} loading={preparing || changingView} disabled={blocked || changingView} onClick={onPresent} /></PmToolbarButton>
|
|
386
|
+
{!narrow && capabilities?.production !== false && <PmToolbarButton asChild><PmIconButton small icon="video" label={p.title} loading={changingView} disabled={busy || !hasStep} onClick={onProduction} /></PmToolbarButton>}
|
|
387
|
+
<span className="pmw-toolbar__divider" aria-hidden="true" />
|
|
388
|
+
{!narrow && capabilities?.narration !== false && <PmToolbarButton asChild><PmIconButton small icon="captions" label={t.documentNarration} hint={t.documentNarrationHint} aria-pressed={aside === 'narration'} disabled={!hasStep} onClick={() => onAside('narration')} /></PmToolbarButton>}
|
|
389
|
+
{!compactCommands && <PmToolbarButton asChild><PmIconButton small icon="comment" label={commentsLabel} aria-pressed={aside === 'comments'} onClick={() => onAside('comments')} /></PmToolbarButton>}
|
|
390
|
+
{!narrow && <span className="pmw-toolbar__history"><PmToolbarButton asChild><PmIconButton small icon="versions" label={historyLabel} aria-pressed={aside === 'history'} onClick={() => onAside('history')} /></PmToolbarButton>{(draftCount > 0 || draftReadFailure) && <PmBadge tone={draftReadFailure ? 'warn' : 'neutral'}>{draftCount || <PmIcon name="warning" />}</PmBadge>}</span>}
|
|
393
391
|
{capabilities?.export !== false && <PmToolbarButton asChild><PmIconButton small icon="export" label={t.exportPane} aria-pressed={aside === 'export'} onClick={() => onAside('export')} /></PmToolbarButton>}
|
|
394
392
|
{actions}
|
|
395
393
|
{narrow && <PmMenu toolbarItem label={t.moreCommands} items={[
|
|
@@ -398,7 +396,7 @@ function DocumentToolbar({ narrow, presentButton, framed, onBack, actions, aside
|
|
|
398
396
|
{ id: 'redo', label: t.redo, icon: 'redo' as const, shortcut: SHORTCUTS.redo, disabled: redoDisabled },
|
|
399
397
|
{ id: 'comments', label: commentsLabel, icon: 'comment' as const, checked: aside === 'comments', separator: true },
|
|
400
398
|
] : [],
|
|
401
|
-
...capabilities?.production !== false ? [{ id: 'production', label: p.title, icon: '
|
|
399
|
+
...capabilities?.production !== false ? [{ id: 'production', label: p.title, icon: 'video' as const, disabled: busy || !hasStep || changingView }] : [],
|
|
402
400
|
...capabilities?.narration !== false ? [{ id: 'narration', label: t.documentNarration, icon: 'captions' as const, disabled: !hasStep }] : [],
|
|
403
401
|
{ id: 'history', label: historyLabel, icon: 'versions' },
|
|
404
402
|
]} onSelect={id => { if (id === 'undo') void workbench.undo(); else if (id === 'redo') void workbench.redo(); else if (id === 'production') onProduction(); else onAside(id as DocumentAside) }} />}
|
|
@@ -442,12 +440,11 @@ function DocumentNotices() {
|
|
|
442
440
|
return (
|
|
443
441
|
<div className="pmw-notices">
|
|
444
442
|
{review && !review.running && review.changes.length > 0 && (
|
|
445
|
-
<PmNotice tone="accent"
|
|
446
|
-
<
|
|
447
|
-
<
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
</span>
|
|
443
|
+
<PmNotice tone="accent" action={<>
|
|
444
|
+
<PmButton small onClick={() => void workbench.rejectReview()}>{t.reject}</PmButton>
|
|
445
|
+
<PmButton small variant="primary" onClick={() => void workbench.acceptReview()}>{t.accept}</PmButton>
|
|
446
|
+
</>}>
|
|
447
|
+
{t.agentWaiting(review.changes.length)}
|
|
451
448
|
</PmNotice>
|
|
452
449
|
)}
|
|
453
450
|
{save.kind === 'locked' && <PmNotice tone="warn">{t.saveLocked}</PmNotice>}
|
|
@@ -475,13 +472,13 @@ function ProblemsNotice() {
|
|
|
475
472
|
const problems = (snapshot?.diagnostics ?? []).filter(diagnostic => diagnostic.severity === 'error' && !diagnostic.checkId.startsWith('presmium.workbench.'))
|
|
476
473
|
if (unavailable) return <PmNotice tone="warn"><span>{t.diagnosticsUnavailable}</span><PmButton small onClick={() => workbench.retryDiagnostics()}>{t.retry}</PmButton></PmNotice>
|
|
477
474
|
if (problems.length === 0) return repairFailure ? <PmNotice tone="danger">{t.fixFailed(failureReason(t, repairFailure))}</PmNotice> : null
|
|
478
|
-
const repair = canRepair && <PmButton small variant="
|
|
475
|
+
const repair = canRepair && <PmButton small variant="primary" icon="sparkle" disabled={repairing} onClick={() => void workbench.requestRepairDiagnostics()}>{repairing ? t.fixing : t.fixWithAi}</PmButton>
|
|
479
476
|
return (
|
|
480
477
|
<PmNotice tone="warn">
|
|
481
478
|
<div className="pmw-problems">
|
|
482
479
|
<div className="pmw-problems__summary">
|
|
483
480
|
<span>{t.problems(problems.length)}</span>
|
|
484
|
-
<PmButton small variant="
|
|
481
|
+
<PmButton small variant="text" onClick={() => setOpen(true)}>{t.details}</PmButton>
|
|
485
482
|
{repair}
|
|
486
483
|
</div>
|
|
487
484
|
{repairFailure && <p className="pmw-problems__failure">{t.fixFailed(failureReason(t, repairFailure))}</p>}
|
|
@@ -169,7 +169,7 @@ export function DocumentVoiceDialog({ stepId, onClose }: { stepId: string, onClo
|
|
|
169
169
|
if (event.target.value) voice.style = event.target.value; else delete voice.style
|
|
170
170
|
edit({ ...draft, source: { type: 'tts', voice } })
|
|
171
171
|
}}><option value="">{t.styleDefault}</option>{styles.map(style => <option key={style} value={style}>{style}</option>)}</PmSelect> : null}
|
|
172
|
-
{draft.rateInput !== undefined && !rateRange && <PmNotice tone="warn"
|
|
172
|
+
{draft.rateInput !== undefined && !rateRange && <PmNotice tone="warn" action={<PmButton small onClick={() => edit({ ...draft, rateInput: undefined })}>{t.recheck}</PmButton>}>{p.draftChanged}</PmNotice>}
|
|
173
173
|
<div className="pmw-voice__actions"><PmButton small icon="audio" disabled={busy || blocked || !draft.source.voice.voice || rateInvalid} onClick={() => void audition('sample')}>{t.standard}</PmButton><PmButton small icon="audio" disabled={busy || blocked || !draft.source.voice.voice || rateInvalid} onClick={() => void audition('step')}>{p.currentScript}</PmButton></div>
|
|
174
174
|
<p className="pmw-pane__footer">{t.previewHint}</p>
|
|
175
175
|
</>}
|
|
@@ -45,9 +45,8 @@ export function HistoryPanel({ onClose, revisionAction }: HistoryPanelProps) {
|
|
|
45
45
|
<section className="pmw-pane" aria-labelledby="pmw-history-title">
|
|
46
46
|
<PmPanelHeader className="pmw-pane__header" titleId="pmw-history-title" title={t.versionHistory} actions={<PmIconButton small icon="close" label={t.close} onClick={onClose} />} />
|
|
47
47
|
{outside && outside.length > 0 && (
|
|
48
|
-
<PmNotice tone="warn">
|
|
49
|
-
|
|
50
|
-
<PmButton small disabled={busy} onClick={() => void workbench.recordOutsideChanges()}>{t.recordOutside}</PmButton>
|
|
48
|
+
<PmNotice tone="warn" action={<PmButton small disabled={busy} onClick={() => void workbench.recordOutsideChanges()}>{t.recordOutside}</PmButton>}>
|
|
49
|
+
{t.outside(outside.length)}
|
|
51
50
|
</PmNotice>
|
|
52
51
|
)}
|
|
53
52
|
{source?.recoveryReadFailure && <PmNotice tone="warn">{t.documentDraftUnreadable}</PmNotice>}
|
|
@@ -75,7 +75,7 @@ export function McpSettingsPanel() {
|
|
|
75
75
|
{transport === 'http' && <PmInput label={t.port} hint={t.portHint} error={valid ? undefined : t.invalid} inputMode="numeric" value={port} disabled={busy} onChange={event => { setPort(event.target.value); setStatus(undefined); setOutput('') }} />}
|
|
76
76
|
{settings.url && <PmInput label={t.address} value={settings.url} readOnly />}
|
|
77
77
|
{settings.issue && <PmNotice tone="danger">{t.portBusy}</PmNotice>}
|
|
78
|
-
<div className="pmw-speech-settings__actions"><PmButton small variant="
|
|
78
|
+
<div className="pmw-speech-settings__actions"><PmButton small variant="primary" disabled={busy || !valid || !dirty && !settings.issue} onClick={() => void save()}>{t.save}</PmButton></div>
|
|
79
79
|
</div></PmCard>}
|
|
80
80
|
<p>{t.local}</p>
|
|
81
81
|
{dirty && <PmNotice>{t.applyFirst}</PmNotice>}
|
|
@@ -63,9 +63,9 @@ export function PreviewPanel({ active = true, onPresentationAction, presentation
|
|
|
63
63
|
return (
|
|
64
64
|
<section className="pmw-preview" aria-label={t.preview} data-ready={(active && document !== undefined && ready && snapshotMatches) || undefined}>
|
|
65
65
|
{mismatch && <PmNotice tone="warn">{t.versionMismatch}</PmNotice>}
|
|
66
|
-
{identityFailure && <PmNotice tone="danger"
|
|
67
|
-
{handshakeFailure && <PmNotice tone="danger"
|
|
68
|
-
{failure && <PmNotice tone="danger"
|
|
66
|
+
{identityFailure && <PmNotice tone="danger" action={<PmButton small onClick={() => workbench.reloadPreview()}>{t.reloadPreview}</PmButton>}>{t.previewIdentityMismatch}</PmNotice>}
|
|
67
|
+
{handshakeFailure && <PmNotice tone="danger" action={<PmButton small onClick={() => workbench.reloadPreview()}>{t.reloadPreview}</PmButton>}>{t.previewStalled}</PmNotice>}
|
|
68
|
+
{failure && <PmNotice tone="danger" action={<PmButton small onClick={() => workbench.retryPreview()}>{t.retry}</PmButton>}>{t.previewFailed(failureReason(t, failure))}</PmNotice>}
|
|
69
69
|
{(!ready || !snapshotMatches) && !failure && !handshakeFailure && !(renderer === 'slides' && preview && !preview.slides) && <p className="pmw-muted pmw-preview__loading">{presentation && ready && !snapshotMatches && !preparing ? t.presentationOutdated : address ? t.previewLoading : t.previewPreparing}</p>}
|
|
70
70
|
{renderer === 'slides' && preview && !preview.slides && <p className="pmw-muted pmw-preview__loading">{t.noSlides}</p>}
|
|
71
71
|
<div className="pmw-preview__stage">
|
|
@@ -196,12 +196,12 @@ export function ProductionPanel({ onClose, closing, active = true, actions }: {
|
|
|
196
196
|
</div>
|
|
197
197
|
</PmPopover>}
|
|
198
198
|
<PmIconButton small icon="refresh" label={p.prepare} loading={preparing} disabled={blocked || closing} onClick={() => void compile()} />
|
|
199
|
-
{wide ? <PmButton small variant="
|
|
199
|
+
{wide ? <PmButton small variant="primary" icon="export" disabled={closing} onClick={openOutputs}>{p.outputs}</PmButton>
|
|
200
200
|
: <PmIconButton small icon="export" label={p.outputs} disabled={closing} onClick={openOutputs} />}
|
|
201
201
|
</>} />
|
|
202
|
-
{!declared && <PmNotice tone="accent"
|
|
202
|
+
{!declared && <PmNotice tone="accent" action={<PmButton small loading={enabling} disabled={blocked || closing} onClick={() => void enable()}>{p.enable}</PmButton>}>{p.enableHint}</PmNotice>}
|
|
203
203
|
{!wide && <PmSegmented label={p.title} value={tab} options={[{ value: 'library', label: p.library }, { value: 'preview', label: p.preview }, { value: 'properties', label: p.properties }, { value: 'timeline', label: p.timeline }]} onChange={setTab} />}
|
|
204
|
-
{voicePlayback.failure && <PmNotice tone="danger"
|
|
204
|
+
{voicePlayback.failure && <PmNotice tone="danger" action={workbench.client.openSpeechSettings && <PmButton small variant="ghost" icon="sliders" onClick={() => { voicePlayback.stop(); workbench.client.openSpeechSettings?.() }}>{p.serviceSettings}</PmButton>}>{voicePlayback.failure}</PmNotice>}
|
|
205
205
|
{voicePlayback.busy && <div role="status"><PmNotice>{voicePlayback.progress ? p.generatingProgress(voicePlayback.progress.completed, voicePlayback.progress.total) : p.generatingPlayback}</PmNotice></div>}
|
|
206
206
|
<PmSplitGroup orientation="vertical" disabled={!wide} className="pmw-production__workarea">
|
|
207
207
|
<PmSplitPanel id="production-main" defaultSize="71%" minSize={wide ? '32%' : 0} className="pmw-production__main" background={backgroundBody}>
|
|
@@ -112,9 +112,9 @@ export function ProductionRecordingRange({ identity, sectionId, stepId, active,
|
|
|
112
112
|
<PmButton small disabled={disabled || !inspected} onClick={() => edit({ range: { startMs: 0, endMs: inspected!.durationMs }, startText: undefined, endText: undefined })}>{t.restore}</PmButton>
|
|
113
113
|
{busy && <PmButton small onClick={() => { request.current?.abort(); request.current = undefined; setBusy(false) }}>{AUDIO_RECORDING_MESSAGES[locale].cancelAdoption}</PmButton>}
|
|
114
114
|
</div>
|
|
115
|
-
{review && <PmNotice tone="warn"
|
|
115
|
+
{review && <PmNotice tone="warn" action={<PmButton small disabled={disabled || !inspected || busy} onClick={() => edit({ version: source!.version!, voice: structuredClone(voice) })}>{t.check}</PmButton>}>{t.review}</PmNotice>}
|
|
116
116
|
{trimmed && hasCaptions && <PmNotice tone="warn">{r.captionReview}</PmNotice>}
|
|
117
|
-
{failure && <PmNotice tone="danger"
|
|
117
|
+
{failure && <PmNotice tone="danger" action={<PmButton small disabled={disabled || busy} onClick={() => { setInspection(undefined); setFailure(undefined); setReload(value => value + 1) }}>{t.retry}</PmButton>}>{failure}</PmNotice>}
|
|
118
118
|
{drafts.has(key) && <span className="pm-ui-field__hint" role="status">{t.pending}</span>}
|
|
119
119
|
</section>
|
|
120
120
|
}
|
|
@@ -153,13 +153,13 @@ export function SourceDocumentPanel({ commentsPortal, onCommentDraftRestore, onO
|
|
|
153
153
|
{Boolean(positionFailure || source?.storageFailure || source?.restored || error) && <div className="pmw-source-document__notices">
|
|
154
154
|
{positionFailure && <PmNotice tone="warn">{t.documentPositionRemoved}</PmNotice>}
|
|
155
155
|
{source?.storageFailure && <PmNotice tone="warn">{t.narrationRecoveryUnavailable}</PmNotice>}
|
|
156
|
-
{source?.restored && !error && <PmNotice tone="accent"
|
|
157
|
-
{error && <PmNotice tone="danger"
|
|
156
|
+
{source?.restored && !error && <PmNotice tone="accent" action={<><PmButton small onClick={() => void workbench.retryDocument()}>{t.retry}</PmButton><PmButton small onClick={() => void workbench.discardDocument()}>{t.narrationDiscard}</PmButton></>}>{messages.restored}</PmNotice>}
|
|
157
|
+
{error && <PmNotice tone="danger" action={<><PmButton small onClick={() => void workbench.retryDocument()}>{t.retry}</PmButton>{source?.dirty && <PmButton small onClick={() => void workbench.discardDocument()}>{t.narrationDiscard}</PmButton>}</>}>{error}</PmNotice>}
|
|
158
158
|
</div>}
|
|
159
159
|
{source?.issues.length ? <div className="pmw-source-document__diagnostics"><PmNotice tone="warn"><details><summary>{messages.diagnostics(source.issues.length)}</summary><ul>{source.issues.map((issue, index) => <li key={`${issue.path}:${index}`}><code>{issue.path}</code> {issue.message}</li>)}</ul></details></PmNotice></div> : null}
|
|
160
160
|
{!source?.content || !source.identity ? source?.loading
|
|
161
161
|
? <div className="pmw-source-document__sheet pmw-source-document__sheet--loading"><PmSkeleton label={messages.loading} /></div>
|
|
162
|
-
: <PmNotice tone="warn"
|
|
162
|
+
: <PmNotice tone="warn" action={<PmButton small onClick={() => void workbench.retryDocument()}>{t.retry}</PmButton>}>{messages.unavailable}</PmNotice> : <div className="pmw-source-document__sheet">
|
|
163
163
|
<DocumentEditor agentActivities={agentActivities} acknowledged={sourceAcknowledged()} getDocumentAcknowledged={sourceAcknowledged} onCommentDraftRestore={onCommentDraftRestore} onOpenComments={onOpenComments} commentDrafts={workbench.documentCommentDrafts(source.identity)} identity={source.identity} document={source.content} version={source.version} member={source.member} getDocument={() => workbench.getDocument(source.identity)}
|
|
164
164
|
getDocumentVersion={() => { const current = workbench.getState().authoring; return current && current.identity === source.identity && current.reset === source.reset ? current.version : undefined }} reset={source.reset} locale={locale} readOnly={readOnly}
|
|
165
165
|
uploadImage={(file, signal) => workbench.importDocumentImage(file, source.identity!, signal)}
|
|
@@ -53,11 +53,11 @@ export function SpeechSettingsPanel() {
|
|
|
53
53
|
{settings && <p>{t.source[settings.source]}</p>}
|
|
54
54
|
<PmInput type="password" label={t.key} hint={t.keyHint} placeholder={settings?.configured ? t.keySaved : t.keyPlaceholder} value={key} disabled={disabled} autoComplete="new-password" spellCheck={false} maxLength={8192} onChange={event => { dirty.current = Boolean(event.target.value.trim() || appId.trim()); setKey(event.target.value); setStatus(undefined) }} />
|
|
55
55
|
<PmInput label={t.appId} hint={t.appIdHint} placeholder={settings?.appIdConfigured ? t.keySaved : t.appIdPlaceholder} value={appId} disabled={disabled} autoComplete="off" inputMode="numeric" spellCheck={false} maxLength={32} onChange={event => { dirty.current = Boolean(event.target.value.trim() || key.trim()); setAppId(event.target.value); setStatus(undefined) }} />
|
|
56
|
-
<div className="pmw-speech-settings__actions"><PmButton small variant="
|
|
56
|
+
<div className="pmw-speech-settings__actions"><PmButton small variant="primary" loading={busy} disabled={disabled || !key.trim() && !settings?.configured} onClick={() => void save()}>{t.save}</PmButton><PmButton small variant="text" disabled={busy || loading || dirty.current} onClick={() => void load(true)}>{t.check}</PmButton></div>
|
|
57
57
|
</div></PmCard>
|
|
58
58
|
<PmNotice>{t.verification}</PmNotice>
|
|
59
59
|
<p>{t.privacy}</p>
|
|
60
|
-
<div className="pmw-speech-settings__actions"><a className="pm-ui-link" href="https://console.volcengine.com/speech/new/setting/apikeys" target="_blank" rel="noreferrer">{t.console}</a>{settings?.stored && <PmButton small variant="
|
|
60
|
+
<div className="pmw-speech-settings__actions"><a className="pm-ui-link" href="https://console.volcengine.com/speech/new/setting/apikeys" target="_blank" rel="noreferrer">{t.console}</a>{settings?.stored && <PmButton small variant="text" disabled={disabled} onClick={() => setConfirm(true)}>{t.remove}</PmButton>}</div>
|
|
61
61
|
</div>
|
|
62
62
|
<PmDialog open={confirm} label={t.removeTitle} closeLabel={t.cancel} busy={busy} onClose={() => setConfirm(false)} description={t.removeHint} footer={<><PmButton disabled={busy} onClick={() => setConfirm(false)}>{t.cancel}</PmButton><PmButton variant="danger" loading={busy} onClick={() => void save(true)}>{t.remove}</PmButton></>} />
|
|
63
63
|
</section>
|
|
@@ -57,7 +57,7 @@ export function VoicePreviewDialog({ quote, snapshot, onClose, onRecheck }: { qu
|
|
|
57
57
|
<PmButton small onClick={close}>{t.close}</PmButton>
|
|
58
58
|
{changed && onRecheck && <PmButton small onClick={recheck}>{t.recheck}</PmButton>}
|
|
59
59
|
{active ? <PmButton small onClick={() => audition.current?.stop()}>{t.stop}</PmButton>
|
|
60
|
-
: <PmButton small variant="
|
|
60
|
+
: <PmButton small variant="primary" disabled={changed || !audition.current} onClick={confirm}>{t.confirmPreview}</PmButton>}
|
|
61
61
|
</>}>
|
|
62
62
|
<div className="pmw-operation">
|
|
63
63
|
<PmField label={t.provider}><span>{quote.provider}</span></PmField>
|
|
@@ -188,7 +188,7 @@ export function VoiceoverDialog({ stepId, onClose }: { stepId: string, onClose()
|
|
|
188
188
|
return <PmDialog open label={t.generation} closeLabel={closeLabel} onClose={close} footer={<>
|
|
189
189
|
<PmButton small onClick={close}>{closeLabel}</PmButton>
|
|
190
190
|
<PmButton small loading={loading} disabled={submitting} onClick={() => setAttempt(value => value + 1)}>{changed ? t.recheck : t.refresh}</PmButton>
|
|
191
|
-
<PmButton small variant="
|
|
191
|
+
<PmButton small variant="primary" loading={submitting} disabled={loading || changed || readOnly || hasActive || !selection?.missing || !selection.providers.length || !status?.capability.available} onClick={() => void start()}>{t.confirmGenerate}</PmButton>
|
|
192
192
|
</>}>
|
|
193
193
|
<div className="pmw-operation">
|
|
194
194
|
{(source?.content || checked?.document) && <VoiceScopeField document={checked?.document ?? source!.content!} stepId={stepId} value={scope} disabled={loading || submitting || readOnly} onChange={chooseScope} />}
|
package/src/styles.css
CHANGED
|
@@ -224,19 +224,6 @@
|
|
|
224
224
|
padding: var(--pm-space-2) var(--pm-space-3) 0;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
.pmw-notices > .pm-ui-notice {
|
|
228
|
-
display: flex;
|
|
229
|
-
flex-wrap: wrap;
|
|
230
|
-
align-items: center;
|
|
231
|
-
gap: var(--pm-space-2);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.pmw-notice__actions {
|
|
235
|
-
display: inline-flex;
|
|
236
|
-
gap: var(--pm-space-2);
|
|
237
|
-
margin-left: auto;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
227
|
.pmw-problems {
|
|
241
228
|
display: flex;
|
|
242
229
|
flex: 1;
|