@vvfx/sdk 0.2.7 → 0.2.9
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/config.js +231 -0
- package/dist/exporter/config.js +18 -0
- package/dist/exporter/const.js +71 -0
- package/dist/exporter/export-media.js +878 -0
- package/dist/exporter/exporter.js +121 -0
- package/dist/exporter/index.js +1 -0
- package/dist/exporter/types.js +1 -0
- package/dist/exporter/utils.js +190 -0
- package/dist/exporter/wav-audio.js +50 -0
- package/dist/gesture-handler/gizmo/adsorption-gizmo.js +227 -0
- package/dist/gesture-handler/gizmo/control-gizmo.js +149 -0
- package/dist/gesture-handler/gizmo/gizmo.js +17 -0
- package/dist/gesture-handler/gizmo/icon-gizmo.js +189 -0
- package/dist/gesture-handler/gizmo/index.js +6 -0
- package/dist/gesture-handler/gizmo/item-create-gizmo.js +256 -0
- package/dist/gesture-handler/gizmo/loading-gizmo.js +320 -0
- package/dist/gesture-handler/gizmo/mask-gizmo.js +648 -0
- package/dist/gesture-handler/gizmo/picture-cut-gizmo.js +550 -0
- package/dist/gesture-handler/gizmo/picture-expand-gizmo.js +491 -0
- package/dist/gesture-handler/gizmo/preference-gizmo.js +148 -0
- package/dist/gesture-handler/gizmo/selector-gizmo.d.ts +1 -1
- package/dist/gesture-handler/gizmo/selector-gizmo.js +468 -0
- package/dist/gesture-handler/gizmo/sprite-text-edit-gizmo.js +247 -0
- package/dist/gesture-handler/gizmo/text-gizmo.js +1033 -0
- package/dist/gesture-handler/gizmo/transform-gizmo.js +1199 -0
- package/dist/gesture-handler/gizmo/type.js +18 -0
- package/dist/gesture-handler/index.js +3 -0
- package/dist/gesture-handler/src/gesture-handler.js +770 -0
- package/dist/gesture-handler/src/icons.js +24 -0
- package/dist/gesture-handler/utils.js +40 -0
- package/dist/html-overlay/anchor-navigation-runtime.js +27 -0
- package/dist/html-overlay/auto-height-runtime.js +132 -0
- package/dist/html-overlay/document-runtime.js +71 -0
- package/dist/html-overlay/document-transform.js +96 -0
- package/dist/html-overlay/dom-order.js +8 -0
- package/dist/html-overlay/host-message-runtime.js +24 -0
- package/dist/html-overlay/html-capture-runtime.js +282 -0
- package/dist/html-overlay/html-viewport-style.js +10 -0
- package/dist/html-overlay/index.js +1 -0
- package/dist/html-overlay/manager.js +1663 -0
- package/dist/html-overlay/mime-utils.js +21 -0
- package/dist/html-overlay/overlay-transform.js +57 -0
- package/dist/html-overlay/path-utils.js +35 -0
- package/dist/html-overlay/shell-runtime.js +12 -0
- package/dist/index.cjs +1 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -75317
- package/dist/index.mjs +75311 -0
- package/dist/index.mjs.map +1 -0
- package/dist/layer-order.js +8 -0
- package/dist/math/box2.js +396 -0
- package/dist/math/circle.js +131 -0
- package/dist/math/euler.js +35 -0
- package/dist/math/index.js +13 -0
- package/dist/math/line2.js +153 -0
- package/dist/math/line3.js +36 -0
- package/dist/math/matrix4.js +207 -0
- package/dist/math/plane.js +52 -0
- package/dist/math/quaternion.js +3 -0
- package/dist/math/ray-caster.js +25 -0
- package/dist/math/ray.js +47 -0
- package/dist/math/type.js +1 -0
- package/dist/math/utils.js +77 -0
- package/dist/math/vector2.js +70 -0
- package/dist/math/vector3.js +60 -0
- package/dist/screen-shot/index.js +1 -0
- package/dist/screen-shot/screen-shot.js +113 -0
- package/dist/sdk-item/base-item.js +160 -0
- package/dist/sdk-item/card-item.js +131 -0
- package/dist/sdk-item/effects-item.js +144 -0
- package/dist/sdk-item/frame-item.js +217 -0
- package/dist/sdk-item/generator-item.js +188 -0
- package/dist/sdk-item/group-item.js +116 -0
- package/dist/sdk-item/index.js +39 -0
- package/dist/sdk-item/sprite-item.js +147 -0
- package/dist/sdk-item/text-item.js +223 -0
- package/dist/sdk-item/types.d.ts +1 -11
- package/dist/sdk-item/types.js +15 -0
- package/dist/sdk-item/video-item.js +174 -0
- package/dist/sdk.js +1903 -0
- package/dist/service/UndoRedo.js +79 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +2 -0
- package/dist/shared/player.d.ts +1 -1
- package/dist/shared/player.js +9 -0
- package/dist/shared/spec.d.ts +1 -0
- package/dist/shared/spec.js +1 -0
- package/dist/size-adapte/index.js +1 -0
- package/dist/size-adapte/size-adapt.js +395 -0
- package/dist/types.d.ts +5 -1
- package/dist/types.js +17 -0
- package/dist/utils/background-manager.js +189 -0
- package/dist/utils/common-utils.js +183 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/interaction-utils.js +205 -0
- package/dist/utils/json-data-utils.js +1529 -0
- package/dist/utils/layout-utils.js +1217 -0
- package/dist/utils/page-data-utils.js +5397 -0
- package/dist/utils/player-data-utils.js +48 -0
- package/dist/utils/types.js +8 -0
- package/dist/wireframe/common/box.js +18 -0
- package/dist/wireframe/common/dashed-line.js +21 -0
- package/dist/wireframe/common/line.js +17 -0
- package/dist/wireframe/common/pixi-ext.js +1 -0
- package/dist/wireframe/common/pixi.js +31 -0
- package/dist/wireframe/index.js +4 -0
- package/package.json +10 -3
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
|
2
|
+
import { VFXItem, SpriteComponent, spec, TextComponent, AssetManager, PrecompositionManager } from '@galacean/effects';
|
|
3
|
+
import { VideoComponent } from '@galacean/effects-plugin-multimedia';
|
|
4
|
+
export class DefaultVFXItems {
|
|
5
|
+
static createEmpty(composition, parent = null, name = 'NewVFXItem') {
|
|
6
|
+
const vfxItem = VFXItemFactory.createVFXItem(composition, parent, name);
|
|
7
|
+
vfxItem.type = spec.ItemType.null;
|
|
8
|
+
return vfxItem;
|
|
9
|
+
}
|
|
10
|
+
static createSprite(composition, parent = null, name = 'NewSpite') {
|
|
11
|
+
const vfxItem = VFXItemFactory.createVFXItem(composition, parent, name, SpriteComponent);
|
|
12
|
+
vfxItem.type = spec.ItemType.sprite;
|
|
13
|
+
return vfxItem;
|
|
14
|
+
}
|
|
15
|
+
static createText(composition, parent = null, name = 'NewText') {
|
|
16
|
+
const vfxItem = VFXItemFactory.createVFXItem(composition, parent, name, TextComponent);
|
|
17
|
+
vfxItem.type = spec.ItemType.text;
|
|
18
|
+
return vfxItem;
|
|
19
|
+
}
|
|
20
|
+
static createVideo(composition, parent = null, name = 'NewVideo') {
|
|
21
|
+
const vfxItem = VFXItemFactory.createVFXItem(composition, parent, name, VideoComponent);
|
|
22
|
+
vfxItem.type = spec.ItemType.video;
|
|
23
|
+
return vfxItem;
|
|
24
|
+
}
|
|
25
|
+
static async createEffects(composition, effects, parent = null, urlname = 'NewEffects') {
|
|
26
|
+
const preComposition = await AssetManager.loadPrecomposition(effects, { autoplay: false });
|
|
27
|
+
const vfxItem = PrecompositionManager.instantiate(preComposition, composition);
|
|
28
|
+
vfxItem.name = urlname;
|
|
29
|
+
vfxItem.type = spec.ItemType.composition;
|
|
30
|
+
return vfxItem;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export class VFXItemFactory {
|
|
34
|
+
static createVFXItem(composition, parent = null, name = 'NewVFXItem', ...types) {
|
|
35
|
+
const vfxItem = new VFXItem(composition.engine);
|
|
36
|
+
vfxItem.name = name;
|
|
37
|
+
for (const type of types) {
|
|
38
|
+
vfxItem.addComponent(type);
|
|
39
|
+
}
|
|
40
|
+
composition.addItem(vfxItem);
|
|
41
|
+
//@ts-expect-error @赤芍 @茂安 type to fix
|
|
42
|
+
composition.rootComposition.items.push(vfxItem);
|
|
43
|
+
if (parent) {
|
|
44
|
+
vfxItem.setParent(parent);
|
|
45
|
+
}
|
|
46
|
+
return vfxItem;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Vector2 } from '@galacean/effects-plugin-model';
|
|
2
|
+
import { Graphics } from './pixi';
|
|
3
|
+
Graphics.prototype.drawBox = function (box) {
|
|
4
|
+
const corners = box.getCorners();
|
|
5
|
+
this.beginFill();
|
|
6
|
+
for (let i = 0; i < 4; i++) {
|
|
7
|
+
const startPoint = corners[i];
|
|
8
|
+
const endPoint = corners[(i + 1) % 4];
|
|
9
|
+
const direction = new Vector2().subtractVectors(endPoint, startPoint).normalize();
|
|
10
|
+
this.moveTo(startPoint.x - direction.x, startPoint.y - direction.y);
|
|
11
|
+
this.lineTo(endPoint.x + direction.x, endPoint.y - direction.y);
|
|
12
|
+
}
|
|
13
|
+
this.endFill();
|
|
14
|
+
};
|
|
15
|
+
Graphics.prototype.fillBox = function (box) {
|
|
16
|
+
const size = box.getSize();
|
|
17
|
+
this.drawRect(box.min.x, box.min.y, size.x, size.y);
|
|
18
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Graphics } from './pixi';
|
|
2
|
+
Graphics.prototype.drawDashLine = function (toX, toY, dash, gap) {
|
|
3
|
+
const lastPosition = this.currentPath.points;
|
|
4
|
+
const currentPosition = {
|
|
5
|
+
x: lastPosition[lastPosition.length - 2] || 0,
|
|
6
|
+
y: lastPosition[lastPosition.length - 1] || 0,
|
|
7
|
+
};
|
|
8
|
+
const absValues = {
|
|
9
|
+
toX: Math.abs(toX),
|
|
10
|
+
toY: Math.abs(toY),
|
|
11
|
+
};
|
|
12
|
+
const angle = Math.atan((toY - currentPosition.y) / (toX - currentPosition.x));
|
|
13
|
+
for (; Math.abs(currentPosition.x) < absValues.toX || Math.abs(currentPosition.y) < absValues.toY;) {
|
|
14
|
+
currentPosition.x = Math.abs(currentPosition.x + dash * Math.cos(angle)) < absValues.toX ? currentPosition.x + dash * Math.cos(angle) : toX;
|
|
15
|
+
currentPosition.y = Math.abs(currentPosition.y + dash * Math.sin(angle)) < absValues.toY ? currentPosition.y + dash * Math.sin(angle) : toY;
|
|
16
|
+
this.lineTo(currentPosition.x, currentPosition.y);
|
|
17
|
+
currentPosition.x = Math.abs(currentPosition.x + gap * Math.cos(angle)) < absValues.toX ? currentPosition.x + gap * Math.cos(angle) : toX;
|
|
18
|
+
currentPosition.y = Math.abs(currentPosition.y + gap * Math.sin(angle)) < absValues.toY ? currentPosition.y + gap * Math.sin(angle) : toY;
|
|
19
|
+
this.moveTo(currentPosition.x, currentPosition.y);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Graphics } from './pixi';
|
|
2
|
+
import { Line2 } from '../../math/line2';
|
|
3
|
+
Graphics.prototype.drawLine = function (line) {
|
|
4
|
+
this.beginFill();
|
|
5
|
+
if (line instanceof Line2) {
|
|
6
|
+
this.moveTo(line.start.x, line.start.y);
|
|
7
|
+
this.lineTo(line.end.x, line.end.y);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
const points = line;
|
|
11
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
12
|
+
this.moveTo(points[i].x, points[i].y);
|
|
13
|
+
this.lineTo(points[i + 1].x, points[i + 1].y);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
this.endFill();
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import '@pixi/polyfill';
|
|
2
|
+
import * as utils from '@pixi/utils';
|
|
3
|
+
import { InteractionManager } from '@pixi/interaction';
|
|
4
|
+
import { Application } from '@pixi/app';
|
|
5
|
+
import { Renderer, BatchRenderer } from '@pixi/core';
|
|
6
|
+
import { AppLoaderPlugin } from '@pixi/loaders';
|
|
7
|
+
import { TickerPlugin } from '@pixi/ticker';
|
|
8
|
+
utils.skipHello();
|
|
9
|
+
// Install renderer plugins
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
11
|
+
Renderer.registerPlugin('interaction', InteractionManager);
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
13
|
+
Renderer.registerPlugin('batch', BatchRenderer);
|
|
14
|
+
// Install application plugins'
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
16
|
+
Application.registerPlugin(TickerPlugin);
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
18
|
+
Application.registerPlugin(AppLoaderPlugin);
|
|
19
|
+
export * from '@pixi/constants';
|
|
20
|
+
export * from '@pixi/core';
|
|
21
|
+
export * from '@pixi/display';
|
|
22
|
+
export * from '@pixi/graphics';
|
|
23
|
+
export * from '@pixi/loaders';
|
|
24
|
+
export * from '@pixi/interaction';
|
|
25
|
+
export * from '@pixi/math';
|
|
26
|
+
export * from '@pixi/runner';
|
|
27
|
+
export * from '@pixi/sprite';
|
|
28
|
+
export * from '@pixi/text';
|
|
29
|
+
export * from '@pixi/ticker';
|
|
30
|
+
export * from '@pixi/settings';
|
|
31
|
+
export { utils, Application };
|
package/package.json
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvfx/sdk",
|
|
3
3
|
"description": "TODO",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.9",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
|
-
"module": "./dist/index.
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"./dist/shared/player.js"
|
|
13
|
+
],
|
|
11
14
|
"exports": {
|
|
12
15
|
".": {
|
|
13
16
|
"types": "./dist/index.d.ts",
|
|
14
|
-
"import": "./dist/index.
|
|
17
|
+
"import": "./dist/index.mjs",
|
|
15
18
|
"require": "./dist/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./types": {
|
|
21
|
+
"types": "./dist/types.d.ts",
|
|
22
|
+
"import": "./dist/types.js"
|
|
16
23
|
}
|
|
17
24
|
},
|
|
18
25
|
"dependencies": {
|