@vvfx/sdk 0.2.2-beta.1 → 0.2.2-beta.12
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/dist/{src/config.d.ts → config.d.ts} +24 -1
- package/dist/{src/html-overlay → html-overlay}/auto-height-runtime.d.ts +5 -0
- package/dist/{src/html-overlay → html-overlay}/manager.d.ts +53 -0
- package/dist/{src/html-overlay → html-overlay}/overlay-transform.d.ts +3 -1
- package/dist/{src/index.d.ts → index.d.ts} +2 -2
- package/dist/index.js +960 -204
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +960 -204
- package/dist/index.mjs.map +1 -1
- package/dist/layer-order.d.ts +7 -0
- package/dist/{src/sdk-item → sdk-item}/card-item.d.ts +2 -6
- package/dist/{src/sdk.d.ts → sdk.d.ts} +22 -2
- package/dist/{src/types.d.ts → types.d.ts} +17 -18
- package/dist/{src/utils → utils}/page-data-utils.d.ts +11 -0
- package/package.json +2 -2
- /package/dist/{src/exporter → exporter}/config.d.ts +0 -0
- /package/dist/{src/exporter → exporter}/const.d.ts +0 -0
- /package/dist/{src/exporter → exporter}/export-media.d.ts +0 -0
- /package/dist/{src/exporter → exporter}/exporter.d.ts +0 -0
- /package/dist/{src/exporter → exporter}/index.d.ts +0 -0
- /package/dist/{src/exporter → exporter}/types.d.ts +0 -0
- /package/dist/{src/exporter → exporter}/utils.d.ts +0 -0
- /package/dist/{src/exporter → exporter}/wav-audio.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/adsorption-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/control-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/icon-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/index.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/item-create-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/loading-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/mask-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/picture-cut-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/picture-expand-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/preference-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/selector-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/sprite-text-edit-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/text-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/transform-gizmo.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/gizmo/type.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/index.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/src/gesture-handler.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/src/icons.d.ts +0 -0
- /package/dist/{src/gesture-handler → gesture-handler}/utils.d.ts +0 -0
- /package/dist/{src/html-overlay → html-overlay}/document-runtime.d.ts +0 -0
- /package/dist/{src/html-overlay → html-overlay}/document-transform.d.ts +0 -0
- /package/dist/{src/html-overlay → html-overlay}/dom-order.d.ts +0 -0
- /package/dist/{src/html-overlay → html-overlay}/host-message-runtime.d.ts +0 -0
- /package/dist/{src/html-overlay → html-overlay}/html-viewport-style.d.ts +0 -0
- /package/dist/{src/html-overlay → html-overlay}/index.d.ts +0 -0
- /package/dist/{src/html-overlay → html-overlay}/mime-utils.d.ts +0 -0
- /package/dist/{src/html-overlay → html-overlay}/path-utils.d.ts +0 -0
- /package/dist/{src/html-overlay → html-overlay}/shell-runtime.d.ts +0 -0
- /package/dist/{src/math → math}/box2.d.ts +0 -0
- /package/dist/{src/math → math}/circle.d.ts +0 -0
- /package/dist/{src/math → math}/euler.d.ts +0 -0
- /package/dist/{src/math → math}/index.d.ts +0 -0
- /package/dist/{src/math → math}/line2.d.ts +0 -0
- /package/dist/{src/math → math}/line3.d.ts +0 -0
- /package/dist/{src/math → math}/matrix4.d.ts +0 -0
- /package/dist/{src/math → math}/plane.d.ts +0 -0
- /package/dist/{src/math → math}/quaternion.d.ts +0 -0
- /package/dist/{src/math → math}/ray-caster.d.ts +0 -0
- /package/dist/{src/math → math}/ray.d.ts +0 -0
- /package/dist/{src/math → math}/type.d.ts +0 -0
- /package/dist/{src/math → math}/utils.d.ts +0 -0
- /package/dist/{src/math → math}/vector2.d.ts +0 -0
- /package/dist/{src/math → math}/vector3.d.ts +0 -0
- /package/dist/{src/screen-shot → screen-shot}/index.d.ts +0 -0
- /package/dist/{src/screen-shot → screen-shot}/screen-shot.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/base-item.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/effects-item.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/frame-item.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/generator-item.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/group-item.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/index.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/sprite-item.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/text-item.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/types.d.ts +0 -0
- /package/dist/{src/sdk-item → sdk-item}/video-item.d.ts +0 -0
- /package/dist/{src/service → service}/UndoRedo.d.ts +0 -0
- /package/dist/{src/shared → shared}/index.d.ts +0 -0
- /package/dist/{src/shared → shared}/player.d.ts +0 -0
- /package/dist/{src/size-adapte → size-adapte}/index.d.ts +0 -0
- /package/dist/{src/size-adapte → size-adapte}/size-adapt.d.ts +0 -0
- /package/dist/{src/utils → utils}/background-manager.d.ts +0 -0
- /package/dist/{src/utils → utils}/common-utils.d.ts +0 -0
- /package/dist/{src/utils → utils}/index.d.ts +0 -0
- /package/dist/{src/utils → utils}/interaction-utils.d.ts +0 -0
- /package/dist/{src/utils → utils}/json-data-utils.d.ts +0 -0
- /package/dist/{src/utils → utils}/layout-utils.d.ts +0 -0
- /package/dist/{src/utils → utils}/player-data-utils.d.ts +0 -0
- /package/dist/{src/utils → utils}/types.d.ts +0 -0
- /package/dist/{src/wireframe → wireframe}/common/box.d.ts +0 -0
- /package/dist/{src/wireframe → wireframe}/common/dashed-line.d.ts +0 -0
- /package/dist/{src/wireframe → wireframe}/common/line.d.ts +0 -0
- /package/dist/{src/wireframe → wireframe}/common/pixi-ext.d.ts +0 -0
- /package/dist/{src/wireframe → wireframe}/common/pixi.d.ts +0 -0
- /package/dist/{src/wireframe → wireframe}/index.d.ts +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type SDKCanvasLayers = {
|
|
2
|
+
container: HTMLElement;
|
|
3
|
+
playerContainer?: HTMLElement;
|
|
4
|
+
htmlOverlayLayer?: HTMLElement;
|
|
5
|
+
gestureCanvas?: HTMLElement;
|
|
6
|
+
};
|
|
7
|
+
export declare function orderSDKCanvasLayers({ container, playerContainer, htmlOverlayLayer, gestureCanvas, }: SDKCanvasLayers): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CardItemProperty, CardCreateInfo
|
|
1
|
+
import type { CardItemProperty, CardCreateInfo } from '../types';
|
|
2
2
|
import { SDKItemType, type CardItemOptions } from './types';
|
|
3
3
|
import { BaseItem } from './base-item';
|
|
4
4
|
/**
|
|
@@ -21,16 +21,12 @@ export declare class CardItem extends BaseItem {
|
|
|
21
21
|
*/
|
|
22
22
|
get cardType(): string;
|
|
23
23
|
set cardType(value: string);
|
|
24
|
-
/**
|
|
25
|
-
* @description HTML 覆盖层配置
|
|
26
|
-
*/
|
|
27
|
-
get html(): CardHTML | undefined;
|
|
28
|
-
set html(value: CardHTML | undefined);
|
|
29
24
|
/**
|
|
30
25
|
* @description 位置
|
|
31
26
|
*/
|
|
32
27
|
get position(): [number, number];
|
|
33
28
|
set position(value: [number, number]);
|
|
29
|
+
get isAutoScale(): boolean;
|
|
34
30
|
/**
|
|
35
31
|
* @description 宽度
|
|
36
32
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Player, spec } from './shared';
|
|
2
|
-
import type { SDKInputParam, PageConfig, PageData, SetItemPropertyParam, ViewProperty, ViewParam, ExportParam, SDKBackgroundType, SpriteCreateInfo, GroupCreateInfo, ItemCreateInfo, TextCreateInfo, ViewportFitShiftParam, SceneCreaetInfo, VideoCreateInfo, GeneratorCreateInfo, GeneratorResource, VideoGeneratorResource, SpriteGeneratorResource, EffectsCreateInfo, FrameCreateInfo, CardCreateInfo, CardItemTransformInfo, PageAutoLayoutParam } from './types';
|
|
2
|
+
import type { SDKInputParam, PageConfig, PageData, SetItemPropertyParam, ViewProperty, ViewParam, ExportParam, SDKBackgroundType, SpriteCreateInfo, GroupCreateInfo, ItemCreateInfo, TextCreateInfo, ViewportFitShiftParam, SceneCreaetInfo, VideoCreateInfo, GeneratorCreateInfo, GeneratorResource, VideoGeneratorResource, SpriteGeneratorResource, EffectsCreateInfo, FrameCreateInfo, CardCreateInfo, CardHTML, CardItemTransformInfo, PageAutoLayoutParam } from './types';
|
|
3
3
|
import { SDKItemType } from './sdk-item/types';
|
|
4
4
|
import type { CardTypeConfig } from './config';
|
|
5
5
|
import { ItemOrderAction } from './types';
|
|
@@ -10,7 +10,7 @@ import { Box2, Vector2 } from './math';
|
|
|
10
10
|
import { GizmoOperation, Operation, UndoRedo } from './service/UndoRedo';
|
|
11
11
|
import { GestureHandlerInteractType, GizmoType, ItemCreateType, SpriteTextInitParam } from './gesture-handler/gizmo';
|
|
12
12
|
import { AlignType, DistributeType } from './utils/types';
|
|
13
|
-
import { SDKItem } from './sdk-item';
|
|
13
|
+
import { SDKItem, type CardItem } from './sdk-item';
|
|
14
14
|
import type { LoadingGizmoItemOptions, LoadingGizmoTip } from './gesture-handler/gizmo/loading-gizmo';
|
|
15
15
|
import type { MaskUndoRedoData } from './gesture-handler/gizmo/mask-gizmo';
|
|
16
16
|
import type { PictureCutUndoRedoData } from './gesture-handler/gizmo/picture-cut-gizmo';
|
|
@@ -99,6 +99,7 @@ export declare class SDK {
|
|
|
99
99
|
on: <E extends "progress" | "loadingItemChange" | "selectedItemChange" | "preSelectedItemChange" | "selectedViewChange" | "pageDataChange" | "zoomChange" | "itemPropertyChange" | "exportProgress" | "exportDone" | "exportComplete" | "sdkConfigChange" | "cutBoxChange" | "expandBoxChange" | "textInput" | "undoRedoChange" | "maskGizmoUndoRedoChange" | "pictureCutGizmoUndoRedoChange" | "viewportTransform" | "itemOnDragStart" | "itemOnDrag" | "itemOnDragEnd" | "spriteTextClick" | "videoPlay" | "itemCreate" | "cardItemTransformChange" | "viewLost" | "viewRebuildFinish">(eventName: E, listener: import("@galacean/effects").EventEmitterListener<SDKEvents[E]>, options?: import("@galacean/effects").EventEmitterOptions) => () => void;
|
|
100
100
|
initPlayer(mode: SDKMode): void;
|
|
101
101
|
setSDKMode(mode: SDKMode): void;
|
|
102
|
+
private syncCanvasLayerOrder;
|
|
102
103
|
private getInitParam;
|
|
103
104
|
private initExporter;
|
|
104
105
|
private initSDK;
|
|
@@ -507,6 +508,25 @@ export declare class SDK {
|
|
|
507
508
|
* @returns 是否已注册
|
|
508
509
|
*/
|
|
509
510
|
isCardTypeRegistered(type: string): boolean;
|
|
511
|
+
/**
|
|
512
|
+
* @description 按 cardType 从注册表解析卡片的 HTML 渲染配置。
|
|
513
|
+
* @param item 卡片元素
|
|
514
|
+
* @returns HTML 渲染配置
|
|
515
|
+
*/
|
|
516
|
+
resolveCardHTML(item: CardItem): CardHTML | undefined;
|
|
517
|
+
/**
|
|
518
|
+
* @description 按 cardType 从注册表解析卡片类型配置。
|
|
519
|
+
* @param item 卡片元素
|
|
520
|
+
* @returns 卡片类型配置
|
|
521
|
+
*/
|
|
522
|
+
resolveCardTypeConfig(item: CardItem): CardTypeConfig | undefined;
|
|
523
|
+
/**
|
|
524
|
+
* @description 重新解析并挂载指定卡片的 HTML 内容。
|
|
525
|
+
* @description 当 inline/document 内容依赖 extension 或外部状态变化时,可调用此方法刷新 DOM。
|
|
526
|
+
* @param id 卡片元素 ID
|
|
527
|
+
* @returns 是否成功触发刷新
|
|
528
|
+
*/
|
|
529
|
+
refreshCardHTML(id: string): boolean;
|
|
510
530
|
/**
|
|
511
531
|
* @description 创建卡片元素
|
|
512
532
|
* @description 底层以透明 SpriteItem 形式渲染,支持 cardType 属性
|
|
@@ -204,6 +204,17 @@ export type CardHTMLShellContent = {
|
|
|
204
204
|
*/
|
|
205
205
|
render: CardHTMLShellRenderer;
|
|
206
206
|
};
|
|
207
|
+
export type CardHTMLRootStyle = Record<string, string | number | undefined>;
|
|
208
|
+
export type CardHTMLRootConfig = {
|
|
209
|
+
/**
|
|
210
|
+
* @description 追加到 HTML 内容根节点的 className。
|
|
211
|
+
*/
|
|
212
|
+
className?: string;
|
|
213
|
+
/**
|
|
214
|
+
* @description 应用到 HTML 内容根节点的内联样式。
|
|
215
|
+
*/
|
|
216
|
+
style?: CardHTMLRootStyle;
|
|
217
|
+
};
|
|
207
218
|
/**
|
|
208
219
|
* @description Card HTML 覆盖层配置。
|
|
209
220
|
*/
|
|
@@ -216,23 +227,19 @@ export type CardHTML = {
|
|
|
216
227
|
* @description HTML 外壳,用于定制承载 content 的容器。
|
|
217
228
|
*/
|
|
218
229
|
shell?: CardHTMLShellContent;
|
|
230
|
+
/**
|
|
231
|
+
* @description HTML 内容根节点样式配置,用于按内容实例设置 className 或内联 style。
|
|
232
|
+
*/
|
|
233
|
+
root?: CardHTMLRootConfig;
|
|
219
234
|
};
|
|
220
235
|
/**
|
|
221
236
|
* @description Card 卡片元素属性
|
|
222
237
|
*/
|
|
223
238
|
export type CardItemProperty = BaseItemProperty & {
|
|
224
239
|
/**
|
|
225
|
-
* @description
|
|
240
|
+
* @description 卡片类型(动态配置,需通过 SDK.registerCardType/registerCardTypes 注册)
|
|
226
241
|
*/
|
|
227
242
|
cardType: string;
|
|
228
|
-
/**
|
|
229
|
-
* @description 是否根据 HTML 挂载内容的自然高度自动更新卡片高度
|
|
230
|
-
*/
|
|
231
|
-
autoHeight?: boolean;
|
|
232
|
-
/**
|
|
233
|
-
* @description HTML 覆盖层配置;存在该字段时由 DOM overlay 渲染
|
|
234
|
-
*/
|
|
235
|
-
html?: CardHTML;
|
|
236
243
|
};
|
|
237
244
|
/**
|
|
238
245
|
* @description Frame 画板元素布局模式
|
|
@@ -927,7 +934,7 @@ export type CardItemTransformInfo = {
|
|
|
927
934
|
size: [number, number];
|
|
928
935
|
};
|
|
929
936
|
/**
|
|
930
|
-
* @description
|
|
937
|
+
* @description 卡片类型(动态配置,需通过 SDK.registerCardType/registerCardTypes 注册)
|
|
931
938
|
*/
|
|
932
939
|
export type CardType = string;
|
|
933
940
|
/**
|
|
@@ -970,10 +977,6 @@ export type CardCreateInfo = {
|
|
|
970
977
|
* @description 卡片元素像素高度
|
|
971
978
|
*/
|
|
972
979
|
height: number;
|
|
973
|
-
/**
|
|
974
|
-
* @description 是否根据 HTML 挂载内容的自然高度自动更新卡片高度
|
|
975
|
-
*/
|
|
976
|
-
autoHeight?: boolean;
|
|
977
980
|
/**
|
|
978
981
|
* @description 卡片元素位置
|
|
979
982
|
*/
|
|
@@ -986,10 +989,6 @@ export type CardCreateInfo = {
|
|
|
986
989
|
* @description 卡片元素缩放
|
|
987
990
|
*/
|
|
988
991
|
scale?: [number, number];
|
|
989
|
-
/**
|
|
990
|
-
* @description HTML 覆盖层配置;存在该字段时由 DOM overlay 渲染
|
|
991
|
-
*/
|
|
992
|
-
html?: CardHTML;
|
|
993
992
|
};
|
|
994
993
|
};
|
|
995
994
|
/**
|
|
@@ -88,6 +88,10 @@ export declare class PageDataUtils {
|
|
|
88
88
|
* 2. 单个元素多个属性: { itemId, type, property }
|
|
89
89
|
*/
|
|
90
90
|
setItemProperty<T extends SDKItemType>(param: SetItemPropertyParam<T>): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* @description 设置元素extension字段
|
|
93
|
+
*/
|
|
94
|
+
setItemExtension(itemId: string, extension: Record<string, any>): void;
|
|
91
95
|
/**
|
|
92
96
|
* @description 场景 1: 设置单个元素的单个属性
|
|
93
97
|
*/
|
|
@@ -333,6 +337,13 @@ export declare class PageDataUtils {
|
|
|
333
337
|
* @param targetParentVFXItem 目标父 VFXItem(移入 Frame 时为 compositionItem,移出 Frame 时为 composition.rootItem)
|
|
334
338
|
*/
|
|
335
339
|
getItemTransformUnderParent(itemId: string, targetParentVFXItem: VFXItem): MoveItemTransformOptions | undefined;
|
|
340
|
+
/**
|
|
341
|
+
* @description 修改画板元素大小
|
|
342
|
+
* @param id 元素id
|
|
343
|
+
* @param size 目标大小 [width, height]
|
|
344
|
+
* @param translation 位置偏移补偿(可选,用于保持拖拽角点固定)
|
|
345
|
+
*/
|
|
346
|
+
resizeCardItem(id: string, size: spec.vec2, translation?: Vector3): void;
|
|
336
347
|
/**
|
|
337
348
|
* @description 修改画板元素大小
|
|
338
349
|
* @param id 元素id
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvfx/sdk",
|
|
3
3
|
"description": "TODO",
|
|
4
|
-
"version": "0.2.2-beta.
|
|
4
|
+
"version": "0.2.2-beta.12",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"prebuild": "pnpm clean",
|
|
69
69
|
"build": "pnpm build:declaration && pnpm build:module",
|
|
70
70
|
"build:module": "rollup -c --bundleConfigAsCjs",
|
|
71
|
-
"build:declaration": "tsc -
|
|
71
|
+
"build:declaration": "tsc -p tsconfig.build.json",
|
|
72
72
|
"clean": "rimraf dist *.tsbuildinfo",
|
|
73
73
|
"test": "vitest run"
|
|
74
74
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|