@vvfx/sdk 0.1.19-alpha.10 → 0.1.19-alpha.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/index.d.cts CHANGED
@@ -1375,6 +1375,39 @@ declare enum FrameLayoutMode {
1375
1375
  AUTO = "auto",
1376
1376
  FREE = "free"
1377
1377
  }
1378
+ /**
1379
+ * @description 自动布局配置
1380
+ */
1381
+ type AutoLayoutConfig = {
1382
+ /**
1383
+ * @description 单行最大宽度(像素),超过后自动换行。未设置时不限制
1384
+ */
1385
+ maxRowWidth?: number;
1386
+ /**
1387
+ * @description 最大行数限制。未设置时不限制
1388
+ */
1389
+ maxRowCount?: number;
1390
+ };
1391
+ /**
1392
+ * @description 元素在自动布局中的位置信息
1393
+ */
1394
+ type LayoutInfo = {
1395
+ /**
1396
+ * @description 所在行号(可为小数)
1397
+ * 整数部分:主行号(0, 1, 2...)
1398
+ * 小数部分:分行后的子行号(如 1.5 表示第1行的第5个子行)
1399
+ * 仅支持两层(即小数部分为 0-9)
1400
+ */
1401
+ row: number;
1402
+ /**
1403
+ * @description 所在列号(必须为整数)
1404
+ */
1405
+ column: number;
1406
+ /**
1407
+ * @description 元素在布局中的位置(相对于画板左上角,可选)
1408
+ */
1409
+ position?: [number, number];
1410
+ };
1378
1411
  /**
1379
1412
  * @description Frame 画板元素属性
1380
1413
  */
@@ -1387,6 +1420,15 @@ type FrameItemProperty = BaseItemProperty & {
1387
1420
  * @description 子元素ID数组
1388
1421
  */
1389
1422
  children: string[];
1423
+ /**
1424
+ * @description 自动布局配置
1425
+ */
1426
+ autoLayoutConfig?: AutoLayoutConfig;
1427
+ /**
1428
+ * @description 子元素布局位置信息(用于自动布局)
1429
+ * key: 子元素ID, value: 元素的位置信息
1430
+ */
1431
+ layoutInfos?: Record<string, LayoutInfo>;
1390
1432
  };
1391
1433
  /**
1392
1434
  * @description BaseItem 基础属性键名
@@ -1739,7 +1781,7 @@ type SpriteCreateInfo = {
1739
1781
  };
1740
1782
  };
1741
1783
  /**
1742
- * @description 空节点创建信息
1784
+ * @description 组 元素创建信息
1743
1785
  */
1744
1786
  type GroupCreateInfo = {
1745
1787
  type: SDKItemType.GROUP;
@@ -2164,6 +2206,15 @@ type FrameCreateInfo = {
2164
2206
  * @description 子元素序号
2165
2207
  */
2166
2208
  children: string[];
2209
+ /**
2210
+ * @description 自动布局配置
2211
+ */
2212
+ autoLayoutConfig?: AutoLayoutConfig;
2213
+ /**
2214
+ * @description 子元素布局位置信息(用于自动布局)
2215
+ * key: 子元素ID, value: 元素的位置信息
2216
+ */
2217
+ layoutInfos?: Record<string, LayoutInfo>;
2167
2218
  };
2168
2219
  /**
2169
2220
  * @description 扩展属性
@@ -2304,8 +2355,25 @@ type SDKConfig = {
2304
2355
  videoPlayGizmoConfig: VideoPlayGizmoConfig;
2305
2356
  itemCreateGizmoEnabled: boolean;
2306
2357
  itemCreateGizmoConfig: ItemCreateGizmoConfig;
2358
+ /**
2359
+ * @description 自动布局指示器配置
2360
+ */
2361
+ autoLayoutIndicatorConfig: AutoLayoutIndicatorConfig;
2307
2362
  };
2308
2363
  };
2364
+ /**
2365
+ * @description 自动布局指示器配置
2366
+ */
2367
+ type AutoLayoutIndicatorConfig = {
2368
+ /**
2369
+ * @description 指示线宽度
2370
+ */
2371
+ lineWidth: number;
2372
+ /**
2373
+ * @description 指示线颜色
2374
+ */
2375
+ lineColor: number;
2376
+ };
2309
2377
  /**
2310
2378
  * @description 页面功能配置
2311
2379
  */
