@vvfx/dsl-ir 0.0.1-beta.10

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.
Files changed (39) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +240 -0
  3. package/dist/common/particle-expression.d.ts +6 -0
  4. package/dist/common/transform.d.ts +11 -0
  5. package/dist/common/utils.d.ts +19 -0
  6. package/dist/dsl/number-expression.d.ts +7 -0
  7. package/dist/dsl/parse-particle-shape.d.ts +2 -0
  8. package/dist/dsl/particle-shape.d.ts +86 -0
  9. package/dist/dsl/schema.d.ts +100 -0
  10. package/dist/dsl/validator/index.d.ts +2 -0
  11. package/dist/dsl/validator/labels.d.ts +1 -0
  12. package/dist/dsl/validator/particle.d.ts +8 -0
  13. package/dist/dsl/validator/types.d.ts +33 -0
  14. package/dist/dsl/validator/validation.d.ts +15 -0
  15. package/dist/dsl2ir/assemble.d.ts +3 -0
  16. package/dist/dsl2ir/content-conversion.d.ts +11 -0
  17. package/dist/dsl2ir/convert-layers.d.ts +4 -0
  18. package/dist/dsl2ir/convert-particle.d.ts +4 -0
  19. package/dist/dsl2ir/convert-property.d.ts +6 -0
  20. package/dist/dsl2ir/convert.d.ts +4 -0
  21. package/dist/dsl2ir/recombine/compare-properties.d.ts +18 -0
  22. package/dist/dsl2ir/recombine/convert.d.ts +5 -0
  23. package/dist/dsl2ir/recombine/update-ir.d.ts +6 -0
  24. package/dist/dsl2ir/recombine/update-layer-order.d.ts +5 -0
  25. package/dist/dsl2ir/recombine/update-layer.d.ts +4 -0
  26. package/dist/dsl2ir/recombine/update-particle.d.ts +4 -0
  27. package/dist/dsl2ir/types.d.ts +35 -0
  28. package/dist/index.d.ts +10 -0
  29. package/dist/index.js +4424 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/index.mjs +4418 -0
  32. package/dist/index.mjs.map +1 -0
  33. package/dist/ir2dsl/assemble.d.ts +5 -0
  34. package/dist/ir2dsl/convert-layers.d.ts +10 -0
  35. package/dist/ir2dsl/convert-particle.d.ts +4 -0
  36. package/dist/ir2dsl/convert.d.ts +4 -0
  37. package/dist/ir2dsl/expand-precompositions.d.ts +6 -0
  38. package/dist/ir2dsl/types.d.ts +45 -0
  39. package/package.json +45 -0
