@volcengine/amk-editor 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/assets/asr-subtitle-dark.svg +3 -0
- package/dist/assets/asr-subtitle.svg +3 -0
- package/dist/assets/export-empty-img2.svg +2 -2
- package/dist/assets/export-empty-img3.svg +2 -2
- package/dist/assets/export-empty-subtract.svg +2 -2
- package/dist/assets/export-task-loading.svg +2 -2
- package/dist/export-project-adapter.d.ts +1 -1
- package/dist/header.d.ts +1 -1
- package/dist/i18n/keys.d.ts +1 -0
- package/dist/index.js +92 -92
- package/dist/types.d.ts +2 -0
- package/dist/veveditor.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,6 +75,7 @@ editor.destroy();
|
|
|
75
75
|
- `theme` 默认 `light`。未传或传入其他值时按浅色渲染;只有显式 `theme: 'dark'` 才走暗色。
|
|
76
76
|
- 产物是面向浏览器的单文件 ESM。依赖里的 AMD `define(["./core"])`、`define(["dayjs"])` 和 Node `require('crypto')` 兜底已在构建时剔除或中和,避免 Next.js / webpack / Rspack 误解析依赖或报告动态 require 警告;浏览器加密仍使用 Web Crypto。
|
|
77
77
|
- `getHeaders` 可选,每次请求前都会重新调用;SDK 不解析、不缓存、不改写返回值,仅将其合并到发往 `endpoint` 的工程、素材、tools、tasks、导出等请求中。闭包内 Token 更新会自动用于下一次请求。
|
|
78
|
+
- SDK 发往 `endpoint` 的全部 AMK 服务请求都会固定携带 `X-Amk-Task-Source: vibe-editing`,用于任务来源和用量归因;该字段不会被 `getHeaders` 或单次请求 Header 覆盖。跨域代理需在 CORS 配置中允许此请求头。成片 CDN 下载、TOS 直传等非 AMK 服务请求不携带该字段。
|
|
78
79
|
- 本地上传通过 `onUploadFile(file)` 实现单文件上传;SDK 负责多文件并发、逐项入库和部分失败收口。旧 `onUploadMaterial(files)` 仍兼容,但只能整批完成后入库。URL 导入仍由 `onUploadUrlMaterial` 完成。返回素材必须带业务主键 `source_material_id`,不必填写 `material_id`。
|
|
79
80
|
- 播放地址、封面、雪碧图可能有时效。通过 `onRefreshPlayInfo` 返回新的访问地址;补丁按 `material_id`、`source_material_id`、无标识时数组顺序依次匹配,未返回的字段保持原值。
|
|
80
81
|
- 可选实现 `onMaterialsImported`:素材成功入库后回调已合并 `material_id` 的列表;可用于把新素材挂到对话草稿。失败或取消不会触发。
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M16.4453 11.8203C16.5215 11.6151 16.8125 11.615 16.8887 11.8203L17.2354 12.7578C17.5223 13.5332 18.1337 14.1447 18.9092 14.4316L19.8457 14.7783C20.0513 14.8544 20.0513 15.1456 19.8457 15.2217L18.9092 15.5684C18.1337 15.8553 17.5223 16.4667 17.2354 17.2422L16.8887 18.1787C16.8126 18.3843 16.5214 18.3843 16.4453 18.1787L16.0986 17.2422C15.8117 16.4667 15.2002 15.8553 14.4248 15.5684L13.4873 15.2217C13.282 15.1456 13.2821 14.8545 13.4873 14.7783L14.4248 14.4316C15.2003 14.1447 15.8117 13.5333 16.0986 12.7578L16.4453 11.8203ZM15.5 2.63574C16.9497 2.63574 18.125 3.81099 18.125 5.26074V10.3506C17.732 10.1746 17.3125 10.0612 16.875 10.0195V5.26074C16.875 4.50135 16.2594 3.88574 15.5 3.88574H4.5C3.74061 3.88574 3.125 4.50135 3.125 5.26074V14.7412C3.12533 15.5003 3.74081 16.1162 4.5 16.1162H12.0713C12.1387 16.5544 12.2531 16.9734 12.4092 17.3662H4.5C3.05046 17.3662 1.87533 16.1907 1.875 14.7412V5.26074C1.875 3.811 3.05025 2.63574 4.5 2.63574H15.5ZM8.53809 6.66797C8.76813 6.66158 8.95482 6.84903 8.95508 7.0791V7.49609C8.95508 7.72638 8.76826 7.9126 8.53809 7.91992C7.78648 7.94386 7.14422 8.0412 6.67578 8.29395C6.41536 8.43446 6.2154 8.62038 6.0752 8.87305C5.93272 9.12992 5.83105 9.49448 5.83105 10.0215C5.83109 10.5385 5.94106 10.8932 6.0918 11.1436C6.24174 11.3925 6.45664 11.5789 6.73438 11.7197C7.22007 11.9659 7.85811 12.0557 8.53809 12.0791C8.76816 12.087 8.95495 12.2727 8.95508 12.5029V12.9199C8.95508 13.1502 8.76827 13.3379 8.53809 13.3311C7.77586 13.3082 6.9012 13.2067 6.16797 12.835C5.7182 12.6068 5.3104 12.2721 5.01953 11.7891C4.72945 11.3073 4.58012 10.7188 4.58008 10.0215C4.58008 9.33399 4.71324 8.74896 4.98145 8.26562C5.25199 7.77815 5.63892 7.43244 6.08203 7.19336C6.8121 6.79947 7.70686 6.69108 8.53809 6.66797ZM14.1631 6.66797C14.3931 6.66158 14.5798 6.84903 14.5801 7.0791V7.49609C14.5801 7.72638 14.3933 7.9126 14.1631 7.91992C13.4115 7.94385 12.7693 8.04125 12.3008 8.29395C12.0404 8.43446 11.8404 8.62038 11.7002 8.87305C11.5577 9.12992 11.4561 9.49441 11.4561 10.0215C11.4561 10.5383 11.5652 10.8933 11.7158 11.1436C11.8657 11.3925 12.0808 11.5789 12.3584 11.7197C12.6086 11.8466 12.8998 11.932 13.2158 11.9883C12.9248 12.3216 12.6817 12.6977 12.4961 13.1055C12.2536 13.037 12.0164 12.9483 11.793 12.835C11.3431 12.6068 10.9354 12.2722 10.6445 11.7891C10.3544 11.3073 10.2051 10.7189 10.2051 10.0215C10.2051 9.33399 10.3382 8.74896 10.6064 8.26562C10.877 7.7782 11.264 7.43243 11.707 7.19336C12.4371 6.79951 13.3319 6.69106 14.1631 6.66797Z" fill="#FFFFFF"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M16.4453 11.8203C16.5215 11.6151 16.8125 11.615 16.8887 11.8203L17.2354 12.7578C17.5223 13.5332 18.1337 14.1447 18.9092 14.4316L19.8457 14.7783C20.0513 14.8544 20.0513 15.1456 19.8457 15.2217L18.9092 15.5684C18.1337 15.8553 17.5223 16.4667 17.2354 17.2422L16.8887 18.1787C16.8126 18.3843 16.5214 18.3843 16.4453 18.1787L16.0986 17.2422C15.8117 16.4667 15.2002 15.8553 14.4248 15.5684L13.4873 15.2217C13.282 15.1456 13.2821 14.8545 13.4873 14.7783L14.4248 14.4316C15.2003 14.1447 15.8117 13.5333 16.0986 12.7578L16.4453 11.8203ZM15.5 2.63574C16.9497 2.63574 18.125 3.81099 18.125 5.26074V10.3506C17.732 10.1746 17.3125 10.0612 16.875 10.0195V5.26074C16.875 4.50135 16.2594 3.88574 15.5 3.88574H4.5C3.74061 3.88574 3.125 4.50135 3.125 5.26074V14.7412C3.12533 15.5003 3.74081 16.1162 4.5 16.1162H12.0713C12.1387 16.5544 12.2531 16.9734 12.4092 17.3662H4.5C3.05046 17.3662 1.87533 16.1907 1.875 14.7412V5.26074C1.875 3.811 3.05025 2.63574 4.5 2.63574H15.5ZM8.53809 6.66797C8.76813 6.66158 8.95482 6.84903 8.95508 7.0791V7.49609C8.95508 7.72638 8.76826 7.9126 8.53809 7.91992C7.78648 7.94386 7.14422 8.0412 6.67578 8.29395C6.41536 8.43446 6.2154 8.62038 6.0752 8.87305C5.93272 9.12992 5.83105 9.49448 5.83105 10.0215C5.83109 10.5385 5.94106 10.8932 6.0918 11.1436C6.24174 11.3925 6.45664 11.5789 6.73438 11.7197C7.22007 11.9659 7.85811 12.0557 8.53809 12.0791C8.76816 12.087 8.95495 12.2727 8.95508 12.5029V12.9199C8.95508 13.1502 8.76827 13.3379 8.53809 13.3311C7.77586 13.3082 6.9012 13.2067 6.16797 12.835C5.7182 12.6068 5.3104 12.2721 5.01953 11.7891C4.72945 11.3073 4.58012 10.7188 4.58008 10.0215C4.58008 9.33399 4.71324 8.74896 4.98145 8.26562C5.25199 7.77815 5.63892 7.43244 6.08203 7.19336C6.8121 6.79947 7.70686 6.69108 8.53809 6.66797ZM14.1631 6.66797C14.3931 6.66158 14.5798 6.84903 14.5801 7.0791V7.49609C14.5801 7.72638 14.3933 7.9126 14.1631 7.91992C13.4115 7.94385 12.7693 8.04125 12.3008 8.29395C12.0404 8.43446 11.8404 8.62038 11.7002 8.87305C11.5577 9.12992 11.4561 9.49441 11.4561 10.0215C11.4561 10.5383 11.5652 10.8933 11.7158 11.1436C11.8657 11.3925 12.0808 11.5789 12.3584 11.7197C12.6086 11.8466 12.8998 11.932 13.2158 11.9883C12.9248 12.3216 12.6817 12.6977 12.4961 13.1055C12.2536 13.037 12.0164 12.9483 11.793 12.835C11.3431 12.6068 10.9354 12.2722 10.6445 11.7891C10.3544 11.3073 10.2051 10.7189 10.2051 10.0215C10.2051 9.33399 10.3382 8.74896 10.6064 8.26562C10.877 7.7782 11.264 7.43243 11.707 7.19336C12.4371 6.79951 13.3319 6.69106 14.1631 6.66797Z" fill="#0C0D0E"/>
|
|
3
|
+
</svg>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="8.10667" height="8.10667" viewBox="0 0 8.10667 8.10667" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g id="亮星星 2" clip-path="url(#
|
|
2
|
+
<g id="亮星星 2" clip-path="url(#clip0_0_56)">
|
|
3
3
|
<path id="Vector" d="M4.72178 0.0990852C4.96717 0.862366 5.38047 1.56749 5.93858 2.15963L5.94346 2.16549L5.94932 2.17135C6.54343 2.73097 7.25119 3.14471 8.01671 3.3901C7.25251 3.63614 6.54588 4.04892 5.9503 4.60494L5.94346 4.6108L5.9376 4.61666C5.38399 5.2078 4.97211 5.91 4.72569 6.6694C4.48066 5.90138 4.06649 5.19104 3.50596 4.59518L3.5001 4.5903L3.49424 4.58444C2.9048 4.03018 2.20387 3.61912 1.44542 3.37448C2.20945 3.12888 2.91581 2.71544 3.50889 2.1567L3.52061 2.14498C4.07074 1.55544 4.4785 0.855605 4.72178 0.0990852Z" stroke="black" stroke-width="0.513422"/>
|
|
4
4
|
</g>
|
|
5
5
|
<defs>
|
|
6
|
-
<clipPath id="
|
|
6
|
+
<clipPath id="clip0_0_56">
|
|
7
7
|
<rect width="8.10667" height="8.10667" fill="white"/>
|
|
8
8
|
</clipPath>
|
|
9
9
|
</defs>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="5.40444" height="5.40444" viewBox="0 0 5.40444 5.40444" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g id="亮星星 3" clip-path="url(#
|
|
2
|
+
<g id="亮星星 3" clip-path="url(#clip0_0_53)">
|
|
3
3
|
<path id="Vector" d="M2.69939 1.13964C2.84679 1.48488 3.05486 1.80458 3.31658 2.08203L3.32146 2.08789L3.32732 2.09277C3.605 2.35412 3.92449 2.56167 4.2697 2.70898C3.92505 2.8561 3.6056 3.06362 3.32732 3.32324L3.3156 3.33496C3.05684 3.61106 2.85045 3.92819 2.7033 4.2705C2.55582 3.92326 2.34786 3.60135 2.08513 3.32226L2.07928 3.31738L2.07342 3.31152C1.7976 3.05238 1.48037 2.84671 1.13787 2.70019C1.48349 2.55281 1.80426 2.34662 2.0822 2.08496L2.09392 2.07324C2.3511 1.79786 2.55372 1.48077 2.69939 1.13964Z" stroke="black" stroke-width="0.513422"/>
|
|
4
4
|
</g>
|
|
5
5
|
<defs>
|
|
6
|
-
<clipPath id="
|
|
6
|
+
<clipPath id="clip0_0_53">
|
|
7
7
|
<rect width="5.40444" height="5.40444" fill="white"/>
|
|
8
8
|
</clipPath>
|
|
9
9
|
</defs>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="35.8047" height="35.7842" viewBox="0 0 35.8047 35.7842" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<g id="Subtract" style="mix-blend-mode:darken">
|
|
3
|
-
<path d="M17.9023 0C27.7895 2.20685e-05 35.8047 8.01516 35.8047 17.9023C35.8047 27.5139 28.2301 35.3544 18.7246 35.7842C26.836 34.7177 33.0977 27.7794 33.0977 19.377C33.0976 10.2363 25.6875 2.82642 16.5469 2.82617C7.67117 2.82617 0.426569 9.8124 0.0136719 18.5859C0.00515664 18.3591 0 18.1312 0 17.9023C1.66351e-05 8.01515 8.01515 0 17.9023 0Z" fill="url(#
|
|
3
|
+
<path d="M17.9023 0C27.7895 2.20685e-05 35.8047 8.01516 35.8047 17.9023C35.8047 27.5139 28.2301 35.3544 18.7246 35.7842C26.836 34.7177 33.0977 27.7794 33.0977 19.377C33.0976 10.2363 25.6875 2.82642 16.5469 2.82617C7.67117 2.82617 0.426569 9.8124 0.0136719 18.5859C0.00515664 18.3591 0 18.1312 0 17.9023C1.66351e-05 8.01515 8.01515 0 17.9023 0Z" fill="url(#paint0_linear_0_68)"/>
|
|
4
4
|
</g>
|
|
5
5
|
<defs>
|
|
6
|
-
<linearGradient id="
|
|
6
|
+
<linearGradient id="paint0_linear_0_68" x1="-3.70393" y1="10.985" x2="35.98" y2="10.999" gradientUnits="userSpaceOnUse">
|
|
7
7
|
<stop offset="0.298077" stop-color="#0066FF"/>
|
|
8
8
|
<stop offset="0.710478" stop-color="#916DF5"/>
|
|
9
9
|
<stop offset="0.785044" stop-color="#FF8C45"/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<g id="Loading-progress">
|
|
3
|
-
<path id="Vector (Stroke)" opacity="0.3" d="M15.1875 9C15.1875 5.58274 12.4172 2.8125 9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4172 5.58274 15.1875 9 15.1875C12.4172 15.1875 15.1875 12.4172 15.1875 9ZM16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9Z" fill="#
|
|
4
|
-
<path id="Vector (Stroke)_2" d="M15.1875 9C15.1875 8.68934 15.4393 8.4375 15.75 8.4375C16.0607 8.4375 16.3125 8.68934 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C8.68934 16.3125 8.4375 16.0607 8.4375 15.75C8.4375 15.4393 8.68934 15.1875 9 15.1875C12.4172 15.1875 15.1875 12.4172 15.1875 9Z" fill="#
|
|
3
|
+
<path id="Vector (Stroke)" opacity="0.3" d="M15.1875 9C15.1875 5.58274 12.4172 2.8125 9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4172 5.58274 15.1875 9 15.1875C12.4172 15.1875 15.1875 12.4172 15.1875 9ZM16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9Z" fill="#101013"/>
|
|
4
|
+
<path id="Vector (Stroke)_2" d="M15.1875 9C15.1875 8.68934 15.4393 8.4375 15.75 8.4375C16.0607 8.4375 16.3125 8.68934 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C8.68934 16.3125 8.4375 16.0607 8.4375 15.75C8.4375 15.4393 8.68934 15.1875 9 15.1875C12.4172 15.1875 15.1875 12.4172 15.1875 9Z" fill="#101013"/>
|
|
5
5
|
</g>
|
|
6
6
|
</svg>
|
|
@@ -5,7 +5,7 @@ import type { ExportVideoParams } from './types';
|
|
|
5
5
|
* - standard / professional → POST .../tools/enhance-video,带 tool_version
|
|
6
6
|
* video_url 由代理在导出完成后再填;关闭增强时返回 undefined。
|
|
7
7
|
*/
|
|
8
|
-
export declare function buildExportCallbackArgs(params: Pick<ExportVideoParams, 'qualityEnhancement' | 'enhancementVersion' | 'resolution' | 'frameRate'>): string | undefined;
|
|
8
|
+
export declare function buildExportCallbackArgs(params: Pick<ExportVideoParams, 'qualityEnhancement' | 'keepOriginal' | 'enhancementVersion' | 'resolution' | 'frameRate'>): string | undefined;
|
|
9
9
|
/**
|
|
10
10
|
* 临时导出兜底:
|
|
11
11
|
* 根据目标分辨率短边等比缩放 Canvas、Track 元素和 Extra。
|
package/dist/header.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface CreateAmkEditorLayoutOptions {
|
|
|
22
22
|
onBack?: () => void;
|
|
23
23
|
/** 传入则展示关闭按钮 */
|
|
24
24
|
onClose?: () => void;
|
|
25
|
-
onTitleSubmit?: (title: string) => void
|
|
25
|
+
onTitleSubmit?: (title: string) => void | Promise<void>;
|
|
26
26
|
i18n?: AmkI18nInstance;
|
|
27
27
|
}
|
|
28
28
|
export type AmkSaveStatus = 'saving' | 'saved';
|
package/dist/i18n/keys.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ export declare const AMK_I18N_KEYS: {
|
|
|
90
90
|
readonly aiEnhanceTag: "amk.export.aiEnhanceTag";
|
|
91
91
|
readonly billingHintPrefix: "amk.export.billingHintPrefix";
|
|
92
92
|
readonly billingRules: "amk.export.billingRules";
|
|
93
|
+
readonly keepOriginal: "amk.export.keepOriginal";
|
|
93
94
|
readonly enhancementVersion: "amk.export.enhancementVersion";
|
|
94
95
|
readonly resolution: "amk.export.resolution";
|
|
95
96
|
readonly enhancedResolution: "amk.export.enhancedResolution";
|