@@ -3411,6 +3479,7 @@ declare class SDK {
3411
3479
  getItemCreateInfos(ids?: string[]): ItemCreateInfo[];
3412
3480
  createScreenShotSceneByIds(idInfo: string | string[], time?: number): Promise<string | undefined>;
3413
3481
  createScreenShotByFrame(id: string): Promise<string | undefined>;
3482
+ createScreenShotByEffects(id: string): Promise<string | undefined>;
3414
3483
  getChildrenIds(id: string): string[];
3415
3484
  /**
3416
3485
  * @description 更新元素在图层中的顺序
@@ -3571,6 +3640,18 @@ declare class SDK {
3571
3640
  closeItemCreateGizmo(): void;
3572
3641
  setItemName(id: string, name: string): void;
3573
3642
  setSafeAreaPreviewVisible(id: number, type: 'url' | 'color', visible: boolean): void;
3643
+ /**
3644
+ * @description 修改画板元素大小
3645
+ * @param id 元素id
3646
+ * @param size 目标大小 [width, height]
3647
+ * @param translation 位置偏移补偿(可选,用于保持拖拽角点固定)
3648
+ */
3649
+ resizeFrameItem(id: string, size: [number, number], translation?: [number, number]): void;
3650
+ /**
3651
+ * @description 对 FrameItem 执行自动布局(当 layoutMode 为 AUTO 时使用)
3652
+ * @param frameId Frame 元素 ID
3653
+ */
3654
+ applyFrameAutoLayout(frameId: string): void;
3574
3655
  }
3575
3656
 
3576
3657
  export { type ActiveData, BaseItem, type BaseItemProperty, type BaseItemPropertyKey, type BaseItemPropertyValueMap, Box2, type CreateOperation, type DeleteOperation, type EffectsCreateInfo, EffectsItem, type EffectsItemOptions, type FrameCreateInfo, FrameItem, type FrameItemOptions, type FrameItemProperty, FrameLayoutMode, type GeneratorCreateInfo, GeneratorItem, type GeneratorItemOptions, type GeneratorItemProperty, type GizmoType, type GroupCreateInfo, GroupItem, type GroupItemOptions, type ItemCreateInfo, ItemOrderAction, type ItemPropertyMap, type Operation, type PageData, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKItem, type SDKItemOptions, SDKItemType, type SDKOptions, type SetItemPropertyParam, type SetSingleItemMultiplePropertiesParam, type SetSingleItemSinglePropertyParam, type SpriteCreateInfo, SpriteItem, type SpriteItemOptions, type SpriteItemProperty, type TextCreateInfo, TextItem, type TextItemOptions, type TextItemProperty, type UpdateOperation, Vector2, type VideoCreateInfo, VideoItem, type VideoItemOptions, type VideoItemProperty, type ViewParam, type ViewProperty, createSDKItem, isBaseItem, isEffectsItem, isFrameItem, isGeneratorItem, isGroupItem, isSpriteItem, isTextItem, isVideoItem };
package/dist/index.d.ts CHANGED
@@ -1375,6 +1375,39 @@ declare enum FrameLayoutMode {
1375
1375
  AUTO = "auto",
1376
1376
  FREE = "free"
1377
1377
  }
1378
+ /**
1379
+ * @description 自动布局配置
1380
+ */
1381
+ type AutoLayoutConfig = {
1382
+ /**
1383
+ * @description 单行最大宽度(像素),超过后自动换行。未设置时不限制
1384
+ */
1385
+ maxRowWidth?: number;
1386
+ /**
1387
+ * @description 最大行数限制。未设置时不限制
1388
+ */
1389
+ maxRowCount?: number;
1390
+ };
1391
+ /**
1392
+ * @description 元素在自动布局中的位置信息
1393
+ */
1394
+ type LayoutInfo = {
1395
+ /**
1396
+ * @description 所在行号(可为小数)
1397
+ * 整数部分:主行号(0, 1, 2...)
1398
+ * 小数部分:分行后的子行号(如 1.5 表示第1行的第5个子行)
1399
+ * 仅支持两层(即小数部分为 0-9)
1400
+ */
1401
+ row: number;
1402
+ /**
1403
+ * @description 所在列号(必须为整数)
1404
+ */
1405
+ column: number;
1406
+ /**
1407
+ * @description 元素在布局中的位置(相对于画板左上角,可选)
1408
+ */
1409
+ position?: [number, number];
1410
+ };
1378
1411
  /**
1379
1412
  * @description Frame 画板元素属性
1380
1413
  */
@@ -1387,6 +1420,15 @@ type FrameItemProperty = BaseItemProperty & {
1387
1420
  * @description 子元素ID数组
1388
1421
  */
1389
1422
  children: string[];
1423
+ /**
1424
+ * @description 自动布局配置
1425
+ */
1426
+ autoLayoutConfig?: AutoLayoutConfig;
1427
+ /**
1428
+ * @description 子元素布局位置信息(用于自动布局)
1429
+ * key: 子元素ID, value: 元素的位置信息
1430
+ */
1431
+ layoutInfos?: Record<string, LayoutInfo>;
1390
1432
  };
1391
1433
  /**
1392
1434
  * @description BaseItem 基础属性键名
@@ -1739,7 +1781,7 @@ type SpriteCreateInfo = {
1739
1781
  };
1740
1782
  };
1741
1783
  /**
1742
- * @description 空节点创建信息
1784
+ * @description 组 元素创建信息
1743
1785
  */
