mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-20 09:20:06 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76ffb51bb2 | ||
|
|
ca94e51424 | ||
|
|
d8621a53b6 | ||
|
|
e2f741eda6 | ||
|
|
7af3647913 | ||
|
|
12f99797d2 | ||
|
|
1796de8eda | ||
|
|
a6b7ac4383 | ||
|
|
ca575803cb | ||
|
|
def42cd000 | ||
|
|
ede52e5009 | ||
|
|
ddbf897b27 | ||
|
|
7d56b5bf90 | ||
|
|
87e88396d1 | ||
|
|
c5b57ca862 | ||
|
|
3420d848cb |
@@ -2,6 +2,8 @@ node_modules
|
||||
.bun
|
||||
dist
|
||||
out
|
||||
*.ccx
|
||||
!apps/premiere-uxp/shumai-premiere.ccx
|
||||
.DS_Store
|
||||
*.log
|
||||
.env
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<h1 align="center">Shumai</h1>
|
||||
|
||||
<p align="center">
|
||||
<strong>An open-source platform for all your creative work.</strong>
|
||||
<strong>The best open-source Frame.io alternative for all your creative work.</strong>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
@@ -34,9 +34,12 @@ Shumai is an open-source Frame.io alternative built for creative teams to collab
|
||||
* **Share Link Watermarking**: Protect shared media with customizable text and image watermarks, and save watermark as reusable templates.
|
||||
* **Wide File Format Support**: Preview common creative file formats, including images (with PSD support), videos, audio, and documents, while allowing any file type to be uploaded and stored.
|
||||
* **Office & Document PDF Proxying via Gotenberg**: Convert Word, PowerPoint, Excel, Markdown, HTML, and CSV documents to high-quality PDF proxies for in-browser previewing using [Gotenberg](https://docs.shumai.one/using-shumai/gotenberg).
|
||||
* **NLE Export & Premiere Pro Plugin (Experimental)**: Export timestamped review comments to your favorite non-linear editor (Premiere Pro XML, DaVinci Resolve EDL, Final Cut Pro, Avid Media Composer) or use the experimental Premiere Pro UXP plugin to import media assets and auto-sync comments directly to sequence timeline markers. See [documentation](https://docs.shumai.one/using-shumai/nle-and-premiere).
|
||||
|
||||
But Shumai goes beyond being a Frame.io alternative. With modern models like GPT-Image-2 and Seedance 2.5, AI can already handle a surprising amount of creative work. That means you can create or update videos and images from a simple prompt without having to jump back into Photoshop, Premiere or Houdini. That is why Shumai includes a powerful agent system:
|
||||
|
||||
> **AI is optional.** You can use Shumai as a traditional Frame.io alternative and completely ignore the AI features if they aren't useful for your team.
|
||||
|
||||
* **Agent as a Team Member**: Mention a context-aware AI agent with `@mentions` directly in asset comments, just like a real teammate.
|
||||
* **Agent as a One-to-One Assistant**: Chat privately with the agent and ask it to help with tasks.
|
||||
* **Custom Skills & Tools**: Extend the agent by registering custom scripts, tools, and automation skills.
|
||||
|
||||
@@ -34,6 +34,7 @@ Shumai 是一个开源的 Frame.io 替代方案,专为创意团队打造,让
|
||||
* **分享链接水印**:通过可自定义的文字和图片水印保护共享媒体,并将水印配置保存为模板以便重复使用。
|
||||
* **丰富的文件格式支持**:支持预览常见创意文件格式,包括图片(支持 PSD)、视频、音频和文档,同时可上传和存储任意类型的文件。
|
||||
* **基于 Gotenberg 的文档 PDF 转码代理**:通过集成 [Gotenberg](https://docs.shumai.one/using-shumai/gotenberg) 支持将 Word、PowerPoint、Excel、Markdown、HTML 和 CSV 文档高质量转换为 PDF 代理文件进行在线预览。
|
||||
* **非编剪辑导出与 Premiere 插件(实验性)**:支持将时间戳审阅评论导出至常用非编软件(Premiere Pro XML、DaVinci Resolve EDL、Final Cut Pro、Avid Media Composer),或使用实验性的 Premiere Pro 原生 UXP 插件导入媒体素材并将评论自动同步为时间轴标记。详见[相关文档](https://docs.shumai.one/using-shumai/nle-and-premiere)。
|
||||
|
||||
但 Shumai 不仅仅只满足于 Frame.io 的开源替代。随着 GPT-Image-2、Seedance 2.5 这类强大模型的问世,AI已经生成产品级的图片/视频。很多时候,你只要给一句提示词,就能直接生成或修改图片和视频,而不用再打开 Photoshop、Premiere 或者 Houdini。也正因为这样,Shumai 才把 AI Agent 做成了核心能力:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@shumai/agent-app",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@shumai/cli",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# Premiere UXP Plugin Guidelines
|
||||
|
||||
## Component Library (Spectrum Web Components / SWC)
|
||||
|
||||
- **Always prefer SWC components if possible**: Use Spectrum Web Component React wrappers (`@swc-react/*`) and `@swc-uxp-wrappers/*` for UI elements (Button, ActionButton, Textfield, Card, Divider, ProgressCircle, StatusLight, Badge, Search, FieldLabel, HelpText, IllustratedMessage, ActionGroup, etc.) rather than hand-crafting custom HTML/CSS elements.
|
||||
- **SWC Support**: `public/manifest.json` has `"featureFlags": { "enableSWCSupport": true }`.
|
||||
- **Package Versions**: Keep SWC packages aligned at version `0.37.0` (matching Adobe UXP compatibility).
|
||||
- **Bundler Aliases**: `build.ts` uses `swcAliasPlugin` with `aliases` from `@swc-uxp-wrappers/utils` to resolve internal SWC imports for Bun.
|
||||
|
||||
## Icons
|
||||
|
||||
- **Always use Spectrum Workflow Icons (`@spectrum-web-components/icons-workflow`)**: Never use external icon libraries like `lucide-react`.
|
||||
- **Registration**: All workflow icons used must be imported and registered in `src/index.tsx` (e.g. `import '@spectrum-web-components/icons-workflow/icons/sp-icon-movie-camera.js'`). Note: Ensure the icon exists in `@spectrum-web-components/icons-workflow/icons/` (Spectrum 1 compatible) rather than only `icons-s2/` (which falls back to an empty circular DefaultIcon under Spectrum 1).
|
||||
- **Typing**: Add custom element declarations to `src/declarations.d.ts` under both `declare namespace React.JSX` and `declare global.JSX.IntrinsicElements` with `SpIconCustomElementProps`.
|
||||
|
||||
## Adobe UXP Layout Engine Rules (Critical CSS Gotchas)
|
||||
|
||||
Adobe UXP's layout engine (Yoga-based) does **not** support several standard modern CSS features:
|
||||
|
||||
1. **No CSS Grid**:
|
||||
- `display: grid` and `grid-template-columns` are **unsupported / invalid**.
|
||||
- Always use Flexbox (`display: flex; flex-direction: row | column;`).
|
||||
2. **No `aspect-ratio`**:
|
||||
- `aspect-ratio` is invalid in UXP and collapses containers to `0px` height.
|
||||
- Always specify explicit `width` and `height` on preview / thumbnail containers.
|
||||
3. **No `box-sizing: border-box`**:
|
||||
- `box-sizing` is not supported (UXP elements are natively border-box). Specifying it logs invalid property warnings.
|
||||
4. **No `gap` in Flexbox**:
|
||||
- `gap` is invalid in Premiere UXP flexbox. Items will render with 0px spacing.
|
||||
- Use `margin-bottom` or `margin-right` on child items for spacing.
|
||||
5. **Always Set `flex-shrink: 0` on List Items**:
|
||||
- Flex children default to `flex-shrink: 1`. When rendering lists with many items (>10 items), flexbox squishes the items down to slivers instead of scrolling.
|
||||
- Always add `flex-shrink: 0` and an explicit `min-height` to list row cards (`.project-row-card`, `.file-row-card`, `.item-row`, etc.).
|
||||
6. **Scroll Containers**:
|
||||
- Scrollable flex children (like `.view-content`) must have `min-height: 0` and `overflow-y: auto` to allow children to overflow and scroll vertically.
|
||||
|
||||
## Build and Packaging Commands
|
||||
|
||||
- **Build**: `bun run --filter @shumai/premiere-uxp build`
|
||||
- **Watch mode**: `bun run --filter @shumai/premiere-uxp dev`
|
||||
- **Package CCX**: `bun run --filter @shumai/premiere-uxp package` (outputs `apps/premiere-uxp/shumai-premiere.ccx`)
|
||||
@@ -0,0 +1,109 @@
|
||||
#!/usr/bin/env bun
|
||||
import { cp, rm, mkdir } from 'node:fs/promises'
|
||||
import { existsSync, watch } from 'node:fs'
|
||||
import { $ } from 'bun'
|
||||
import { aliases } from '@swc-uxp-wrappers/utils'
|
||||
import type { BunPlugin } from 'bun'
|
||||
|
||||
const swcAliasPlugin: BunPlugin = {
|
||||
name: 'swc-uxp-aliases',
|
||||
setup(build) {
|
||||
for (const [key, target] of Object.entries(aliases)) {
|
||||
const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
||||
const filter = new RegExp(`^${escaped}(/.*)?$`)
|
||||
build.onResolve({ filter }, (args) => {
|
||||
const subpath = args.path.slice(key.length)
|
||||
const targetPath = target + subpath
|
||||
try {
|
||||
return { path: import.meta.resolveSync(targetPath) }
|
||||
} catch {
|
||||
return undefined
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
const isWatch = process.argv.includes('--watch')
|
||||
const isPackage = process.argv.includes('--package')
|
||||
|
||||
async function build(): Promise<boolean> {
|
||||
const start = performance.now()
|
||||
try {
|
||||
if (!existsSync('dist')) {
|
||||
await mkdir('dist', { recursive: true })
|
||||
}
|
||||
|
||||
// 1. Copy public assets (manifest, index.html, styles, icons)
|
||||
await cp('public', 'dist', { recursive: true })
|
||||
|
||||
// 2. Bundle with Bun.build
|
||||
const result = await Bun.build({
|
||||
entrypoints: ['./src/index.tsx'],
|
||||
outdir: './dist',
|
||||
naming: 'index.js',
|
||||
target: 'browser',
|
||||
format: 'cjs',
|
||||
sourcemap: 'external',
|
||||
minify: false,
|
||||
plugins: [swcAliasPlugin],
|
||||
external: ['os', 'premierepro', 'uxp'],
|
||||
define: {
|
||||
'process.env.NODE_ENV': JSON.stringify('production'),
|
||||
},
|
||||
})
|
||||
|
||||
if (!result.success) {
|
||||
console.error('❌ Build failed:')
|
||||
for (const log of result.logs) {
|
||||
console.error(log)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const elapsed = (performance.now() - start).toFixed(1)
|
||||
console.log(`✅ Build completed in ${elapsed}ms`)
|
||||
|
||||
// 3. Package .ccx if requested
|
||||
if (isPackage) {
|
||||
console.log('📦 Packaging shumai-premiere.ccx...')
|
||||
if (existsSync('shumai-premiere.ccx')) {
|
||||
await rm('shumai-premiere.ccx')
|
||||
}
|
||||
await $`cd dist && zip -r ../shumai-premiere.ccx . -x '*.map' -x '.DS_Store' -x '__MACOSX*'`
|
||||
console.log('✅ Package created.')
|
||||
}
|
||||
|
||||
return true
|
||||
} catch (err) {
|
||||
console.error('❌ Build error:', err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Clean and run initial build
|
||||
if (existsSync('dist')) {
|
||||
await rm('dist', { recursive: true, force: true })
|
||||
}
|
||||
const success = await build()
|
||||
if (!success && !isWatch) {
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
// Watch mode
|
||||
if (isWatch) {
|
||||
console.log('👀 Watching src/ and public/ for changes...')
|
||||
let building = false
|
||||
const triggerRebuild = async (dir: string) => {
|
||||
if (building) return
|
||||
building = true
|
||||
setTimeout(async () => {
|
||||
console.log(`\n🔄 Change detected in ${dir}, rebuilding...`)
|
||||
await build()
|
||||
building = false
|
||||
}, 50)
|
||||
}
|
||||
|
||||
watch('./src', { recursive: true }, () => triggerRebuild('src'))
|
||||
watch('./public', { recursive: true }, () => triggerRebuild('public'))
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"name": "@shumai/premiere-uxp",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "commonjs",
|
||||
"scripts": {
|
||||
"build": "bun run ./build.ts",
|
||||
"dev": "bun run ./build.ts --watch",
|
||||
"package": "bun run ./build.ts --package",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@shumai/api": "workspace:*",
|
||||
"@shumai/dtos": "workspace:*",
|
||||
"@spectrum-web-components/action-menu": "0.37.0",
|
||||
"@spectrum-web-components/badge": "0.37.0",
|
||||
"@spectrum-web-components/icon": "1.12.2",
|
||||
"@spectrum-web-components/icons-workflow": "1.12.2",
|
||||
"@spectrum-web-components/menu": "0.37.0",
|
||||
"@spectrum-web-components/progress-circle": "0.37.0",
|
||||
"@spectrum-web-components/status-light": "0.37.0",
|
||||
"@spectrum-web-components/theme": "0.37.0",
|
||||
"@swc-react/action-button": "0.37.0",
|
||||
"@swc-react/action-group": "0.37.0",
|
||||
"@swc-react/action-menu": "0.37.0",
|
||||
"@swc-react/badge": "0.37.0",
|
||||
"@swc-react/button": "0.37.0",
|
||||
"@swc-react/card": "0.37.0",
|
||||
"@swc-react/divider": "0.37.0",
|
||||
"@swc-react/field-label": "0.37.0",
|
||||
"@swc-react/help-text": "0.37.0",
|
||||
"@swc-react/illustrated-message": "0.37.0",
|
||||
"@swc-react/menu": "0.37.0",
|
||||
"@swc-react/progress-circle": "0.37.0",
|
||||
"@swc-react/search": "0.37.0",
|
||||
"@swc-react/status-light": "0.37.0",
|
||||
"@swc-react/textfield": "0.37.0",
|
||||
"@swc-react/theme": "0.37.0",
|
||||
"@swc-uxp-wrappers/action-button": "2.0.0",
|
||||
"@swc-uxp-wrappers/action-group": "2.0.0",
|
||||
"@swc-uxp-wrappers/button": "2.0.0",
|
||||
"@swc-uxp-wrappers/card": "2.0.0",
|
||||
"@swc-uxp-wrappers/divider": "2.0.0",
|
||||
"@swc-uxp-wrappers/field-label": "2.0.0",
|
||||
"@swc-uxp-wrappers/help-text": "2.0.0",
|
||||
"@swc-uxp-wrappers/illustrated-message": "2.0.0",
|
||||
"@swc-uxp-wrappers/menu": "2.0.0",
|
||||
"@swc-uxp-wrappers/overlay": "2.0.0",
|
||||
"@swc-uxp-wrappers/popover": "2.0.0",
|
||||
"@swc-uxp-wrappers/search": "2.0.0",
|
||||
"@swc-uxp-wrappers/textfield": "2.0.0",
|
||||
"@swc-uxp-wrappers/utils": "2.0.1",
|
||||
"hono": "4.13.5",
|
||||
"react": "19.2.8",
|
||||
"react-dom": "19.2.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@adobe/premierepro": "26.3.0",
|
||||
"@types/react": "19.2.18",
|
||||
"@types/react-dom": "19.2.7"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Shumai</title>
|
||||
<link rel="stylesheet" href="./styles.css" />
|
||||
<script defer src="./index.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"id": "com.shumai.premiere",
|
||||
"name": "Shumai",
|
||||
"shortname": "shumai",
|
||||
"version": "0.1.0",
|
||||
"main": "index.html",
|
||||
"host": {
|
||||
"app": "premierepro",
|
||||
"minVersion": "25.1.0"
|
||||
},
|
||||
"manifestVersion": 5,
|
||||
"featureFlags": {
|
||||
"enableSWCSupport": true
|
||||
},
|
||||
"requiredPermissions": {
|
||||
"network": {
|
||||
"domains": "all"
|
||||
},
|
||||
"localFileSystem": "request",
|
||||
"clipboard": "readAndWrite"
|
||||
},
|
||||
"entrypoints": [
|
||||
{
|
||||
"id": "shumaiPanel",
|
||||
"type": "panel",
|
||||
"minimumSize": {
|
||||
"width": 320,
|
||||
"height": 480
|
||||
},
|
||||
"maximumSize": {
|
||||
"width": 2000,
|
||||
"height": 2000
|
||||
},
|
||||
"preferredDockedSize": {
|
||||
"width": 400,
|
||||
"height": 720
|
||||
},
|
||||
"preferredFloatingSize": {
|
||||
"width": 460,
|
||||
"height": 780
|
||||
},
|
||||
"label": {
|
||||
"default": "Shumai"
|
||||
},
|
||||
"icons": [
|
||||
{
|
||||
"width": 114,
|
||||
"height": 114,
|
||||
"path": "icons/icon.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"icons": [
|
||||
{
|
||||
"width": 114,
|
||||
"height": 114,
|
||||
"path": "icons/icon.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,123 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { Header } from './components/Header'
|
||||
import { NavigationTabs, type MainTab } from './components/NavigationTabs'
|
||||
import { AuthView } from './views/AuthView'
|
||||
import { ProjectsView, ProjectSummary } from './views/ProjectsView'
|
||||
import { FileListView } from './views/FileListView'
|
||||
import { SequencesView } from './views/SequencesView'
|
||||
import { getStoredCredentials, clearStoredCredentials } from './services/storage'
|
||||
import { getAllSequenceLinksFromCache } from './services/linkStorage'
|
||||
import { resetClient } from './api/client'
|
||||
import { autoSyncService } from './services/autoSyncService'
|
||||
import { ProgressCircle } from '@swc-react/progress-circle'
|
||||
|
||||
type AppView = 'auth' | 'projects' | 'files'
|
||||
|
||||
export const App: React.FC = () => {
|
||||
const [view, setView] = useState<AppView>('auth')
|
||||
const [mainTab, setMainTab] = useState<MainTab>('browse')
|
||||
const [linkedCount, setLinkedCount] = useState<number>(0)
|
||||
const [endpoint, setEndpoint] = useState<string>('')
|
||||
const [apiKey, setApiKey] = useState<string>('')
|
||||
const [selectedProject, setSelectedProject] = useState<ProjectSummary | null>(null)
|
||||
const [initialLoading, setInitialLoading] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
const creds = getStoredCredentials()
|
||||
if (creds && creds.endpoint && creds.apiKey) {
|
||||
setEndpoint(creds.endpoint)
|
||||
setApiKey(creds.apiKey)
|
||||
setView('projects')
|
||||
autoSyncService.start(creds.endpoint, creds.apiKey)
|
||||
const cached = getAllSequenceLinksFromCache()
|
||||
setLinkedCount(cached.length)
|
||||
} else {
|
||||
setView('auth')
|
||||
}
|
||||
setInitialLoading(false)
|
||||
|
||||
return () => {
|
||||
autoSyncService.stop()
|
||||
}
|
||||
}, [])
|
||||
|
||||
const handleConnectSuccess = (newEndpoint: string, newApiKey: string) => {
|
||||
setEndpoint(newEndpoint)
|
||||
setApiKey(newApiKey)
|
||||
setView('projects')
|
||||
autoSyncService.start(newEndpoint, newApiKey)
|
||||
}
|
||||
|
||||
const handleDisconnect = () => {
|
||||
autoSyncService.stop()
|
||||
clearStoredCredentials()
|
||||
resetClient()
|
||||
setEndpoint('')
|
||||
setApiKey('')
|
||||
setSelectedProject(null)
|
||||
setView('auth')
|
||||
setMainTab('browse')
|
||||
}
|
||||
|
||||
const handleSelectProject = (project: ProjectSummary) => {
|
||||
setSelectedProject(project)
|
||||
setView('files')
|
||||
setMainTab('browse')
|
||||
}
|
||||
|
||||
const handleBackToProjects = () => {
|
||||
setSelectedProject(null)
|
||||
setView('projects')
|
||||
setMainTab('browse')
|
||||
}
|
||||
|
||||
if (initialLoading) {
|
||||
return (
|
||||
<div className="app-container">
|
||||
<Header />
|
||||
<div className="view-content" style={{ justifyContent: 'center', alignItems: 'center' }}>
|
||||
<ProgressCircle indeterminate size="l" label="Loading Shumai..." />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="app-container">
|
||||
<Header
|
||||
endpoint={view !== 'auth' ? endpoint : undefined}
|
||||
onDisconnect={view !== 'auth' ? handleDisconnect : undefined}
|
||||
/>
|
||||
|
||||
{view !== 'auth' && (
|
||||
<NavigationTabs activeTab={mainTab} onTabChange={setMainTab} linkedCount={linkedCount} />
|
||||
)}
|
||||
|
||||
{view === 'auth' && (
|
||||
<AuthView
|
||||
initialEndpoint={endpoint || 'http://localhost:3000'}
|
||||
initialApiKey={apiKey}
|
||||
onConnectSuccess={handleConnectSuccess}
|
||||
/>
|
||||
)}
|
||||
|
||||
{view !== 'auth' && mainTab === 'sequences' && (
|
||||
<SequencesView endpoint={endpoint} apiKey={apiKey} onLinkCountChange={setLinkedCount} />
|
||||
)}
|
||||
|
||||
{view !== 'auth' && mainTab === 'browse' && view === 'projects' && (
|
||||
<ProjectsView endpoint={endpoint} apiKey={apiKey} onSelectProject={handleSelectProject} />
|
||||
)}
|
||||
|
||||
{view !== 'auth' && mainTab === 'browse' && view === 'files' && selectedProject && (
|
||||
<FileListView
|
||||
endpoint={endpoint}
|
||||
apiKey={apiKey}
|
||||
project={selectedProject}
|
||||
onBackToProjects={handleBackToProjects}
|
||||
onLinkCountChange={setLinkedCount}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { hc } from 'hono/client'
|
||||
import type { AppType } from '@shumai/api'
|
||||
|
||||
export type ShumaiClient = ReturnType<typeof hc<AppType>>
|
||||
|
||||
let currentClient: ShumaiClient | null = null
|
||||
let currentKey = ''
|
||||
|
||||
export function getShumaiClient(endpoint: string, apiKey: string): ShumaiClient {
|
||||
const normalizedEndpoint = endpoint.trim().replace(/\/+$/, '')
|
||||
const cacheKey = `${normalizedEndpoint}::${apiKey}`
|
||||
|
||||
if (currentClient && currentKey === cacheKey) {
|
||||
return currentClient
|
||||
}
|
||||
|
||||
currentClient = hc<AppType>(normalizedEndpoint, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${apiKey}`,
|
||||
'x-api-key': apiKey,
|
||||
},
|
||||
})
|
||||
currentKey = cacheKey
|
||||
|
||||
return currentClient
|
||||
}
|
||||
|
||||
export function resetClient(): void {
|
||||
currentClient = null
|
||||
currentKey = ''
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import React from 'react'
|
||||
import { Divider } from '@swc-react/divider'
|
||||
|
||||
export interface BreadcrumbCrumb {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
interface BreadcrumbProps {
|
||||
projectName?: string
|
||||
crumbs: BreadcrumbCrumb[]
|
||||
onNavigateToProjects: () => void
|
||||
onNavigateToCrumb: (index: number) => void
|
||||
}
|
||||
|
||||
export const Breadcrumb: React.FC<BreadcrumbProps> = ({
|
||||
projectName,
|
||||
crumbs,
|
||||
onNavigateToProjects,
|
||||
onNavigateToCrumb,
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<nav className="breadcrumb-bar" aria-label="Folder Path">
|
||||
<span className="breadcrumb-item" onClick={onNavigateToProjects} title="Back to Projects">
|
||||
Projects
|
||||
</span>
|
||||
|
||||
{projectName && (
|
||||
<>
|
||||
<span className="breadcrumb-separator">/</span>
|
||||
<span
|
||||
className={`breadcrumb-item ${crumbs.length === 0 ? 'active' : ''}`}
|
||||
onClick={() => onNavigateToCrumb(-1)}
|
||||
title={projectName}
|
||||
>
|
||||
{projectName}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
|
||||
{crumbs.map((crumb, idx) => {
|
||||
const isLast = idx === crumbs.length - 1
|
||||
return (
|
||||
<React.Fragment key={crumb.id}>
|
||||
<span className="breadcrumb-separator">/</span>
|
||||
<span
|
||||
className={`breadcrumb-item ${isLast ? 'active' : ''}`}
|
||||
onClick={() => (!isLast ? onNavigateToCrumb(idx) : undefined)}
|
||||
title={crumb.name}
|
||||
>
|
||||
{crumb.name}
|
||||
</span>
|
||||
</React.Fragment>
|
||||
)
|
||||
})}
|
||||
</nav>
|
||||
<Divider size="s" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,409 @@
|
||||
// @vitest-environment happy-dom
|
||||
import React from 'react'
|
||||
import { describe, it, expect, vi, afterEach } from 'vitest'
|
||||
import { render, screen, fireEvent, cleanup } from '@testing-library/react'
|
||||
import {
|
||||
getFileTypeCategory,
|
||||
getAssetVersionLabel,
|
||||
FileItem,
|
||||
FileCardItem,
|
||||
type AssetSummary,
|
||||
} from './FileItem'
|
||||
|
||||
// Configure React 19 act environment for happy-dom
|
||||
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
|
||||
|
||||
describe('getFileTypeCategory', () => {
|
||||
it('identifies folder type', () => {
|
||||
const asset: AssetSummary = {
|
||||
id: 'f1',
|
||||
name: 'My Folder',
|
||||
type: 'folder',
|
||||
}
|
||||
expect(getFileTypeCategory(asset)).toBe('folder')
|
||||
})
|
||||
|
||||
it('identifies video by mimeType', () => {
|
||||
const asset: AssetSummary = {
|
||||
id: 'v1',
|
||||
name: 'clip.dat',
|
||||
type: 'file',
|
||||
mimeType: 'video/mp4',
|
||||
}
|
||||
expect(getFileTypeCategory(asset)).toBe('video')
|
||||
})
|
||||
|
||||
it('identifies video by extension', () => {
|
||||
const extensions = ['mp4', 'mov', 'avi', 'mkv', 'm4v', 'webm']
|
||||
for (const ext of extensions) {
|
||||
const asset: AssetSummary = {
|
||||
id: `v-${ext}`,
|
||||
name: `sample.${ext}`,
|
||||
type: 'file',
|
||||
}
|
||||
expect(getFileTypeCategory(asset)).toBe('video')
|
||||
}
|
||||
})
|
||||
|
||||
it('identifies audio by mimeType or extension', () => {
|
||||
const asset1: AssetSummary = {
|
||||
id: 'a1',
|
||||
name: 'audio.raw',
|
||||
type: 'file',
|
||||
mimeType: 'audio/wav',
|
||||
}
|
||||
const asset2: AssetSummary = {
|
||||
id: 'a2',
|
||||
name: 'track.mp3',
|
||||
type: 'file',
|
||||
}
|
||||
expect(getFileTypeCategory(asset1)).toBe('audio')
|
||||
expect(getFileTypeCategory(asset2)).toBe('audio')
|
||||
})
|
||||
|
||||
it('identifies image by mimeType or extension', () => {
|
||||
const asset1: AssetSummary = {
|
||||
id: 'i1',
|
||||
name: 'photo.bin',
|
||||
type: 'file',
|
||||
mimeType: 'image/png',
|
||||
}
|
||||
const asset2: AssetSummary = {
|
||||
id: 'i2',
|
||||
name: 'art.jpg',
|
||||
type: 'file',
|
||||
}
|
||||
expect(getFileTypeCategory(asset1)).toBe('image')
|
||||
expect(getFileTypeCategory(asset2)).toBe('image')
|
||||
})
|
||||
|
||||
it('falls back to generic file', () => {
|
||||
const asset: AssetSummary = {
|
||||
id: 'doc1',
|
||||
name: 'notes.pdf',
|
||||
type: 'file',
|
||||
mimeType: 'application/pdf',
|
||||
}
|
||||
expect(getFileTypeCategory(asset)).toBe('file')
|
||||
})
|
||||
})
|
||||
|
||||
describe('FileItem and FileCardItem UI Components', () => {
|
||||
afterEach(() => {
|
||||
cleanup()
|
||||
vi.clearAllMocks()
|
||||
})
|
||||
|
||||
const mockOnClick = vi.fn()
|
||||
const mockOnImportRaw = vi.fn()
|
||||
const mockOnSelectVideoForImport = vi.fn()
|
||||
|
||||
const folderAsset: AssetSummary = {
|
||||
id: 'folder-1',
|
||||
name: 'Raw Footage',
|
||||
type: 'folder',
|
||||
fileCount: 5,
|
||||
}
|
||||
|
||||
const imageAsset: AssetSummary = {
|
||||
id: 'img-1',
|
||||
name: 'logo.png',
|
||||
type: 'file',
|
||||
mimeType: 'image/png',
|
||||
sizeByte: 2048,
|
||||
}
|
||||
|
||||
const videoAsset: AssetSummary = {
|
||||
id: 'vid-1',
|
||||
name: 'interview.mp4',
|
||||
type: 'file',
|
||||
mimeType: 'video/mp4',
|
||||
sizeByte: 50 * 1024 * 1024,
|
||||
}
|
||||
|
||||
it('FileItem navigates into folder on click without download button', () => {
|
||||
render(
|
||||
<FileItem
|
||||
asset={folderAsset}
|
||||
onClick={mockOnClick}
|
||||
onImportRaw={mockOnImportRaw}
|
||||
onSelectVideoForImport={mockOnSelectVideoForImport}
|
||||
/>,
|
||||
)
|
||||
|
||||
expect(screen.getByText('Raw Footage')).toBeTruthy()
|
||||
expect(screen.queryByTitle('Import into Premiere Pro')).toBeNull()
|
||||
|
||||
fireEvent.click(screen.getByText('Raw Footage'))
|
||||
expect(mockOnClick).toHaveBeenCalled()
|
||||
expect(mockOnImportRaw).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('FileCardItem calls onImportRaw when download button is clicked for non-video, but clicking card does not', () => {
|
||||
render(
|
||||
<FileCardItem
|
||||
asset={imageAsset}
|
||||
onClick={mockOnClick}
|
||||
onImportRaw={mockOnImportRaw}
|
||||
onSelectVideoForImport={mockOnSelectVideoForImport}
|
||||
/>,
|
||||
)
|
||||
|
||||
expect(screen.getByText('logo.png')).toBeTruthy()
|
||||
// Clicking the file title / card text should NOT trigger import
|
||||
fireEvent.click(screen.getByText('logo.png'))
|
||||
expect(mockOnImportRaw).not.toHaveBeenCalled()
|
||||
|
||||
const downloadBtn = screen.getByTitle('Import into Premiere Pro')
|
||||
expect(downloadBtn).toBeTruthy()
|
||||
|
||||
fireEvent.click(downloadBtn)
|
||||
expect(mockOnImportRaw).toHaveBeenCalledWith(imageAsset)
|
||||
})
|
||||
|
||||
it('FileCardItem calls onSelectVideoForImport when download button is clicked for video', () => {
|
||||
render(
|
||||
<FileCardItem
|
||||
asset={videoAsset}
|
||||
onClick={mockOnClick}
|
||||
onImportRaw={mockOnImportRaw}
|
||||
onSelectVideoForImport={mockOnSelectVideoForImport}
|
||||
/>,
|
||||
)
|
||||
|
||||
expect(screen.getByText('interview.mp4')).toBeTruthy()
|
||||
const downloadBtn = screen.getByTitle('Import into Premiere Pro')
|
||||
fireEvent.click(downloadBtn)
|
||||
|
||||
expect(mockOnSelectVideoForImport).toHaveBeenCalledWith(videoAsset)
|
||||
expect(mockOnImportRaw).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('FileCardItem renders sp-icon-link when isLinked is false, and triggers onLinkSequence on click', () => {
|
||||
const mockOnLinkSequence = vi.fn()
|
||||
const { container } = render(
|
||||
<FileCardItem
|
||||
asset={videoAsset}
|
||||
onClick={mockOnClick}
|
||||
onLinkSequence={mockOnLinkSequence}
|
||||
isLinked={false}
|
||||
/>,
|
||||
)
|
||||
|
||||
const linkIcon = container.querySelector('sp-icon-link')
|
||||
const unlinkIcon = container.querySelector('sp-icon-unlink')
|
||||
expect(linkIcon).toBeTruthy()
|
||||
expect(unlinkIcon).toBeNull()
|
||||
|
||||
const linkBtn = screen.getByTitle('Link to Sequence')
|
||||
expect(linkBtn).toBeTruthy()
|
||||
fireEvent.click(linkBtn)
|
||||
expect(mockOnLinkSequence).toHaveBeenCalledWith(videoAsset)
|
||||
})
|
||||
|
||||
it('FileCardItem renders sp-icon-unlink when isLinked is true, and triggers onUnlinkSequence on click', () => {
|
||||
const mockOnLinkSequence = vi.fn()
|
||||
const mockOnUnlinkSequence = vi.fn()
|
||||
const { container } = render(
|
||||
<FileCardItem
|
||||
asset={videoAsset}
|
||||
onClick={mockOnClick}
|
||||
onLinkSequence={mockOnLinkSequence}
|
||||
onUnlinkSequence={mockOnUnlinkSequence}
|
||||
isLinked={true}
|
||||
linkedSequenceName="Cut_v1"
|
||||
/>,
|
||||
)
|
||||
|
||||
const linkIcon = container.querySelector('sp-icon-link')
|
||||
const unlinkIcon = container.querySelector('sp-icon-unlink')
|
||||
expect(linkIcon).toBeNull()
|
||||
expect(unlinkIcon).toBeTruthy()
|
||||
|
||||
const unlinkBtn = screen.getByTitle('Unlink from Cut_v1')
|
||||
expect(unlinkBtn).toBeTruthy()
|
||||
fireEvent.click(unlinkBtn)
|
||||
expect(mockOnUnlinkSequence).toHaveBeenCalledWith(videoAsset)
|
||||
expect(mockOnLinkSequence).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('FileItem renders sp-icon-unlink when isLinked is true', () => {
|
||||
const mockOnLinkSequence = vi.fn()
|
||||
const mockOnUnlinkSequence = vi.fn()
|
||||
const { container } = render(
|
||||
<FileItem
|
||||
asset={videoAsset}
|
||||
onClick={mockOnClick}
|
||||
onLinkSequence={mockOnLinkSequence}
|
||||
onUnlinkSequence={mockOnUnlinkSequence}
|
||||
isLinked={true}
|
||||
linkedSequenceName="Cut_v1"
|
||||
/>,
|
||||
)
|
||||
|
||||
const linkIcon = container.querySelector('sp-icon-link')
|
||||
const unlinkIcon = container.querySelector('sp-icon-unlink')
|
||||
expect(linkIcon).toBeNull()
|
||||
expect(unlinkIcon).toBeTruthy()
|
||||
|
||||
const unlinkBtn = screen.getByTitle('Unlink from Cut_v1')
|
||||
expect(unlinkBtn).toBeTruthy()
|
||||
fireEvent.click(unlinkBtn)
|
||||
expect(mockOnUnlinkSequence).toHaveBeenCalledWith(videoAsset)
|
||||
})
|
||||
|
||||
it('FileCardItem renders version in details when asset has versionStack', () => {
|
||||
const versionedAsset: AssetSummary = {
|
||||
id: 'vid-v2',
|
||||
name: 'interview_cut.mp4',
|
||||
type: 'file',
|
||||
mimeType: 'video/mp4',
|
||||
sizeByte: 20 * 1024 * 1024,
|
||||
versionStack: {
|
||||
id: 'stack-1',
|
||||
versions: [
|
||||
{ version: 2, current: true, id: 'vid-v2', name: 'interview_cut.mp4' },
|
||||
{ version: 1, current: false, id: 'vid-v1', name: 'interview_cut_v1.mp4' },
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
render(<FileCardItem asset={versionedAsset} onClick={mockOnClick} />)
|
||||
|
||||
expect(screen.getByText('v2')).toBeTruthy()
|
||||
})
|
||||
|
||||
it('FileCardItem does not render version when asset has no versionStack', () => {
|
||||
render(<FileCardItem asset={videoAsset} onClick={mockOnClick} />)
|
||||
|
||||
expect(screen.queryByText(/^v\d+$/)).toBeNull()
|
||||
})
|
||||
|
||||
it('FileItem renders version in subtext when asset has versionStack', () => {
|
||||
const versionedAsset: AssetSummary = {
|
||||
id: 'vid-v2',
|
||||
name: 'interview_cut.mp4',
|
||||
type: 'file',
|
||||
mimeType: 'video/mp4',
|
||||
sizeByte: 20 * 1024 * 1024,
|
||||
versionStack: {
|
||||
id: 'stack-1',
|
||||
versions: [
|
||||
{ version: 2, current: true, id: 'vid-v2', name: 'interview_cut.mp4' },
|
||||
{ version: 1, current: false, id: 'vid-v1', name: 'interview_cut_v1.mp4' },
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
render(<FileItem asset={versionedAsset} onClick={mockOnClick} />)
|
||||
|
||||
expect(screen.getByText(/v2 •/)).toBeTruthy()
|
||||
})
|
||||
|
||||
it('FileCardItem renders createdAt time when provided', () => {
|
||||
const assetWithDates: AssetSummary = {
|
||||
id: 'date-1',
|
||||
name: 'render.mp4',
|
||||
type: 'file',
|
||||
createdAt: new Date(Date.now() - 3600 * 1000).toISOString(),
|
||||
updatedAt: new Date(Date.now() - 60 * 1000).toISOString(),
|
||||
}
|
||||
|
||||
render(<FileCardItem asset={assetWithDates} onClick={mockOnClick} />)
|
||||
expect(screen.getByText('1h ago')).toBeTruthy()
|
||||
expect(screen.queryByText('1m ago')).toBeNull()
|
||||
})
|
||||
|
||||
it('FileCardItem falls back to updatedAt if createdAt is absent', () => {
|
||||
const assetWithUpdatedOnly: AssetSummary = {
|
||||
id: 'date-2',
|
||||
name: 'render2.mp4',
|
||||
type: 'file',
|
||||
updatedAt: new Date(Date.now() - 60 * 1000).toISOString(),
|
||||
}
|
||||
|
||||
render(<FileCardItem asset={assetWithUpdatedOnly} onClick={mockOnClick} />)
|
||||
expect(screen.getByText('1m ago')).toBeTruthy()
|
||||
})
|
||||
|
||||
it('FileItem renders createdAt time in subtext when provided', () => {
|
||||
const assetWithDates: AssetSummary = {
|
||||
id: 'date-3',
|
||||
name: 'render3.mp4',
|
||||
type: 'file',
|
||||
createdAt: new Date(Date.now() - 3600 * 1000).toISOString(),
|
||||
updatedAt: new Date(Date.now() - 60 * 1000).toISOString(),
|
||||
}
|
||||
|
||||
render(<FileItem asset={assetWithDates} onClick={mockOnClick} />)
|
||||
expect(screen.getByText(/1h ago/)).toBeTruthy()
|
||||
expect(screen.queryByText(/1m ago/)).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('getAssetVersionLabel', () => {
|
||||
it('returns null for folder asset', () => {
|
||||
const folder: AssetSummary = {
|
||||
id: 'f1',
|
||||
name: 'Footage',
|
||||
type: 'folder',
|
||||
}
|
||||
expect(getAssetVersionLabel(folder)).toBeNull()
|
||||
})
|
||||
|
||||
it('returns null for standalone file without versionStack', () => {
|
||||
const file: AssetSummary = {
|
||||
id: 'file1',
|
||||
name: 'clip.mp4',
|
||||
type: 'file',
|
||||
}
|
||||
expect(getAssetVersionLabel(file)).toBeNull()
|
||||
})
|
||||
|
||||
it('returns null when versionStack has empty versions array', () => {
|
||||
const file: AssetSummary = {
|
||||
id: 'file1',
|
||||
name: 'clip.mp4',
|
||||
type: 'file',
|
||||
versionStack: {
|
||||
id: 'stack-1',
|
||||
versions: [],
|
||||
},
|
||||
}
|
||||
expect(getAssetVersionLabel(file)).toBeNull()
|
||||
})
|
||||
|
||||
it('returns formatted version matching asset id', () => {
|
||||
const file: AssetSummary = {
|
||||
id: 'ver-1',
|
||||
name: 'cut.mov',
|
||||
type: 'file',
|
||||
versionStack: {
|
||||
id: 'stack-1',
|
||||
versions: [
|
||||
{ version: 3, current: false, id: 'ver-3' },
|
||||
{ version: 2, current: false, id: 'ver-2' },
|
||||
{ version: 1, current: false, id: 'ver-1' },
|
||||
],
|
||||
},
|
||||
}
|
||||
expect(getAssetVersionLabel(file)).toBe('v1')
|
||||
})
|
||||
|
||||
it('returns current version when asset id is stack id or does not match', () => {
|
||||
const file: AssetSummary = {
|
||||
id: 'stack-1',
|
||||
name: 'cut.mov',
|
||||
type: 'version_stack',
|
||||
versionStack: {
|
||||
id: 'stack-1',
|
||||
versions: [
|
||||
{ version: 3, current: true, id: 'ver-3' },
|
||||
{ version: 2, current: false, id: 'ver-2' },
|
||||
{ version: 1, current: false, id: 'ver-1' },
|
||||
],
|
||||
},
|
||||
}
|
||||
expect(getAssetVersionLabel(file)).toBe('v3')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,503 @@
|
||||
import React, { useState } from 'react'
|
||||
import { formatDateAgo } from '../utils/date'
|
||||
import { formatBytes, formatDuration } from '../utils/format'
|
||||
import { resolveAssetUrl } from '../utils/url'
|
||||
|
||||
export { formatBytes, formatDuration }
|
||||
|
||||
export interface AssetSummary {
|
||||
id: string
|
||||
name: string
|
||||
type: string
|
||||
size?: number | null
|
||||
sizeByte?: number | null
|
||||
mimeType?: string | null
|
||||
updatedAt?: string | Date
|
||||
createdAt?: string | Date
|
||||
commentsCount?: number
|
||||
fileCount?: number
|
||||
creator?: {
|
||||
id: string
|
||||
name: string
|
||||
image?: string | null
|
||||
} | null
|
||||
agent?: {
|
||||
id: string
|
||||
name: string
|
||||
} | null
|
||||
preview?: {
|
||||
thumbnailUrl?: string
|
||||
duration?: number
|
||||
pageCount?: number
|
||||
proxyType?: string | null
|
||||
} | null
|
||||
media?: {
|
||||
original?: {
|
||||
key?: string
|
||||
filesizeInBytes?: number
|
||||
codec?: string
|
||||
} | null
|
||||
metadata?: {
|
||||
duration?: number
|
||||
}
|
||||
videoTranscodes?: Array<{
|
||||
id: string
|
||||
url: string
|
||||
key: string
|
||||
width: number
|
||||
height: number
|
||||
size: number
|
||||
}>
|
||||
} | null
|
||||
versionStack?: {
|
||||
id: string
|
||||
versions: Array<{
|
||||
version: number
|
||||
current: boolean
|
||||
id: string
|
||||
name?: string | null
|
||||
createdAt?: string | null
|
||||
previewUrl?: string | null
|
||||
}>
|
||||
} | null
|
||||
}
|
||||
|
||||
export interface FileItemProps {
|
||||
asset: AssetSummary
|
||||
endpoint?: string
|
||||
apiKey?: string
|
||||
onClick: (e: React.MouseEvent) => void
|
||||
onImportRaw?: (asset: AssetSummary) => void
|
||||
onSelectVideoForImport?: (asset: AssetSummary) => void
|
||||
onLinkSequence?: (asset: AssetSummary) => void
|
||||
onUnlinkSequence?: (asset: AssetSummary) => void
|
||||
isLinked?: boolean
|
||||
linkedSequenceName?: string
|
||||
}
|
||||
|
||||
export function getFileTypeCategory(
|
||||
asset: AssetSummary,
|
||||
): 'folder' | 'video' | 'audio' | 'image' | 'file' {
|
||||
if (asset.type === 'folder') return 'folder'
|
||||
const name = asset.name.toLowerCase()
|
||||
const mime = asset.mimeType?.toLowerCase() || ''
|
||||
|
||||
if (mime.startsWith('video/') || /\.(mp4|mov|avi|mkv|m4v|webm)$/.test(name)) {
|
||||
return 'video'
|
||||
}
|
||||
if (mime.startsWith('audio/') || /\.(mp3|wav|aac|flac|m4a|ogg)$/.test(name)) {
|
||||
return 'audio'
|
||||
}
|
||||
if (mime.startsWith('image/') || /\.(png|jpg|jpeg|gif|webp|svg|bmp)$/.test(name)) {
|
||||
return 'image'
|
||||
}
|
||||
return 'file'
|
||||
}
|
||||
|
||||
export function getAssetVersionLabel(asset: AssetSummary): string | null {
|
||||
if (asset.versionStack?.versions && asset.versionStack.versions.length > 0) {
|
||||
const matched = asset.versionStack.versions.find((v) => v.id === asset.id)
|
||||
if (matched?.version != null) {
|
||||
return `v${matched.version}`
|
||||
}
|
||||
const current = asset.versionStack.versions.find((v) => v.current)
|
||||
if (current?.version != null) {
|
||||
return `v${current.version}`
|
||||
}
|
||||
const first = asset.versionStack.versions[0]
|
||||
if (first?.version != null) {
|
||||
return `v${first.version}`
|
||||
}
|
||||
return `v${asset.versionStack.versions.length}`
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/** List View Row Item */
|
||||
export const FileItem: React.FC<FileItemProps> = ({
|
||||
asset,
|
||||
endpoint = '',
|
||||
onClick,
|
||||
onImportRaw,
|
||||
onSelectVideoForImport,
|
||||
onLinkSequence,
|
||||
onUnlinkSequence,
|
||||
isLinked = false,
|
||||
linkedSequenceName,
|
||||
}) => {
|
||||
const [imgError, setImgError] = useState(false)
|
||||
const category = getFileTypeCategory(asset)
|
||||
const isFolder = category === 'folder'
|
||||
const versionLabel = getAssetVersionLabel(asset)
|
||||
const effectiveSize = asset.sizeByte ?? asset.size
|
||||
const timeText = formatDateAgo(asset.createdAt || asset.updatedAt)
|
||||
const thumbUrl = resolveAssetUrl(asset.preview?.thumbnailUrl, endpoint)
|
||||
|
||||
const iconFallback = (
|
||||
<div className={`item-icon ${category}`}>
|
||||
{category === 'folder' && (
|
||||
<sp-icon-folder size="s" style={{ color: '#fbbf24' }}></sp-icon-folder>
|
||||
)}
|
||||
{category === 'video' && (
|
||||
<sp-icon-filmstrip size="s" style={{ color: '#60a5fa' }}></sp-icon-filmstrip>
|
||||
)}
|
||||
{category === 'audio' && (
|
||||
<sp-icon-audio size="s" style={{ color: '#a78bfa' }}></sp-icon-audio>
|
||||
)}
|
||||
{category === 'image' && (
|
||||
<sp-icon-image size="s" style={{ color: '#f472b6' }}></sp-icon-image>
|
||||
)}
|
||||
{category === 'file' && (
|
||||
<sp-icon-document size="s" style={{ color: '#999999' }}></sp-icon-document>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
||||
const handleImportAction = () => {
|
||||
if (isFolder) return
|
||||
if (category === 'video' && onSelectVideoForImport) {
|
||||
onSelectVideoForImport(asset)
|
||||
} else if (onImportRaw) {
|
||||
onImportRaw(asset)
|
||||
}
|
||||
}
|
||||
|
||||
const handleRowClick = (e: React.MouseEvent) => {
|
||||
if (isFolder) {
|
||||
onClick(e)
|
||||
} else {
|
||||
e.stopPropagation()
|
||||
handleImportAction()
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="item-row"
|
||||
onClick={handleRowClick}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
handleRowClick(e as unknown as React.MouseEvent)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="item-left">
|
||||
{thumbUrl && !isFolder && !imgError ? (
|
||||
<div className="item-thumb-wrapper">
|
||||
<img
|
||||
src={thumbUrl}
|
||||
alt={asset.name}
|
||||
className="item-thumb-img"
|
||||
onLoad={() => console.log('[UXP Image OK]', thumbUrl)}
|
||||
onError={() => {
|
||||
console.error('[UXP Image Failed]', thumbUrl)
|
||||
setImgError(true)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
iconFallback
|
||||
)}
|
||||
|
||||
<div className="item-meta">
|
||||
<span className="item-name" title={asset.name}>
|
||||
{asset.name}
|
||||
</span>
|
||||
<span className="item-subtext">
|
||||
{versionLabel ? `${versionLabel} • ` : ''}
|
||||
{isFolder ? 'Folder' : formatBytes(effectiveSize)}
|
||||
{timeText ? ` • ${timeText}` : ''}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="item-right">
|
||||
{asset.commentsCount != null && asset.commentsCount > 0 && (
|
||||
<span className="item-comments-count" title={`${asset.commentsCount} comments`}>
|
||||
{asset.commentsCount} {asset.commentsCount === 1 ? 'comment' : 'comments'}
|
||||
</span>
|
||||
)}
|
||||
{isFolder ? (
|
||||
<sp-icon-chevron-right size="xs"></sp-icon-chevron-right>
|
||||
) : (
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
{(onLinkSequence || onUnlinkSequence) &&
|
||||
(category === 'video' || category === 'audio') && (
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
icon-only
|
||||
label={
|
||||
isLinked
|
||||
? onUnlinkSequence
|
||||
? `Unlink from ${linkedSequenceName || 'Sequence'}`
|
||||
: `Linked to ${linkedSequenceName || 'Sequence'}`
|
||||
: 'Link to Sequence'
|
||||
}
|
||||
title={
|
||||
isLinked
|
||||
? onUnlinkSequence
|
||||
? `Unlink from ${linkedSequenceName || 'Sequence'}`
|
||||
: `Linked to ${linkedSequenceName || 'Sequence'}`
|
||||
: 'Link to Sequence'
|
||||
}
|
||||
className="item-row-link-btn"
|
||||
style={{ marginRight: 4 }}
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
if (isLinked && onUnlinkSequence) {
|
||||
onUnlinkSequence(asset)
|
||||
} else if (onLinkSequence) {
|
||||
onLinkSequence(asset)
|
||||
}
|
||||
}}
|
||||
>
|
||||
{isLinked ? (
|
||||
<sp-icon-unlink
|
||||
size="s"
|
||||
slot="icon"
|
||||
style={{ color: '#f87171' }}
|
||||
></sp-icon-unlink>
|
||||
) : (
|
||||
<sp-icon-link size="s" slot="icon"></sp-icon-link>
|
||||
)}
|
||||
</sp-action-button>
|
||||
)}
|
||||
{(onImportRaw || onSelectVideoForImport) && (
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
icon-only
|
||||
label="Import into Premiere Pro"
|
||||
title="Import into Premiere Pro"
|
||||
className="item-row-import-btn"
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
handleImportAction()
|
||||
}}
|
||||
>
|
||||
<sp-icon-download size="s" slot="icon"></sp-icon-download>
|
||||
</sp-action-button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** Card View Row Item (2 Columns: Left Preview, Right Info as Raw Text) */
|
||||
export const FileCardItem: React.FC<FileItemProps> = ({
|
||||
asset,
|
||||
endpoint = '',
|
||||
onClick,
|
||||
onImportRaw,
|
||||
onSelectVideoForImport,
|
||||
onLinkSequence,
|
||||
onUnlinkSequence,
|
||||
isLinked = false,
|
||||
linkedSequenceName,
|
||||
}) => {
|
||||
const [imgError, setImgError] = useState(false)
|
||||
const category = getFileTypeCategory(asset)
|
||||
const isFolder = category === 'folder'
|
||||
const effectiveSize = asset.sizeByte ?? asset.size
|
||||
const timeText = formatDateAgo(asset.createdAt || asset.updatedAt)
|
||||
const thumbUrl = resolveAssetUrl(asset.preview?.thumbnailUrl, endpoint)
|
||||
const duration = asset.preview?.duration ?? asset.media?.metadata?.duration
|
||||
const durationText = formatDuration(duration)
|
||||
const creatorName = asset.creator?.name || asset.agent?.name
|
||||
|
||||
const cardFallback = (
|
||||
<div className={`file-row-placeholder ${category}`}>
|
||||
{category === 'folder' && (
|
||||
<sp-icon-folder size="l" style={{ color: '#fbbf24' }}></sp-icon-folder>
|
||||
)}
|
||||
{category === 'video' && (
|
||||
<sp-icon-filmstrip size="l" style={{ color: '#60a5fa' }}></sp-icon-filmstrip>
|
||||
)}
|
||||
{category === 'audio' && (
|
||||
<sp-icon-audio size="l" style={{ color: '#a78bfa' }}></sp-icon-audio>
|
||||
)}
|
||||
{category === 'image' && (
|
||||
<sp-icon-image size="l" style={{ color: '#f472b6' }}></sp-icon-image>
|
||||
)}
|
||||
{category === 'file' && (
|
||||
<sp-icon-document size="l" style={{ color: '#999999' }}></sp-icon-document>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
||||
const handleImportAction = () => {
|
||||
if (isFolder) return
|
||||
if (category === 'video' && onSelectVideoForImport) {
|
||||
onSelectVideoForImport(asset)
|
||||
} else if (onImportRaw) {
|
||||
onImportRaw(asset)
|
||||
}
|
||||
}
|
||||
|
||||
const handleCardClick = (e: React.MouseEvent) => {
|
||||
if (isFolder) {
|
||||
onClick(e)
|
||||
}
|
||||
}
|
||||
|
||||
// Assemble raw text details for Line 3 (Version • Duration • Size/Type • Comments)
|
||||
const details: string[] = []
|
||||
const versionLabel = getAssetVersionLabel(asset)
|
||||
if (versionLabel) {
|
||||
details.push(versionLabel)
|
||||
}
|
||||
if (durationText) {
|
||||
details.push(durationText)
|
||||
}
|
||||
if (isFolder) {
|
||||
details.push(asset.fileCount != null ? `${asset.fileCount} items` : 'Folder')
|
||||
} else if (effectiveSize != null) {
|
||||
details.push(formatBytes(effectiveSize))
|
||||
}
|
||||
if (asset.commentsCount != null && asset.commentsCount > 0) {
|
||||
details.push(`${asset.commentsCount} ${asset.commentsCount === 1 ? 'comment' : 'comments'}`)
|
||||
}
|
||||
if (isLinked) {
|
||||
details.push(`Linked: ${linkedSequenceName || 'Sequence'}`)
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`file-row-card ${isFolder ? 'is-folder' : 'is-file'}`}
|
||||
onClick={isFolder ? handleCardClick : undefined}
|
||||
role={isFolder ? 'button' : undefined}
|
||||
tabIndex={isFolder ? 0 : undefined}
|
||||
title={isFolder ? asset.name : undefined}
|
||||
onKeyDown={
|
||||
isFolder
|
||||
? (e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
handleCardClick(e as unknown as React.MouseEvent)
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{/* Left Column: Preview Only (NO LABELS, NO BADGES) */}
|
||||
<div className="file-row-preview">
|
||||
{thumbUrl && !isFolder && !imgError ? (
|
||||
<img
|
||||
src={thumbUrl}
|
||||
alt={asset.name}
|
||||
className="file-row-img"
|
||||
onError={() => setImgError(true)}
|
||||
/>
|
||||
) : (
|
||||
cardFallback
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Right Column: Title, Creator & Date, Duration / Size / Comments as Raw Text */}
|
||||
<div className="file-row-content">
|
||||
<div className="file-row-header">
|
||||
<span className="file-row-title" title={isFolder ? asset.name : undefined}>
|
||||
{asset.name}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{(creatorName || timeText) && (
|
||||
<div className="file-row-meta">
|
||||
{creatorName && <span className="file-row-creator">{creatorName}</span>}
|
||||
{creatorName && timeText && <span className="file-row-meta-dot">•</span>}
|
||||
{timeText && <span className="file-row-time">{timeText}</span>}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{details.length > 0 && (
|
||||
<div className="file-row-subtext file-row-details">
|
||||
{details.map((item, idx) => (
|
||||
<React.Fragment key={idx}>
|
||||
{idx > 0 && <span className="file-row-meta-dot">•</span>}
|
||||
<span
|
||||
className={`file-row-detail-item${item === versionLabel ? ' file-row-version' : ''}`}
|
||||
>
|
||||
{item}
|
||||
</span>
|
||||
</React.Fragment>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Far Right Action Column (Centered Vertically across the card) */}
|
||||
<div className="file-row-actions" style={{ display: 'flex', alignItems: 'center' }}>
|
||||
{isFolder ? (
|
||||
<sp-icon-chevron-right size="xs" className="file-row-chevron"></sp-icon-chevron-right>
|
||||
) : (
|
||||
<>
|
||||
{(onLinkSequence || onUnlinkSequence) &&
|
||||
(category === 'video' || category === 'audio') && (
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
icon-only
|
||||
label={
|
||||
isLinked
|
||||
? onUnlinkSequence
|
||||
? `Unlink from ${linkedSequenceName || 'Sequence'}`
|
||||
: `Linked to ${linkedSequenceName || 'Sequence'}`
|
||||
: 'Link to Sequence'
|
||||
}
|
||||
title={
|
||||
isLinked
|
||||
? onUnlinkSequence
|
||||
? `Unlink from ${linkedSequenceName || 'Sequence'}`
|
||||
: `Linked to ${linkedSequenceName || 'Sequence'}`
|
||||
: 'Link to Sequence'
|
||||
}
|
||||
className="file-row-link-btn"
|
||||
style={{ marginRight: 4 }}
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
if (isLinked && onUnlinkSequence) {
|
||||
onUnlinkSequence(asset)
|
||||
} else if (onLinkSequence) {
|
||||
onLinkSequence(asset)
|
||||
}
|
||||
}}
|
||||
>
|
||||
{isLinked ? (
|
||||
<sp-icon-unlink
|
||||
size="s"
|
||||
slot="icon"
|
||||
style={{ color: '#f87171' }}
|
||||
></sp-icon-unlink>
|
||||
) : (
|
||||
<sp-icon-link size="s" slot="icon"></sp-icon-link>
|
||||
)}
|
||||
</sp-action-button>
|
||||
)}
|
||||
{(onImportRaw || onSelectVideoForImport) && (
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
icon-only
|
||||
label="Import into Premiere Pro"
|
||||
title="Import into Premiere Pro"
|
||||
className="file-row-import-btn"
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
handleImportAction()
|
||||
}}
|
||||
>
|
||||
<sp-icon-download size="s" slot="icon"></sp-icon-download>
|
||||
</sp-action-button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import React from 'react'
|
||||
import { Divider } from '@swc-react/divider'
|
||||
import { ShumaiLogo } from './icons'
|
||||
|
||||
interface HeaderProps {
|
||||
endpoint?: string
|
||||
onDisconnect?: () => void
|
||||
}
|
||||
|
||||
export const Header: React.FC<HeaderProps> = ({ endpoint, onDisconnect }) => {
|
||||
let displayHost = ''
|
||||
if (endpoint) {
|
||||
try {
|
||||
const url = new URL(endpoint)
|
||||
displayHost = url.host
|
||||
} catch {
|
||||
displayHost = endpoint
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<header className="app-header">
|
||||
<div className="logo-group">
|
||||
<div className="logo-icon">
|
||||
<ShumaiLogo width={18} height={18} />
|
||||
</div>
|
||||
<span className="app-title">Shumai</span>
|
||||
</div>
|
||||
|
||||
{endpoint && onDisconnect && (
|
||||
<div className="actions-group">
|
||||
<div
|
||||
className="header-status"
|
||||
title={`Connected to ${endpoint}`}
|
||||
role="status"
|
||||
aria-label={`Connected to ${displayHost}`}
|
||||
>
|
||||
<span className="status-dot positive" />
|
||||
<span className="status-text">{displayHost}</span>
|
||||
</div>
|
||||
<sp-button
|
||||
quiet
|
||||
variant="secondary"
|
||||
size="s"
|
||||
label="Disconnect / Change Server"
|
||||
icon-only
|
||||
onClick={onDisconnect}
|
||||
title="Disconnect / Change Server"
|
||||
>
|
||||
<sp-icon-log-out slot="icon" size="s"></sp-icon-log-out>
|
||||
</sp-button>
|
||||
</div>
|
||||
)}
|
||||
</header>
|
||||
<Divider size="s" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
// @vitest-environment happy-dom
|
||||
import React, { act } from 'react'
|
||||
import { describe, it, expect, vi, afterEach } from 'vitest'
|
||||
import { render, screen, fireEvent, cleanup } from '@testing-library/react'
|
||||
import { ImportVideoDialog } from './ImportVideoDialog'
|
||||
import type { AssetSummary } from './FileItem'
|
||||
import * as importService from '../services/import'
|
||||
|
||||
// Configure React 19 act environment for happy-dom
|
||||
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
|
||||
|
||||
describe('ImportVideoDialog Component', () => {
|
||||
const mockOnClose = vi.fn()
|
||||
const mockOnImportRaw = vi.fn()
|
||||
const mockOnImportProxy = vi.fn()
|
||||
|
||||
const videoAsset: AssetSummary = {
|
||||
id: 'asset-vid-1',
|
||||
name: 'interview_clip.mp4',
|
||||
type: 'file',
|
||||
mimeType: 'video/mp4',
|
||||
sizeByte: 1024 * 1024 * 45,
|
||||
preview: {
|
||||
duration: 154,
|
||||
},
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
cleanup()
|
||||
vi.clearAllMocks()
|
||||
})
|
||||
|
||||
it('renders nothing when closed or asset is null', () => {
|
||||
const { container } = render(
|
||||
<ImportVideoDialog
|
||||
asset={videoAsset}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={false}
|
||||
onClose={mockOnClose}
|
||||
onImportRaw={mockOnImportRaw}
|
||||
onImportProxy={mockOnImportProxy}
|
||||
/>,
|
||||
)
|
||||
expect(container.firstChild).toBeNull()
|
||||
|
||||
const { container: containerNull } = render(
|
||||
<ImportVideoDialog
|
||||
asset={null}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={true}
|
||||
onClose={mockOnClose}
|
||||
onImportRaw={mockOnImportRaw}
|
||||
onImportProxy={mockOnImportProxy}
|
||||
/>,
|
||||
)
|
||||
expect(containerNull.firstChild).toBeNull()
|
||||
})
|
||||
|
||||
it('renders video info and selects original file by default', async () => {
|
||||
vi.spyOn(importService, 'fetchVideoProxies').mockResolvedValue([])
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<ImportVideoDialog
|
||||
asset={videoAsset}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={true}
|
||||
onClose={mockOnClose}
|
||||
onImportRaw={mockOnImportRaw}
|
||||
onImportProxy={mockOnImportProxy}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
expect(screen.getByText('Import Video')).toBeTruthy()
|
||||
expect(screen.getByText('interview_clip.mp4')).toBeTruthy()
|
||||
expect(screen.getByText('Original File')).toBeTruthy()
|
||||
expect(screen.getByText('No proxy transcodes available for this video.')).toBeTruthy()
|
||||
|
||||
// Click Import button
|
||||
const importBtn = screen.getByText('Import')
|
||||
fireEvent.click(importBtn)
|
||||
|
||||
expect(mockOnImportRaw).toHaveBeenCalledWith(videoAsset)
|
||||
expect(mockOnClose).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('fetches and allows selecting a proxy transcode', async () => {
|
||||
vi.spyOn(importService, 'fetchVideoProxies').mockResolvedValue([
|
||||
{
|
||||
id: 'proxy-1',
|
||||
label: '1080p (MP4)',
|
||||
resolution: '1080p',
|
||||
url: 'https://cdn.shumai.test/1080p.mp4',
|
||||
key: 'proxies/1080p.mp4',
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
size: 1024 * 1024 * 12,
|
||||
},
|
||||
])
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<ImportVideoDialog
|
||||
asset={videoAsset}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={true}
|
||||
onClose={mockOnClose}
|
||||
onImportRaw={mockOnImportRaw}
|
||||
onImportProxy={mockOnImportProxy}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
expect(screen.getByText('1080p (MP4)')).toBeTruthy()
|
||||
|
||||
// Select the proxy card
|
||||
const proxyCard = screen.getByText('1080p (MP4)')
|
||||
fireEvent.click(proxyCard)
|
||||
|
||||
// Click Import button
|
||||
const importBtn = screen.getByText('Import')
|
||||
fireEvent.click(importBtn)
|
||||
|
||||
expect(mockOnImportProxy).toHaveBeenCalledWith(
|
||||
videoAsset,
|
||||
expect.objectContaining({ id: 'proxy-1', label: '1080p (MP4)' }),
|
||||
)
|
||||
expect(mockOnClose).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('closes on Escape key or cancel button', async () => {
|
||||
vi.spyOn(importService, 'fetchVideoProxies').mockResolvedValue([])
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<ImportVideoDialog
|
||||
asset={videoAsset}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={true}
|
||||
onClose={mockOnClose}
|
||||
onImportRaw={mockOnImportRaw}
|
||||
onImportProxy={mockOnImportProxy}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
const cancelBtn = screen.getByText('Cancel')
|
||||
fireEvent.click(cancelBtn)
|
||||
expect(mockOnClose).toHaveBeenCalledTimes(1)
|
||||
|
||||
act(() => {
|
||||
fireEvent.keyDown(document, { key: 'Escape' })
|
||||
})
|
||||
expect(mockOnClose).toHaveBeenCalledTimes(2)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,245 @@
|
||||
import React, { useState, useEffect, useCallback } from 'react'
|
||||
import type { AssetSummary } from './FileItem'
|
||||
import { fetchVideoProxies, type ProxyOption } from '../services/import'
|
||||
import { formatBytes, formatDuration } from '../utils/format'
|
||||
import { resolveAssetUrl } from '../utils/url'
|
||||
import { ProgressCircle } from '@swc-react/progress-circle'
|
||||
|
||||
export interface ImportVideoDialogProps {
|
||||
asset: AssetSummary | null
|
||||
endpoint: string
|
||||
apiKey: string
|
||||
isOpen: boolean
|
||||
onClose: () => void
|
||||
onImportRaw: (asset: AssetSummary) => void
|
||||
onImportProxy: (asset: AssetSummary, proxy: ProxyOption) => void
|
||||
}
|
||||
|
||||
export const ImportVideoDialog: React.FC<ImportVideoDialogProps> = ({
|
||||
asset,
|
||||
endpoint,
|
||||
apiKey,
|
||||
isOpen,
|
||||
onClose,
|
||||
onImportRaw,
|
||||
onImportProxy,
|
||||
}) => {
|
||||
const [selectedVersion, setSelectedVersion] = useState<'raw' | string>('raw')
|
||||
const [proxies, setProxies] = useState<ProxyOption[]>([])
|
||||
const [loadingProxies, setLoadingProxies] = useState(false)
|
||||
const [thumbError, setThumbError] = useState(false)
|
||||
|
||||
// Reset and fetch proxies when a new video asset is opened
|
||||
useEffect(() => {
|
||||
if (!isOpen || !asset) {
|
||||
setProxies([])
|
||||
setSelectedVersion('raw')
|
||||
setLoadingProxies(false)
|
||||
setThumbError(false)
|
||||
return
|
||||
}
|
||||
|
||||
let isMounted = true
|
||||
setLoadingProxies(true)
|
||||
setSelectedVersion('raw')
|
||||
|
||||
void fetchVideoProxies(endpoint, apiKey, asset.id)
|
||||
.then((items) => {
|
||||
if (isMounted) {
|
||||
setProxies(items)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.warn('Failed to load video proxies:', err)
|
||||
})
|
||||
.finally(() => {
|
||||
if (isMounted) {
|
||||
setLoadingProxies(false)
|
||||
}
|
||||
})
|
||||
|
||||
return () => {
|
||||
isMounted = false
|
||||
}
|
||||
}, [isOpen, asset, endpoint, apiKey])
|
||||
|
||||
// Handle Escape key to close dialog
|
||||
useEffect(() => {
|
||||
if (!isOpen) return
|
||||
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') {
|
||||
onClose()
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', handleKeyDown)
|
||||
return () => {
|
||||
document.removeEventListener('keydown', handleKeyDown)
|
||||
}
|
||||
}, [isOpen, onClose])
|
||||
|
||||
const handleConfirm = useCallback(() => {
|
||||
if (!asset) return
|
||||
|
||||
if (selectedVersion === 'raw') {
|
||||
onClose()
|
||||
onImportRaw(asset)
|
||||
} else if (selectedVersion.startsWith('proxy:')) {
|
||||
const proxyId = selectedVersion.slice('proxy:'.length)
|
||||
const targetProxy = proxies.find((p) => p.id === proxyId)
|
||||
if (targetProxy) {
|
||||
onClose()
|
||||
onImportProxy(asset, targetProxy)
|
||||
}
|
||||
}
|
||||
}, [asset, selectedVersion, proxies, onClose, onImportRaw, onImportProxy])
|
||||
|
||||
if (!isOpen || !asset) return null
|
||||
|
||||
const effectiveSize = asset.sizeByte ?? asset.size
|
||||
const thumbUrl = resolveAssetUrl(asset.preview?.thumbnailUrl, endpoint)
|
||||
const duration = asset.preview?.duration ?? asset.media?.metadata?.duration
|
||||
const durationText = formatDuration(duration)
|
||||
|
||||
return (
|
||||
<div
|
||||
className="shumai-dialog-backdrop"
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget) {
|
||||
onClose()
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="shumai-dialog" role="dialog" aria-modal="true" aria-labelledby="dialog-title">
|
||||
{/* Dialog Header */}
|
||||
<div className="shumai-dialog-header">
|
||||
<span id="dialog-title" className="shumai-dialog-title">
|
||||
Import Video
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
className="shumai-dialog-close"
|
||||
onClick={onClose}
|
||||
title="Close dialog"
|
||||
aria-label="Close dialog"
|
||||
>
|
||||
<sp-icon-close size="s"></sp-icon-close>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Video Asset Preview Info */}
|
||||
<div className="shumai-dialog-asset-info">
|
||||
<div className="shumai-dialog-thumb">
|
||||
{thumbUrl && !thumbError ? (
|
||||
<img src={thumbUrl} alt={asset.name} onError={() => setThumbError(true)} />
|
||||
) : (
|
||||
<sp-icon-filmstrip size="xxl" style={{ color: '#60a5fa' }}></sp-icon-filmstrip>
|
||||
)}
|
||||
</div>
|
||||
<div className="shumai-dialog-asset-meta">
|
||||
<span className="shumai-dialog-asset-name" title={asset.name}>
|
||||
{asset.name}
|
||||
</span>
|
||||
<span className="shumai-dialog-asset-details">
|
||||
{durationText ? `${durationText} • ` : ''}
|
||||
{effectiveSize ? formatBytes(effectiveSize) : 'Video'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Options Selection Body */}
|
||||
<div className="shumai-dialog-body">
|
||||
<div className="shumai-dialog-section-label">Choose Version to Import</div>
|
||||
|
||||
{/* Original Version Card */}
|
||||
<div
|
||||
className={`shumai-option-card ${selectedVersion === 'raw' ? 'selected' : ''}`}
|
||||
onClick={() => setSelectedVersion('raw')}
|
||||
role="radio"
|
||||
aria-checked={selectedVersion === 'raw'}
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
setSelectedVersion('raw')
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="shumai-option-left">
|
||||
<div className="shumai-option-texts">
|
||||
<span className="shumai-option-title">Original File</span>
|
||||
<span className="shumai-option-meta">
|
||||
Full resolution • {effectiveSize ? formatBytes(effectiveSize) : 'Raw file'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="shumai-option-radio">
|
||||
{selectedVersion === 'raw' && <div className="shumai-option-radio-dot" />}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="shumai-dialog-divider" />
|
||||
|
||||
{/* Proxies Section */}
|
||||
<div className="shumai-dialog-section-label">Transcode Proxies</div>
|
||||
|
||||
{loadingProxies ? (
|
||||
<div className="shumai-dialog-loading">
|
||||
<ProgressCircle indeterminate size="s" label="Checking available proxies..." />
|
||||
<span>Checking available proxies...</span>
|
||||
</div>
|
||||
) : proxies.length > 0 ? (
|
||||
proxies.map((proxy) => {
|
||||
const isSelected = selectedVersion === `proxy:${proxy.id}`
|
||||
return (
|
||||
<div
|
||||
key={proxy.id}
|
||||
className={`shumai-option-card ${isSelected ? 'selected' : ''}`}
|
||||
onClick={() => setSelectedVersion(`proxy:${proxy.id}`)}
|
||||
role="radio"
|
||||
aria-checked={isSelected}
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
setSelectedVersion(`proxy:${proxy.id}`)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="shumai-option-left">
|
||||
<div className="shumai-option-texts">
|
||||
<span className="shumai-option-title">{proxy.label}</span>
|
||||
<span className="shumai-option-meta">
|
||||
{proxy.width && proxy.height ? `${proxy.width}x${proxy.height} • ` : ''}
|
||||
{proxy.size ? `${formatBytes(proxy.size)} • ` : ''}
|
||||
Fast editing proxy
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="shumai-option-radio">
|
||||
{isSelected && <div className="shumai-option-radio-dot" />}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
) : (
|
||||
<div className="shumai-dialog-empty-proxies">
|
||||
<span>No proxy transcodes available for this video.</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Dialog Footer Actions */}
|
||||
<div className="shumai-dialog-footer">
|
||||
<sp-button quiet variant="secondary" size="s" onClick={onClose}>
|
||||
Cancel
|
||||
</sp-button>
|
||||
<sp-button variant="accent" size="s" onClick={handleConfirm}>
|
||||
Import
|
||||
</sp-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
// @vitest-environment happy-dom
|
||||
import React, { act } from 'react'
|
||||
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'
|
||||
import { render, screen, fireEvent, cleanup } from '@testing-library/react'
|
||||
import { LinkSequenceDialog } from './LinkSequenceDialog'
|
||||
import type { AssetSummary } from './FileItem'
|
||||
import * as premiereService from '../services/premiere'
|
||||
import * as linkStorage from '../services/linkStorage'
|
||||
import * as markersService from '../services/markers'
|
||||
import type { Project, Sequence } from '@adobe/premierepro'
|
||||
import type { CommentInfo } from '@shumai/dtos'
|
||||
|
||||
// Configure React 19 act environment for happy-dom
|
||||
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
|
||||
|
||||
describe('LinkSequenceDialog Component', () => {
|
||||
const mockOnClose = vi.fn()
|
||||
const mockOnLinkSuccess = vi.fn()
|
||||
|
||||
const videoAsset: AssetSummary = {
|
||||
id: 'asset-vid-1',
|
||||
name: 'interview_clip.mp4',
|
||||
type: 'file',
|
||||
mimeType: 'video/mp4',
|
||||
sizeByte: 1024 * 1024 * 45,
|
||||
preview: {
|
||||
duration: 154,
|
||||
},
|
||||
commentsCount: 3,
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
cleanup()
|
||||
})
|
||||
|
||||
it('renders nothing when closed or asset is null', () => {
|
||||
const { container } = render(
|
||||
<LinkSequenceDialog
|
||||
asset={videoAsset}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={false}
|
||||
onClose={mockOnClose}
|
||||
onLinkSuccess={mockOnLinkSuccess}
|
||||
/>,
|
||||
)
|
||||
expect(container.firstChild).toBeNull()
|
||||
|
||||
const { container: containerNull } = render(
|
||||
<LinkSequenceDialog
|
||||
asset={null}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={true}
|
||||
onClose={mockOnClose}
|
||||
onLinkSuccess={mockOnLinkSuccess}
|
||||
/>,
|
||||
)
|
||||
expect(containerNull.firstChild).toBeNull()
|
||||
})
|
||||
|
||||
it('displays error message when no active project is open', async () => {
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(null)
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<LinkSequenceDialog
|
||||
asset={videoAsset}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={true}
|
||||
onClose={mockOnClose}
|
||||
onLinkSuccess={mockOnLinkSuccess}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
expect(screen.getByText(/no active premiere pro project found/i)).toBeDefined()
|
||||
})
|
||||
|
||||
it('lists project sequences and highlights active sequence without sequence icon', async () => {
|
||||
const mockSeq1 = { guid: 'seq-1', name: 'Rough Cut' }
|
||||
const mockSeq2 = { guid: 'seq-2', name: 'Fine Cut' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([
|
||||
mockSeq1,
|
||||
mockSeq2,
|
||||
] as unknown as Sequence[])
|
||||
vi.spyOn(premiereService, 'getActiveSequence').mockResolvedValue(
|
||||
mockSeq2 as unknown as Sequence,
|
||||
)
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([])
|
||||
|
||||
let renderedContainer: HTMLElement = null!
|
||||
await act(async () => {
|
||||
const { container } = render(
|
||||
<LinkSequenceDialog
|
||||
asset={videoAsset}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={true}
|
||||
onClose={mockOnClose}
|
||||
onLinkSuccess={mockOnLinkSuccess}
|
||||
/>,
|
||||
)
|
||||
renderedContainer = container
|
||||
})
|
||||
|
||||
expect(screen.getByText('Rough Cut')).toBeDefined()
|
||||
expect(screen.getByText('Fine Cut')).toBeDefined()
|
||||
expect(screen.getByText('Active')).toBeDefined()
|
||||
expect(renderedContainer.querySelectorAll('.shumai-option-card sp-icon-filmstrip').length).toBe(
|
||||
0,
|
||||
)
|
||||
})
|
||||
|
||||
it('executes sync and invokes onLinkSuccess on confirmation', async () => {
|
||||
const mockSeq1 = { guid: 'seq-1', name: 'Rough Cut' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([
|
||||
mockSeq1,
|
||||
] as unknown as Sequence[])
|
||||
vi.spyOn(premiereService, 'getActiveSequence').mockResolvedValue(
|
||||
mockSeq1 as unknown as Sequence,
|
||||
)
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([])
|
||||
vi.spyOn(markersService, 'fetchAssetComments').mockResolvedValue([
|
||||
{ id: 'comm-1', second: 10, message: 'Test marker' } as unknown as CommentInfo,
|
||||
])
|
||||
|
||||
const mockUpdatedLink = {
|
||||
sequenceGuid: 'seq-1',
|
||||
sequenceName: 'Rough Cut',
|
||||
assetId: 'asset-vid-1',
|
||||
assetName: 'interview_clip.mp4',
|
||||
syncedCommentIds: ['comm-1'],
|
||||
lastSyncAt: Date.now(),
|
||||
totalCommentsSynced: 1,
|
||||
}
|
||||
|
||||
vi.spyOn(markersService, 'syncCommentsToSequence').mockResolvedValue({
|
||||
updatedLink: mockUpdatedLink,
|
||||
addedCount: 1,
|
||||
})
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<LinkSequenceDialog
|
||||
asset={videoAsset}
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
isOpen={true}
|
||||
onClose={mockOnClose}
|
||||
onLinkSuccess={mockOnLinkSuccess}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
const linkBtn = screen.getByText('Link Sequence')
|
||||
await act(async () => {
|
||||
fireEvent.click(linkBtn)
|
||||
})
|
||||
|
||||
expect(markersService.fetchAssetComments).toHaveBeenCalledWith(
|
||||
'https://api.shumai.test',
|
||||
'test-key',
|
||||
'asset-vid-1',
|
||||
)
|
||||
expect(markersService.syncCommentsToSequence).toHaveBeenCalledWith(
|
||||
mockProject,
|
||||
mockSeq1,
|
||||
expect.any(Array),
|
||||
expect.objectContaining({
|
||||
endpoint: 'https://api.shumai.test',
|
||||
sequenceGuid: 'seq-1',
|
||||
assetId: 'asset-vid-1',
|
||||
}),
|
||||
)
|
||||
expect(mockOnLinkSuccess).toHaveBeenCalledWith(mockUpdatedLink, 1)
|
||||
expect(mockOnClose).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,420 @@
|
||||
import React, { useState, useEffect, useCallback } from 'react'
|
||||
import type { Sequence, Project } from '@adobe/premierepro'
|
||||
import type { AssetSummary } from './FileItem'
|
||||
import type { LinkedSequenceAsset } from '../types/link'
|
||||
import { getActiveProject, getAllSequences, getActiveSequence } from '../services/premiere'
|
||||
import { getAllLinkedSequences, normalizeGuid, removeSequenceLink } from '../services/linkStorage'
|
||||
import { fetchAssetComments, syncCommentsToSequence } from '../services/markers'
|
||||
import { resolveAssetUrl, isSameEndpoint } from '../utils/url'
|
||||
import { formatBytes, formatDuration } from '../utils/format'
|
||||
import { ProgressCircle } from '@swc-react/progress-circle'
|
||||
|
||||
export interface LinkSequenceDialogProps {
|
||||
asset: AssetSummary | null
|
||||
endpoint: string
|
||||
apiKey: string
|
||||
isOpen: boolean
|
||||
onClose: () => void
|
||||
onLinkSuccess: (link: LinkedSequenceAsset, addedMarkersCount: number) => void
|
||||
}
|
||||
|
||||
interface SequenceOption {
|
||||
sequence: Sequence
|
||||
guid: string
|
||||
name: string
|
||||
isActive: boolean
|
||||
currentLink: LinkedSequenceAsset | null
|
||||
}
|
||||
|
||||
export const LinkSequenceDialog: React.FC<LinkSequenceDialogProps> = ({
|
||||
asset,
|
||||
endpoint,
|
||||
apiKey,
|
||||
isOpen,
|
||||
onClose,
|
||||
onLinkSuccess,
|
||||
}) => {
|
||||
const [project, setProject] = useState<Project | null>(null)
|
||||
const [sequences, setSequences] = useState<SequenceOption[]>([])
|
||||
const [selectedGuid, setSelectedGuid] = useState<string>('')
|
||||
const [loadingSequences, setLoadingSequences] = useState(true)
|
||||
const [linking, setLinking] = useState(false)
|
||||
const [errorMessage, setErrorMessage] = useState<string | null>(null)
|
||||
const [thumbError, setThumbError] = useState(false)
|
||||
|
||||
// Load project sequences and link states when opened
|
||||
useEffect(() => {
|
||||
if (!isOpen || !asset) {
|
||||
setProject(null)
|
||||
setSequences([])
|
||||
setSelectedGuid('')
|
||||
setErrorMessage(null)
|
||||
setLinking(false)
|
||||
setThumbError(false)
|
||||
return
|
||||
}
|
||||
|
||||
let isMounted = true
|
||||
setLoadingSequences(true)
|
||||
setErrorMessage(null)
|
||||
|
||||
async function loadProjectData() {
|
||||
try {
|
||||
const pr = await getActiveProject()
|
||||
if (!isMounted) return
|
||||
|
||||
if (!pr) {
|
||||
setProject(null)
|
||||
setLoadingSequences(false)
|
||||
setErrorMessage('No active Premiere Pro project found. Please open a project first.')
|
||||
return
|
||||
}
|
||||
|
||||
setProject(pr)
|
||||
|
||||
const [allSeqs, activeSeq, existingLinks] = await Promise.all([
|
||||
getAllSequences(pr),
|
||||
getActiveSequence(pr),
|
||||
getAllLinkedSequences(pr),
|
||||
])
|
||||
|
||||
if (!isMounted) return
|
||||
|
||||
if (!allSeqs || allSeqs.length === 0) {
|
||||
setLoadingSequences(false)
|
||||
setErrorMessage(
|
||||
'No sequences found in the current project. Please create a sequence first.',
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const activeGuid = normalizeGuid(activeSeq?.guid)
|
||||
const linksMap = new Map<string, LinkedSequenceAsset>()
|
||||
for (const link of existingLinks) {
|
||||
if (!link.endpoint || isSameEndpoint(link.endpoint, endpoint)) {
|
||||
linksMap.set(normalizeGuid(link.sequenceGuid), link)
|
||||
}
|
||||
}
|
||||
|
||||
const options: SequenceOption[] = allSeqs.map((seq) => {
|
||||
const guidStr = normalizeGuid(seq.guid)
|
||||
return {
|
||||
sequence: seq,
|
||||
guid: guidStr,
|
||||
name: seq.name || 'Untitled Sequence',
|
||||
isActive: Boolean(activeGuid && guidStr === activeGuid),
|
||||
currentLink: linksMap.get(guidStr) || null,
|
||||
}
|
||||
})
|
||||
|
||||
setSequences(options)
|
||||
|
||||
// Pre-select active sequence if found, else first sequence
|
||||
if (activeGuid && options.some((opt) => opt.guid === activeGuid)) {
|
||||
setSelectedGuid(activeGuid)
|
||||
} else if (options.length > 0) {
|
||||
setSelectedGuid(options[0].guid)
|
||||
}
|
||||
} catch (err) {
|
||||
if (!isMounted) return
|
||||
console.error('[LinkSequenceDialog] Error loading project data:', err)
|
||||
setErrorMessage('Failed to load project sequences from Premiere Pro.')
|
||||
} finally {
|
||||
if (isMounted) {
|
||||
setLoadingSequences(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void loadProjectData()
|
||||
|
||||
return () => {
|
||||
isMounted = false
|
||||
}
|
||||
}, [isOpen, asset, endpoint])
|
||||
|
||||
// Escape key handler
|
||||
useEffect(() => {
|
||||
if (!isOpen) return
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape' && !linking) {
|
||||
onClose()
|
||||
}
|
||||
}
|
||||
document.addEventListener('keydown', handleKeyDown)
|
||||
return () => {
|
||||
document.removeEventListener('keydown', handleKeyDown)
|
||||
}
|
||||
}, [isOpen, linking, onClose])
|
||||
|
||||
const handleConfirm = useCallback(async () => {
|
||||
if (!asset || !project || !selectedGuid || linking) return
|
||||
const targetOption = sequences.find(
|
||||
(opt) => normalizeGuid(opt.guid) === normalizeGuid(selectedGuid),
|
||||
)
|
||||
if (!targetOption) return
|
||||
|
||||
setLinking(true)
|
||||
try {
|
||||
// If sequence was linked to another asset, remove its previous link and markers first
|
||||
if (targetOption.currentLink && targetOption.currentLink.assetId !== asset.id) {
|
||||
await removeSequenceLink(project, targetOption.sequence)
|
||||
}
|
||||
|
||||
// 1. Fetch timecoded comments for this asset
|
||||
const comments = await fetchAssetComments(endpoint, apiKey, asset.id)
|
||||
|
||||
// 2. Prepare initial link metadata
|
||||
const prGuidStr = project.guid ? normalizeGuid(project.guid) : undefined
|
||||
const initialLink: LinkedSequenceAsset = {
|
||||
sequenceGuid: normalizeGuid(targetOption.guid),
|
||||
sequenceName: targetOption.name,
|
||||
assetId: asset.id,
|
||||
assetName: asset.name,
|
||||
assetThumbnailUrl: asset.preview?.thumbnailUrl,
|
||||
endpoint: endpoint.trim().replace(/\/+$/, ''),
|
||||
projectId: prGuidStr,
|
||||
syncedCommentIds:
|
||||
targetOption.currentLink?.assetId === asset.id
|
||||
? targetOption.currentLink.syncedCommentIds
|
||||
: [],
|
||||
syncedMarkerGuids:
|
||||
targetOption.currentLink?.assetId === asset.id
|
||||
? (targetOption.currentLink.syncedMarkerGuids || []).map(normalizeGuid)
|
||||
: [],
|
||||
lastSyncAt: Date.now(),
|
||||
totalCommentsSynced:
|
||||
targetOption.currentLink?.assetId === asset.id
|
||||
? targetOption.currentLink.totalCommentsSynced
|
||||
: 0,
|
||||
}
|
||||
|
||||
// 3. Translate comments to markers on the sequence
|
||||
const { updatedLink, addedCount } = await syncCommentsToSequence(
|
||||
project,
|
||||
targetOption.sequence,
|
||||
comments,
|
||||
initialLink,
|
||||
)
|
||||
|
||||
onLinkSuccess(updatedLink, addedCount)
|
||||
onClose()
|
||||
} catch (err) {
|
||||
console.error('[LinkSequenceDialog] Failed to link sequence:', err)
|
||||
setErrorMessage('Failed to link sequence and sync markers. Please try again.')
|
||||
} finally {
|
||||
setLinking(false)
|
||||
}
|
||||
}, [asset, project, selectedGuid, linking, sequences, endpoint, apiKey, onLinkSuccess, onClose])
|
||||
|
||||
if (!isOpen || !asset) return null
|
||||
|
||||
const selectedOption = sequences.find((opt) => opt.guid === selectedGuid)
|
||||
const isReplacingOtherAsset =
|
||||
selectedOption?.currentLink && selectedOption.currentLink.assetId !== asset.id
|
||||
|
||||
const effectiveSize = asset.sizeByte ?? asset.size
|
||||
const thumbUrl = resolveAssetUrl(asset.preview?.thumbnailUrl, endpoint)
|
||||
const duration = asset.preview?.duration ?? asset.media?.metadata?.duration
|
||||
const durationText = formatDuration(duration)
|
||||
|
||||
return (
|
||||
<div
|
||||
className="shumai-dialog-backdrop"
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget && !linking) {
|
||||
onClose()
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="shumai-dialog"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="link-dialog-title"
|
||||
>
|
||||
{/* Header */}
|
||||
<div className="shumai-dialog-header">
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<sp-icon-link size="s" style={{ marginRight: 6, color: '#3b82f6' }}></sp-icon-link>
|
||||
<span id="link-dialog-title" className="shumai-dialog-title">
|
||||
Link to Sequence
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="shumai-dialog-close"
|
||||
onClick={onClose}
|
||||
disabled={linking}
|
||||
title="Close dialog"
|
||||
aria-label="Close dialog"
|
||||
>
|
||||
<sp-icon-close size="s"></sp-icon-close>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Asset Info Card */}
|
||||
<div className="shumai-dialog-asset-info">
|
||||
<div className="shumai-dialog-thumb">
|
||||
{thumbUrl && !thumbError ? (
|
||||
<img src={thumbUrl} alt={asset.name} onError={() => setThumbError(true)} />
|
||||
) : asset.type === 'video' ? (
|
||||
<sp-icon-filmstrip size="xxl" style={{ color: '#60a5fa' }}></sp-icon-filmstrip>
|
||||
) : asset.type === 'audio' ? (
|
||||
<sp-icon-audio size="xxl" style={{ color: '#a78bfa' }}></sp-icon-audio>
|
||||
) : (
|
||||
<sp-icon-document size="xxl" style={{ color: '#999999' }}></sp-icon-document>
|
||||
)}
|
||||
</div>
|
||||
<div className="shumai-dialog-asset-meta">
|
||||
<span className="shumai-dialog-asset-name" title={asset.name}>
|
||||
{asset.name}
|
||||
</span>
|
||||
<span className="shumai-dialog-asset-details">
|
||||
{durationText ? `${durationText} • ` : ''}
|
||||
{effectiveSize ? `${formatBytes(effectiveSize)} • ` : ''}
|
||||
{asset.commentsCount != null && asset.commentsCount > 0
|
||||
? `${asset.commentsCount} comments`
|
||||
: 'No comments'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Dialog Body */}
|
||||
<div className="shumai-dialog-body">
|
||||
<div className="shumai-dialog-section-label">Select Sequence in Project</div>
|
||||
|
||||
{loadingSequences ? (
|
||||
<div className="shumai-dialog-loading">
|
||||
<ProgressCircle indeterminate size="s" label="Checking project sequences..." />
|
||||
<span>Checking project sequences...</span>
|
||||
</div>
|
||||
) : errorMessage ? (
|
||||
<div className="shumai-dialog-empty-proxies" style={{ color: '#f87171' }}>
|
||||
<span>{errorMessage}</span>
|
||||
</div>
|
||||
) : sequences.length > 0 ? (
|
||||
sequences.map((opt) => {
|
||||
const isSelected = selectedGuid === opt.guid
|
||||
const isLinkedToAnother = opt.currentLink && opt.currentLink.assetId !== asset.id
|
||||
const isLinkedToThis = opt.currentLink && opt.currentLink.assetId === asset.id
|
||||
|
||||
return (
|
||||
<div
|
||||
key={opt.guid}
|
||||
className={`shumai-option-card ${isSelected ? 'selected' : ''}`}
|
||||
onClick={() => !linking && setSelectedGuid(opt.guid)}
|
||||
role="radio"
|
||||
aria-checked={isSelected}
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
if (!linking) setSelectedGuid(opt.guid)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="shumai-option-left">
|
||||
<div className="shumai-option-texts">
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span className="shumai-option-title">{opt.name}</span>
|
||||
{opt.isActive && (
|
||||
<span
|
||||
style={{
|
||||
fontSize: '10px',
|
||||
marginLeft: 6,
|
||||
padding: '1px 5px',
|
||||
borderRadius: '3px',
|
||||
backgroundColor: 'rgba(59, 130, 246, 0.2)',
|
||||
color: '#60a5fa',
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
Active
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<span className="shumai-option-meta">
|
||||
{isLinkedToThis ? (
|
||||
<span style={{ color: '#34d399' }}>Already linked to this asset</span>
|
||||
) : isLinkedToAnother ? (
|
||||
<span style={{ color: '#fbbf24' }}>
|
||||
Linked to "{opt.currentLink?.assetName}" (will replace)
|
||||
</span>
|
||||
) : (
|
||||
'Ready to link'
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="shumai-option-radio">
|
||||
{isSelected && <div className="shumai-option-radio-dot" />}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
) : (
|
||||
<div className="shumai-dialog-empty-proxies">
|
||||
<span>No sequences available in current project.</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isReplacingOtherAsset && (
|
||||
<div
|
||||
style={{
|
||||
marginTop: 10,
|
||||
padding: '8px 10px',
|
||||
borderRadius: 4,
|
||||
backgroundColor: 'rgba(245, 158, 11, 0.12)',
|
||||
border: '1px solid rgba(245, 158, 11, 0.3)',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
fontSize: 11,
|
||||
color: '#fbbf24',
|
||||
}}
|
||||
>
|
||||
<sp-icon-alert-triangle
|
||||
size="s"
|
||||
style={{ marginRight: 6, flexShrink: 0 }}
|
||||
></sp-icon-alert-triangle>
|
||||
<span>
|
||||
This sequence is already linked to another asset. Proceeding will replace the link
|
||||
and sync markers for this asset.
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div style={{ marginTop: 12, fontSize: 11, color: 'var(--text-secondary)' }}>
|
||||
Comments with timestamps will be placed on the sequence timeline as markers. Markers
|
||||
deleted in Premiere Pro will not be re-synced.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Footer */}
|
||||
<div className="shumai-dialog-footer">
|
||||
<sp-button quiet variant="secondary" size="s" onClick={onClose} disabled={linking}>
|
||||
Cancel
|
||||
</sp-button>
|
||||
<sp-button
|
||||
variant="accent"
|
||||
size="s"
|
||||
onClick={handleConfirm}
|
||||
disabled={!selectedGuid || loadingSequences || Boolean(errorMessage) || linking}
|
||||
>
|
||||
{linking ? (
|
||||
<>
|
||||
<ProgressCircle indeterminate size="s" slot="icon" label="Linking..." />
|
||||
Linking...
|
||||
</>
|
||||
) : isReplacingOtherAsset ? (
|
||||
'Replace & Link'
|
||||
) : (
|
||||
'Link Sequence'
|
||||
)}
|
||||
</sp-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// @vitest-environment happy-dom
|
||||
import React from 'react'
|
||||
import { describe, it, expect, vi, afterEach } from 'vitest'
|
||||
import { render, screen, fireEvent, cleanup } from '@testing-library/react'
|
||||
import { NavigationTabs } from './NavigationTabs'
|
||||
|
||||
describe('NavigationTabs Component', () => {
|
||||
afterEach(() => {
|
||||
cleanup()
|
||||
})
|
||||
|
||||
it('renders Sequences and Browse tabs with badge', () => {
|
||||
const handleTabChange = vi.fn()
|
||||
render(<NavigationTabs activeTab="sequences" onTabChange={handleTabChange} linkedCount={3} />)
|
||||
|
||||
expect(screen.getByText('Sequences')).toBeDefined()
|
||||
expect(screen.getByText('Browse')).toBeDefined()
|
||||
expect(screen.getByText('3')).toBeDefined()
|
||||
})
|
||||
|
||||
it('handles tab click events', () => {
|
||||
const handleTabChange = vi.fn()
|
||||
render(<NavigationTabs activeTab="sequences" onTabChange={handleTabChange} linkedCount={0} />)
|
||||
|
||||
const browseTab = screen.getByText('Browse')
|
||||
fireEvent.click(browseTab)
|
||||
expect(handleTabChange).toHaveBeenCalledWith('browse')
|
||||
|
||||
const sequencesTab = screen.getByText('Sequences')
|
||||
fireEvent.click(sequencesTab)
|
||||
expect(handleTabChange).toHaveBeenCalledWith('sequences')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,44 @@
|
||||
import React from 'react'
|
||||
|
||||
export type MainTab = 'sequences' | 'browse'
|
||||
|
||||
export interface NavigationTabsProps {
|
||||
activeTab: MainTab
|
||||
onTabChange: (tab: MainTab) => void
|
||||
linkedCount?: number
|
||||
}
|
||||
|
||||
export const NavigationTabs: React.FC<NavigationTabsProps> = ({
|
||||
activeTab,
|
||||
onTabChange,
|
||||
linkedCount = 0,
|
||||
}) => {
|
||||
return (
|
||||
<div className="shumai-nav-tabs-bar" role="tablist">
|
||||
<sp-button
|
||||
size="s"
|
||||
variant={activeTab === 'sequences' ? 'accent' : 'secondary'}
|
||||
treatment="fill"
|
||||
onClick={() => onTabChange('sequences')}
|
||||
className={`shumai-tab-sp-btn ${activeTab === 'sequences' ? 'active' : ''}`}
|
||||
>
|
||||
<span className="shumai-tab-label">Sequences</span>
|
||||
{linkedCount > 0 && (
|
||||
<span className="shumai-tab-badge" title={`${linkedCount} linked sequence assets`}>
|
||||
{linkedCount}
|
||||
</span>
|
||||
)}
|
||||
</sp-button>
|
||||
|
||||
<sp-button
|
||||
size="s"
|
||||
variant={activeTab === 'browse' ? 'accent' : 'secondary'}
|
||||
treatment="fill"
|
||||
onClick={() => onTabChange('browse')}
|
||||
className={`shumai-tab-sp-btn ${activeTab === 'browse' ? 'active' : ''}`}
|
||||
>
|
||||
<span className="shumai-tab-label">Browse</span>
|
||||
</sp-button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import React, { useState } from 'react'
|
||||
import { formatDateAgo } from '../utils/date'
|
||||
import { resolveAssetUrl } from '../utils/url'
|
||||
import type { ProjectSummary } from '../views/ProjectsView'
|
||||
|
||||
interface ProjectCardProps {
|
||||
project: ProjectSummary
|
||||
endpoint?: string
|
||||
onClick: () => void
|
||||
}
|
||||
|
||||
export const ShumaiPolygonCover: React.FC = () => (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 180.95 164.7"
|
||||
preserveAspectRatio="xMidYMid slice"
|
||||
style={{ width: '100%', height: '100%', display: 'block' }}
|
||||
>
|
||||
<polygon fill="#FC9F8E" points="0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6" />
|
||||
<polygon fill="#FEBAB8" points="0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0" />
|
||||
<polyline
|
||||
fill="#FAA5A5"
|
||||
points="0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"
|
||||
/>
|
||||
<polygon fill="#EC5B6C" points="0 76.0 0 164.7 151.69 164.7" />
|
||||
<polygon fill="#E85C71" points="180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6" />
|
||||
<polygon
|
||||
fill="#C8405B"
|
||||
points="117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"
|
||||
/>
|
||||
<polygon fill="#FFCCBE" points="90.53 51.6 63.69 68.1 90.53 83.4" />
|
||||
<path
|
||||
fill="#FB9991"
|
||||
d="M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"
|
||||
/>
|
||||
<path
|
||||
fill="#FFEACD"
|
||||
d="M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"
|
||||
/>
|
||||
<polygon fill="#FFCFB5" points="64.02 99.3 90.53 114.9 90.53 83.4" />
|
||||
<path fill="#F67D73" d="M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z" />
|
||||
<path fill="#F26560" d="M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z" />
|
||||
<polygon fill="#EB5F5B" points="80.08 67.5 90.53 73.5 90.53 61.3" />
|
||||
<polygon fill="#DB4D50" points="90.53 61.3 90.53 73.5 100.87 67.4" />
|
||||
</svg>
|
||||
)
|
||||
|
||||
export const ProjectCard: React.FC<ProjectCardProps> = ({ project, endpoint, onClick }) => {
|
||||
const [imgError, setImgError] = useState(false)
|
||||
const updatedText = formatDateAgo(project.updatedAt)
|
||||
const coverUrl = resolveAssetUrl(project.coverImage, endpoint)
|
||||
|
||||
return (
|
||||
<div
|
||||
className="project-row-card"
|
||||
onClick={onClick}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
title={project.name}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
onClick()
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="project-row-preview">
|
||||
{coverUrl && !imgError ? (
|
||||
<img
|
||||
src={coverUrl}
|
||||
alt={project.name}
|
||||
className="project-row-img"
|
||||
onError={() => setImgError(true)}
|
||||
/>
|
||||
) : (
|
||||
<ShumaiPolygonCover />
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="project-row-content">
|
||||
<span className="project-row-title">{project.name}</span>
|
||||
<span className="project-row-subtext">
|
||||
{updatedText ? `Updated ${updatedText}` : 'Project'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import React from 'react'
|
||||
|
||||
export const ShumaiLogo: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
|
||||
return (
|
||||
<svg viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
||||
<defs>
|
||||
<clipPath id="bg-clip">
|
||||
<rect x="5" y="5" width="90" height="90" rx="22" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
|
||||
{/* Background */}
|
||||
<rect x="5" y="5" width="90" height="90" rx="22" fill="#D95A66" />
|
||||
|
||||
{/* Long Shadow */}
|
||||
<path
|
||||
d="M 35 75 L 65 75 L 80 60 L 75 30 L 175 130 L 135 175 Z"
|
||||
fill="#A8384D"
|
||||
clipPath="url(#bg-clip)"
|
||||
/>
|
||||
|
||||
{/* Left Cream */}
|
||||
<path d="M 25 30 Q 38 36 50 42 L 35 55 L 35 75 L 20 60 Z" fill="#FDF0D5" />
|
||||
|
||||
{/* Right Orange */}
|
||||
<path d="M 50 42 Q 62 36 75 30 L 80 60 L 65 75 L 65 55 Z" fill="#E77A65" />
|
||||
|
||||
{/* Front Peach */}
|
||||
<path d="M 35 75 L 65 75 L 65 55 L 50 42 L 35 55 Z" fill="#F5B895" />
|
||||
|
||||
{/* Top Pink */}
|
||||
<path d="M 50 42 Q 38 36 25 30 Q 38 26 50 20 Q 62 26 75 30 Q 62 36 50 42 Z" fill="#F4B8B8" />
|
||||
|
||||
{/* Hole Left */}
|
||||
<path d="M 50 25 L 42 30 L 50 35 Z" fill="#E57A5F" />
|
||||
|
||||
{/* Hole Right */}
|
||||
<path d="M 50 25 L 58 30 L 50 35 Z" fill="#C2523C" />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
+299
@@ -0,0 +1,299 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention -- Custom element tag names in IntrinsicElements require hyphens */
|
||||
declare module '@swc-uxp-wrappers/utils' {
|
||||
export const aliases: Record<string, string>
|
||||
}
|
||||
|
||||
type SpIconCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'
|
||||
slot?: string
|
||||
name?: string
|
||||
label?: string
|
||||
}
|
||||
|
||||
type SpButtonCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
HTMLButtonElement
|
||||
> & {
|
||||
variant?: 'accent' | 'primary' | 'secondary' | 'negative' | 'white' | 'black' | string
|
||||
treatment?: 'fill' | 'outline' | string
|
||||
quiet?: boolean
|
||||
size?: 'xs' | 's' | 'm' | 'l' | 'xl'
|
||||
label?: string
|
||||
'icon-only'?: boolean
|
||||
disabled?: boolean
|
||||
slot?: string
|
||||
}
|
||||
|
||||
type SpButtonGroupCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
vertical?: boolean
|
||||
size?: 'xs' | 's' | 'm' | 'l' | 'xl'
|
||||
}
|
||||
|
||||
type SpActionButtonCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
HTMLButtonElement
|
||||
> & {
|
||||
quiet?: boolean
|
||||
size?: 'xs' | 's' | 'm' | 'l' | 'xl'
|
||||
label?: string
|
||||
disabled?: boolean
|
||||
selected?: boolean
|
||||
toggles?: boolean
|
||||
emphasized?: boolean
|
||||
slot?: string
|
||||
}
|
||||
|
||||
type SpActionMenuCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
quiet?: boolean
|
||||
size?: 'xs' | 's' | 'm' | 'l' | 'xl'
|
||||
label?: string
|
||||
disabled?: boolean
|
||||
open?: boolean
|
||||
placement?:
|
||||
| 'top'
|
||||
| 'top-start'
|
||||
| 'top-end'
|
||||
| 'right'
|
||||
| 'right-start'
|
||||
| 'right-end'
|
||||
| 'bottom'
|
||||
| 'bottom-start'
|
||||
| 'bottom-end'
|
||||
| 'left'
|
||||
| 'left-start'
|
||||
| 'left-end'
|
||||
'force-popover'?: boolean
|
||||
selects?: 'single'
|
||||
value?: string
|
||||
slot?: string
|
||||
}
|
||||
|
||||
type SpMenuCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
slot?: string
|
||||
selects?: 'single' | 'multiple' | 'inherit'
|
||||
label?: string
|
||||
}
|
||||
|
||||
type SpMenuItemCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
disabled?: boolean
|
||||
selected?: boolean
|
||||
value?: string
|
||||
slot?: string
|
||||
}
|
||||
|
||||
type SpMenuDividerCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
size?: 's' | 'm' | 'l'
|
||||
}
|
||||
|
||||
type SpMenuGroupCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
slot?: string
|
||||
}
|
||||
|
||||
type SpStatusLightCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
variant?:
|
||||
| 'negative'
|
||||
| 'notice'
|
||||
| 'positive'
|
||||
| 'info'
|
||||
| 'neutral'
|
||||
| 'yellow'
|
||||
| 'fuchsia'
|
||||
| 'indigo'
|
||||
| 'seafoam'
|
||||
| 'chartreuse'
|
||||
| 'magenta'
|
||||
| 'celery'
|
||||
| 'purple'
|
||||
| string
|
||||
disabled?: boolean
|
||||
slot?: string
|
||||
}
|
||||
|
||||
type SpProgressCircleCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
size?: 's' | 'm' | 'l'
|
||||
indeterminate?: boolean
|
||||
label?: string
|
||||
slot?: string
|
||||
'static-color'?: 'white' | string
|
||||
}
|
||||
|
||||
type SpTopNavCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
selected?: string
|
||||
quiet?: boolean
|
||||
compact?: boolean
|
||||
label?: string
|
||||
}
|
||||
|
||||
type SpTopNavItemCustomElementProps = import('react').DetailedHTMLProps<
|
||||
import('react').HTMLAttributes<HTMLElement>,
|
||||
HTMLElement
|
||||
> & {
|
||||
value?: string
|
||||
selected?: boolean
|
||||
href?: string
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
declare namespace React {
|
||||
namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
'sp-icon': SpIconCustomElementProps
|
||||
'sp-icon-refresh': SpIconCustomElementProps
|
||||
'sp-icon-chevron-down': SpIconCustomElementProps
|
||||
'sp-icon-chevron-right': SpIconCustomElementProps
|
||||
'sp-icon-log-out': SpIconCustomElementProps
|
||||
'sp-icon-arrow-right': SpIconCustomElementProps
|
||||
'sp-icon-filmstrip': SpIconCustomElementProps
|
||||
'sp-icon-folder': SpIconCustomElementProps
|
||||
'sp-icon-folder-open': SpIconCustomElementProps
|
||||
'sp-icon-audio': SpIconCustomElementProps
|
||||
'sp-icon-image': SpIconCustomElementProps
|
||||
'sp-icon-document': SpIconCustomElementProps
|
||||
'sp-icon-link': SpIconCustomElementProps
|
||||
'sp-icon-unlink': SpIconCustomElementProps
|
||||
'sp-icon-link-out': SpIconCustomElementProps
|
||||
'sp-icon-download': SpIconCustomElementProps
|
||||
'sp-icon-briefcase': SpIconCustomElementProps
|
||||
'sp-icon-alert-circle': SpIconCustomElementProps
|
||||
'sp-icon-alert-triangle': SpIconCustomElementProps
|
||||
'sp-icon-checkmark-circle': SpIconCustomElementProps
|
||||
'sp-icon-close': SpIconCustomElementProps
|
||||
'sp-icon-movie-camera': SpIconCustomElementProps
|
||||
'sp-icon-video-filled': SpIconCustomElementProps
|
||||
'sp-button': SpButtonCustomElementProps
|
||||
'sp-button-group': SpButtonGroupCustomElementProps
|
||||
'sp-action-button': SpActionButtonCustomElementProps
|
||||
'sp-action-menu': SpActionMenuCustomElementProps
|
||||
'sp-menu': SpMenuCustomElementProps
|
||||
'sp-menu-item': SpMenuItemCustomElementProps
|
||||
'sp-menu-divider': SpMenuDividerCustomElementProps
|
||||
'sp-menu-group': SpMenuGroupCustomElementProps
|
||||
'sp-status-light': SpStatusLightCustomElementProps
|
||||
'sp-progress-circle': SpProgressCircleCustomElementProps
|
||||
'sp-top-nav': SpTopNavCustomElementProps
|
||||
'sp-top-nav-item': SpTopNavItemCustomElementProps
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
'sp-icon': SpIconCustomElementProps
|
||||
'sp-icon-refresh': SpIconCustomElementProps
|
||||
'sp-icon-chevron-down': SpIconCustomElementProps
|
||||
'sp-icon-chevron-right': SpIconCustomElementProps
|
||||
'sp-icon-log-out': SpIconCustomElementProps
|
||||
'sp-icon-arrow-right': SpIconCustomElementProps
|
||||
'sp-icon-filmstrip': SpIconCustomElementProps
|
||||
'sp-icon-folder': SpIconCustomElementProps
|
||||
'sp-icon-folder-open': SpIconCustomElementProps
|
||||
'sp-icon-audio': SpIconCustomElementProps
|
||||
'sp-icon-image': SpIconCustomElementProps
|
||||
'sp-icon-document': SpIconCustomElementProps
|
||||
'sp-icon-link': SpIconCustomElementProps
|
||||
'sp-icon-unlink': SpIconCustomElementProps
|
||||
'sp-icon-link-out': SpIconCustomElementProps
|
||||
'sp-icon-download': SpIconCustomElementProps
|
||||
'sp-icon-briefcase': SpIconCustomElementProps
|
||||
'sp-icon-alert-circle': SpIconCustomElementProps
|
||||
'sp-icon-alert-triangle': SpIconCustomElementProps
|
||||
'sp-icon-checkmark-circle': SpIconCustomElementProps
|
||||
'sp-icon-close': SpIconCustomElementProps
|
||||
'sp-icon-movie-camera': SpIconCustomElementProps
|
||||
'sp-icon-video-filled': SpIconCustomElementProps
|
||||
'sp-button': SpButtonCustomElementProps
|
||||
'sp-button-group': SpButtonGroupCustomElementProps
|
||||
'sp-action-button': SpActionButtonCustomElementProps
|
||||
'sp-action-menu': SpActionMenuCustomElementProps
|
||||
'sp-menu': SpMenuCustomElementProps
|
||||
'sp-menu-item': SpMenuItemCustomElementProps
|
||||
'sp-menu-divider': SpMenuDividerCustomElementProps
|
||||
'sp-menu-group': SpMenuGroupCustomElementProps
|
||||
'sp-status-light': SpStatusLightCustomElementProps
|
||||
'sp-progress-circle': SpProgressCircleCustomElementProps
|
||||
'sp-top-nav': SpTopNavCustomElementProps
|
||||
'sp-top-nav-item': SpTopNavItemCustomElementProps
|
||||
}
|
||||
}
|
||||
|
||||
type UxpEntry = UxpFileEntry | UxpFolderEntry
|
||||
|
||||
interface UxpFileEntry {
|
||||
readonly isFile: true
|
||||
readonly isFolder: false
|
||||
readonly name: string
|
||||
readonly nativePath: string
|
||||
write(data: ArrayBuffer | string, options?: { format?: unknown; append?: boolean }): Promise<void>
|
||||
}
|
||||
|
||||
interface UxpFolderEntry {
|
||||
readonly isFile: false
|
||||
readonly isFolder: true
|
||||
readonly name: string
|
||||
readonly nativePath: string
|
||||
createFile(name: string, options?: { overwrite?: boolean }): Promise<UxpFileEntry>
|
||||
getEntries(): Promise<UxpEntry[]>
|
||||
getFiles?(): Promise<UxpFileEntry[]>
|
||||
}
|
||||
|
||||
interface UxpLocalFileSystem {
|
||||
getFileForSaving(
|
||||
defaultName?: string,
|
||||
options?: { types?: string[] },
|
||||
): Promise<UxpFileEntry | null>
|
||||
getFileForOpening(options?: {
|
||||
allowMultiple?: boolean
|
||||
types?: string[]
|
||||
}): Promise<UxpFileEntry | UxpFileEntry[] | null>
|
||||
getFolder(): Promise<UxpFolderEntry | null>
|
||||
getTemporaryFolder(): Promise<UxpFolderEntry>
|
||||
getDataFolder(): Promise<UxpFolderEntry>
|
||||
getPluginFolder(): Promise<UxpFolderEntry>
|
||||
}
|
||||
|
||||
interface UxpStorageFormats {
|
||||
readonly binary: unknown
|
||||
readonly utf8: unknown
|
||||
}
|
||||
|
||||
interface UxpModule {
|
||||
storage: {
|
||||
localFileSystem: UxpLocalFileSystem
|
||||
formats: UxpStorageFormats
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'uxp' {
|
||||
const uxp: UxpModule
|
||||
export = uxp
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import './polyfills'
|
||||
import React from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { Theme } from '@swc-react/theme'
|
||||
import '@spectrum-web-components/theme/theme-dark.js'
|
||||
import '@spectrum-web-components/theme/theme-darkest.js'
|
||||
import '@spectrum-web-components/theme/theme-light.js'
|
||||
import '@spectrum-web-components/theme/scale-medium.js'
|
||||
import '@swc-uxp-wrappers/button/sp-button.js'
|
||||
import '@swc-uxp-wrappers/action-button/sp-action-button.js'
|
||||
import '@swc-uxp-wrappers/menu/sp-menu.js'
|
||||
import '@swc-uxp-wrappers/menu/sp-menu-item.js'
|
||||
import '@swc-uxp-wrappers/menu/sp-menu-divider.js'
|
||||
import '@swc-uxp-wrappers/menu/sp-menu-group.js'
|
||||
import '@swc-uxp-wrappers/popover/sp-popover.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-refresh.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-chevron-down.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-chevron-right.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-log-out.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-arrow-right.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-filmstrip.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-folder.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-folder-open.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-audio.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-image.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-document.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-link.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-unlink.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-link-out.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-download.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-briefcase.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-alert-circle.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-alert-triangle.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-checkmark-circle.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-close.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-movie-camera.js'
|
||||
import '@spectrum-web-components/icons-workflow/icons/sp-icon-video-filled.js'
|
||||
import { App } from './App'
|
||||
|
||||
const container = document.getElementById('root')
|
||||
if (container) {
|
||||
const root = createRoot(container)
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<Theme theme="spectrum" scale="medium" color="dark">
|
||||
<App />
|
||||
</Theme>
|
||||
</React.StrictMode>,
|
||||
)
|
||||
} else {
|
||||
console.error('Failed to find root container element')
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// @vitest-environment happy-dom
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import './polyfills'
|
||||
|
||||
describe('polyfills', () => {
|
||||
it('defines window.matchMedia polyfill when missing', () => {
|
||||
expect(typeof window.matchMedia).toBe('function')
|
||||
const mql = window.matchMedia('(prefers-color-scheme: dark)')
|
||||
expect(mql).toBeDefined()
|
||||
expect(mql.matches).toBe(false)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,31 @@
|
||||
// Guard against duplicate custom element registrations during UXP development and plugin reload
|
||||
if (typeof window !== 'undefined' && window.customElements) {
|
||||
const origDefine = window.customElements.define.bind(window.customElements)
|
||||
window.customElements.define = (
|
||||
name: string,
|
||||
constructor: CustomElementConstructor,
|
||||
options?: ElementDefinitionOptions,
|
||||
) => {
|
||||
if (window.customElements.get(name)) {
|
||||
return
|
||||
}
|
||||
origDefine(name, constructor, options)
|
||||
}
|
||||
}
|
||||
|
||||
// Polyfill window.matchMedia for Adobe UXP environment
|
||||
if (typeof window !== 'undefined' && typeof window.matchMedia !== 'function') {
|
||||
window.matchMedia = (query: string): MediaQueryList => {
|
||||
const mql: MediaQueryList = {
|
||||
matches: false,
|
||||
media: query,
|
||||
onchange: null,
|
||||
addListener: () => {},
|
||||
removeListener: () => {},
|
||||
addEventListener: () => {},
|
||||
removeEventListener: () => {},
|
||||
dispatchEvent: () => false,
|
||||
}
|
||||
return mql
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
||||
import { autoSyncService } from './autoSyncService'
|
||||
import type { Project, Sequence } from '@adobe/premierepro'
|
||||
import type { CommentInfo } from '@shumai/dtos'
|
||||
import * as premiereService from './premiere'
|
||||
import * as linkStorage from './linkStorage'
|
||||
import * as markersService from './markers'
|
||||
|
||||
describe('autoSyncService', () => {
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers()
|
||||
vi.restoreAllMocks()
|
||||
autoSyncService.stop()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
autoSyncService.stop()
|
||||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
it('starts and stops background interval without throwing', () => {
|
||||
autoSyncService.start('https://api.shumai.test', 'test-key')
|
||||
expect(autoSyncService['timer']).not.toBeNull()
|
||||
|
||||
autoSyncService.stop()
|
||||
expect(autoSyncService['timer']).toBeNull()
|
||||
})
|
||||
|
||||
it('syncs all linked sequences on triggerImmediateSync', async () => {
|
||||
const mockSeq = { guid: 'seq-1', name: 'Seq 1' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
const mockLink = {
|
||||
sequenceGuid: 'seq-1',
|
||||
sequenceName: 'Seq 1',
|
||||
assetId: 'asset-1',
|
||||
assetName: 'video.mp4',
|
||||
syncedCommentIds: [],
|
||||
lastSyncAt: 0,
|
||||
totalCommentsSynced: 0,
|
||||
}
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([mockSeq as unknown as Sequence])
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([mockLink])
|
||||
vi.spyOn(markersService, 'fetchAssetComments').mockResolvedValue([
|
||||
{ id: 'comm-1', second: 5, message: 'hello' } as unknown as CommentInfo,
|
||||
])
|
||||
vi.spyOn(markersService, 'syncCommentsToSequence').mockResolvedValue({
|
||||
updatedLink: { ...mockLink, syncedCommentIds: ['comm-1'] },
|
||||
addedCount: 1,
|
||||
})
|
||||
|
||||
autoSyncService.start('https://api.shumai.test', 'test-key')
|
||||
await autoSyncService.triggerImmediateSync()
|
||||
|
||||
expect(markersService.fetchAssetComments).toHaveBeenCalledWith(
|
||||
'https://api.shumai.test',
|
||||
'test-key',
|
||||
'asset-1',
|
||||
)
|
||||
expect(markersService.syncCommentsToSequence).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('normalizes sequence GUIDs with braces and uppercase when matching against linked sequences', async () => {
|
||||
const mockSeq = { guid: '{B991F605-7BD7-4028-B05F-0BC36B66CD0A}', name: 'Seq Braced' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
const mockLink = {
|
||||
sequenceGuid: 'b991f605-7bd7-4028-b05f-0bc36b66cd0a',
|
||||
sequenceName: 'Seq Braced',
|
||||
assetId: 'asset-99',
|
||||
assetName: 'video.mp4',
|
||||
syncedCommentIds: [],
|
||||
lastSyncAt: 0,
|
||||
totalCommentsSynced: 0,
|
||||
}
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([mockSeq as unknown as Sequence])
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([mockLink])
|
||||
vi.spyOn(markersService, 'fetchAssetComments').mockResolvedValue([
|
||||
{ id: 'comm-1', second: 1, message: 'braced guid comment' } as unknown as CommentInfo,
|
||||
])
|
||||
vi.spyOn(markersService, 'syncCommentsToSequence').mockResolvedValue({
|
||||
updatedLink: { ...mockLink, syncedCommentIds: ['comm-1'] },
|
||||
addedCount: 1,
|
||||
})
|
||||
|
||||
autoSyncService.start('https://api.shumai.test', 'test-key')
|
||||
await autoSyncService.triggerImmediateSync()
|
||||
|
||||
expect(markersService.fetchAssetComments).toHaveBeenCalledWith(
|
||||
'https://api.shumai.test',
|
||||
'test-key',
|
||||
'asset-99',
|
||||
)
|
||||
expect(markersService.syncCommentsToSequence).toHaveBeenCalledWith(
|
||||
mockProject,
|
||||
mockSeq,
|
||||
expect.any(Array),
|
||||
mockLink,
|
||||
)
|
||||
})
|
||||
|
||||
it('skips linked sequences configured for a different server endpoint', async () => {
|
||||
const mockSeq1 = { guid: 'seq-foreign', name: 'Seq Foreign' }
|
||||
const mockSeq2 = { guid: 'seq-local', name: 'Seq Local' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
|
||||
const foreignLink = {
|
||||
sequenceGuid: 'seq-foreign',
|
||||
sequenceName: 'Seq Foreign',
|
||||
assetId: 'asset-foreign',
|
||||
assetName: 'foreign.mp4',
|
||||
endpoint: 'http://localhost:3000',
|
||||
syncedCommentIds: [],
|
||||
lastSyncAt: 0,
|
||||
totalCommentsSynced: 0,
|
||||
}
|
||||
|
||||
const sameLink = {
|
||||
sequenceGuid: 'seq-local',
|
||||
sequenceName: 'Seq Local',
|
||||
assetId: 'asset-local',
|
||||
assetName: 'local.mp4',
|
||||
endpoint: 'https://staging.shumai.one/', // trailing slash variation
|
||||
syncedCommentIds: [],
|
||||
lastSyncAt: 0,
|
||||
totalCommentsSynced: 0,
|
||||
}
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([
|
||||
mockSeq1 as unknown as Sequence,
|
||||
mockSeq2 as unknown as Sequence,
|
||||
])
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([foreignLink, sameLink])
|
||||
vi.spyOn(markersService, 'fetchAssetComments').mockResolvedValue([
|
||||
{ id: 'comm-1', second: 2, message: 'comment' } as unknown as CommentInfo,
|
||||
])
|
||||
vi.spyOn(markersService, 'syncCommentsToSequence').mockResolvedValue({
|
||||
updatedLink: { ...sameLink, syncedCommentIds: ['comm-1'] },
|
||||
addedCount: 1,
|
||||
})
|
||||
|
||||
autoSyncService.start('https://staging.shumai.one', 'test-key')
|
||||
await autoSyncService.triggerImmediateSync()
|
||||
|
||||
// Foreign link should be skipped
|
||||
expect(markersService.fetchAssetComments).not.toHaveBeenCalledWith(
|
||||
expect.anything(),
|
||||
expect.anything(),
|
||||
'asset-foreign',
|
||||
)
|
||||
|
||||
// Matching link should be synced
|
||||
expect(markersService.fetchAssetComments).toHaveBeenCalledWith(
|
||||
'https://staging.shumai.one',
|
||||
'test-key',
|
||||
'asset-local',
|
||||
)
|
||||
expect(markersService.syncCommentsToSequence).toHaveBeenCalledWith(
|
||||
mockProject,
|
||||
mockSeq2,
|
||||
expect.any(Array),
|
||||
sameLink,
|
||||
)
|
||||
})
|
||||
|
||||
it('aborts syncing when stop() is called and credentials are reset', async () => {
|
||||
const fetchSpy = vi.spyOn(markersService, 'fetchAssetComments')
|
||||
autoSyncService.start('https://api.shumai.test', 'test-key')
|
||||
autoSyncService.stop()
|
||||
await autoSyncService.triggerImmediateSync()
|
||||
expect(fetchSpy).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,175 @@
|
||||
import type { Sequence } from '@adobe/premierepro'
|
||||
import { getActiveProject, getAllSequences, getPremiereModule } from './premiere'
|
||||
import { getAllLinkedSequences, normalizeGuid } from './linkStorage'
|
||||
import { fetchAssetComments, syncCommentsToSequence } from './markers'
|
||||
import { isSameEndpoint } from '../utils/url'
|
||||
|
||||
const SYNC_INTERVAL_MS = 12000 // 12 seconds
|
||||
|
||||
class AutoSyncService {
|
||||
private timer: ReturnType<typeof setInterval> | null = null
|
||||
private endpoint = ''
|
||||
private apiKey = ''
|
||||
private cleanupListeners: (() => void) | null = null
|
||||
private syncPromise: Promise<void> | null = null
|
||||
|
||||
/**
|
||||
* Starts the background auto-sync loop.
|
||||
*/
|
||||
start(endpoint: string, apiKey: string): void {
|
||||
this.stop()
|
||||
this.endpoint = endpoint
|
||||
this.apiKey = apiKey
|
||||
|
||||
if (!endpoint || !apiKey) return
|
||||
|
||||
// Setup background interval
|
||||
this.timer = setInterval(() => {
|
||||
void this.syncAllLinkedSequences()
|
||||
}, SYNC_INTERVAL_MS)
|
||||
|
||||
// Setup host and window event listeners
|
||||
this.setupListeners()
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the background auto-sync loop and tears down listeners.
|
||||
*/
|
||||
stop(): void {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
}
|
||||
if (this.cleanupListeners) {
|
||||
this.cleanupListeners()
|
||||
this.cleanupListeners = null
|
||||
}
|
||||
this.endpoint = ''
|
||||
this.apiKey = ''
|
||||
this.syncPromise = null
|
||||
}
|
||||
|
||||
/**
|
||||
* Forces an immediate synchronization cycle.
|
||||
*/
|
||||
async triggerImmediateSync(): Promise<void> {
|
||||
if (this.syncPromise) {
|
||||
await this.syncPromise
|
||||
}
|
||||
await this.syncAllLinkedSequences()
|
||||
}
|
||||
|
||||
private setupListeners(): void {
|
||||
const onFocus = () => {
|
||||
void this.triggerImmediateSync()
|
||||
}
|
||||
const onVisibilityChange = () => {
|
||||
if (typeof document !== 'undefined' && document.visibilityState === 'visible') {
|
||||
void this.triggerImmediateSync()
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
window.addEventListener('focus', onFocus)
|
||||
}
|
||||
if (typeof document !== 'undefined') {
|
||||
document.addEventListener('visibilitychange', onVisibilityChange)
|
||||
}
|
||||
|
||||
// Premiere Pro Sequence Activated listener
|
||||
const ppro = getPremiereModule()
|
||||
let hasSeqListener = false
|
||||
const onSequenceActivated = () => {
|
||||
void this.triggerImmediateSync()
|
||||
}
|
||||
|
||||
if (ppro?.EventManager && ppro.Constants?.SequenceEvent?.ACTIVATED) {
|
||||
try {
|
||||
ppro.EventManager.addGlobalEventListener(
|
||||
ppro.Constants.SequenceEvent.ACTIVATED,
|
||||
onSequenceActivated,
|
||||
)
|
||||
hasSeqListener = true
|
||||
} catch (err) {
|
||||
console.warn('[autoSyncService] Could not register SequenceEvent listener:', err)
|
||||
}
|
||||
}
|
||||
|
||||
this.cleanupListeners = () => {
|
||||
if (typeof window !== 'undefined') {
|
||||
window.removeEventListener('focus', onFocus)
|
||||
}
|
||||
if (typeof document !== 'undefined') {
|
||||
document.removeEventListener('visibilitychange', onVisibilityChange)
|
||||
}
|
||||
if (hasSeqListener && ppro?.EventManager && ppro.Constants?.SequenceEvent?.ACTIVATED) {
|
||||
try {
|
||||
ppro.EventManager.removeGlobalEventListener(
|
||||
ppro.Constants.SequenceEvent.ACTIVATED,
|
||||
onSequenceActivated,
|
||||
)
|
||||
} catch {
|
||||
// Ignore error during cleanup
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async syncAllLinkedSequences(): Promise<void> {
|
||||
if (this.syncPromise) {
|
||||
return this.syncPromise
|
||||
}
|
||||
const currentEndpoint = this.endpoint
|
||||
const currentApiKey = this.apiKey
|
||||
if (!currentEndpoint || !currentApiKey) return
|
||||
|
||||
this.syncPromise = (async () => {
|
||||
try {
|
||||
const project = await getActiveProject()
|
||||
if (!project || this.endpoint !== currentEndpoint || this.apiKey !== currentApiKey) return
|
||||
|
||||
const allSeqs = await getAllSequences(project)
|
||||
if (!allSeqs || allSeqs.length === 0 || this.endpoint !== currentEndpoint) return
|
||||
|
||||
const linkedItems = await getAllLinkedSequences(project, allSeqs)
|
||||
if (!linkedItems || linkedItems.length === 0 || this.endpoint !== currentEndpoint) return
|
||||
|
||||
const seqsMap = new Map<string, Sequence>()
|
||||
for (const s of allSeqs) {
|
||||
const normGuid = normalizeGuid(s.guid)
|
||||
if (normGuid) {
|
||||
seqsMap.set(normGuid, s)
|
||||
}
|
||||
}
|
||||
|
||||
for (const link of linkedItems) {
|
||||
if (this.endpoint !== currentEndpoint || this.apiKey !== currentApiKey) break
|
||||
|
||||
// Skip links created against a different server endpoint
|
||||
if (link.endpoint && !isSameEndpoint(link.endpoint, currentEndpoint)) {
|
||||
continue
|
||||
}
|
||||
|
||||
const targetSeq = seqsMap.get(normalizeGuid(link.sequenceGuid))
|
||||
if (!targetSeq) continue
|
||||
|
||||
try {
|
||||
const comments = await fetchAssetComments(currentEndpoint, currentApiKey, link.assetId)
|
||||
if (this.endpoint !== currentEndpoint) break
|
||||
await syncCommentsToSequence(project, targetSeq, comments, link)
|
||||
} catch (itemErr) {
|
||||
console.error(`[autoSyncService] Error syncing sequence ${link.sequenceName}:`, itemErr)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[autoSyncService] Sync cycle failed:', err)
|
||||
} finally {
|
||||
this.syncPromise = null
|
||||
}
|
||||
})()
|
||||
|
||||
return this.syncPromise
|
||||
}
|
||||
}
|
||||
|
||||
export const autoSyncService = new AutoSyncService()
|
||||
@@ -0,0 +1,124 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { fetchAssetComments, formatCommentBody } from './commentUtils'
|
||||
import * as clientModule from '../api/client'
|
||||
import type { CommentInfo } from '@shumai/dtos'
|
||||
|
||||
describe('commentUtils', () => {
|
||||
beforeEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
describe('fetchAssetComments', () => {
|
||||
it('returns comments array when response is ok', async () => {
|
||||
const mockComments: Partial<CommentInfo>[] = [
|
||||
{ id: 'c1', message: 'First comment', second: 12 },
|
||||
{ id: 'c2', message: 'Second comment', second: 45 },
|
||||
]
|
||||
|
||||
const mockGet = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({ data: mockComments }),
|
||||
})
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
':fileId': {
|
||||
comments: {
|
||||
$get: mockGet,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const result = await fetchAssetComments('https://api.shumai.test', 'test-key', 'asset-1')
|
||||
|
||||
expect(mockGet).toHaveBeenCalledWith({
|
||||
param: { fileId: 'asset-1' },
|
||||
query: { first: '100' },
|
||||
})
|
||||
expect(result).toEqual(mockComments)
|
||||
})
|
||||
|
||||
it('throws error with message from server response when res.ok is false', async () => {
|
||||
const mockGet = vi.fn().mockResolvedValue({
|
||||
ok: false,
|
||||
status: 404,
|
||||
json: async () => ({ error: 'Asset not found on this server' }),
|
||||
})
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
':fileId': {
|
||||
comments: {
|
||||
$get: mockGet,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
await expect(
|
||||
fetchAssetComments('https://api.shumai.test', 'test-key', 'asset-missing'),
|
||||
).rejects.toThrow('Asset not found on this server')
|
||||
})
|
||||
|
||||
it('throws fallback HTTP status error when res.ok is false and response has no error field', async () => {
|
||||
const mockGet = vi.fn().mockResolvedValue({
|
||||
ok: false,
|
||||
status: 500,
|
||||
json: async () => {
|
||||
throw new Error('Invalid JSON')
|
||||
},
|
||||
})
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
':fileId': {
|
||||
comments: {
|
||||
$get: mockGet,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
await expect(
|
||||
fetchAssetComments('https://api.shumai.test', 'test-key', 'asset-crash'),
|
||||
).rejects.toThrow('Failed to fetch comments (HTTP 500)')
|
||||
})
|
||||
})
|
||||
|
||||
describe('formatCommentBody', () => {
|
||||
it('formats single comment without replies', () => {
|
||||
const comment = {
|
||||
message: 'Review cut at 01:23',
|
||||
replies: [],
|
||||
} as unknown as CommentInfo
|
||||
|
||||
expect(formatCommentBody(comment)).toBe('Review cut at 01:23')
|
||||
})
|
||||
|
||||
it('formats comment with nested replies and authors', () => {
|
||||
const comment = {
|
||||
message: 'Needs color correction',
|
||||
replies: [
|
||||
{ creator: { name: 'Alice' }, message: 'Applied LUT' },
|
||||
{ creator: { name: 'Bob' }, message: 'Looks better' },
|
||||
],
|
||||
} as unknown as CommentInfo
|
||||
|
||||
const result = formatCommentBody(comment)
|
||||
expect(result).toContain('Needs color correction')
|
||||
expect(result).toContain('--- Replies ---')
|
||||
expect(result).toContain('Alice: Applied LUT')
|
||||
expect(result).toContain('Bob: Looks better')
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { CommentInfo } from '@shumai/dtos'
|
||||
import { getShumaiClient } from '../api/client'
|
||||
|
||||
/**
|
||||
* Fetches timecoded comments for an asset from Shumai.
|
||||
*/
|
||||
export async function fetchAssetComments(
|
||||
endpoint: string,
|
||||
apiKey: string,
|
||||
assetId: string,
|
||||
): Promise<CommentInfo[]> {
|
||||
const client = getShumaiClient(endpoint, apiKey)
|
||||
const res = await client.api.files[':fileId'].comments.$get({
|
||||
param: { fileId: assetId },
|
||||
query: { first: '100' },
|
||||
})
|
||||
|
||||
if (!res.ok) {
|
||||
const errData = (await res.json().catch(() => ({}))) as { error?: string }
|
||||
throw new Error(errData.error || `Failed to fetch comments (HTTP ${res.status})`)
|
||||
}
|
||||
|
||||
const data = await res.json()
|
||||
return (data?.data as CommentInfo[]) || []
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a Shumai comment into marker text including any threaded replies.
|
||||
*/
|
||||
export function formatCommentBody(comment: CommentInfo): string {
|
||||
let body = comment.message || ''
|
||||
|
||||
if (comment.replies && comment.replies.length > 0) {
|
||||
body += '\n\n--- Replies ---'
|
||||
for (const reply of comment.replies) {
|
||||
const author = reply.creator?.name || 'User'
|
||||
const replyMsg = reply.message || ''
|
||||
body += `\n${author}: ${replyMsg}`
|
||||
}
|
||||
}
|
||||
|
||||
return body
|
||||
}
|
||||
@@ -0,0 +1,619 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import {
|
||||
formatResolutionLabel,
|
||||
getResolutionRank,
|
||||
resolveRawDownloadUrl,
|
||||
fetchVideoProxies,
|
||||
getUniqueFileName,
|
||||
getFolderEntryNames,
|
||||
createUniqueFileInFolder,
|
||||
importAssetIntoPremiere,
|
||||
} from './import'
|
||||
import * as premiereModule from './premiere'
|
||||
import * as clientModule from '../api/client'
|
||||
import type { AssetSummary } from '../components/FileItem'
|
||||
|
||||
describe('import service', () => {
|
||||
beforeEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
describe('formatResolutionLabel', () => {
|
||||
it('formats given resolution strings', () => {
|
||||
expect(formatResolutionLabel(undefined, undefined, '1080p')).toBe('1080p (MP4)')
|
||||
expect(formatResolutionLabel(undefined, undefined, '720')).toBe('720p (MP4)')
|
||||
})
|
||||
|
||||
it('formats given height numbers', () => {
|
||||
expect(formatResolutionLabel(1920, 1080)).toBe('1080p (MP4)')
|
||||
expect(formatResolutionLabel(1280, 720)).toBe('720p (MP4)')
|
||||
})
|
||||
|
||||
it('formats by width if height is missing', () => {
|
||||
expect(formatResolutionLabel(1920, undefined)).toBe('1080p (MP4)')
|
||||
expect(formatResolutionLabel(1280, undefined)).toBe('720p (MP4)')
|
||||
expect(formatResolutionLabel(3840, undefined)).toBe('2160p (MP4)')
|
||||
})
|
||||
|
||||
it('falls back to Proxy (MP4)', () => {
|
||||
expect(formatResolutionLabel(undefined, undefined)).toBe('Proxy (MP4)')
|
||||
})
|
||||
})
|
||||
|
||||
describe('getResolutionRank', () => {
|
||||
it('extracts resolution numeric rank', () => {
|
||||
expect(getResolutionRank('1080p (MP4)')).toBe(1080)
|
||||
expect(getResolutionRank('720p (MP4)')).toBe(720)
|
||||
expect(getResolutionRank('Proxy (MP4)')).toBe(0)
|
||||
})
|
||||
})
|
||||
|
||||
describe('resolveRawDownloadUrl', () => {
|
||||
it('resolves directly via download-url when original key is in knownAsset', async () => {
|
||||
const mockDownloadUrlPost = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({ url: 'https://s3.example.com/direct-raw.mp4' }),
|
||||
})
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
'download-url': {
|
||||
$post: mockDownloadUrlPost,
|
||||
},
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const knownAsset: AssetSummary = {
|
||||
id: 'file-1',
|
||||
name: 'direct-raw.mp4',
|
||||
type: 'file',
|
||||
media: {
|
||||
original: {
|
||||
key: 'files/test/direct-raw.mp4',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const result = await resolveRawDownloadUrl('http://test', 'key', 'file-1', knownAsset)
|
||||
expect(result.url).toBe('https://s3.example.com/direct-raw.mp4')
|
||||
expect(result.name).toBe('direct-raw.mp4')
|
||||
expect(mockDownloadUrlPost).toHaveBeenCalledWith({
|
||||
json: { key: 'files/test/direct-raw.mp4', assetId: 'file-1' },
|
||||
})
|
||||
})
|
||||
|
||||
it('resolves via GET :fileId and download-url when not in knownAsset', async () => {
|
||||
const mockGet = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
id: 'file-1',
|
||||
name: 'remote-video.mp4',
|
||||
media: {
|
||||
original: {
|
||||
key: 'files/remote/video.mp4',
|
||||
},
|
||||
},
|
||||
}),
|
||||
})
|
||||
const mockDownloadUrlPost = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({ url: 'https://s3.example.com/presigned-remote.mp4' }),
|
||||
})
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
':fileId': {
|
||||
$get: mockGet,
|
||||
},
|
||||
'download-url': {
|
||||
$post: mockDownloadUrlPost,
|
||||
},
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const result = await resolveRawDownloadUrl('http://test', 'key', 'file-1')
|
||||
expect(result.url).toBe('https://s3.example.com/presigned-remote.mp4')
|
||||
expect(result.name).toBe('remote-video.mp4')
|
||||
expect(mockGet).toHaveBeenCalledWith({ param: { fileId: 'file-1' } })
|
||||
expect(mockDownloadUrlPost).toHaveBeenCalledWith({
|
||||
json: { key: 'files/remote/video.mp4', assetId: 'file-1' },
|
||||
})
|
||||
})
|
||||
|
||||
it('falls back to download-links endpoint when download-url is unavailable', async () => {
|
||||
const mockPost = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
files: [{ id: 'file-1', name: 'video.mov', url: 'https://s3.example.com/video.mov' }],
|
||||
}),
|
||||
})
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
'download-links': {
|
||||
$post: mockPost,
|
||||
},
|
||||
},
|
||||
},
|
||||
// Partial mock of Hono client for unit test isolation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const result = await resolveRawDownloadUrl('http://test', 'key', 'file-1')
|
||||
expect(result.url).toBe('https://s3.example.com/video.mov')
|
||||
expect(result.name).toBe('video.mov')
|
||||
expect(mockPost).toHaveBeenCalledWith({ json: { ids: ['file-1'] } })
|
||||
})
|
||||
|
||||
it('throws error when all resolution methods fail', async () => {
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
'download-links': {
|
||||
$post: vi.fn().mockResolvedValue({
|
||||
ok: false,
|
||||
status: 500,
|
||||
json: async () => ({ error: 'Server error' }),
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
// Partial mock of Hono client for unit test isolation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
await expect(resolveRawDownloadUrl('http://test', 'key', 'file-1')).rejects.toThrow(
|
||||
'Server error',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('fetchVideoProxies', () => {
|
||||
it('returns available proxies sorted descending', async () => {
|
||||
const mockGet = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
id: 'file-1',
|
||||
media: {
|
||||
videoTranscodes: [
|
||||
{
|
||||
id: 't-720',
|
||||
key: 'files/720.mp4',
|
||||
url: 'https://s3.example.com/720.mp4',
|
||||
width: 1280,
|
||||
height: 720,
|
||||
},
|
||||
{
|
||||
id: 't-1080',
|
||||
key: 'files/1080.mp4',
|
||||
url: 'https://s3.example.com/1080.mp4',
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
})
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
':fileId': {
|
||||
$get: mockGet,
|
||||
},
|
||||
},
|
||||
},
|
||||
// Partial mock of Hono client for unit test isolation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const proxies = await fetchVideoProxies('http://test', 'key', 'file-1')
|
||||
expect(proxies).toHaveLength(2)
|
||||
// Highest resolution first
|
||||
expect(proxies[0].label).toBe('1080p (MP4)')
|
||||
expect(proxies[1].label).toBe('720p (MP4)')
|
||||
})
|
||||
})
|
||||
|
||||
describe('getUniqueFileName', () => {
|
||||
it('returns exact name when no collision exists', () => {
|
||||
expect(getUniqueFileName([], 'image.png')).toBe('image.png')
|
||||
expect(getUniqueFileName(['other.png', 'test.mov'], 'image.png')).toBe('image.png')
|
||||
})
|
||||
|
||||
it('appends _1 on first collision', () => {
|
||||
expect(getUniqueFileName(['image.png'], 'image.png')).toBe('image_1.png')
|
||||
})
|
||||
|
||||
it('appends _2 when original and _1 both exist', () => {
|
||||
expect(getUniqueFileName(['image.png', 'image_1.png'], 'image.png')).toBe('image_2.png')
|
||||
})
|
||||
|
||||
it('handles case-insensitive collision checks', () => {
|
||||
expect(getUniqueFileName(['IMAGE.PNG'], 'image.png')).toBe('image_1.png')
|
||||
expect(getUniqueFileName(['image.png', 'IMAGE_1.PNG'], 'image.png')).toBe('image_2.png')
|
||||
})
|
||||
|
||||
it('handles files without extensions', () => {
|
||||
expect(getUniqueFileName(['README'], 'README')).toBe('README_1')
|
||||
expect(getUniqueFileName(['README', 'README_1'], 'README')).toBe('README_2')
|
||||
})
|
||||
|
||||
it('handles files with multiple dots', () => {
|
||||
expect(getUniqueFileName(['archive.tar.gz'], 'archive.tar.gz')).toBe('archive.tar_1.gz')
|
||||
expect(getUniqueFileName(['archive.tar.gz', 'archive.tar_1.gz'], 'archive.tar.gz')).toBe(
|
||||
'archive.tar_2.gz',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('getFolderEntryNames', () => {
|
||||
it('reads entry names from folder.getEntries', async () => {
|
||||
const mockFolder = {
|
||||
isFile: false as const,
|
||||
isFolder: true as const,
|
||||
name: 'dir',
|
||||
nativePath: '/path/dir',
|
||||
createFile: vi.fn(),
|
||||
getEntries: vi.fn().mockResolvedValue([
|
||||
{ name: 'file1.mp4', isFile: true, isFolder: false },
|
||||
{ name: 'subfolder', isFile: false, isFolder: true },
|
||||
]),
|
||||
}
|
||||
|
||||
const names = await getFolderEntryNames(mockFolder)
|
||||
expect(names).toEqual(['file1.mp4', 'subfolder'])
|
||||
})
|
||||
|
||||
it('handles folder.getEntries error gracefully', async () => {
|
||||
const mockFolder = {
|
||||
isFile: false as const,
|
||||
isFolder: true as const,
|
||||
name: 'dir',
|
||||
nativePath: '/path/dir',
|
||||
createFile: vi.fn(),
|
||||
getEntries: vi.fn().mockRejectedValue(new Error('Permission denied')),
|
||||
}
|
||||
|
||||
const names = await getFolderEntryNames(mockFolder)
|
||||
expect(names).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe('createUniqueFileInFolder', () => {
|
||||
it('creates file with candidate name when no collision', async () => {
|
||||
const mockCreatedFile = {
|
||||
isFile: true as const,
|
||||
isFolder: false as const,
|
||||
name: 'test.mp4',
|
||||
nativePath: '/path/test.mp4',
|
||||
write: vi.fn(),
|
||||
}
|
||||
const mockFolder = {
|
||||
isFile: false as const,
|
||||
isFolder: true as const,
|
||||
name: 'dir',
|
||||
nativePath: '/path/dir',
|
||||
createFile: vi.fn().mockResolvedValue(mockCreatedFile),
|
||||
getEntries: vi.fn().mockResolvedValue([]),
|
||||
}
|
||||
|
||||
const res = await createUniqueFileInFolder(mockFolder, 'test.mp4')
|
||||
expect(res.name).toBe('test.mp4')
|
||||
expect(res.file).toBe(mockCreatedFile)
|
||||
expect(mockFolder.createFile).toHaveBeenCalledWith('test.mp4', { overwrite: false })
|
||||
})
|
||||
|
||||
it('auto-increments suffix when candidate creation fails due to collision', async () => {
|
||||
const mockCreatedFile = {
|
||||
isFile: true as const,
|
||||
isFolder: false as const,
|
||||
name: 'test_1.mp4',
|
||||
nativePath: '/path/test_1.mp4',
|
||||
write: vi.fn(),
|
||||
}
|
||||
const mockFolder = {
|
||||
isFile: false as const,
|
||||
isFolder: true as const,
|
||||
name: 'dir',
|
||||
nativePath: '/path/dir',
|
||||
createFile: vi
|
||||
.fn()
|
||||
.mockRejectedValueOnce(new Error('File exists'))
|
||||
.mockResolvedValueOnce(mockCreatedFile),
|
||||
getEntries: vi.fn().mockResolvedValue([]),
|
||||
}
|
||||
|
||||
const res = await createUniqueFileInFolder(mockFolder, 'test.mp4')
|
||||
expect(res.name).toBe('test_1.mp4')
|
||||
expect(res.file).toBe(mockCreatedFile)
|
||||
})
|
||||
})
|
||||
|
||||
describe('importAssetIntoPremiere', () => {
|
||||
const mockAsset: AssetSummary = {
|
||||
id: 'asset-1',
|
||||
name: 'Sample.mov',
|
||||
type: 'file',
|
||||
}
|
||||
|
||||
it('returns error when no active project in Premiere', async () => {
|
||||
vi.spyOn(premiereModule, 'getActiveProject').mockResolvedValue(null)
|
||||
|
||||
const result = await importAssetIntoPremiere({
|
||||
endpoint: 'http://test',
|
||||
apiKey: 'key',
|
||||
asset: mockAsset,
|
||||
type: 'raw',
|
||||
})
|
||||
|
||||
expect(result.success).toBe(false)
|
||||
expect(result.message).toContain('Please open or create a project')
|
||||
})
|
||||
|
||||
it('returns cancelled when user cancels folder picker', async () => {
|
||||
// Mocking incomplete Premiere Project object in unit test
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
vi.spyOn(premiereModule, 'getActiveProject').mockResolvedValue({} as any)
|
||||
vi.spyOn(premiereModule, 'promptSelectFolder').mockResolvedValue(null)
|
||||
|
||||
const result = await importAssetIntoPremiere({
|
||||
endpoint: 'http://test',
|
||||
apiKey: 'key',
|
||||
asset: mockAsset,
|
||||
type: 'raw',
|
||||
})
|
||||
|
||||
expect(result.success).toBe(false)
|
||||
expect(result.cancelled).toBe(true)
|
||||
expect(premiereModule.promptSelectFolder).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('fails after folder selection if download link resolution fails', async () => {
|
||||
// Mocking incomplete Premiere Project object in unit test
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
vi.spyOn(premiereModule, 'getActiveProject').mockResolvedValue({} as any)
|
||||
const mockFolder = {
|
||||
isFile: false as const,
|
||||
isFolder: true as const,
|
||||
name: 'dir',
|
||||
nativePath: '/path/dir',
|
||||
createFile: vi.fn(),
|
||||
getEntries: vi.fn().mockResolvedValue([]),
|
||||
}
|
||||
vi.spyOn(premiereModule, 'promptSelectFolder').mockResolvedValue(mockFolder)
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
'download-links': {
|
||||
$post: vi.fn().mockResolvedValue({
|
||||
ok: false,
|
||||
status: 401,
|
||||
json: async () => ({ error: 'Unauthorized: Invalid API Key' }),
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
// Partial mock of Hono client for unit test isolation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
await expect(
|
||||
importAssetIntoPremiere({
|
||||
endpoint: 'http://test',
|
||||
apiKey: 'key',
|
||||
asset: mockAsset,
|
||||
type: 'raw',
|
||||
}),
|
||||
).rejects.toThrow('Unauthorized: Invalid API Key')
|
||||
})
|
||||
|
||||
it('downloads and imports file successfully with original name when no conflict', async () => {
|
||||
// Mocking incomplete Premiere Project object in unit test
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const mockProject = {} as any
|
||||
vi.spyOn(premiereModule, 'getActiveProject').mockResolvedValue(mockProject)
|
||||
|
||||
const mockSaveFile = {
|
||||
isFile: true as const,
|
||||
isFolder: false as const,
|
||||
name: 'Sample.mov',
|
||||
nativePath: '/Users/test/Downloads/Sample.mov',
|
||||
write: vi.fn().mockResolvedValue(undefined),
|
||||
}
|
||||
const mockFolder = {
|
||||
isFile: false as const,
|
||||
isFolder: true as const,
|
||||
name: 'Downloads',
|
||||
nativePath: '/Users/test/Downloads',
|
||||
createFile: vi.fn().mockResolvedValue(mockSaveFile),
|
||||
getEntries: vi.fn().mockResolvedValue([]),
|
||||
}
|
||||
vi.spyOn(premiereModule, 'promptSelectFolder').mockResolvedValue(mockFolder)
|
||||
vi.spyOn(premiereModule, 'writeBinaryFile').mockResolvedValue(undefined)
|
||||
vi.spyOn(premiereModule, 'importFilesIntoProject').mockResolvedValue(true)
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
'download-links': {
|
||||
$post: vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
files: [{ id: 'asset-1', name: 'Sample.mov', url: 'https://s3.example.com/raw' }],
|
||||
}),
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
// Partial mock of Hono client for unit test isolation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
// Mock global fetch
|
||||
const dummyBuffer = new ArrayBuffer(8)
|
||||
const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValue({
|
||||
ok: true,
|
||||
arrayBuffer: async () => dummyBuffer,
|
||||
// Mocking Response object for unit test
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const onProgress = vi.fn()
|
||||
const result = await importAssetIntoPremiere({
|
||||
endpoint: 'http://test',
|
||||
apiKey: 'key',
|
||||
asset: mockAsset,
|
||||
type: 'raw',
|
||||
onProgress,
|
||||
})
|
||||
|
||||
expect(result.success).toBe(true)
|
||||
expect(result.fileName).toBe('Sample.mov')
|
||||
expect(result.message).toContain('Successfully imported Sample.mov')
|
||||
expect(mockFolder.createFile).toHaveBeenCalledWith('Sample.mov', { overwrite: false })
|
||||
expect(premiereModule.importFilesIntoProject).toHaveBeenCalledWith(mockProject, [
|
||||
'/Users/test/Downloads/Sample.mov',
|
||||
])
|
||||
expect(onProgress).toHaveBeenCalled()
|
||||
fetchSpy.mockRestore()
|
||||
})
|
||||
|
||||
it('automatically adds _1 suffix when name conflict exists in selected folder', async () => {
|
||||
// Mocking incomplete Premiere Project object in unit test
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const mockProject = {} as any
|
||||
vi.spyOn(premiereModule, 'getActiveProject').mockResolvedValue(mockProject)
|
||||
|
||||
const mockSaveFile = {
|
||||
isFile: true as const,
|
||||
isFolder: false as const,
|
||||
name: 'Sample_1.mov',
|
||||
nativePath: '/Users/test/Downloads/Sample_1.mov',
|
||||
write: vi.fn().mockResolvedValue(undefined),
|
||||
}
|
||||
const mockFolder = {
|
||||
isFile: false as const,
|
||||
isFolder: true as const,
|
||||
name: 'Downloads',
|
||||
nativePath: '/Users/test/Downloads',
|
||||
createFile: vi.fn().mockResolvedValue(mockSaveFile),
|
||||
getEntries: vi
|
||||
.fn()
|
||||
.mockResolvedValue([{ name: 'Sample.mov', isFile: true, isFolder: false }]),
|
||||
}
|
||||
vi.spyOn(premiereModule, 'promptSelectFolder').mockResolvedValue(mockFolder)
|
||||
vi.spyOn(premiereModule, 'writeBinaryFile').mockResolvedValue(undefined)
|
||||
vi.spyOn(premiereModule, 'importFilesIntoProject').mockResolvedValue(true)
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
'download-links': {
|
||||
$post: vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
files: [{ id: 'asset-1', name: 'Sample.mov', url: 'https://s3.example.com/raw' }],
|
||||
}),
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
// Partial mock of Hono client for unit test isolation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const dummyBuffer = new ArrayBuffer(8)
|
||||
const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValue({
|
||||
ok: true,
|
||||
arrayBuffer: async () => dummyBuffer,
|
||||
// Mocking Response object for unit test
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const result = await importAssetIntoPremiere({
|
||||
endpoint: 'http://test',
|
||||
apiKey: 'key',
|
||||
asset: mockAsset,
|
||||
type: 'raw',
|
||||
})
|
||||
|
||||
expect(result.success).toBe(true)
|
||||
expect(result.fileName).toBe('Sample_1.mov')
|
||||
expect(result.message).toContain('Successfully imported Sample_1.mov')
|
||||
expect(mockFolder.createFile).toHaveBeenCalledWith('Sample_1.mov', { overwrite: false })
|
||||
expect(premiereModule.importFilesIntoProject).toHaveBeenCalledWith(mockProject, [
|
||||
'/Users/test/Downloads/Sample_1.mov',
|
||||
])
|
||||
fetchSpy.mockRestore()
|
||||
})
|
||||
|
||||
it('resolves relative download URL with endpoint before fetching', async () => {
|
||||
// Mocking incomplete Premiere Project object in unit test
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const mockProject = {} as any
|
||||
vi.spyOn(premiereModule, 'getActiveProject').mockResolvedValue(mockProject)
|
||||
|
||||
const mockSaveFile = {
|
||||
isFile: true as const,
|
||||
isFolder: false as const,
|
||||
name: 'Sample.mov',
|
||||
nativePath: '/Users/test/Downloads/Sample.mov',
|
||||
write: vi.fn().mockResolvedValue(undefined),
|
||||
}
|
||||
const mockFolder = {
|
||||
isFile: false as const,
|
||||
isFolder: true as const,
|
||||
name: 'Downloads',
|
||||
nativePath: '/Users/test/Downloads',
|
||||
createFile: vi.fn().mockResolvedValue(mockSaveFile),
|
||||
getEntries: vi.fn().mockResolvedValue([]),
|
||||
}
|
||||
vi.spyOn(premiereModule, 'promptSelectFolder').mockResolvedValue(mockFolder)
|
||||
vi.spyOn(premiereModule, 'writeBinaryFile').mockResolvedValue(undefined)
|
||||
vi.spyOn(premiereModule, 'importFilesIntoProject').mockResolvedValue(true)
|
||||
|
||||
vi.spyOn(clientModule, 'getShumaiClient').mockReturnValue({
|
||||
api: {
|
||||
files: {
|
||||
'download-links': {
|
||||
$post: vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
files: [{ id: 'asset-1', name: 'Sample.mov', url: '/api/upload/local?key=test' }],
|
||||
}),
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const dummyBuffer = new ArrayBuffer(8)
|
||||
const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValue({
|
||||
ok: true,
|
||||
arrayBuffer: async () => dummyBuffer,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any)
|
||||
|
||||
const result = await importAssetIntoPremiere({
|
||||
endpoint: 'http://test:3000',
|
||||
apiKey: 'key',
|
||||
asset: mockAsset,
|
||||
type: 'raw',
|
||||
})
|
||||
|
||||
expect(result.success).toBe(true)
|
||||
expect(fetchSpy).toHaveBeenCalledWith('http://test:3000/api/upload/local?key=test')
|
||||
fetchSpy.mockRestore()
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,357 @@
|
||||
import { getShumaiClient } from '../api/client'
|
||||
import type { AssetSummary } from '../components/FileItem'
|
||||
import {
|
||||
getActiveProject,
|
||||
importFilesIntoProject,
|
||||
promptSelectFolder,
|
||||
writeBinaryFile,
|
||||
} from './premiere'
|
||||
import { resolveAssetUrl } from '../utils/url'
|
||||
|
||||
export interface ProxyOption {
|
||||
id: string
|
||||
label: string
|
||||
resolution: string
|
||||
url: string
|
||||
key: string
|
||||
width?: number
|
||||
height?: number
|
||||
size?: number
|
||||
}
|
||||
|
||||
export function formatResolutionLabel(width?: number, height?: number, res?: string): string {
|
||||
if (res) {
|
||||
const cleanRes = res.endsWith('p') ? res : `${res}p`
|
||||
return `${cleanRes} (MP4)`
|
||||
}
|
||||
if (height) return `${height}p (MP4)`
|
||||
if (width) {
|
||||
if (width >= 3840) return '2160p (MP4)'
|
||||
if (width >= 1920) return '1080p (MP4)'
|
||||
if (width >= 1280) return '720p (MP4)'
|
||||
if (width >= 960) return '540p (MP4)'
|
||||
if (width >= 640) return '360p (MP4)'
|
||||
}
|
||||
return 'Proxy (MP4)'
|
||||
}
|
||||
|
||||
export function getResolutionRank(label: string): number {
|
||||
const match = label.match(/(\d+)p/) || label.match(/^(\d+)/)
|
||||
return match ? parseInt(match[1], 10) : 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the presigned download URL for the original / raw file.
|
||||
*/
|
||||
export async function resolveRawDownloadUrl(
|
||||
endpoint: string,
|
||||
apiKey: string,
|
||||
assetId: string,
|
||||
knownAsset?: AssetSummary,
|
||||
): Promise<{ url: string; name?: string }> {
|
||||
const client = getShumaiClient(endpoint, apiKey)
|
||||
|
||||
// 1. If original key is known directly from asset summary, presign via download-url endpoint
|
||||
const directKey = knownAsset?.media?.original?.key
|
||||
if (directKey) {
|
||||
try {
|
||||
const res = await client.api.files['download-url']?.$post({
|
||||
json: { key: directKey, assetId },
|
||||
})
|
||||
if (res?.ok) {
|
||||
const data = await res.json()
|
||||
if (data.url) {
|
||||
return { url: data.url, name: knownAsset?.name }
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('Failed to resolve download URL via known key:', err)
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Fetch full asset details via GET /api/files/:fileId to get the original media key
|
||||
try {
|
||||
const detailRes = await client.api.files[':fileId']?.$get({
|
||||
param: { fileId: assetId },
|
||||
})
|
||||
if (detailRes?.ok) {
|
||||
const assetData = await detailRes.json()
|
||||
const originalKey = assetData.media?.original?.key
|
||||
if (originalKey) {
|
||||
const urlRes = await client.api.files['download-url']?.$post({
|
||||
json: { key: originalKey, assetId },
|
||||
})
|
||||
if (urlRes?.ok) {
|
||||
const urlData = await urlRes.json()
|
||||
if (urlData.url) {
|
||||
return { url: urlData.url, name: assetData.name || knownAsset?.name }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('Failed to fetch asset details for download URL:', err)
|
||||
}
|
||||
|
||||
// 3. Fallback to POST /api/files/download-links batch resolution
|
||||
const res = await client.api.files['download-links']?.$post({
|
||||
json: { ids: [assetId] },
|
||||
})
|
||||
|
||||
if (res?.ok) {
|
||||
const data = await res.json()
|
||||
const file = data.files?.[0]
|
||||
if (file?.url) {
|
||||
return { url: file.url, name: file.name || knownAsset?.name }
|
||||
}
|
||||
} else if (res) {
|
||||
const errData = (await res.json().catch(() => ({}))) as { error?: string }
|
||||
throw new Error(errData.error || `Failed to get download link (${res.status})`)
|
||||
}
|
||||
|
||||
throw new Error('No download URL returned from server.')
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches available video proxy transcodes for an asset.
|
||||
*/
|
||||
export async function fetchVideoProxies(
|
||||
endpoint: string,
|
||||
apiKey: string,
|
||||
assetId: string,
|
||||
): Promise<ProxyOption[]> {
|
||||
const client = getShumaiClient(endpoint, apiKey)
|
||||
const res = await client.api.files[':fileId'].$get({
|
||||
param: { fileId: assetId },
|
||||
})
|
||||
|
||||
if (!res.ok) {
|
||||
const errData = (await res.json().catch(() => ({}))) as { error?: string }
|
||||
throw new Error(errData.error || `Failed to get asset details (${res.status})`)
|
||||
}
|
||||
|
||||
const asset = await res.json()
|
||||
const transcodes = asset.media?.videoTranscodes || []
|
||||
if (!transcodes.length) return []
|
||||
|
||||
const proxies: ProxyOption[] = []
|
||||
for (const t of transcodes) {
|
||||
let url = t.url
|
||||
if (!url && t.key) {
|
||||
// If transcode url wasn't presigned yet, request via download-url endpoint
|
||||
try {
|
||||
const urlRes = await client.api.files['download-url'].$post({
|
||||
json: { key: t.key, assetId },
|
||||
})
|
||||
if (urlRes.ok) {
|
||||
const urlData = await urlRes.json()
|
||||
url = urlData.url
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn(`Failed to presign transcode key ${t.key}:`, err)
|
||||
}
|
||||
}
|
||||
|
||||
if (url) {
|
||||
const label = formatResolutionLabel(t.width, t.height)
|
||||
proxies.push({
|
||||
id: t.id || t.key,
|
||||
label,
|
||||
resolution: `${t.height || 0}p`,
|
||||
url,
|
||||
key: t.key,
|
||||
width: t.width,
|
||||
height: t.height,
|
||||
size: t.size,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Sort descending by resolution (1080p, 720p, 540p, 360p)
|
||||
proxies.sort((a, b) => getResolutionRank(b.label) - getResolutionRank(a.label))
|
||||
return proxies
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves a unique filename within the specified existing file names in a folder.
|
||||
* If requestedName exists, it appends _1, _2, etc. before the file extension.
|
||||
* Comparison is case-insensitive to safely handle Windows and macOS filesystems.
|
||||
*/
|
||||
export function getUniqueFileName(existingNames: string[], requestedName: string): string {
|
||||
const existingSet = new Set(existingNames.map((n) => n.toLowerCase()))
|
||||
if (!existingSet.has(requestedName.toLowerCase())) {
|
||||
return requestedName
|
||||
}
|
||||
|
||||
const dotIndex = requestedName.lastIndexOf('.')
|
||||
const base = dotIndex > 0 ? requestedName.slice(0, dotIndex) : requestedName
|
||||
const ext = dotIndex > 0 ? requestedName.slice(dotIndex) : ''
|
||||
|
||||
let counter = 1
|
||||
while (true) {
|
||||
const candidate = `${base}_${counter}${ext}`
|
||||
if (!existingSet.has(candidate.toLowerCase())) {
|
||||
return candidate
|
||||
}
|
||||
counter++
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads existing file/folder names inside a UXP FolderEntry safely.
|
||||
*/
|
||||
export async function getFolderEntryNames(folder: UxpFolderEntry): Promise<string[]> {
|
||||
try {
|
||||
if (typeof folder.getEntries === 'function') {
|
||||
const entries = await folder.getEntries()
|
||||
return entries.map((e) => e.name)
|
||||
}
|
||||
const folderRecord = folder as unknown as Record<string, unknown>
|
||||
if (typeof folderRecord.getFiles === 'function') {
|
||||
const files = await (folderRecord.getFiles as () => Promise<Array<{ name: string }>>)()
|
||||
return files.map((f) => f.name)
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('Failed to read folder entries:', err)
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a unique file entry in the target folder, preventing overwrites by auto-incrementing suffixes (_1, _2).
|
||||
*/
|
||||
export async function createUniqueFileInFolder(
|
||||
folder: UxpFolderEntry,
|
||||
requestedName: string,
|
||||
): Promise<{ file: UxpFileEntry; name: string }> {
|
||||
const existingNames = await getFolderEntryNames(folder)
|
||||
const candidateName = getUniqueFileName(existingNames, requestedName)
|
||||
|
||||
try {
|
||||
const file = await folder.createFile(candidateName, { overwrite: false })
|
||||
return { file, name: candidateName }
|
||||
} catch (err) {
|
||||
console.warn(`Could not create file "${candidateName}" with overwrite: false, retrying...`, err)
|
||||
const dotIndex = requestedName.lastIndexOf('.')
|
||||
const base = dotIndex > 0 ? requestedName.slice(0, dotIndex) : requestedName
|
||||
const ext = dotIndex > 0 ? requestedName.slice(dotIndex) : ''
|
||||
|
||||
for (let counter = 1; counter <= 50; counter++) {
|
||||
const retryName = `${base}_${counter}${ext}`
|
||||
try {
|
||||
const file = await folder.createFile(retryName, { overwrite: false })
|
||||
return { file, name: retryName }
|
||||
} catch {
|
||||
continue
|
||||
}
|
||||
}
|
||||
const fallbackFile = await folder.createFile(candidateName, { overwrite: true })
|
||||
return { file: fallbackFile, name: candidateName }
|
||||
}
|
||||
}
|
||||
|
||||
export interface ImportAssetOptions {
|
||||
endpoint: string
|
||||
apiKey: string
|
||||
asset: AssetSummary
|
||||
type: 'raw' | 'proxy'
|
||||
proxyItem?: ProxyOption
|
||||
onProgress?: (message: string) => void
|
||||
}
|
||||
|
||||
export interface ImportResult {
|
||||
success: boolean
|
||||
cancelled?: boolean
|
||||
message: string
|
||||
fileName?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Orchestrates the full import workflow:
|
||||
* 1. Checks active Premiere Pro project
|
||||
* 2. Prompts user with native folder picker (Frame.io pattern)
|
||||
* 3. Resolves download URL from Shumai S3 presigned URL
|
||||
* 4. Resolves unique filename in folder with auto-increment (_1, _2) on collision
|
||||
* 5. Downloads binary data and writes to disk
|
||||
* 6. Calls Premiere project.importFiles
|
||||
*/
|
||||
export async function importAssetIntoPremiere({
|
||||
endpoint,
|
||||
apiKey,
|
||||
asset,
|
||||
type,
|
||||
proxyItem,
|
||||
onProgress,
|
||||
}: ImportAssetOptions): Promise<ImportResult> {
|
||||
// 1. Verify active Premiere project
|
||||
const project = await getActiveProject()
|
||||
if (!project) {
|
||||
return {
|
||||
success: false,
|
||||
message: 'Please open or create a project in Premiere Pro first.',
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Open native folder picker (Frame.io pattern)
|
||||
const targetFolder = await promptSelectFolder()
|
||||
if (!targetFolder) {
|
||||
return {
|
||||
success: false,
|
||||
cancelled: true,
|
||||
message: 'Import cancelled by user.',
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Determine default filename & download URL
|
||||
onProgress?.('Preparing download link...')
|
||||
let downloadUrl: string
|
||||
let defaultFileName: string
|
||||
if (type === 'raw') {
|
||||
const rawInfo = await resolveRawDownloadUrl(endpoint, apiKey, asset.id, asset)
|
||||
downloadUrl = rawInfo.url
|
||||
defaultFileName = rawInfo.name || asset.name
|
||||
} else {
|
||||
if (!proxyItem?.url) {
|
||||
throw new Error('Proxy URL not available.')
|
||||
}
|
||||
downloadUrl = proxyItem.url
|
||||
const rawName = asset.name
|
||||
const dotIndex = rawName.lastIndexOf('.')
|
||||
const baseName = dotIndex !== -1 ? rawName.slice(0, dotIndex) : rawName
|
||||
const resTag = proxyItem ? proxyItem.label.split(' ')[0] : 'proxy'
|
||||
defaultFileName = `${baseName}_proxy_${resTag}.mp4`
|
||||
}
|
||||
|
||||
const resolvedDownloadUrl = resolveAssetUrl(downloadUrl, endpoint) || downloadUrl
|
||||
|
||||
// 4. Create unique file in destination folder with collision avoidance (_1, _2)
|
||||
const { file: saveFile, name: finalFileName } = await createUniqueFileInFolder(
|
||||
targetFolder,
|
||||
defaultFileName,
|
||||
)
|
||||
|
||||
// 5. Download binary data
|
||||
onProgress?.(`Downloading ${finalFileName}...`)
|
||||
const response = await fetch(resolvedDownloadUrl)
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to download file (HTTP ${response.status})`)
|
||||
}
|
||||
const arrayBuffer = await response.arrayBuffer()
|
||||
|
||||
// 6. Write file to disk
|
||||
onProgress?.(`Saving ${finalFileName} to disk...`)
|
||||
await writeBinaryFile(saveFile, arrayBuffer)
|
||||
|
||||
// 7. Import into Premiere Pro
|
||||
onProgress?.('Importing into Premiere Pro...')
|
||||
const imported = await importFilesIntoProject(project, [saveFile.nativePath])
|
||||
if (!imported) {
|
||||
throw new Error(`Premiere Pro could not import "${finalFileName}".`)
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
fileName: finalFileName,
|
||||
message: `Successfully imported ${finalFileName} into Premiere Pro.`,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,548 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import {
|
||||
saveSequenceLinkToCache,
|
||||
getSequenceLinkFromCache,
|
||||
removeSequenceLinkFromCache,
|
||||
getAllSequenceLinksFromCache,
|
||||
getAllLinkedSequences,
|
||||
getSequenceLink,
|
||||
saveSequenceLink,
|
||||
removeSequenceLink,
|
||||
normalizeGuid,
|
||||
LINK_STORAGE_PROP_KEY,
|
||||
} from './linkStorage'
|
||||
import * as commentUtils from './commentUtils'
|
||||
import type { Project, Sequence } from '@adobe/premierepro'
|
||||
import type { LinkedSequenceAsset } from '../types/link'
|
||||
|
||||
const localStorageMock = (() => {
|
||||
let store: Record<string, string> = {}
|
||||
return {
|
||||
getItem: (key: string) => store[key] || null,
|
||||
setItem: (key: string, value: string) => {
|
||||
store[key] = value.toString()
|
||||
},
|
||||
removeItem: (key: string) => {
|
||||
delete store[key]
|
||||
},
|
||||
clear: () => {
|
||||
store = {}
|
||||
},
|
||||
key: (index: number) => Object.keys(store)[index] || null,
|
||||
get length() {
|
||||
return Object.keys(store).length
|
||||
},
|
||||
}
|
||||
})()
|
||||
|
||||
Object.defineProperty(globalThis, 'localStorage', {
|
||||
value: localStorageMock,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
})
|
||||
|
||||
describe('linkStorage service', () => {
|
||||
beforeEach(() => {
|
||||
localStorage.clear()
|
||||
vi.restoreAllMocks()
|
||||
// Reset global require
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
delete (globalThis as any).require
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
delete (globalThis as any).window
|
||||
})
|
||||
|
||||
const sampleLink: LinkedSequenceAsset = {
|
||||
sequenceGuid: 'seq-guid-1',
|
||||
sequenceName: 'Sequence 01',
|
||||
assetId: 'asset-1',
|
||||
assetName: 'video.mp4',
|
||||
syncedCommentIds: ['comm-1', 'comm-2'],
|
||||
lastSyncAt: 1000,
|
||||
totalCommentsSynced: 2,
|
||||
}
|
||||
|
||||
describe('cache operations (localStorage)', () => {
|
||||
it('saves and retrieves link from cache', () => {
|
||||
saveSequenceLinkToCache(sampleLink, 'proj-1')
|
||||
const result = getSequenceLinkFromCache('seq-guid-1', 'proj-1')
|
||||
expect(result).toEqual(sampleLink)
|
||||
})
|
||||
|
||||
it('saves and retrieves link with endpoint from cache', () => {
|
||||
const linkWithEndpoint: LinkedSequenceAsset = {
|
||||
...sampleLink,
|
||||
endpoint: 'https://staging.shumai.one',
|
||||
}
|
||||
saveSequenceLinkToCache(linkWithEndpoint, 'proj-1')
|
||||
const result = getSequenceLinkFromCache('seq-guid-1', 'proj-1')
|
||||
expect(result?.endpoint).toBe('https://staging.shumai.one')
|
||||
})
|
||||
|
||||
it('returns null when link is not in cache', () => {
|
||||
expect(getSequenceLinkFromCache('unknown-seq', 'proj-1')).toBeNull()
|
||||
})
|
||||
|
||||
it('lists all links for a project', () => {
|
||||
saveSequenceLinkToCache(sampleLink, 'proj-1')
|
||||
const link2: LinkedSequenceAsset = {
|
||||
...sampleLink,
|
||||
sequenceGuid: 'seq-guid-2',
|
||||
sequenceName: 'Sequence 02',
|
||||
}
|
||||
saveSequenceLinkToCache(link2, 'proj-1')
|
||||
|
||||
const all = getAllSequenceLinksFromCache('proj-1')
|
||||
expect(all).toHaveLength(2)
|
||||
expect(all.map((l) => l.sequenceGuid)).toContain('seq-guid-1')
|
||||
expect(all.map((l) => l.sequenceGuid)).toContain('seq-guid-2')
|
||||
})
|
||||
|
||||
it('removes a link from cache', () => {
|
||||
saveSequenceLinkToCache(sampleLink, 'proj-1')
|
||||
expect(getSequenceLinkFromCache('seq-guid-1', 'proj-1')).not.toBeNull()
|
||||
|
||||
removeSequenceLinkFromCache('seq-guid-1', 'proj-1')
|
||||
expect(getSequenceLinkFromCache('seq-guid-1', 'proj-1')).toBeNull()
|
||||
})
|
||||
|
||||
it('returns all links across projects when projectGuid is omitted', () => {
|
||||
saveSequenceLinkToCache(sampleLink, 'proj-1')
|
||||
const link2: LinkedSequenceAsset = {
|
||||
...sampleLink,
|
||||
sequenceGuid: 'seq-guid-2',
|
||||
sequenceName: 'Sequence 02',
|
||||
assetId: 'asset-2',
|
||||
}
|
||||
saveSequenceLinkToCache(link2, 'proj-2')
|
||||
|
||||
const all = getAllSequenceLinksFromCache()
|
||||
expect(all).toHaveLength(2)
|
||||
expect(all.map((l) => l.sequenceGuid)).toContain('seq-guid-1')
|
||||
expect(all.map((l) => l.sequenceGuid)).toContain('seq-guid-2')
|
||||
})
|
||||
|
||||
it('does not return links from default cache when projectGuid is specified', () => {
|
||||
saveSequenceLinkToCache(sampleLink, null)
|
||||
const result = getAllSequenceLinksFromCache('proj-unknown')
|
||||
expect(result).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe('host sequence properties integration', () => {
|
||||
it('retrieves persistent property from sequence when available', async () => {
|
||||
const mockProps = {
|
||||
getValue: vi.fn().mockReturnValue(JSON.stringify(sampleLink)),
|
||||
}
|
||||
const mockPpro = {
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue(mockProps),
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const mockSeq = { guid: 'seq-guid-1' }
|
||||
const mockProj = { guid: 'proj-1' }
|
||||
|
||||
const link = await getSequenceLink(
|
||||
mockSeq as unknown as Sequence,
|
||||
mockProj as unknown as Project,
|
||||
)
|
||||
expect(link).toEqual(sampleLink)
|
||||
expect(mockProps.getValue).toHaveBeenCalledWith(LINK_STORAGE_PROP_KEY)
|
||||
})
|
||||
|
||||
it('saves persistent property and executes transaction', async () => {
|
||||
const mockCompoundAction = { addAction: vi.fn() }
|
||||
const mockProps = {
|
||||
createSetValueAction: vi.fn().mockReturnValue({ id: 'action-set' }),
|
||||
}
|
||||
const mockPpro = {
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue(mockProps),
|
||||
PROPERTY_PERSISTENT: 1,
|
||||
},
|
||||
Constants: {
|
||||
PropertyType: { PERSISTENT: 1 },
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const mockSeq = { guid: 'seq-guid-1' }
|
||||
const mockProj = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn((cb) => cb()),
|
||||
executeTransaction: vi.fn((cb) => {
|
||||
cb(mockCompoundAction)
|
||||
return true
|
||||
}),
|
||||
}
|
||||
|
||||
const success = await saveSequenceLink(
|
||||
mockProj as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
sampleLink,
|
||||
)
|
||||
expect(success).toBe(true)
|
||||
expect(mockProps.createSetValueAction).toHaveBeenCalledWith(
|
||||
LINK_STORAGE_PROP_KEY,
|
||||
JSON.stringify(sampleLink),
|
||||
1,
|
||||
)
|
||||
expect(mockCompoundAction.addAction).toHaveBeenCalledWith({ id: 'action-set' })
|
||||
})
|
||||
|
||||
it('clears persistent property on removeSequenceLink', async () => {
|
||||
const mockCompoundAction = { addAction: vi.fn() }
|
||||
const mockProps = {
|
||||
createClearValueAction: vi.fn().mockReturnValue({ id: 'action-clear' }),
|
||||
}
|
||||
const mockPpro = {
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue(mockProps),
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const mockSeq = { guid: 'seq-guid-1' }
|
||||
const mockProj = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn((cb) => cb()),
|
||||
executeTransaction: vi.fn((cb) => {
|
||||
cb(mockCompoundAction)
|
||||
return true
|
||||
}),
|
||||
}
|
||||
|
||||
const success = await removeSequenceLink(
|
||||
mockProj as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
)
|
||||
expect(success).toBe(true)
|
||||
expect(mockProps.createClearValueAction).toHaveBeenCalledWith(LINK_STORAGE_PROP_KEY)
|
||||
})
|
||||
|
||||
it('removes synced markers matching syncedMarkerGuids on removeSequenceLink, preserving manual markers', async () => {
|
||||
const mockCompoundAction = { addAction: vi.fn() }
|
||||
const mockProps = {
|
||||
getValue: vi.fn().mockReturnValue(
|
||||
JSON.stringify({
|
||||
...sampleLink,
|
||||
syncedMarkerGuids: ['synced-marker-1', 'synced-marker-2'],
|
||||
}),
|
||||
),
|
||||
createClearValueAction: vi.fn().mockReturnValue({ id: 'action-clear' }),
|
||||
}
|
||||
|
||||
const mockMarker1 = {
|
||||
guid: 'synced-marker-1',
|
||||
name: 'Director (edited)',
|
||||
comments: 'Edited comment',
|
||||
}
|
||||
const mockMarker2 = { guid: 'synced-marker-2', name: 'Producer', comments: 'Another comment' }
|
||||
const mockManualMarker = {
|
||||
guid: 'manual-user-marker',
|
||||
name: 'Editor Note',
|
||||
comments: 'Manual marker',
|
||||
}
|
||||
|
||||
const mockSeqMarkers = {
|
||||
getMarkers: vi.fn().mockReturnValue([mockMarker1, mockManualMarker, mockMarker2]),
|
||||
createRemoveMarkerAction: vi.fn().mockImplementation((marker) => ({
|
||||
type: 'remove-marker',
|
||||
guid: marker.guid,
|
||||
})),
|
||||
}
|
||||
|
||||
const mockPpro = {
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue(mockProps),
|
||||
},
|
||||
Markers: {
|
||||
getMarkers: vi.fn().mockResolvedValue(mockSeqMarkers),
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const mockSeq = { guid: 'seq-guid-1' }
|
||||
const mockProj = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn((cb) => cb()),
|
||||
executeTransaction: vi.fn((cb) => {
|
||||
cb(mockCompoundAction)
|
||||
return true
|
||||
}),
|
||||
}
|
||||
|
||||
const success = await removeSequenceLink(
|
||||
mockProj as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
)
|
||||
expect(success).toBe(true)
|
||||
|
||||
// Only synced-marker-1 and synced-marker-2 should be removed; manual-user-marker must NOT be removed
|
||||
expect(mockSeqMarkers.createRemoveMarkerAction).toHaveBeenCalledTimes(2)
|
||||
expect(mockSeqMarkers.createRemoveMarkerAction).toHaveBeenCalledWith(mockMarker1)
|
||||
expect(mockSeqMarkers.createRemoveMarkerAction).toHaveBeenCalledWith(mockMarker2)
|
||||
expect(mockSeqMarkers.createRemoveMarkerAction).not.toHaveBeenCalledWith(mockManualMarker)
|
||||
|
||||
expect(mockCompoundAction.addAction).toHaveBeenCalledWith({
|
||||
type: 'remove-marker',
|
||||
guid: 'synced-marker-1',
|
||||
})
|
||||
expect(mockCompoundAction.addAction).toHaveBeenCalledWith({
|
||||
type: 'remove-marker',
|
||||
guid: 'synced-marker-2',
|
||||
})
|
||||
expect(mockProps.createClearValueAction).toHaveBeenCalledWith(LINK_STORAGE_PROP_KEY)
|
||||
})
|
||||
|
||||
it('removes markers by comment matching fallback when syncedMarkerGuids is empty', async () => {
|
||||
localStorage.setItem('shumai_uxp_endpoint', 'https://shumai.example.com')
|
||||
localStorage.setItem('shumai_uxp_api_key', 'test-api-key')
|
||||
|
||||
vi.spyOn(commentUtils, 'fetchAssetComments').mockResolvedValue([
|
||||
{
|
||||
id: 'comm-1',
|
||||
creator: {
|
||||
id: 'u1',
|
||||
name: 'Director',
|
||||
} as unknown as import('@shumai/dtos').CommentInfo['creator'],
|
||||
message: 'Please trim this scene',
|
||||
} as unknown as import('@shumai/dtos').CommentInfo,
|
||||
])
|
||||
|
||||
const mockCompoundAction = { addAction: vi.fn() }
|
||||
const mockProps = {
|
||||
getValue: vi.fn().mockReturnValue(
|
||||
JSON.stringify({
|
||||
...sampleLink,
|
||||
syncedMarkerGuids: [],
|
||||
}),
|
||||
),
|
||||
createClearValueAction: vi.fn().mockReturnValue({ id: 'action-clear' }),
|
||||
}
|
||||
|
||||
const mockLegacyShumaiMarker = {
|
||||
guid: 'legacy-guid-1',
|
||||
getName: () => 'Director',
|
||||
getComments: () => 'Please trim this scene',
|
||||
}
|
||||
const mockManualMarker = {
|
||||
guid: 'manual-guid-2',
|
||||
getName: () => 'Editor',
|
||||
getComments: () => 'My own note',
|
||||
}
|
||||
|
||||
const mockSeqMarkers = {
|
||||
getMarkers: vi.fn().mockReturnValue([mockLegacyShumaiMarker, mockManualMarker]),
|
||||
createRemoveMarkerAction: vi.fn().mockImplementation((marker) => ({
|
||||
type: 'remove-marker',
|
||||
guid: marker.guid,
|
||||
})),
|
||||
}
|
||||
|
||||
const mockPpro = {
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue(mockProps),
|
||||
},
|
||||
Markers: {
|
||||
getMarkers: vi.fn().mockResolvedValue(mockSeqMarkers),
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const mockSeq = { guid: 'seq-guid-1' }
|
||||
const mockProj = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn((cb) => cb()),
|
||||
executeTransaction: vi.fn((cb) => {
|
||||
cb(mockCompoundAction)
|
||||
return true
|
||||
}),
|
||||
}
|
||||
|
||||
const success = await removeSequenceLink(
|
||||
mockProj as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
)
|
||||
expect(success).toBe(true)
|
||||
|
||||
expect(mockSeqMarkers.createRemoveMarkerAction).toHaveBeenCalledWith(mockLegacyShumaiMarker)
|
||||
expect(mockSeqMarkers.createRemoveMarkerAction).not.toHaveBeenCalledWith(mockManualMarker)
|
||||
})
|
||||
|
||||
it('attempts individual marker removals if compound batch remove returns false', async () => {
|
||||
const mockCompoundAction = { addAction: vi.fn() }
|
||||
const mockProps = {
|
||||
getValue: vi.fn().mockReturnValue(
|
||||
JSON.stringify({
|
||||
...sampleLink,
|
||||
syncedMarkerGuids: ['synced-1'],
|
||||
}),
|
||||
),
|
||||
createClearValueAction: vi.fn().mockReturnValue({ id: 'action-clear' }),
|
||||
}
|
||||
|
||||
const mockMarker = { guid: 'synced-1' }
|
||||
const mockSeqMarkers = {
|
||||
getMarkers: vi.fn().mockReturnValue([mockMarker]),
|
||||
createRemoveMarkerAction: vi.fn().mockReturnValue({ type: 'remove-marker' }),
|
||||
}
|
||||
|
||||
const mockPpro = {
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue(mockProps),
|
||||
},
|
||||
Markers: {
|
||||
getMarkers: vi.fn().mockResolvedValue(mockSeqMarkers),
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
let txCount = 0
|
||||
const mockProj = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn((cb) => cb()),
|
||||
executeTransaction: vi.fn((cb) => {
|
||||
txCount++
|
||||
cb(mockCompoundAction)
|
||||
if (txCount === 1) return false // batch failed
|
||||
return true // individual succeeded
|
||||
}),
|
||||
}
|
||||
|
||||
const mockSeq = { guid: 'seq-guid-1' }
|
||||
const success = await removeSequenceLink(
|
||||
mockProj as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
)
|
||||
expect(success).toBe(true)
|
||||
expect(txCount).toBeGreaterThanOrEqual(2)
|
||||
})
|
||||
|
||||
it('skips fallback comment fetch if link endpoint does not match current session endpoint', async () => {
|
||||
localStorage.setItem('shumai_uxp_endpoint', 'https://staging.shumai.one')
|
||||
localStorage.setItem('shumai_uxp_api_key', 'test-key')
|
||||
|
||||
const fetchCommentsSpy = vi.spyOn(commentUtils, 'fetchAssetComments')
|
||||
|
||||
const mockSeq = {
|
||||
guid: 'seq-diff-endpoint',
|
||||
name: 'Diff Endpoint Seq',
|
||||
}
|
||||
const mockProj = {
|
||||
guid: 'proj-diff',
|
||||
lockedAccess: (fn: () => void) => fn(),
|
||||
executeTransaction: () => true,
|
||||
}
|
||||
|
||||
const linkFromLocal: LinkedSequenceAsset = {
|
||||
...sampleLink,
|
||||
sequenceGuid: 'seq-diff-endpoint',
|
||||
endpoint: 'http://localhost:3000',
|
||||
syncedMarkerGuids: [], // Trigger fallback
|
||||
}
|
||||
|
||||
saveSequenceLinkToCache(linkFromLocal, 'proj-diff')
|
||||
|
||||
await removeSequenceLink(mockProj as unknown as Project, mockSeq as unknown as Sequence)
|
||||
expect(fetchCommentsSpy).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
describe('getAllLinkedSequences', () => {
|
||||
it('does not leak cached links across projects when a project has an empty sequence list', async () => {
|
||||
saveSequenceLinkToCache(sampleLink, 'proj-A')
|
||||
const defaultLink: LinkedSequenceAsset = {
|
||||
...sampleLink,
|
||||
sequenceGuid: 'seq-default',
|
||||
sequenceName: 'Default Seq',
|
||||
}
|
||||
saveSequenceLinkToCache(defaultLink, null)
|
||||
|
||||
const mockProjB = {
|
||||
guid: 'proj-B',
|
||||
getSequences: vi.fn().mockResolvedValue([]),
|
||||
}
|
||||
|
||||
const results = await getAllLinkedSequences(mockProjB as unknown as Project, [])
|
||||
expect(results).toEqual([])
|
||||
})
|
||||
|
||||
it('restores cached link only if the sequence actually exists in the project', async () => {
|
||||
saveSequenceLinkToCache(sampleLink, 'proj-A')
|
||||
|
||||
const mockSeq1 = { guid: 'seq-guid-1' }
|
||||
const mockSeq2 = { guid: 'seq-guid-2' }
|
||||
|
||||
const mockProjA = {
|
||||
guid: 'proj-A',
|
||||
getSequences: vi.fn().mockResolvedValue([mockSeq1]),
|
||||
}
|
||||
|
||||
const results = await getAllLinkedSequences(mockProjA as unknown as Project, [
|
||||
mockSeq1 as unknown as Sequence,
|
||||
])
|
||||
expect(results).toHaveLength(1)
|
||||
expect(results[0].sequenceGuid).toBe('seq-guid-1')
|
||||
|
||||
const resultsSeq2 = await getAllLinkedSequences(mockProjA as unknown as Project, [
|
||||
mockSeq2 as unknown as Sequence,
|
||||
])
|
||||
expect(resultsSeq2).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
|
||||
describe('normalizeGuid', () => {
|
||||
it('normalizes GUIDs with uppercase, braces, whitespace, and objects', () => {
|
||||
expect(normalizeGuid('{1234-ABCD-5678}')).toBe('1234-abcd-5678')
|
||||
expect(normalizeGuid(' ABC-DEF ')).toBe('abc-def')
|
||||
expect(normalizeGuid({ toString: () => '{Guid-Obj}' })).toBe('guid-obj')
|
||||
expect(normalizeGuid(null)).toBe('')
|
||||
expect(normalizeGuid(undefined)).toBe('')
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,472 @@
|
||||
import type { Marker, Project, Sequence } from '@adobe/premierepro'
|
||||
import { getPremiereModule } from './premiere'
|
||||
import type { LinkedSequenceAsset } from '../types/link'
|
||||
import { getStoredCredentials } from './storage'
|
||||
import { fetchAssetComments, formatCommentBody } from './commentUtils'
|
||||
import { isSameEndpoint } from '../utils/url'
|
||||
|
||||
export const LINK_STORAGE_PROP_KEY = 'shumai_linked_asset'
|
||||
const STORAGE_PREFIX = '@shumai/premiere-uxp:project-links'
|
||||
|
||||
/**
|
||||
* Normalizes a GUID or string identifier by removing curly braces,
|
||||
* trimming whitespace, and converting to lower case for reliable comparison.
|
||||
*/
|
||||
export function normalizeGuid(guid: unknown): string {
|
||||
if (!guid) return ''
|
||||
const str =
|
||||
typeof guid === 'string'
|
||||
? guid
|
||||
: typeof (guid as { toString?: () => string }).toString === 'function'
|
||||
? (guid as { toString: () => string }).toString()
|
||||
: String(guid)
|
||||
return str.trim().toLowerCase().replace(/[{}]/g, '')
|
||||
}
|
||||
|
||||
function getStorageKey(projectGuid?: string | null): string {
|
||||
return `${STORAGE_PREFIX}:${projectGuid ? normalizeGuid(projectGuid) : 'default'}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads all cached sequence links for a project from localStorage.
|
||||
* If projectGuid is omitted or null, aggregates across all project keys in localStorage.
|
||||
*/
|
||||
export function getAllSequenceLinksFromCache(projectGuid?: string | null): LinkedSequenceAsset[] {
|
||||
if (typeof localStorage === 'undefined') return []
|
||||
try {
|
||||
const normProj = projectGuid ? normalizeGuid(projectGuid) : null
|
||||
if (normProj) {
|
||||
const raw = localStorage.getItem(getStorageKey(normProj))
|
||||
if (raw) {
|
||||
const parsed = JSON.parse(raw)
|
||||
if (Array.isArray(parsed)) return parsed
|
||||
if (typeof parsed === 'object' && parsed !== null) {
|
||||
return Object.values(parsed)
|
||||
}
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
// When projectGuid is not provided, aggregate all cached sequence links
|
||||
const results: LinkedSequenceAsset[] = []
|
||||
const seenGuids = new Set<string>()
|
||||
|
||||
// Check default key
|
||||
const defaultRaw = localStorage.getItem(getStorageKey(null))
|
||||
if (defaultRaw) {
|
||||
try {
|
||||
const parsed = JSON.parse(defaultRaw)
|
||||
const items: LinkedSequenceAsset[] = Array.isArray(parsed)
|
||||
? parsed
|
||||
: typeof parsed === 'object' && parsed !== null
|
||||
? Object.values(parsed)
|
||||
: []
|
||||
for (const item of items) {
|
||||
const normSeq = normalizeGuid(item.sequenceGuid)
|
||||
if (normSeq && !seenGuids.has(normSeq)) {
|
||||
seenGuids.add(normSeq)
|
||||
results.push(item)
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Ignore JSON error
|
||||
}
|
||||
}
|
||||
|
||||
// Scan all keys matching STORAGE_PREFIX in localStorage
|
||||
if (typeof localStorage.length === 'number') {
|
||||
for (let i = 0; i < localStorage.length; i++) {
|
||||
const key = typeof localStorage.key === 'function' ? localStorage.key(i) : null
|
||||
if (key && key.startsWith(STORAGE_PREFIX)) {
|
||||
const raw = localStorage.getItem(key)
|
||||
if (raw) {
|
||||
try {
|
||||
const parsed = JSON.parse(raw)
|
||||
const items: LinkedSequenceAsset[] = Array.isArray(parsed)
|
||||
? parsed
|
||||
: typeof parsed === 'object' && parsed !== null
|
||||
? Object.values(parsed)
|
||||
: []
|
||||
for (const item of items) {
|
||||
const normSeq = normalizeGuid(item.sequenceGuid)
|
||||
if (normSeq && !seenGuids.has(normSeq)) {
|
||||
seenGuids.add(normSeq)
|
||||
results.push(item)
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Ignore corrupted item
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results
|
||||
} catch (err) {
|
||||
console.warn('[linkStorage] Failed to read cached links from localStorage:', err)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a cached sequence link by sequence GUID from localStorage.
|
||||
*/
|
||||
export function getSequenceLinkFromCache(
|
||||
sequenceGuid: string,
|
||||
projectGuid?: string | null,
|
||||
): LinkedSequenceAsset | null {
|
||||
const normSeq = normalizeGuid(sequenceGuid)
|
||||
const all = getAllSequenceLinksFromCache(projectGuid)
|
||||
return all.find((item) => normalizeGuid(item.sequenceGuid) === normSeq) || null
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a sequence link in the local cache.
|
||||
*/
|
||||
export function saveSequenceLinkToCache(
|
||||
linkData: LinkedSequenceAsset,
|
||||
projectGuid?: string | null,
|
||||
): void {
|
||||
if (typeof localStorage === 'undefined') return
|
||||
try {
|
||||
const normSeq = normalizeGuid(linkData.sequenceGuid)
|
||||
const normalizedData: LinkedSequenceAsset = {
|
||||
...linkData,
|
||||
sequenceGuid: normSeq,
|
||||
...(linkData.syncedMarkerGuids != null
|
||||
? { syncedMarkerGuids: linkData.syncedMarkerGuids.map(normalizeGuid).filter(Boolean) }
|
||||
: {}),
|
||||
}
|
||||
|
||||
if (projectGuid) {
|
||||
const all = getAllSequenceLinksFromCache(projectGuid).filter(
|
||||
(item) => normalizeGuid(item.sequenceGuid) !== normSeq,
|
||||
)
|
||||
all.push(normalizedData)
|
||||
localStorage.setItem(getStorageKey(projectGuid), JSON.stringify(all))
|
||||
}
|
||||
|
||||
// Always also update default key so it's accessible when projectGuid is unknown
|
||||
const defaultAll = getAllSequenceLinksFromCache(null).filter(
|
||||
(item) => normalizeGuid(item.sequenceGuid) !== normSeq,
|
||||
)
|
||||
defaultAll.push(normalizedData)
|
||||
localStorage.setItem(getStorageKey(null), JSON.stringify(defaultAll))
|
||||
} catch (err) {
|
||||
console.warn('[linkStorage] Failed to save link to localStorage:', err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a sequence link from the local cache.
|
||||
*/
|
||||
export function removeSequenceLinkFromCache(
|
||||
sequenceGuid: string,
|
||||
projectGuid?: string | null,
|
||||
): void {
|
||||
if (typeof localStorage === 'undefined') return
|
||||
try {
|
||||
const normSeq = normalizeGuid(sequenceGuid)
|
||||
if (projectGuid) {
|
||||
const all = getAllSequenceLinksFromCache(projectGuid).filter(
|
||||
(item) => normalizeGuid(item.sequenceGuid) !== normSeq,
|
||||
)
|
||||
localStorage.setItem(getStorageKey(projectGuid), JSON.stringify(all))
|
||||
}
|
||||
|
||||
const defaultAll = getAllSequenceLinksFromCache(null).filter(
|
||||
(item) => normalizeGuid(item.sequenceGuid) !== normSeq,
|
||||
)
|
||||
localStorage.setItem(getStorageKey(null), JSON.stringify(defaultAll))
|
||||
|
||||
// Also remove from any other keys matching STORAGE_PREFIX
|
||||
if (typeof localStorage.length === 'number') {
|
||||
for (let i = 0; i < localStorage.length; i++) {
|
||||
const key = typeof localStorage.key === 'function' ? localStorage.key(i) : null
|
||||
if (key && key.startsWith(STORAGE_PREFIX)) {
|
||||
const raw = localStorage.getItem(key)
|
||||
if (raw) {
|
||||
try {
|
||||
const parsed = JSON.parse(raw)
|
||||
if (Array.isArray(parsed)) {
|
||||
const filtered = parsed.filter(
|
||||
(item) => normalizeGuid(item.sequenceGuid) !== normSeq,
|
||||
)
|
||||
localStorage.setItem(key, JSON.stringify(filtered))
|
||||
}
|
||||
} catch {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[linkStorage] Failed to remove link from localStorage:', err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the persistent link metadata from a sequence's properties.
|
||||
*/
|
||||
export async function getSequenceLink(
|
||||
sequence: Sequence,
|
||||
project?: Project | null,
|
||||
): Promise<LinkedSequenceAsset | null> {
|
||||
const ppro = getPremiereModule()
|
||||
const seqGuidStr = normalizeGuid(sequence.guid)
|
||||
const prGuidStr = project?.guid ? normalizeGuid(project.guid) : null
|
||||
|
||||
// Check persistent sequence properties in Premiere
|
||||
if (ppro?.Properties) {
|
||||
try {
|
||||
const properties = await ppro.Properties.getProperties(sequence)
|
||||
const raw = properties.getValue(LINK_STORAGE_PROP_KEY)
|
||||
if (raw) {
|
||||
const parsed = JSON.parse(raw) as LinkedSequenceAsset
|
||||
// Synchronize with cache
|
||||
saveSequenceLinkToCache(parsed, prGuidStr)
|
||||
return parsed
|
||||
}
|
||||
} catch (err) {
|
||||
// Property might not exist or failed to load
|
||||
console.debug('[linkStorage] No persistent property found or failed:', err)
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to local cache if sequence property was not available
|
||||
return getSequenceLinkFromCache(seqGuidStr, prGuidStr)
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all linked sequence assets across a project.
|
||||
*/
|
||||
export async function getAllLinkedSequences(
|
||||
project: Project,
|
||||
allSequences?: Sequence[],
|
||||
): Promise<LinkedSequenceAsset[]> {
|
||||
const prGuidStr = project.guid ? normalizeGuid(project.guid) : null
|
||||
const seqs = allSequences || (await project.getSequences()) || []
|
||||
|
||||
const results: LinkedSequenceAsset[] = []
|
||||
const checkedGuids = new Set<string>()
|
||||
|
||||
for (const seq of seqs) {
|
||||
const seqGuid = normalizeGuid(seq.guid)
|
||||
if (seqGuid) checkedGuids.add(seqGuid)
|
||||
const link = await getSequenceLink(seq, project)
|
||||
if (link) {
|
||||
results.push(link)
|
||||
}
|
||||
}
|
||||
|
||||
// Also check cache for any items matching known sequences
|
||||
const cached = getAllSequenceLinksFromCache(prGuidStr)
|
||||
for (const item of cached) {
|
||||
const normItemSeq = normalizeGuid(item.sequenceGuid)
|
||||
if (!results.some((r) => normalizeGuid(r.sequenceGuid) === normItemSeq)) {
|
||||
if (checkedGuids.has(normItemSeq)) {
|
||||
results.push(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the link metadata persistently on the sequence and in the cache.
|
||||
*/
|
||||
export async function saveSequenceLink(
|
||||
project: Project,
|
||||
sequence: Sequence,
|
||||
linkData: LinkedSequenceAsset,
|
||||
): Promise<boolean> {
|
||||
const ppro = getPremiereModule()
|
||||
const prGuidStr = project.guid ? normalizeGuid(project.guid) : null
|
||||
|
||||
// Always update cache first
|
||||
saveSequenceLinkToCache(linkData, prGuidStr)
|
||||
|
||||
if (!ppro?.Properties) {
|
||||
return true
|
||||
}
|
||||
|
||||
try {
|
||||
const properties = await ppro.Properties.getProperties(sequence)
|
||||
const persistentType =
|
||||
ppro.Constants?.PropertyType?.PERSISTENT ?? ppro.Properties.PROPERTY_PERSISTENT ?? 0
|
||||
|
||||
let success = false
|
||||
project.lockedAccess(() => {
|
||||
success = project.executeTransaction((compoundAction) => {
|
||||
const setValAction = properties.createSetValueAction(
|
||||
LINK_STORAGE_PROP_KEY,
|
||||
JSON.stringify(linkData),
|
||||
persistentType,
|
||||
)
|
||||
compoundAction.addAction(setValAction)
|
||||
}, 'Save Shumai Link')
|
||||
})
|
||||
return success
|
||||
} catch (err) {
|
||||
console.warn('[linkStorage] Failed to set sequence persistent property:', err)
|
||||
return true // Local cache succeeded
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the persistent link metadata from the sequence and cache,
|
||||
* and deletes any markers that were synced from Shumai (matching Frame.io behavior).
|
||||
*/
|
||||
export async function removeSequenceLink(project: Project, sequence: Sequence): Promise<boolean> {
|
||||
const ppro = getPremiereModule()
|
||||
const seqGuidStr = normalizeGuid(sequence.guid)
|
||||
const prGuidStr = project.guid ? normalizeGuid(project.guid) : null
|
||||
|
||||
console.log('[linkStorage] removeSequenceLink called for sequence:', sequence.name || seqGuidStr)
|
||||
|
||||
// Retrieve link metadata before clearing, to identify synced marker GUIDs
|
||||
let linkData = await getSequenceLink(sequence, project)
|
||||
if (!linkData) {
|
||||
const cached = getAllSequenceLinksFromCache(prGuidStr)
|
||||
linkData = cached.find((item) => normalizeGuid(item.sequenceGuid) === seqGuidStr) || null
|
||||
}
|
||||
console.log(
|
||||
'[linkStorage] Retrieved linkData:',
|
||||
linkData ? { assetId: linkData.assetId, guidsCount: linkData.syncedMarkerGuids?.length } : null,
|
||||
)
|
||||
|
||||
// Remove from cache
|
||||
removeSequenceLinkFromCache(seqGuidStr, prGuidStr)
|
||||
|
||||
// Remove synced markers from the sequence timeline
|
||||
if (ppro?.Markers) {
|
||||
try {
|
||||
const sequenceMarkers = await ppro.Markers.getMarkers(sequence)
|
||||
const allMarkers = sequenceMarkers.getMarkers() || []
|
||||
console.log('[linkStorage] Found', allMarkers.length, 'markers on sequence timeline')
|
||||
|
||||
const targetGuids = new Set(
|
||||
(linkData?.syncedMarkerGuids || []).map(normalizeGuid).filter(Boolean),
|
||||
)
|
||||
console.log('[linkStorage] targetGuids count:', targetGuids.size)
|
||||
|
||||
const markersToRemove: Marker[] = []
|
||||
|
||||
// 1. Match markers by GUID
|
||||
if (targetGuids.size > 0) {
|
||||
for (const m of allMarkers) {
|
||||
const g = normalizeGuid(m.guid)
|
||||
if (g && targetGuids.has(g)) {
|
||||
markersToRemove.push(m)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Fallback: If targetGuids was empty/missing or didn't find markers, match by asset comments
|
||||
if (markersToRemove.length === 0 && linkData?.assetId) {
|
||||
console.log(
|
||||
'[linkStorage] Fallback: attempting comment-based marker identification for asset:',
|
||||
linkData.assetId,
|
||||
)
|
||||
try {
|
||||
const creds = getStoredCredentials()
|
||||
const canFetchComments =
|
||||
creds?.endpoint &&
|
||||
creds?.apiKey &&
|
||||
(!linkData.endpoint || isSameEndpoint(linkData.endpoint, creds.endpoint))
|
||||
if (canFetchComments) {
|
||||
const comments = await fetchAssetComments(
|
||||
creds.endpoint,
|
||||
creds.apiKey,
|
||||
linkData.assetId,
|
||||
)
|
||||
for (const comm of comments) {
|
||||
const commBody = formatCommentBody(comm)
|
||||
const commAuthor = comm.creator?.name || 'Comment'
|
||||
for (const m of allMarkers) {
|
||||
if (markersToRemove.includes(m)) continue
|
||||
try {
|
||||
const mName = m.getName()
|
||||
const mComments = m.getComments()
|
||||
if (
|
||||
(mName === commAuthor && mComments === commBody) ||
|
||||
(mComments && comm.message && mComments.includes(comm.message))
|
||||
) {
|
||||
markersToRemove.push(m)
|
||||
break
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[linkStorage] Fallback comment fetch failed:', err)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('[linkStorage] Total markers to remove:', markersToRemove.length)
|
||||
|
||||
if (markersToRemove.length > 0) {
|
||||
let removeSuccess = false
|
||||
try {
|
||||
project.lockedAccess(() => {
|
||||
removeSuccess = project.executeTransaction((compoundAction) => {
|
||||
for (const marker of markersToRemove) {
|
||||
const removeAction = sequenceMarkers.createRemoveMarkerAction(marker)
|
||||
compoundAction.addAction(removeAction)
|
||||
}
|
||||
}, 'Remove Shumai Synced Markers')
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('[linkStorage] executeTransaction batch remove failed:', err)
|
||||
}
|
||||
|
||||
console.log('[linkStorage] Batch remove result:', removeSuccess)
|
||||
|
||||
// If batch compound action did not succeed, attempt individual removals
|
||||
if (!removeSuccess) {
|
||||
console.warn('[linkStorage] Batch remove returned false, attempting individual removals')
|
||||
for (const marker of markersToRemove) {
|
||||
try {
|
||||
project.lockedAccess(() => {
|
||||
project.executeTransaction((compoundAction) => {
|
||||
const removeAction = sequenceMarkers.createRemoveMarkerAction(marker)
|
||||
compoundAction.addAction(removeAction)
|
||||
}, 'Remove Shumai Synced Marker')
|
||||
})
|
||||
} catch (indErr) {
|
||||
console.warn('[linkStorage] Failed individual remove:', indErr)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[linkStorage] Failed to remove synced markers from sequence:', err)
|
||||
}
|
||||
}
|
||||
|
||||
if (!ppro?.Properties) {
|
||||
return true
|
||||
}
|
||||
|
||||
try {
|
||||
const properties = await ppro.Properties.getProperties(sequence)
|
||||
let success = false
|
||||
project.lockedAccess(() => {
|
||||
success = project.executeTransaction((compoundAction) => {
|
||||
const clearAction = properties.createClearValueAction(LINK_STORAGE_PROP_KEY)
|
||||
compoundAction.addAction(clearAction)
|
||||
}, 'Unlink Shumai Asset')
|
||||
})
|
||||
console.log('[linkStorage] Clear property result:', success)
|
||||
return success
|
||||
} catch (err) {
|
||||
console.warn('[linkStorage] Failed to clear sequence persistent property:', err)
|
||||
return true // Cache was cleared
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,405 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { formatCommentBody, syncCommentsToSequence } from './markers'
|
||||
import type { Project, Sequence } from '@adobe/premierepro'
|
||||
import type { CommentInfo } from '@shumai/dtos'
|
||||
import type { LinkedSequenceAsset } from '../types/link'
|
||||
|
||||
const localStorageMock = (() => {
|
||||
let store: Record<string, string> = {}
|
||||
return {
|
||||
getItem: (key: string) => store[key] || null,
|
||||
setItem: (key: string, value: string) => {
|
||||
store[key] = value.toString()
|
||||
},
|
||||
removeItem: (key: string) => {
|
||||
delete store[key]
|
||||
},
|
||||
clear: () => {
|
||||
store = {}
|
||||
},
|
||||
}
|
||||
})()
|
||||
|
||||
Object.defineProperty(globalThis, 'localStorage', {
|
||||
value: localStorageMock,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
})
|
||||
|
||||
describe('markers service', () => {
|
||||
beforeEach(() => {
|
||||
localStorage.clear()
|
||||
vi.restoreAllMocks()
|
||||
// Reset global require
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
delete (globalThis as any).require
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
delete (globalThis as any).window
|
||||
})
|
||||
|
||||
describe('formatCommentBody', () => {
|
||||
it('formats simple comment without replies', () => {
|
||||
const comment: Partial<CommentInfo> = {
|
||||
message: 'This is a test comment',
|
||||
replies: [],
|
||||
}
|
||||
expect(formatCommentBody(comment as CommentInfo)).toBe('This is a test comment')
|
||||
})
|
||||
|
||||
it('appends formatted replies beneath message', () => {
|
||||
const comment: Partial<CommentInfo> = {
|
||||
message: 'Original cut feedback',
|
||||
replies: [
|
||||
{
|
||||
creator: { id: 'u2', name: 'Alice' },
|
||||
message: 'Fixed in v2',
|
||||
} as unknown as CommentInfo,
|
||||
{
|
||||
creator: { id: 'u3', name: 'Bob' },
|
||||
message: 'Looks great now',
|
||||
} as unknown as CommentInfo,
|
||||
],
|
||||
}
|
||||
const formatted = formatCommentBody(comment as CommentInfo)
|
||||
expect(formatted).toContain('Original cut feedback')
|
||||
expect(formatted).toContain('--- Replies ---')
|
||||
expect(formatted).toContain('Alice: Fixed in v2')
|
||||
expect(formatted).toContain('Bob: Looks great now')
|
||||
})
|
||||
})
|
||||
|
||||
describe('syncCommentsToSequence', () => {
|
||||
const existingLink: LinkedSequenceAsset = {
|
||||
sequenceGuid: 'seq-guid-1',
|
||||
sequenceName: 'Seq 1',
|
||||
assetId: 'asset-1',
|
||||
assetName: 'test.mp4',
|
||||
syncedCommentIds: ['comm-1'],
|
||||
lastSyncAt: 1000,
|
||||
totalCommentsSynced: 1,
|
||||
}
|
||||
|
||||
it('returns without creating markers if no new comments exist', async () => {
|
||||
const comments: Partial<CommentInfo>[] = [
|
||||
{ id: 'comm-1', second: 10, message: 'Already synced' },
|
||||
]
|
||||
|
||||
const mockProject = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn(),
|
||||
executeTransaction: vi.fn(),
|
||||
}
|
||||
const mockSeq = { guid: 'seq-guid-1' }
|
||||
|
||||
const result = await syncCommentsToSequence(
|
||||
mockProject as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
comments as CommentInfo[],
|
||||
existingLink,
|
||||
)
|
||||
|
||||
expect(result.addedCount).toBe(0)
|
||||
expect(result.updatedLink.syncedCommentIds).toEqual(['comm-1'])
|
||||
expect(mockProject.executeTransaction).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('creates markers for new comments, placing non-timestamped comments at time 0 (zeroPoint)', async () => {
|
||||
const mockCompoundAction = { addAction: vi.fn() }
|
||||
let callCount = 0
|
||||
const mockSeqMarkers = {
|
||||
getMarkers: vi.fn().mockImplementation(() => {
|
||||
callCount++
|
||||
if (callCount === 1) {
|
||||
return [{ guid: 'old-guid-1' }]
|
||||
}
|
||||
return [{ guid: 'old-guid-1' }, { guid: 'marker-guid-2' }, { guid: 'marker-guid-3' }]
|
||||
}),
|
||||
createAddMarkerAction: vi.fn().mockImplementation((name, type, time, dur, comment) => {
|
||||
return { name, type, time, dur, comment }
|
||||
}),
|
||||
}
|
||||
|
||||
const mockPpro = {
|
||||
Marker: { MARKER_TYPE_COMMENT: 'CommentMarkerType' },
|
||||
Markers: {
|
||||
getMarkers: vi.fn().mockResolvedValue(mockSeqMarkers),
|
||||
},
|
||||
TickTime: {
|
||||
TIME_ZERO: { ticks: '0' },
|
||||
createWithSeconds: vi.fn((sec) => ({ seconds: sec })),
|
||||
},
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue({
|
||||
createSetValueAction: vi.fn().mockReturnValue({}),
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const comments: Partial<CommentInfo>[] = [
|
||||
{ id: 'comm-1', second: 10, message: 'Already synced' },
|
||||
{
|
||||
id: 'comm-2',
|
||||
second: 15.5,
|
||||
message: 'New timestamped comment',
|
||||
creator: { id: 'u1', name: 'Director' } as unknown as CommentInfo['creator'],
|
||||
replies: [],
|
||||
},
|
||||
{
|
||||
id: 'comm-3',
|
||||
second: null,
|
||||
message: 'General comment without timestamp',
|
||||
creator: { id: 'u2', name: 'Producer' } as unknown as CommentInfo['creator'],
|
||||
replies: [],
|
||||
},
|
||||
]
|
||||
|
||||
const mockProject = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn((cb) => cb()),
|
||||
executeTransaction: vi.fn((cb) => {
|
||||
cb(mockCompoundAction)
|
||||
return true
|
||||
}),
|
||||
}
|
||||
const mockSeq = {
|
||||
guid: 'seq-guid-1',
|
||||
getZeroPoint: vi.fn().mockResolvedValue({ seconds: 3600 }), // 1hr timecode start
|
||||
}
|
||||
|
||||
const result = await syncCommentsToSequence(
|
||||
mockProject as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
comments as CommentInfo[],
|
||||
existingLink,
|
||||
)
|
||||
|
||||
expect(result.addedCount).toBe(2)
|
||||
expect(result.updatedLink.syncedCommentIds).toEqual(['comm-1', 'comm-2', 'comm-3'])
|
||||
expect(result.updatedLink.syncedMarkerGuids).toEqual(['marker-guid-2', 'marker-guid-3'])
|
||||
expect(result.updatedLink.totalCommentsSynced).toBe(3)
|
||||
|
||||
// Time should be offset by zeroPoint (3600 + 15.5 = 3615.5 for comm-2, 3600 + 0 = 3600 for comm-3)
|
||||
expect(mockPpro.TickTime.createWithSeconds).toHaveBeenCalledWith(3615.5)
|
||||
expect(mockPpro.TickTime.createWithSeconds).toHaveBeenCalledWith(3600)
|
||||
expect(mockSeqMarkers.createAddMarkerAction).toHaveBeenCalledWith(
|
||||
'Director',
|
||||
'CommentMarkerType',
|
||||
{ seconds: 3615.5 },
|
||||
mockPpro.TickTime.TIME_ZERO,
|
||||
'New timestamped comment',
|
||||
)
|
||||
expect(mockSeqMarkers.createAddMarkerAction).toHaveBeenCalledWith(
|
||||
'Producer',
|
||||
'CommentMarkerType',
|
||||
{ seconds: 3600 },
|
||||
mockPpro.TickTime.TIME_ZERO,
|
||||
'General comment without timestamp',
|
||||
)
|
||||
expect(mockSeqMarkers.createAddMarkerAction).toHaveBeenCalledTimes(2)
|
||||
expect(mockCompoundAction.addAction).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('backfills missing marker GUIDs from sequence when syncedMarkerGuids is incomplete', async () => {
|
||||
const existingLink: LinkedSequenceAsset = {
|
||||
sequenceGuid: 'seq-guid-1',
|
||||
sequenceName: 'Sequence 01',
|
||||
assetId: 'asset-1',
|
||||
assetName: 'video.mp4',
|
||||
syncedCommentIds: ['comm-1'],
|
||||
syncedMarkerGuids: [], // missing GUIDs from previous sync
|
||||
totalCommentsSynced: 1,
|
||||
lastSyncAt: 1000,
|
||||
}
|
||||
|
||||
const mockLegacyMarker = {
|
||||
guid: '{LEGACY-MARKER-GUID-1}',
|
||||
getName: () => 'Director',
|
||||
getComments: () => 'Existing comment message',
|
||||
}
|
||||
|
||||
const mockSeqMarkers = {
|
||||
getMarkers: vi.fn().mockReturnValue([mockLegacyMarker]),
|
||||
createAddMarkerAction: vi.fn(),
|
||||
}
|
||||
|
||||
const mockPpro = {
|
||||
Marker: { MARKER_TYPE_COMMENT: 'CommentMarkerType' },
|
||||
Markers: {
|
||||
getMarkers: vi.fn().mockResolvedValue(mockSeqMarkers),
|
||||
},
|
||||
TickTime: {
|
||||
TIME_ZERO: { ticks: '0' },
|
||||
createWithSeconds: vi.fn((sec) => ({ seconds: sec })),
|
||||
},
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue({
|
||||
createSetValueAction: vi.fn().mockReturnValue({}),
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const comments: Partial<CommentInfo>[] = [
|
||||
{
|
||||
id: 'comm-1',
|
||||
second: 10,
|
||||
message: 'Existing comment message',
|
||||
creator: { id: 'u1', name: 'Director' } as unknown as CommentInfo['creator'],
|
||||
replies: [],
|
||||
},
|
||||
]
|
||||
|
||||
const mockProject = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn((cb) => cb()),
|
||||
executeTransaction: vi.fn(),
|
||||
}
|
||||
const mockSeq = {
|
||||
guid: 'seq-guid-1',
|
||||
getZeroPoint: vi.fn().mockResolvedValue({ seconds: 0 }),
|
||||
}
|
||||
|
||||
const result = await syncCommentsToSequence(
|
||||
mockProject as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
comments as CommentInfo[],
|
||||
existingLink,
|
||||
)
|
||||
|
||||
expect(result.addedCount).toBe(0)
|
||||
expect(result.updatedLink.syncedMarkerGuids).toEqual(['legacy-marker-guid-1'])
|
||||
expect(mockSeqMarkers.createAddMarkerAction).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('does not advance synced comments when executeTransaction returns false', async () => {
|
||||
const mockSeqMarkers = {
|
||||
getMarkers: vi.fn().mockReturnValue([]),
|
||||
createAddMarkerAction: vi.fn().mockReturnValue({}),
|
||||
}
|
||||
|
||||
const mockPpro = {
|
||||
Marker: { MARKER_TYPE_COMMENT: 'CommentMarkerType' },
|
||||
Markers: {
|
||||
getMarkers: vi.fn().mockResolvedValue(mockSeqMarkers),
|
||||
},
|
||||
TickTime: {
|
||||
TIME_ZERO: { ticks: '0' },
|
||||
createWithSeconds: vi.fn((sec) => ({ seconds: sec })),
|
||||
},
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue({
|
||||
createSetValueAction: vi.fn().mockReturnValue({}),
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const comments: Partial<CommentInfo>[] = [
|
||||
{ id: 'comm-1', second: 10, message: 'Already synced' },
|
||||
{ id: 'comm-2', second: 20, message: 'New comment' },
|
||||
]
|
||||
|
||||
const mockProject = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn((cb) => cb()),
|
||||
executeTransaction: vi.fn().mockReturnValue(false),
|
||||
}
|
||||
const mockSeq = {
|
||||
guid: 'seq-guid-1',
|
||||
getZeroPoint: vi.fn().mockResolvedValue({ seconds: 0 }),
|
||||
}
|
||||
|
||||
const result = await syncCommentsToSequence(
|
||||
mockProject as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
comments as CommentInfo[],
|
||||
existingLink,
|
||||
)
|
||||
|
||||
expect(result.addedCount).toBe(0)
|
||||
expect(result.updatedLink.syncedCommentIds).toEqual(['comm-1'])
|
||||
expect(result.updatedLink.totalCommentsSynced).toBe(1)
|
||||
})
|
||||
|
||||
it('does not advance synced comments when executeTransaction throws an error', async () => {
|
||||
const mockSeqMarkers = {
|
||||
getMarkers: vi.fn().mockReturnValue([]),
|
||||
createAddMarkerAction: vi.fn().mockReturnValue({}),
|
||||
}
|
||||
|
||||
const mockPpro = {
|
||||
Marker: { MARKER_TYPE_COMMENT: 'CommentMarkerType' },
|
||||
Markers: {
|
||||
getMarkers: vi.fn().mockResolvedValue(mockSeqMarkers),
|
||||
},
|
||||
TickTime: {
|
||||
TIME_ZERO: { ticks: '0' },
|
||||
createWithSeconds: vi.fn((sec) => ({ seconds: sec })),
|
||||
},
|
||||
Properties: {
|
||||
getProperties: vi.fn().mockResolvedValue({
|
||||
createSetValueAction: vi.fn().mockReturnValue({}),
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const comments: Partial<CommentInfo>[] = [
|
||||
{ id: 'comm-1', second: 10, message: 'Already synced' },
|
||||
{ id: 'comm-2', second: 20, message: 'New comment' },
|
||||
]
|
||||
|
||||
const mockProject = {
|
||||
guid: 'proj-1',
|
||||
lockedAccess: vi.fn(() => {
|
||||
throw new Error('Transaction execution crashed')
|
||||
}),
|
||||
executeTransaction: vi.fn(),
|
||||
}
|
||||
const mockSeq = {
|
||||
guid: 'seq-guid-1',
|
||||
getZeroPoint: vi.fn().mockResolvedValue({ seconds: 0 }),
|
||||
}
|
||||
|
||||
const result = await syncCommentsToSequence(
|
||||
mockProject as unknown as Project,
|
||||
mockSeq as unknown as Sequence,
|
||||
comments as CommentInfo[],
|
||||
existingLink,
|
||||
)
|
||||
|
||||
expect(result.addedCount).toBe(0)
|
||||
expect(result.updatedLink.syncedCommentIds).toEqual(['comm-1'])
|
||||
expect(result.updatedLink.totalCommentsSynced).toBe(1)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,179 @@
|
||||
import type { Project, Sequence } from '@adobe/premierepro'
|
||||
import { getPremiereModule } from './premiere'
|
||||
import type { LinkedSequenceAsset } from '../types/link'
|
||||
import { normalizeGuid, saveSequenceLink } from './linkStorage'
|
||||
import type { CommentInfo } from '@shumai/dtos'
|
||||
import { fetchAssetComments, formatCommentBody } from './commentUtils'
|
||||
|
||||
export { fetchAssetComments, formatCommentBody }
|
||||
|
||||
export interface SyncCommentsResult {
|
||||
updatedLink: LinkedSequenceAsset
|
||||
addedCount: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronizes new Shumai comments to a Premiere Pro sequence as markers.
|
||||
* Comments without timestamps (`second == null`) default to time 0 (sequence start),
|
||||
* matching Frame.io convention. Newly created marker GUIDs are captured and stored
|
||||
* so they can be accurately removed when the sequence is unlinked.
|
||||
*/
|
||||
export async function syncCommentsToSequence(
|
||||
project: Project,
|
||||
sequence: Sequence,
|
||||
comments: CommentInfo[],
|
||||
existingLink: LinkedSequenceAsset,
|
||||
): Promise<SyncCommentsResult> {
|
||||
const ppro = getPremiereModule()
|
||||
const now = Date.now()
|
||||
|
||||
// Filter comments that have not been synced yet; non-timestamped comments default to time 0
|
||||
const alreadySyncedSet = new Set(existingLink.syncedCommentIds)
|
||||
const newComments = comments.filter((c) => !alreadySyncedSet.has(c.id))
|
||||
|
||||
const currentMarkerGuids = (existingLink.syncedMarkerGuids || [])
|
||||
.map(normalizeGuid)
|
||||
.filter(Boolean)
|
||||
const needsGuidBackfill =
|
||||
currentMarkerGuids.length < (existingLink.syncedCommentIds?.length || 0) &&
|
||||
ppro?.Markers != null
|
||||
|
||||
if (newComments.length === 0 && !needsGuidBackfill) {
|
||||
const updatedLink: LinkedSequenceAsset = {
|
||||
...existingLink,
|
||||
lastSyncAt: now,
|
||||
}
|
||||
await saveSequenceLink(project, sequence, updatedLink)
|
||||
return { updatedLink, addedCount: 0 }
|
||||
}
|
||||
|
||||
if (!ppro?.Markers || !ppro?.TickTime) {
|
||||
console.warn('[markers] premierepro Markers or TickTime module not available')
|
||||
return { updatedLink: existingLink, addedCount: 0 }
|
||||
}
|
||||
|
||||
const newMarkerGuids: string[] = []
|
||||
|
||||
try {
|
||||
const sequenceMarkers = await ppro.Markers.getMarkers(sequence)
|
||||
let zeroPointSeconds = 0
|
||||
|
||||
try {
|
||||
const zeroPoint = await sequence.getZeroPoint()
|
||||
if (zeroPoint && typeof zeroPoint.seconds === 'number') {
|
||||
zeroPointSeconds = zeroPoint.seconds
|
||||
}
|
||||
} catch {
|
||||
// zeroPoint defaults to 0
|
||||
}
|
||||
|
||||
// Capture existing marker GUIDs before adding new markers
|
||||
let beforeGuids = new Set<string>()
|
||||
try {
|
||||
const beforeMarkers = sequenceMarkers.getMarkers() || []
|
||||
beforeGuids = new Set(beforeMarkers.map((m) => normalizeGuid(m.guid)).filter(Boolean))
|
||||
console.log('[markers] Existing markers before sync:', beforeMarkers.length)
|
||||
} catch (err) {
|
||||
console.warn('[markers] Could not get existing markers before sync:', err)
|
||||
}
|
||||
|
||||
if (newComments.length > 0) {
|
||||
let txSuccess = false
|
||||
project.lockedAccess(() => {
|
||||
txSuccess =
|
||||
project.executeTransaction((compoundAction) => {
|
||||
for (const comment of newComments) {
|
||||
const markerSeconds = zeroPointSeconds + (comment.second ?? 0)
|
||||
const startTime = ppro.TickTime.createWithSeconds(markerSeconds)
|
||||
const duration = ppro.TickTime.TIME_ZERO
|
||||
const markerName = comment.creator?.name || 'Comment'
|
||||
const markerText = formatCommentBody(comment)
|
||||
|
||||
const addMarkerAction = sequenceMarkers.createAddMarkerAction(
|
||||
markerName,
|
||||
ppro.Marker.MARKER_TYPE_COMMENT,
|
||||
startTime,
|
||||
duration,
|
||||
markerText,
|
||||
)
|
||||
compoundAction.addAction(addMarkerAction)
|
||||
}
|
||||
}, 'Sync Shumai Comments') === true
|
||||
})
|
||||
console.log('[markers] executeTransaction result:', txSuccess)
|
||||
|
||||
if (!txSuccess) {
|
||||
console.warn('[markers] Failed to execute add markers transaction (returned false)')
|
||||
return { updatedLink: existingLink, addedCount: 0 }
|
||||
}
|
||||
}
|
||||
|
||||
// Re-fetch fresh Markers object after transaction to ensure newly committed markers are seen
|
||||
const freshSequenceMarkers = await ppro.Markers.getMarkers(sequence)
|
||||
const afterMarkers = freshSequenceMarkers.getMarkers() || []
|
||||
console.log('[markers] Markers after sync transaction:', afterMarkers.length)
|
||||
|
||||
// 1. Identify newly added markers by GUID difference
|
||||
for (const m of afterMarkers) {
|
||||
const guidStr = normalizeGuid(m.guid)
|
||||
if (guidStr && !beforeGuids.has(guidStr) && !newMarkerGuids.includes(guidStr)) {
|
||||
newMarkerGuids.push(guidStr)
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Fallback / Backfill: Match any comment markers by content/author
|
||||
const allExpectedComments = [...newComments]
|
||||
if (needsGuidBackfill) {
|
||||
const alreadySyncedComments = comments.filter((c) => alreadySyncedSet.has(c.id))
|
||||
allExpectedComments.push(...alreadySyncedComments)
|
||||
}
|
||||
|
||||
const currentKnownGuids = new Set([...currentMarkerGuids, ...newMarkerGuids])
|
||||
for (const comment of allExpectedComments) {
|
||||
const commentBody = formatCommentBody(comment)
|
||||
const commentAuthor = comment.creator?.name || 'Comment'
|
||||
for (const m of afterMarkers) {
|
||||
const g = normalizeGuid(m.guid)
|
||||
if (!g || currentKnownGuids.has(g)) continue
|
||||
try {
|
||||
const mName = m.getName()
|
||||
const mComments = m.getComments()
|
||||
if (
|
||||
(mName === commentAuthor && mComments === commentBody) ||
|
||||
(mComments && comment.message && mComments.includes(comment.message))
|
||||
) {
|
||||
newMarkerGuids.push(g)
|
||||
currentKnownGuids.add(g)
|
||||
break
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(
|
||||
'[markers] Total newly captured/backfilled marker GUIDs:',
|
||||
newMarkerGuids.length,
|
||||
newMarkerGuids,
|
||||
)
|
||||
|
||||
const updatedMarkerGuids = Array.from(
|
||||
new Set([...currentMarkerGuids, ...newMarkerGuids.map(normalizeGuid)]),
|
||||
)
|
||||
|
||||
const updatedLink: LinkedSequenceAsset = {
|
||||
...existingLink,
|
||||
syncedCommentIds: [...existingLink.syncedCommentIds, ...newComments.map((c) => c.id)],
|
||||
syncedMarkerGuids: updatedMarkerGuids,
|
||||
totalCommentsSynced: existingLink.totalCommentsSynced + newComments.length,
|
||||
lastSyncAt: now,
|
||||
}
|
||||
|
||||
await saveSequenceLink(project, sequence, updatedLink)
|
||||
return { updatedLink, addedCount: newComments.length }
|
||||
} catch (err) {
|
||||
console.error('[markers] Failed to execute add markers transaction:', err)
|
||||
return { updatedLink: existingLink, addedCount: 0 }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import {
|
||||
getActiveProject,
|
||||
importFilesIntoProject,
|
||||
promptSelectFolder,
|
||||
promptSaveFile,
|
||||
writeBinaryFile,
|
||||
getPremiereModule,
|
||||
getUxpModule,
|
||||
} from './premiere'
|
||||
import type { Project, Sequence } from '@adobe/premierepro'
|
||||
|
||||
describe('premiere service', () => {
|
||||
beforeEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
// Reset any global require mocks on globalThis
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
delete (globalThis as any).require
|
||||
// Reset window mock on globalThis
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
delete (globalThis as any).window
|
||||
})
|
||||
|
||||
describe('module getters', () => {
|
||||
it('returns null when premierepro is not available', () => {
|
||||
expect(getPremiereModule()).toBeNull()
|
||||
})
|
||||
|
||||
it('returns null when uxp is not available', () => {
|
||||
expect(getUxpModule()).toBeNull()
|
||||
})
|
||||
|
||||
it('resolves premiere module from global require when present', () => {
|
||||
const mockPpro = { Project: { getActiveProject: vi.fn() } }
|
||||
// Mocking UXP window environment on globalThis
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') return mockPpro
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
expect(getPremiereModule()).toBe(mockPpro)
|
||||
})
|
||||
})
|
||||
|
||||
describe('getActiveProject', () => {
|
||||
it('returns null when module is missing', async () => {
|
||||
const project = await getActiveProject()
|
||||
expect(project).toBeNull()
|
||||
})
|
||||
|
||||
it('returns active project when available', async () => {
|
||||
const mockProject = { name: 'MyProject.prproj' }
|
||||
// Mocking UXP window environment on globalThis
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'premierepro') {
|
||||
return {
|
||||
Project: {
|
||||
getActiveProject: vi.fn().mockResolvedValue(mockProject),
|
||||
},
|
||||
}
|
||||
}
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const project = await getActiveProject()
|
||||
expect(project).toBe(mockProject)
|
||||
})
|
||||
})
|
||||
|
||||
describe('importFilesIntoProject', () => {
|
||||
it('returns false when filePaths is empty', async () => {
|
||||
const project = { importFiles: vi.fn() } as unknown as Project
|
||||
const success = await importFilesIntoProject(project, [])
|
||||
expect(success).toBe(false)
|
||||
expect(project.importFiles).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('calls project.importFiles with suppressUI true', async () => {
|
||||
const project = {
|
||||
importFiles: vi.fn().mockResolvedValue(true),
|
||||
} as unknown as Project
|
||||
|
||||
const success = await importFilesIntoProject(project, ['/path/to/video.mp4'])
|
||||
expect(success).toBe(true)
|
||||
expect(project.importFiles).toHaveBeenCalledWith(['/path/to/video.mp4'], true, null, false)
|
||||
})
|
||||
|
||||
it('handles import error gracefully', async () => {
|
||||
const project = {
|
||||
importFiles: vi.fn().mockRejectedValue(new Error('Import failed in host')),
|
||||
} as unknown as Project
|
||||
|
||||
const success = await importFilesIntoProject(project, ['/path/to/video.mp4'])
|
||||
expect(success).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('promptSelectFolder', () => {
|
||||
it('throws when UXP storage is unavailable', async () => {
|
||||
await expect(promptSelectFolder()).rejects.toThrow('UXP storage')
|
||||
})
|
||||
|
||||
it('delegates to uxp.storage.localFileSystem.getFolder', async () => {
|
||||
const mockFolder: UxpFolderEntry = {
|
||||
isFile: false,
|
||||
isFolder: true,
|
||||
name: 'Downloads',
|
||||
nativePath: '/Users/test/Downloads',
|
||||
createFile: vi.fn(),
|
||||
getEntries: vi.fn().mockResolvedValue([]),
|
||||
}
|
||||
// Mocking UXP window environment on globalThis
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'uxp') {
|
||||
return {
|
||||
storage: {
|
||||
localFileSystem: {
|
||||
getFolder: vi.fn().mockResolvedValue(mockFolder),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const folder = await promptSelectFolder()
|
||||
expect(folder).toBe(mockFolder)
|
||||
})
|
||||
})
|
||||
|
||||
describe('promptSaveFile', () => {
|
||||
it('throws when UXP storage is unavailable', async () => {
|
||||
await expect(promptSaveFile('test.mp4')).rejects.toThrow('UXP storage')
|
||||
})
|
||||
|
||||
it('delegates to uxp.storage.localFileSystem.getFileForSaving', async () => {
|
||||
const mockFile: UxpFileEntry = {
|
||||
isFile: true,
|
||||
isFolder: false,
|
||||
name: 'test.mp4',
|
||||
nativePath: '/path/test.mp4',
|
||||
write: vi.fn(),
|
||||
}
|
||||
// Mocking UXP window environment on globalThis
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'uxp') {
|
||||
return {
|
||||
storage: {
|
||||
localFileSystem: {
|
||||
getFileForSaving: vi.fn().mockResolvedValue(mockFile),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const file = await promptSaveFile('test.mp4')
|
||||
expect(file).toBe(mockFile)
|
||||
})
|
||||
})
|
||||
|
||||
describe('writeBinaryFile', () => {
|
||||
it('calls file.write with binary format option', async () => {
|
||||
const mockFile: UxpFileEntry = {
|
||||
isFile: true,
|
||||
isFolder: false,
|
||||
name: 'test.mp4',
|
||||
nativePath: '/path/test.mp4',
|
||||
write: vi.fn().mockResolvedValue(undefined),
|
||||
}
|
||||
|
||||
// Mocking UXP window environment on globalThis
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(globalThis as any).window = {
|
||||
require: vi.fn().mockImplementation((name: string) => {
|
||||
if (name === 'uxp') {
|
||||
return {
|
||||
storage: {
|
||||
formats: { binary: 'binary-format-token' },
|
||||
},
|
||||
}
|
||||
}
|
||||
return null
|
||||
}),
|
||||
}
|
||||
|
||||
const dummyBuffer = new ArrayBuffer(16)
|
||||
await writeBinaryFile(mockFile, dummyBuffer)
|
||||
expect(mockFile.write).toHaveBeenCalledWith(dummyBuffer, { format: 'binary-format-token' })
|
||||
})
|
||||
})
|
||||
|
||||
describe('sequence functions', () => {
|
||||
it('getActiveSequence returns active sequence from project', async () => {
|
||||
const { getActiveSequence } = await import('./premiere')
|
||||
const mockSeq = { name: 'Seq 1', guid: 'guid-1' }
|
||||
const mockProject = {
|
||||
getActiveSequence: vi.fn().mockResolvedValue(mockSeq),
|
||||
}
|
||||
|
||||
const seq = await getActiveSequence(mockProject as unknown as Project)
|
||||
expect(seq).toBe(mockSeq)
|
||||
})
|
||||
|
||||
it('getAllSequences returns array of sequences', async () => {
|
||||
const { getAllSequences } = await import('./premiere')
|
||||
const mockSeq1 = { name: 'Seq 1', guid: 'guid-1' }
|
||||
const mockSeq2 = { name: 'Seq 2', guid: 'guid-2' }
|
||||
const mockProject = {
|
||||
getSequences: vi.fn().mockResolvedValue([mockSeq1, mockSeq2]),
|
||||
}
|
||||
|
||||
const seqs = await getAllSequences(mockProject as unknown as Project)
|
||||
expect(seqs).toHaveLength(2)
|
||||
expect(seqs[0].name).toBe('Seq 1')
|
||||
})
|
||||
|
||||
it('openSequenceInTimeline opens and activates sequence', async () => {
|
||||
const { openSequenceInTimeline } = await import('./premiere')
|
||||
const mockSeq = { name: 'Seq 1', guid: 'guid-1' }
|
||||
const mockProject = {
|
||||
openSequence: vi.fn().mockResolvedValue(true),
|
||||
setActiveSequence: vi.fn().mockResolvedValue(true),
|
||||
}
|
||||
|
||||
const result = await openSequenceInTimeline(
|
||||
mockSeq as unknown as Sequence,
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
expect(result).toBe(true)
|
||||
expect(mockProject.openSequence).toHaveBeenCalledWith(mockSeq)
|
||||
expect(mockProject.setActiveSequence).toHaveBeenCalledWith(mockSeq)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,178 @@
|
||||
import type { Project, Sequence, premierepro } from '@adobe/premierepro'
|
||||
|
||||
/**
|
||||
* Safely resolves the Premiere Pro host module (`premierepro`).
|
||||
*/
|
||||
export function getPremiereModule(): premierepro | null {
|
||||
try {
|
||||
// In UXP, host modules are available via require()
|
||||
if (typeof window !== 'undefined' && 'require' in window) {
|
||||
// Dynamic runtime property injected on window by Adobe UXP
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return (window as any).require('premierepro')
|
||||
}
|
||||
if (typeof require !== 'undefined') {
|
||||
// Adobe UXP host modules must be resolved dynamically at runtime via CommonJS require
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
return require('premierepro')
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[UXP] premierepro module not available:', err)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Safely resolves the UXP environment module (`uxp`).
|
||||
*/
|
||||
export function getUxpModule(): UxpModule | null {
|
||||
try {
|
||||
if (typeof window !== 'undefined' && 'require' in window) {
|
||||
// Dynamic runtime property injected on window by Adobe UXP
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return (window as any).require('uxp')
|
||||
}
|
||||
if (typeof require !== 'undefined') {
|
||||
// Adobe UXP host modules must be resolved dynamically at runtime via CommonJS require
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
return require('uxp')
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[UXP] uxp module not available:', err)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the currently active project in Premiere Pro.
|
||||
*/
|
||||
export async function getActiveProject(): Promise<Project | null> {
|
||||
const ppro = getPremiereModule()
|
||||
if (!ppro?.Project) {
|
||||
return null
|
||||
}
|
||||
try {
|
||||
return await ppro.Project.getActiveProject()
|
||||
} catch (err) {
|
||||
console.error('Failed to get active project:', err)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the currently active sequence of the project.
|
||||
*/
|
||||
export async function getActiveSequence(project?: Project | null): Promise<Sequence | null> {
|
||||
const pr = project || (await getActiveProject())
|
||||
if (!pr) return null
|
||||
try {
|
||||
const seq = await pr.getActiveSequence()
|
||||
return seq || null
|
||||
} catch (err) {
|
||||
console.error('Failed to get active sequence:', err)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all sequences in the project.
|
||||
*/
|
||||
export async function getAllSequences(project?: Project | null): Promise<Sequence[]> {
|
||||
const pr = project || (await getActiveProject())
|
||||
if (!pr) return []
|
||||
try {
|
||||
const seqs = await pr.getSequences()
|
||||
return seqs || []
|
||||
} catch (err) {
|
||||
console.error('Failed to get all sequences:', err)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens and activates a sequence in the Premiere Pro timeline.
|
||||
*/
|
||||
export async function openSequenceInTimeline(
|
||||
sequence: Sequence,
|
||||
project?: Project | null,
|
||||
): Promise<boolean> {
|
||||
const pr = project || (await getActiveProject())
|
||||
if (!pr) return false
|
||||
try {
|
||||
const opened = await pr.openSequence(sequence)
|
||||
try {
|
||||
await pr.setActiveSequence(sequence)
|
||||
} catch {
|
||||
// setActiveSequence may not be required if openSequence already focuses it
|
||||
}
|
||||
return opened ?? true
|
||||
} catch (err) {
|
||||
console.error('Failed to open sequence in timeline:', err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports one or more files into the Premiere Pro project root.
|
||||
*/
|
||||
export async function importFilesIntoProject(
|
||||
project: Project,
|
||||
filePaths: string[],
|
||||
): Promise<boolean> {
|
||||
if (!filePaths.length) return false
|
||||
try {
|
||||
return await project.importFiles(
|
||||
filePaths,
|
||||
true, // suppressUI
|
||||
// @ts-expect-error Premiere Pro UXP requires null instead of undefined to default to project root
|
||||
null, // targetBin; `null` defaults to project root
|
||||
false, // asNumberedStills
|
||||
)
|
||||
} catch (err) {
|
||||
console.error('Failed to import files into Premiere project:', err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the native OS folder picker to ask the user where to save files.
|
||||
* Returns the selected UxpFolderEntry, or null if the user cancelled.
|
||||
*/
|
||||
export async function promptSelectFolder(): Promise<UxpFolderEntry | null> {
|
||||
const uxp = getUxpModule()
|
||||
if (!uxp?.storage?.localFileSystem) {
|
||||
throw new Error('UXP storage.localFileSystem is not available.')
|
||||
}
|
||||
try {
|
||||
return await uxp.storage.localFileSystem.getFolder()
|
||||
} catch (err) {
|
||||
console.error('Error in promptSelectFolder:', err)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the native OS file picker to ask the user where to save a file.
|
||||
* Returns the selected UxpFileEntry, or null if the user cancelled.
|
||||
*/
|
||||
export async function promptSaveFile(defaultName: string): Promise<UxpFileEntry | null> {
|
||||
const uxp = getUxpModule()
|
||||
if (!uxp?.storage?.localFileSystem) {
|
||||
throw new Error('UXP storage.localFileSystem is not available.')
|
||||
}
|
||||
try {
|
||||
return await uxp.storage.localFileSystem.getFileForSaving(defaultName)
|
||||
} catch (err) {
|
||||
console.error('Error in promptSaveFile:', err)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes an ArrayBuffer into a UXP File entry as binary.
|
||||
*/
|
||||
export async function writeBinaryFile(file: UxpFileEntry, data: ArrayBuffer): Promise<void> {
|
||||
const uxp = getUxpModule()
|
||||
const format = uxp?.storage?.formats?.binary
|
||||
await file.write(data, { format })
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import { describe, it, expect, beforeEach } from 'vitest'
|
||||
import { getStoredCredentials, saveStoredCredentials, clearStoredCredentials } from './storage'
|
||||
|
||||
const localStorageMock = (() => {
|
||||
let store: Record<string, string> = {}
|
||||
return {
|
||||
getItem: (key: string) => store[key] || null,
|
||||
setItem: (key: string, value: string) => {
|
||||
store[key] = value.toString()
|
||||
},
|
||||
removeItem: (key: string) => {
|
||||
delete store[key]
|
||||
},
|
||||
clear: () => {
|
||||
store = {}
|
||||
},
|
||||
}
|
||||
})()
|
||||
|
||||
Object.defineProperty(globalThis, 'localStorage', {
|
||||
value: localStorageMock,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
})
|
||||
|
||||
describe('Storage Service', () => {
|
||||
beforeEach(() => {
|
||||
localStorage.clear()
|
||||
})
|
||||
|
||||
it('returns null when no credentials are stored', () => {
|
||||
expect(getStoredCredentials()).toBeNull()
|
||||
})
|
||||
|
||||
it('saves and retrieves credentials correctly', () => {
|
||||
saveStoredCredentials('http://localhost:3000', 'test-api-key')
|
||||
const creds = getStoredCredentials()
|
||||
expect(creds).toEqual({
|
||||
endpoint: 'http://localhost:3000',
|
||||
apiKey: 'test-api-key',
|
||||
})
|
||||
})
|
||||
|
||||
it('normalizes endpoint URL by stripping trailing slashes', () => {
|
||||
saveStoredCredentials('https://api.shumai.io///', 'test-api-key')
|
||||
const creds = getStoredCredentials()
|
||||
expect(creds?.endpoint).toBe('https://api.shumai.io')
|
||||
})
|
||||
|
||||
it('clears stored credentials', () => {
|
||||
saveStoredCredentials('http://localhost:3000', 'test-api-key')
|
||||
clearStoredCredentials()
|
||||
expect(getStoredCredentials()).toBeNull()
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,38 @@
|
||||
export interface StoredCredentials {
|
||||
endpoint: string
|
||||
apiKey: string
|
||||
}
|
||||
|
||||
const STORAGE_KEY_ENDPOINT = 'shumai_uxp_endpoint'
|
||||
const STORAGE_KEY_API_KEY = 'shumai_uxp_api_key'
|
||||
|
||||
export function getStoredCredentials(): StoredCredentials | null {
|
||||
try {
|
||||
const endpoint = localStorage.getItem(STORAGE_KEY_ENDPOINT)
|
||||
const apiKey = localStorage.getItem(STORAGE_KEY_API_KEY)
|
||||
if (endpoint && apiKey) {
|
||||
return { endpoint, apiKey }
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to read credentials from localStorage:', err)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export function saveStoredCredentials(endpoint: string, apiKey: string): void {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY_ENDPOINT, endpoint.trim().replace(/\/+$/, ''))
|
||||
localStorage.setItem(STORAGE_KEY_API_KEY, apiKey.trim())
|
||||
} catch (err) {
|
||||
console.error('Failed to save credentials to localStorage:', err)
|
||||
}
|
||||
}
|
||||
|
||||
export function clearStoredCredentials(): void {
|
||||
try {
|
||||
localStorage.removeItem(STORAGE_KEY_ENDPOINT)
|
||||
localStorage.removeItem(STORAGE_KEY_API_KEY)
|
||||
} catch (err) {
|
||||
console.error('Failed to clear credentials from localStorage:', err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
export interface LinkedSequenceAsset {
|
||||
sequenceGuid: string
|
||||
sequenceName: string
|
||||
assetId: string
|
||||
assetName: string
|
||||
assetThumbnailUrl?: string
|
||||
endpoint?: string
|
||||
projectId?: string
|
||||
syncedCommentIds: string[]
|
||||
syncedMarkerGuids?: string[]
|
||||
lastSyncAt: number
|
||||
totalCommentsSynced: number
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
export function formatDateAgo(dateInput?: string | number | Date | null): string {
|
||||
if (!dateInput) return ''
|
||||
const date =
|
||||
typeof dateInput === 'string' || typeof dateInput === 'number' ? new Date(dateInput) : dateInput
|
||||
if (isNaN(date.getTime())) return ''
|
||||
|
||||
const now = new Date()
|
||||
const diffSec = Math.max(0, Math.floor((now.getTime() - date.getTime()) / 1000))
|
||||
|
||||
if (diffSec < 60) return 'just now'
|
||||
|
||||
const diffMin = Math.floor(diffSec / 60)
|
||||
if (diffMin < 60) return `${diffMin}m ago`
|
||||
|
||||
const diffHours = Math.floor(diffMin / 60)
|
||||
if (diffHours < 24) return `${diffHours}h ago`
|
||||
|
||||
const diffDays = Math.floor(diffHours / 24)
|
||||
if (diffDays === 1) return 'yesterday'
|
||||
if (diffDays < 30) return `${diffDays}d ago`
|
||||
|
||||
const diffMonths = Math.floor(diffDays / 30)
|
||||
if (diffMonths < 12) return `${diffMonths}mo ago`
|
||||
|
||||
const diffYears = Math.floor(diffMonths / 12)
|
||||
return `${diffYears}y ago`
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { formatBytes, formatDuration } from './format'
|
||||
|
||||
describe('formatBytes', () => {
|
||||
it('handles null, undefined, 0 and invalid inputs', () => {
|
||||
expect(formatBytes(null)).toBe('0 B')
|
||||
expect(formatBytes(undefined)).toBe('0 B')
|
||||
expect(formatBytes(0)).toBe('0 B')
|
||||
expect(formatBytes(-100)).toBe('0 B')
|
||||
expect(formatBytes(NaN)).toBe('0 B')
|
||||
})
|
||||
|
||||
it('formats bytes correctly', () => {
|
||||
expect(formatBytes(500)).toBe('500 B')
|
||||
expect(formatBytes(1024)).toBe('1.0 KB')
|
||||
expect(formatBytes(1536)).toBe('1.5 KB')
|
||||
expect(formatBytes(1048576)).toBe('1.0 MB')
|
||||
expect(formatBytes(1073741824)).toBe('1.0 GB')
|
||||
})
|
||||
})
|
||||
|
||||
describe('formatDuration', () => {
|
||||
it('returns null for invalid or non-positive durations', () => {
|
||||
expect(formatDuration(null)).toBeNull()
|
||||
expect(formatDuration(undefined)).toBeNull()
|
||||
expect(formatDuration(0)).toBeNull()
|
||||
expect(formatDuration(-15)).toBeNull()
|
||||
expect(formatDuration(NaN)).toBeNull()
|
||||
})
|
||||
|
||||
it('formats seconds into MM:SS format', () => {
|
||||
expect(formatDuration(5.4)).toBe('00:05')
|
||||
expect(formatDuration(59)).toBe('00:59')
|
||||
expect(formatDuration(60)).toBe('01:00')
|
||||
expect(formatDuration(65)).toBe('01:05')
|
||||
expect(formatDuration(3599)).toBe('59:59')
|
||||
})
|
||||
|
||||
it('formats hours into H:MM:SS format', () => {
|
||||
expect(formatDuration(3600)).toBe('1:00:00')
|
||||
expect(formatDuration(3665)).toBe('1:01:05')
|
||||
expect(formatDuration(36665)).toBe('10:11:05')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Formats a byte count into a human-readable size string (e.g. 1.2 MB, 450 KB).
|
||||
*/
|
||||
export function formatBytes(bytes?: number | null): string {
|
||||
if (bytes == null || bytes === 0 || isNaN(bytes) || bytes < 0) return '0 B'
|
||||
const units = ['B', 'KB', 'MB', 'GB', 'TB']
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(1024))
|
||||
const safeIndex = Math.min(Math.max(0, i), units.length - 1)
|
||||
return `${(bytes / Math.pow(1024, safeIndex)).toFixed(safeIndex === 0 ? 0 : 1)} ${units[safeIndex]}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats duration in seconds into MM:SS or H:MM:SS format (e.g. 02:45, 1:12:30).
|
||||
* Returns null if duration is invalid, zero or negative.
|
||||
*/
|
||||
export function formatDuration(seconds?: number | null): string | null {
|
||||
if (seconds == null || isNaN(seconds) || seconds <= 0) return null
|
||||
const totalSecs = Math.round(seconds)
|
||||
const hours = Math.floor(totalSecs / 3600)
|
||||
const minutes = Math.floor((totalSecs % 3600) / 60)
|
||||
const secs = totalSecs % 60
|
||||
if (hours > 0) {
|
||||
return `${hours}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`
|
||||
}
|
||||
return `${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { resolveAssetUrl, normalizeEndpoint, isSameEndpoint } from './url'
|
||||
|
||||
describe('resolveAssetUrl', () => {
|
||||
it('returns undefined for empty or null inputs', () => {
|
||||
expect(resolveAssetUrl(null, 'http://localhost:3000')).toBeUndefined()
|
||||
expect(resolveAssetUrl(undefined, 'http://localhost:3000')).toBeUndefined()
|
||||
expect(resolveAssetUrl('', 'http://localhost:3000')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('returns original url if endpoint is not provided', () => {
|
||||
expect(resolveAssetUrl('/files/123')).toBe('/files/123')
|
||||
expect(resolveAssetUrl('http://example.com/img.png')).toBe('http://example.com/img.png')
|
||||
})
|
||||
|
||||
it('prepends endpoint to relative paths', () => {
|
||||
expect(resolveAssetUrl('/files/shumai/cat.png', 'http://localhost:3000')).toBe(
|
||||
'http://localhost:3000/files/shumai/cat.png',
|
||||
)
|
||||
expect(resolveAssetUrl('/files/shumai/cat.png', 'http://localhost:3000/')).toBe(
|
||||
'http://localhost:3000/files/shumai/cat.png',
|
||||
)
|
||||
})
|
||||
|
||||
it('preserves absolute URLs intact even when hosts differ', () => {
|
||||
const localRaw = 'http://localhost:3000/files/shumai/files/cat.webp'
|
||||
const endpoint = 'http://127.0.0.1:3000'
|
||||
expect(resolveAssetUrl(localRaw, endpoint)).toBe(localRaw)
|
||||
|
||||
const remoteEndpoint = 'https://shumai.example.com'
|
||||
expect(resolveAssetUrl(localRaw, remoteEndpoint)).toBe(localRaw)
|
||||
})
|
||||
|
||||
it('keeps matching absolute URLs intact', () => {
|
||||
const raw = 'http://localhost:3000/files/shumai/cat.png'
|
||||
expect(resolveAssetUrl(raw, 'http://localhost:3000')).toBe(raw)
|
||||
})
|
||||
|
||||
it('preserves remote cloud storage presigned URLs without rewriting host', () => {
|
||||
const r2Url =
|
||||
'https://04e37a3c563610bccea6a3ce6f8618ca.r2.cloudflarestorage.com/shumai/files/01KYKNT8NEJ3Q1G6A6K08M2XHC/Float%2002-480p.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Signature=8112ab30'
|
||||
const endpoint = 'https://staging.shumai.one'
|
||||
expect(resolveAssetUrl(r2Url, endpoint)).toBe(r2Url)
|
||||
})
|
||||
})
|
||||
|
||||
describe('normalizeEndpoint', () => {
|
||||
it('handles empty and null values', () => {
|
||||
expect(normalizeEndpoint('')).toBe('')
|
||||
expect(normalizeEndpoint(null)).toBe('')
|
||||
expect(normalizeEndpoint(undefined)).toBe('')
|
||||
})
|
||||
|
||||
it('trims whitespace and trailing slashes and converts to lower case', () => {
|
||||
expect(normalizeEndpoint(' https://STAGING.shumai.one/// ')).toBe('https://staging.shumai.one')
|
||||
expect(normalizeEndpoint('http://localhost:3000/')).toBe('http://localhost:3000')
|
||||
})
|
||||
})
|
||||
|
||||
describe('isSameEndpoint', () => {
|
||||
it('returns true when endpoints match ignoring slashes and casing', () => {
|
||||
expect(isSameEndpoint('https://staging.shumai.one/', 'https://STAGING.shumai.one')).toBe(true)
|
||||
expect(isSameEndpoint('http://localhost:3000', 'http://localhost:3000/')).toBe(true)
|
||||
})
|
||||
|
||||
it('returns false when endpoints differ', () => {
|
||||
expect(isSameEndpoint('http://localhost:3000', 'https://staging.shumai.one')).toBe(false)
|
||||
expect(isSameEndpoint('http://localhost:3000', 'http://127.0.0.1:3000')).toBe(false)
|
||||
expect(isSameEndpoint('', 'http://localhost:3000')).toBe(false)
|
||||
expect(isSameEndpoint(null, undefined)).toBe(false)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Utility functions for URL manipulation and resolution in UXP plugins.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resolves an asset URL (such as a thumbnail or file download) against
|
||||
* the user-configured Shumai endpoint.
|
||||
*
|
||||
* Handles:
|
||||
* - Relative paths (/files/..., /api/...) by prepending the endpoint.
|
||||
* - Absolute URLs (http://, https://) are preserved as-is.
|
||||
*/
|
||||
export function resolveAssetUrl(url?: string | null, endpoint?: string): string | undefined {
|
||||
if (!url) return undefined
|
||||
if (!endpoint) return url
|
||||
|
||||
const cleanEndpoint = endpoint.replace(/\/+$/, '')
|
||||
|
||||
// Handle relative URLs (e.g. /files/..., /api/...)
|
||||
if (url.startsWith('/') && !url.startsWith('//')) {
|
||||
return `${cleanEndpoint}${url}`
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes an endpoint URL by trimming whitespace, stripping trailing slashes,
|
||||
* and converting to lower case for reliable comparison.
|
||||
*/
|
||||
export function normalizeEndpoint(endpoint?: string | null): string {
|
||||
if (!endpoint) return ''
|
||||
return endpoint.trim().replace(/\/+$/, '').toLowerCase()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if two endpoints refer to the same server URL.
|
||||
*/
|
||||
export function isSameEndpoint(ep1?: string | null, ep2?: string | null): boolean {
|
||||
const n1 = normalizeEndpoint(ep1)
|
||||
const n2 = normalizeEndpoint(ep2)
|
||||
return Boolean(n1 && n2 && n1 === n2)
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
import React, { useState } from 'react'
|
||||
import { getShumaiClient } from '../api/client'
|
||||
import { saveStoredCredentials } from '../services/storage'
|
||||
import { Button } from '@swc-react/button'
|
||||
import { Textfield } from '@swc-react/textfield'
|
||||
import { FieldLabel } from '@swc-react/field-label'
|
||||
import { HelpText } from '@swc-react/help-text'
|
||||
import { ProgressCircle } from '@swc-react/progress-circle'
|
||||
|
||||
interface AuthViewProps {
|
||||
initialEndpoint?: string
|
||||
initialApiKey?: string
|
||||
onConnectSuccess: (endpoint: string, apiKey: string) => void
|
||||
}
|
||||
|
||||
export const AuthView: React.FC<AuthViewProps> = ({
|
||||
initialEndpoint = 'http://localhost:3000',
|
||||
initialApiKey = '',
|
||||
onConnectSuccess,
|
||||
}) => {
|
||||
const [endpoint, setEndpoint] = useState(initialEndpoint)
|
||||
const [apiKey, setApiKey] = useState(initialApiKey)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [errorMessage, setErrorMessage] = useState<string | null>(null)
|
||||
|
||||
const handleConnect = async (e?: React.SyntheticEvent) => {
|
||||
if (e) {
|
||||
e.preventDefault()
|
||||
}
|
||||
setErrorMessage(null)
|
||||
|
||||
const trimmedEndpoint = endpoint.trim().replace(/\/+$/, '')
|
||||
const trimmedKey = apiKey.trim()
|
||||
|
||||
if (!trimmedEndpoint) {
|
||||
setErrorMessage('Please enter your Shumai server endpoint.')
|
||||
return
|
||||
}
|
||||
|
||||
if (!trimmedKey) {
|
||||
setErrorMessage('Please enter your Shumai API key.')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
new URL(trimmedEndpoint)
|
||||
} catch {
|
||||
setErrorMessage(
|
||||
'Invalid endpoint URL. Example: http://localhost:3000 or https://shumai.example.com',
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
setLoading(true)
|
||||
console.log('[Shumai UXP] Connecting to:', trimmedEndpoint)
|
||||
|
||||
try {
|
||||
const client = getShumaiClient(trimmedEndpoint, trimmedKey)
|
||||
const res = await client.api.projects.$get({
|
||||
query: { first: '1' },
|
||||
})
|
||||
|
||||
console.log('[Shumai UXP] Response status:', res.status)
|
||||
|
||||
if (res.status === 401) {
|
||||
setErrorMessage('Unauthorized: Invalid API Key. Please verify your token.')
|
||||
setLoading(false)
|
||||
return
|
||||
}
|
||||
|
||||
if (!res.ok) {
|
||||
const errorData = (await res.json().catch(() => ({}))) as { error?: string }
|
||||
setErrorMessage(errorData.error || `Connection failed with status ${res.status}`)
|
||||
setLoading(false)
|
||||
return
|
||||
}
|
||||
|
||||
// Validated successfully
|
||||
saveStoredCredentials(trimmedEndpoint, trimmedKey)
|
||||
onConnectSuccess(trimmedEndpoint, trimmedKey)
|
||||
} catch (err) {
|
||||
console.error('[Shumai UXP] Failed to connect to Shumai server:', err)
|
||||
setErrorMessage(
|
||||
err instanceof Error
|
||||
? `Cannot reach server: ${err.message}`
|
||||
: 'Could not connect to the Shumai server. Please check the URL and your network connection.',
|
||||
)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
const handleKeyDown = (e: React.KeyboardEvent) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
handleConnect(e)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="view-content" style={{ justifyContent: 'center' }}>
|
||||
<div className="auth-container">
|
||||
<div className="auth-header">
|
||||
<h2>Connect to Shumai</h2>
|
||||
<p>Enter your server URL and API key to integrate Premiere Pro with your workspace.</p>
|
||||
</div>
|
||||
|
||||
{errorMessage && (
|
||||
<div style={{ marginBottom: '12px' }}>
|
||||
<HelpText variant="negative" icon>
|
||||
{errorMessage}
|
||||
</HelpText>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="auth-form">
|
||||
<div className="form-group">
|
||||
<FieldLabel for="endpoint-input">Server Endpoint</FieldLabel>
|
||||
<Textfield
|
||||
id="endpoint-input"
|
||||
style={{ width: '100%' }}
|
||||
placeholder="https://shumai.example.com"
|
||||
value={endpoint}
|
||||
onInput={(e: React.FormEvent<HTMLElement>) =>
|
||||
setEndpoint((e.target as HTMLInputElement).value)
|
||||
}
|
||||
onKeyDown={handleKeyDown}
|
||||
disabled={loading}
|
||||
invalid={Boolean(errorMessage && !endpoint.trim())}
|
||||
/>
|
||||
<HelpText>The base URL of your Shumai backend instance.</HelpText>
|
||||
</div>
|
||||
|
||||
<div className="form-group">
|
||||
<FieldLabel for="api-key-input">API Key</FieldLabel>
|
||||
<Textfield
|
||||
id="api-key-input"
|
||||
type="password"
|
||||
style={{ width: '100%' }}
|
||||
placeholder="Paste your API key here"
|
||||
value={apiKey}
|
||||
onInput={(e: React.FormEvent<HTMLElement>) =>
|
||||
setApiKey((e.target as HTMLInputElement).value)
|
||||
}
|
||||
onKeyDown={handleKeyDown}
|
||||
disabled={loading}
|
||||
invalid={Boolean(errorMessage && !apiKey.trim())}
|
||||
/>
|
||||
<HelpText>Generate an API key in Shumai: Settings > Developer.</HelpText>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
variant="accent"
|
||||
onClick={handleConnect}
|
||||
style={{ width: '100%', marginTop: '8px' }}
|
||||
disabled={loading}
|
||||
>
|
||||
{loading ? 'Connecting...' : 'Connect Workspace'}
|
||||
{loading ? (
|
||||
<ProgressCircle indeterminate size="s" static-color="white" slot="icon" />
|
||||
) : (
|
||||
<sp-icon-arrow-right size="s" slot="icon"></sp-icon-arrow-right>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,790 @@
|
||||
import React, { useEffect, useState, useCallback } from 'react'
|
||||
import { getShumaiClient } from '../api/client'
|
||||
import { Breadcrumb, BreadcrumbCrumb } from '../components/Breadcrumb'
|
||||
import { FileCardItem, AssetSummary } from '../components/FileItem'
|
||||
import { ImportVideoDialog } from '../components/ImportVideoDialog'
|
||||
import { LinkSequenceDialog } from '../components/LinkSequenceDialog'
|
||||
import {
|
||||
getAllSequenceLinksFromCache,
|
||||
getAllLinkedSequences,
|
||||
normalizeGuid,
|
||||
removeSequenceLink,
|
||||
removeSequenceLinkFromCache,
|
||||
} from '../services/linkStorage'
|
||||
import { getActiveProject, getAllSequences } from '../services/premiere'
|
||||
import type { LinkedSequenceAsset } from '../types/link'
|
||||
import { importAssetIntoPremiere, type ProxyOption } from '../services/import'
|
||||
import { ProjectSummary } from './ProjectsView'
|
||||
import { isSameEndpoint } from '../utils/url'
|
||||
import { ActionButton } from '@swc-react/action-button'
|
||||
import { Button } from '@swc-react/button'
|
||||
import { Search } from '@swc-react/search'
|
||||
import { ProgressCircle } from '@swc-react/progress-circle'
|
||||
import { StatusLight } from '@swc-react/status-light'
|
||||
import { IllustratedMessage } from '@swc-react/illustrated-message'
|
||||
import { Divider } from '@swc-react/divider'
|
||||
import type { SearchCondition, SearchSort } from '@shumai/dtos'
|
||||
|
||||
const PAGE_SIZE = 20
|
||||
|
||||
interface FileListViewProps {
|
||||
endpoint: string
|
||||
apiKey: string
|
||||
project: ProjectSummary
|
||||
onBackToProjects: () => void
|
||||
onLinkCountChange?: (count: number) => void
|
||||
}
|
||||
|
||||
export const FileListView: React.FC<FileListViewProps> = ({
|
||||
endpoint,
|
||||
apiKey,
|
||||
project,
|
||||
onBackToProjects,
|
||||
onLinkCountChange,
|
||||
}) => {
|
||||
const [currentFolderId, setCurrentFolderId] = useState<string | null>(project.rootFolder || null)
|
||||
const [crumbs, setCrumbs] = useState<BreadcrumbCrumb[]>([])
|
||||
|
||||
// Folders state
|
||||
const [folders, setFolders] = useState<AssetSummary[]>([])
|
||||
const [foldersTotal, setFoldersTotal] = useState<number | null>(null)
|
||||
const [foldersCursor, setFoldersCursor] = useState<string | null>(null)
|
||||
const [foldersHasNext, setFoldersHasNext] = useState(false)
|
||||
const [foldersExpanded, setFoldersExpanded] = useState(true)
|
||||
const [loadingMoreFolders, setLoadingMoreFolders] = useState(false)
|
||||
|
||||
// Files state
|
||||
const [files, setFiles] = useState<AssetSummary[]>([])
|
||||
const [filesTotal, setFilesTotal] = useState<number | null>(null)
|
||||
const [filesCursor, setFilesCursor] = useState<string | null>(null)
|
||||
const [filesHasNext, setFilesHasNext] = useState(false)
|
||||
const [filesExpanded, setFilesExpanded] = useState(true)
|
||||
const [loadingMoreFiles, setLoadingMoreFiles] = useState(false)
|
||||
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
const [searchTerm, setSearchTerm] = useState('')
|
||||
const [debouncedSearch, setDebouncedSearch] = useState('')
|
||||
const [videoForDialog, setVideoForDialog] = useState<AssetSummary | null>(null)
|
||||
const [assetForLinkDialog, setAssetForLinkDialog] = useState<AssetSummary | null>(null)
|
||||
const [linkedAssetsMap, setLinkedAssetsMap] = useState<Record<string, LinkedSequenceAsset>>({})
|
||||
|
||||
// Refresh links from cache and active Premiere project
|
||||
const refreshLinkedAssets = useCallback(async () => {
|
||||
// 1. Immediately read from cache (fast, non-blocking)
|
||||
const cachedLinks = getAllSequenceLinksFromCache()
|
||||
if (cachedLinks.length > 0) {
|
||||
const map: Record<string, LinkedSequenceAsset> = {}
|
||||
for (const link of cachedLinks) {
|
||||
if (!link.endpoint || isSameEndpoint(link.endpoint, endpoint)) {
|
||||
map[link.assetId] = link
|
||||
}
|
||||
}
|
||||
setLinkedAssetsMap((prev) => ({ ...prev, ...map }))
|
||||
onLinkCountChange?.(Object.keys(map).length)
|
||||
}
|
||||
|
||||
// 2. Query active project in Premiere Pro for live persistent links
|
||||
try {
|
||||
const pr = await getActiveProject()
|
||||
if (pr) {
|
||||
const liveLinks = await getAllLinkedSequences(pr)
|
||||
const liveMap: Record<string, LinkedSequenceAsset> = {}
|
||||
for (const link of liveLinks) {
|
||||
if (!link.endpoint || isSameEndpoint(link.endpoint, endpoint)) {
|
||||
liveMap[link.assetId] = link
|
||||
}
|
||||
}
|
||||
setLinkedAssetsMap(liveMap)
|
||||
onLinkCountChange?.(Object.keys(liveMap).length)
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[FileListView] Could not get linked sequences from active project:', err)
|
||||
}
|
||||
}, [endpoint, onLinkCountChange])
|
||||
|
||||
useEffect(() => {
|
||||
void refreshLinkedAssets()
|
||||
}, [refreshLinkedAssets])
|
||||
|
||||
const handleUnlinkAsset = useCallback(
|
||||
async (asset: AssetSummary) => {
|
||||
const link = linkedAssetsMap[asset.id]
|
||||
if (!link) return
|
||||
|
||||
// Optimistically remove from state immediately
|
||||
setLinkedAssetsMap((prev) => {
|
||||
const copy = { ...prev }
|
||||
delete copy[asset.id]
|
||||
return copy
|
||||
})
|
||||
|
||||
try {
|
||||
const pr = await getActiveProject()
|
||||
if (pr) {
|
||||
const allSeqs = await getAllSequences(pr)
|
||||
const targetSeq = allSeqs.find(
|
||||
(s) => normalizeGuid(s.guid) === normalizeGuid(link.sequenceGuid),
|
||||
)
|
||||
if (targetSeq) {
|
||||
await removeSequenceLink(pr, targetSeq)
|
||||
} else {
|
||||
removeSequenceLinkFromCache(link.sequenceGuid, pr.guid ? pr.guid.toString() : null)
|
||||
}
|
||||
} else {
|
||||
removeSequenceLinkFromCache(link.sequenceGuid)
|
||||
}
|
||||
void refreshLinkedAssets()
|
||||
setImportStatus({
|
||||
id: Date.now().toString(),
|
||||
fileName: asset.name,
|
||||
status: 'success',
|
||||
message: `Unlinked from "${link.sequenceName}".`,
|
||||
})
|
||||
setTimeout(() => {
|
||||
setImportStatus((prev) => (prev?.fileName === asset.name ? null : prev))
|
||||
}, 3000)
|
||||
} catch (err) {
|
||||
console.error('Failed to unlink asset:', err)
|
||||
void refreshLinkedAssets()
|
||||
setImportStatus({
|
||||
id: Date.now().toString(),
|
||||
fileName: asset.name,
|
||||
status: 'error',
|
||||
message: 'Failed to unlink sequence.',
|
||||
})
|
||||
setTimeout(() => {
|
||||
setImportStatus((prev) => (prev?.fileName === asset.name ? null : prev))
|
||||
}, 4000)
|
||||
}
|
||||
},
|
||||
[linkedAssetsMap, refreshLinkedAssets],
|
||||
)
|
||||
|
||||
// Import task state
|
||||
const [importStatus, setImportStatus] = useState<{
|
||||
id: string
|
||||
fileName: string
|
||||
status: 'importing' | 'success' | 'error'
|
||||
message: string
|
||||
} | null>(null)
|
||||
|
||||
const runImport = async (asset: AssetSummary, type: 'raw' | 'proxy', proxyItem?: ProxyOption) => {
|
||||
const taskId = Date.now().toString()
|
||||
const label = type === 'raw' ? asset.name : `${asset.name} (${proxyItem?.label || 'Proxy'})`
|
||||
setImportStatus({
|
||||
id: taskId,
|
||||
fileName: label,
|
||||
status: 'importing',
|
||||
message: 'Starting import...',
|
||||
})
|
||||
|
||||
try {
|
||||
const result = await importAssetIntoPremiere({
|
||||
endpoint,
|
||||
apiKey,
|
||||
asset,
|
||||
type,
|
||||
proxyItem,
|
||||
onProgress: (msg) => {
|
||||
setImportStatus((prev) => (prev?.id === taskId ? { ...prev, message: msg } : prev))
|
||||
},
|
||||
})
|
||||
|
||||
if (result.cancelled) {
|
||||
setImportStatus(null)
|
||||
return
|
||||
}
|
||||
|
||||
if (result.success) {
|
||||
setImportStatus({
|
||||
id: taskId,
|
||||
fileName: result.fileName || label,
|
||||
status: 'success',
|
||||
message: result.message,
|
||||
})
|
||||
setTimeout(() => {
|
||||
setImportStatus((prev) => (prev?.id === taskId ? null : prev))
|
||||
}, 4000)
|
||||
} else {
|
||||
setImportStatus({
|
||||
id: taskId,
|
||||
fileName: label,
|
||||
status: 'error',
|
||||
message: result.message,
|
||||
})
|
||||
setTimeout(() => {
|
||||
setImportStatus((prev) => (prev?.id === taskId ? null : prev))
|
||||
}, 6000)
|
||||
}
|
||||
} catch (err) {
|
||||
setImportStatus({
|
||||
id: taskId,
|
||||
fileName: label,
|
||||
status: 'error',
|
||||
message: err instanceof Error ? err.message : 'Import failed.',
|
||||
})
|
||||
setTimeout(() => {
|
||||
setImportStatus((prev) => (prev?.id === taskId ? null : prev))
|
||||
}, 6000)
|
||||
}
|
||||
}
|
||||
|
||||
const handleImportRaw = (asset: AssetSummary) => {
|
||||
runImport(asset, 'raw')
|
||||
}
|
||||
|
||||
const handleImportProxy = (asset: AssetSummary, proxy: ProxyOption) => {
|
||||
runImport(asset, 'proxy', proxy)
|
||||
}
|
||||
|
||||
// Debounce search term by 300ms
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
setDebouncedSearch(searchTerm.trim())
|
||||
}, 300)
|
||||
return () => clearTimeout(timer)
|
||||
}, [searchTerm])
|
||||
|
||||
// Initial fetch of both folders and files
|
||||
const fetchContents = useCallback(
|
||||
async (folderId: string, query: string) => {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
try {
|
||||
const client = getShumaiClient(endpoint, apiKey)
|
||||
const isSearching = Boolean(query)
|
||||
|
||||
const conditions: SearchCondition[] = isSearching
|
||||
? [{ field: 'name', operator: 'contains', value: query }]
|
||||
: []
|
||||
|
||||
const sort: SearchSort = { field: 'name', order: 'asc' }
|
||||
|
||||
// Fetch first page of folders and files in parallel
|
||||
const [foldersRes, filesRes] = await Promise.all([
|
||||
client.api.folders[':folderId'].search.$post({
|
||||
param: { folderId },
|
||||
json: {
|
||||
assetType: 'folder',
|
||||
recursively: isSearching,
|
||||
conditions,
|
||||
sort,
|
||||
first: PAGE_SIZE,
|
||||
previewFormat: 'jpeg',
|
||||
},
|
||||
}),
|
||||
client.api.folders[':folderId'].search.$post({
|
||||
param: { folderId },
|
||||
json: {
|
||||
assetType: 'file',
|
||||
recursively: isSearching,
|
||||
conditions,
|
||||
sort,
|
||||
first: PAGE_SIZE,
|
||||
previewFormat: 'jpeg',
|
||||
},
|
||||
}),
|
||||
])
|
||||
|
||||
if (!foldersRes.ok) {
|
||||
const errData = (await foldersRes.json().catch(() => ({}))) as { error?: string }
|
||||
throw new Error(errData.error || `Failed to search folders (${foldersRes.status})`)
|
||||
}
|
||||
if (!filesRes.ok) {
|
||||
const errData = (await filesRes.json().catch(() => ({}))) as { error?: string }
|
||||
throw new Error(errData.error || `Failed to search files (${filesRes.status})`)
|
||||
}
|
||||
|
||||
const foldersBody = await foldersRes.json()
|
||||
const filesBody = await filesRes.json()
|
||||
|
||||
const folderItems = (foldersBody.data || []) as AssetSummary[]
|
||||
const fileItems = (filesBody.data || []) as AssetSummary[]
|
||||
|
||||
setFolders(folderItems)
|
||||
setFoldersCursor(foldersBody.pageInfo?.cursor || null)
|
||||
setFoldersHasNext(Boolean(foldersBody.pageInfo?.cursor))
|
||||
setFoldersTotal(foldersBody.pageInfo?.total ?? folderItems.length)
|
||||
|
||||
setFiles(fileItems)
|
||||
setFilesCursor(filesBody.pageInfo?.cursor || null)
|
||||
setFilesHasNext(Boolean(filesBody.pageInfo?.cursor))
|
||||
setFilesTotal(filesBody.pageInfo?.total ?? fileItems.length)
|
||||
} catch (err) {
|
||||
console.error('Error fetching folder contents via search API:', err)
|
||||
setError(err instanceof Error ? err.message : 'Failed to load folder contents.')
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
},
|
||||
[endpoint, apiKey],
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (currentFolderId) {
|
||||
fetchContents(currentFolderId, debouncedSearch)
|
||||
} else {
|
||||
setError('Root folder ID not available for this project.')
|
||||
setLoading(false)
|
||||
}
|
||||
}, [currentFolderId, debouncedSearch, fetchContents])
|
||||
|
||||
// Paginate next files
|
||||
const fetchNextFilesPage = useCallback(async () => {
|
||||
if (!currentFolderId || !filesHasNext || loadingMoreFiles || loading) return
|
||||
setLoadingMoreFiles(true)
|
||||
try {
|
||||
const client = getShumaiClient(endpoint, apiKey)
|
||||
const isSearching = Boolean(debouncedSearch)
|
||||
const conditions: SearchCondition[] = isSearching
|
||||
? [{ field: 'name', operator: 'contains', value: debouncedSearch }]
|
||||
: []
|
||||
const sort: SearchSort = { field: 'name', order: 'asc' }
|
||||
|
||||
const res = await client.api.folders[':folderId'].search.$post({
|
||||
param: { folderId: currentFolderId },
|
||||
json: {
|
||||
assetType: 'file',
|
||||
recursively: isSearching,
|
||||
conditions,
|
||||
sort,
|
||||
first: PAGE_SIZE,
|
||||
after: filesCursor || undefined,
|
||||
previewFormat: 'jpeg',
|
||||
},
|
||||
})
|
||||
if (res.ok) {
|
||||
const body = await res.json()
|
||||
const newFiles = (body.data || []) as AssetSummary[]
|
||||
setFiles((prev) => [...prev, ...newFiles])
|
||||
setFilesCursor(body.pageInfo?.cursor || null)
|
||||
setFilesHasNext(Boolean(body.pageInfo?.cursor))
|
||||
if (body.pageInfo?.total != null) {
|
||||
setFilesTotal(body.pageInfo.total)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error fetching next files page:', err)
|
||||
} finally {
|
||||
setLoadingMoreFiles(false)
|
||||
}
|
||||
}, [
|
||||
currentFolderId,
|
||||
filesHasNext,
|
||||
loadingMoreFiles,
|
||||
loading,
|
||||
endpoint,
|
||||
apiKey,
|
||||
debouncedSearch,
|
||||
filesCursor,
|
||||
])
|
||||
|
||||
// Paginate next folders
|
||||
const fetchNextFoldersPage = useCallback(async () => {
|
||||
if (!currentFolderId || !foldersHasNext || loadingMoreFolders || loading) return
|
||||
setLoadingMoreFolders(true)
|
||||
try {
|
||||
const client = getShumaiClient(endpoint, apiKey)
|
||||
const isSearching = Boolean(debouncedSearch)
|
||||
const conditions: SearchCondition[] = isSearching
|
||||
? [{ field: 'name', operator: 'contains', value: debouncedSearch }]
|
||||
: []
|
||||
const sort: SearchSort = { field: 'name', order: 'asc' }
|
||||
|
||||
const res = await client.api.folders[':folderId'].search.$post({
|
||||
param: { folderId: currentFolderId },
|
||||
json: {
|
||||
assetType: 'folder',
|
||||
recursively: isSearching,
|
||||
conditions,
|
||||
sort,
|
||||
first: PAGE_SIZE,
|
||||
after: foldersCursor || undefined,
|
||||
previewFormat: 'jpeg',
|
||||
},
|
||||
})
|
||||
if (res.ok) {
|
||||
const body = await res.json()
|
||||
const newFolders = (body.data || []) as AssetSummary[]
|
||||
setFolders((prev) => [...prev, ...newFolders])
|
||||
setFoldersCursor(body.pageInfo?.cursor || null)
|
||||
setFoldersHasNext(Boolean(body.pageInfo?.cursor))
|
||||
if (body.pageInfo?.total != null) {
|
||||
setFoldersTotal(body.pageInfo.total)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error fetching next folders page:', err)
|
||||
} finally {
|
||||
setLoadingMoreFolders(false)
|
||||
}
|
||||
}, [
|
||||
currentFolderId,
|
||||
foldersHasNext,
|
||||
loadingMoreFolders,
|
||||
loading,
|
||||
endpoint,
|
||||
apiKey,
|
||||
debouncedSearch,
|
||||
foldersCursor,
|
||||
])
|
||||
|
||||
// Infinite scroll listener
|
||||
const handleScroll = (e: React.UIEvent<HTMLDivElement>) => {
|
||||
const target = e.currentTarget
|
||||
const threshold = 120
|
||||
const isNearBottom = target.scrollHeight - target.scrollTop - target.clientHeight <= threshold
|
||||
if (isNearBottom) {
|
||||
if (filesExpanded && filesHasNext && !loadingMoreFiles) {
|
||||
fetchNextFilesPage()
|
||||
} else if (
|
||||
foldersExpanded &&
|
||||
foldersHasNext &&
|
||||
!loadingMoreFolders &&
|
||||
(!filesExpanded || files.length === 0)
|
||||
) {
|
||||
fetchNextFoldersPage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleFolderClick = (folder: AssetSummary) => {
|
||||
setCrumbs((prev) => [...prev, { id: folder.id, name: folder.name }])
|
||||
setCurrentFolderId(folder.id)
|
||||
setSearchTerm('')
|
||||
}
|
||||
|
||||
const handleCrumbNavigate = (crumbIndex: number) => {
|
||||
setSearchTerm('')
|
||||
if (crumbIndex === -1) {
|
||||
setCrumbs([])
|
||||
if (project.rootFolder) {
|
||||
setCurrentFolderId(project.rootFolder)
|
||||
}
|
||||
} else {
|
||||
const targetCrumb = crumbs[crumbIndex]
|
||||
setCrumbs((prev) => prev.slice(0, crumbIndex + 1))
|
||||
setCurrentFolderId(targetCrumb.id)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
flex: 1,
|
||||
minHeight: 0,
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
<Breadcrumb
|
||||
projectName={project.name}
|
||||
crumbs={crumbs}
|
||||
onNavigateToProjects={onBackToProjects}
|
||||
onNavigateToCrumb={handleCrumbNavigate}
|
||||
/>
|
||||
|
||||
{/* Sticky Header: Search input & Refresh button */}
|
||||
<div className="view-sticky-header">
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '8px',
|
||||
marginBottom: '8px',
|
||||
}}
|
||||
>
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
style={{ width: '100%' }}
|
||||
placeholder="Search files and folders..."
|
||||
value={searchTerm}
|
||||
onInput={(e: React.FormEvent<HTMLElement>) =>
|
||||
setSearchTerm((e.target as HTMLInputElement).value)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<sp-button
|
||||
quiet
|
||||
variant="secondary"
|
||||
size="s"
|
||||
label="Refresh folder"
|
||||
icon-only
|
||||
onClick={() => {
|
||||
if (currentFolderId) {
|
||||
fetchContents(currentFolderId, debouncedSearch)
|
||||
void refreshLinkedAssets()
|
||||
}
|
||||
}}
|
||||
title="Refresh folder"
|
||||
disabled={loading || !currentFolderId}
|
||||
>
|
||||
<sp-icon-refresh
|
||||
slot="icon"
|
||||
size="s"
|
||||
className={loading ? 'spin' : ''}
|
||||
></sp-icon-refresh>
|
||||
</sp-button>
|
||||
</div>
|
||||
<Divider size="s" />
|
||||
</div>
|
||||
|
||||
<div className="view-content" onScroll={handleScroll}>
|
||||
{loading && (
|
||||
<div className="state-container">
|
||||
<ProgressCircle indeterminate size="m" label="Loading folder contents..." />
|
||||
<p style={{ marginTop: '8px' }}>Loading folder contents...</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{error && !loading && (
|
||||
<div className="state-container">
|
||||
<IllustratedMessage heading="Error loading folder" description={error}>
|
||||
<sp-icon-alert-circle
|
||||
size="xxl"
|
||||
style={{ color: 'var(--accent-red)' }}
|
||||
></sp-icon-alert-circle>
|
||||
</IllustratedMessage>
|
||||
{currentFolderId && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => fetchContents(currentFolderId, debouncedSearch)}
|
||||
style={{ marginTop: '12px' }}
|
||||
>
|
||||
Try Again
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!loading && !error && folders.length === 0 && files.length === 0 && (
|
||||
<div className="state-container">
|
||||
<IllustratedMessage
|
||||
heading={searchTerm ? 'No matching items' : 'Folder is empty'}
|
||||
description={
|
||||
searchTerm
|
||||
? `No files or subfolders match "${searchTerm}".`
|
||||
: 'No files or subfolders found in this directory.'
|
||||
}
|
||||
>
|
||||
<sp-icon-folder-open size="xxl" style={{ color: '#999999' }}></sp-icon-folder-open>
|
||||
</IllustratedMessage>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!loading && !error && (folders.length > 0 || files.length > 0) && (
|
||||
<>
|
||||
{/* Folders Section */}
|
||||
{folders.length > 0 && (
|
||||
<div className="section-container">
|
||||
<div
|
||||
className="section-header"
|
||||
onClick={() => setFoldersExpanded(!foldersExpanded)}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
title={foldersExpanded ? 'Collapse Folders' : 'Expand Folders'}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
setFoldersExpanded(!foldersExpanded)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="section-header-left">
|
||||
<sp-button
|
||||
quiet
|
||||
variant="secondary"
|
||||
size="xs"
|
||||
label={foldersExpanded ? 'Collapse Folders' : 'Expand Folders'}
|
||||
icon-only
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
setFoldersExpanded(!foldersExpanded)
|
||||
}}
|
||||
>
|
||||
{foldersExpanded ? (
|
||||
<sp-icon-chevron-down slot="icon" size="xs"></sp-icon-chevron-down>
|
||||
) : (
|
||||
<sp-icon-chevron-right slot="icon" size="xs"></sp-icon-chevron-right>
|
||||
)}
|
||||
</sp-button>
|
||||
<span className="section-title">Folders</span>
|
||||
<span className="count-badge">{foldersTotal ?? folders.length}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{foldersExpanded && (
|
||||
<>
|
||||
<div className="file-card-list">
|
||||
{folders.map((folder) => (
|
||||
<FileCardItem
|
||||
key={folder.id}
|
||||
asset={folder}
|
||||
endpoint={endpoint}
|
||||
onClick={() => handleFolderClick(folder)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{foldersHasNext && (
|
||||
<div style={{ display: 'flex', justifyContent: 'center', padding: '6px 0' }}>
|
||||
{loadingMoreFolders ? (
|
||||
<ProgressCircle indeterminate size="s" label="Loading more folders..." />
|
||||
) : (
|
||||
<ActionButton quiet size="s" onClick={fetchNextFoldersPage}>
|
||||
Load more folders
|
||||
</ActionButton>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Files Section */}
|
||||
{files.length > 0 && (
|
||||
<div
|
||||
className="section-container"
|
||||
style={{ marginTop: folders.length > 0 && foldersExpanded ? '14px' : '4px' }}
|
||||
>
|
||||
<div
|
||||
className="section-header"
|
||||
onClick={() => setFilesExpanded(!filesExpanded)}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
title={filesExpanded ? 'Collapse Files' : 'Expand Files'}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault()
|
||||
setFilesExpanded(!filesExpanded)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="section-header-left">
|
||||
<sp-button
|
||||
quiet
|
||||
variant="secondary"
|
||||
size="xs"
|
||||
label={filesExpanded ? 'Collapse Files' : 'Expand Files'}
|
||||
icon-only
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
setFilesExpanded(!filesExpanded)
|
||||
}}
|
||||
>
|
||||
{filesExpanded ? (
|
||||
<sp-icon-chevron-down slot="icon" size="xs"></sp-icon-chevron-down>
|
||||
) : (
|
||||
<sp-icon-chevron-right slot="icon" size="xs"></sp-icon-chevron-right>
|
||||
)}
|
||||
</sp-button>
|
||||
<span className="section-title">Files</span>
|
||||
<span className="count-badge">{filesTotal ?? files.length}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{filesExpanded && (
|
||||
<>
|
||||
<div className="file-card-list">
|
||||
{files.map((file) => (
|
||||
<FileCardItem
|
||||
key={file.id}
|
||||
asset={file}
|
||||
endpoint={endpoint}
|
||||
apiKey={apiKey}
|
||||
onClick={() => {}}
|
||||
onImportRaw={handleImportRaw}
|
||||
onSelectVideoForImport={setVideoForDialog}
|
||||
onLinkSequence={setAssetForLinkDialog}
|
||||
onUnlinkSequence={handleUnlinkAsset}
|
||||
isLinked={Boolean(linkedAssetsMap[file.id])}
|
||||
linkedSequenceName={linkedAssetsMap[file.id]?.sequenceName}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{loadingMoreFiles && (
|
||||
<div style={{ display: 'flex', justifyContent: 'center', padding: '10px 0' }}>
|
||||
<ProgressCircle indeterminate size="s" label="Loading more files..." />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{filesHasNext && !loadingMoreFiles && (
|
||||
<div style={{ display: 'flex', justifyContent: 'center', padding: '6px 0' }}>
|
||||
<ActionButton quiet size="s" onClick={fetchNextFilesPage}>
|
||||
Load more files
|
||||
</ActionButton>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Video Import Modal Dialog */}
|
||||
<ImportVideoDialog
|
||||
asset={videoForDialog}
|
||||
endpoint={endpoint}
|
||||
apiKey={apiKey}
|
||||
isOpen={videoForDialog != null}
|
||||
onClose={() => setVideoForDialog(null)}
|
||||
onImportRaw={handleImportRaw}
|
||||
onImportProxy={handleImportProxy}
|
||||
/>
|
||||
|
||||
{/* Sequence Linking Modal Dialog */}
|
||||
<LinkSequenceDialog
|
||||
asset={assetForLinkDialog}
|
||||
endpoint={endpoint}
|
||||
apiKey={apiKey}
|
||||
isOpen={assetForLinkDialog != null}
|
||||
onClose={() => setAssetForLinkDialog(null)}
|
||||
onLinkSuccess={(newLink, addedCount) => {
|
||||
setLinkedAssetsMap((prev) => ({
|
||||
...prev,
|
||||
[newLink.assetId]: newLink,
|
||||
}))
|
||||
void refreshLinkedAssets()
|
||||
setImportStatus({
|
||||
id: Date.now().toString(),
|
||||
fileName: newLink.assetName,
|
||||
status: 'success',
|
||||
message: `Linked to "${newLink.sequenceName}". Synced ${addedCount} comment ${addedCount === 1 ? 'marker' : 'markers'}.`,
|
||||
})
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Toast Notification for Import Progress & Status */}
|
||||
{importStatus && (
|
||||
<div className={`shumai-import-toast ${importStatus.status}`}>
|
||||
<div className="shumai-toast-left">
|
||||
{importStatus.status === 'importing' && (
|
||||
<ProgressCircle indeterminate size="s" label="Importing..." />
|
||||
)}
|
||||
{importStatus.status === 'success' && <StatusLight variant="positive"></StatusLight>}
|
||||
{importStatus.status === 'error' && <StatusLight variant="negative"></StatusLight>}
|
||||
<div className="shumai-toast-text">
|
||||
<span className="shumai-toast-title">{importStatus.fileName}</span>
|
||||
<span className="shumai-toast-msg">{importStatus.message}</span>
|
||||
</div>
|
||||
</div>
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
onClick={() => setImportStatus(null)}
|
||||
title="Dismiss notification"
|
||||
>
|
||||
×
|
||||
</sp-action-button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { getShumaiClient } from '../api/client'
|
||||
import { ProjectCard } from '../components/ProjectCard'
|
||||
import { Button } from '@swc-react/button'
|
||||
import { ProgressCircle } from '@swc-react/progress-circle'
|
||||
import { IllustratedMessage } from '@swc-react/illustrated-message'
|
||||
import { Divider } from '@swc-react/divider'
|
||||
|
||||
export interface ProjectSummary {
|
||||
id: string
|
||||
name: string
|
||||
teamId: string
|
||||
rootFolder?: string | null
|
||||
coverImage?: string | null
|
||||
updatedAt?: string | Date
|
||||
}
|
||||
|
||||
interface ProjectsViewProps {
|
||||
endpoint: string
|
||||
apiKey: string
|
||||
onSelectProject: (project: ProjectSummary) => void
|
||||
}
|
||||
|
||||
export const ProjectsView: React.FC<ProjectsViewProps> = ({
|
||||
endpoint,
|
||||
apiKey,
|
||||
onSelectProject,
|
||||
}) => {
|
||||
const [projects, setProjects] = useState<ProjectSummary[]>([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
|
||||
const fetchProjects = async () => {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
try {
|
||||
const client = getShumaiClient(endpoint, apiKey)
|
||||
const res = await client.api.projects.$get({
|
||||
query: { first: '200', previewFormat: 'jpeg' },
|
||||
})
|
||||
|
||||
if (!res.ok) {
|
||||
const errData = (await res.json().catch(() => ({}))) as { error?: string }
|
||||
throw new Error(errData.error || `Failed to fetch projects (${res.status})`)
|
||||
}
|
||||
|
||||
const body = await res.json()
|
||||
setProjects((body.data || []) as ProjectSummary[])
|
||||
} catch (err) {
|
||||
console.error('Error fetching projects:', err)
|
||||
setError(err instanceof Error ? err.message : 'Failed to load projects.')
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
fetchProjects()
|
||||
}, [endpoint, apiKey])
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
flex: 1,
|
||||
minHeight: 0,
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
{/* Sticky Title Bar */}
|
||||
<div className="view-sticky-header">
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
marginBottom: '8px',
|
||||
}}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '6px' }}>
|
||||
<h2 style={{ fontSize: '13px', fontWeight: 600 }}>Projects</h2>
|
||||
{!loading && <span className="count-badge">{projects.length}</span>}
|
||||
</div>
|
||||
|
||||
<sp-button
|
||||
quiet
|
||||
variant="secondary"
|
||||
size="s"
|
||||
label="Refresh projects"
|
||||
icon-only
|
||||
onClick={fetchProjects}
|
||||
title="Refresh projects"
|
||||
disabled={loading}
|
||||
>
|
||||
<sp-icon-refresh
|
||||
slot="icon"
|
||||
size="s"
|
||||
className={loading ? 'spin' : ''}
|
||||
></sp-icon-refresh>
|
||||
</sp-button>
|
||||
</div>
|
||||
<Divider size="s" />
|
||||
</div>
|
||||
|
||||
<div className="view-content">
|
||||
{loading && (
|
||||
<div className="state-container">
|
||||
<ProgressCircle indeterminate size="m" label="Loading projects..." />
|
||||
<p style={{ marginTop: '8px' }}>Loading projects...</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{error && !loading && (
|
||||
<div className="state-container">
|
||||
<IllustratedMessage heading="Error loading projects" description={error}>
|
||||
<sp-icon-alert-circle
|
||||
size="xxl"
|
||||
style={{ color: 'var(--accent-red)' }}
|
||||
></sp-icon-alert-circle>
|
||||
</IllustratedMessage>
|
||||
<Button variant="secondary" onClick={fetchProjects} style={{ marginTop: '12px' }}>
|
||||
Try Again
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!loading && !error && projects.length === 0 && (
|
||||
<div className="state-container">
|
||||
<IllustratedMessage
|
||||
heading="No projects found"
|
||||
description="Create a project in your Shumai workspace to get started."
|
||||
>
|
||||
<sp-icon-briefcase size="xxl" style={{ color: '#999999' }}></sp-icon-briefcase>
|
||||
</IllustratedMessage>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!loading && !error && projects.length > 0 && (
|
||||
<div className="project-card-list">
|
||||
{projects.map((project) => (
|
||||
<ProjectCard
|
||||
key={project.id}
|
||||
project={project}
|
||||
endpoint={endpoint}
|
||||
onClick={() => onSelectProject(project)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
// @vitest-environment happy-dom
|
||||
import React, { act } from 'react'
|
||||
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'
|
||||
import { render, screen, fireEvent, cleanup } from '@testing-library/react'
|
||||
import { SequencesView } from './SequencesView'
|
||||
import type { Project, Sequence } from '@adobe/premierepro'
|
||||
import * as premiereService from '../services/premiere'
|
||||
import * as linkStorage from '../services/linkStorage'
|
||||
import * as markersService from '../services/markers'
|
||||
import type { CommentInfo } from '@shumai/dtos'
|
||||
|
||||
// Configure React 19 act environment for happy-dom
|
||||
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
|
||||
|
||||
describe('SequencesView Component', () => {
|
||||
const mockOnLinkCountChange = vi.fn()
|
||||
|
||||
beforeEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
cleanup()
|
||||
})
|
||||
|
||||
it('renders unified empty state when no sequences are linked', async () => {
|
||||
const mockSeq = { guid: 'seq-1', name: 'Sequence 01' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getActiveSequence').mockResolvedValue(mockSeq as unknown as Sequence)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([mockSeq as unknown as Sequence])
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([])
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<SequencesView
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
onLinkCountChange={mockOnLinkCountChange}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
expect(screen.getByText('No Linked Sequences')).toBeDefined()
|
||||
expect(screen.getByText(/Sequence 01/i)).toBeDefined()
|
||||
expect(screen.queryByText('Browse Assets to Link')).toBeNull()
|
||||
})
|
||||
|
||||
it('renders linked sequence card and handles unlink', async () => {
|
||||
const mockSeq = { guid: 'seq-1', name: 'Sequence 01' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
const mockLink = {
|
||||
sequenceGuid: 'seq-1',
|
||||
sequenceName: 'Sequence 01',
|
||||
assetId: 'asset-1',
|
||||
assetName: 'final_edit.mp4',
|
||||
syncedCommentIds: ['comm-1'],
|
||||
lastSyncAt: Date.now(),
|
||||
totalCommentsSynced: 1,
|
||||
}
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getActiveSequence').mockResolvedValue(mockSeq as unknown as Sequence)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([mockSeq as unknown as Sequence])
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([mockLink])
|
||||
vi.spyOn(linkStorage, 'removeSequenceLink').mockResolvedValue(true)
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<SequencesView
|
||||
endpoint="https://api.shumai.test"
|
||||
apiKey="test-key"
|
||||
onLinkCountChange={mockOnLinkCountChange}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
expect(screen.getAllByText('Sequence 01').length).toBeGreaterThan(0)
|
||||
expect(screen.getAllByText(/Asset: final_edit.mp4/i).length).toBeGreaterThan(0)
|
||||
|
||||
const unlinkButtons = screen.getAllByTitle('Unlink sequence')
|
||||
expect(unlinkButtons.length).toBeGreaterThan(0)
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.click(unlinkButtons[0])
|
||||
})
|
||||
|
||||
expect(linkStorage.removeSequenceLink).toHaveBeenCalledWith(mockProject, mockSeq)
|
||||
})
|
||||
|
||||
it('filters out foreign endpoint links from the view and link count', async () => {
|
||||
const mockSeq1 = { guid: 'seq-1', name: 'Sequence Foreign' }
|
||||
const mockSeq2 = { guid: 'seq-2', name: 'Sequence Staging' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
const foreignLink = {
|
||||
sequenceGuid: 'seq-1',
|
||||
sequenceName: 'Sequence Foreign',
|
||||
assetId: 'asset-dev',
|
||||
assetName: 'dev_asset.mp4',
|
||||
endpoint: 'http://localhost:3000',
|
||||
syncedCommentIds: [],
|
||||
lastSyncAt: Date.now(),
|
||||
totalCommentsSynced: 0,
|
||||
}
|
||||
const stagingLink = {
|
||||
sequenceGuid: 'seq-2',
|
||||
sequenceName: 'Sequence Staging',
|
||||
assetId: 'asset-staging',
|
||||
assetName: 'staging_asset.mp4',
|
||||
endpoint: 'https://staging.shumai.one',
|
||||
syncedCommentIds: [],
|
||||
lastSyncAt: Date.now(),
|
||||
totalCommentsSynced: 0,
|
||||
}
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getActiveSequence').mockResolvedValue(
|
||||
mockSeq1 as unknown as Sequence,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([
|
||||
mockSeq1 as unknown as Sequence,
|
||||
mockSeq2 as unknown as Sequence,
|
||||
])
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([foreignLink, stagingLink])
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<SequencesView
|
||||
endpoint="https://staging.shumai.one"
|
||||
apiKey="staging-key"
|
||||
onLinkCountChange={mockOnLinkCountChange}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
// Foreign link should be completely hidden
|
||||
expect(screen.queryByText('dev_asset.mp4')).toBeNull()
|
||||
expect(screen.queryByText(/Server:/i)).toBeNull()
|
||||
|
||||
// Matching link should be visible
|
||||
expect(screen.getAllByText(/staging_asset.mp4/i).length).toBeGreaterThan(0)
|
||||
|
||||
// Active sequence (seq-1) is linked to foreign server, so current sequence card should show unlinked state
|
||||
expect(screen.getByText('This sequence is not linked to any Shumai asset.')).toBeDefined()
|
||||
|
||||
// Link count reported to parent should only count staging link (1)
|
||||
expect(mockOnLinkCountChange).toHaveBeenCalledWith(1)
|
||||
})
|
||||
|
||||
it('shows error toast when manual sync fails', async () => {
|
||||
const mockSeq = { guid: 'seq-1', name: 'Sequence 01' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
const mockLink = {
|
||||
sequenceGuid: 'seq-1',
|
||||
sequenceName: 'Sequence 01',
|
||||
assetId: 'asset-missing',
|
||||
assetName: 'missing.mp4',
|
||||
endpoint: 'https://staging.shumai.one',
|
||||
syncedCommentIds: [],
|
||||
lastSyncAt: Date.now(),
|
||||
totalCommentsSynced: 0,
|
||||
}
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getActiveSequence').mockResolvedValue(mockSeq as unknown as Sequence)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([mockSeq as unknown as Sequence])
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([mockLink])
|
||||
|
||||
vi.spyOn(markersService, 'fetchAssetComments').mockRejectedValue(
|
||||
new Error('Asset not found on this server (HTTP 404)'),
|
||||
)
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<SequencesView
|
||||
endpoint="https://staging.shumai.one"
|
||||
apiKey="staging-key"
|
||||
onLinkCountChange={mockOnLinkCountChange}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
const syncButtons = screen.getAllByTitle('Sync comments now')
|
||||
expect(syncButtons[0].hasAttribute('disabled')).toBe(false)
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.click(syncButtons[0])
|
||||
})
|
||||
|
||||
expect(markersService.fetchAssetComments).toHaveBeenCalledWith(
|
||||
'https://staging.shumai.one',
|
||||
'staging-key',
|
||||
'asset-missing',
|
||||
)
|
||||
expect(screen.getByText('Asset not found on this server (HTTP 404)')).toBeDefined()
|
||||
})
|
||||
|
||||
it('shows success toast when manual sync succeeds', async () => {
|
||||
const mockSeq = { guid: 'seq-1', name: 'Sequence 01' }
|
||||
const mockProject = { guid: 'proj-1' }
|
||||
const mockLink = {
|
||||
sequenceGuid: 'seq-1',
|
||||
sequenceName: 'Sequence 01',
|
||||
assetId: 'asset-1',
|
||||
assetName: 'final.mp4',
|
||||
endpoint: 'https://staging.shumai.one',
|
||||
syncedCommentIds: [],
|
||||
lastSyncAt: Date.now(),
|
||||
totalCommentsSynced: 0,
|
||||
}
|
||||
|
||||
vi.spyOn(premiereService, 'getActiveProject').mockResolvedValue(
|
||||
mockProject as unknown as Project,
|
||||
)
|
||||
vi.spyOn(premiereService, 'getActiveSequence').mockResolvedValue(mockSeq as unknown as Sequence)
|
||||
vi.spyOn(premiereService, 'getAllSequences').mockResolvedValue([mockSeq as unknown as Sequence])
|
||||
vi.spyOn(linkStorage, 'getAllLinkedSequences').mockResolvedValue([mockLink])
|
||||
|
||||
vi.spyOn(markersService, 'fetchAssetComments').mockResolvedValue([
|
||||
{ id: 'comm-1', second: 10, message: 'Fix color' } as unknown as CommentInfo,
|
||||
])
|
||||
vi.spyOn(markersService, 'syncCommentsToSequence').mockResolvedValue({
|
||||
updatedLink: { ...mockLink, syncedCommentIds: ['comm-1'], totalCommentsSynced: 1 },
|
||||
addedCount: 1,
|
||||
})
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<SequencesView
|
||||
endpoint="https://staging.shumai.one"
|
||||
apiKey="staging-key"
|
||||
onLinkCountChange={mockOnLinkCountChange}
|
||||
/>,
|
||||
)
|
||||
})
|
||||
|
||||
const syncButtons = screen.getAllByTitle('Sync comments now')
|
||||
await act(async () => {
|
||||
fireEvent.click(syncButtons[0])
|
||||
})
|
||||
|
||||
expect(screen.getByText('Synced 1 new comment marker for "Sequence 01".')).toBeDefined()
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,524 @@
|
||||
import React, { useState, useEffect, useCallback } from 'react'
|
||||
import type { Project, Sequence } from '@adobe/premierepro'
|
||||
import type { LinkedSequenceAsset } from '../types/link'
|
||||
import {
|
||||
getActiveProject,
|
||||
getActiveSequence,
|
||||
getAllSequences,
|
||||
openSequenceInTimeline,
|
||||
getPremiereModule,
|
||||
} from '../services/premiere'
|
||||
import { getAllLinkedSequences, normalizeGuid, removeSequenceLink } from '../services/linkStorage'
|
||||
import { fetchAssetComments, syncCommentsToSequence } from '../services/markers'
|
||||
import { resolveAssetUrl, isSameEndpoint } from '../utils/url'
|
||||
import { formatDateAgo } from '../utils/date'
|
||||
import { ProgressCircle } from '@swc-react/progress-circle'
|
||||
|
||||
export interface SequencesViewProps {
|
||||
endpoint: string
|
||||
apiKey: string
|
||||
onLinkCountChange?: (count: number) => void
|
||||
}
|
||||
|
||||
export const SequencesView: React.FC<SequencesViewProps> = ({
|
||||
endpoint,
|
||||
apiKey,
|
||||
onLinkCountChange,
|
||||
}) => {
|
||||
const [project, setProject] = useState<Project | null>(null)
|
||||
const [activeSeq, setActiveSeq] = useState<Sequence | null>(null)
|
||||
const [allSeqs, setAllSeqs] = useState<Sequence[]>([])
|
||||
const [linkedSequences, setLinkedSequences] = useState<LinkedSequenceAsset[]>([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [syncingGuid, setSyncingGuid] = useState<string | null>(null)
|
||||
const [unlinkingGuid, setUnlinkingGuid] = useState<string | null>(null)
|
||||
const [toast, setToast] = useState<{ type: 'success' | 'error'; message: string } | null>(null)
|
||||
|
||||
const loadData = useCallback(async () => {
|
||||
try {
|
||||
const pr = await getActiveProject()
|
||||
setProject(pr)
|
||||
if (!pr) {
|
||||
setActiveSeq(null)
|
||||
setAllSeqs([])
|
||||
setLinkedSequences([])
|
||||
onLinkCountChange?.(0)
|
||||
return
|
||||
}
|
||||
|
||||
const [currentActive, seqsList] = await Promise.all([
|
||||
getActiveSequence(pr),
|
||||
getAllSequences(pr),
|
||||
])
|
||||
|
||||
setActiveSeq(currentActive)
|
||||
setAllSeqs(seqsList)
|
||||
|
||||
const allLinks = await getAllLinkedSequences(pr, seqsList)
|
||||
// Hide foreign links entirely: only show sequences linked to the current endpoint
|
||||
const currentServerLinks = allLinks.filter(
|
||||
(link) => !link.endpoint || isSameEndpoint(link.endpoint, endpoint),
|
||||
)
|
||||
setLinkedSequences(currentServerLinks)
|
||||
onLinkCountChange?.(currentServerLinks.length)
|
||||
} catch (err) {
|
||||
console.error('[SequencesView] Failed to load sequences data:', err)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}, [endpoint, onLinkCountChange])
|
||||
|
||||
useEffect(() => {
|
||||
void loadData()
|
||||
|
||||
// Listen for sequence activation events in Premiere Pro
|
||||
const ppro = getPremiereModule()
|
||||
if (ppro?.EventManager && ppro.Constants?.SequenceEvent?.ACTIVATED) {
|
||||
const handleActivated = () => {
|
||||
void loadData()
|
||||
}
|
||||
try {
|
||||
ppro.EventManager.addGlobalEventListener(
|
||||
ppro.Constants.SequenceEvent.ACTIVATED,
|
||||
handleActivated,
|
||||
true,
|
||||
)
|
||||
return () => {
|
||||
try {
|
||||
ppro.EventManager.removeGlobalEventListener(
|
||||
ppro.Constants.SequenceEvent.ACTIVATED,
|
||||
handleActivated,
|
||||
)
|
||||
} catch {
|
||||
// Ignore error on unmount
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[SequencesView] Could not add SequenceEvent listener:', err)
|
||||
}
|
||||
}
|
||||
}, [loadData])
|
||||
|
||||
const showToast = (type: 'success' | 'error', message: string, duration = 4000) => {
|
||||
setToast({ type, message })
|
||||
setTimeout(() => {
|
||||
setToast((prev) => (prev?.message === message ? null : prev))
|
||||
}, duration)
|
||||
}
|
||||
|
||||
// Sync Now handler
|
||||
const handleSyncNow = async (link: LinkedSequenceAsset) => {
|
||||
if (!project || syncingGuid) return
|
||||
if (link.endpoint && !isSameEndpoint(link.endpoint, endpoint)) {
|
||||
showToast(
|
||||
'error',
|
||||
`Cannot sync comments: sequence was linked to "${link.endpoint}". Connect to that server to sync.`,
|
||||
5000,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const targetSeq =
|
||||
allSeqs.find((s) => normalizeGuid(s.guid) === normalizeGuid(link.sequenceGuid)) ||
|
||||
(await getAllSequences(project)).find(
|
||||
(s) => normalizeGuid(s.guid) === normalizeGuid(link.sequenceGuid),
|
||||
)
|
||||
if (!targetSeq) return
|
||||
|
||||
setSyncingGuid(link.sequenceGuid)
|
||||
try {
|
||||
const comments = await fetchAssetComments(endpoint, apiKey, link.assetId)
|
||||
const { updatedLink, addedCount } = await syncCommentsToSequence(
|
||||
project,
|
||||
targetSeq,
|
||||
comments,
|
||||
link,
|
||||
)
|
||||
|
||||
setLinkedSequences((prev) =>
|
||||
prev.map((item) =>
|
||||
normalizeGuid(item.sequenceGuid) === normalizeGuid(updatedLink.sequenceGuid)
|
||||
? updatedLink
|
||||
: item,
|
||||
),
|
||||
)
|
||||
|
||||
showToast(
|
||||
'success',
|
||||
addedCount > 0
|
||||
? `Synced ${addedCount} new comment ${addedCount === 1 ? 'marker' : 'markers'} for "${link.sequenceName}".`
|
||||
: `All comments are already synced for "${link.sequenceName}".`,
|
||||
)
|
||||
} catch (err) {
|
||||
console.error('[SequencesView] Failed to sync comments:', err)
|
||||
showToast(
|
||||
'error',
|
||||
err instanceof Error ? err.message : 'Failed to sync comments from server.',
|
||||
5000,
|
||||
)
|
||||
} finally {
|
||||
setSyncingGuid(null)
|
||||
}
|
||||
}
|
||||
|
||||
// Unlink handler
|
||||
const handleUnlink = async (link: LinkedSequenceAsset) => {
|
||||
if (!project || unlinkingGuid) return
|
||||
const targetSeq =
|
||||
allSeqs.find((s) => normalizeGuid(s.guid) === normalizeGuid(link.sequenceGuid)) ||
|
||||
(await getAllSequences(project)).find(
|
||||
(s) => normalizeGuid(s.guid) === normalizeGuid(link.sequenceGuid),
|
||||
)
|
||||
if (!targetSeq) return
|
||||
|
||||
setUnlinkingGuid(link.sequenceGuid)
|
||||
try {
|
||||
await removeSequenceLink(project, targetSeq)
|
||||
setLinkedSequences((prev) => {
|
||||
const next = prev.filter(
|
||||
(item) => normalizeGuid(item.sequenceGuid) !== normalizeGuid(link.sequenceGuid),
|
||||
)
|
||||
onLinkCountChange?.(next.length)
|
||||
return next
|
||||
})
|
||||
showToast('success', `Unlinked "${link.sequenceName}" from "${link.assetName}".`, 3000)
|
||||
} catch (err) {
|
||||
console.error('[SequencesView] Failed to unlink sequence:', err)
|
||||
showToast('error', 'Failed to unlink sequence.', 4000)
|
||||
} finally {
|
||||
setUnlinkingGuid(null)
|
||||
}
|
||||
}
|
||||
|
||||
// Open Sequence in Timeline handler
|
||||
const handleOpenSequence = async (link: LinkedSequenceAsset) => {
|
||||
if (!project) return
|
||||
const targetSeq =
|
||||
allSeqs.find((s) => normalizeGuid(s.guid) === normalizeGuid(link.sequenceGuid)) ||
|
||||
(await getAllSequences(project)).find(
|
||||
(s) => normalizeGuid(s.guid) === normalizeGuid(link.sequenceGuid),
|
||||
)
|
||||
if (!targetSeq) return
|
||||
|
||||
await openSequenceInTimeline(targetSeq, project)
|
||||
setActiveSeq(targetSeq)
|
||||
}
|
||||
|
||||
const renderToast = () => {
|
||||
if (!toast) return null
|
||||
const isError = toast.type === 'error'
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
marginBottom: 10,
|
||||
padding: '6px 10px',
|
||||
borderRadius: 4,
|
||||
backgroundColor: isError ? 'rgba(239, 68, 68, 0.15)' : 'rgba(59, 130, 246, 0.15)',
|
||||
border: isError
|
||||
? '1px solid rgba(239, 68, 68, 0.3)'
|
||||
: '1px solid rgba(59, 130, 246, 0.3)',
|
||||
color: isError ? '#f87171' : '#60a5fa',
|
||||
fontSize: 11,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
{isError ? (
|
||||
<sp-icon-alert-circle
|
||||
size="s"
|
||||
style={{ marginRight: 6, flexShrink: 0 }}
|
||||
></sp-icon-alert-circle>
|
||||
) : (
|
||||
<sp-icon-checkmark-circle
|
||||
size="s"
|
||||
style={{ marginRight: 6, flexShrink: 0 }}
|
||||
></sp-icon-checkmark-circle>
|
||||
)}
|
||||
<span>{toast.message}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div
|
||||
className="sequences-view-container"
|
||||
style={{ justifyContent: 'center', alignItems: 'center' }}
|
||||
>
|
||||
<ProgressCircle indeterminate size="m" label="Loading sequences..." />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const activeGuidStr = normalizeGuid(activeSeq?.guid)
|
||||
const currentSequenceLink = linkedSequences.find(
|
||||
(item) => normalizeGuid(item.sequenceGuid) === activeGuidStr,
|
||||
)
|
||||
|
||||
if (linkedSequences.length === 0) {
|
||||
return (
|
||||
<div className="sequences-view-container sequences-empty-container">
|
||||
{renderToast()}
|
||||
|
||||
<div className="sequence-empty-state unified-empty">
|
||||
<sp-icon-movie-camera
|
||||
size="xxl"
|
||||
style={{ color: '#60a5fa', opacity: 0.7, marginBottom: 12 }}
|
||||
></sp-icon-movie-camera>
|
||||
<div className="sequence-empty-state-title" style={{ fontSize: 14, marginBottom: 6 }}>
|
||||
No Linked Sequences
|
||||
</div>
|
||||
<div style={{ fontSize: 11, marginBottom: 8, maxWidth: 280, lineHeight: 1.4 }}>
|
||||
{activeSeq
|
||||
? `Active sequence "${activeSeq.name}" is not linked to any Shumai asset.`
|
||||
: 'Open a sequence in Premiere Pro and link it to a Shumai asset.'}
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
fontSize: 11,
|
||||
color: 'var(--text-secondary)',
|
||||
marginBottom: 0,
|
||||
maxWidth: 280,
|
||||
lineHeight: 1.4,
|
||||
}}
|
||||
>
|
||||
Linking a sequence enables automatic synchronization of comments from Shumai as timeline
|
||||
markers.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="sequences-view-container">
|
||||
{/* Toast Notification */}
|
||||
{renderToast()}
|
||||
|
||||
{/* SECTION 1: Current Sequence Asset */}
|
||||
<div className="sequence-section">
|
||||
<div className="sequence-section-title">Current Sequence Asset</div>
|
||||
|
||||
{currentSequenceLink ? (
|
||||
<div className="sequence-link-card current-active">
|
||||
<div className="sequence-card-row">
|
||||
<div className="sequence-card-left">
|
||||
<div className="sequence-card-thumb">
|
||||
{currentSequenceLink.assetThumbnailUrl ? (
|
||||
<img
|
||||
src={resolveAssetUrl(
|
||||
currentSequenceLink.assetThumbnailUrl,
|
||||
currentSequenceLink.endpoint || endpoint,
|
||||
)}
|
||||
alt={currentSequenceLink.assetName}
|
||||
/>
|
||||
) : (
|
||||
<sp-icon-movie-camera
|
||||
size="m"
|
||||
style={{ color: '#3b82f6' }}
|
||||
></sp-icon-movie-camera>
|
||||
)}
|
||||
</div>
|
||||
<div className="sequence-card-info">
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span className="sequence-card-title">{currentSequenceLink.sequenceName}</span>
|
||||
<span
|
||||
style={{
|
||||
fontSize: '9px',
|
||||
marginLeft: 6,
|
||||
padding: '1px 4px',
|
||||
borderRadius: 3,
|
||||
backgroundColor: 'rgba(59, 130, 246, 0.2)',
|
||||
color: '#60a5fa',
|
||||
fontWeight: 600,
|
||||
}}
|
||||
>
|
||||
Active
|
||||
</span>
|
||||
</div>
|
||||
<span className="sequence-card-subtitle" title={currentSequenceLink.assetName}>
|
||||
Asset: {currentSequenceLink.assetName}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="sequence-card-actions">
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
label="Sync comments now"
|
||||
title="Sync comments now"
|
||||
disabled={syncingGuid === currentSequenceLink.sequenceGuid}
|
||||
onClick={() => handleSyncNow(currentSequenceLink)}
|
||||
>
|
||||
{syncingGuid === currentSequenceLink.sequenceGuid ? (
|
||||
<ProgressCircle indeterminate size="s" slot="icon" label="Syncing..." />
|
||||
) : (
|
||||
<sp-icon-refresh size="s" slot="icon"></sp-icon-refresh>
|
||||
)}
|
||||
</sp-action-button>
|
||||
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
label="Unlink sequence"
|
||||
title="Unlink sequence"
|
||||
disabled={unlinkingGuid === currentSequenceLink.sequenceGuid}
|
||||
onClick={() => handleUnlink(currentSequenceLink)}
|
||||
>
|
||||
{unlinkingGuid === currentSequenceLink.sequenceGuid ? (
|
||||
<ProgressCircle indeterminate size="s" slot="icon" label="Unlinking..." />
|
||||
) : (
|
||||
<sp-icon-unlink
|
||||
size="s"
|
||||
slot="icon"
|
||||
style={{ color: '#f87171' }}
|
||||
></sp-icon-unlink>
|
||||
)}
|
||||
</sp-action-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="sequence-card-footer">
|
||||
<span>
|
||||
{currentSequenceLink.totalCommentsSynced}{' '}
|
||||
{currentSequenceLink.totalCommentsSynced === 1 ? 'comment' : 'comments'} synced
|
||||
</span>
|
||||
<span>Last sync: {formatDateAgo(currentSequenceLink.lastSyncAt) || 'Just now'}</span>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="sequence-empty-state compact">
|
||||
<sp-icon-movie-camera
|
||||
size="l"
|
||||
style={{ color: '#60a5fa', opacity: 0.6, marginBottom: 4 }}
|
||||
></sp-icon-movie-camera>
|
||||
<div className="sequence-empty-state-title">
|
||||
{activeSeq ? activeSeq.name : 'No Active Sequence'}
|
||||
</div>
|
||||
<div style={{ fontSize: 11, color: 'var(--text-secondary)', marginBottom: 8 }}>
|
||||
{activeSeq
|
||||
? 'This sequence is not linked to any Shumai asset.'
|
||||
: 'Open a sequence in the timeline to view its linked asset.'}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* SECTION 2: All Sequence Assets */}
|
||||
<div className="sequence-section" style={{ marginTop: 8 }}>
|
||||
<div className="sequence-section-title">All Sequence Assets ({linkedSequences.length})</div>
|
||||
|
||||
{linkedSequences.map((link) => {
|
||||
const isActive = normalizeGuid(link.sequenceGuid) === activeGuidStr
|
||||
const isSyncing = syncingGuid === link.sequenceGuid
|
||||
const isUnlinking = unlinkingGuid === link.sequenceGuid
|
||||
|
||||
return (
|
||||
<div
|
||||
key={link.sequenceGuid}
|
||||
className={`sequence-link-card ${isActive ? 'current-active' : ''}`}
|
||||
>
|
||||
<div className="sequence-card-row">
|
||||
<div className="sequence-card-left">
|
||||
<div className="sequence-card-thumb">
|
||||
{link.assetThumbnailUrl ? (
|
||||
<img
|
||||
src={resolveAssetUrl(link.assetThumbnailUrl, link.endpoint || endpoint)}
|
||||
alt={link.assetName}
|
||||
/>
|
||||
) : (
|
||||
<sp-icon-movie-camera
|
||||
size="m"
|
||||
style={{ color: '#60a5fa' }}
|
||||
></sp-icon-movie-camera>
|
||||
)}
|
||||
</div>
|
||||
<div className="sequence-card-info">
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span className="sequence-card-title">{link.sequenceName}</span>
|
||||
{isActive && (
|
||||
<span
|
||||
style={{
|
||||
fontSize: '9px',
|
||||
marginLeft: 6,
|
||||
padding: '1px 4px',
|
||||
borderRadius: 3,
|
||||
backgroundColor: 'rgba(59, 130, 246, 0.2)',
|
||||
color: '#60a5fa',
|
||||
fontWeight: 600,
|
||||
}}
|
||||
>
|
||||
Active
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<span className="sequence-card-subtitle" title={link.assetName}>
|
||||
Asset: {link.assetName}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="sequence-card-actions">
|
||||
{!isActive && (
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
label="Open sequence in timeline"
|
||||
title="Open sequence in timeline"
|
||||
onClick={() => handleOpenSequence(link)}
|
||||
>
|
||||
<sp-icon-link-out size="s" slot="icon"></sp-icon-link-out>
|
||||
</sp-action-button>
|
||||
)}
|
||||
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
label="Sync comments now"
|
||||
title="Sync comments now"
|
||||
disabled={isSyncing}
|
||||
onClick={() => handleSyncNow(link)}
|
||||
>
|
||||
{isSyncing ? (
|
||||
<ProgressCircle indeterminate size="s" slot="icon" label="Syncing..." />
|
||||
) : (
|
||||
<sp-icon-refresh size="s" slot="icon"></sp-icon-refresh>
|
||||
)}
|
||||
</sp-action-button>
|
||||
|
||||
<sp-action-button
|
||||
quiet
|
||||
size="xs"
|
||||
label="Unlink sequence"
|
||||
title="Unlink sequence"
|
||||
disabled={isUnlinking}
|
||||
onClick={() => handleUnlink(link)}
|
||||
>
|
||||
{isUnlinking ? (
|
||||
<ProgressCircle indeterminate size="s" slot="icon" label="Unlinking..." />
|
||||
) : (
|
||||
<sp-icon-unlink
|
||||
size="s"
|
||||
slot="icon"
|
||||
style={{ color: '#f87171' }}
|
||||
></sp-icon-unlink>
|
||||
)}
|
||||
</sp-action-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="sequence-card-footer">
|
||||
<span>
|
||||
{link.totalCommentsSynced}{' '}
|
||||
{link.totalCommentsSynced === 1 ? 'comment' : 'comments'} synced
|
||||
</span>
|
||||
<span>Last sync: {formatDateAgo(link.lastSyncAt) || 'Just now'}</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react",
|
||||
"types": ["bun", "node", "@adobe/premierepro"]
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@shumai/transcode-app",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@shumai/web-app",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
},
|
||||
"apps/agent": {
|
||||
"name": "@shumai/agent-app",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"bin": {
|
||||
"shumai-agent": "./src/index.ts",
|
||||
},
|
||||
@@ -45,7 +45,7 @@
|
||||
},
|
||||
"apps/cli": {
|
||||
"name": "@shumai/cli",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"bin": {
|
||||
"shumai-cli": "./src/index.ts",
|
||||
},
|
||||
@@ -58,9 +58,63 @@
|
||||
"ulid": "3.0.2",
|
||||
},
|
||||
},
|
||||
"apps/premiere-uxp": {
|
||||
"name": "@shumai/premiere-uxp",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@shumai/api": "workspace:*",
|
||||
"@shumai/dtos": "workspace:*",
|
||||
"@spectrum-web-components/action-menu": "0.37.0",
|
||||
"@spectrum-web-components/badge": "0.37.0",
|
||||
"@spectrum-web-components/icon": "1.12.2",
|
||||
"@spectrum-web-components/icons-workflow": "1.12.2",
|
||||
"@spectrum-web-components/menu": "0.37.0",
|
||||
"@spectrum-web-components/progress-circle": "0.37.0",
|
||||
"@spectrum-web-components/status-light": "0.37.0",
|
||||
"@spectrum-web-components/theme": "0.37.0",
|
||||
"@swc-react/action-button": "0.37.0",
|
||||
"@swc-react/action-group": "0.37.0",
|
||||
"@swc-react/action-menu": "0.37.0",
|
||||
"@swc-react/badge": "0.37.0",
|
||||
"@swc-react/button": "0.37.0",
|
||||
"@swc-react/card": "0.37.0",
|
||||
"@swc-react/divider": "0.37.0",
|
||||
"@swc-react/field-label": "0.37.0",
|
||||
"@swc-react/help-text": "0.37.0",
|
||||
"@swc-react/illustrated-message": "0.37.0",
|
||||
"@swc-react/menu": "0.37.0",
|
||||
"@swc-react/progress-circle": "0.37.0",
|
||||
"@swc-react/search": "0.37.0",
|
||||
"@swc-react/status-light": "0.37.0",
|
||||
"@swc-react/textfield": "0.37.0",
|
||||
"@swc-react/theme": "0.37.0",
|
||||
"@swc-uxp-wrappers/action-button": "2.0.0",
|
||||
"@swc-uxp-wrappers/action-group": "2.0.0",
|
||||
"@swc-uxp-wrappers/button": "2.0.0",
|
||||
"@swc-uxp-wrappers/card": "2.0.0",
|
||||
"@swc-uxp-wrappers/divider": "2.0.0",
|
||||
"@swc-uxp-wrappers/field-label": "2.0.0",
|
||||
"@swc-uxp-wrappers/help-text": "2.0.0",
|
||||
"@swc-uxp-wrappers/illustrated-message": "2.0.0",
|
||||
"@swc-uxp-wrappers/menu": "2.0.0",
|
||||
"@swc-uxp-wrappers/overlay": "2.0.0",
|
||||
"@swc-uxp-wrappers/popover": "2.0.0",
|
||||
"@swc-uxp-wrappers/search": "2.0.0",
|
||||
"@swc-uxp-wrappers/textfield": "2.0.0",
|
||||
"@swc-uxp-wrappers/utils": "2.0.1",
|
||||
"hono": "4.13.5",
|
||||
"react": "19.2.8",
|
||||
"react-dom": "19.2.8",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@adobe/premierepro": "26.3.0",
|
||||
"@types/react": "19.2.18",
|
||||
"@types/react-dom": "19.2.7",
|
||||
},
|
||||
},
|
||||
"apps/transcode": {
|
||||
"name": "@shumai/transcode-app",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"bin": {
|
||||
"shumai-transcode": "./src/index.ts",
|
||||
},
|
||||
@@ -72,7 +126,7 @@
|
||||
},
|
||||
"apps/web": {
|
||||
"name": "@shumai/web-app",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@shumai/agent": "workspace:*",
|
||||
"@shumai/api": "workspace:*",
|
||||
@@ -92,7 +146,7 @@
|
||||
},
|
||||
"packages/agent": {
|
||||
"name": "@shumai/agent",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sandbox-runtime": "0.0.74",
|
||||
"@earendil-works/pi-agent-core": "0.82.1",
|
||||
@@ -117,7 +171,7 @@
|
||||
},
|
||||
"packages/api": {
|
||||
"name": "@shumai/api",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@hono/zod-validator": "0.7.6",
|
||||
"@shumai/core": "workspace:*",
|
||||
@@ -131,7 +185,7 @@
|
||||
},
|
||||
"packages/core": {
|
||||
"name": "@shumai/core",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@ai-sdk/alibaba": "2.0.38",
|
||||
"@ai-sdk/amazon-bedrock": "5.0.67",
|
||||
@@ -188,7 +242,7 @@
|
||||
},
|
||||
"packages/db": {
|
||||
"name": "@shumai/db",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@earendil-works/pi-agent-core": "0.82.1",
|
||||
"@prisma/adapter-pg": "7.10.0",
|
||||
@@ -204,7 +258,7 @@
|
||||
},
|
||||
"packages/dtos": {
|
||||
"name": "@shumai/dtos",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@earendil-works/pi-agent-core": "0.82.1",
|
||||
"zod": "4.5.4",
|
||||
@@ -212,7 +266,7 @@
|
||||
},
|
||||
"packages/e2e": {
|
||||
"name": "@shumai/e2e",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@earendil-works/pi-agent-core": "0.82.1",
|
||||
"@google/genai": "2.19.0",
|
||||
@@ -227,11 +281,11 @@
|
||||
},
|
||||
"packages/tableprinter": {
|
||||
"name": "@shumai/tableprinter",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
},
|
||||
"packages/transcode": {
|
||||
"name": "@shumai/transcode",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@shumai/core": "workspace:*",
|
||||
"@shumai/db": "workspace:*",
|
||||
@@ -245,12 +299,13 @@
|
||||
},
|
||||
"packages/webui": {
|
||||
"name": "@shumai/webui",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@base-ui/react": "1.7.0",
|
||||
"@dnd-kit/abstract": "0.5.0",
|
||||
"@dnd-kit/dom": "0.5.0",
|
||||
"@dnd-kit/react": "0.5.0",
|
||||
"@ferrucc-io/emoji-picker": "0.1.2",
|
||||
"@hookform/resolvers": "5.9.1",
|
||||
"@lexical/code": "0.49.0",
|
||||
"@lexical/link": "0.49.0",
|
||||
@@ -346,7 +401,7 @@
|
||||
},
|
||||
"packages/workflow-core": {
|
||||
"name": "@shumai/workflow-core",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"dependencies": {
|
||||
"@shumai/core": "workspace:*",
|
||||
"@shumai/db": "workspace:*",
|
||||
@@ -362,6 +417,8 @@
|
||||
"@earendil-works/pi-ai@0.82.1": "patches/@earendil-works%2Fpi-ai@0.82.1.patch",
|
||||
},
|
||||
"packages": {
|
||||
"@adobe/premierepro": ["@adobe/premierepro@26.3.0", "", {}, "sha512-J84zEX8R4L5EU5EVVs3AWkd4LRoXPKueo28jPNfwwDAo69TOSNsAblImtsAmJR4HGDDazsvHkMQE3JBJqIcB9Q=="],
|
||||
|
||||
"@ai-sdk/alibaba": ["@ai-sdk/alibaba@2.0.38", "", { "dependencies": { "@ai-sdk/provider": "4.0.8", "@ai-sdk/provider-utils": "5.0.33" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-cPXqexcd/l94AyDeo2DoRBqQl6jrXwZbv7FBcnrKbz59U3RHJcxOs3a9KnxYYrmI4rs5iCqh3LGI0jb+Efw+ng=="],
|
||||
|
||||
"@ai-sdk/amazon-bedrock": ["@ai-sdk/amazon-bedrock@5.0.67", "", { "dependencies": { "@ai-sdk/anthropic": "4.0.45", "@ai-sdk/openai": "4.0.51", "@ai-sdk/provider": "4.0.8", "@ai-sdk/provider-utils": "5.0.33", "@smithy/eventstream-codec": "^4.3.3", "@smithy/util-utf8": "^4.3.3", "aws4fetch": "^1.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-GFhqE9rHOTrSwcNcqvBNGdU4DD9a6tsYCz/KelQZJy3XAAaUpLkTvefITLNX2A+n/MHfu6Q9TPhKrOpXj5auSQ=="],
|
||||
@@ -578,6 +635,8 @@
|
||||
|
||||
"@eslint/plugin-kit": ["@eslint/plugin-kit@0.7.2", "", { "dependencies": { "@eslint/core": "^1.2.1", "levn": "^0.4.1" } }, "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A=="],
|
||||
|
||||
"@ferrucc-io/emoji-picker": ["@ferrucc-io/emoji-picker@0.1.2", "", { "dependencies": { "@tanstack/react-virtual": "^3.11.2", "clsx": "^2.1.1", "jotai": "^2.11.1", "node-emoji": "^2.1.3", "tailwind-merge": "^3.4.0", "unicode-emoji-json": "^0.8.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0", "tailwindcss": ">=3.0.0" } }, "sha512-P15x8qOOz3n12lkCWrnKbniy2otHTg0JLyK2LNsQzrj2UJwltSDcitqj10+FRf4dMEFuGKHPjiwqP/8Xz2e+YA=="],
|
||||
|
||||
"@floating-ui/core": ["@floating-ui/core@1.8.0", "", { "dependencies": { "@floating-ui/utils": "^0.2.12" } }, "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ=="],
|
||||
|
||||
"@floating-ui/dom": ["@floating-ui/dom@1.8.0", "", { "dependencies": { "@floating-ui/core": "^1.8.0", "@floating-ui/utils": "^0.2.12" } }, "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg=="],
|
||||
@@ -764,6 +823,14 @@
|
||||
|
||||
"@lexical/yjs": ["@lexical/yjs@0.49.0", "", { "dependencies": { "@lexical/internal": "0.49.0", "@lexical/selection": "0.49.0", "lexical": "0.49.0" }, "peerDependencies": { "typescript": ">=5.2", "yjs": ">=13.5.22" }, "optionalPeers": ["typescript"] }, "sha512-uqV3D0AOLqQ1f/Bo6ZtuDLoJYGlBm0RlucNYhNvfMAncEw0f/xHc1pTyXeWjdCI/iWgWR/MV6hgVi26TSPs+Vg=="],
|
||||
|
||||
"@lit-labs/observers": ["@lit-labs/observers@2.0.2", "", { "dependencies": { "@lit/reactive-element": "^1.0.0 || ^2.0.0" } }, "sha512-eZb5+W9Cb0e/Y5m1DNxBSGTvGB2TAVTGMnTxL/IzFhPQEcZIAHewW1eVBhN8W07A5tirRaAmmF6fGL1V20p3gQ=="],
|
||||
|
||||
"@lit-labs/react": ["@lit-labs/react@1.2.1", "", {}, "sha512-DiZdJYFU0tBbdQkfwwRSwYyI/mcWkg3sWesKRsHUd4G+NekTmmeq9fzsurvcKTNVa0comNljwtg4Hvi1ds3V+A=="],
|
||||
|
||||
"@lit-labs/ssr-dom-shim": ["@lit-labs/ssr-dom-shim@1.6.0", "", {}, "sha512-VHb0ALPMTlgKjM6yIxxoQNnpKyUKLD04VzeQdsiXkMqkvYlAHxq9glGLmgbb889/1GsohSOAjvQYoiBppXFqrQ=="],
|
||||
|
||||
"@lit/reactive-element": ["@lit/reactive-element@2.1.2", "", { "dependencies": { "@lit-labs/ssr-dom-shim": "^1.5.0" } }, "sha512-pbCDiVMnne1lYUIaYNN5wrwQXDtHaYtg7YEFPeW+hws6U47WeFvISGUWekPGKWOP1ygrs0ef0o1VJMk1exos5A=="],
|
||||
|
||||
"@lix-js/sdk": ["@lix-js/sdk@0.12.3", "", { "dependencies": { "fflate": "^0.8.3" }, "optionalDependencies": { "@lix-js/sdk-darwin-arm64": "0.12.3", "@lix-js/sdk-linux-arm64": "0.12.3", "@lix-js/sdk-linux-x64": "0.12.3", "@lix-js/sdk-win32-x64": "0.12.3" } }, "sha512-T2194yoZsM2S9kyRmI8UtEJL0fgXYAkeY9jZ/PVyC0K78/wmBvrqOSt9SdvgYxM5qnZ57re3NLOjVlV+X5hWxQ=="],
|
||||
|
||||
"@lix-js/sdk-darwin-arm64": ["@lix-js/sdk-darwin-arm64@0.12.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-YeMJyYGk+QwvQe8O4AAcBMgfNm68IjAGDvuvZHr1U1rIb3GC2kYFStajqf4mT4BGc+cN65/P/2kkqEo+Igu/sA=="],
|
||||
@@ -1074,6 +1141,8 @@
|
||||
|
||||
"@shumai/e2e": ["@shumai/e2e@workspace:packages/e2e"],
|
||||
|
||||
"@shumai/premiere-uxp": ["@shumai/premiere-uxp@workspace:apps/premiere-uxp"],
|
||||
|
||||
"@shumai/tableprinter": ["@shumai/tableprinter@workspace:packages/tableprinter"],
|
||||
|
||||
"@shumai/transcode": ["@shumai/transcode@workspace:packages/transcode"],
|
||||
@@ -1088,6 +1157,8 @@
|
||||
|
||||
"@sinclair/typebox": ["@sinclair/typebox@0.34.52", "", {}, "sha512-XiMQh7qqVlxZzcVD+kkGMNGMzcTrDMLWI7S4x7z1MkCkbDPrekpZXEUK0eZqZFMuHQg2a2DZOcDIh9o5v3Gonw=="],
|
||||
|
||||
"@sindresorhus/is": ["@sindresorhus/is@4.6.0", "", {}, "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="],
|
||||
|
||||
"@smithy/core": ["@smithy/core@3.33.3", "", { "dependencies": { "@smithy/types": "^4.17.2", "tslib": "^2.6.2" } }, "sha512-CsOeKq/9kA3y6VJHt+/+VTCtBaxJ4OTFpgrjIUhPpDIKxBci1k2bJaQASF2h/ELWrulGp+t97DZ0mevfAD8idg=="],
|
||||
|
||||
"@smithy/credential-provider-imds": ["@smithy/credential-provider-imds@4.5.2", "", { "dependencies": { "@smithy/core": "^3.33.2", "@smithy/types": "^4.17.2", "tslib": "^2.6.2" } }, "sha512-A9uSdn72ozbRUSit0eib0TW7nXuNPlaeM0zcGkJ+nE6tFcSDbnmtwoxbTCFBukVQcszDAyvsd7+rTduPTXpygg=="],
|
||||
@@ -1108,12 +1179,200 @@
|
||||
|
||||
"@smithy/util-utf8": ["@smithy/util-utf8@4.5.2", "", { "dependencies": { "@smithy/core": "^3.33.2", "tslib": "^2.6.2" } }, "sha512-7wNWV7SugHpcMA7uzEawJNpE0GrasXM7a9E+1+Wm6NxVuDClESac/AKt+G7jMZNUz5vBLWqKlqVV7Sv7AtUr6Q=="],
|
||||
|
||||
"@spectrum-web-components/action-button": ["@spectrum-web-components/action-button@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/button": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-cU/5sHpRSA823sHUH6jZccmizkTxWr/LJHTDJ4jj0LxCLh15OHfxKM+hu/vcc5fXYrAPma5Hp54xTBc/l/frDA=="],
|
||||
|
||||
"@spectrum-web-components/action-group": ["@spectrum-web-components/action-group@0.37.0", "", { "dependencies": { "@lit-labs/observers": "^2.0.0", "@spectrum-web-components/action-button": "^0.37.0", "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/reactive-controllers": "^0.37.0" } }, "sha512-unC1SMjhWI080lfHeAMxBL1y2Vyk6fIhKdukWzqQnzMpPdogh+tvKF9kUgPLZ3rq0hFFCquT0ZZezyywvjTWZA=="],
|
||||
|
||||
"@spectrum-web-components/action-menu": ["@spectrum-web-components/action-menu@0.37.0", "", { "dependencies": { "@spectrum-web-components/action-button": "^0.37.0", "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/picker": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-Xgta0n0bSRSBwh5ZZhwFC3YicwqcAYgvmSZQiZ6TEgccNMpwsgFj66e/r3K1dCEkVcsONfV3dbuIu3eqTCAXSA=="],
|
||||
|
||||
"@spectrum-web-components/asset": ["@spectrum-web-components/asset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-nFZ4/TCHbUcNUay5NI1fLhLejtx7QJ3H+diCNsZXOvmUI+0atcNPid6j5/4CyvSd8PQooEvCgHpbHf39AM57Cg=="],
|
||||
|
||||
"@spectrum-web-components/badge": ["@spectrum-web-components/badge@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-C2ZgSLcQ2crQ/fmgpfy6xAi2Vc+XsPr5bAdfAQG4yy/5S3etSwVzxdDCSY7JB8tWyA/mvQk5vSqUyEB9JmD+PQ=="],
|
||||
|
||||
"@spectrum-web-components/base": ["@spectrum-web-components/base@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-3JOI36CemlFzXKAuennOBZ2k99ayd6yooG8eX24z58r0nT6I+3q6jYbytBRJuj48Y7vxwxqMIKX4V118A1dmMQ=="],
|
||||
|
||||
"@spectrum-web-components/button": ["@spectrum-web-components/button@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/clear-button": "^0.37.0", "@spectrum-web-components/close-button": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-Cz69UtdNDqNVAMUjz2i1RjZ4LetR+bTnUvaDlj8heQHYR/ZHKdnMWaxS1DnZjlu7+osFo57XJPLyhlEEgYT1Ig=="],
|
||||
|
||||
"@spectrum-web-components/card": ["@spectrum-web-components/card@0.37.0", "", { "dependencies": { "@spectrum-web-components/asset": "^0.37.0", "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/checkbox": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/quick-actions": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0", "@spectrum-web-components/styles": "^0.37.0" } }, "sha512-NNwdXU4O7aI4gkLA2xOSHqYc/DDMoefp0YL2PFHjkxdEMW1G0cL4G7TTvow11yWmIyrtysra8sqTikNohW8Rmw=="],
|
||||
|
||||
"@spectrum-web-components/checkbox": ["@spectrum-web-components/checkbox@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-5DV4/aTZUkKyb6U3AHn/zxqbCeb+P1dWibp4Zjvr1FcRbMKdmY782pzRSOOXygLPkLJMKPCN4r6py32gBZY+eg=="],
|
||||
|
||||
"@spectrum-web-components/clear-button": ["@spectrum-web-components/clear-button@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-8NGvpHogC/pWGgKnVD1ZN0t+WWtuKrW6muNRI9fPJW0rGzVTTNzsTvL/QNrGusBES8/aiT08L35ayV3QfnAU7g=="],
|
||||
|
||||
"@spectrum-web-components/close-button": ["@spectrum-web-components/close-button@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-sqqDyi725V3/3oy2J+IbUTlcHpZKEY7m+wXifanQ5mDOjP/8zX17DDZgSX2X7HI4IFevBSVYZxCV2MUhG5Zp1w=="],
|
||||
|
||||
"@spectrum-web-components/divider": ["@spectrum-web-components/divider@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-f08h0pQ4srKw9R1fT+jKHUF3s1GfV2UPpcKrrfXFclXRRlu4AuQBO8Wo6nYUj/yYCz+hRWhlmtxL/BDKmREu9w=="],
|
||||
|
||||
"@spectrum-web-components/field-label": ["@spectrum-web-components/field-label@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/reactive-controllers": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-QTk0IwONj1P8jnsIwr3xyxkNs2fMHBs2nNoHMrmEiW1/6a5TIjIIntmeOj1BUcP2wRbUB5CD3mnh44OWSbmbHQ=="],
|
||||
|
||||
"@spectrum-web-components/help-text": ["@spectrum-web-components/help-text@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0" } }, "sha512-MsBD9I/mVOKRrnTqFxzbtmcLvgIGrA6y7kPwldKSQeFBHmm1oey2dnrlu7NK4OtWUdJJ3dQDKi/REJX35USOcw=="],
|
||||
|
||||
"@spectrum-web-components/icon": ["@spectrum-web-components/icon@1.12.2", "", { "dependencies": { "@spectrum-web-components/base": "1.12.2", "@spectrum-web-components/iconset": "1.12.2", "@spectrum-web-components/reactive-controllers": "1.12.2" } }, "sha512-mvnP1wcjdRVQCV73Le0rKJ22EhPi2jb5xAktRaPdYQebH0yjqVV1EvRNB5ZQPLqVzzDz9UzBm2RzOoGDupu+Jg=="],
|
||||
|
||||
"@spectrum-web-components/icons-ui": ["@spectrum-web-components/icons-ui@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DmaK+NDIgYhtYW19Y4lZoGYLfnFWPBjLNcLWGTQtc41yccEmgWrJbaf9n+nP4TADVJMT5dKNgE2vHnmDABtydg=="],
|
||||
|
||||
"@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@1.12.2", "", { "dependencies": { "@spectrum-web-components/base": "1.12.2", "@spectrum-web-components/icon": "1.12.2" } }, "sha512-r8r5YhaCwlw8D839HIbqZ+G3J1H49/ibbnp4golnfa96u9oY0OTkQIrdpPefrDxgk4eLXAjwovCMQk7hCWtuNw=="],
|
||||
|
||||
"@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@1.12.2", "", { "dependencies": { "@spectrum-web-components/base": "1.12.2" } }, "sha512-s6BsY6VnZQOcTx8LfLixdu16g0QXr54wC4PiY7wKcgqkS+VJzo3Up02y7nUUcga38tDb2XcYHZU3rqKVagz6zQ=="],
|
||||
|
||||
"@spectrum-web-components/illustrated-message": ["@spectrum-web-components/illustrated-message@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/styles": "^0.37.0" } }, "sha512-JUop4B2MgkQpYR6PrEifHOFNNKhVwqoBy1xS1HUKLidlOovagY1Wa769ajeXUBGoL1HLKif3O+CmWTBCwAaa5A=="],
|
||||
|
||||
"@spectrum-web-components/menu": ["@spectrum-web-components/menu@0.37.0", "", { "dependencies": { "@lit-labs/observers": "^2.0.0", "@spectrum-web-components/action-button": "^0.37.0", "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/divider": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/overlay": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-WG7lqePUERK/xE6/DlyfNzbW8gjSkQPEwGSxbe8AFOWTImzQALAz0rxmGTzHOkoThvsSGErt/mC7WiXkL5IWjQ=="],
|
||||
|
||||
"@spectrum-web-components/modal": ["@spectrum-web-components/modal@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-GXtRZdXFHZoP3UKu5oG7TQFEOShHhxGE5p7vvN7oFPm2Yz1WtpmjH2HdBFb2mI8BmEvKax/KEG5kZCrTDQpTvg=="],
|
||||
|
||||
"@spectrum-web-components/overlay": ["@spectrum-web-components/overlay@0.37.0", "", { "dependencies": { "@floating-ui/dom": "^1.5.1", "@floating-ui/utils": "^0.1.1", "@spectrum-web-components/action-button": "^0.37.0", "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/reactive-controllers": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0", "@spectrum-web-components/theme": "^0.37.0" } }, "sha512-kMEXAWdHJ/RGLbR4GHAEvgb03uaKNJSakVYgqoxQ15Z8PTq669FZQZMvYGr5VftRaXpejm5n1GK+KxuK6Cy+uw=="],
|
||||
|
||||
"@spectrum-web-components/picker": ["@spectrum-web-components/picker@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/button": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/menu": "^0.37.0", "@spectrum-web-components/overlay": "^0.37.0", "@spectrum-web-components/popover": "^0.37.0", "@spectrum-web-components/reactive-controllers": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0", "@spectrum-web-components/tray": "^0.37.0" } }, "sha512-9PEysOL7auFrlwFRkZWYb+OI2yTAZ+GM2mvEqkHfONU98g0aZO6oyjtg69RUNH9VUveqUfoEEBiZ0ihyuAL3cA=="],
|
||||
|
||||
"@spectrum-web-components/popover": ["@spectrum-web-components/popover@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/overlay": "^0.37.0" } }, "sha512-UilQj4W2HgDMopON2RG7wEYxnGViAWBJYFaTuO7dCLgEHuQMbIN6h30JvSwfz5Z0Vr/eJgSd3I7xj0K9Bl2c6Q=="],
|
||||
|
||||
"@spectrum-web-components/progress-circle": ["@spectrum-web-components/progress-circle@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-OjabwypclIBqjUwwiWDztjy4QRV1guIojhmdv3HaCEbueX0zhv9y9XqYZn3dxKnDubSkNfT4FrYHJXaMsKrovQ=="],
|
||||
|
||||
"@spectrum-web-components/quick-actions": ["@spectrum-web-components/quick-actions@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-h9KRwowJ4AQh6UpDcC+iuijm1wPxf/ZhmQgwH4CeYXXl2HU9NuW67QwVkVz7axjNdY5dDh6I2bdwFD/IcZW/ug=="],
|
||||
|
||||
"@spectrum-web-components/reactive-controllers": ["@spectrum-web-components/reactive-controllers@1.12.2", "", { "dependencies": { "@spectrum-web-components/progress-circle": "1.12.2", "colorjs.io": "0.5.2", "lit": "^2.5.0 || ^3.1.3" } }, "sha512-TD94tuA5XDK8ISUM4pWHxJF9oe/IvSHYoR/4P6aYsAj8oPZgrGerNh1a+vzQZ0PorRpVMV4Rg/UHCbtTwxOgOQ=="],
|
||||
|
||||
"@spectrum-web-components/search": ["@spectrum-web-components/search@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/button": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/textfield": "^0.37.0" } }, "sha512-9ithHfHhMTC4SpVC04XRDP8SEJwI2aEJRbbpjODNJcpUruclweutsektMvh4Jm3Qk3+95C5QE8fZHBIfQ5Quhw=="],
|
||||
|
||||
"@spectrum-web-components/shared": ["@spectrum-web-components/shared@0.37.0", "", { "dependencies": { "@lit-labs/observers": "^2.0.0", "@spectrum-web-components/base": "^0.37.0", "focus-visible": "^5.1.0" } }, "sha512-i2yJ1tpQxUffP0xcx9QfusxKlRS3eOBZXjCnxhiicHIIlQtK+mPENbUTe2mRmVLT3WPwIt6mNzoO8w/p5h0Pxw=="],
|
||||
|
||||
"@spectrum-web-components/status-light": ["@spectrum-web-components/status-light@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-oFzV1mB2c148Es6udezsR11xEAgEhOlS+DsMSMxhcn7XPXOSRBKtLMUYJ0Q+F5Fb+lcUfCgNy3sDEDqqbYPtrg=="],
|
||||
|
||||
"@spectrum-web-components/styles": ["@spectrum-web-components/styles@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-OGG7KSoKG7Ut/idWHUicNBQdk6Wsi/ZZASj5+UgjMGv8qivZ2XOgqms+Zg4mamnYH2aE80CG/GMxKZ3VB/iAPg=="],
|
||||
|
||||
"@spectrum-web-components/textfield": ["@spectrum-web-components/textfield@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/help-text": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-pDhBXQth3w3OaxXGe9tMzEHvHFoJjmf2SQzOnrPPldRYx+JOEX6/fhBGel4EVXjl81oIpR9BRGAQEOFvtIWmLg=="],
|
||||
|
||||
"@spectrum-web-components/theme": ["@spectrum-web-components/theme@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/styles": "^0.37.0" } }, "sha512-xfKnzwWmjD6zN1T7Jo+3yLRdjh7qx8CX2FCL/PrUu8sE2Jo4cO3/vKYLAt27bbeHF5+zxKx2hOZdPOgEpZG9Hg=="],
|
||||
|
||||
"@spectrum-web-components/tray": ["@spectrum-web-components/tray@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/modal": "^0.37.0", "@spectrum-web-components/reactive-controllers": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0", "@spectrum-web-components/underlay": "^0.37.0" } }, "sha512-vYjGeIYaVWQ0+6hZMQy25qqB+AjQZllEkpO/ua9nGXSvo/wbb43H6duSwVhmT2hkyqLy0sBw7Yt2LFgPYiSySQ=="],
|
||||
|
||||
"@spectrum-web-components/underlay": ["@spectrum-web-components/underlay@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-H3a3HmxrqGY6+N9nQwiapxXVLEIJoQ87naoXKy7ZnEmRyUnPcLjBaoXvLZKKXEDosaYxE3Mm6dnfjyKpk5PM1Q=="],
|
||||
|
||||
"@sqlite.org/sqlite-wasm": ["@sqlite.org/sqlite-wasm@3.48.0-build4", "", { "bin": { "sqlite-wasm": "bin/index.js" } }, "sha512-hI6twvUkzOmyGZhQMza1gpfqErZxXRw6JEsiVjUbo7tFanVD+8Oil0Ih3l2nGzHdxPI41zFmfUQG7GHqhciKZQ=="],
|
||||
|
||||
"@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],
|
||||
|
||||
"@standard-schema/utils": ["@standard-schema/utils@0.3.0", "", {}, "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g=="],
|
||||
|
||||
"@swc-react/action-button": ["@swc-react/action-button@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/action-button": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-S9NsUcklTFLMz3KCEd3q6rhYEOMu5fTk2TSi3MAQRFAHuCs0whb7ml9bVnyqCyBIGo+r3m20ynRzW/NymV1Ixw=="],
|
||||
|
||||
"@swc-react/action-group": ["@swc-react/action-group@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/action-group": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-+V0KVx0JPBrOd24tGddslLBF7b+0IfReULuxcgZnjDCzfzMseVIphetXSEx9u4MT8ymUBsbrbG8wWHYloxpiQQ=="],
|
||||
|
||||
"@swc-react/action-menu": ["@swc-react/action-menu@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/action-menu": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-tw32XTQaLBpG7BE0i56Te1Hxcl38DX93BLiuRIN2B36s1Vrn9n0cPcY4nyBVlNu/Z+uhGu44qamZLf2qiZsRcA=="],
|
||||
|
||||
"@swc-react/badge": ["@swc-react/badge@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/badge": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-kziT/wzswh6eXRAnCxwXa0zTnp8LrmI6A5khrkCVybzGGsR6VAmqBZkjtGmhCjyLazj2LiG+x7xix0UCpbrToA=="],
|
||||
|
||||
"@swc-react/button": ["@swc-react/button@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/button": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-8okizgzPhdRGbooPztgqnSHqmVQ64sMb/jWZp1n731hKjx0fKcHzRtn9S1qNg7RaDRPCsEvfLB1k4dBShllaRA=="],
|
||||
|
||||
"@swc-react/card": ["@swc-react/card@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/card": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-/DDENblDw9fXULduV9nuYssZVotzM5rV4CwkpieBpukVfySfBCpIC60Zj0ihBsg0mmFQtsd9DINop3nO5SpUpg=="],
|
||||
|
||||
"@swc-react/divider": ["@swc-react/divider@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/divider": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-wDTbhe1Qj6ZvBvdWE//wpg/jtVnG3UTG8baBmhZPgVIWSn0KxMeoh9j2XAneEkfhdu6KqZXhp9Wy/cfYw8e+nQ=="],
|
||||
|
||||
"@swc-react/field-label": ["@swc-react/field-label@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/field-label": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-dCwtWlEhXCoh+KFomHDnoAVVsKLUBD4XObeJiSvlg2x3iRcWRDEylsmZjUDqJaTXsbxw0/kRWvtM+TlW1y5Rgw=="],
|
||||
|
||||
"@swc-react/help-text": ["@swc-react/help-text@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/help-text": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-AtiUqtARgHIcqeivy3+ud0912LBZac06u5ww8dV8qdnx+C+eDgI0W2hDBoVxTsUxbhiPy2Emkjrv5ZrypGon4g=="],
|
||||
|
||||
"@swc-react/illustrated-message": ["@swc-react/illustrated-message@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/illustrated-message": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-XMF8hnG9YUj7uBoJJX6z1lLjpC4wkNvvjh2y7toqHvZBPiheWJoNqV1tYvbchZJb2xTmXadWUus59o4lHH5ZzA=="],
|
||||
|
||||
"@swc-react/menu": ["@swc-react/menu@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/menu": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-oGiVmTUAVRVgwiU81GrUTX+LSwtigZy5JaqPb/I48bzmay6iWd2PkkWs6HiWxpu8oK5tRkauegPYJFW12ZzcbQ=="],
|
||||
|
||||
"@swc-react/progress-circle": ["@swc-react/progress-circle@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/progress-circle": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-j1S08ncB1IQ7Piq5UnHCvDF/bC320vTDSFH17i83IyosHYmxiXmOzrjB6SxbPI5SVpAunAjWBFwLkEusGli85w=="],
|
||||
|
||||
"@swc-react/search": ["@swc-react/search@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/search": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-ZxwEj622rtbvyxPHRCL7Y9QKS8sXyt2GcB+11Cb7fxIpAd7bz2vHOwZqFSVE1w4cQrcjKjAKdSqv9lKc9cYgJw=="],
|
||||
|
||||
"@swc-react/status-light": ["@swc-react/status-light@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/status-light": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-HrKaxoxNQ7mwquIwSg9FCzJ1NQHk1lpJ8nYg4mODxXx7fvPbbcLjDA1CFE9k3/GDqD1+yrUEEXMaBX+V+aS/OQ=="],
|
||||
|
||||
"@swc-react/textfield": ["@swc-react/textfield@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/textfield": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-jhm1Z9tIOuNDwg4Eqfhxcmcv2I+84hNhVuh7Re8tOYu4hF0ICkifQl0luXXPLAO6mqc7ldkfEtM/yTl9sqJryA=="],
|
||||
|
||||
"@swc-react/theme": ["@swc-react/theme@0.37.0", "", { "dependencies": { "@lit-labs/react": "^1.1.1", "@spectrum-web-components/theme": "^0.37.0" }, "peerDependencies": { "next": "~13.4" }, "optionalPeers": ["next"] }, "sha512-TA9MpFOWUFd1sY0B6ZX9IDc3gGTsLyLykDBr772vSyuajLjIhG1ZXd9ccOlP1NDK0TF9ySc3MxK0MA4gRmS51g=="],
|
||||
|
||||
"@swc-uxp-internal/action-button": ["@spectrum-web-components/action-button@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/button": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-cU/5sHpRSA823sHUH6jZccmizkTxWr/LJHTDJ4jj0LxCLh15OHfxKM+hu/vcc5fXYrAPma5Hp54xTBc/l/frDA=="],
|
||||
|
||||
"@swc-uxp-internal/action-group": ["@spectrum-web-components/action-group@0.37.0", "", { "dependencies": { "@lit-labs/observers": "^2.0.0", "@spectrum-web-components/action-button": "^0.37.0", "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/reactive-controllers": "^0.37.0" } }, "sha512-unC1SMjhWI080lfHeAMxBL1y2Vyk6fIhKdukWzqQnzMpPdogh+tvKF9kUgPLZ3rq0hFFCquT0ZZezyywvjTWZA=="],
|
||||
|
||||
"@swc-uxp-internal/asset": ["@spectrum-web-components/asset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-nFZ4/TCHbUcNUay5NI1fLhLejtx7QJ3H+diCNsZXOvmUI+0atcNPid6j5/4CyvSd8PQooEvCgHpbHf39AM57Cg=="],
|
||||
|
||||
"@swc-uxp-internal/base": ["@spectrum-web-components/base@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-3JOI36CemlFzXKAuennOBZ2k99ayd6yooG8eX24z58r0nT6I+3q6jYbytBRJuj48Y7vxwxqMIKX4V118A1dmMQ=="],
|
||||
|
||||
"@swc-uxp-internal/button": ["@spectrum-web-components/button@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/clear-button": "^0.37.0", "@spectrum-web-components/close-button": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-Cz69UtdNDqNVAMUjz2i1RjZ4LetR+bTnUvaDlj8heQHYR/ZHKdnMWaxS1DnZjlu7+osFo57XJPLyhlEEgYT1Ig=="],
|
||||
|
||||
"@swc-uxp-internal/card": ["@spectrum-web-components/card@0.37.0", "", { "dependencies": { "@spectrum-web-components/asset": "^0.37.0", "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/checkbox": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/quick-actions": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0", "@spectrum-web-components/styles": "^0.37.0" } }, "sha512-NNwdXU4O7aI4gkLA2xOSHqYc/DDMoefp0YL2PFHjkxdEMW1G0cL4G7TTvow11yWmIyrtysra8sqTikNohW8Rmw=="],
|
||||
|
||||
"@swc-uxp-internal/checkbox": ["@spectrum-web-components/checkbox@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-5DV4/aTZUkKyb6U3AHn/zxqbCeb+P1dWibp4Zjvr1FcRbMKdmY782pzRSOOXygLPkLJMKPCN4r6py32gBZY+eg=="],
|
||||
|
||||
"@swc-uxp-internal/divider": ["@spectrum-web-components/divider@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-f08h0pQ4srKw9R1fT+jKHUF3s1GfV2UPpcKrrfXFclXRRlu4AuQBO8Wo6nYUj/yYCz+hRWhlmtxL/BDKmREu9w=="],
|
||||
|
||||
"@swc-uxp-internal/field-label": ["@spectrum-web-components/field-label@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/reactive-controllers": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-QTk0IwONj1P8jnsIwr3xyxkNs2fMHBs2nNoHMrmEiW1/6a5TIjIIntmeOj1BUcP2wRbUB5CD3mnh44OWSbmbHQ=="],
|
||||
|
||||
"@swc-uxp-internal/help-text": ["@spectrum-web-components/help-text@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0" } }, "sha512-MsBD9I/mVOKRrnTqFxzbtmcLvgIGrA6y7kPwldKSQeFBHmm1oey2dnrlu7NK4OtWUdJJ3dQDKi/REJX35USOcw=="],
|
||||
|
||||
"@swc-uxp-internal/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/icons": ["@spectrum-web-components/icons@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-OH8+I2vpE+73XQKWBUBPbR36m/RYRDkuotK7DvhgJd4TjM3q2jBq4zQCxEe4vFC/eeADdgWy2CmAiK/5wrXASw=="],
|
||||
|
||||
"@swc-uxp-internal/icons-ui": ["@spectrum-web-components/icons-ui@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DmaK+NDIgYhtYW19Y4lZoGYLfnFWPBjLNcLWGTQtc41yccEmgWrJbaf9n+nP4TADVJMT5dKNgE2vHnmDABtydg=="],
|
||||
|
||||
"@swc-uxp-internal/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@swc-uxp-internal/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/illustrated-message": ["@spectrum-web-components/illustrated-message@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/styles": "^0.37.0" } }, "sha512-JUop4B2MgkQpYR6PrEifHOFNNKhVwqoBy1xS1HUKLidlOovagY1Wa769ajeXUBGoL1HLKif3O+CmWTBCwAaa5A=="],
|
||||
|
||||
"@swc-uxp-internal/menu": ["@spectrum-web-components/menu@0.37.0", "", { "dependencies": { "@lit-labs/observers": "^2.0.0", "@spectrum-web-components/action-button": "^0.37.0", "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/divider": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/overlay": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-WG7lqePUERK/xE6/DlyfNzbW8gjSkQPEwGSxbe8AFOWTImzQALAz0rxmGTzHOkoThvsSGErt/mC7WiXkL5IWjQ=="],
|
||||
|
||||
"@swc-uxp-internal/overlay": ["@spectrum-web-components/overlay@0.37.0", "", { "dependencies": { "@floating-ui/dom": "^1.5.1", "@floating-ui/utils": "^0.1.1", "@spectrum-web-components/action-button": "^0.37.0", "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/reactive-controllers": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0", "@spectrum-web-components/theme": "^0.37.0" } }, "sha512-kMEXAWdHJ/RGLbR4GHAEvgb03uaKNJSakVYgqoxQ15Z8PTq669FZQZMvYGr5VftRaXpejm5n1GK+KxuK6Cy+uw=="],
|
||||
|
||||
"@swc-uxp-internal/popover": ["@spectrum-web-components/popover@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/overlay": "^0.37.0" } }, "sha512-UilQj4W2HgDMopON2RG7wEYxnGViAWBJYFaTuO7dCLgEHuQMbIN6h30JvSwfz5Z0Vr/eJgSd3I7xj0K9Bl2c6Q=="],
|
||||
|
||||
"@swc-uxp-internal/quick-actions": ["@spectrum-web-components/quick-actions@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-h9KRwowJ4AQh6UpDcC+iuijm1wPxf/ZhmQgwH4CeYXXl2HU9NuW67QwVkVz7axjNdY5dDh6I2bdwFD/IcZW/ug=="],
|
||||
|
||||
"@swc-uxp-internal/reactive-controllers": ["@spectrum-web-components/reactive-controllers@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-1wnWLt88iyTPrElxZqPpyWWzScSkXY3zxi+QxIV0cFGmhRlPsH+XXqs/kGkfzRyNtE4s2AWuRZ2wtbcao6MzJQ=="],
|
||||
|
||||
"@swc-uxp-internal/search": ["@spectrum-web-components/search@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/button": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/textfield": "^0.37.0" } }, "sha512-9ithHfHhMTC4SpVC04XRDP8SEJwI2aEJRbbpjODNJcpUruclweutsektMvh4Jm3Qk3+95C5QE8fZHBIfQ5Quhw=="],
|
||||
|
||||
"@swc-uxp-internal/shared": ["@spectrum-web-components/shared@0.37.0", "", { "dependencies": { "@lit-labs/observers": "^2.0.0", "@spectrum-web-components/base": "^0.37.0", "focus-visible": "^5.1.0" } }, "sha512-i2yJ1tpQxUffP0xcx9QfusxKlRS3eOBZXjCnxhiicHIIlQtK+mPENbUTe2mRmVLT3WPwIt6mNzoO8w/p5h0Pxw=="],
|
||||
|
||||
"@swc-uxp-internal/styles": ["@spectrum-web-components/styles@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-OGG7KSoKG7Ut/idWHUicNBQdk6Wsi/ZZASj5+UgjMGv8qivZ2XOgqms+Zg4mamnYH2aE80CG/GMxKZ3VB/iAPg=="],
|
||||
|
||||
"@swc-uxp-internal/textfield": ["@spectrum-web-components/textfield@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/help-text": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0", "@spectrum-web-components/icons-ui": "^0.37.0", "@spectrum-web-components/icons-workflow": "^0.37.0", "@spectrum-web-components/shared": "^0.37.0" } }, "sha512-pDhBXQth3w3OaxXGe9tMzEHvHFoJjmf2SQzOnrPPldRYx+JOEX6/fhBGel4EVXjl81oIpR9BRGAQEOFvtIWmLg=="],
|
||||
|
||||
"@swc-uxp-internal/theme": ["@spectrum-web-components/theme@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/styles": "^0.37.0" } }, "sha512-xfKnzwWmjD6zN1T7Jo+3yLRdjh7qx8CX2FCL/PrUu8sE2Jo4cO3/vKYLAt27bbeHF5+zxKx2hOZdPOgEpZG9Hg=="],
|
||||
|
||||
"@swc-uxp-wrappers/action-button": ["@swc-uxp-wrappers/action-button@2.0.0", "", { "dependencies": { "@swc-uxp-internal/action-button": "npm:@spectrum-web-components/action-button@0.37.0", "@swc-uxp-wrappers/button": "2.0.0" } }, "sha512-MsGVtZRxY9jR8oO6X60FEVcrjLSp05YS/rFfqawr4tGKwyqRaOQ4x9THBLcVpRti6c4MuzpDs5CQ3Duz0NqqDw=="],
|
||||
|
||||
"@swc-uxp-wrappers/action-group": ["@swc-uxp-wrappers/action-group@2.0.0", "", { "dependencies": { "@swc-uxp-internal/action-group": "npm:@spectrum-web-components/action-group@0.37.0", "@swc-uxp-wrappers/action-button": "2.0.0" } }, "sha512-bDN9IlzwaT4Fz8vCHg53/wI1N4C4fM9WtsK8QvpY+V2nwBYF3NdYPLfNBo2g6KjoSOkRR+kDmlDRafj9fU31eA=="],
|
||||
|
||||
"@swc-uxp-wrappers/asset": ["@swc-uxp-wrappers/asset@2.0.0", "", { "dependencies": { "@swc-uxp-internal/asset": "npm:@spectrum-web-components/asset@0.37.0" } }, "sha512-NOrlHLLbZyNtjEYYri8GAHON9vPBXTnJ1QLLgdfJ7p++IixZBuHQ6IC/9lO4oDtwNHrwkPziUSvkZQ/8BbSyPQ=="],
|
||||
|
||||
"@swc-uxp-wrappers/button": ["@swc-uxp-wrappers/button@2.0.0", "", { "dependencies": { "@swc-uxp-internal/button": "npm:@spectrum-web-components/button@0.37.0" } }, "sha512-gu0SktpuDntmWAyGJ3isNyNHAm2nyKiLWmkPXIZRygSHqpE36wNkeYar6Fdh+wFZcmqYYEL7lIZjqdCZuYcA0w=="],
|
||||
|
||||
"@swc-uxp-wrappers/card": ["@swc-uxp-wrappers/card@2.0.0", "", { "dependencies": { "@swc-uxp-internal/card": "npm:@spectrum-web-components/card@0.37.0", "@swc-uxp-wrappers/asset": "2.0.0", "@swc-uxp-wrappers/checkbox": "2.0.0", "@swc-uxp-wrappers/quick-actions": "2.0.0" } }, "sha512-uOz72BKsjv2tAueejZIEKSHvJibI6pGSA6hy9SjknbcWd+teIHkqqJLlCmM1OBsYG5msm/nMxS0bm5ZcOKNJjw=="],
|
||||
|
||||
"@swc-uxp-wrappers/checkbox": ["@swc-uxp-wrappers/checkbox@2.0.0", "", { "dependencies": { "@swc-uxp-internal/checkbox": "npm:@spectrum-web-components/checkbox@0.37.0" } }, "sha512-Rgns87G9dh5LWGr3v9hx2eML8CK0WGpt5c+6KArRiMLAQ64GcbN8y7s4/pOLvrx3kivX6XcZczqpns3zFl3lDw=="],
|
||||
|
||||
"@swc-uxp-wrappers/divider": ["@swc-uxp-wrappers/divider@2.0.0", "", { "dependencies": { "@swc-uxp-internal/divider": "npm:@spectrum-web-components/divider@0.37.0" } }, "sha512-HqJ7hmMgF9bfeG/N03tze1N4NQaRzlmIyN637wepB6gxOilLcDtdSIeJ7El5UDzNNEbTp2eFjUW9FuiSiYrwqg=="],
|
||||
|
||||
"@swc-uxp-wrappers/field-label": ["@swc-uxp-wrappers/field-label@2.0.0", "", { "dependencies": { "@swc-uxp-internal/field-label": "npm:@spectrum-web-components/field-label@0.37.0" } }, "sha512-tzOBQafXfxGORNQPQFajOlFolIblgApoiMzm81T8ye/U1NTzOVHozHL3RVXhepESMKu2oAgVUY/8ZQK6h71KRQ=="],
|
||||
|
||||
"@swc-uxp-wrappers/help-text": ["@swc-uxp-wrappers/help-text@2.0.0", "", { "dependencies": { "@swc-uxp-internal/help-text": "npm:@spectrum-web-components/help-text@0.37.0" } }, "sha512-caiMb+PbhDC1999Uw5ugYr77PQ7pih/30DNaMry5/7UCeWuiphGGfJEXtwsfr5evdI8pRNILHbrqgiQLqhLuTg=="],
|
||||
|
||||
"@swc-uxp-wrappers/illustrated-message": ["@swc-uxp-wrappers/illustrated-message@2.0.0", "", { "dependencies": { "@swc-uxp-internal/illustrated-message": "npm:@spectrum-web-components/illustrated-message@0.37.0" } }, "sha512-uBZSU0VLGRfpBnCTOCxU/XIZLli6Dvwedu56ZuJc6nl+CqXI1zyEjkqxNmGefYZIHUmlJ/Q/Ko5NTTm+07hvAw=="],
|
||||
|
||||
"@swc-uxp-wrappers/menu": ["@swc-uxp-wrappers/menu@2.0.0", "", { "dependencies": { "@swc-uxp-internal/menu": "npm:@spectrum-web-components/menu@0.37.0", "@swc-uxp-wrappers/action-button": "2.0.0", "@swc-uxp-wrappers/divider": "2.0.0" } }, "sha512-dPjS2OKJ7bWSfLzGeiCo6XN3SSSwA+lUC1BWOjn6g72BTtOUg/S6n9JpSEa2mtwxGn8AN3bpc452EgTBTPbF1w=="],
|
||||
|
||||
"@swc-uxp-wrappers/overlay": ["@swc-uxp-wrappers/overlay@2.0.0", "", { "dependencies": { "@swc-uxp-internal/overlay": "npm:@spectrum-web-components/overlay@0.37.0", "@swc-uxp-wrappers/action-button": "2.0.0" } }, "sha512-z62AFiL9thiwN1lM1Zwal9YXY4b30tLoaPGg2sGPRCZL7lrRTEDdQzMRC2J7dudqP/BzirDSlzBtqEns9sw60Q=="],
|
||||
|
||||
"@swc-uxp-wrappers/popover": ["@swc-uxp-wrappers/popover@2.0.0", "", { "dependencies": { "@swc-uxp-internal/popover": "npm:@spectrum-web-components/popover@0.37.0" } }, "sha512-KZCVCo9qs3IH582ou28t/8GROYxBYl+og0OOC5nCFIBcL9DakkQHZBLviU68R29+1PzcS1EnZ6ZMAU2UrOiixw=="],
|
||||
|
||||
"@swc-uxp-wrappers/quick-actions": ["@swc-uxp-wrappers/quick-actions@2.0.0", "", { "dependencies": { "@swc-uxp-internal/quick-actions": "npm:@spectrum-web-components/quick-actions@0.37.0" } }, "sha512-9tW/T15dJTibR5BQIUGw5i3LhIZWfU91UNBcP/Siuyv3KM6wxYAlAHcnJA+70LNeP0NE+OQuTbo9XJiGT25GjQ=="],
|
||||
|
||||
"@swc-uxp-wrappers/search": ["@swc-uxp-wrappers/search@2.0.0", "", { "dependencies": { "@swc-uxp-internal/search": "npm:@spectrum-web-components/search@0.37.0", "@swc-uxp-wrappers/button": "2.0.0", "@swc-uxp-wrappers/textfield": "2.0.0" } }, "sha512-+59SCaLEJNWci/ETnvFbdlu+GSa5SSivLOIZFNGnbXsXRZ/DN8ldNOAugH1AA/3u7qoYlqAxXWKQYc++DJv6aA=="],
|
||||
|
||||
"@swc-uxp-wrappers/textfield": ["@swc-uxp-wrappers/textfield@2.0.0", "", { "dependencies": { "@swc-uxp-internal/textfield": "npm:@spectrum-web-components/textfield@0.37.0", "@swc-uxp-wrappers/help-text": "2.0.0" } }, "sha512-gKs8rxl4y9ajV/mAiibPI1pXRcagiQSBZ1mrk0or3WU7EiFzcP//kSclL2EihtVxLLsxhLFgxwZYjfkavdSCRA=="],
|
||||
|
||||
"@swc-uxp-wrappers/utils": ["@swc-uxp-wrappers/utils@2.0.1", "", { "dependencies": { "@swc-uxp-internal/base": "npm:@spectrum-web-components/base@0.37.0", "@swc-uxp-internal/icon": "npm:@spectrum-web-components/icon@0.37.0", "@swc-uxp-internal/icons": "npm:@spectrum-web-components/icons@0.37.0", "@swc-uxp-internal/icons-ui": "npm:@spectrum-web-components/icons-ui@0.37.0", "@swc-uxp-internal/icons-workflow": "npm:@spectrum-web-components/icons-workflow@0.37.0", "@swc-uxp-internal/iconset": "npm:@spectrum-web-components/iconset@0.37.0", "@swc-uxp-internal/reactive-controllers": "npm:@spectrum-web-components/reactive-controllers@0.37.0", "@swc-uxp-internal/shared": "npm:@spectrum-web-components/shared@0.37.0", "@swc-uxp-internal/styles": "npm:@spectrum-web-components/styles@0.37.0", "@swc-uxp-internal/theme": "npm:@spectrum-web-components/theme@0.37.0" } }, "sha512-8vbd6fOok2/f8Tp0KPlBPUJYlMhnMGmEhiiySf/dhsOR85kiFMKf3VwILWkd0No2+fViARviDCVZbk+5F8EtNA=="],
|
||||
|
||||
"@swc/core": ["@swc/core@1.16.1", "", { "dependencies": { "@swc/counter": "^0.1.3", "@swc/types": "^0.1.28" }, "optionalDependencies": { "@swc/core-darwin-arm64": "1.16.1", "@swc/core-darwin-x64": "1.16.1", "@swc/core-linux-arm-gnueabihf": "1.16.1", "@swc/core-linux-arm64-gnu": "1.16.1", "@swc/core-linux-arm64-musl": "1.16.1", "@swc/core-linux-ppc64-gnu": "1.16.1", "@swc/core-linux-s390x-gnu": "1.16.1", "@swc/core-linux-x64-gnu": "1.16.1", "@swc/core-linux-x64-musl": "1.16.1", "@swc/core-win32-arm64-msvc": "1.16.1", "@swc/core-win32-ia32-msvc": "1.16.1", "@swc/core-win32-x64-msvc": "1.16.1" }, "peerDependencies": { "@swc/helpers": ">=0.5.17" }, "optionalPeers": ["@swc/helpers"] }, "sha512-nUaeu91O5QZKrQdaDCHd402ogUIoNOOjpkZNq0UomWK0G6gDaGmLhvddF1/3BXf5O8aLyo6ZPY/aMDWvaJQ/hg=="],
|
||||
|
||||
"@swc/core-darwin-arm64": ["@swc/core-darwin-arm64@1.16.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-zlJblJ8ncErD43lKdxjbUaUskJQf+LxiPXYcWXD8/8ZMV+7uuAT+CwjciLXpyZBd5Pq/S726bMpeeAwSeL1hhg=="],
|
||||
@@ -1310,7 +1569,7 @@
|
||||
|
||||
"@types/react": ["@types/react@19.2.18", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w=="],
|
||||
|
||||
"@types/react-dom": ["@types/react-dom@19.2.5", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-fMPwH9v7r/pp43yUd2/Mbiex5KouJwwR3dzHkhLREUC6764VyDsqxhAxv6OFEYR1RhjOyD1naqba8ECDBe7ZQg=="],
|
||||
"@types/react-dom": ["@types/react-dom@19.2.7", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-I8bPpDLcHBv1qiIiXDCy71Rt8eQDKJP0sMSWJphDdAcdqiJ1sGpZamavoEIRZmYzjia9LuEb2HlYdDpmoENpvQ=="],
|
||||
|
||||
"@types/react-reconciler": ["@types/react-reconciler@0.33.0", "", { "peerDependencies": { "@types/react": "*" } }, "sha512-HZOXsKT0tGI9LlUw2LuedXsVeB88wFa536vVL0M6vE8zN63nI+sSr1ByxmPToP5K5bukaVscyeCJcF9guVNJ1g=="],
|
||||
|
||||
@@ -1586,6 +1845,8 @@
|
||||
|
||||
"chai": ["chai@6.2.2", "", {}, "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg=="],
|
||||
|
||||
"char-regex": ["char-regex@1.0.2", "", {}, "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw=="],
|
||||
|
||||
"character-entities": ["character-entities@2.0.2", "", {}, "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ=="],
|
||||
|
||||
"character-entities-html4": ["character-entities-html4@2.1.0", "", {}, "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA=="],
|
||||
@@ -1618,6 +1879,8 @@
|
||||
|
||||
"colorette": ["colorette@2.0.20", "", {}, "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="],
|
||||
|
||||
"colorjs.io": ["colorjs.io@0.5.2", "", {}, "sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw=="],
|
||||
|
||||
"comma-separated-tokens": ["comma-separated-tokens@2.0.3", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="],
|
||||
|
||||
"commander": ["commander@11.1.0", "", {}, "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ=="],
|
||||
@@ -1758,6 +2021,8 @@
|
||||
|
||||
"emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
||||
|
||||
"emojilib": ["emojilib@2.4.0", "", {}, "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw=="],
|
||||
|
||||
"empathic": ["empathic@2.0.0", "", {}, "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA=="],
|
||||
|
||||
"end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],
|
||||
@@ -1882,6 +2147,8 @@
|
||||
|
||||
"flatted": ["flatted@3.4.4", "", {}, "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q=="],
|
||||
|
||||
"focus-visible": ["focus-visible@5.2.1", "", {}, "sha512-8Bx950VD1bWTQJEH/AM6SpEk+SU55aVnp4Ujhuuxy3eMEBCRwBnTBnVXr9YAPvZL3/CNjCa8u4IWfNmEO53whA=="],
|
||||
|
||||
"fontkit": ["fontkit@2.0.4", "", { "dependencies": { "@swc/helpers": "^0.5.12", "brotli": "^1.3.2", "clone": "^2.1.2", "dfa": "^1.2.0", "fast-deep-equal": "^3.1.3", "restructure": "^3.0.0", "tiny-inflate": "^1.0.3", "unicode-properties": "^1.4.0", "unicode-trie": "^2.0.0" } }, "sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g=="],
|
||||
|
||||
"for-each": ["for-each@0.3.5", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="],
|
||||
@@ -2106,6 +2373,8 @@
|
||||
|
||||
"jose": ["jose@6.2.10", "", {}, "sha512-iiW7J9qRFlGxvCOIBDBDxFePQSn7ZMAnrYGhrrOo6siO/MIqwfyilLR27pkfDgUk+raLuzADS8A3S/KLBisc0g=="],
|
||||
|
||||
"jotai": ["jotai@2.20.3", "", { "peerDependencies": { "@babel/core": ">=7.0.0", "@babel/template": ">=7.0.0", "@types/react": ">=17.0.0", "react": ">=17.0.0" }, "optionalPeers": ["@babel/core", "@babel/template", "@types/react", "react"] }, "sha512-N8L9FUbeGDP+0qNJw1FebOxt+5hk+jTOwUA2LlRE4C081jUcY6F1T/FSETp4DT2/INMtiSRZyNm2D+yZdzrSgA=="],
|
||||
|
||||
"joycon": ["joycon@3.1.1", "", {}, "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw=="],
|
||||
|
||||
"js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
|
||||
@@ -2172,6 +2441,12 @@
|
||||
|
||||
"linebreak": ["linebreak@1.1.0", "", { "dependencies": { "base64-js": "0.0.8", "unicode-trie": "^2.0.0" } }, "sha512-MHp03UImeVhB7XZtjd0E4n6+3xr5Dq/9xI/5FptGk5FrbDR3zagPa2DS6U8ks/3HjbKWG9Q1M2ufOzxV2qLYSQ=="],
|
||||
|
||||
"lit": ["lit@2.8.0", "", { "dependencies": { "@lit/reactive-element": "^1.6.0", "lit-element": "^3.3.0", "lit-html": "^2.8.0" } }, "sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA=="],
|
||||
|
||||
"lit-element": ["lit-element@3.3.3", "", { "dependencies": { "@lit-labs/ssr-dom-shim": "^1.1.0", "@lit/reactive-element": "^1.3.0", "lit-html": "^2.8.0" } }, "sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA=="],
|
||||
|
||||
"lit-html": ["lit-html@2.8.0", "", { "dependencies": { "@types/trusted-types": "^2.0.2" } }, "sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q=="],
|
||||
|
||||
"locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="],
|
||||
|
||||
"lodash": ["lodash@4.18.1", "", {}, "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q=="],
|
||||
@@ -2306,6 +2581,8 @@
|
||||
|
||||
"node-domexception": ["node-domexception@1.0.0", "", {}, "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="],
|
||||
|
||||
"node-emoji": ["node-emoji@2.2.0", "", { "dependencies": { "@sindresorhus/is": "^4.6.0", "char-regex": "^1.0.2", "emojilib": "^2.4.0", "skin-tone": "^2.0.0" } }, "sha512-Z3lTE9pLaJF47NyMhd4ww1yFTAP8YhYI8SleJiHzM46Fgpm5cnNzSl9XfzFNqbaz+VlJrIj3fXQ4DeN1Rjm6cw=="],
|
||||
|
||||
"node-exports-info": ["node-exports-info@1.6.2", "", { "dependencies": { "array.prototype.flatmap": "^1.3.3", "es-errors": "^1.3.0", "object.entries": "^1.1.9", "semver": "^6.3.1" } }, "sha512-kXs9Go0cah0qHVV2v389IXQLdLCeE1xfFtjOAF+iobu0OIoG1pje8At2vMHyaPMiPMnG/LWP50twML21eMcAag=="],
|
||||
|
||||
"node-fetch": ["node-fetch@3.3.2", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="],
|
||||
@@ -2608,6 +2885,8 @@
|
||||
|
||||
"signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
|
||||
|
||||
"skin-tone": ["skin-tone@2.0.0", "", { "dependencies": { "unicode-emoji-modifier-base": "^1.0.0" } }, "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA=="],
|
||||
|
||||
"sonic-boom": ["sonic-boom@4.2.1", "", { "dependencies": { "atomic-sleep": "^1.0.0" } }, "sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q=="],
|
||||
|
||||
"sonner": ["sonner@2.0.8", "", { "peerDependencies": { "@types/react": "^18.0.0 || ^19.0.0", "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-UM/ByIoFra8yzV75n1o0Puu0bw5U/9UNnDacrJNspekBewIfsQ3D6ez1nvlWpt7aTsO6rujQtifBpycwIivqlg=="],
|
||||
@@ -2762,6 +3041,10 @@
|
||||
|
||||
"undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="],
|
||||
|
||||
"unicode-emoji-json": ["unicode-emoji-json@0.8.0", "", {}, "sha512-3wDXXvp6YGoKGhS2O2H7+V+bYduOBydN1lnI0uVfr1cIdY02uFFiEH1i3kE5CCE4l6UqbLKVmEFW9USxTAMD1g=="],
|
||||
|
||||
"unicode-emoji-modifier-base": ["unicode-emoji-modifier-base@1.0.0", "", {}, "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g=="],
|
||||
|
||||
"unicode-properties": ["unicode-properties@1.4.1", "", { "dependencies": { "base64-js": "^1.3.0", "unicode-trie": "^2.0.0" } }, "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg=="],
|
||||
|
||||
"unicode-trie": ["unicode-trie@2.0.0", "", { "dependencies": { "pako": "^0.2.5", "tiny-inflate": "^1.0.0" } }, "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ=="],
|
||||
@@ -2956,6 +3239,106 @@
|
||||
|
||||
"@reduxjs/toolkit/reselect": ["reselect@5.3.0", "", {}, "sha512-XGoLeRAVzUTcJ1qkxPQhDJyIZ5d6zzZD9nT7AEZOaaU9UbWclhycElmhO+VD5bFeLuzhPBaOV2oXC8uG35ZSpg=="],
|
||||
|
||||
"@shumai/webui/@types/react-dom": ["@types/react-dom@19.2.5", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-fMPwH9v7r/pp43yUd2/Mbiex5KouJwwR3dzHkhLREUC6764VyDsqxhAxv6OFEYR1RhjOyD1naqba8ECDBe7ZQg=="],
|
||||
|
||||
"@spectrum-web-components/action-button/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/action-group/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@spectrum-web-components/action-group/@spectrum-web-components/reactive-controllers": ["@spectrum-web-components/reactive-controllers@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-1wnWLt88iyTPrElxZqPpyWWzScSkXY3zxi+QxIV0cFGmhRlPsH+XXqs/kGkfzRyNtE4s2AWuRZ2wtbcao6MzJQ=="],
|
||||
|
||||
"@spectrum-web-components/action-menu/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/action-menu/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@spectrum-web-components/button/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/card/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@spectrum-web-components/checkbox/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/field-label/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/field-label/@spectrum-web-components/reactive-controllers": ["@spectrum-web-components/reactive-controllers@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-1wnWLt88iyTPrElxZqPpyWWzScSkXY3zxi+QxIV0cFGmhRlPsH+XXqs/kGkfzRyNtE4s2AWuRZ2wtbcao6MzJQ=="],
|
||||
|
||||
"@spectrum-web-components/help-text/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@spectrum-web-components/icon/@spectrum-web-components/base": ["@spectrum-web-components/base@1.12.2", "", { "dependencies": { "lit": "^2.5.0 || ^3.1.3" } }, "sha512-7vB3182FqJzRevafUWlFRw/bfM4ZjC+Mmh5Fh0mDmVcP/SohUowrmHsQns1fsQPi+/O8iMP8XbtT7sAFp6ejkA=="],
|
||||
|
||||
"@spectrum-web-components/icons-ui/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/icons-ui/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/icons-workflow/@spectrum-web-components/base": ["@spectrum-web-components/base@1.12.2", "", { "dependencies": { "lit": "^2.5.0 || ^3.1.3" } }, "sha512-7vB3182FqJzRevafUWlFRw/bfM4ZjC+Mmh5Fh0mDmVcP/SohUowrmHsQns1fsQPi+/O8iMP8XbtT7sAFp6ejkA=="],
|
||||
|
||||
"@spectrum-web-components/iconset/@spectrum-web-components/base": ["@spectrum-web-components/base@1.12.2", "", { "dependencies": { "lit": "^2.5.0 || ^3.1.3" } }, "sha512-7vB3182FqJzRevafUWlFRw/bfM4ZjC+Mmh5Fh0mDmVcP/SohUowrmHsQns1fsQPi+/O8iMP8XbtT7sAFp6ejkA=="],
|
||||
|
||||
"@spectrum-web-components/menu/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/overlay/@floating-ui/utils": ["@floating-ui/utils@0.1.6", "", {}, "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A=="],
|
||||
|
||||
"@spectrum-web-components/overlay/@spectrum-web-components/reactive-controllers": ["@spectrum-web-components/reactive-controllers@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-1wnWLt88iyTPrElxZqPpyWWzScSkXY3zxi+QxIV0cFGmhRlPsH+XXqs/kGkfzRyNtE4s2AWuRZ2wtbcao6MzJQ=="],
|
||||
|
||||
"@spectrum-web-components/picker/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/picker/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@spectrum-web-components/picker/@spectrum-web-components/reactive-controllers": ["@spectrum-web-components/reactive-controllers@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-1wnWLt88iyTPrElxZqPpyWWzScSkXY3zxi+QxIV0cFGmhRlPsH+XXqs/kGkfzRyNtE4s2AWuRZ2wtbcao6MzJQ=="],
|
||||
|
||||
"@spectrum-web-components/reactive-controllers/@spectrum-web-components/progress-circle": ["@spectrum-web-components/progress-circle@1.12.2", "", { "dependencies": { "@spectrum-web-components/base": "1.12.2", "@spectrum-web-components/reactive-controllers": "1.12.2", "@spectrum-web-components/shared": "1.12.2" } }, "sha512-I7gAZM8gza/gDZ+tJuKcWF8lld4030GcJpLcySb1NTzBpJlnIItPuybBolSpSb+QzmFTAnlGJaRWTXPZkC8hwA=="],
|
||||
|
||||
"@spectrum-web-components/search/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/search/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@spectrum-web-components/textfield/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/textfield/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@spectrum-web-components/tray/@spectrum-web-components/reactive-controllers": ["@spectrum-web-components/reactive-controllers@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-1wnWLt88iyTPrElxZqPpyWWzScSkXY3zxi+QxIV0cFGmhRlPsH+XXqs/kGkfzRyNtE4s2AWuRZ2wtbcao6MzJQ=="],
|
||||
|
||||
"@swc-uxp-internal/action-button/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/action-group/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@swc-uxp-internal/action-group/@spectrum-web-components/reactive-controllers": ["@spectrum-web-components/reactive-controllers@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-1wnWLt88iyTPrElxZqPpyWWzScSkXY3zxi+QxIV0cFGmhRlPsH+XXqs/kGkfzRyNtE4s2AWuRZ2wtbcao6MzJQ=="],
|
||||
|
||||
"@swc-uxp-internal/button/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/card/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@swc-uxp-internal/checkbox/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/field-label/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/field-label/@spectrum-web-components/reactive-controllers": ["@spectrum-web-components/reactive-controllers@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-1wnWLt88iyTPrElxZqPpyWWzScSkXY3zxi+QxIV0cFGmhRlPsH+XXqs/kGkfzRyNtE4s2AWuRZ2wtbcao6MzJQ=="],
|
||||
|
||||
"@swc-uxp-internal/help-text/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@swc-uxp-internal/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/icons/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/icons-ui/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/icons-ui/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/icons-workflow/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/menu/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/overlay/@floating-ui/utils": ["@floating-ui/utils@0.1.6", "", {}, "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A=="],
|
||||
|
||||
"@swc-uxp-internal/overlay/@spectrum-web-components/reactive-controllers": ["@spectrum-web-components/reactive-controllers@0.37.0", "", { "dependencies": { "lit": "^2.5.0" } }, "sha512-1wnWLt88iyTPrElxZqPpyWWzScSkXY3zxi+QxIV0cFGmhRlPsH+XXqs/kGkfzRyNtE4s2AWuRZ2wtbcao6MzJQ=="],
|
||||
|
||||
"@swc-uxp-internal/search/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/search/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@swc-uxp-internal/textfield/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/textfield/@spectrum-web-components/icons-workflow": ["@spectrum-web-components/icons-workflow@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/icon": "^0.37.0" } }, "sha512-D1Dg+ZjlqbaU/2uKYhmMtZXQMVUw9J9LevHSKSzMFL+Y++JMqRROQuzwAOFW7tttCw1w0+3kIuv2ohkeE+8fNQ=="],
|
||||
|
||||
"@tailwindcss/node/lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.3", "tslib": "^2.4.0" }, "bundled": true }, "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg=="],
|
||||
@@ -3040,6 +3423,10 @@
|
||||
|
||||
"linebreak/base64-js": ["base64-js@0.0.8", "", {}, "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw=="],
|
||||
|
||||
"lit/@lit/reactive-element": ["@lit/reactive-element@1.6.3", "", { "dependencies": { "@lit-labs/ssr-dom-shim": "^1.0.0" } }, "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ=="],
|
||||
|
||||
"lit-element/@lit/reactive-element": ["@lit/reactive-element@1.6.3", "", { "dependencies": { "@lit-labs/ssr-dom-shim": "^1.0.0" } }, "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ=="],
|
||||
|
||||
"p-retry/retry": ["retry@0.13.1", "", {}, "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg=="],
|
||||
|
||||
"parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="],
|
||||
@@ -3102,6 +3489,56 @@
|
||||
|
||||
"@prisma/studio-core/@radix-ui/react-toggle/@radix-ui/react-use-controllable-state": ["@radix-ui/react-use-controllable-state@1.2.2", "", { "dependencies": { "@radix-ui/react-use-effect-event": "0.0.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg=="],
|
||||
|
||||
"@spectrum-web-components/action-button/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/action-group/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/action-menu/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/button/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/card/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/checkbox/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/field-label/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/help-text/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@spectrum-web-components/menu/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/picker/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/reactive-controllers/@spectrum-web-components/progress-circle/@spectrum-web-components/base": ["@spectrum-web-components/base@1.12.2", "", { "dependencies": { "lit": "^2.5.0 || ^3.1.3" } }, "sha512-7vB3182FqJzRevafUWlFRw/bfM4ZjC+Mmh5Fh0mDmVcP/SohUowrmHsQns1fsQPi+/O8iMP8XbtT7sAFp6ejkA=="],
|
||||
|
||||
"@spectrum-web-components/reactive-controllers/@spectrum-web-components/progress-circle/@spectrum-web-components/shared": ["@spectrum-web-components/shared@1.12.2", "", { "dependencies": { "@lit-labs/observers": "2.0.2", "@spectrum-web-components/base": "1.12.2", "focus-visible": "5.2.1" } }, "sha512-1vRimMtdKllujoFPbuDoPP0eSHZJfExWld2jeqboMKjzNTDvBfoOIN3ZOz7ClOVyrJOQDJSP2htCVfDBYl72Ug=="],
|
||||
|
||||
"@spectrum-web-components/search/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/textfield/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/action-button/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/action-group/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/button/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/card/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/checkbox/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/field-label/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/help-text/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon": ["@spectrum-web-components/icon@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0", "@spectrum-web-components/iconset": "^0.37.0" } }, "sha512-DZ1yOKHxNQygzIJ7u9akYComDnMmxuTzfmYxxt9sHdUXmc1NbMkCJqEaAG/LYsdb+hc4xWaDTT9SzArLKZ/btA=="],
|
||||
|
||||
"@swc-uxp-internal/icons-workflow/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/menu/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/search/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/textfield/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@tailwindcss/node/lightningcss/lightningcss-android-arm64": ["lightningcss-android-arm64@1.32.0", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="],
|
||||
|
||||
"@tailwindcss/node/lightningcss/lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.32.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ=="],
|
||||
@@ -3162,6 +3599,18 @@
|
||||
|
||||
"@prisma/studio-core/@radix-ui/react-toggle/@radix-ui/react-use-controllable-state/@radix-ui/react-use-layout-effect": ["@radix-ui/react-use-layout-effect@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ=="],
|
||||
|
||||
"@spectrum-web-components/action-group/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/card/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@spectrum-web-components/help-text/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/action-group/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/card/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"@swc-uxp-internal/help-text/@spectrum-web-components/icons-workflow/@spectrum-web-components/icon/@spectrum-web-components/iconset": ["@spectrum-web-components/iconset@0.37.0", "", { "dependencies": { "@spectrum-web-components/base": "^0.37.0" } }, "sha512-s1TBjWeQtGdGf6n+r+aG2glv77IgR0pNs0HLusGyYt6jzWFkP276fE7Neqq/2XvG9a9zvAwngffnWS3td/Gtmg=="],
|
||||
|
||||
"dockerode/tar-fs/tar-stream/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
|
||||
|
||||
"eslint-plugin-react/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
"using-shumai/metadata",
|
||||
"using-shumai/collections",
|
||||
"using-shumai/share-links",
|
||||
"using-shumai/nle-and-premiere",
|
||||
"using-shumai/gotenberg"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
---
|
||||
title: NLE Export & Premiere Pro Plugin
|
||||
description: Export timestamped review comments to popular NLE formats or use the native Premiere Pro UXP plugin to import assets and auto-sync timeline markers.
|
||||
---
|
||||
|
||||
Shumai integrates directly into video editing workflows. You can export review comments into industry-standard non-linear editor (NLE) marker formats from the web interface, or use the native Adobe Premiere Pro UXP plugin to import media assets and synchronize comments to timeline markers in real-time.
|
||||
|
||||
---
|
||||
|
||||
## Comments Export to NLE
|
||||
|
||||
Comments left during video and audio reviews can be exported directly from the web interface to external editing software.
|
||||
|
||||
### How to Export Comments
|
||||
|
||||
1. Open any video or audio asset in the Shumai media viewer.
|
||||
2. In the right sidebar, navigate to the **Comments** tab.
|
||||
3. Click the **More Options** (`...`) menu located next to **All Comments**.
|
||||
4. Hover over **Export Comments** and select your editing software format:
|
||||
|
||||
| Format | File Extension | Target Software |
|
||||
| :----------------- | :------------- | :--------------------------------- |
|
||||
| **Premiere Pro** | `.xml` | Adobe Premiere Pro marker sequence |
|
||||
| **Resolve** | `.edl` | DaVinci Resolve timeline markers |
|
||||
| **FCP 10.4.0+** | `.fiojson` | Apple Final Cut Pro marker data |
|
||||
| **Media Composer** | `.xml` | Avid Media Composer markers |
|
||||
|
||||
Once downloaded, import the marker file into your editing software to overlay all review notes and timestamps onto your timeline.
|
||||
|
||||
---
|
||||
|
||||
## Premiere Pro UXP Plugin (Experimental)
|
||||
|
||||
The official Shumai Premiere Pro UXP plugin provides a native panel inside Adobe Premiere Pro, enabling editors to browse workspace assets, import media or proxies directly into the project bin, and automatically synchronize review comments to sequence markers.
|
||||
|
||||
> [!NOTE]
|
||||
> **Experimental Feature:**
|
||||
> The Premiere Pro UXP plugin is currently experimental. While functional, it has not yet been tested across all Premiere Pro minor versions and operating system configurations. If you encounter any bugs, unexpected behavior, or have workflow suggestions, please [open an issue on GitHub](https://github.com/shumaiOne/shumai/issues) or join our [Discord community](https://discord.gg/sUzhujK6DD).
|
||||
|
||||
### Minimum Version Requirements
|
||||
|
||||
| Software | Minimum Version Required |
|
||||
| :--------------------- | :------------------------------------------------ |
|
||||
| **Adobe Premiere Pro** | **`25.1.0`** or higher (Premiere Pro 2025 v25.1+) |
|
||||
| **Shumai Server** | **`0.4.6`** or higher |
|
||||
|
||||
---
|
||||
|
||||
### Installation
|
||||
|
||||
You can install the Shumai Premiere Pro plugin using either the packaged `.ccx` installer or the Adobe UXP Developer Tools.
|
||||
|
||||
#### Option 1: Install via Creative Cloud (.ccx)
|
||||
|
||||
This is the recommended and quickest installation method for standard users.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> **Prerequisites:**
|
||||
>
|
||||
> - You must have **Adobe Premiere Pro** (v25.1.0+) and the **Adobe Creative Cloud desktop application** installed on your system.
|
||||
> - Adobe Premiere Pro must be recognized and listed in the Creative Cloud desktop app under your installed applications.
|
||||
|
||||
1. Download the pre-built plugin package [`shumai-premiere.ccx`](https://github.com/shumaiOne/shumai/raw/main/apps/premiere-uxp/shumai-premiere.ccx) from the repository (located at `apps/premiere-uxp/shumai-premiere.ccx`).
|
||||
2. Double-click the downloaded `.ccx` file, or drag and drop it directly into the **Adobe Creative Cloud** desktop app.
|
||||
3. Follow the on-screen prompts in Creative Cloud to approve and install the plugin.
|
||||
4. Launch or restart Adobe Premiere Pro.
|
||||
|
||||
#### Option 2: Install via Adobe UXP Developer Tools (UDT)
|
||||
|
||||
This method is intended for developers or users building from source code.
|
||||
|
||||
> [!NOTE]
|
||||
> Refer to the official [Adobe UXP Developer Tools Documentation](https://developer.adobe.com/premiere-pro/uxp/getting-started/quickstart/) for details on installing and setting up the UXP Developer Tool (UDT).
|
||||
|
||||
1. Clone the Shumai repository:
|
||||
```bash
|
||||
git clone https://github.com/shumaiOne/shumai.git
|
||||
cd shumai
|
||||
```
|
||||
2. Install dependencies and build the UXP plugin:
|
||||
```bash
|
||||
bun install
|
||||
bun run --filter @shumai/premiere-uxp build
|
||||
```
|
||||
3. Open the **Adobe UXP Developer Tool** (UDT).
|
||||
4. Click **Add Plugin** and select the manifest file located at:
|
||||
```text
|
||||
apps/premiere-uxp/dist/manifest.json
|
||||
```
|
||||
_(Or `apps/premiere-uxp/public/manifest.json` when running in watch mode)._
|
||||
5. Open Adobe Premiere Pro. In the UDT application, find the Shumai plugin in your list, click the `•••` action menu, and select **Load** (or **Load & Watch**).
|
||||
|
||||
---
|
||||
|
||||
### Connecting to Your Shumai Server
|
||||
|
||||
1. In Premiere Pro, open the plugin panel by navigating to **Window** > **Extensions** > **Shumai** (or **Window** > **Shumai**).
|
||||
2. Enter your connection credentials:
|
||||
- **Endpoint URL:** The URL of your Shumai server (e.g. `http://localhost:3000` or `https://shumai.yourdomain.com`).
|
||||
- **API Key:** A valid API key generated in Shumai. To create one, open Shumai in your browser, go to **Team Settings** > **Developer**, and generate a new API key.
|
||||
3. Click **Connect**. Once connected, your credentials are saved locally in Premiere Pro.
|
||||
|
||||
---
|
||||
|
||||
### What the Shumai UXP Plugin Can Do
|
||||
|
||||
The plugin integrates two core workflows directly into Premiere Pro:
|
||||
|
||||
#### 1. Browse & Import Assets into Premiere Pro
|
||||
|
||||
- **Browse & Search:** Navigate through your Shumai projects, folders, and media assets with breadcrumb navigation and instant search.
|
||||
- **Choose Download Quality:** Select **Import** on any asset to choose between:
|
||||
- **Original (Raw):** Downloads and imports the full original master media file.
|
||||
- **Video Proxy:** Downloads and imports an optimized proxy transcode (e.g. 1080p, 720p, 540p, or 360p MP4) for lighter, smoother editing playback.
|
||||
- **Native Destination Selection:** Prompts a native system folder picker so you can choose exactly where on your local disk the media file should be saved.
|
||||
- **Automatic Bin Import:** After saving to disk, the file is automatically imported into your active Premiere Pro project bin.
|
||||
|
||||
#### 2. Auto-Sync Comments to Sequence Markers
|
||||
|
||||
- **Link Sequence:** In the plugin file list, select **Link Sequence** on any video asset to link it with your currently active timeline sequence.
|
||||
- **Automatic Marker Creation:** The plugin immediately fetches existing comments from Shumai and converts them into native Premiere Pro sequence markers:
|
||||
- **Accurate Timestamps:** Comments placed at specific timecodes appear at the corresponding timeline frames. Comments without timestamps are placed at the beginning of the sequence (`00:00:00:00`).
|
||||
- **Author & Content:** The marker name shows the commenter's name, and the marker notes include the comment body along with formatted threaded replies.
|
||||
- **Continuous Background Sync:** The plugin continuously syncs in the background (every 12 seconds), and triggers an immediate sync whenever you switch focus to the panel or activate a sequence.
|
||||
- **Sequences Dashboard:** Switch to the **Sequences** tab at any time to see all linked sequences in your project, view the last sync time, trigger an instant manual sync, or unlink sequences.
|
||||
- **Clean Unlink:** When unlinking an asset from a sequence, Shumai cleanly cleans up the markers it generated without affecting other project markers.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "shumai",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@shumai/agent",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@shumai/api",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
|
||||
@@ -36,6 +36,7 @@ vi.mock('@shumai/core/src/authz/authz', () => ({
|
||||
Asset: 'asset',
|
||||
Team: 'team',
|
||||
Project: 'project',
|
||||
Comment: 'comment',
|
||||
},
|
||||
}))
|
||||
|
||||
@@ -65,11 +66,14 @@ describe('file api', () => {
|
||||
vi.spyOn(assetService, 'createComment').mockImplementation(vi.fn())
|
||||
vi.spyOn(assetService, 'completeComment').mockImplementation(vi.fn())
|
||||
vi.spyOn(assetService, 'deleteComment').mockImplementation(vi.fn())
|
||||
vi.spyOn(assetService, 'addCommentReaction').mockImplementation(vi.fn())
|
||||
vi.spyOn(assetService, 'removeCommentReaction').mockImplementation(vi.fn())
|
||||
vi.spyOn(assetService, 'getComment').mockResolvedValue({
|
||||
id: 'comment1',
|
||||
assetId: 'file1',
|
||||
} as unknown as Awaited<ReturnType<typeof assetService.getComment>>)
|
||||
vi.spyOn(assetService, 'listComments').mockImplementation(vi.fn())
|
||||
vi.spyOn(assetService, 'exportComments').mockImplementation(vi.fn())
|
||||
vi.spyOn(assetService, 'restoreAssets').mockImplementation(vi.fn())
|
||||
vi.spyOn(metadataService, 'updateAssetMetadata').mockImplementation(vi.fn())
|
||||
vi.spyOn(notificationService, 'create').mockImplementation(vi.fn())
|
||||
@@ -214,6 +218,7 @@ describe('file api', () => {
|
||||
sessionId: null,
|
||||
isCompleted: false,
|
||||
completionLastChangedBy: null,
|
||||
reactionCounts: [],
|
||||
})
|
||||
|
||||
// Mock assetService.getAsset to return teamId for notification
|
||||
@@ -273,6 +278,7 @@ describe('file api', () => {
|
||||
sessionId: null,
|
||||
isCompleted: false,
|
||||
completionLastChangedBy: null,
|
||||
reactionCounts: [],
|
||||
})
|
||||
|
||||
// Mock assetService.getAsset to return teamId for notification
|
||||
@@ -329,6 +335,7 @@ describe('file api', () => {
|
||||
sessionId: null,
|
||||
isCompleted: false,
|
||||
completionLastChangedBy: null,
|
||||
reactionCounts: [],
|
||||
},
|
||||
],
|
||||
pageInfo: { cursor: 'cursor', total: 1 },
|
||||
@@ -348,6 +355,112 @@ describe('file api', () => {
|
||||
type: ResourceType.Asset,
|
||||
id: 'test-id',
|
||||
})
|
||||
expect(assetService.listComments).toHaveBeenCalledWith('test-id', expect.anything(), 'user1')
|
||||
})
|
||||
|
||||
it('POST /files/:fileId/comments/export - success', async () => {
|
||||
vi.mocked(assetService.exportComments).mockResolvedValue({
|
||||
content: 'TITLE: test\n001 ...',
|
||||
filename: 'test-video_comments.edl',
|
||||
mimeType: 'application/edl',
|
||||
})
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', fileRoute)
|
||||
const res = await app.request('/files/test-id/comments/export', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ format: 'resolve-edl' }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
expect(res.headers.get('Content-Disposition')).toBe(
|
||||
'attachment; filename="test-video_comments.edl"; filename*=UTF-8\'\'test-video_comments.edl',
|
||||
)
|
||||
expect(res.headers.get('Content-Type')).toBe('application/edl')
|
||||
const body = await res.text()
|
||||
expect(body).toBe('TITLE: test\n001 ...')
|
||||
|
||||
expect(authzService.hasPermission).toHaveBeenCalledWith({
|
||||
user: { id: 'user1', name: 'Test User' },
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Asset,
|
||||
id: 'test-id',
|
||||
})
|
||||
|
||||
expect(assetService.exportComments).toHaveBeenCalledWith('test-id', 'resolve-edl', {
|
||||
timeZone: undefined,
|
||||
})
|
||||
})
|
||||
|
||||
it('POST /files/:fileId/comments/export - handles CJK filename in Content-Disposition', async () => {
|
||||
vi.mocked(assetService.exportComments).mockResolvedValue({
|
||||
content: 'TITLE: 中文视频\n001 ...',
|
||||
filename: '宣传片_2026_resolve.edl',
|
||||
mimeType: 'text/plain; charset=utf-8',
|
||||
})
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', fileRoute)
|
||||
const res = await app.request('/files/test-id/comments/export', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ format: 'resolve-edl' }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
expect(res.headers.get('Content-Disposition')).toBe(
|
||||
`attachment; filename*=UTF-8''${encodeURIComponent('宣传片_2026_resolve.edl')}`,
|
||||
)
|
||||
})
|
||||
|
||||
it('POST /files/:fileId/comments/export - with timezone in body', async () => {
|
||||
vi.mocked(assetService.exportComments).mockResolvedValue({
|
||||
content: '{}',
|
||||
filename: 'test.fiojson',
|
||||
mimeType: 'application/json',
|
||||
})
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', fileRoute)
|
||||
const res = await app.request('/files/test-id/comments/export', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
format: 'fcp-fiojson',
|
||||
timeZone: 'America/New_York',
|
||||
}),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
expect(assetService.exportComments).toHaveBeenCalledWith('test-id', 'fcp-fiojson', {
|
||||
timeZone: 'America/New_York',
|
||||
})
|
||||
})
|
||||
|
||||
it('POST /files/:fileId/comments/export - 400 on missing or invalid format', async () => {
|
||||
const app = new Hono().use('*', authMiddleware).route('/', fileRoute)
|
||||
|
||||
const resMissing = await app.request('/files/test-id/comments/export', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({}),
|
||||
})
|
||||
expect(resMissing.status).toBe(400)
|
||||
|
||||
const resInvalid = await app.request('/files/test-id/comments/export', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ format: 'invalid-format' }),
|
||||
})
|
||||
expect(resInvalid.status).toBe(400)
|
||||
|
||||
const resInvalidTz = await app.request('/files/test-id/comments/export', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
format: 'resolve-edl',
|
||||
timeZone: 'Invalid/Fake_Zone',
|
||||
}),
|
||||
})
|
||||
expect(resInvalidTz.status).toBe(400)
|
||||
})
|
||||
|
||||
it('POST /comments/:commentId/complete', async () => {
|
||||
@@ -366,6 +479,7 @@ describe('file api', () => {
|
||||
sessionId: null,
|
||||
isCompleted: true,
|
||||
completionLastChangedBy: { id: 'user1', name: 'Test User' },
|
||||
reactionCounts: [],
|
||||
})
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', fileRoute)
|
||||
@@ -414,6 +528,56 @@ describe('file api', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('POST /comments/:commentId/reactions', async () => {
|
||||
vi.mocked(assetService.addCommentReaction).mockResolvedValue(undefined)
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', fileRoute)
|
||||
const res = await app.request('/comments/comment-id/reactions', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ code: '👍' }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const json = await res.json()
|
||||
expect(json.success).toBe(true)
|
||||
|
||||
expect(authzService.hasPermission).toHaveBeenCalledWith({
|
||||
user: { id: 'user1', name: 'Test User' },
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Comment,
|
||||
id: 'comment-id',
|
||||
})
|
||||
expect(assetService.addCommentReaction).toHaveBeenCalledWith('comment-id', 'user1', '👍')
|
||||
})
|
||||
|
||||
it('DELETE /comments/:commentId/reactions', async () => {
|
||||
vi.mocked(assetService.removeCommentReaction).mockResolvedValue(undefined)
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', fileRoute)
|
||||
const res = await app.request('/comments/comment-id/reactions', {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ code: '👍' }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const json = await res.json()
|
||||
expect(json.success).toBe(true)
|
||||
|
||||
expect(authzService.hasPermission).toHaveBeenCalledWith({
|
||||
user: { id: 'user1', name: 'Test User' },
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Comment,
|
||||
id: 'comment-id',
|
||||
})
|
||||
expect(assetService.removeCommentReaction).toHaveBeenCalledWith('comment-id', 'user1', '👍')
|
||||
})
|
||||
|
||||
it('POST /teams/:teamId/files - image with compression', async () => {
|
||||
vi.mocked(s3Service.putObject).mockResolvedValue(undefined)
|
||||
|
||||
|
||||
@@ -17,9 +17,12 @@ import {
|
||||
uploadFileRequestSchema,
|
||||
getDownloadLinksRequestSchema,
|
||||
completeCommentRequestSchema,
|
||||
exportCommentsRequestSchema,
|
||||
addCommentReactionRequestSchema,
|
||||
removeCommentReactionRequestSchema,
|
||||
AuditAction,
|
||||
} from '@shumai/dtos'
|
||||
import { transcodeService } from '@shumai/core'
|
||||
import { transcodeService, buildContentDisposition } from '@shumai/core'
|
||||
import fs from 'fs'
|
||||
import { Hono } from 'hono'
|
||||
import os from 'os'
|
||||
@@ -224,9 +227,71 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
id: fileId,
|
||||
})
|
||||
|
||||
const comments = await assetService.listComments(fileId, req)
|
||||
const comments = await assetService.listComments(fileId, req, user.id)
|
||||
return c.json(comments)
|
||||
})
|
||||
.post(
|
||||
'/files/:fileId/comments/export',
|
||||
zValidator('json', exportCommentsRequestSchema),
|
||||
async (c) => {
|
||||
const fileId = c.req.param('fileId')
|
||||
const user = c.get('user')
|
||||
const { format, timeZone } = c.req.valid('json')
|
||||
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Asset,
|
||||
id: fileId,
|
||||
})
|
||||
|
||||
const result = await assetService.exportComments(fileId, format, { timeZone })
|
||||
|
||||
c.header('Content-Type', result.mimeType)
|
||||
c.header('Content-Disposition', buildContentDisposition(result.filename))
|
||||
return c.body(result.content)
|
||||
},
|
||||
)
|
||||
.post(
|
||||
'/comments/:commentId/reactions',
|
||||
zValidator('json', addCommentReactionRequestSchema),
|
||||
async (c) => {
|
||||
const commentId = c.req.param('commentId')
|
||||
const user = c.get('user')
|
||||
const req = c.req.valid('json')
|
||||
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Comment,
|
||||
id: commentId,
|
||||
})
|
||||
|
||||
await assetService.addCommentReaction(commentId, user.id, req.code)
|
||||
|
||||
return c.json({ success: true })
|
||||
},
|
||||
)
|
||||
.delete(
|
||||
'/comments/:commentId/reactions',
|
||||
zValidator('json', removeCommentReactionRequestSchema),
|
||||
async (c) => {
|
||||
const commentId = c.req.param('commentId')
|
||||
const user = c.get('user')
|
||||
const req = c.req.valid('json')
|
||||
|
||||
await authzService.hasPermission({
|
||||
user,
|
||||
permission: Permission.Read,
|
||||
type: ResourceType.Comment,
|
||||
id: commentId,
|
||||
})
|
||||
|
||||
await assetService.removeCommentReaction(commentId, user.id, req.code)
|
||||
|
||||
return c.json({ success: true })
|
||||
},
|
||||
)
|
||||
.post(
|
||||
'/comments/:commentId/complete',
|
||||
zValidator('json', completeCommentRequestSchema),
|
||||
|
||||
@@ -318,6 +318,28 @@ describe('folder api', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('POST /folders/:folderId/search passes previewFormat to searchService', async () => {
|
||||
vi.mocked(searchService.search).mockResolvedValue({
|
||||
data: [],
|
||||
pageInfo: { total: 0 },
|
||||
})
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', folderRoute)
|
||||
const res = await app.request('/folders/test-id/search', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
previewFormat: 'jpeg',
|
||||
}),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
expect(searchService.search).toHaveBeenCalledWith(
|
||||
'test-id',
|
||||
expect.objectContaining({ previewFormat: 'jpeg' }),
|
||||
)
|
||||
})
|
||||
|
||||
it('PATCH /folders/:folderId/order', async () => {
|
||||
vi.spyOn(assetService, 'updateAssetOrder').mockResolvedValue({
|
||||
id: 'test-id',
|
||||
|
||||
@@ -45,6 +45,8 @@ const apiRoute = new Hono<{ Variables: { user: User } }>()
|
||||
.use('/projects/*', tokenAuthMiddleware)
|
||||
.use('/folders', tokenAuthMiddleware)
|
||||
.use('/folders/*', tokenAuthMiddleware)
|
||||
.use('/files', tokenAuthMiddleware)
|
||||
.use('/files/*', tokenAuthMiddleware)
|
||||
.use('/teams/:teamId/upload/tasks', tokenAuthMiddleware)
|
||||
.use('/teams/:teamId/upload/tasks/*', tokenAuthMiddleware)
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import { describe, expect, it, vi, beforeEach } from 'vitest'
|
||||
import { Hono } from 'hono'
|
||||
import type { Prisma } from '@shumai/db'
|
||||
import { authMiddleware } from './auth'
|
||||
import { auth } from '@shumai/core/src/auth/auth'
|
||||
import { userService } from '@shumai/core/src/user/user'
|
||||
import { teamService } from '@shumai/core/src/team/team'
|
||||
|
||||
type User = Prisma.UserGetPayload<Record<string, never>>
|
||||
|
||||
vi.mock('@shumai/core/src/auth/auth', () => ({
|
||||
auth: {
|
||||
api: {
|
||||
@@ -124,5 +127,59 @@ describe('authMiddleware', () => {
|
||||
const res = await app.request('/test', { method: 'POST' })
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
|
||||
const createTokenApp = () =>
|
||||
new Hono<{ Variables: { user: User } }>()
|
||||
.use('*', async (c, next) => {
|
||||
c.set('user', { id: 'token-user' } as unknown as User)
|
||||
await next()
|
||||
})
|
||||
.use('*', authMiddleware)
|
||||
.get('/test', (c) => c.text('ok'))
|
||||
.post('/test', (c) => c.text('ok'))
|
||||
.post('/test/search', (c) => c.text('ok'))
|
||||
.post('/test/recents/view', (c) => c.text('ok'))
|
||||
.put('/test', (c) => c.text('ok'))
|
||||
.delete('/test', (c) => c.text('ok'))
|
||||
|
||||
it('rejects POST for token-authenticated user without writable role in demo mode', async () => {
|
||||
const tokenApp = createTokenApp()
|
||||
vi.mocked(teamService.hasWritableRoleInAnyTeam).mockResolvedValue(false)
|
||||
|
||||
const res = await tokenApp.request('/test', { method: 'POST' })
|
||||
expect(res.status).toBe(403)
|
||||
expect(await res.json()).toEqual({ error: 'System is in read-only mode' })
|
||||
})
|
||||
|
||||
it('allows GET for token-authenticated user in demo mode', async () => {
|
||||
const tokenApp = createTokenApp()
|
||||
const res = await tokenApp.request('/test', { method: 'GET' })
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
|
||||
it('allows allowed demo write paths for token-authenticated user in demo mode', async () => {
|
||||
const tokenApp = createTokenApp()
|
||||
vi.mocked(teamService.hasWritableRoleInAnyTeam).mockResolvedValue(false)
|
||||
|
||||
const searchRes = await tokenApp.request('/test/search', { method: 'POST' })
|
||||
expect(searchRes.status).toBe(200)
|
||||
|
||||
const recentsRes = await tokenApp.request('/test/recents/view', { method: 'POST' })
|
||||
expect(recentsRes.status).toBe(200)
|
||||
})
|
||||
|
||||
it('allows write operations for token-authenticated user with writable role in demo mode', async () => {
|
||||
const tokenApp = createTokenApp()
|
||||
vi.mocked(teamService.hasWritableRoleInAnyTeam).mockResolvedValue(true)
|
||||
|
||||
const postRes = await tokenApp.request('/test', { method: 'POST' })
|
||||
expect(postRes.status).toBe(200)
|
||||
|
||||
const putRes = await tokenApp.request('/test', { method: 'PUT' })
|
||||
expect(putRes.status).toBe(200)
|
||||
|
||||
const delRes = await tokenApp.request('/test', { method: 'DELETE' })
|
||||
expect(delRes.status).toBe(200)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -11,44 +11,44 @@ export const authMiddleware = createMiddleware<{
|
||||
user: User
|
||||
}
|
||||
}>(async (c, next) => {
|
||||
if (c.get('user')) {
|
||||
await next()
|
||||
return
|
||||
}
|
||||
let user = c.get('user')
|
||||
|
||||
const session = await auth.api.getSession({
|
||||
headers: c.req.raw.headers,
|
||||
})
|
||||
if (!user) {
|
||||
const session = await auth.api.getSession({
|
||||
headers: c.req.raw.headers,
|
||||
})
|
||||
|
||||
if (!session) {
|
||||
return c.json({ error: 'Unauthorized' }, 401)
|
||||
}
|
||||
|
||||
try {
|
||||
const user = await userService.getUserById(session.user.id)
|
||||
|
||||
if (!user) {
|
||||
return c.json({ error: 'User not found' }, 401)
|
||||
if (!session) {
|
||||
return c.json({ error: 'Unauthorized' }, 401)
|
||||
}
|
||||
|
||||
c.set('user', user)
|
||||
try {
|
||||
const fetchedUser = await userService.getUserById(session.user.id)
|
||||
|
||||
if (process.env.SHUMAI_DEMO_MODE === '1') {
|
||||
const method = c.req.method.toUpperCase()
|
||||
const path = c.req.path
|
||||
const isAllowedDemoWrite =
|
||||
method === 'POST' && (path.endsWith('/search') || path.endsWith('/recents/view'))
|
||||
if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method) && !isAllowedDemoWrite) {
|
||||
const hasWritable = await teamService.hasWritableRoleInAnyTeam(user.id)
|
||||
if (!fetchedUser) {
|
||||
return c.json({ error: 'User not found' }, 401)
|
||||
}
|
||||
|
||||
if (!hasWritable) {
|
||||
return c.json({ error: 'System is in read-only mode' }, 403)
|
||||
}
|
||||
user = fetchedUser
|
||||
c.set('user', user)
|
||||
} catch {
|
||||
return c.json({ error: 'Authentication failed' }, 401)
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.SHUMAI_DEMO_MODE === '1') {
|
||||
const method = c.req.method.toUpperCase()
|
||||
const path = c.req.path
|
||||
const isAllowedDemoWrite =
|
||||
method === 'POST' && (path.endsWith('/search') || path.endsWith('/recents/view'))
|
||||
if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method) && !isAllowedDemoWrite) {
|
||||
const hasWritable = await teamService.hasWritableRoleInAnyTeam(user.id)
|
||||
|
||||
if (!hasWritable) {
|
||||
return c.json({ error: 'System is in read-only mode' }, 403)
|
||||
}
|
||||
}
|
||||
|
||||
await next()
|
||||
} catch {
|
||||
return c.json({ error: 'Authentication failed' }, 401)
|
||||
}
|
||||
|
||||
await next()
|
||||
})
|
||||
|
||||
@@ -77,6 +77,23 @@ describe('project api', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('GET /teams/:teamId/projects with previewFormat=jpeg', async () => {
|
||||
vi.mocked(projectService.listProjects).mockResolvedValue({
|
||||
data: [{ id: 'p1', name: 'p1', rootFolder: 'r1', coverImage: 'http://s3/p1.jpeg' }] as any, // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
pageInfo: { total: 1, cursor: 'abc' },
|
||||
})
|
||||
|
||||
const res = await app.request('/teams/t/projects?previewFormat=jpeg')
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
expect(projectService.listProjects).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
teamId: 't',
|
||||
previewFormat: 'jpeg',
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('POST /teams/:teamId/projects', async () => {
|
||||
vi.mocked(projectService.createProject).mockResolvedValue({
|
||||
id: 'foo',
|
||||
@@ -412,6 +429,27 @@ describe('project api', () => {
|
||||
expect(projectService.getUserProjects).toHaveBeenCalledWith('user1', 10)
|
||||
})
|
||||
|
||||
it('GET /projects with previewFormat=jpeg', async () => {
|
||||
vi.mocked(projectService.getUserProjects).mockResolvedValue([
|
||||
{
|
||||
id: 'proj1',
|
||||
name: 'My Project',
|
||||
teamId: 'team1',
|
||||
rootFolder: 'folder1',
|
||||
coverImage: 'http://s3/proj1.jpeg',
|
||||
enableNotification: true,
|
||||
updatedAt: '2026-06-21T00:00:00.000Z',
|
||||
},
|
||||
] as unknown as ProjectInfo[])
|
||||
|
||||
const res = await app.request('/projects?first=10&previewFormat=jpeg')
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const json = await res.json()
|
||||
expect(json.data[0].coverImage).toBe('http://s3/proj1.jpeg')
|
||||
expect(projectService.getUserProjects).toHaveBeenCalledWith('user1', 10, 'jpeg')
|
||||
})
|
||||
|
||||
it('GET /projects/:projectId/recents', async () => {
|
||||
vi.mocked(assetService.listRecents).mockResolvedValue({
|
||||
data: [{ id: 'file1', name: 'video.mp4', type: 'file' }] as any, // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
|
||||
@@ -8,25 +8,28 @@ import {
|
||||
createProjectRequestSchema,
|
||||
updateProjectRequestSchema,
|
||||
listProjectsRequestSchema,
|
||||
listUserProjectsRequestSchema,
|
||||
recentlyDeletedRequestSchema,
|
||||
updateProjectMemberRoleRequestSchema,
|
||||
addProjectMemberRequestSchema,
|
||||
listRecentsRequestSchema,
|
||||
recordRecentViewRequestSchema,
|
||||
} from '@shumai/dtos'
|
||||
import { listMembersQuerySchema, paginationParamsSchema, AuditAction } from '@shumai/dtos'
|
||||
import { listMembersQuerySchema, AuditAction } from '@shumai/dtos'
|
||||
import type { Prisma } from '@shumai/db'
|
||||
import { auditLogService } from '@shumai/core/src/auditLog/auditLog'
|
||||
|
||||
type User = Prisma.UserGetPayload<Record<string, never>>
|
||||
|
||||
const route = new Hono<{ Variables: { user: User } }>()
|
||||
.get('/projects', zValidator('query', paginationParamsSchema), async (c) => {
|
||||
.get('/projects', zValidator('query', listUserProjectsRequestSchema), async (c) => {
|
||||
const user = c.get('user')
|
||||
const req = c.req.valid('query')
|
||||
const limit = req.first ? Math.min(req.first, 200) : 200
|
||||
|
||||
const allProjects = await projectService.getUserProjects(user.id, limit)
|
||||
const allProjects = req.previewFormat
|
||||
? await projectService.getUserProjects(user.id, limit, req.previewFormat)
|
||||
: await projectService.getUserProjects(user.id, limit)
|
||||
|
||||
return c.json({
|
||||
data: allProjects.map((p) => ({
|
||||
@@ -34,6 +37,8 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
name: p.name,
|
||||
teamId: p.teamId,
|
||||
rootFolder: p.rootFolder,
|
||||
coverImage: p.coverImage,
|
||||
coverImageKey: p.coverImageKey,
|
||||
enableNotification: p.enableNotification,
|
||||
updatedAt: p.updatedAt,
|
||||
})),
|
||||
@@ -197,6 +202,7 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
userId: user.id,
|
||||
sortBy: req.sortBy,
|
||||
sortDirection: req.sortDirection,
|
||||
previewFormat: req.previewFormat,
|
||||
pagination: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -282,7 +282,14 @@ const route = app
|
||||
await shareService.verifyPublicAccess(fileId, password)
|
||||
|
||||
const targetFileId = await assetService.resolveTargetAssetId(fileId)
|
||||
const res = await assetService.listComments(targetFileId, req)
|
||||
let userId: string | undefined
|
||||
const session = await auth.api.getSession({
|
||||
headers: c.req.raw.headers,
|
||||
})
|
||||
if (session?.user) {
|
||||
userId = session.user.id
|
||||
}
|
||||
const res = await assetService.listComments(targetFileId, req, userId)
|
||||
return c.json(res)
|
||||
} catch (err) {
|
||||
return handlePublicShareError(c, err)
|
||||
|
||||
@@ -260,6 +260,21 @@ describe('team api', () => {
|
||||
expect(mockUpdateSettings).toHaveBeenCalledWith('t1', 'transcode.hardwareAcceleration', 'auto')
|
||||
})
|
||||
|
||||
it('PATCH /teams/:teamId/settings updates appearance.hideAgent', async () => {
|
||||
mockUpdateSettings.mockResolvedValue({ appearance: { hideAgent: true } })
|
||||
|
||||
const res = await app.request('/teams/t1/settings', {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ key: 'appearance.hideAgent', value: true }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const data = await res.json()
|
||||
expect(data.appearance.hideAgent).toBe(true)
|
||||
expect(mockUpdateSettings).toHaveBeenCalledWith('t1', 'appearance.hideAgent', true)
|
||||
})
|
||||
|
||||
it('GET /teams/:teamId/user-metadata returns all metadata for the user in the team', async () => {
|
||||
mockListUserMetadata.mockResolvedValue([
|
||||
{ key: 'key1', value: 'value1' },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@shumai/core",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
|
||||
@@ -335,10 +335,24 @@ describe('AgentService', () => {
|
||||
providerId: provider.id,
|
||||
modelId: model.id,
|
||||
})
|
||||
expect(agent2!.user.image).toMatch(/^files\/[A-Z0-9]{26}\.webp$/)
|
||||
expect(agent2!.user.image).toBe('files/avatars/avatar-2.webp')
|
||||
expect((agent2!.config as unknown as PrismaJson.AgentConfig).avatarPreset).toBe('avatar-2')
|
||||
const initialKey = agent2!.user.image
|
||||
|
||||
// 1b. Create another agent with the SAME preset avatar (should share identical storage key)
|
||||
const agent2Duplicate = await svc.createAgent({
|
||||
teamId: team.id,
|
||||
name: 'Agent Preset 2 Duplicate',
|
||||
type: 'chat',
|
||||
enabled: true,
|
||||
thinkingLevel: 'off',
|
||||
avatar: 'avatar-2',
|
||||
providerId: provider.id,
|
||||
modelId: model.id,
|
||||
})
|
||||
expect(agent2Duplicate!.user.image).toBe('files/avatars/avatar-2.webp')
|
||||
expect(agent2Duplicate!.user.image).toBe(agent2!.user.image)
|
||||
|
||||
// 2. Create without avatar (should default to avatar-1)
|
||||
const agentDefault = await svc.createAgent({
|
||||
teamId: team.id,
|
||||
@@ -349,7 +363,7 @@ describe('AgentService', () => {
|
||||
providerId: provider.id,
|
||||
modelId: model.id,
|
||||
})
|
||||
expect(agentDefault!.user.image).toMatch(/^files\/[A-Z0-9]{26}\.webp$/)
|
||||
expect(agentDefault!.user.image).toBe('files/avatars/avatar-1.webp')
|
||||
expect((agentDefault!.config as unknown as PrismaJson.AgentConfig).avatarPreset).toBe(
|
||||
'avatar-1',
|
||||
)
|
||||
@@ -368,7 +382,7 @@ describe('AgentService', () => {
|
||||
providerId: provider.id,
|
||||
modelId: model.id,
|
||||
})
|
||||
expect(updatedPreset.user.image).toMatch(/^files\/[A-Z0-9]{26}\.webp$/)
|
||||
expect(updatedPreset.user.image).toBe('files/avatars/avatar-3.webp')
|
||||
expect(updatedPreset.user.image).not.toBe(initialKey)
|
||||
expect((updatedPreset.config as unknown as PrismaJson.AgentConfig).avatarPreset).toBe(
|
||||
'avatar-3',
|
||||
@@ -407,6 +421,19 @@ describe('AgentService', () => {
|
||||
(updatedPresigned.config as unknown as PrismaJson.AgentConfig).avatarPreset,
|
||||
).toBeUndefined()
|
||||
|
||||
// 4b. Update with presigned URL pointing to a preset avatar path
|
||||
const updatedPresignedPreset = await svc.updateAgent({
|
||||
agentId: agent2!.id,
|
||||
name: 'Agent Presigned Preset',
|
||||
type: 'chat',
|
||||
enabled: true,
|
||||
thinkingLevel: 'off',
|
||||
avatar: 'https://shumai.s3.amazonaws.com/files/avatars/avatar-2.webp?foo=bar',
|
||||
providerId: provider.id,
|
||||
modelId: model.id,
|
||||
})
|
||||
expect(updatedPresignedPreset.user.image).toBe('files/avatars/avatar-2.webp')
|
||||
|
||||
// 5. Update without avatar specified (avatar undefined) - preserves image
|
||||
const updatedWithoutAvatar = await svc.updateAgent({
|
||||
agentId: agent2!.id,
|
||||
@@ -417,7 +444,7 @@ describe('AgentService', () => {
|
||||
providerId: provider.id,
|
||||
modelId: model.id,
|
||||
})
|
||||
expect(updatedWithoutAvatar.user.image).toBe('files/01JK23456789ABCDEF01234567.webp')
|
||||
expect(updatedWithoutAvatar.user.image).toBe('files/avatars/avatar-2.webp')
|
||||
})
|
||||
|
||||
test('Delete Agent', async () => {
|
||||
|
||||
@@ -19,8 +19,7 @@ import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { getAvatarUrl } from '@shumai/core/src/user/avatar'
|
||||
import { resolveEffectiveRole } from '@shumai/core/src/authz/authz'
|
||||
import { getAllowedAgentRoles } from './permissions'
|
||||
import { ulid } from 'ulid'
|
||||
import { isPresetAvatarId, getPresetAvatarBuffer } from './presets'
|
||||
import { isPresetAvatarId, getPresetAvatarBuffer, getPresetAvatarStorageKey } from './presets'
|
||||
import AdmZip from 'adm-zip'
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
@@ -50,7 +49,9 @@ interface AgentInfoSource {
|
||||
|
||||
function extractS3Key(urlOrKey?: string | null): string | null | undefined {
|
||||
if (!urlOrKey) return urlOrKey
|
||||
const match = urlOrKey.match(/files\/[A-Z0-9]{26}(\.[a-zA-Z0-9]+)?/)
|
||||
const match = urlOrKey.match(
|
||||
/(files\/avatars\/[a-zA-Z0-9_-]+\.webp|files\/[A-Z0-9]{26}(\.[a-zA-Z0-9]+)?)/,
|
||||
)
|
||||
return match ? match[0] : urlOrKey
|
||||
}
|
||||
|
||||
@@ -190,7 +191,7 @@ export class AgentService {
|
||||
const buffer = getPresetAvatarBuffer(targetAvatar)
|
||||
if (buffer) {
|
||||
const bucket = process.env.S3_BUCKET || 'shumai'
|
||||
const key = `files/${ulid()}.webp`
|
||||
const key = getPresetAvatarStorageKey(targetAvatar)
|
||||
await s3Service.putObject(bucket, key, buffer, buffer.length, 'image/webp')
|
||||
imageKey = key
|
||||
}
|
||||
@@ -335,7 +336,7 @@ export class AgentService {
|
||||
const buffer = getPresetAvatarBuffer(avatar)
|
||||
if (buffer) {
|
||||
const bucket = process.env.S3_BUCKET || 'shumai'
|
||||
const key = `files/${ulid()}.webp`
|
||||
const key = getPresetAvatarStorageKey(avatar)
|
||||
await s3Service.putObject(bucket, key, buffer, buffer.length, 'image/webp')
|
||||
imageKey = key
|
||||
newAvatarPreset = avatar
|
||||
|
||||
@@ -88,7 +88,7 @@ describe('migrateLegacyAgentAvatars', () => {
|
||||
const updatedAgent = await prisma.user.findUnique({
|
||||
where: { id: agentUser.id },
|
||||
})
|
||||
expect(updatedAgent?.image).toMatch(/^files\/[A-Z0-9]{26}\.webp$/)
|
||||
expect(updatedAgent?.image).toBe('files/avatars/avatar-1.webp')
|
||||
|
||||
const updatedAgentRecord = await prisma.agent.findUnique({
|
||||
where: { id: agentUser.id },
|
||||
|
||||
@@ -2,7 +2,12 @@ import { prisma } from '@shumai/db'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { logger } from '@shumai/core/src/logger'
|
||||
import { ulid } from 'ulid'
|
||||
import { PRESET_AVATAR_IDS, getPresetAvatarBuffer } from './presets'
|
||||
import {
|
||||
PRESET_AVATAR_IDS,
|
||||
getPresetAvatarBuffer,
|
||||
getPresetAvatarStorageKey,
|
||||
type PresetAvatarId,
|
||||
} from './presets'
|
||||
|
||||
export async function migrateLegacyAgentAvatars(
|
||||
client: typeof prisma = prisma,
|
||||
@@ -58,7 +63,9 @@ export async function migrateLegacyAgentAvatars(
|
||||
}
|
||||
}
|
||||
|
||||
const key = `files/${ulid()}.${ext}`
|
||||
const key = matchedPresetId
|
||||
? getPresetAvatarStorageKey(matchedPresetId as PresetAvatarId)
|
||||
: `files/${ulid()}.${ext}`
|
||||
await s3Service.putObject(bucket, key, buffer, buffer.length, contentType)
|
||||
|
||||
await client.user.update({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
getPresetAvatarBuffer,
|
||||
getPresetAvatarStorageKey,
|
||||
isPresetAvatarId,
|
||||
PRESET_AVATAR_IDS,
|
||||
type PresetAvatarId,
|
||||
@@ -27,6 +28,12 @@ describe('agent presets', () => {
|
||||
expect(getPresetAvatarBuffer('unknown' as PresetAvatarId)).toBeNull()
|
||||
})
|
||||
|
||||
it('returns deterministic storage key for preset avatars', () => {
|
||||
for (const id of PRESET_AVATAR_IDS) {
|
||||
expect(getPresetAvatarStorageKey(id)).toBe(`files/avatars/${id}.webp`)
|
||||
}
|
||||
})
|
||||
|
||||
it('provides AVAILABLE_AVATARS with 8 previews via dtos', async () => {
|
||||
const { AVAILABLE_AVATARS } = await import('@shumai/dtos')
|
||||
expect(AVAILABLE_AVATARS).toHaveLength(8)
|
||||
|
||||
@@ -7,6 +7,10 @@ import {
|
||||
|
||||
export { PRESET_AVATAR_IDS, type PresetAvatarId, isPresetAvatarId }
|
||||
|
||||
export function getPresetAvatarStorageKey(id: PresetAvatarId): string {
|
||||
return `files/avatars/${id}.webp`
|
||||
}
|
||||
|
||||
const bufferCache = new Map<PresetAvatarId, Buffer>()
|
||||
|
||||
export function getPresetAvatarBuffer(id: PresetAvatarId): Buffer | null {
|
||||
|
||||
@@ -9,6 +9,8 @@ import { uploadService } from '@shumai/core/src/upload/upload'
|
||||
import { metadataService } from '@shumai/core/src/metadata/metadata'
|
||||
import { AssetService } from './asset'
|
||||
|
||||
import { ensureJpegInStorage } from '@shumai/core/src/s3/preview-converter'
|
||||
|
||||
vi.mock('@shumai/core/src/s3/s3', () => ({
|
||||
s3Service: {
|
||||
presign: vi.fn().mockResolvedValue('http://mock-s3-url'),
|
||||
@@ -19,6 +21,14 @@ vi.mock('@shumai/core/src/s3/s3', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('@shumai/core/src/s3/preview-converter', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import('@shumai/core/src/s3/preview-converter')>()
|
||||
return {
|
||||
...actual,
|
||||
ensureJpegInStorage: vi.fn().mockResolvedValue(undefined),
|
||||
}
|
||||
})
|
||||
|
||||
describe('AssetService', () => {
|
||||
setupTestDbHooks()
|
||||
|
||||
@@ -1117,6 +1127,189 @@ describe('AssetService', () => {
|
||||
expect(incompleted.completionLastChangedBy?.id).toBe(user.id)
|
||||
})
|
||||
|
||||
describe('Comment Reactions', () => {
|
||||
it('adds, removes, and lists reactions chronologically with creatorNames', async () => {
|
||||
const { user, assets } = await setupBasicAssets()
|
||||
|
||||
const user2 = await prisma.user.create({
|
||||
data: {
|
||||
name: 'Bob',
|
||||
type: 'human',
|
||||
email: `bob-${Date.now()}@example.com`,
|
||||
},
|
||||
})
|
||||
|
||||
const user3 = await prisma.user.create({
|
||||
data: {
|
||||
name: 'Charlie',
|
||||
type: 'human',
|
||||
email: `charlie-${Date.now()}@example.com`,
|
||||
},
|
||||
})
|
||||
|
||||
const comment = await assetService.createComment({
|
||||
assetId: assets.fileA1.id,
|
||||
userId: user.id,
|
||||
message: 'A wonderful comment',
|
||||
attachmentIds: [],
|
||||
})
|
||||
|
||||
// Add reaction 1: Bob adds 👍
|
||||
await assetService.addCommentReaction(comment.id, user2.id, '👍')
|
||||
// Idempotency: Bob adds 👍 again
|
||||
await assetService.addCommentReaction(comment.id, user2.id, '👍')
|
||||
|
||||
// Add reaction 2: Charlie adds ❤️
|
||||
await assetService.addCommentReaction(comment.id, user3.id, '❤️')
|
||||
|
||||
// Add reaction 3: Alice (user) adds 👍
|
||||
await assetService.addCommentReaction(comment.id, user.id, '👍')
|
||||
|
||||
// Fetch as user (Alice)
|
||||
const commentAsAlice = await assetService.getComment(comment.id, user.id)
|
||||
expect(commentAsAlice.reactionCounts).toHaveLength(2)
|
||||
|
||||
// First reaction added was 👍, then ❤️
|
||||
expect(commentAsAlice.reactionCounts[0].code).toBe('👍')
|
||||
expect(commentAsAlice.reactionCounts[0].count).toBe(2)
|
||||
expect(commentAsAlice.reactionCounts[0].requestingUserReacted).toBe(true)
|
||||
expect(commentAsAlice.reactionCounts[0].creatorNames).toEqual(['Bob'])
|
||||
|
||||
expect(commentAsAlice.reactionCounts[1].code).toBe('❤️')
|
||||
expect(commentAsAlice.reactionCounts[1].count).toBe(1)
|
||||
expect(commentAsAlice.reactionCounts[1].requestingUserReacted).toBe(false)
|
||||
expect(commentAsAlice.reactionCounts[1].creatorNames).toEqual(['Charlie'])
|
||||
|
||||
// Fetch as Bob
|
||||
const commentAsBob = await assetService.getComment(comment.id, user2.id)
|
||||
expect(commentAsBob.reactionCounts[0].code).toBe('👍')
|
||||
expect(commentAsBob.reactionCounts[0].requestingUserReacted).toBe(true)
|
||||
expect(commentAsBob.reactionCounts[0].creatorNames).toEqual([user.name])
|
||||
|
||||
// Remove Alice's 👍
|
||||
await assetService.removeCommentReaction(comment.id, user.id, '👍')
|
||||
// Idempotency
|
||||
await assetService.removeCommentReaction(comment.id, user.id, '👍')
|
||||
|
||||
const updatedAlice = await assetService.getComment(comment.id, user.id)
|
||||
expect(updatedAlice.reactionCounts[0].code).toBe('👍')
|
||||
expect(updatedAlice.reactionCounts[0].count).toBe(1)
|
||||
expect(updatedAlice.reactionCounts[0].requestingUserReacted).toBe(false)
|
||||
expect(updatedAlice.reactionCounts[0].creatorNames).toEqual(['Bob'])
|
||||
|
||||
// Verify listComments returns reactions for comments and replies
|
||||
const reply = await assetService.createComment({
|
||||
assetId: assets.fileA1.id,
|
||||
userId: user2.id,
|
||||
message: 'A nice reply',
|
||||
replyToId: comment.id,
|
||||
attachmentIds: [],
|
||||
})
|
||||
await assetService.addCommentReaction(reply.id, user.id, '🎉')
|
||||
|
||||
const listRes = await assetService.listComments(assets.fileA1.id, { first: 10 }, user.id)
|
||||
const listedComment = listRes.data.find((c) => c.id === comment.id)
|
||||
expect(listedComment).toBeDefined()
|
||||
expect(listedComment?.reactionCounts[0].code).toBe('👍')
|
||||
expect(listedComment?.replies).toHaveLength(1)
|
||||
expect(listedComment?.replies[0].reactionCounts).toHaveLength(1)
|
||||
expect(listedComment?.replies[0].reactionCounts[0].code).toBe('🎉')
|
||||
expect(listedComment?.replies[0].reactionCounts[0].requestingUserReacted).toBe(true)
|
||||
})
|
||||
|
||||
it('throws error when adding reaction to nonexistent comment', async () => {
|
||||
const { user } = await setupBasicAssets()
|
||||
await expect(
|
||||
assetService.addCommentReaction('nonexistent-id', user.id, '👍'),
|
||||
).rejects.toThrow('Comment not found')
|
||||
})
|
||||
})
|
||||
|
||||
it('can export comments in all supported NLE formats', async () => {
|
||||
const { user, assets } = await setupBasicAssets()
|
||||
|
||||
// Update asset media metadata with video frameRate and duration
|
||||
await prisma.asset.update({
|
||||
where: { id: assets.fileA1.id },
|
||||
data: {
|
||||
media: {
|
||||
duration: 10,
|
||||
filesize: 1024,
|
||||
frames: 240,
|
||||
finishedAt: new Date().toISOString(),
|
||||
imageTranscodes: [],
|
||||
videoTranscodes: [],
|
||||
metadata: {
|
||||
frameRate: 24,
|
||||
duration: 10,
|
||||
totalFrames: 240,
|
||||
originalWidth: 1920,
|
||||
originalHeight: 1080,
|
||||
hasAudio: true,
|
||||
bitRate: 5000,
|
||||
startTimecode: '00:00:00:00',
|
||||
format: 'mp4',
|
||||
},
|
||||
original: null,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
const rootComment = await assetService.createComment({
|
||||
assetId: assets.fileA1.id,
|
||||
userId: user.id,
|
||||
message: 'First scene looks great',
|
||||
second: 2.5,
|
||||
attachmentIds: [],
|
||||
})
|
||||
|
||||
await assetService.createComment({
|
||||
assetId: assets.fileA1.id,
|
||||
userId: user.id,
|
||||
message: 'Agreed!',
|
||||
replyToId: rootComment.id,
|
||||
attachmentIds: [],
|
||||
})
|
||||
|
||||
await assetService.createComment({
|
||||
assetId: assets.fileA1.id,
|
||||
userId: user.id,
|
||||
message: 'General feedback without timestamp',
|
||||
attachmentIds: [],
|
||||
})
|
||||
|
||||
// Test resolve-edl
|
||||
const edl = await assetService.exportComments(assets.fileA1.id, 'resolve-edl')
|
||||
expect(edl.filename.endsWith('_resolve.edl')).toBe(true)
|
||||
expect(edl.mimeType).toBe('text/plain; charset=utf-8')
|
||||
expect(edl.content).toContain('TITLE:')
|
||||
expect(edl.content).toContain('First scene looks great')
|
||||
expect(edl.content).toContain('^ Agreed!')
|
||||
expect(edl.content).toContain('General feedback without timestamp')
|
||||
|
||||
// Test premiere-xml
|
||||
const ppro = await assetService.exportComments(assets.fileA1.id, 'premiere-xml')
|
||||
expect(ppro.filename.endsWith('_premiere.xml')).toBe(true)
|
||||
expect(ppro.mimeType).toBe('application/xml; charset=utf-8')
|
||||
expect(ppro.content).toContain('<xmeml version="4">')
|
||||
expect(ppro.content).toContain('<comment>First scene looks great</comment>')
|
||||
expect(ppro.content).toContain('<comment>Agreed!</comment>')
|
||||
|
||||
// Test media-composer-xml
|
||||
const mc = await assetService.exportComments(assets.fileA1.id, 'media-composer-xml')
|
||||
expect(mc.filename.endsWith('_media-composer.xml')).toBe(true)
|
||||
expect(mc.mimeType).toBe('application/xml; charset=utf-8')
|
||||
expect(mc.content).toContain('<Avid:StreamItems')
|
||||
expect(mc.content).toContain('First scene looks great')
|
||||
|
||||
// Test fcp-fiojson
|
||||
const fcp = await assetService.exportComments(assets.fileA1.id, 'fcp-fiojson')
|
||||
expect(fcp.filename.endsWith('.fiojson')).toBe(true)
|
||||
expect(fcp.mimeType).toBe('application/json; charset=utf-8')
|
||||
const parsedFcp = JSON.parse(fcp.content) as { comments: unknown[] }
|
||||
expect(parsedFcp.comments.length).toBe(3)
|
||||
})
|
||||
|
||||
it('triggers AI workflow on bot mention', async () => {
|
||||
const { user, project } = await setupBasicAssets()
|
||||
|
||||
@@ -1735,6 +1928,146 @@ describe('AssetService', () => {
|
||||
expect(info.preview).toBeDefined()
|
||||
expect(info.preview?.duration).toBeUndefined()
|
||||
})
|
||||
|
||||
it('converts webp thumbnail to jpeg on demand when hasJpegPreview is false', async () => {
|
||||
vi.mocked(ensureJpegInStorage).mockClear()
|
||||
const { project, user } = await setupBasicAssets()
|
||||
|
||||
const image = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'photo.webp',
|
||||
type: AssetType.file,
|
||||
projectId: project.id,
|
||||
creatorId: user.id,
|
||||
sizeByte: 2000,
|
||||
mediaType: 'image/webp',
|
||||
status: 'processed',
|
||||
hasJpegPreview: false,
|
||||
media: {
|
||||
proxyType: 'image',
|
||||
thumbnail: { key: 'shumai/files/1/thumb.webp' },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any,
|
||||
},
|
||||
})
|
||||
|
||||
const preview = await assetService.toPreviewInfo(image, 'jpeg')
|
||||
|
||||
expect(preview).toBeDefined()
|
||||
expect(ensureJpegInStorage).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'shumai/files/1/thumb.webp',
|
||||
'shumai/files/1/thumb.jpeg',
|
||||
)
|
||||
expect(s3Service.presign).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'shumai/files/1/thumb.jpeg',
|
||||
'GET',
|
||||
)
|
||||
|
||||
const updated = await prisma.asset.findUnique({ where: { id: image.id } })
|
||||
expect(updated?.hasJpegPreview).toBe(true)
|
||||
})
|
||||
|
||||
it('skips conversion when hasJpegPreview is already true', async () => {
|
||||
vi.mocked(ensureJpegInStorage).mockClear()
|
||||
const { project, user } = await setupBasicAssets()
|
||||
|
||||
const image = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'photo-converted.webp',
|
||||
type: AssetType.file,
|
||||
projectId: project.id,
|
||||
creatorId: user.id,
|
||||
sizeByte: 2000,
|
||||
mediaType: 'image/webp',
|
||||
status: 'processed',
|
||||
hasJpegPreview: true,
|
||||
media: {
|
||||
proxyType: 'image',
|
||||
thumbnail: { key: 'shumai/files/2/thumb.webp' },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any,
|
||||
},
|
||||
})
|
||||
|
||||
const preview = await assetService.toPreviewInfo(image, 'jpeg')
|
||||
|
||||
expect(preview).toBeDefined()
|
||||
expect(ensureJpegInStorage).not.toHaveBeenCalled()
|
||||
expect(s3Service.presign).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'shumai/files/2/thumb.jpeg',
|
||||
'GET',
|
||||
)
|
||||
})
|
||||
|
||||
it('gracefully falls back to webp when conversion fails', async () => {
|
||||
vi.mocked(ensureJpegInStorage).mockRejectedValueOnce(new Error('Sharp conversion failed'))
|
||||
const { project, user } = await setupBasicAssets()
|
||||
|
||||
const image = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'failing.webp',
|
||||
type: AssetType.file,
|
||||
projectId: project.id,
|
||||
creatorId: user.id,
|
||||
sizeByte: 2000,
|
||||
mediaType: 'image/webp',
|
||||
status: 'processed',
|
||||
hasJpegPreview: false,
|
||||
media: {
|
||||
proxyType: 'image',
|
||||
thumbnail: { key: 'shumai/files/3/thumb.webp' },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any,
|
||||
},
|
||||
})
|
||||
|
||||
const preview = await assetService.toPreviewInfo(image, 'jpeg')
|
||||
|
||||
expect(preview).toBeDefined()
|
||||
expect(s3Service.presign).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'shumai/files/3/thumb.webp',
|
||||
'GET',
|
||||
)
|
||||
|
||||
const updated = await prisma.asset.findUnique({ where: { id: image.id } })
|
||||
expect(updated?.hasJpegPreview).toBe(false)
|
||||
})
|
||||
|
||||
it('listAssetsByIds forwards previewFormat and converts preview', async () => {
|
||||
vi.mocked(ensureJpegInStorage).mockClear()
|
||||
const { project, user } = await setupBasicAssets()
|
||||
|
||||
const image = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'list-photo.webp',
|
||||
type: AssetType.file,
|
||||
projectId: project.id,
|
||||
creatorId: user.id,
|
||||
sizeByte: 2000,
|
||||
mediaType: 'image/webp',
|
||||
status: 'processed',
|
||||
hasJpegPreview: false,
|
||||
media: {
|
||||
proxyType: 'image',
|
||||
thumbnail: { key: 'shumai/files/4/thumb.webp' },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any,
|
||||
},
|
||||
})
|
||||
|
||||
const list = await assetService.listAssetsByIds([image.id], 'jpeg')
|
||||
|
||||
expect(list).toHaveLength(1)
|
||||
expect(ensureJpegInStorage).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'shumai/files/4/thumb.webp',
|
||||
'shumai/files/4/thumb.jpeg',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Symlinks', () => {
|
||||
@@ -4335,4 +4668,194 @@ describe('AssetService — natural sort by name', () => {
|
||||
expect(folderRes.data.length).toBe(1)
|
||||
})
|
||||
})
|
||||
|
||||
describe('commentsCount in toAssetInfos', () => {
|
||||
it('returns commentsCount 0 when file has no comments', async () => {
|
||||
const team = await prisma.team.create({ data: { name: 'Test Team' } })
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Test Project', teamId: team.id },
|
||||
})
|
||||
const rootFolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'root',
|
||||
type: AssetType.folder,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'Test User', email: `test-${Date.now()}@example.com` },
|
||||
})
|
||||
|
||||
const file = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'file.mp4',
|
||||
type: AssetType.file,
|
||||
projectId: project.id,
|
||||
parentId: rootFolder.id,
|
||||
creatorId: user.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
|
||||
const res = await assetService.listChildren({
|
||||
assetId: rootFolder.id,
|
||||
assetType: 'file',
|
||||
})
|
||||
const fileInfo = res.data.find((a) => a.id === file.id)
|
||||
expect(fileInfo).toBeDefined()
|
||||
expect(fileInfo?.commentsCount).toBe(0)
|
||||
})
|
||||
|
||||
it('returns total comments count including replies for a file', async () => {
|
||||
const team = await prisma.team.create({ data: { name: 'Test Team' } })
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Test Project', teamId: team.id },
|
||||
})
|
||||
const rootFolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'root',
|
||||
type: AssetType.folder,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'Test User', email: `test-${Date.now()}@example.com` },
|
||||
})
|
||||
|
||||
const file = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'video.mp4',
|
||||
type: AssetType.file,
|
||||
projectId: project.id,
|
||||
parentId: rootFolder.id,
|
||||
creatorId: user.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
|
||||
const rootComment = await prisma.assetComment.create({
|
||||
data: {
|
||||
assetId: file.id,
|
||||
creatorId: user.id,
|
||||
message: 'Root comment 1',
|
||||
},
|
||||
})
|
||||
|
||||
await prisma.assetComment.create({
|
||||
data: {
|
||||
assetId: file.id,
|
||||
creatorId: user.id,
|
||||
message: 'Reply to comment 1',
|
||||
replyToId: rootComment.id,
|
||||
},
|
||||
})
|
||||
|
||||
await prisma.assetComment.create({
|
||||
data: {
|
||||
assetId: file.id,
|
||||
creatorId: user.id,
|
||||
message: 'Root comment 2',
|
||||
},
|
||||
})
|
||||
|
||||
const res = await assetService.listChildren({
|
||||
assetId: rootFolder.id,
|
||||
assetType: 'file',
|
||||
})
|
||||
const fileInfo = res.data.find((a) => a.id === file.id)
|
||||
expect(fileInfo).toBeDefined()
|
||||
expect(fileInfo?.commentsCount).toBe(3)
|
||||
})
|
||||
|
||||
it('returns comments count of the active version for version stack', async () => {
|
||||
const team = await prisma.team.create({ data: { name: 'Test Team' } })
|
||||
const project = await prisma.project.create({
|
||||
data: { name: 'Test Project', teamId: team.id },
|
||||
})
|
||||
const rootFolder = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'root',
|
||||
type: AssetType.folder,
|
||||
projectId: project.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'Test User', email: `test-${Date.now()}@example.com` },
|
||||
})
|
||||
|
||||
const stack = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'video_stack',
|
||||
type: AssetType.version_stack,
|
||||
projectId: project.id,
|
||||
parentId: rootFolder.id,
|
||||
creatorId: user.id,
|
||||
status: AssetStatus.uploaded,
|
||||
},
|
||||
})
|
||||
|
||||
// Older version (v1): larger sortIndex
|
||||
const fileV1 = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'video_v1.mp4',
|
||||
type: AssetType.file,
|
||||
projectId: project.id,
|
||||
parentId: stack.id,
|
||||
creatorId: user.id,
|
||||
status: AssetStatus.uploaded,
|
||||
sortIndex: 'b',
|
||||
},
|
||||
})
|
||||
|
||||
// Active / latest version (v2): smaller sortIndex
|
||||
const fileV2 = await prisma.asset.create({
|
||||
data: {
|
||||
name: 'video_v2.mp4',
|
||||
type: AssetType.file,
|
||||
projectId: project.id,
|
||||
parentId: stack.id,
|
||||
creatorId: user.id,
|
||||
status: AssetStatus.uploaded,
|
||||
sortIndex: 'a',
|
||||
},
|
||||
})
|
||||
|
||||
// Add 2 comments to v1
|
||||
await prisma.assetComment.create({
|
||||
data: {
|
||||
assetId: fileV1.id,
|
||||
creatorId: user.id,
|
||||
message: 'Comment on v1',
|
||||
},
|
||||
})
|
||||
await prisma.assetComment.create({
|
||||
data: {
|
||||
assetId: fileV1.id,
|
||||
creatorId: user.id,
|
||||
message: 'Another comment on v1',
|
||||
},
|
||||
})
|
||||
|
||||
// Add 1 comment to v2 (active version)
|
||||
await prisma.assetComment.create({
|
||||
data: {
|
||||
assetId: fileV2.id,
|
||||
creatorId: user.id,
|
||||
message: 'Comment on v2',
|
||||
},
|
||||
})
|
||||
|
||||
const res = await assetService.listChildren({
|
||||
assetId: rootFolder.id,
|
||||
assetType: 'file',
|
||||
})
|
||||
const stackInfo = res.data.find((a) => a.id === stack.id)
|
||||
expect(stackInfo).toBeDefined()
|
||||
// Should reflect active version (v2) comments count
|
||||
expect(stackInfo?.commentsCount).toBe(1)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
AttachmentInfo,
|
||||
ChildPreview,
|
||||
CommentInfo,
|
||||
CommentReactionCount,
|
||||
CopyAssetsRequest,
|
||||
CreateAssetRequest,
|
||||
CreateCommentRequest,
|
||||
@@ -17,12 +18,26 @@ import {
|
||||
UpdateAssetOrderRequest,
|
||||
AssetUserInfo,
|
||||
ListRecentsRequest,
|
||||
CommentExportFormat,
|
||||
PreviewFormat,
|
||||
} from '@shumai/dtos'
|
||||
import {
|
||||
exportCommentsToFormat,
|
||||
type ExportAssetMetadata,
|
||||
type ExportCommentItem,
|
||||
type ExportOptions,
|
||||
type ExportResult,
|
||||
} from './comments-export'
|
||||
import { type Asset, AssetStatus, AssetType, Prisma, type StorageKey } from '@shumai/db'
|
||||
import { HTTPException } from 'hono/http-exception'
|
||||
import { logger } from '@shumai/core/src/logger'
|
||||
import { PaginatedData, paginateQuery, PaginationParams } from '@shumai/core/src/pagination'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import {
|
||||
ensureJpegInStorage,
|
||||
getJpegKeyForWebp,
|
||||
isWebpKey,
|
||||
} from '@shumai/core/src/s3/preview-converter'
|
||||
import { dedupeSymlinksToTarget } from './symlink'
|
||||
import { watermarkService } from '@shumai/core/src/watermark/watermark'
|
||||
import { generateKeyBetween } from 'jittered-fractional-indexing'
|
||||
@@ -78,11 +93,21 @@ type CommentWithIncludes = Prisma.AssetCommentGetPayload<{
|
||||
creator: true
|
||||
completionLastChangedBy: true
|
||||
attachments: { include: { asset: { include: { storageKey: true } } } }
|
||||
reactions: {
|
||||
include: {
|
||||
user: { select: { id: true; name: true } }
|
||||
}
|
||||
}
|
||||
replies: {
|
||||
include: {
|
||||
creator: true
|
||||
completionLastChangedBy: true
|
||||
attachments: { include: { asset: { include: { storageKey: true } } } }
|
||||
reactions: {
|
||||
include: {
|
||||
user: { select: { id: true; name: true } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,7 +139,7 @@ export class AssetService {
|
||||
return [folderId, ...ids]
|
||||
}
|
||||
|
||||
async listAssetsByIds(ids: string[]): Promise<AssetInfo[]> {
|
||||
async listAssetsByIds(ids: string[], previewFormat?: PreviewFormat): Promise<AssetInfo[]> {
|
||||
if (ids.length === 0) return []
|
||||
|
||||
const assets = await this.prismaClient.asset.findMany({
|
||||
@@ -126,7 +151,7 @@ export class AssetService {
|
||||
const orderedAssets = ids
|
||||
.map((id) => assetMap.get(id))
|
||||
.filter((a): a is AssetWithIncludes => !!a)
|
||||
const orderedInfos = await this.toAssetInfos(orderedAssets)
|
||||
const orderedInfos = await this.toAssetInfos(orderedAssets, previewFormat)
|
||||
|
||||
return orderedInfos
|
||||
}
|
||||
@@ -1699,10 +1724,10 @@ export class AssetService {
|
||||
}
|
||||
})
|
||||
|
||||
return this.getComment(commentId)
|
||||
return this.getComment(commentId, req.userId)
|
||||
}
|
||||
|
||||
async getComment(commentId: string): Promise<CommentInfo> {
|
||||
async getComment(commentId: string, requestingUserId?: string): Promise<CommentInfo> {
|
||||
const c = await this.prismaClient.assetComment.findUnique({
|
||||
where: { id: commentId },
|
||||
include: {
|
||||
@@ -1710,18 +1735,65 @@ export class AssetService {
|
||||
completionLastChangedBy: true,
|
||||
asset: { include: { storageKey: true } },
|
||||
attachments: { include: { asset: { include: { storageKey: true } } } },
|
||||
reactions: {
|
||||
include: {
|
||||
user: { select: { id: true, name: true } },
|
||||
},
|
||||
orderBy: { createdAt: 'asc' },
|
||||
},
|
||||
replies: {
|
||||
include: {
|
||||
creator: true,
|
||||
completionLastChangedBy: true,
|
||||
attachments: { include: { asset: { include: { storageKey: true } } } },
|
||||
reactions: {
|
||||
include: {
|
||||
user: { select: { id: true, name: true } },
|
||||
},
|
||||
orderBy: { createdAt: 'asc' },
|
||||
},
|
||||
},
|
||||
orderBy: { id: 'asc' },
|
||||
},
|
||||
},
|
||||
})
|
||||
if (!c) throw new Error('Comment not found')
|
||||
return this.toCommentInfo(c)
|
||||
return this.toCommentInfo(c, requestingUserId)
|
||||
}
|
||||
|
||||
async addCommentReaction(commentId: string, userId: string, code: string): Promise<void> {
|
||||
const comment = await this.prismaClient.assetComment.findUnique({
|
||||
where: { id: commentId },
|
||||
select: { id: true },
|
||||
})
|
||||
if (!comment) throw new Error('Comment not found')
|
||||
|
||||
await this.prismaClient.assetCommentReaction.upsert({
|
||||
where: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
commentId_userId_code: {
|
||||
commentId,
|
||||
userId,
|
||||
code,
|
||||
},
|
||||
},
|
||||
create: {
|
||||
commentId,
|
||||
userId,
|
||||
code,
|
||||
},
|
||||
update: {},
|
||||
})
|
||||
}
|
||||
|
||||
async removeCommentReaction(commentId: string, userId: string, code: string): Promise<void> {
|
||||
await this.prismaClient.assetCommentReaction.deleteMany({
|
||||
where: {
|
||||
commentId,
|
||||
userId,
|
||||
code,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
async completeComment(
|
||||
@@ -1736,7 +1808,7 @@ export class AssetService {
|
||||
completionLastChangedById: userId,
|
||||
},
|
||||
})
|
||||
return this.getComment(commentId)
|
||||
return this.getComment(commentId, userId)
|
||||
}
|
||||
|
||||
async deleteComment({ commentId, userId }: { commentId: string; userId: string }): Promise<void> {
|
||||
@@ -1827,6 +1899,7 @@ export class AssetService {
|
||||
async listComments(
|
||||
assetId: string,
|
||||
params: PaginationParams,
|
||||
requestingUserId?: string,
|
||||
): Promise<PaginatedData<CommentInfo[]>> {
|
||||
const resolvedAssetId = await this.resolveLatestVersionId(assetId)
|
||||
|
||||
@@ -1839,11 +1912,23 @@ export class AssetService {
|
||||
completionLastChangedBy: true,
|
||||
asset: { include: { storageKey: true } },
|
||||
attachments: { include: { asset: { include: { storageKey: true } } } },
|
||||
reactions: {
|
||||
include: {
|
||||
user: { select: { id: true, name: true } },
|
||||
},
|
||||
orderBy: { createdAt: 'asc' },
|
||||
},
|
||||
replies: {
|
||||
include: {
|
||||
creator: true,
|
||||
completionLastChangedBy: true,
|
||||
attachments: { include: { asset: { include: { storageKey: true } } } },
|
||||
reactions: {
|
||||
include: {
|
||||
user: { select: { id: true, name: true } },
|
||||
},
|
||||
orderBy: { createdAt: 'asc' },
|
||||
},
|
||||
},
|
||||
orderBy: { id: 'asc' },
|
||||
},
|
||||
@@ -1857,12 +1942,110 @@ export class AssetService {
|
||||
params,
|
||||
)
|
||||
|
||||
const infos = await Promise.all(comments.map((c) => this.toCommentInfo(c)))
|
||||
const infos = await Promise.all(comments.map((c) => this.toCommentInfo(c, requestingUserId)))
|
||||
|
||||
return { data: infos, pageInfo }
|
||||
}
|
||||
|
||||
async toAssetInfos(assets: AssetWithIncludes[]): Promise<AssetInfo[]> {
|
||||
async exportComments(
|
||||
assetId: string,
|
||||
format: CommentExportFormat,
|
||||
options?: ExportOptions,
|
||||
): Promise<ExportResult> {
|
||||
const resolvedAssetId = await this.resolveLatestVersionId(assetId)
|
||||
|
||||
const asset = await this.prismaClient.asset.findUnique({
|
||||
where: { id: resolvedAssetId },
|
||||
include: {
|
||||
creator: true,
|
||||
},
|
||||
})
|
||||
|
||||
if (!asset) {
|
||||
throw new HTTPException(404, { message: 'Asset not found' })
|
||||
}
|
||||
|
||||
const rawComments = await this.prismaClient.assetComment.findMany({
|
||||
where: { assetId: resolvedAssetId, replyToId: null },
|
||||
include: {
|
||||
creator: true,
|
||||
replies: {
|
||||
include: {
|
||||
creator: true,
|
||||
},
|
||||
orderBy: { id: 'asc' },
|
||||
},
|
||||
},
|
||||
orderBy: { id: 'asc' },
|
||||
})
|
||||
|
||||
const comments: ExportCommentItem[] = await Promise.all(
|
||||
rawComments.map(async (c) => {
|
||||
const creatorImage = c.creator ? await getAvatarUrl(c.creator.image) : null
|
||||
const replies: ExportCommentItem[] = await Promise.all(
|
||||
(c.replies || []).map(async (r) => {
|
||||
const replyCreatorImage = r.creator ? await getAvatarUrl(r.creator.image) : null
|
||||
return {
|
||||
id: r.id,
|
||||
message: r.message,
|
||||
second: r.second,
|
||||
createdAt: r.createdAt,
|
||||
isCompleted: r.isCompleted,
|
||||
creator: {
|
||||
id: r.creator?.id || '',
|
||||
name: r.creator?.name || 'Anonymous',
|
||||
image: replyCreatorImage || null,
|
||||
},
|
||||
annotations: r.annotation,
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
||||
return {
|
||||
id: c.id,
|
||||
message: c.message,
|
||||
second: c.second,
|
||||
createdAt: c.createdAt,
|
||||
isCompleted: c.isCompleted,
|
||||
creator: {
|
||||
id: c.creator?.id || '',
|
||||
name: c.creator?.name || 'Anonymous',
|
||||
image: creatorImage || null,
|
||||
},
|
||||
annotations: c.annotation,
|
||||
replies,
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
||||
const media = asset.media as PrismaJson.MediaInfo | null
|
||||
const fps = media?.metadata?.frameRate || 24
|
||||
const duration = media?.metadata?.duration || 0
|
||||
const totalFrames =
|
||||
media?.metadata?.totalFrames || media?.frames || Math.round(duration * fps) || 0
|
||||
const width = media?.metadata?.originalWidth || 1920
|
||||
const height = media?.metadata?.originalHeight || 1080
|
||||
const startTimecode = media?.metadata?.startTimecode || null
|
||||
|
||||
const metadata: ExportAssetMetadata = {
|
||||
id: asset.id,
|
||||
name: asset.name,
|
||||
fps,
|
||||
duration,
|
||||
totalFrames,
|
||||
width,
|
||||
height,
|
||||
startTimecode,
|
||||
rawMedia: media,
|
||||
}
|
||||
|
||||
return exportCommentsToFormat(metadata, comments, format, options)
|
||||
}
|
||||
|
||||
async toAssetInfos(
|
||||
assets: AssetWithIncludes[],
|
||||
previewFormat?: PreviewFormat,
|
||||
): Promise<AssetInfo[]> {
|
||||
const stackIds = new Set<string>()
|
||||
|
||||
for (const a of assets) {
|
||||
@@ -1923,6 +2106,38 @@ export class AssetService {
|
||||
: []
|
||||
const hasAgentMdSet = new Set(agentMdRecords.map((r) => r.assetId))
|
||||
|
||||
const commentTargetIds = new Set<string>()
|
||||
for (const a of assets) {
|
||||
if (
|
||||
a.type === AssetType.version_stack ||
|
||||
(a.type === AssetType.symlink && a.target?.type === AssetType.version_stack)
|
||||
) {
|
||||
const stackId = a.type === AssetType.symlink ? a.targetId! : a.id
|
||||
const versions = versionsMap.get(stackId) || []
|
||||
if (versions.length > 0) {
|
||||
commentTargetIds.add(versions[0].id)
|
||||
} else {
|
||||
commentTargetIds.add(stackId)
|
||||
}
|
||||
} else if (a.type === AssetType.symlink && a.target) {
|
||||
commentTargetIds.add(a.target.id)
|
||||
} else {
|
||||
commentTargetIds.add(a.id)
|
||||
}
|
||||
}
|
||||
|
||||
const commentCounts =
|
||||
commentTargetIds.size > 0
|
||||
? await this.prismaClient.assetComment.groupBy({
|
||||
by: ['assetId'],
|
||||
where: {
|
||||
assetId: { in: Array.from(commentTargetIds) },
|
||||
},
|
||||
_count: { _all: true },
|
||||
})
|
||||
: []
|
||||
const commentCountMap = new Map(commentCounts.map((c) => [c.assetId, c._count._all]))
|
||||
|
||||
const result: AssetInfo[] = []
|
||||
for (const a of assets) {
|
||||
let latestVersion:
|
||||
@@ -1944,7 +2159,7 @@ export class AssetService {
|
||||
id: stackId,
|
||||
versions: await Promise.all(
|
||||
versions.map(async (v, i) => {
|
||||
const preview = await this.toPreviewInfo(v as Asset)
|
||||
const preview = await this.toPreviewInfo(v as Asset, previewFormat)
|
||||
return {
|
||||
version: versions.length - i,
|
||||
current: i === 0,
|
||||
@@ -2002,12 +2217,12 @@ export class AssetService {
|
||||
|
||||
latestChildren.push({
|
||||
type: mediaType,
|
||||
preview: await this.toPreviewInfo(previewAsset),
|
||||
preview: await this.toPreviewInfo(previewAsset, previewFormat),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const preview = await this.toPreviewInfo(latestVersion as Asset)
|
||||
const preview = await this.toPreviewInfo(latestVersion as Asset, previewFormat)
|
||||
|
||||
const creator = latestVersion.creator
|
||||
? {
|
||||
@@ -2104,6 +2319,7 @@ export class AssetService {
|
||||
fieldValues,
|
||||
sortIndex: a.sortIndex,
|
||||
hasAgentsMd: hasAgentMdSet.has(a.id),
|
||||
commentsCount: commentCountMap.get(latestVersion.id) ?? 0,
|
||||
media: media as unknown as AssetInfo['media'],
|
||||
versionStack,
|
||||
})
|
||||
@@ -2167,6 +2383,7 @@ export class AssetService {
|
||||
const assets = await this.prismaClient.asset.findMany({
|
||||
where: { id: { in: assetIds }, isDeleted: false },
|
||||
select: {
|
||||
id: true,
|
||||
projectId: true,
|
||||
type: true,
|
||||
target: { select: { projectId: true } },
|
||||
@@ -2179,6 +2396,16 @@ export class AssetService {
|
||||
if (asset.type === 'symlink' && asset.target?.projectId) {
|
||||
projId = asset.target.projectId
|
||||
}
|
||||
if (!projId) {
|
||||
try {
|
||||
const ctx = await this.getAssetContext(asset.id)
|
||||
if (ctx.projectId) {
|
||||
projId = ctx.projectId
|
||||
}
|
||||
} catch {
|
||||
// ignore if no team/project context
|
||||
}
|
||||
}
|
||||
if (projId) {
|
||||
projectIds.add(projId)
|
||||
}
|
||||
@@ -2397,24 +2624,48 @@ export class AssetService {
|
||||
)
|
||||
}
|
||||
|
||||
async toPreviewInfo(asset: Asset | AssetWithIncludes): Promise<PreviewInfo | null> {
|
||||
async toPreviewInfo(
|
||||
asset: Asset | AssetWithIncludes,
|
||||
previewFormat?: PreviewFormat,
|
||||
): Promise<PreviewInfo | null> {
|
||||
if (!asset.media) return null
|
||||
|
||||
const proxyType = (asset.media?.proxyType || null) as 'image' | 'video' | 'audio' | 'pdf' | null
|
||||
|
||||
let thumbnailUrl = undefined
|
||||
let rawThumbKey: string | undefined
|
||||
if (proxyType === 'image' && asset.media.thumbnail?.key) {
|
||||
thumbnailUrl = await s3Service.presign(
|
||||
process.env.S3_BUCKET || 'shumai',
|
||||
asset.media.thumbnail.key,
|
||||
'GET',
|
||||
)
|
||||
rawThumbKey = asset.media.thumbnail.key
|
||||
} else if (asset.media.poster?.key) {
|
||||
thumbnailUrl = await s3Service.presign(
|
||||
process.env.S3_BUCKET || 'shumai',
|
||||
asset.media.poster.key,
|
||||
'GET',
|
||||
)
|
||||
rawThumbKey = asset.media.poster.key
|
||||
}
|
||||
|
||||
let thumbnailUrl = undefined
|
||||
if (rawThumbKey) {
|
||||
const bucket = process.env.S3_BUCKET || 'shumai'
|
||||
let finalKey = rawThumbKey
|
||||
if (previewFormat === 'jpeg' && isWebpKey(rawThumbKey)) {
|
||||
const targetJpegKey = getJpegKeyForWebp(rawThumbKey)
|
||||
if (asset.hasJpegPreview) {
|
||||
finalKey = targetJpegKey
|
||||
} else {
|
||||
try {
|
||||
await ensureJpegInStorage(bucket, rawThumbKey, targetJpegKey)
|
||||
await this.prismaClient.asset.update({
|
||||
where: { id: asset.id },
|
||||
data: { hasJpegPreview: true },
|
||||
})
|
||||
asset.hasJpegPreview = true
|
||||
finalKey = targetJpegKey
|
||||
} catch (err) {
|
||||
logger.warn(
|
||||
{ err, assetId: asset.id, rawThumbKey },
|
||||
'Failed to ensure JPEG preview for asset, falling back to WebP',
|
||||
)
|
||||
finalKey = rawThumbKey
|
||||
}
|
||||
}
|
||||
}
|
||||
thumbnailUrl = await s3Service.presign(bucket, finalKey, 'GET')
|
||||
}
|
||||
|
||||
let spriteUrl = undefined
|
||||
@@ -2439,11 +2690,12 @@ export class AssetService {
|
||||
|
||||
private async toCommentInfo(
|
||||
c: CommentWithIncludes | CommentWithIncludes['replies'][0],
|
||||
requestingUserId?: string,
|
||||
): Promise<CommentInfo> {
|
||||
const replies: CommentInfo[] = []
|
||||
if ('replies' in c && c.replies) {
|
||||
for (const r of c.replies) {
|
||||
replies.push(await this.toCommentInfo(r))
|
||||
replies.push(await this.toCommentInfo(r, requestingUserId))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2507,6 +2759,49 @@ export class AssetService {
|
||||
}
|
||||
: null
|
||||
|
||||
const reactionsMap = new Map<
|
||||
string,
|
||||
{
|
||||
count: number
|
||||
requestingUserReacted: boolean
|
||||
creatorNames: string[]
|
||||
firstCreatedAt: Date
|
||||
}
|
||||
>()
|
||||
|
||||
if ('reactions' in c && c.reactions) {
|
||||
for (const reaction of c.reactions) {
|
||||
let entry = reactionsMap.get(reaction.code)
|
||||
if (!entry) {
|
||||
entry = {
|
||||
count: 0,
|
||||
requestingUserReacted: false,
|
||||
creatorNames: [],
|
||||
firstCreatedAt: reaction.createdAt,
|
||||
}
|
||||
reactionsMap.set(reaction.code, entry)
|
||||
}
|
||||
entry.count++
|
||||
if (requestingUserId && reaction.userId === requestingUserId) {
|
||||
entry.requestingUserReacted = true
|
||||
} else {
|
||||
const userName = reaction.user?.name || 'User'
|
||||
if (!entry.creatorNames.includes(userName)) {
|
||||
entry.creatorNames.push(userName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const reactionCounts: CommentReactionCount[] = Array.from(reactionsMap.entries())
|
||||
.sort((a, b) => a[1].firstCreatedAt.getTime() - b[1].firstCreatedAt.getTime())
|
||||
.map(([code, data]) => ({
|
||||
code,
|
||||
count: data.count,
|
||||
requestingUserReacted: data.requestingUserReacted,
|
||||
creatorNames: data.creatorNames,
|
||||
}))
|
||||
|
||||
return {
|
||||
id: c.id,
|
||||
assetId: c.assetId,
|
||||
@@ -2522,6 +2817,7 @@ export class AssetService {
|
||||
sessionId: c.sessionId,
|
||||
isCompleted: c.isCompleted,
|
||||
completionLastChangedBy,
|
||||
reactionCounts,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,363 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import type { ExportAssetMetadata, ExportCommentItem } from './types'
|
||||
import { exportCommentsToFormat } from './index'
|
||||
|
||||
interface RawFrameioUser {
|
||||
id?: string
|
||||
name?: string
|
||||
profileImage?: { image128?: string }
|
||||
avatarColor?: string
|
||||
}
|
||||
|
||||
interface RawFrameioComment {
|
||||
id: string
|
||||
text: string
|
||||
timestampMicroseconds: number | null
|
||||
insertedAt: string
|
||||
completed: boolean
|
||||
owner?: RawFrameioUser
|
||||
annotation?: unknown
|
||||
replies?: RawFrameioComment[]
|
||||
}
|
||||
|
||||
interface RawFrameioResponse {
|
||||
data: {
|
||||
asset: {
|
||||
comments: {
|
||||
result: RawFrameioComment[]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
describe('Comments Export against Frame.io Golden Test Data', () => {
|
||||
const testDataDir = path.resolve(__dirname, 'fixtures')
|
||||
|
||||
const apiData = JSON.parse(
|
||||
fs.readFileSync(path.join(testDataDir, 'api.json'), 'utf8'),
|
||||
) as RawFrameioResponse
|
||||
|
||||
const rawComments = apiData.data.asset.comments.result
|
||||
|
||||
const comments: ExportCommentItem[] = rawComments.map((c) => ({
|
||||
id: c.id,
|
||||
message: c.text,
|
||||
second: c.timestampMicroseconds != null ? c.timestampMicroseconds / 1_000_000 : null,
|
||||
createdAt: c.insertedAt,
|
||||
isCompleted: c.completed,
|
||||
creator: {
|
||||
id: c.owner?.id || 'u1',
|
||||
name: c.owner?.name || 'Anonymous',
|
||||
image: c.owner?.profileImage?.image128 || null,
|
||||
avatarColor: c.owner?.avatarColor || 'aqua',
|
||||
},
|
||||
annotations: c.annotation,
|
||||
replies: (c.replies || []).map((r) => ({
|
||||
id: r.id,
|
||||
message: r.text,
|
||||
second: r.timestampMicroseconds != null ? r.timestampMicroseconds / 1_000_000 : null,
|
||||
createdAt: r.insertedAt,
|
||||
isCompleted: r.completed,
|
||||
creator: {
|
||||
id: r.owner?.id || 'u2',
|
||||
name: r.owner?.name || 'Anonymous',
|
||||
image: r.owner?.profileImage?.image128 || null,
|
||||
avatarColor: r.owner?.avatarColor || 'orange',
|
||||
},
|
||||
})),
|
||||
}))
|
||||
|
||||
const metadata: ExportAssetMetadata = {
|
||||
id: '2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3',
|
||||
name: 'YTDown_YouTube_Ed-Sheeran-Pokemon-Celestial-Official-Vi_Media_23g5HBOg3Ic_002_720p.mp4',
|
||||
fps: 24000 / 1001,
|
||||
duration: 262.269388,
|
||||
totalFrames: 6287,
|
||||
}
|
||||
|
||||
it('exports DaVinci Resolve EDL matching golden test data byte-for-byte', () => {
|
||||
const golden = fs.readFileSync(path.join(testDataDir, 'resolve.edl'), 'utf8')
|
||||
const result = exportCommentsToFormat(metadata, comments, 'resolve-edl', {
|
||||
exportDate: new Date('2026-09-13T03:26:00Z'),
|
||||
})
|
||||
|
||||
expect(result.filename).toBe(
|
||||
'YTDown_YouTube_Ed-Sheeran-Pokemon-Celestial-Official-Vi_Media_23g5HBOg3Ic_002_720p_resolve.edl',
|
||||
)
|
||||
expect(result.mimeType).toBe('text/plain; charset=utf-8')
|
||||
expect(result.content).toBe(golden)
|
||||
})
|
||||
|
||||
it('exports Avid Media Composer XML matching golden test data byte-for-byte', () => {
|
||||
const golden = fs.readFileSync(path.join(testDataDir, 'media-composer.xml'), 'utf8')
|
||||
const result = exportCommentsToFormat(metadata, comments, 'media-composer-xml')
|
||||
|
||||
expect(result.filename).toBe(
|
||||
'YTDown_YouTube_Ed-Sheeran-Pokemon-Celestial-Official-Vi_Media_23g5HBOg3Ic_002_720p_media-composer.xml',
|
||||
)
|
||||
expect(result.mimeType).toBe('application/xml; charset=utf-8')
|
||||
expect(result.content).toBe(golden)
|
||||
})
|
||||
|
||||
it('exports Adobe Premiere Pro XML matching golden test data byte-for-byte', () => {
|
||||
const golden = fs.readFileSync(path.join(testDataDir, 'premierepro.xml'), 'utf8')
|
||||
const result = exportCommentsToFormat(metadata, comments, 'premiere-xml', {
|
||||
exportDate: new Date('2026-09-13T03:26:31Z'),
|
||||
})
|
||||
|
||||
expect(result.filename).toBe(
|
||||
'YTDown_YouTube_Ed-Sheeran-Pokemon-Celestial-Official-Vi_Media_23g5HBOg3Ic_002_720p_premiere.xml',
|
||||
)
|
||||
expect(result.mimeType).toBe('application/xml; charset=utf-8')
|
||||
expect(result.content).toBe(golden)
|
||||
})
|
||||
|
||||
it('exports Final Cut Pro FIOJSON matching golden comments and metadata', () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const golden: any = JSON.parse(fs.readFileSync(path.join(testDataDir, 'fcp.fiojson'), 'utf8'))
|
||||
const result = exportCommentsToFormat(metadata, comments, 'fcp-fiojson')
|
||||
|
||||
expect(result.filename).toBe(
|
||||
'YTDown_YouTube_Ed-Sheeran-Pokemon-Celestial-Official-Vi_Media_23g5HBOg3Ic_002_720p.fiojson',
|
||||
)
|
||||
expect(result.mimeType).toBe('application/json; charset=utf-8')
|
||||
|
||||
const parsed = JSON.parse(result.content) as typeof golden
|
||||
|
||||
expect(parsed.asset.id).toBe(metadata.id)
|
||||
expect(parsed.asset.name).toBe(metadata.name)
|
||||
expect(parsed.asset.fps).toBe(metadata.fps)
|
||||
expect(parsed.asset.duration).toBe(metadata.duration)
|
||||
expect(parsed.asset.frames).toBe(metadata.totalFrames)
|
||||
expect(parsed.comments.length).toBe(golden.comments.length)
|
||||
|
||||
for (let i = 0; i < parsed.comments.length; i++) {
|
||||
const gen = parsed.comments[i]
|
||||
const gold = golden.comments[i]
|
||||
|
||||
expect(gen.text).toBe(gold.text)
|
||||
expect(gen.frame).toBe(gold.frame)
|
||||
expect(gen.timestamp).toBe(gold.timestamp)
|
||||
expect(gen.completed).toBe(gold.completed)
|
||||
expect(gen.parent_id).toBe(gold.parent_id)
|
||||
if (gold.annotation) {
|
||||
expect(gen.annotation).toBe(gold.annotation)
|
||||
} else {
|
||||
expect(gen.annotation).toBeNull()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
describe('Edge Cases and CJK Character Support', () => {
|
||||
it('escapes special XML characters in asset name for Premiere XML', () => {
|
||||
const specialMetadata: ExportAssetMetadata = {
|
||||
id: 'special-1',
|
||||
name: 'Tom & Jerry <Summer Special> & Co.mp4',
|
||||
fps: 24,
|
||||
duration: 10,
|
||||
totalFrames: 240,
|
||||
}
|
||||
|
||||
const result = exportCommentsToFormat(specialMetadata, [], 'premiere-xml', {
|
||||
exportDate: new Date('2026-09-13T03:26:31Z'),
|
||||
})
|
||||
|
||||
expect(result.filename).toBe('Tom & Jerry <Summer Special> & Co_premiere.xml')
|
||||
expect(result.content).toContain(
|
||||
'<name>Tom & Jerry <Summer Special> & Co.mp4 2026-9-13 03-26-31</name>',
|
||||
)
|
||||
expect(result.content).not.toContain('<name>Tom & Jerry <Summer Special>')
|
||||
})
|
||||
|
||||
it('keeps Resolve EDL FCM consistent with startTimecode separator', () => {
|
||||
const ndfMetadata: ExportAssetMetadata = {
|
||||
id: 'ndf-1',
|
||||
name: 'video_ndf.mp4',
|
||||
fps: 29.97,
|
||||
duration: 10,
|
||||
totalFrames: 300,
|
||||
startTimecode: '01:00:00:00', // Colon denotes NDF
|
||||
}
|
||||
|
||||
const comment: ExportCommentItem = {
|
||||
id: 'c1',
|
||||
message: 'test comment',
|
||||
second: 1.0,
|
||||
createdAt: new Date('2026-09-13T00:00:00Z'),
|
||||
isCompleted: false,
|
||||
creator: { id: 'u1', name: 'User' },
|
||||
}
|
||||
|
||||
const edlNdf = exportCommentsToFormat(ndfMetadata, [comment], 'resolve-edl')
|
||||
expect(edlNdf.content).toContain('FCM: NON DROP FRAME')
|
||||
// Emitted timecode must use colon (NDF), matching FCM
|
||||
expect(edlNdf.content).toContain('01:00:00:29')
|
||||
expect(edlNdf.content).not.toContain('01:00:00;29')
|
||||
|
||||
const dfMetadata: ExportAssetMetadata = {
|
||||
...ndfMetadata,
|
||||
startTimecode: '01:00:00;00', // Semicolon denotes DF
|
||||
}
|
||||
|
||||
const edlDf = exportCommentsToFormat(dfMetadata, [comment], 'resolve-edl')
|
||||
expect(edlDf.content).toContain('FCM: DROP FRAME')
|
||||
// Emitted timecode must use semicolon (DF), matching FCM
|
||||
expect(edlDf.content).toContain('01:00:00;29')
|
||||
})
|
||||
|
||||
it('exports CJK filenames, author names, and comments across all formats without corruption', () => {
|
||||
const cjkMetadata: ExportAssetMetadata = {
|
||||
id: 'cjk-asset',
|
||||
name: '宣传片_最终版 (2026).mp4',
|
||||
fps: 24,
|
||||
duration: 120,
|
||||
totalFrames: 2880,
|
||||
}
|
||||
|
||||
const cjkComments: ExportCommentItem[] = [
|
||||
{
|
||||
id: 'cjk-1',
|
||||
message: '这个镜头的色调太暗了,建议提高曝光度。',
|
||||
second: 5.5,
|
||||
createdAt: '2026-09-13T03:26:00Z',
|
||||
isCompleted: false,
|
||||
creator: { id: 'u1', name: '张三 (Zhang San)' },
|
||||
replies: [
|
||||
{
|
||||
id: 'cjk-1-reply',
|
||||
message: '同意!コントラストも少し下げた方が良いと思います。',
|
||||
second: null,
|
||||
createdAt: '2026-09-13T03:27:00Z',
|
||||
isCompleted: false,
|
||||
creator: { id: 'u2', name: '佐藤健 (Satō Ken)' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'cjk-2',
|
||||
message: '전체적인 템포가 아주 좋습니다.',
|
||||
second: null,
|
||||
createdAt: '2026-09-13T03:28:00Z',
|
||||
isCompleted: true,
|
||||
creator: { id: 'u3', name: '김민수 (Kim Min-soo)' },
|
||||
},
|
||||
]
|
||||
|
||||
// 1. Resolve EDL
|
||||
const edl = exportCommentsToFormat(cjkMetadata, cjkComments, 'resolve-edl')
|
||||
expect(edl.filename).toBe('宣传片_最终版 (2026)_resolve.edl')
|
||||
expect(edl.content).toContain('TITLE: 宣传片_最终版 (2026).mp4')
|
||||
expect(edl.content).toContain('这个镜头的色调太暗了,建议提高曝光度。')
|
||||
expect(edl.content).toContain('佐藤健 (Satō Ken)')
|
||||
expect(edl.content).toContain('同意!コントラストも少し下げた方が良いと思います。')
|
||||
expect(edl.content).toContain('전체적인 템포가 아주 좋습니다.')
|
||||
|
||||
// 2. Media Composer XML
|
||||
const mc = exportCommentsToFormat(cjkMetadata, cjkComments, 'media-composer-xml')
|
||||
expect(mc.filename).toBe('宣传片_最终版 (2026)_media-composer.xml')
|
||||
expect(mc.content).toContain('张三 (Zhang San)')
|
||||
expect(mc.content).toContain('这个镜头的色调太暗了,建议提高曝光度。')
|
||||
expect(mc.content).toContain('佐藤健 (Satō Ken)')
|
||||
expect(mc.content).toContain('同意!コントラストも少し下げた方が良いと思います。')
|
||||
expect(mc.content).toContain('전체적인 템포가 아주 좋습니다.')
|
||||
|
||||
// 3. Premiere XML
|
||||
const ppro = exportCommentsToFormat(cjkMetadata, cjkComments, 'premiere-xml', {
|
||||
exportDate: new Date('2026-09-13T03:26:31Z'),
|
||||
})
|
||||
expect(ppro.filename).toBe('宣传片_最终版 (2026)_premiere.xml')
|
||||
expect(ppro.content).toContain('<name>宣传片_最终版 (2026).mp4 2026-9-13 03-26-31</name>')
|
||||
expect(ppro.content).toContain('这个镜头的色调太暗了,建议提高曝光度。')
|
||||
expect(ppro.content).toContain('同意!コントラストも少し下げた方が良いと思います。')
|
||||
|
||||
// 4. FCP FIOJSON
|
||||
const fcp = exportCommentsToFormat(cjkMetadata, cjkComments, 'fcp-fiojson')
|
||||
expect(fcp.filename).toBe('宣传片_最终版 (2026).fiojson')
|
||||
const parsedFcp = JSON.parse(fcp.content)
|
||||
expect(parsedFcp.asset.name).toBe('宣传片_最终版 (2026).mp4')
|
||||
expect(parsedFcp.comments[0].text).toBe('这个镜头的色调太暗了,建议提高曝光度。')
|
||||
expect(parsedFcp.comments[0].owner.name).toBe('张三 (Zhang San)')
|
||||
expect(parsedFcp.comments[1].text).toBe('同意!コントラストも少し下げた方が良いと思います。')
|
||||
expect(parsedFcp.comments[1].owner.name).toBe('佐藤健 (Satō Ken)')
|
||||
expect(parsedFcp.comments[2].text).toBe('전체적인 템포가 아주 좋습니다.')
|
||||
expect(parsedFcp.comments[2].owner.name).toBe('김민수 (Kim Min-soo)')
|
||||
})
|
||||
|
||||
it('applies non-UTC timeZone consistently across exporters', () => {
|
||||
const fixedDate = new Date('2026-09-13T03:26:31Z')
|
||||
const sampleMetadata: ExportAssetMetadata = {
|
||||
id: 'tz-asset',
|
||||
name: 'timezone-test.mp4',
|
||||
fps: 24,
|
||||
duration: 10,
|
||||
totalFrames: 240,
|
||||
}
|
||||
const sampleComments: ExportCommentItem[] = [
|
||||
{
|
||||
id: 'c1',
|
||||
message: 'testing timezone',
|
||||
second: 2.0,
|
||||
createdAt: fixedDate,
|
||||
isCompleted: false,
|
||||
creator: { id: 'u1', name: 'Author' },
|
||||
},
|
||||
]
|
||||
|
||||
const tzOptions = { exportDate: fixedDate, timeZone: 'America/New_York' }
|
||||
|
||||
// Resolve EDL: Sep 13 03:26 UTC -> Sep 12 11:26pm EDT
|
||||
const edl = exportCommentsToFormat(sampleMetadata, sampleComments, 'resolve-edl', tzOptions)
|
||||
expect(edl.content).toContain('@Author, Sep 12 12 11:26pm')
|
||||
expect(edl.content).not.toContain('Sep 13')
|
||||
|
||||
// Media Composer XML: Sep 13 03:26 UTC -> Sep 12, 2026 23:26 EDT
|
||||
const mc = exportCommentsToFormat(
|
||||
sampleMetadata,
|
||||
sampleComments,
|
||||
'media-composer-xml',
|
||||
tzOptions,
|
||||
)
|
||||
expect(mc.content).toContain('Sep 12, 2026 · 23:26')
|
||||
expect(mc.content).not.toContain('Sep 13')
|
||||
|
||||
// Premiere XML: Sep 13 03:26 UTC -> 2026-9-12 23-26-31 EDT
|
||||
const ppro = exportCommentsToFormat(sampleMetadata, sampleComments, 'premiere-xml', tzOptions)
|
||||
expect(ppro.content).toContain('<name>timezone-test.mp4 2026-9-12 23-26-31</name>')
|
||||
expect(ppro.content).toContain('<name>Marker Color Matte (2026-9-12 23-26-31)</name>')
|
||||
expect(ppro.content).not.toContain('2026-9-13')
|
||||
})
|
||||
|
||||
it('sanitizes EDL title, author, and comment text containing newlines and control characters', () => {
|
||||
const dirtyMetadata: ExportAssetMetadata = {
|
||||
id: 'dirty-asset',
|
||||
name: 'Line1\r\nLine2\x07.mp4',
|
||||
fps: 24,
|
||||
duration: 10,
|
||||
totalFrames: 240,
|
||||
}
|
||||
const dirtyComments: ExportCommentItem[] = [
|
||||
{
|
||||
id: 'c1',
|
||||
message: 'Multi\r\nLine\nComment\x00 Message',
|
||||
second: 1.0,
|
||||
createdAt: new Date('2026-09-13T00:00:00Z'),
|
||||
isCompleted: false,
|
||||
creator: { id: 'u1', name: 'Author\r\nWithNewline' },
|
||||
},
|
||||
]
|
||||
|
||||
const edl = exportCommentsToFormat(dirtyMetadata, dirtyComments, 'resolve-edl')
|
||||
// Title must be on a single line without raw newlines
|
||||
expect(edl.content).toContain('TITLE: Line1 Line2.mp4')
|
||||
expect(edl.content).not.toMatch(/TITLE: .*\r?\n.*\.mp4/)
|
||||
// Author must not have newline
|
||||
expect(edl.content).toContain('@Author WithNewline')
|
||||
// Comment text must not have unescaped newlines breaking the marker line
|
||||
expect(edl.content).toContain(
|
||||
'Multi Line Comment Message |C:ResolveColorPurple |M:Author WithNewline |D:0',
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,140 @@
|
||||
import type { ExportAssetMetadata, ExportCommentItem, ExportOptions, ExportResult } from '../types'
|
||||
import { secondToFrame } from '../timecode'
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
interface FcpFioOwner {
|
||||
id: string
|
||||
name: string
|
||||
profile_image: string | null
|
||||
avatar_color: string
|
||||
image_32: string | null
|
||||
image_64: string | null
|
||||
image_128: string | null
|
||||
image_256: string | null
|
||||
}
|
||||
|
||||
interface FcpFioComment {
|
||||
id: string
|
||||
text: string
|
||||
completed: boolean
|
||||
parent_id: string | null
|
||||
frame: number | null
|
||||
timestamp: number | null
|
||||
timestamp_microseconds: number | null
|
||||
has_replies: boolean
|
||||
annotation: string | null
|
||||
inserted_at: string
|
||||
owner: FcpFioOwner
|
||||
}
|
||||
|
||||
export const exportToFcpFioJson = (
|
||||
metadata: ExportAssetMetadata,
|
||||
comments: ExportCommentItem[],
|
||||
options?: ExportOptions,
|
||||
): ExportResult => {
|
||||
// Final Cut Pro .fiojson format uses standard ISO 8601 UTC timestamps (e.g. 2026-09-13T03:26:00.000Z)
|
||||
// for inserted_at, so timeZone options do not modify the JSON timestamp format.
|
||||
void options
|
||||
// Separate timestamped and non-timestamped comments
|
||||
const timed = comments.filter((c) => c.second !== null && c.second !== undefined)
|
||||
timed.sort((a, b) => (a.second ?? 0) - (b.second ?? 0))
|
||||
const notimed = comments.filter((c) => c.second === null || c.second === undefined)
|
||||
|
||||
const allSorted = [...timed, ...notimed]
|
||||
|
||||
const flattenedComments: FcpFioComment[] = []
|
||||
|
||||
allSorted.forEach((comment) => {
|
||||
const isTimed = comment.second !== null && comment.second !== undefined
|
||||
const frame = isTimed ? secondToFrame(comment.second, metadata.fps) : null
|
||||
const us = isTimed ? Math.round((comment.second ?? 0) * 1_000_000) : null
|
||||
const replies = comment.replies || []
|
||||
|
||||
const hasAnnotation = Boolean(
|
||||
comment.annotations &&
|
||||
(Array.isArray(comment.annotations) ? comment.annotations.length > 0 : true),
|
||||
)
|
||||
const annotationStr = hasAnnotation
|
||||
? typeof comment.annotations === 'string'
|
||||
? comment.annotations
|
||||
: JSON.stringify(comment.annotations)
|
||||
: null
|
||||
|
||||
flattenedComments.push({
|
||||
id: comment.id,
|
||||
text: comment.message || '',
|
||||
completed: comment.isCompleted,
|
||||
parent_id: null,
|
||||
frame,
|
||||
timestamp: frame,
|
||||
timestamp_microseconds: us,
|
||||
has_replies: replies.length > 0,
|
||||
annotation: annotationStr,
|
||||
inserted_at:
|
||||
typeof comment.createdAt === 'string' ? comment.createdAt : comment.createdAt.toISOString(),
|
||||
owner: {
|
||||
id: comment.creator.id,
|
||||
name: comment.creator.name,
|
||||
profile_image: comment.creator.image || null,
|
||||
avatar_color: comment.creator.avatarColor || 'aqua',
|
||||
image_32: comment.creator.image || null,
|
||||
image_64: comment.creator.image || null,
|
||||
image_128: comment.creator.image || null,
|
||||
image_256: comment.creator.image || null,
|
||||
},
|
||||
})
|
||||
|
||||
replies.forEach((r) => {
|
||||
flattenedComments.push({
|
||||
id: r.id,
|
||||
text: r.message || '',
|
||||
completed: r.isCompleted,
|
||||
parent_id: comment.id,
|
||||
frame: null,
|
||||
timestamp: null,
|
||||
timestamp_microseconds: null,
|
||||
has_replies: false,
|
||||
annotation: null,
|
||||
inserted_at: typeof r.createdAt === 'string' ? r.createdAt : r.createdAt.toISOString(),
|
||||
owner: {
|
||||
id: r.creator.id,
|
||||
name: r.creator.name,
|
||||
profile_image: r.creator.image || null,
|
||||
avatar_color: r.creator.avatarColor || 'orange',
|
||||
image_32: r.creator.image || null,
|
||||
image_64: r.creator.image || null,
|
||||
image_128: r.creator.image || null,
|
||||
image_256: r.creator.image || null,
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const output = {
|
||||
asset: {
|
||||
id: metadata.id,
|
||||
name: metadata.name,
|
||||
fps: metadata.fps,
|
||||
duration: metadata.duration,
|
||||
frames: metadata.totalFrames,
|
||||
type: 'file',
|
||||
metadata: {
|
||||
fps: metadata.fps,
|
||||
duration: metadata.duration.toString(),
|
||||
totalFrames: metadata.totalFrames,
|
||||
width: metadata.width,
|
||||
height: metadata.height,
|
||||
format_name: 'MP4',
|
||||
},
|
||||
},
|
||||
comments: flattenedComments,
|
||||
}
|
||||
|
||||
const baseName = metadata.name.replace(/\.[^/.]+$/, '')
|
||||
return {
|
||||
content: JSON.stringify(output),
|
||||
filename: `${baseName}.fiojson`,
|
||||
mimeType: 'application/json; charset=utf-8',
|
||||
}
|
||||
}
|
||||
/* eslint-enable @typescript-eslint/naming-convention */
|
||||
@@ -0,0 +1,156 @@
|
||||
import type { ExportAssetMetadata, ExportCommentItem, ExportOptions, ExportResult } from '../types'
|
||||
import { formatDateAvid, secondToFrame } from '../timecode'
|
||||
|
||||
const escapeXml = (str: string): string => {
|
||||
return str
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
}
|
||||
|
||||
export const exportToMediaComposerXml = (
|
||||
metadata: ExportAssetMetadata,
|
||||
comments: ExportCommentItem[],
|
||||
options?: ExportOptions,
|
||||
): ExportResult => {
|
||||
const lines: string[] = [
|
||||
'<?xml version="1.0" encoding="UTF-8" standalone="no" ?>',
|
||||
'<!DOCTYPE Avid:StreamItems SYSTEM "AvidSettingsFile.dtd">',
|
||||
'<Avid:StreamItems xmlns:Avid="http://www.avid.com">',
|
||||
'<Avid:XMLFileData>',
|
||||
'<AvProp name="DomainMagic" type="string">Domain</AvProp>',
|
||||
'<AvProp name="DomainKey" type="char4">58424a44</AvProp>',
|
||||
]
|
||||
|
||||
// Media Composer orders markers strictly by timeline frame (TC) ascending.
|
||||
// For non-timestamped markers on TC1, sequential frames (0, 1, 2...) are used to avoid frame collisions.
|
||||
const timed = comments.filter((c) => c.second !== null && c.second !== undefined)
|
||||
timed.sort((a, b) => (a.second ?? 0) - (b.second ?? 0))
|
||||
const notimed = comments.filter((c) => c.second === null || c.second === undefined)
|
||||
|
||||
let notimedCounter = 0
|
||||
const allSortedWithTc = [
|
||||
...notimed.map((c) => ({ comment: c, isTimed: false, tc: (notimedCounter++).toString() })),
|
||||
...timed.map((c) => ({
|
||||
comment: c,
|
||||
isTimed: true,
|
||||
tc: secondToFrame(c.second, metadata.fps).toString(),
|
||||
})),
|
||||
]
|
||||
|
||||
allSortedWithTc.forEach(({ comment, isTimed, tc }) => {
|
||||
const color = isTimed ? 'Blue' : 'Magenta'
|
||||
const track = isTimed ? 'V1' : 'TC1'
|
||||
const createdEpoch = Math.floor(new Date(comment.createdAt).getTime() / 1000)
|
||||
|
||||
// Collect unique authors in order
|
||||
const authors: string[] = [comment.creator.name]
|
||||
const replies = comment.replies || []
|
||||
replies.forEach((r) => {
|
||||
if (!authors.includes(r.creator.name)) {
|
||||
authors.push(r.creator.name)
|
||||
}
|
||||
})
|
||||
const userStr = escapeXml(authors.join(', '))
|
||||
|
||||
let comStr: string
|
||||
if (!isTimed) {
|
||||
comStr = escapeXml(comment.message || '')
|
||||
} else {
|
||||
const hasAnnotation = Boolean(
|
||||
comment.annotations &&
|
||||
(Array.isArray(comment.annotations) ? comment.annotations.length > 0 : true),
|
||||
)
|
||||
const annotationPrefix = hasAnnotation ? '(Annotation) ' : ''
|
||||
const rootText = `${annotationPrefix}${comment.message || ''}`
|
||||
const formatLine = (name: string, date: Date, text: string): string => {
|
||||
return `[${escapeXml(name)} ${formatDateAvid(date, options?.timeZone)}] ${escapeXml(text)}`
|
||||
}
|
||||
|
||||
const rootPart = formatLine(comment.creator.name, new Date(comment.createdAt), rootText)
|
||||
|
||||
if (replies.length === 0) {
|
||||
comStr = rootPart
|
||||
} else {
|
||||
const parts = [rootPart]
|
||||
replies.forEach((r) => {
|
||||
parts.push(formatLine(r.creator.name, new Date(r.createdAt), r.message || ''))
|
||||
})
|
||||
// Format with space before newline as in Frame.io export
|
||||
comStr = parts.join(' \n')
|
||||
}
|
||||
}
|
||||
|
||||
lines.push('<AvClass id="ATTR">')
|
||||
lines.push(' <AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>')
|
||||
lines.push(' <List id="OMFI:ATTR:AttrRefs">')
|
||||
lines.push(' <ListElem>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>')
|
||||
lines.push(
|
||||
' <AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>',
|
||||
)
|
||||
lines.push(
|
||||
` <AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">${createdEpoch}</AvProp>`,
|
||||
)
|
||||
lines.push(' </ListElem>')
|
||||
lines.push(' <ListElem>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>')
|
||||
lines.push(
|
||||
' <AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>',
|
||||
)
|
||||
lines.push(
|
||||
` <AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">${color}</AvProp>`,
|
||||
)
|
||||
lines.push(' </ListElem>')
|
||||
lines.push(' <ListElem>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>')
|
||||
lines.push(
|
||||
` <AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">${userStr}</AvProp>`,
|
||||
)
|
||||
lines.push(' </ListElem>')
|
||||
lines.push(' <ListElem>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>')
|
||||
lines.push(
|
||||
` <AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">${comStr}</AvProp>`,
|
||||
)
|
||||
lines.push(' </ListElem>')
|
||||
lines.push(' <ListElem>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>')
|
||||
lines.push(
|
||||
` <AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">${tc}</AvProp>`,
|
||||
)
|
||||
lines.push(' </ListElem>')
|
||||
lines.push(' <ListElem>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>')
|
||||
lines.push(
|
||||
` <AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">${track}</AvProp>`,
|
||||
)
|
||||
lines.push(' </ListElem>')
|
||||
lines.push(' <ListElem>')
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>')
|
||||
lines.push(
|
||||
' <AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>',
|
||||
)
|
||||
lines.push(' <AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>')
|
||||
lines.push(' </ListElem>')
|
||||
lines.push(' <ListElem/>')
|
||||
lines.push(' </List>')
|
||||
lines.push('</AvClass>')
|
||||
})
|
||||
|
||||
lines.push('</Avid:XMLFileData></Avid:StreamItems>')
|
||||
lines.push('')
|
||||
|
||||
const baseName = metadata.name.replace(/\.[^/.]+$/, '')
|
||||
return {
|
||||
content: lines.join('\n'),
|
||||
filename: `${baseName}_media-composer.xml`,
|
||||
mimeType: 'application/xml; charset=utf-8',
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
import type { ExportAssetMetadata, ExportCommentItem, ExportOptions, ExportResult } from '../types'
|
||||
import { formatDatePremiere, isDropFrameRate, secondToFrame } from '../timecode'
|
||||
|
||||
const escapeXml = (str: string): string => {
|
||||
return str
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
}
|
||||
|
||||
export const exportToPremiereXml = (
|
||||
metadata: ExportAssetMetadata,
|
||||
comments: ExportCommentItem[],
|
||||
options?: ExportOptions,
|
||||
): ExportResult => {
|
||||
const exportDate = options?.exportDate || new Date()
|
||||
const dateStr = formatDatePremiere(exportDate, options?.timeZone)
|
||||
const isNtsc = isDropFrameRate(metadata.fps)
|
||||
const timebase = Math.round(metadata.fps) || 24
|
||||
const duration = metadata.totalFrames || Math.round(metadata.duration * metadata.fps) || 0
|
||||
const width = metadata.width || 1920
|
||||
const height = metadata.height || 1080
|
||||
|
||||
// Sort comments: timestamped first, then non-timestamped
|
||||
const timed = comments.filter((c) => c.second !== null && c.second !== undefined)
|
||||
timed.sort((a, b) => (a.second ?? 0) - (b.second ?? 0))
|
||||
const notimed = comments.filter((c) => c.second === null || c.second === undefined)
|
||||
|
||||
const allSorted = [...timed, ...notimed]
|
||||
|
||||
const markerXmlBlocks: string[] = []
|
||||
allSorted.forEach((comment, index) => {
|
||||
const isTimed = comment.second !== null && comment.second !== undefined
|
||||
const inFrame = isTimed ? secondToFrame(comment.second, metadata.fps) : 0
|
||||
const markerIndent = index === 0 ? ' <marker>' : ' <marker>'
|
||||
|
||||
markerXmlBlocks.push(`${markerIndent}
|
||||
<comment>${escapeXml(comment.message || '')}</comment>
|
||||
<name>${escapeXml(comment.creator.name)}</name>
|
||||
<in>${inFrame}</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>`)
|
||||
|
||||
const replies = comment.replies || []
|
||||
replies.forEach((r) => {
|
||||
markerXmlBlocks.push(` <marker>
|
||||
<comment>${escapeXml(r.message || '')}</comment>
|
||||
<name>${escapeXml(r.creator.name)}</name>
|
||||
<in>${inFrame}</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>`)
|
||||
})
|
||||
})
|
||||
|
||||
const clipMarkersJoined = markerXmlBlocks.join('\n')
|
||||
|
||||
// Sequence markers have slightly different initial indent (6 spaces instead of 14)
|
||||
const seqMarkerBlocks = [...markerXmlBlocks]
|
||||
if (seqMarkerBlocks.length > 0) {
|
||||
seqMarkerBlocks[0] = seqMarkerBlocks[0].replace(' <marker>', ' <marker>')
|
||||
}
|
||||
const seqMarkersJoined = seqMarkerBlocks.join('\n')
|
||||
|
||||
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE xmeml>
|
||||
<xmeml version="4">
|
||||
<sequence id="sequence" TL.SQAudioVisibleBase="0" TL.SQVideoVisibleBase="0" TL.SQVisibleBaseTime="0" TL.SQAVDividerPosition="0.5" TL.SQHideShyTracks="0" TL.SQHeaderWidth="292" Monitor.ProgramZoomOut="0" Monitor.ProgramZoomIn="0" TL.SQTimePerPixel="0.19999999999999998" MZ.EditLine="0" MZ.Sequence.PreviewFrameSizeHeight="${height}" MZ.Sequence.PreviewFrameSizeWidth="${width}" MZ.Sequence.AudioTimeDisplayFormat="200" MZ.Sequence.PreviewRenderingClassID="1061109567" MZ.Sequence.PreviewRenderingPresetCodec="1634755439" MZ.Sequence.PreviewRenderingPresetPath="EncoderPresets/SequencePreview/795454d9-d3c2-429d-9474-923ab13b7018/QuickTime.epr" MZ.Sequence.PreviewUseMaxRenderQuality="false" MZ.Sequence.PreviewUseMaxBitDepth="false" MZ.Sequence.EditingModeGUID="795454d9-d3c2-429d-9474-923ab13b7018" MZ.Sequence.VideoTimeDisplayFormat="101" MZ.WorkOutPoint="4612930560000" MZ.WorkInPoint="0" explodedTracks="true">
|
||||
<uuid>7dcf0da5-fbe2-4459-adcc-aa46dd4e3822</uuid>
|
||||
<duration>${duration}</duration>
|
||||
<rate>
|
||||
<timebase>${timebase}</timebase>
|
||||
<ntsc>${isNtsc ? 'TRUE' : 'FALSE'}</ntsc>
|
||||
</rate>
|
||||
<name>${escapeXml(metadata.name)} ${dateStr}</name>
|
||||
<media>
|
||||
<video>
|
||||
<format>
|
||||
<samplecharacteristics>
|
||||
<rate>
|
||||
<timebase>${timebase}</timebase>
|
||||
<ntsc>${isNtsc ? 'TRUE' : 'FALSE'}</ntsc>
|
||||
</rate>
|
||||
<codec>
|
||||
<name>Apple ProRes 422</name>
|
||||
<appspecificdata>
|
||||
<appname>Final Cut Pro</appname>
|
||||
<appmanufacturer>Apple Inc.</appmanufacturer>
|
||||
<appversion>7.0</appversion>
|
||||
<data>
|
||||
<qtcodec>
|
||||
<codecname>Apple ProRes 422</codecname>
|
||||
<codectypename>Apple ProRes 422</codectypename>
|
||||
<codecname>Apple ProRes 422</codecname>
|
||||
<codectypecode>apcn</codectypecode>
|
||||
<codecvendorcode>appl</codecvendorcode>
|
||||
<spatialquality>1024</spatialquality>
|
||||
<temporalquality>0</temporalquality>
|
||||
<keyframerate>0</keyframerate>
|
||||
<datarate>0</datarate>
|
||||
</qtcodec>
|
||||
</data>
|
||||
</appspecificdata>
|
||||
</codec>
|
||||
<width>${width}</width>
|
||||
<height>${height}</height>
|
||||
<anamorphic>FALSE</anamorphic>
|
||||
<pixelaspectratio>square</pixelaspectratio>
|
||||
<fielddominance>none</fielddominance>
|
||||
<colordepth>24</colordepth>
|
||||
</samplecharacteristics>
|
||||
</format>
|
||||
<track TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="0">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<generatoritem id="clipitem-1">
|
||||
<name>Marker Color Matte (${dateStr})</name>
|
||||
<enabled>TRUE</enabled>
|
||||
<duration>${duration}</duration>
|
||||
<rate>
|
||||
<timebase>${timebase}</timebase>
|
||||
<ntsc>${isNtsc ? 'TRUE' : 'FALSE'}</ntsc>
|
||||
</rate>
|
||||
<start>0</start>
|
||||
<end>${duration}</end>
|
||||
<in>0</in>
|
||||
<out>${duration}</out>
|
||||
<alphatype>none</alphatype>
|
||||
<effect>
|
||||
<name>Color</name>
|
||||
<effectid>Color</effectid>
|
||||
<effectcategory>Matte</effectcategory>
|
||||
<effecttype>generator</effecttype>
|
||||
<mediatype>video</mediatype>
|
||||
<parameter authoringApp="PremierePro">
|
||||
<parameterid>fillcolor</parameterid>
|
||||
<name>Color</name>
|
||||
<value>
|
||||
<alpha>0</alpha>
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</value>
|
||||
</parameter>
|
||||
</effect>
|
||||
<filter>
|
||||
<effect>
|
||||
<name>Opacity</name>
|
||||
<effectid>opacity</effectid>
|
||||
<effectcategory>motion</effectcategory>
|
||||
<effecttype>motion</effecttype>
|
||||
<mediatype>video</mediatype>
|
||||
<pproBypass>false</pproBypass>
|
||||
<parameter authoringApp="PremierePro">
|
||||
<parameterid>opacity</parameterid>
|
||||
<name>opacity</name>
|
||||
<valuemin>0</valuemin>
|
||||
<valuemax>100</valuemax>
|
||||
<value>0</value>
|
||||
</parameter>
|
||||
</effect>
|
||||
</filter>
|
||||
${clipMarkersJoined}
|
||||
|
||||
</generatoritem>
|
||||
</track>
|
||||
</video>
|
||||
<audio>
|
||||
<numOutputChannels>2</numOutputChannels>
|
||||
<format>
|
||||
<samplecharacteristics>
|
||||
<depth>16</depth>
|
||||
<samplerate>48000</samplerate>
|
||||
</samplecharacteristics>
|
||||
</format>
|
||||
<outputs>
|
||||
<groups>
|
||||
<index>1</index>
|
||||
<numchannels>1</numchannels>
|
||||
<downmix>0</downmix>
|
||||
<channel>
|
||||
<index>1</index>
|
||||
</channel>
|
||||
</groups>
|
||||
<groups>
|
||||
<index>2</index>
|
||||
<numchannels>1</numchannels>
|
||||
<downmix>0</downmix>
|
||||
<channel>
|
||||
<index>2</index>
|
||||
</channel>
|
||||
</groups>
|
||||
</outputs>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="0" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>1</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="1" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>2</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="0" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>1</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="1" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>2</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="0" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>1</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="1" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>2</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="0" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>1</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="1" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>2</outputchannelindex>
|
||||
</track>
|
||||
</audio>
|
||||
</media>
|
||||
<timecode>
|
||||
<rate>
|
||||
<timebase>${timebase}</timebase>
|
||||
<ntsc>${isNtsc ? 'TRUE' : 'FALSE'}</ntsc>
|
||||
</rate>
|
||||
<string>00:00:00:00</string>
|
||||
<frame>0</frame>
|
||||
<displayformat>${isNtsc ? 'DF' : 'NDF'}</displayformat>
|
||||
</timecode>
|
||||
<labels>
|
||||
<label2>Iris</label2>
|
||||
</labels>
|
||||
<logginginfo>
|
||||
<description/>
|
||||
<scene/>
|
||||
<shottake/>
|
||||
<lognote/>
|
||||
<good/>
|
||||
<originalvideofilename/>
|
||||
<originalaudiofilename/>
|
||||
</logginginfo>
|
||||
${seqMarkersJoined}
|
||||
|
||||
</sequence>
|
||||
</xmeml>
|
||||
`
|
||||
|
||||
const baseName = metadata.name.replace(/\.[^/.]+$/, '')
|
||||
return {
|
||||
content: xml,
|
||||
filename: `${baseName}_premiere.xml`,
|
||||
mimeType: 'application/xml; charset=utf-8',
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import type { ExportAssetMetadata, ExportCommentItem, ExportOptions, ExportResult } from '../types'
|
||||
import { formatDateEdl, frameToTimecode, getEffectiveDropFrame, secondToFrame } from '../timecode'
|
||||
|
||||
const sanitizeEdlText = (str: string): string => {
|
||||
return (
|
||||
str
|
||||
.replace(/[\r\n]+/g, ' ')
|
||||
// eslint-disable-next-line no-control-regex
|
||||
.replace(/[\x00-\x1f\x7f]/g, '')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim()
|
||||
)
|
||||
}
|
||||
|
||||
export const exportToResolveEdl = (
|
||||
metadata: ExportAssetMetadata,
|
||||
comments: ExportCommentItem[],
|
||||
options?: ExportOptions,
|
||||
): ExportResult => {
|
||||
const exportDate = options?.exportDate || new Date()
|
||||
const dropFrame = getEffectiveDropFrame(metadata.fps, metadata.startTimecode)
|
||||
const fcm = dropFrame ? 'DROP FRAME' : 'NON DROP FRAME'
|
||||
|
||||
const lines: string[] = [`TITLE: ${sanitizeEdlText(metadata.name)}`, `FCM: ${fcm}`, '']
|
||||
|
||||
// Separate timestamped and non-timestamped root comments
|
||||
const timed = comments.filter((c) => c.second !== null && c.second !== undefined)
|
||||
timed.sort((a, b) => (a.second ?? 0) - (b.second ?? 0))
|
||||
const notimed = comments.filter((c) => c.second === null || c.second === undefined)
|
||||
|
||||
const allSorted = [...timed, ...notimed]
|
||||
|
||||
allSorted.forEach((comment, index) => {
|
||||
const eventNum = (index + 1).toString().padStart(3, '0')
|
||||
const frame =
|
||||
comment.second !== null && comment.second !== undefined
|
||||
? secondToFrame(comment.second, metadata.fps)
|
||||
: 0
|
||||
const tc = frameToTimecode(frame, metadata.fps, dropFrame, metadata.startTimecode)
|
||||
const author = sanitizeEdlText(comment.creator.name)
|
||||
|
||||
lines.push(`${eventNum} 001 C V ${tc} ${tc} ${tc} ${tc}`)
|
||||
lines.push(`@${author}, ${formatDateEdl(exportDate, false, options?.timeZone)}`)
|
||||
|
||||
const markerTag = `|C:ResolveColorPurple |M:${author} |D:0`
|
||||
const replies = comment.replies || []
|
||||
const rootMsg = sanitizeEdlText(comment.message || '')
|
||||
|
||||
if (replies.length === 0) {
|
||||
const msg = rootMsg ? `${rootMsg} ${markerTag}` : markerTag
|
||||
lines.push(msg)
|
||||
} else {
|
||||
lines.push(rootMsg)
|
||||
replies.forEach((reply, rIndex) => {
|
||||
const isLastReply = rIndex === replies.length - 1
|
||||
const replyAuthor = sanitizeEdlText(reply.creator.name)
|
||||
lines.push(`@${replyAuthor}, ${formatDateEdl(exportDate, true, options?.timeZone)} [Reply]`)
|
||||
const replyMsg = sanitizeEdlText(reply.message || '')
|
||||
if (isLastReply) {
|
||||
lines.push(`^ ${replyMsg} ${markerTag}`)
|
||||
} else {
|
||||
lines.push(`^ ${replyMsg}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
lines.push('')
|
||||
})
|
||||
|
||||
// EDL files standard ending
|
||||
lines.push('')
|
||||
lines.push('')
|
||||
|
||||
const baseName = metadata.name.replace(/\.[^/.]+$/, '')
|
||||
return {
|
||||
content: lines.join('\n'),
|
||||
filename: `${baseName}_resolve.edl`,
|
||||
mimeType: 'text/plain; charset=utf-8',
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,960 @@
|
||||
{
|
||||
"data": {
|
||||
"asset": {
|
||||
"id": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"project": {
|
||||
"id": "13ed8fe7-1d01-496d-a20d-d27f7010071a",
|
||||
"workspace": {
|
||||
"id": "b60ab173-bfcd-4640-962e-da7dd5562481",
|
||||
"accountId": "fdc13276-ce7a-41ea-9faf-c1d92b74dc97",
|
||||
"__typename": "Workspace"
|
||||
},
|
||||
"__typename": "Project"
|
||||
},
|
||||
"commentCount": 19,
|
||||
"commentCountStats": {
|
||||
"private": 0,
|
||||
"public": 19,
|
||||
"__typename": "CommentCountStats"
|
||||
},
|
||||
"comments": {
|
||||
"result": [
|
||||
{
|
||||
"id": "878fbfc6-64b5-4e4a-ae17-d749dfaa7881",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 1,
|
||||
"text": "fly",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 2168833,
|
||||
"insertedAt": "2026-09-13T02:23:39.322486Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "f63b3c87-3e11-4b48-88d9-f66226485209",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 2,
|
||||
"text": "yellow",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 4838166,
|
||||
"insertedAt": "2026-09-13T02:23:48.058328Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "16607bc1-c9e5-4f1f-8ff9-9be71d6bab72",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 3,
|
||||
"text": "foo",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 17058708,
|
||||
"insertedAt": "2026-09-13T02:24:07.439183Z",
|
||||
"editedAt": null,
|
||||
"readCount": 1,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [
|
||||
{
|
||||
"type": "read",
|
||||
"user": {
|
||||
"id": "b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301",
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"__typename": "ReadImpression"
|
||||
}
|
||||
],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": [
|
||||
{
|
||||
"id": "feba3395-26f4-423c-981a-412a367dc658",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": null,
|
||||
"text": "火了",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": null,
|
||||
"insertedAt": "2026-09-13T02:26:42.822033Z",
|
||||
"editedAt": null,
|
||||
"readCount": 1,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [
|
||||
{
|
||||
"type": "read",
|
||||
"user": {
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"__typename": "ReadImpression"
|
||||
}
|
||||
],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": "16607bc1-c9e5-4f1f-8ff9-9be71d6bab72",
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl723@gmail.com",
|
||||
"id": "b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301",
|
||||
"name": "matt",
|
||||
"avatarColor": "ORANGE",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?x-amz-meta-resource_id=b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=6cb224ddc340bb3d6ba8636265708635bf4f97266006ef1ff9521c94ca811e9d",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "95eb5e84-3154-450a-a970-1ce0f8ab3b49",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": null,
|
||||
"text": "@matt 很棒",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": null,
|
||||
"insertedAt": "2026-09-13T02:28:06.605972Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": "16607bc1-c9e5-4f1f-8ff9-9be71d6bab72",
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [
|
||||
{
|
||||
"id": "4772a0e6-fc52-4e4a-8a0b-c680382d0ca6",
|
||||
"type": "MENTION",
|
||||
"mentionText": "@matt",
|
||||
"userId": "b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301",
|
||||
"__typename": "CommentMention",
|
||||
"endIndex": 4,
|
||||
"startIndex": 0
|
||||
}
|
||||
],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "9ee234e5-8e22-467a-8d8e-f471202c286e",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 4,
|
||||
"text": "60",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 23314958,
|
||||
"insertedAt": "2026-09-13T02:24:18.876068Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "c64c3624-36ef-4fcf-8711-7696e4fa7bc9",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 5,
|
||||
"text": "pi",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 28778750,
|
||||
"insertedAt": "2026-09-13T02:24:27.938596Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "900c9efb-acb8-4da0-9b61-70aa377d1713",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 6,
|
||||
"text": "fir",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 45712333,
|
||||
"insertedAt": "2026-09-13T02:24:49.188944Z",
|
||||
"editedAt": null,
|
||||
"readCount": 1,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [
|
||||
{
|
||||
"type": "read",
|
||||
"user": {
|
||||
"id": "b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301",
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"__typename": "ReadImpression"
|
||||
}
|
||||
],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": [
|
||||
{
|
||||
"id": "a257d510-2a41-4d8d-a3cb-798c721313f5",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": null,
|
||||
"text": "这个好吃",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": null,
|
||||
"insertedAt": "2026-09-13T02:26:35.392129Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": false,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": "900c9efb-acb8-4da0-9b61-70aa377d1713",
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl723@gmail.com",
|
||||
"id": "b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301",
|
||||
"name": "matt",
|
||||
"avatarColor": "ORANGE",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?x-amz-meta-resource_id=b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=6cb224ddc340bb3d6ba8636265708635bf4f97266006ef1ff9521c94ca811e9d",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "6c6d7ffd-d3f7-4f65-9672-e4a106a9a99c",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 7,
|
||||
"text": "run",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 104145708,
|
||||
"insertedAt": "2026-09-13T02:25:00.981832Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "de262b66-e732-4790-aae7-180b0837a3e3",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 8,
|
||||
"text": "good",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 114405958,
|
||||
"insertedAt": "2026-09-13T02:25:16.882041Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "10c73ebe-791f-487c-b4cc-ead5bf07dadb",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 9,
|
||||
"text": "yes",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 152694208,
|
||||
"insertedAt": "2026-09-13T02:26:00.908615Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": false,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl723@gmail.com",
|
||||
"id": "b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301",
|
||||
"name": "matt",
|
||||
"avatarColor": "ORANGE",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?x-amz-meta-resource_id=b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=6cb224ddc340bb3d6ba8636265708635bf4f97266006ef1ff9521c94ca811e9d",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "b942a666-bd3b-47ac-8ede-b4947e2db7c5",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 10,
|
||||
"text": "楼梯",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 156698208,
|
||||
"insertedAt": "2026-09-13T02:26:10.868037Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": false,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl723@gmail.com",
|
||||
"id": "b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301",
|
||||
"name": "matt",
|
||||
"avatarColor": "ORANGE",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?x-amz-meta-resource_id=b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=6cb224ddc340bb3d6ba8636265708635bf4f97266006ef1ff9521c94ca811e9d",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "446a7736-7844-4fd8-ad10-6f293209eb35",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 11,
|
||||
"text": "起飞",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 184948653,
|
||||
"insertedAt": "2026-09-13T02:27:39.516606Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": false,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl723@gmail.com",
|
||||
"id": "b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301",
|
||||
"name": "matt",
|
||||
"avatarColor": "ORANGE",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?x-amz-meta-resource_id=b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=6cb224ddc340bb3d6ba8636265708635bf4f97266006ef1ff9521c94ca811e9d",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "d214aaec-3d0f-4d3d-8fd0-41ced84f6b49",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 12,
|
||||
"text": "发呆",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 216341125,
|
||||
"insertedAt": "2026-09-13T02:27:50.932069Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": false,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl723@gmail.com",
|
||||
"id": "b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301",
|
||||
"name": "matt",
|
||||
"avatarColor": "ORANGE",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4NTg0NjAsInN1YiI6InVzZXJzL2I1ZDdlMWY2LWQzYjktNGFhYS1iYjdlLThhMTMzYjc3MjMwMS9mMmRmZDM3NC0xNDZlLTRiYWItOTMwNy0zZjY0MTU3ZmIwODcvaW1hZ2UucG5nIn0.n_AUA2dO5WVKof-E5JM2zs-qEg2PmlBdFXL6EIz7U-I",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301/f2dfd374-146e-4bab-9307-3f64157fb087/image.png?x-amz-meta-resource_id=b5d7e1f6-d3b9-4aaa-bb7e-8a133b772301&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=6cb224ddc340bb3d6ba8636265708635bf4f97266006ef1ff9521c94ca811e9d",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "0f392cf0-6ebb-4747-ab1e-247ef8a51f56",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": true,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 15,
|
||||
"text": "donedone",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 236486250,
|
||||
"insertedAt": "2026-09-13T03:24:22.136713Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "1196e655-4b55-49aa-bbf1-cfcd3d953e77",
|
||||
"attachments": [],
|
||||
"annotation": "[{\"tool\":\"rect\",\"color\":\"#F27637\",\"size\":3,\"x\":0.46111759640249533,\"y\":0.5933636704745946,\"w\":0.12655248538681746,\"h\":0.18235713317601765,\"ix\":0.46111759640249533,\"iy\":0.5933636704745946,\"radius\":8},{\"tool\":\"pen\",\"color\":\"#F27637\",\"size\":3,\"xs\":[0.49638859029281013,0.4962860203822167,0.4964718801450213,0.5004429111411856,0.5097950615177086,0.5248136761386472,0.5444411060870339,0.5650652599679004,0.5850419894882918,0.6027495663088581,0.6162682474735411,0.6259698075938311,0.6324246609684362,0.6352706730150574,0.635914902394429,0.6352898979875585,0.6321778762211439,0.6260787674666312,0.6179316758248781,0.6083294906340782,0.5986696305257749,0.5904359989648261,0.5847214998320982,0.5810325085471253,0.579157605498276,0.5809748336296219,0.587564316897616,0.5993555048312521,0.6238096147668061,0.6724294049645159,0.7301097208842474,0.7797230951192147,0.8221380116707151,0.8495599836218658,0.8631331447229489,0.8706488419956249,0.8736935488153451,0.8745589480073013,0.8747031628440003,0.8747031628440003,0.8745846180278902,0.8744115381894989,0.8744115381894989],\"ys\":[0.39414678115324464,0.39414678115324464,0.3934573507481103,0.3869447796114276,0.3737487486936077,0.3577664983927653,0.34446220535663924,0.338810002234773,0.3378471010332838,0.33933990392826474,0.3452598978800798,0.3559717269389447,0.3695380818733861,0.3852297725134282,0.40507508548349436,0.42639048148291775,0.44445238293197514,0.4580131068652383,0.46637171604907796,0.47035444973464763,0.47120345781665224,0.4686280337386087,0.4631296793619792,0.45265719233580587,0.4333759098228947,0.4044198328072509,0.36918484672121,0.3360409206814236,0.30446956189243946,0.2729095630362671,0.24974244902328074,0.23407928062833744,0.22115672050687235,0.21397183231211453,0.21209727201985867,0.21195483217266153,0.21195483217266153,0.21276961356054758,0.2142282387266377,0.2154817485541547,0.2162509433151104,0.21623955889968471,0.21623955889968471]}]",
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 16,
|
||||
"text": "markup",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": 241407833,
|
||||
"insertedAt": "2026-09-13T03:24:48.692521Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "39dfb715-4502-4fd7-8bd1-d3462642ae84",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 14,
|
||||
"text": "notime",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": null,
|
||||
"insertedAt": "2026-09-13T03:24:09.554210Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
},
|
||||
{
|
||||
"id": "d68d79d0-218d-499f-900e-7335c4e7c294",
|
||||
"attachments": [],
|
||||
"annotation": null,
|
||||
"assetId": "2e7ffdba-8fcf-40b6-a93c-026dc1f5dca3",
|
||||
"bounds": null,
|
||||
"completed": false,
|
||||
"deviceLinkChannelInput": null,
|
||||
"duration": null,
|
||||
"isCopy": false,
|
||||
"number": 13,
|
||||
"text": "网吧",
|
||||
"textReviewAnnotation": null,
|
||||
"timestampMicroseconds": null,
|
||||
"insertedAt": "2026-09-13T03:13:58.235530Z",
|
||||
"editedAt": null,
|
||||
"readCount": 0,
|
||||
"readByViewer": true,
|
||||
"readImpressions": {
|
||||
"result": [],
|
||||
"__typename": "PaginatedReadImpressions"
|
||||
},
|
||||
"parentId": null,
|
||||
"documentPageNumber": null,
|
||||
"owner": {
|
||||
"email": "njjyl000@gmail.com",
|
||||
"id": "d57c3554-43f9-4ede-93ab-537476d7b0e6",
|
||||
"name": "apple apple",
|
||||
"avatarColor": "AQUA",
|
||||
"profileImage": {
|
||||
"image32": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=32&height=32&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image64": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=64&height=64&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image128": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=128&height=128&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"image256": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?width=256&height=256&resize=fill&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"imageBase": "https://picture.frame.io/image/convert/frameio-uploads-production/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTE4MDQyNjUsInN1YiI6InVzZXJzL2Q1N2MzNTU0LTQzZjktNGVkZS05M2FiLTUzNzQ3NmQ3YjBlNi9mODQ0OWJjYy1mZDg3LTQ2NWYtYTQ1Ny02ZDNkY2MxMjFmZTcvaW1hZ2UucG5nIn0.cH1L-b1vpNSDb4FPRo14h_srbhY2OHUYDFZN33iXEy4",
|
||||
"original": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/users/d57c3554-43f9-4ede-93ab-537476d7b0e6/f8449bcc-fd87-465f-a457-6d3dcc121fe7/image.png?x-amz-meta-resource_id=d57c3554-43f9-4ede-93ab-537476d7b0e6&x-amz-meta-resource_type=user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5BPIQ3GOMNTLW4S%2F20260913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260913T032725Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8465cc8de07dd2de1a35c6ba30aee21c044a4664c250a84a90cbd29bc7b1dfac",
|
||||
"__typename": "Images"
|
||||
},
|
||||
"__typename": "AuthenticatedUser"
|
||||
},
|
||||
"commentEntities": [],
|
||||
"reactionCounts": [],
|
||||
"viewerContext": null,
|
||||
"private": false,
|
||||
"__typename": "Comment",
|
||||
"replies": []
|
||||
}
|
||||
],
|
||||
"__typename": "PaginatedComments"
|
||||
},
|
||||
"__typename": "VideoAsset"
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,666 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<!DOCTYPE Avid:StreamItems SYSTEM "AvidSettingsFile.dtd">
|
||||
<Avid:StreamItems xmlns:Avid="http://www.avid.com">
|
||||
<Avid:XMLFileData>
|
||||
<AvProp name="DomainMagic" type="string">Domain</AvProp>
|
||||
<AvProp name="DomainKey" type="char4">58424a44</AvProp>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789269849</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Magenta</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">notime</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">0</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">TC1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789269238</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Magenta</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">网吧</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">TC1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266219</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 02:23] fly</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">51</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266228</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 02:23] yellow</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">115</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266247</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple, matt</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 02:24] foo
|
||||
[matt Sep 13, 2026 · 02:26] 火了
|
||||
[apple apple Sep 13, 2026 · 02:28] @matt 很棒</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">408</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266258</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 02:24] 60</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">558</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266267</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 02:24] pi</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">690</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266289</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple, matt</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 02:24] fir
|
||||
[matt Sep 13, 2026 · 02:26] 这个好吃</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">1095</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266300</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 02:25] run</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">2496</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266316</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 02:25] good</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">2742</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266360</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">matt</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[matt Sep 13, 2026 · 02:26] yes</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">3660</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266370</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">matt</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[matt Sep 13, 2026 · 02:26] 楼梯</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">3756</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266459</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">matt</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[matt Sep 13, 2026 · 02:27] 起飞</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">4434</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789266470</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">matt</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[matt Sep 13, 2026 · 02:27] 发呆</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">5187</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789269862</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 03:24] donedone</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">5670</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
<AvClass id="ATTR">
|
||||
<AvProp id="ATTR" name="__OMFI:ATTR:NumItems" type="int32">7</AvProp>
|
||||
<List id="OMFI:ATTR:AttrRefs">
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LONG_CREATE_DATE</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1789269888</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COLOR</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">Blue</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_USER</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">apple apple</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_COM</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">[apple apple Sep 13, 2026 · 03:24] (Annotation) markup</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TC</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">5787</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">2</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_TRK</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:StringAttribute" type="string">V1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Kind" type="int32">1</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:Name" type="string">_ATN_CRM_LENGTH</AvProp>
|
||||
<AvProp id="ATTR" name="OMFI:ATTB:IntAttribute" type="int32">1</AvProp>
|
||||
</ListElem>
|
||||
<ListElem/>
|
||||
</List>
|
||||
</AvClass>
|
||||
</Avid:XMLFileData></Avid:StreamItems>
|
||||
@@ -0,0 +1,460 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE xmeml>
|
||||
<xmeml version="4">
|
||||
<sequence id="sequence" TL.SQAudioVisibleBase="0" TL.SQVideoVisibleBase="0" TL.SQVisibleBaseTime="0" TL.SQAVDividerPosition="0.5" TL.SQHideShyTracks="0" TL.SQHeaderWidth="292" Monitor.ProgramZoomOut="0" Monitor.ProgramZoomIn="0" TL.SQTimePerPixel="0.19999999999999998" MZ.EditLine="0" MZ.Sequence.PreviewFrameSizeHeight="1080" MZ.Sequence.PreviewFrameSizeWidth="1920" MZ.Sequence.AudioTimeDisplayFormat="200" MZ.Sequence.PreviewRenderingClassID="1061109567" MZ.Sequence.PreviewRenderingPresetCodec="1634755439" MZ.Sequence.PreviewRenderingPresetPath="EncoderPresets/SequencePreview/795454d9-d3c2-429d-9474-923ab13b7018/QuickTime.epr" MZ.Sequence.PreviewUseMaxRenderQuality="false" MZ.Sequence.PreviewUseMaxBitDepth="false" MZ.Sequence.EditingModeGUID="795454d9-d3c2-429d-9474-923ab13b7018" MZ.Sequence.VideoTimeDisplayFormat="101" MZ.WorkOutPoint="4612930560000" MZ.WorkInPoint="0" explodedTracks="true">
|
||||
<uuid>7dcf0da5-fbe2-4459-adcc-aa46dd4e3822</uuid>
|
||||
<duration>6287</duration>
|
||||
<rate>
|
||||
<timebase>24</timebase>
|
||||
<ntsc>FALSE</ntsc>
|
||||
</rate>
|
||||
<name>YTDown_YouTube_Ed-Sheeran-Pokemon-Celestial-Official-Vi_Media_23g5HBOg3Ic_002_720p.mp4 2026-9-13 03-26-31</name>
|
||||
<media>
|
||||
<video>
|
||||
<format>
|
||||
<samplecharacteristics>
|
||||
<rate>
|
||||
<timebase>24</timebase>
|
||||
<ntsc>FALSE</ntsc>
|
||||
</rate>
|
||||
<codec>
|
||||
<name>Apple ProRes 422</name>
|
||||
<appspecificdata>
|
||||
<appname>Final Cut Pro</appname>
|
||||
<appmanufacturer>Apple Inc.</appmanufacturer>
|
||||
<appversion>7.0</appversion>
|
||||
<data>
|
||||
<qtcodec>
|
||||
<codecname>Apple ProRes 422</codecname>
|
||||
<codectypename>Apple ProRes 422</codectypename>
|
||||
<codecname>Apple ProRes 422</codecname>
|
||||
<codectypecode>apcn</codectypecode>
|
||||
<codecvendorcode>appl</codecvendorcode>
|
||||
<spatialquality>1024</spatialquality>
|
||||
<temporalquality>0</temporalquality>
|
||||
<keyframerate>0</keyframerate>
|
||||
<datarate>0</datarate>
|
||||
</qtcodec>
|
||||
</data>
|
||||
</appspecificdata>
|
||||
</codec>
|
||||
<width>1920</width>
|
||||
<height>1080</height>
|
||||
<anamorphic>FALSE</anamorphic>
|
||||
<pixelaspectratio>square</pixelaspectratio>
|
||||
<fielddominance>none</fielddominance>
|
||||
<colordepth>24</colordepth>
|
||||
</samplecharacteristics>
|
||||
</format>
|
||||
<track TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="0">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<generatoritem id="clipitem-1">
|
||||
<name>Marker Color Matte (2026-9-13 03-26-31)</name>
|
||||
<enabled>TRUE</enabled>
|
||||
<duration>6287</duration>
|
||||
<rate>
|
||||
<timebase>24</timebase>
|
||||
<ntsc>FALSE</ntsc>
|
||||
</rate>
|
||||
<start>0</start>
|
||||
<end>6287</end>
|
||||
<in>0</in>
|
||||
<out>6287</out>
|
||||
<alphatype>none</alphatype>
|
||||
<effect>
|
||||
<name>Color</name>
|
||||
<effectid>Color</effectid>
|
||||
<effectcategory>Matte</effectcategory>
|
||||
<effecttype>generator</effecttype>
|
||||
<mediatype>video</mediatype>
|
||||
<parameter authoringApp="PremierePro">
|
||||
<parameterid>fillcolor</parameterid>
|
||||
<name>Color</name>
|
||||
<value>
|
||||
<alpha>0</alpha>
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</value>
|
||||
</parameter>
|
||||
</effect>
|
||||
<filter>
|
||||
<effect>
|
||||
<name>Opacity</name>
|
||||
<effectid>opacity</effectid>
|
||||
<effectcategory>motion</effectcategory>
|
||||
<effecttype>motion</effecttype>
|
||||
<mediatype>video</mediatype>
|
||||
<pproBypass>false</pproBypass>
|
||||
<parameter authoringApp="PremierePro">
|
||||
<parameterid>opacity</parameterid>
|
||||
<name>opacity</name>
|
||||
<valuemin>0</valuemin>
|
||||
<valuemax>100</valuemax>
|
||||
<value>0</value>
|
||||
</parameter>
|
||||
</effect>
|
||||
</filter>
|
||||
<marker>
|
||||
<comment>fly</comment>
|
||||
<name>apple apple</name>
|
||||
<in>51</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>yellow</comment>
|
||||
<name>apple apple</name>
|
||||
<in>115</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>foo</comment>
|
||||
<name>apple apple</name>
|
||||
<in>408</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>火了</comment>
|
||||
<name>matt</name>
|
||||
<in>408</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>@matt 很棒</comment>
|
||||
<name>apple apple</name>
|
||||
<in>408</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>60</comment>
|
||||
<name>apple apple</name>
|
||||
<in>558</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>pi</comment>
|
||||
<name>apple apple</name>
|
||||
<in>690</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>fir</comment>
|
||||
<name>apple apple</name>
|
||||
<in>1095</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>这个好吃</comment>
|
||||
<name>matt</name>
|
||||
<in>1095</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>run</comment>
|
||||
<name>apple apple</name>
|
||||
<in>2496</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>good</comment>
|
||||
<name>apple apple</name>
|
||||
<in>2742</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>yes</comment>
|
||||
<name>matt</name>
|
||||
<in>3660</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>楼梯</comment>
|
||||
<name>matt</name>
|
||||
<in>3756</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>起飞</comment>
|
||||
<name>matt</name>
|
||||
<in>4434</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>发呆</comment>
|
||||
<name>matt</name>
|
||||
<in>5187</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>donedone</comment>
|
||||
<name>apple apple</name>
|
||||
<in>5670</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>markup</comment>
|
||||
<name>apple apple</name>
|
||||
<in>5787</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>notime</comment>
|
||||
<name>apple apple</name>
|
||||
<in>0</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>网吧</comment>
|
||||
<name>apple apple</name>
|
||||
<in>0</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
|
||||
</generatoritem>
|
||||
</track>
|
||||
</video>
|
||||
<audio>
|
||||
<numOutputChannels>2</numOutputChannels>
|
||||
<format>
|
||||
<samplecharacteristics>
|
||||
<depth>16</depth>
|
||||
<samplerate>48000</samplerate>
|
||||
</samplecharacteristics>
|
||||
</format>
|
||||
<outputs>
|
||||
<groups>
|
||||
<index>1</index>
|
||||
<numchannels>1</numchannels>
|
||||
<downmix>0</downmix>
|
||||
<channel>
|
||||
<index>1</index>
|
||||
</channel>
|
||||
</groups>
|
||||
<groups>
|
||||
<index>2</index>
|
||||
<numchannels>1</numchannels>
|
||||
<downmix>0</downmix>
|
||||
<channel>
|
||||
<index>2</index>
|
||||
</channel>
|
||||
</groups>
|
||||
</outputs>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="0" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>1</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="1" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>2</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="0" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>1</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="1" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>2</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="0" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>1</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="1" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>2</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="0" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>1</outputchannelindex>
|
||||
</track>
|
||||
<track TL.SQTrackAudioKeyframeStyle="0" TL.SQTrackShy="0" TL.SQTrackExpandedHeight="25" TL.SQTrackExpanded="0" MZ.TrackTargeted="1" PannerCurrentValue="0.5" PannerIsInverted="true" PannerStartKeyframe="-91445760000000000,0.5,0,0,0,0,0,0" PannerName="Balance" currentExplodedTrackIndex="1" totalExplodedTrackCount="2" premiereTrackType="Stereo">
|
||||
<enabled>TRUE</enabled>
|
||||
<locked>FALSE</locked>
|
||||
<outputchannelindex>2</outputchannelindex>
|
||||
</track>
|
||||
</audio>
|
||||
</media>
|
||||
<timecode>
|
||||
<rate>
|
||||
<timebase>24</timebase>
|
||||
<ntsc>FALSE</ntsc>
|
||||
</rate>
|
||||
<string>00:00:00:00</string>
|
||||
<frame>0</frame>
|
||||
<displayformat>NDF</displayformat>
|
||||
</timecode>
|
||||
<labels>
|
||||
<label2>Iris</label2>
|
||||
</labels>
|
||||
<logginginfo>
|
||||
<description/>
|
||||
<scene/>
|
||||
<shottake/>
|
||||
<lognote/>
|
||||
<good/>
|
||||
<originalvideofilename/>
|
||||
<originalaudiofilename/>
|
||||
</logginginfo>
|
||||
<marker>
|
||||
<comment>fly</comment>
|
||||
<name>apple apple</name>
|
||||
<in>51</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>yellow</comment>
|
||||
<name>apple apple</name>
|
||||
<in>115</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>foo</comment>
|
||||
<name>apple apple</name>
|
||||
<in>408</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>火了</comment>
|
||||
<name>matt</name>
|
||||
<in>408</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>@matt 很棒</comment>
|
||||
<name>apple apple</name>
|
||||
<in>408</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>60</comment>
|
||||
<name>apple apple</name>
|
||||
<in>558</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>pi</comment>
|
||||
<name>apple apple</name>
|
||||
<in>690</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>fir</comment>
|
||||
<name>apple apple</name>
|
||||
<in>1095</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>这个好吃</comment>
|
||||
<name>matt</name>
|
||||
<in>1095</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>run</comment>
|
||||
<name>apple apple</name>
|
||||
<in>2496</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>good</comment>
|
||||
<name>apple apple</name>
|
||||
<in>2742</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>yes</comment>
|
||||
<name>matt</name>
|
||||
<in>3660</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>楼梯</comment>
|
||||
<name>matt</name>
|
||||
<in>3756</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>起飞</comment>
|
||||
<name>matt</name>
|
||||
<in>4434</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>发呆</comment>
|
||||
<name>matt</name>
|
||||
<in>5187</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>donedone</comment>
|
||||
<name>apple apple</name>
|
||||
<in>5670</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>markup</comment>
|
||||
<name>apple apple</name>
|
||||
<in>5787</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>notime</comment>
|
||||
<name>apple apple</name>
|
||||
<in>0</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
<marker>
|
||||
<comment>网吧</comment>
|
||||
<name>apple apple</name>
|
||||
<in>0</in>
|
||||
<out>-1</out>
|
||||
<pproColor>4294741314</pproColor>
|
||||
</marker>
|
||||
|
||||
</sequence>
|
||||
</xmeml>
|
||||
@@ -0,0 +1,74 @@
|
||||
TITLE: YTDown_YouTube_Ed-Sheeran-Pokemon-Celestial-Official-Vi_Media_23g5HBOg3Ic_002_720p.mp4
|
||||
FCM: NON DROP FRAME
|
||||
|
||||
001 001 C V 00:00:02:03 00:00:02:03 00:00:02:03 00:00:02:03
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
fly |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
002 001 C V 00:00:04:19 00:00:04:19 00:00:04:19 00:00:04:19
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
yellow |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
003 001 C V 00:00:17:00 00:00:17:00 00:00:17:00 00:00:17:00
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
foo
|
||||
@matt, Sep 13 03:26am [Reply]
|
||||
^ 火了
|
||||
@apple apple, Sep 13 03:26am [Reply]
|
||||
^ @matt 很棒 |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
004 001 C V 00:00:23:06 00:00:23:06 00:00:23:06 00:00:23:06
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
60 |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
005 001 C V 00:00:28:18 00:00:28:18 00:00:28:18 00:00:28:18
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
pi |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
006 001 C V 00:00:45:15 00:00:45:15 00:00:45:15 00:00:45:15
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
fir
|
||||
@matt, Sep 13 03:26am [Reply]
|
||||
^ 这个好吃 |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
007 001 C V 00:01:44:00 00:01:44:00 00:01:44:00 00:01:44:00
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
run |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
008 001 C V 00:01:54:06 00:01:54:06 00:01:54:06 00:01:54:06
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
good |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
009 001 C V 00:02:32:12 00:02:32:12 00:02:32:12 00:02:32:12
|
||||
@matt, Sep 13 13 03:26am
|
||||
yes |C:ResolveColorPurple |M:matt |D:0
|
||||
|
||||
010 001 C V 00:02:36:12 00:02:36:12 00:02:36:12 00:02:36:12
|
||||
@matt, Sep 13 13 03:26am
|
||||
楼梯 |C:ResolveColorPurple |M:matt |D:0
|
||||
|
||||
011 001 C V 00:03:04:18 00:03:04:18 00:03:04:18 00:03:04:18
|
||||
@matt, Sep 13 13 03:26am
|
||||
起飞 |C:ResolveColorPurple |M:matt |D:0
|
||||
|
||||
012 001 C V 00:03:36:03 00:03:36:03 00:03:36:03 00:03:36:03
|
||||
@matt, Sep 13 13 03:26am
|
||||
发呆 |C:ResolveColorPurple |M:matt |D:0
|
||||
|
||||
013 001 C V 00:03:56:06 00:03:56:06 00:03:56:06 00:03:56:06
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
donedone |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
014 001 C V 00:04:01:03 00:04:01:03 00:04:01:03 00:04:01:03
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
markup |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
015 001 C V 00:00:00:00 00:00:00:00 00:00:00:00 00:00:00:00
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
notime |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
016 001 C V 00:00:00:00 00:00:00:00 00:00:00:00 00:00:00:00
|
||||
@apple apple, Sep 13 13 03:26am
|
||||
网吧 |C:ResolveColorPurple |M:apple apple |D:0
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import type { CommentExportFormat } from '@shumai/dtos'
|
||||
import type { ExportAssetMetadata, ExportCommentItem, ExportOptions, ExportResult } from './types'
|
||||
import { exportToFcpFioJson } from './exporters/fcp-fiojson'
|
||||
import { exportToMediaComposerXml } from './exporters/media-composer-xml'
|
||||
import { exportToPremiereXml } from './exporters/premiere-xml'
|
||||
import { exportToResolveEdl } from './exporters/resolve-edl'
|
||||
|
||||
export * from './types'
|
||||
export * from './timecode'
|
||||
export * from './exporters/fcp-fiojson'
|
||||
export * from './exporters/media-composer-xml'
|
||||
export * from './exporters/premiere-xml'
|
||||
export * from './exporters/resolve-edl'
|
||||
|
||||
export const exportCommentsToFormat = (
|
||||
metadata: ExportAssetMetadata,
|
||||
comments: ExportCommentItem[],
|
||||
format: CommentExportFormat,
|
||||
options?: ExportOptions,
|
||||
): ExportResult => {
|
||||
switch (format) {
|
||||
case 'fcp-fiojson':
|
||||
return exportToFcpFioJson(metadata, comments, options)
|
||||
case 'media-composer-xml':
|
||||
return exportToMediaComposerXml(metadata, comments, options)
|
||||
case 'premiere-xml':
|
||||
return exportToPremiereXml(metadata, comments, options)
|
||||
case 'resolve-edl':
|
||||
return exportToResolveEdl(metadata, comments, options)
|
||||
default: {
|
||||
const _exhaustive: never = format
|
||||
throw new Error(`Unsupported comment export format: ${_exhaustive}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
formatDateAvid,
|
||||
formatDateEdl,
|
||||
formatDatePremiere,
|
||||
frameToTimecode,
|
||||
getEffectiveDropFrame,
|
||||
isDropFrameRate,
|
||||
secondToFrame,
|
||||
} from './timecode'
|
||||
|
||||
describe('Timecode and Frame utilities', () => {
|
||||
it('detects drop-frame frame rates correctly', () => {
|
||||
expect(isDropFrameRate(29.97)).toBe(true)
|
||||
expect(isDropFrameRate(59.94)).toBe(true)
|
||||
expect(isDropFrameRate(24)).toBe(false)
|
||||
expect(isDropFrameRate(23.976)).toBe(false)
|
||||
expect(isDropFrameRate(25)).toBe(false)
|
||||
expect(isDropFrameRate(30)).toBe(false)
|
||||
expect(isDropFrameRate(60)).toBe(false)
|
||||
})
|
||||
|
||||
it('determines effective drop-frame setting from fps and startTimecode separator', () => {
|
||||
// 29.97 with no startTimecode defaults to DF
|
||||
expect(getEffectiveDropFrame(29.97)).toBe(true)
|
||||
// 29.97 with NDF startTimecode (:) overrides to NDF
|
||||
expect(getEffectiveDropFrame(29.97, '01:00:00:00')).toBe(false)
|
||||
// 29.97 with DF startTimecode (;) remains DF
|
||||
expect(getEffectiveDropFrame(29.97, '01:00:00;00')).toBe(true)
|
||||
// 24 fps always defaults to NDF
|
||||
expect(getEffectiveDropFrame(24)).toBe(false)
|
||||
expect(getEffectiveDropFrame(24, '01:00:00:00')).toBe(false)
|
||||
// forced flag takes precedence
|
||||
expect(getEffectiveDropFrame(29.97, '01:00:00:00', true)).toBe(true)
|
||||
})
|
||||
|
||||
it('converts second to frame index with 0.45 offset', () => {
|
||||
expect(secondToFrame(null, 24)).toBe(0)
|
||||
expect(secondToFrame(undefined, 24)).toBe(0)
|
||||
expect(secondToFrame(0, 24)).toBe(0)
|
||||
// 2.168833s at 24000/1001 = 51.999992 -> +0.45 = 52.449992 -> 52 or 51?
|
||||
expect(secondToFrame(1.0, 24)).toBe(24)
|
||||
expect(secondToFrame(1.5, 24)).toBe(36)
|
||||
})
|
||||
|
||||
it('formats non-drop-frame timecode correctly', () => {
|
||||
expect(frameToTimecode(0, 24)).toBe('00:00:00:00')
|
||||
expect(frameToTimecode(24, 24)).toBe('00:00:01:00')
|
||||
expect(frameToTimecode(51, 24)).toBe('00:00:02:03')
|
||||
expect(frameToTimecode(115, 24)).toBe('00:00:04:19')
|
||||
expect(frameToTimecode(408, 24)).toBe('00:00:17:00')
|
||||
expect(frameToTimecode(2496, 24)).toBe('00:01:44:00')
|
||||
})
|
||||
|
||||
it('formats drop-frame timecode correctly for 29.97 fps', () => {
|
||||
expect(frameToTimecode(0, 29.97)).toBe('00:00:00;00')
|
||||
expect(frameToTimecode(30, 29.97)).toBe('00:00:01;00')
|
||||
// At minute 1, frames 0 and 1 are dropped in DF timecode
|
||||
expect(frameToTimecode(1799, 29.97)).toBe('00:00:59;29')
|
||||
expect(frameToTimecode(1800, 29.97)).toBe('00:01:00;02')
|
||||
})
|
||||
|
||||
it('respects startTimecode offset', () => {
|
||||
expect(frameToTimecode(0, 24, false, '01:00:00:00')).toBe('01:00:00:00')
|
||||
expect(frameToTimecode(24, 24, false, '01:00:00:00')).toBe('01:00:01:00')
|
||||
})
|
||||
|
||||
it('formats EDL dates matching expected reference patterns', () => {
|
||||
const testDate = new Date('2026-09-13T03:26:00Z')
|
||||
expect(formatDateEdl(testDate, false)).toBe('Sep 13 13 03:26am')
|
||||
expect(formatDateEdl(testDate, true)).toBe('Sep 13 03:26am')
|
||||
})
|
||||
|
||||
it('formats Avid dates matching expected reference patterns', () => {
|
||||
const testDate = new Date('2026-09-13T03:24:00Z')
|
||||
expect(formatDateAvid(testDate)).toBe('Sep 13, 2026 · 03:24')
|
||||
})
|
||||
|
||||
it('formats Premiere date matching expected sequence name suffix', () => {
|
||||
const testDate = new Date('2026-09-13T03:26:31Z')
|
||||
expect(formatDatePremiere(testDate)).toBe('2026-9-13 03-26-31')
|
||||
})
|
||||
|
||||
it('formats dates in custom timezones correctly', () => {
|
||||
const testDate = new Date('2026-09-13T03:26:31Z')
|
||||
// America/New_York is UTC-4 (EDT) -> Sep 12, 2026 23:26:31
|
||||
expect(formatDateEdl(testDate, false, 'America/New_York')).toBe('Sep 12 12 11:26pm')
|
||||
expect(formatDateEdl(testDate, true, 'America/New_York')).toBe('Sep 12 11:26pm')
|
||||
expect(formatDateAvid(testDate, 'America/New_York')).toBe('Sep 12, 2026 · 23:26')
|
||||
expect(formatDatePremiere(testDate, 'America/New_York')).toBe('2026-9-12 23-26-31')
|
||||
|
||||
// Asia/Shanghai is UTC+8 -> Sep 13, 2026 11:26:31
|
||||
expect(formatDatePremiere(testDate, 'Asia/Shanghai')).toBe('2026-9-13 11-26-31')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,192 @@
|
||||
export const isDropFrameRate = (fps: number): boolean => {
|
||||
const frameRateRound = Math.round(fps)
|
||||
const isFractional = fps !== frameRateRound
|
||||
return isFractional && (frameRateRound === 30 || frameRateRound === 60)
|
||||
}
|
||||
|
||||
export const getEffectiveDropFrame = (
|
||||
fps: number,
|
||||
startTimecode?: string | null,
|
||||
forcedDropFrame?: boolean,
|
||||
): boolean => {
|
||||
if (forcedDropFrame !== undefined) {
|
||||
return forcedDropFrame
|
||||
}
|
||||
if (startTimecode) {
|
||||
const parts = startTimecode.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/)
|
||||
if (parts) {
|
||||
return parts[4] !== ':'
|
||||
}
|
||||
}
|
||||
return isDropFrameRate(fps)
|
||||
}
|
||||
|
||||
export const secondToFrame = (second: number | null | undefined, fps: number): number => {
|
||||
if (second === null || second === undefined || isNaN(second)) {
|
||||
return 0
|
||||
}
|
||||
return Math.floor(second * fps)
|
||||
}
|
||||
|
||||
export const frameToTimecode = (
|
||||
frameIndex: number,
|
||||
fps: number,
|
||||
forcedDropFrame?: boolean,
|
||||
startTimecode?: string | null,
|
||||
): string => {
|
||||
const frameRateRound = Math.round(fps) || 24
|
||||
const dropFrame = getEffectiveDropFrame(fps, startTimecode, forcedDropFrame)
|
||||
|
||||
let startFrameCount = 0
|
||||
if (startTimecode) {
|
||||
const parts = startTimecode.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/)
|
||||
if (parts) {
|
||||
const hours = parseInt(parts[1], 10)
|
||||
const minutes = parseInt(parts[2], 10)
|
||||
const seconds = parseInt(parts[3], 10)
|
||||
const frames = parseInt(parts[5], 10)
|
||||
startFrameCount = (hours * 3600 + minutes * 60 + seconds) * frameRateRound + frames
|
||||
if (dropFrame) {
|
||||
const totalMinutes = hours * 60 + minutes
|
||||
const df = frameRateRound < 45 ? 2 : 4
|
||||
startFrameCount -= df * (totalMinutes - Math.floor(totalMinutes / 10))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let fc = frameIndex + startFrameCount
|
||||
|
||||
if (dropFrame) {
|
||||
const df = frameRateRound < 45 ? 2 : 4
|
||||
const d = Math.floor(fc / ((17982 * df) / 2))
|
||||
let m = fc % ((17982 * df) / 2)
|
||||
if (m < df) {
|
||||
m = m + df
|
||||
}
|
||||
fc += 9 * df * d + df * Math.floor((m - df) / ((1798 * df) / 2))
|
||||
}
|
||||
|
||||
const frames = fc % frameRateRound
|
||||
const seconds = Math.floor(fc / frameRateRound) % 60
|
||||
const minutes = Math.floor(fc / (frameRateRound * 60)) % 60
|
||||
const hours = Math.floor(fc / (frameRateRound * 3600)) % 24
|
||||
|
||||
const separator = dropFrame ? ';' : ':'
|
||||
return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}${separator}${frames.toString().padStart(2, '0')}`
|
||||
}
|
||||
|
||||
export interface DateTimeParts {
|
||||
year: number
|
||||
month: number
|
||||
day: number
|
||||
hour: number
|
||||
minute: number
|
||||
second: number
|
||||
}
|
||||
|
||||
export const getDateTimeParts = (date: Date, timeZone?: string): DateTimeParts => {
|
||||
if (!timeZone || timeZone.toUpperCase() === 'UTC') {
|
||||
return {
|
||||
year: date.getUTCFullYear(),
|
||||
month: date.getUTCMonth() + 1,
|
||||
day: date.getUTCDate(),
|
||||
hour: date.getUTCHours(),
|
||||
minute: date.getUTCMinutes(),
|
||||
second: date.getUTCSeconds(),
|
||||
}
|
||||
}
|
||||
|
||||
const formatter = new Intl.DateTimeFormat('en-US', {
|
||||
timeZone,
|
||||
year: 'numeric',
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
hour12: false,
|
||||
})
|
||||
|
||||
const parts = formatter.formatToParts(date)
|
||||
let year = 0
|
||||
let month = 0
|
||||
let day = 0
|
||||
let hour = 0
|
||||
let minute = 0
|
||||
let second = 0
|
||||
|
||||
for (const part of parts) {
|
||||
if (part.type === 'year') year = parseInt(part.value, 10)
|
||||
else if (part.type === 'month') month = parseInt(part.value, 10)
|
||||
else if (part.type === 'day') day = parseInt(part.value, 10)
|
||||
else if (part.type === 'hour') {
|
||||
const val = parseInt(part.value, 10)
|
||||
hour = val === 24 ? 0 : val
|
||||
} else if (part.type === 'minute') minute = parseInt(part.value, 10)
|
||||
else if (part.type === 'second') second = parseInt(part.value, 10)
|
||||
}
|
||||
|
||||
return { year, month, day, hour, minute, second }
|
||||
}
|
||||
|
||||
export const formatDateEdl = (date: Date, isReply = false, timeZone?: string): string => {
|
||||
const months = [
|
||||
'Jan',
|
||||
'Feb',
|
||||
'Mar',
|
||||
'Apr',
|
||||
'May',
|
||||
'Jun',
|
||||
'Jul',
|
||||
'Aug',
|
||||
'Sep',
|
||||
'Oct',
|
||||
'Nov',
|
||||
'Dec',
|
||||
]
|
||||
const parts = getDateTimeParts(date, timeZone)
|
||||
const month = months[parts.month - 1]
|
||||
const day = parts.day
|
||||
const hours = parts.hour
|
||||
const minutes = parts.minute.toString().padStart(2, '0')
|
||||
const ampm = hours >= 12 ? 'pm' : 'am'
|
||||
const hour12 = (hours % 12 || 12).toString().padStart(2, '0')
|
||||
const timeStr = `${hour12}:${minutes}${ampm}`
|
||||
|
||||
if (isReply) {
|
||||
return `${month} ${day} ${timeStr}`
|
||||
}
|
||||
return `${month} ${day} ${day} ${timeStr}`
|
||||
}
|
||||
|
||||
export const formatDateAvid = (date: Date, timeZone?: string): string => {
|
||||
const months = [
|
||||
'Jan',
|
||||
'Feb',
|
||||
'Mar',
|
||||
'Apr',
|
||||
'May',
|
||||
'Jun',
|
||||
'Jul',
|
||||
'Aug',
|
||||
'Sep',
|
||||
'Oct',
|
||||
'Nov',
|
||||
'Dec',
|
||||
]
|
||||
const parts = getDateTimeParts(date, timeZone)
|
||||
const month = months[parts.month - 1]
|
||||
const day = parts.day
|
||||
const year = parts.year
|
||||
const hours = parts.hour.toString().padStart(2, '0')
|
||||
const minutes = parts.minute.toString().padStart(2, '0')
|
||||
return `${month} ${day}, ${year} · ${hours}:${minutes}`
|
||||
}
|
||||
|
||||
export const formatDatePremiere = (date: Date, timeZone?: string): string => {
|
||||
const parts = getDateTimeParts(date, timeZone)
|
||||
const hours = parts.hour.toString().padStart(2, '0')
|
||||
const minutes = parts.minute.toString().padStart(2, '0')
|
||||
const seconds = parts.second.toString().padStart(2, '0')
|
||||
return `${parts.year}-${parts.month}-${parts.day} ${hours}-${minutes}-${seconds}`
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
export interface ExportCommentUser {
|
||||
id: string
|
||||
name: string
|
||||
image?: string | null
|
||||
email?: string | null
|
||||
avatarColor?: string | null
|
||||
}
|
||||
|
||||
export interface ExportCommentItem {
|
||||
id: string
|
||||
message: string | null
|
||||
second: number | null
|
||||
createdAt: Date | string
|
||||
isCompleted: boolean
|
||||
creator: ExportCommentUser
|
||||
annotations?: unknown
|
||||
replies?: ExportCommentItem[]
|
||||
}
|
||||
|
||||
export interface ExportAssetMetadata {
|
||||
id: string
|
||||
name: string
|
||||
fps: number
|
||||
duration: number
|
||||
totalFrames: number
|
||||
startTimecode?: string | null
|
||||
width?: number
|
||||
height?: number
|
||||
rawMedia?: unknown
|
||||
}
|
||||
|
||||
export interface ExportOptions {
|
||||
exportDate?: Date
|
||||
timeZone?: string
|
||||
}
|
||||
|
||||
export interface ExportResult {
|
||||
content: string
|
||||
filename: string
|
||||
mimeType: string
|
||||
}
|
||||
@@ -30,3 +30,4 @@ export * from './quota/quota-service'
|
||||
export * from './kanban/kanban'
|
||||
export * from './media-generation/media-generation'
|
||||
export * from './sandbox'
|
||||
export * from './asset/comments-export'
|
||||
|
||||
@@ -5,6 +5,8 @@ import { ProjectService } from './project'
|
||||
import { s3Service } from '@shumai/core/src/s3/s3'
|
||||
import { assetService } from '@shumai/core/src/asset/asset'
|
||||
|
||||
import { ensureJpegInStorage } from '@shumai/core/src/s3/preview-converter'
|
||||
|
||||
vi.mock('@shumai/core/src/s3/s3', () => ({
|
||||
s3Service: {
|
||||
presign: vi.fn(),
|
||||
@@ -13,6 +15,14 @@ vi.mock('@shumai/core/src/s3/s3', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('@shumai/core/src/s3/preview-converter', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import('@shumai/core/src/s3/preview-converter')>()
|
||||
return {
|
||||
...actual,
|
||||
ensureJpegInStorage: vi.fn().mockResolvedValue(undefined),
|
||||
}
|
||||
})
|
||||
|
||||
describe('ProjectService', () => {
|
||||
setupTestDbHooks()
|
||||
let projectService: ProjectService
|
||||
@@ -562,4 +572,116 @@ describe('ProjectService', () => {
|
||||
expect(result).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe('previewFormat handling', () => {
|
||||
it('converts webp cover to jpeg on demand and updates hasJpegCover in listProjects', async () => {
|
||||
const team = await prisma.team.create({ data: { name: 'Preview Team' } })
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'preview-u1', email: 'preview-u1@example.com' },
|
||||
})
|
||||
await prisma.teamMember.create({
|
||||
data: { teamId: team.id, userId: user.id, role: 'editor', scope: 'team' },
|
||||
})
|
||||
|
||||
const project = await prisma.project.create({
|
||||
data: {
|
||||
name: 'Proj WebP',
|
||||
teamId: team.id,
|
||||
coverImageKey: 'projects/p1/cover.webp',
|
||||
hasJpegCover: false,
|
||||
},
|
||||
})
|
||||
|
||||
const res = await projectService.listProjects({
|
||||
teamId: team.id,
|
||||
userId: user.id,
|
||||
previewFormat: 'jpeg',
|
||||
pagination: {},
|
||||
})
|
||||
|
||||
expect(res.data).toHaveLength(1)
|
||||
expect(ensureJpegInStorage).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'projects/p1/cover.webp',
|
||||
'projects/p1/cover.jpeg',
|
||||
)
|
||||
expect(s3Service.presign).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'projects/p1/cover.jpeg',
|
||||
'GET',
|
||||
)
|
||||
|
||||
const updated = await prisma.project.findUnique({ where: { id: project.id } })
|
||||
expect(updated?.hasJpegCover).toBe(true)
|
||||
})
|
||||
|
||||
it('skips conversion if hasJpegCover is already true in getUserProjects', async () => {
|
||||
vi.mocked(ensureJpegInStorage).mockClear()
|
||||
const team = await prisma.team.create({ data: { name: 'Preview Team 2' } })
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'preview-u2', email: 'preview-u2@example.com' },
|
||||
})
|
||||
await prisma.teamMember.create({
|
||||
data: { teamId: team.id, userId: user.id, role: 'editor', scope: 'team' },
|
||||
})
|
||||
|
||||
await prisma.project.create({
|
||||
data: {
|
||||
name: 'Proj JPEG',
|
||||
teamId: team.id,
|
||||
coverImageKey: 'projects/p2/cover.webp',
|
||||
hasJpegCover: true,
|
||||
},
|
||||
})
|
||||
|
||||
const result = await projectService.getUserProjects(user.id, 10, 'jpeg')
|
||||
|
||||
expect(result).toHaveLength(1)
|
||||
expect(ensureJpegInStorage).not.toHaveBeenCalled()
|
||||
expect(s3Service.presign).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'projects/p2/cover.jpeg',
|
||||
'GET',
|
||||
)
|
||||
})
|
||||
|
||||
it('resets hasJpegCover to false when coverImageKey changes during updateProject and reconverts', async () => {
|
||||
vi.mocked(ensureJpegInStorage).mockClear()
|
||||
const team = await prisma.team.create({ data: { name: 'Preview Team 3' } })
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'preview-u3', email: 'preview-u3@example.com' },
|
||||
})
|
||||
await prisma.teamMember.create({
|
||||
data: { teamId: team.id, userId: user.id, role: 'editor', scope: 'team' },
|
||||
})
|
||||
|
||||
const project = await prisma.project.create({
|
||||
data: {
|
||||
name: 'Proj Original',
|
||||
teamId: team.id,
|
||||
coverImageKey: 'projects/p3/original.webp',
|
||||
hasJpegCover: true,
|
||||
},
|
||||
})
|
||||
|
||||
await projectService.updateProject({
|
||||
projectId: project.id,
|
||||
coverImageKey: 'projects/p3/replacement.webp',
|
||||
})
|
||||
|
||||
const afterUpdate = await prisma.project.findUnique({ where: { id: project.id } })
|
||||
expect(afterUpdate?.coverImageKey).toBe('projects/p3/replacement.webp')
|
||||
expect(afterUpdate?.hasJpegCover).toBe(false)
|
||||
|
||||
const fetched = await projectService.getUserProjects(user.id, 10, 'jpeg')
|
||||
expect(fetched).toHaveLength(1)
|
||||
expect(ensureJpegInStorage).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
'projects/p3/replacement.webp',
|
||||
'projects/p3/replacement.jpeg',
|
||||
)
|
||||
const afterFetch = await prisma.project.findUnique({ where: { id: project.id } })
|
||||
expect(afterFetch?.hasJpegCover).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user