@@ -0,0 +1,5 @@
1
+ import { type IRComposition, type IRScene } from '@vvfx/animation-ir';
2
+ import type { ConversionDiagnostic } from '@vvfx/animation-ir/adapter';
3
+ import type { Layer } from '../dsl/schema';
4
+ import type { IRToDSLLayerMapping, IRToDSLResult } from './types';
5
+ export declare function assembleDSLResult(baselineScene: IRScene, baselineComposition: IRComposition, dslLayerByIRId: Map<string, Layer>, layerMapping: IRToDSLLayerMapping, diagnostics: ConversionDiagnostic[]): IRToDSLResult;
@@ -0,0 +1,10 @@
1
+ import type { IRAsset, IRComposition } from '@vvfx/animation-ir';
2
+ import { type ConversionDiagnostic } from '@vvfx/animation-ir/adapter';
3
+ import type { Layer } from '../dsl/schema';
4
+ import type { IRToDSLLayerMapping } from './types';
5
+ export interface IRLayerConversionResult {
6
+ dslLayerByIRId: Map<string, Layer>;
7
+ layerMapping: IRToDSLLayerMapping;
8
+ diagnostics: ConversionDiagnostic[];
9
+ }
10
+ export declare function convertIRLayersToDSL(baselineComposition: IRComposition, assets: IRAsset[], frameRate: number): IRLayerConversionResult;
@@ -0,0 +1,4 @@
1
+ import type { IRParticleLayer } from '@vvfx/animation-ir';
2
+ import type { ConversionDiagnostic } from '@vvfx/animation-ir/adapter';
3
+ import type { ParticleProperties } from '../dsl/schema';
4
+ export declare function convertIRParticleToDSL(layer: IRParticleLayer, frameRate: number, layerPath: string, diagnostics: ConversionDiagnostic[]): ParticleProperties;
@@ -0,0 +1,4 @@
1
+ import { type IRScene } from '@vvfx/animation-ir';
2
+ import type { IRToDSLResult } from './types';
3
+ /** Convert Animation IR to editable DSL and retain source-neutral data for the reverse conversion. */
4
+ export declare function convertIRToDSL(baselineScene: IRScene): IRToDSLResult;
@@ -0,0 +1,6 @@
1
+ import type { IRScene } from '@vvfx/animation-ir';
2
+ import type { IRToDSLResult } from './types';
3
+ type ConvertIRSceneEntryToDSL = (scene: IRScene) => IRToDSLResult;
4
+ /** Expand referenced IR Compositions into the editable DSL tree. */
5
+ export declare function expandDSLPrecompositions(dslResult: IRToDSLResult, convertIRSceneEntryToDSL: ConvertIRSceneEntryToDSL): void;
6
+ export {};
@@ -0,0 +1,45 @@
1
+ import type { IRScene } from '@vvfx/animation-ir';
2
+ import type { ConversionDiagnostic } from '@vvfx/animation-ir/adapter';
3
+ import type { Composition, Layer } from '../dsl/schema';
4
+ export interface IRToDSLLayerMappingEntry {
5
+ irCompositionId: string;
6
+ irLayerId: string;
7
+ expandedSource?: IRToDSLExpandedLayerSource;
8
+ }
9
+ export interface IRToDSLExpandedLayerSource {
10
+ irCompositionId: string;
11
+ parentLayerId: string;
12
+ baselineTransform: {
13
+ position: Layer['position'];
14
+ scale: Layer['scale'];
15
+ rotation: Layer['rotation'];
16
+ anchor: Layer['anchor'];
17
+ opacity: Layer['opacity'];
18
+ };
19
+ baselineLayer: {
20
+ name: Layer['name'];
21
+ type: Layer['type'];
22
+ width: Layer['width'];
23
+ height: Layer['height'];
24
+ description: Layer['description'];
25
+ parent: Layer['parent'];
26
+ timeRange: Layer['time_range'];
27
+ text?: Layer['text'];
28
+ asset?: Layer['asset'];
29
+ particle?: Layer['particle'];
30
+ };
31
+ }
32
+ export interface IRToDSLLayerMapping {
33
+ layers: Record<string, IRToDSLLayerMappingEntry>;
34
+ }
35
+ /** Opaque Animation IR data retained for a later DSL-to-IR conversion. */
36
+ export interface IRToDSLPreservedData {
37
+ readonly baselineScene: IRScene;
38
+ readonly layerMapping: IRToDSLLayerMapping;
39
+ }
40
+ /** Result of converting Animation IR to editable DSL. */
41
+ export interface IRToDSLResult {
42
+ dsl: Composition;
43
+ preservedData: IRToDSLPreservedData;
44
+ diagnostics: ConversionDiagnostic[];
45
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@vvfx/dsl-ir",
3
+ "version": "0.0.1-beta.10",
4
+ "description": "Editable DSL and Animation IR bidirectional converter",
5
+ "module": "./dist/index.mjs",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.mjs",
14
+ "require": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ }
17
+ },
18
+ "dependencies": {
19
+ "uuid": "^13.0.0",
20
+ "@vvfx/animation-ir": "0.0.1-beta.10"
21
+ },
22
+ "devDependencies": {
23
+ "@galacean/effects-specification": "2.7.2",
24
+ "@vvfx/ge-ir": "0.0.1-beta.10"
25
+ },
26
+ "contributors": [
27
+ {
28
+ "name": "澄弈"
29
+ }
30
+ ],
31
+ "author": "Ant Group CO., Ltd.",
32
+ "license": "MIT",
33
+ "publishConfig": {
34
+ "access": "public",
35
+ "registry": "https://registry.npmjs.org"
36
+ },
37
+ "scripts": {
38
+ "prebuild": "pnpm clean",
39
+ "build": "pnpm build:declaration && pnpm build:module",
40
+ "build:module": "rollup -c --bundleConfigAsCjs",
41
+ "build:declaration": "tsc -b ../animation-ir tsconfig.json --emitDeclarationOnly",
42
+ "clean": "rimraf dist *.tsbuildinfo",
43
+ "test": "vitest run"
44
+ }
45
+ }