1744
1786
  type GroupCreateInfo = {
1745
1787
  type: SDKItemType.GROUP;
@@ -2164,6 +2206,15 @@ type FrameCreateInfo = {
2164
2206
  * @description 子元素序号
2165
2207
  */
2166
2208
  children: string[];
2209
+ /**
2210
+ * @description 自动布局配置
2211
+ */
2212
+ autoLayoutConfig?: AutoLayoutConfig;
2213
+ /**
2214
+ * @description 子元素布局位置信息(用于自动布局)
2215
+ * key: 子元素ID, value: 元素的位置信息
2216
+ */
2217
+ layoutInfos?: Record<string, LayoutInfo>;
2167
2218
  };
2168
2219
  /**
2169
2220
  * @description 扩展属性
@@ -2304,8 +2355,25 @@ type SDKConfig = {
2304
2355
  videoPlayGizmoConfig: VideoPlayGizmoConfig;
2305
2356
  itemCreateGizmoEnabled: boolean;
2306
2357
  itemCreateGizmoConfig: ItemCreateGizmoConfig;
2358
+ /**
2359
+ * @description 自动布局指示器配置
2360
+ */
2361
+ autoLayoutIndicatorConfig: AutoLayoutIndicatorConfig;
2307
2362
  };
2308
2363
  };
2364
+ /**
2365
+ * @description 自动布局指示器配置
2366
+ */
2367
+ type AutoLayoutIndicatorConfig = {
2368
+ /**
2369
+ * @description 指示线宽度
2370
+ */
2371
+ lineWidth: number;
2372
+ /**
2373
+ * @description 指示线颜色
2374
+ */
2375
+ lineColor: number;
2376
+ };
2309
2377
  /**
2310
2378
  * @description 页面功能配置
2311
2379
  */
@@ -3411,6 +3479,7 @@ declare class SDK {
3411
3479
  getItemCreateInfos(ids?: string[]): ItemCreateInfo[];
3412
3480
  createScreenShotSceneByIds(idInfo: string | string[], time?: number): Promise<string | undefined>;
3413
3481
  createScreenShotByFrame(id: string): Promise<string | undefined>;
3482
+ createScreenShotByEffects(id: string): Promise<string | undefined>;
3414
3483
  getChildrenIds(id: string): string[];
3415
3484
  /**
3416
3485
  * @description 更新元素在图层中的顺序
@@ -3571,6 +3640,18 @@ declare class SDK {
3571
3640
  closeItemCreateGizmo(): void;
3572
3641
  setItemName(id: string, name: string): void;
3573
3642
  setSafeAreaPreviewVisible(id: number, type: 'url' | 'color', visible: boolean): void;
3643
+ /**
3644
+ * @description 修改画板元素大小
3645
+ * @param id 元素id
3646
+ * @param size 目标大小 [width, height]
3647
+ * @param translation 位置偏移补偿(可选,用于保持拖拽角点固定)
3648
+ */
3649
+ resizeFrameItem(id: string, size: [number, number], translation?: [number, number]): void;
3650
+ /**
3651
+ * @description 对 FrameItem 执行自动布局(当 layoutMode 为 AUTO 时使用)
3652
+ * @param frameId Frame 元素 ID
3653
+ */
3654
+ applyFrameAutoLayout(frameId: string): void;
3574
3655
  }
3575
3656
 
3576
3657
  export { type ActiveData, BaseItem, type BaseItemProperty, type BaseItemPropertyKey, type BaseItemPropertyValueMap, Box2, type CreateOperation, type DeleteOperation, type EffectsCreateInfo, EffectsItem, type EffectsItemOptions, type FrameCreateInfo, FrameItem, type FrameItemOptions, type FrameItemProperty, FrameLayoutMode, type GeneratorCreateInfo, GeneratorItem, type GeneratorItemOptions, type GeneratorItemProperty, type GizmoType, type GroupCreateInfo, GroupItem, type GroupItemOptions, type ItemCreateInfo, ItemOrderAction, type ItemPropertyMap, type Operation, type PageData, type PageProperty, SDK, type SDKEvents, type SDKInputParam, type SDKItem, type SDKItemOptions, SDKItemType, type SDKOptions, type SetItemPropertyParam, type SetSingleItemMultiplePropertiesParam, type SetSingleItemSinglePropertyParam, type SpriteCreateInfo, SpriteItem, type SpriteItemOptions, type SpriteItemProperty, type TextCreateInfo, TextItem, type TextItemOptions, type TextItemProperty, type UpdateOperation, Vector2, type VideoCreateInfo, VideoItem, type VideoItemOptions, type VideoItemProperty, type ViewParam, type ViewProperty, createSDKItem, isBaseItem, isEffectsItem, isFrameItem, isGeneratorItem, isGroupItem, isSpriteItem, isTextItem, isVideoItem };