@vvfx/artis 0.0.1-alpha.1 → 0.0.1-alpha.2
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/artis/operations/operations.d.ts +15 -10
- package/dist/artis/types.d.ts +2 -2
- package/dist/core/command/commands/{picture-cut-commit-command.d.ts → image-cut-commit-command.d.ts} +4 -4
- package/dist/core/command/commands/{picture-expand-commit-command.d.ts → image-expand-commit-command.d.ts} +5 -5
- package/dist/core/command/commands/index.d.ts +4 -4
- package/dist/core/command/commands/item-replace-source-command.d.ts +5 -0
- package/dist/core/command/commands/item-set-font-family-command.d.ts +1 -0
- package/dist/core/command/commands/item-transform-command.d.ts +1 -0
- package/dist/core/command/commands/item-update-property-by-schema-command.d.ts +1 -0
- package/dist/core/gizmo/gizmo-command-binder.d.ts +3 -3
- package/dist/core/gizmo/gizmo-registry.d.ts +2 -2
- package/dist/index.cjs +1599 -1495
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1596 -1492
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -472,6 +472,11 @@ export declare class Operations {
|
|
|
472
472
|
openTextGizmo(itemId: string): void;
|
|
473
473
|
/** 关闭文本编辑态。 */
|
|
474
474
|
closeTextGizmo(): void;
|
|
475
|
+
/**
|
|
476
|
+
* 选中当前 TextGizmo 正在编辑的全部文字,并聚焦文本输入框。
|
|
477
|
+
* @returns TextGizmo 已就绪且存在正在编辑的文本时返回 true
|
|
478
|
+
*/
|
|
479
|
+
selectAllText(): boolean;
|
|
475
480
|
/**
|
|
476
481
|
* 应用笔刷大小后开启蒙版 Gizmo;非法尺寸回退为 1。
|
|
477
482
|
* @param brushSize 初始笔刷像素大小
|
|
@@ -504,14 +509,14 @@ export declare class Operations {
|
|
|
504
509
|
*/
|
|
505
510
|
closeLoadingGizmo(id: string): void;
|
|
506
511
|
/** 开启图片裁切 Gizmo。 */
|
|
507
|
-
|
|
512
|
+
openImageCutGizmo(): void;
|
|
508
513
|
/**
|
|
509
514
|
* 设置图片裁切 Gizmo 是否锁定裁切框比例。
|
|
510
515
|
* @param lock 是否锁定比例
|
|
511
516
|
*/
|
|
512
|
-
|
|
517
|
+
setImageCutGizmoLockScale(lock: boolean): void;
|
|
513
518
|
/**
|
|
514
|
-
* 获取当前裁切信息(归一化裁切框 + 元素视图框),委托
|
|
519
|
+
* 获取当前裁切信息(归一化裁切框 + 元素视图框),委托 ImageCutGizmo.getCutInfo。
|
|
515
520
|
* @returns 裁切信息;Gizmo 未就绪 / 未选中单个元素 / 结果无效时返回 undefined
|
|
516
521
|
*/
|
|
517
522
|
getCutInfo(): {
|
|
@@ -519,24 +524,24 @@ export declare class Operations {
|
|
|
519
524
|
itemBox: Box2;
|
|
520
525
|
} | undefined;
|
|
521
526
|
/**
|
|
522
|
-
* 获取归一化裁切包围盒(min/max ∈ [0,1],相对元素包围盒),委托
|
|
527
|
+
* 获取归一化裁切包围盒(min/max ∈ [0,1],相对元素包围盒),委托 ImageCutGizmo.getCutBox。
|
|
523
528
|
* @returns 归一化裁切框;Gizmo 未就绪时返回 undefined
|
|
524
529
|
*/
|
|
525
530
|
getCutBox(): Box2 | undefined;
|
|
526
531
|
/**
|
|
527
|
-
* 设置归一化裁切包围盒(入参为归一化坐标),委托
|
|
532
|
+
* 设置归一化裁切包围盒(入参为归一化坐标),委托 ImageCutGizmo.setCutBox。
|
|
528
533
|
* @param normalizeBox 归一化裁切框
|
|
529
534
|
*/
|
|
530
535
|
setCutBox(normalizeBox: Box2): void;
|
|
531
536
|
/** 关闭图片裁切 Gizmo。 */
|
|
532
|
-
|
|
537
|
+
closeImageCutGizmo(): void;
|
|
533
538
|
/**
|
|
534
539
|
* 设置图片扩边 Gizmo 是否锁定扩边框比例。
|
|
535
540
|
* @param lock 是否锁定比例
|
|
536
541
|
*/
|
|
537
|
-
|
|
542
|
+
setImageExpandGizmoLockScale(lock: boolean): void;
|
|
538
543
|
/**
|
|
539
|
-
* 获取当前扩边信息(归一化扩边框 + 元素视图框),委托
|
|
544
|
+
* 获取当前扩边信息(归一化扩边框 + 元素视图框),委托 ImageExpandGizmo.getExpandInfo。
|
|
540
545
|
* @returns 扩边信息;Gizmo 未就绪 / 未选中单个元素 / 结果无效时返回 undefined
|
|
541
546
|
*/
|
|
542
547
|
getExpandInfo(): {
|
|
@@ -544,12 +549,12 @@ export declare class Operations {
|
|
|
544
549
|
itemBox: Box2;
|
|
545
550
|
} | undefined;
|
|
546
551
|
/**
|
|
547
|
-
* 获取归一化扩边包围盒(相对元素包围盒,可超出 [0,1]),委托
|
|
552
|
+
* 获取归一化扩边包围盒(相对元素包围盒,可超出 [0,1]),委托 ImageExpandGizmo.getExpandBox。
|
|
548
553
|
* @returns 归一化扩边框;Gizmo 未就绪时返回 undefined
|
|
549
554
|
*/
|
|
550
555
|
getExpandBox(): Box2 | undefined;
|
|
551
556
|
/**
|
|
552
|
-
* 设置归一化扩边包围盒(入参为归一化坐标),委托
|
|
557
|
+
* 设置归一化扩边包围盒(入参为归一化坐标),委托 ImageExpandGizmo.setExpandBox。
|
|
553
558
|
* @param normalizeBox 归一化扩边框
|
|
554
559
|
*/
|
|
555
560
|
setExpandBox(normalizeBox: Box2): void;
|
package/dist/artis/types.d.ts
CHANGED
|
@@ -9,11 +9,11 @@ export type ArtisStateEvents = {
|
|
|
9
9
|
/** 任意编辑状态切换;source 为触发切换的业务入参。 */
|
|
10
10
|
'state.change': [previousState: BaseState | undefined, currentState: BaseState, source: any];
|
|
11
11
|
/** 图片裁切框变化。 */
|
|
12
|
-
'
|
|
12
|
+
'image-cut.change': [info: {
|
|
13
13
|
box: Box2;
|
|
14
14
|
}];
|
|
15
15
|
/** 图片扩图框变化。 */
|
|
16
|
-
'
|
|
16
|
+
'image-expand.change': [info: {
|
|
17
17
|
box: Box2;
|
|
18
18
|
}];
|
|
19
19
|
};
|
package/dist/core/command/commands/{picture-cut-commit-command.d.ts → image-cut-commit-command.d.ts}
RENAMED
|
@@ -8,7 +8,7 @@ export type NormalizedBox = {
|
|
|
8
8
|
width: number;
|
|
9
9
|
height: number;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type ImageCutCommitCommandArgs = {
|
|
12
12
|
/** 新的裁切包围盒 */
|
|
13
13
|
newBox: NormalizedBox;
|
|
14
14
|
/** 交互前的裁切包围盒 */
|
|
@@ -20,9 +20,9 @@ export type PictureCutCommitCommandArgs = {
|
|
|
20
20
|
applyBox: (box: NormalizedBox) => void;
|
|
21
21
|
};
|
|
22
22
|
/** 提交图片裁切区域变化的可撤销命令。 */
|
|
23
|
-
export declare class
|
|
23
|
+
export declare class ImageCutCommitCommand implements Command {
|
|
24
24
|
readonly id: string;
|
|
25
|
-
readonly commandId = "
|
|
25
|
+
readonly commandId = "imageCut.commit";
|
|
26
26
|
private _newBox;
|
|
27
27
|
private _oldBox;
|
|
28
28
|
private _applyBox;
|
|
@@ -30,7 +30,7 @@ export declare class PictureCutCommitCommand implements Command {
|
|
|
30
30
|
* 构造裁切提交命令,缓存新旧包围盒与应用回调
|
|
31
31
|
* @param args 命令参数(含新旧裁切包围盒与 applyBox 回调)
|
|
32
32
|
*/
|
|
33
|
-
constructor(args:
|
|
33
|
+
constructor(args: ImageCutCommitCommandArgs);
|
|
34
34
|
/** 应用新的裁切包围盒 */
|
|
35
35
|
execute(): void;
|
|
36
36
|
/** 恢复到交互前的裁切包围盒 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Command } from '../types';
|
|
2
|
-
import type { NormalizedBox } from './
|
|
3
|
-
export type
|
|
2
|
+
import type { NormalizedBox } from './image-cut-commit-command';
|
|
3
|
+
export type ImageExpandCommitCommandArgs = {
|
|
4
4
|
/** 新的扩图包围盒 */
|
|
5
5
|
newBox: NormalizedBox;
|
|
6
6
|
/** 交互前的扩图包围盒 */
|
|
@@ -12,9 +12,9 @@ export type PictureExpandCommitCommandArgs = {
|
|
|
12
12
|
applyBox: (box: NormalizedBox) => void;
|
|
13
13
|
};
|
|
14
14
|
/** 提交图片扩边区域变化的可撤销命令。 */
|
|
15
|
-
export declare class
|
|
15
|
+
export declare class ImageExpandCommitCommand implements Command {
|
|
16
16
|
readonly id: string;
|
|
17
|
-
readonly commandId = "
|
|
17
|
+
readonly commandId = "imageExpand.commit";
|
|
18
18
|
private _newBox;
|
|
19
19
|
private _oldBox;
|
|
20
20
|
private _applyBox;
|
|
@@ -22,7 +22,7 @@ export declare class PictureExpandCommitCommand implements Command {
|
|
|
22
22
|
* 构造扩图提交命令,缓存新旧包围盒与应用回调
|
|
23
23
|
* @param args 命令参数(含新旧扩图包围盒与 applyBox 回调)
|
|
24
24
|
*/
|
|
25
|
-
constructor(args:
|
|
25
|
+
constructor(args: ImageExpandCommitCommandArgs);
|
|
26
26
|
/** 应用新的扩图包围盒 */
|
|
27
27
|
execute(): void;
|
|
28
28
|
/** 恢复到交互前的扩图包围盒 */
|
|
@@ -56,10 +56,10 @@ export { FrameLayoutModeCommand } from './frame-layout-mode-command';
|
|
|
56
56
|
export type { FrameLayoutModeCommandArgs } from './frame-layout-mode-command';
|
|
57
57
|
export { MaskCommitCommand } from './mask-commit-command';
|
|
58
58
|
export type { MaskCommitCommandArgs, MaskLine } from './mask-commit-command';
|
|
59
|
-
export {
|
|
60
|
-
export type {
|
|
61
|
-
export {
|
|
62
|
-
export type {
|
|
59
|
+
export { ImageCutCommitCommand } from './image-cut-commit-command';
|
|
60
|
+
export type { ImageCutCommitCommandArgs, NormalizedBox } from './image-cut-commit-command';
|
|
61
|
+
export { ImageExpandCommitCommand } from './image-expand-commit-command';
|
|
62
|
+
export type { ImageExpandCommitCommandArgs } from './image-expand-commit-command';
|
|
63
63
|
export { SpriteImageCommand } from './sprite-image-command';
|
|
64
64
|
export type { SpriteImageCommandArgs } from './sprite-image-command';
|
|
65
65
|
export { VideoSourceCommand } from './video-source-command';
|
|
@@ -14,9 +14,12 @@ export declare class ItemReplaceSourceCommand implements Command {
|
|
|
14
14
|
readonly commandId = "item.replaceSource";
|
|
15
15
|
readonly isHistorical = false;
|
|
16
16
|
readonly params: Record<string, unknown>;
|
|
17
|
+
eventPayload?: Record<string, unknown>;
|
|
18
|
+
completion: Promise<void>;
|
|
17
19
|
private _itemId;
|
|
18
20
|
private _newUrl;
|
|
19
21
|
private _oldUrl;
|
|
22
|
+
private _propertyKey;
|
|
20
23
|
private _itemService;
|
|
21
24
|
private _store;
|
|
22
25
|
/**
|
|
@@ -30,6 +33,8 @@ export declare class ItemReplaceSourceCommand implements Command {
|
|
|
30
33
|
undo(): void;
|
|
31
34
|
/** 重新应用新资源 */
|
|
32
35
|
redo(): void;
|
|
36
|
+
/** 仅在资源实际替换成功时保留属性变化载荷。 */
|
|
37
|
+
private _replaceSource;
|
|
33
38
|
/** 将在线换源标记为不可重放,避免复现流程依赖外部资源时序。 */
|
|
34
39
|
serializeReplay(): {
|
|
35
40
|
args: Record<string, unknown>;
|
|
@@ -10,6 +10,7 @@ export type ItemSetFontFamilyCommandArgs = {
|
|
|
10
10
|
export declare class ItemSetFontFamilyCommand implements Command {
|
|
11
11
|
readonly id: string;
|
|
12
12
|
readonly commandId = "item.setFontFamily";
|
|
13
|
+
readonly eventPayload: Record<string, unknown>;
|
|
13
14
|
completion: Promise<void>;
|
|
14
15
|
private _itemId;
|
|
15
16
|
private _fontFamily;
|
|
@@ -18,6 +18,7 @@ export type ItemTransformCommandArgs = {
|
|
|
18
18
|
export declare class ItemTransformCommand implements Command {
|
|
19
19
|
readonly id: string;
|
|
20
20
|
readonly commandId = "item.transform";
|
|
21
|
+
eventPayload: Record<string, unknown>;
|
|
21
22
|
private _itemId;
|
|
22
23
|
private _newTransform;
|
|
23
24
|
private _oldTransform;
|
|
@@ -9,6 +9,7 @@ export type ItemUpdatePropertyBySchemaCommandArgs = {
|
|
|
9
9
|
export declare class ItemUpdatePropertyBySchemaCommand implements Command {
|
|
10
10
|
readonly id: string;
|
|
11
11
|
readonly commandId = "item.updatePropertyBySchema";
|
|
12
|
+
readonly eventPayload: Record<string, unknown>;
|
|
12
13
|
completion: Promise<void>;
|
|
13
14
|
private _schemas;
|
|
14
15
|
private _itemService;
|
|
@@ -4,10 +4,10 @@ import type { ItemService } from '../service';
|
|
|
4
4
|
import type { Store } from '../store';
|
|
5
5
|
import type { BaseArtisEvents } from '../types/artis-events';
|
|
6
6
|
type GizmoBridgeEvents = BaseArtisEvents & {
|
|
7
|
-
'
|
|
7
|
+
'image-cut.change': [info: {
|
|
8
8
|
box: Box2;
|
|
9
9
|
}];
|
|
10
|
-
'
|
|
10
|
+
'image-expand.change': [info: {
|
|
11
11
|
box: Box2;
|
|
12
12
|
}];
|
|
13
13
|
};
|
|
@@ -35,7 +35,7 @@ export type CommandBindingContext = {
|
|
|
35
35
|
/** 实时创建 Text 被取消时退出对应编辑态。 */
|
|
36
36
|
finishCreatedTextEditing: () => void;
|
|
37
37
|
};
|
|
38
|
-
export type GizmoBridgeEvent = 'item.create' | 'item.dragstart' | 'item.drag' | 'item.dragend' | 'item.propertychange' | 'loading.change' | 'spritetext.click' | 'text.input' | 'video.play' | '
|
|
38
|
+
export type GizmoBridgeEvent = 'item.create' | 'item.dragstart' | 'item.drag' | 'item.dragend' | 'item.propertychange' | 'loading.change' | 'spritetext.click' | 'text.input' | 'video.play' | 'image-cut.change' | 'image-expand.change';
|
|
39
39
|
export type GizmoBridgeEventArgs<K extends GizmoBridgeEvent> = GizmoBridgeEvents[K];
|
|
40
40
|
/** Command behavior for one Gizmo type on the unified GestureHandler action stream. */
|
|
41
41
|
export type CommandActionBinding = {
|
|
@@ -7,8 +7,8 @@ export declare enum BuiltinGizmoId {
|
|
|
7
7
|
LOADING = "loading",
|
|
8
8
|
VIEWPORT_OVERLAY = "viewport-overlay",
|
|
9
9
|
READONLY_SELECTION = "readonly-selection",
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
IMAGE_CUT = "image-cut",
|
|
11
|
+
IMAGE_EXPAND = "image-expand",
|
|
12
12
|
SPRITE_TEXT_EDIT = "sprite-text-edit",
|
|
13
13
|
MASK = "mask",
|
|
14
14
|
ITEM_CREATE = "item-create"
|