@wonderlandengine/editor-api 1.2.0-dev.1 → 1.2.0-dev.3

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/data.d.ts CHANGED
@@ -2,6 +2,8 @@
2
2
  export type ObjectReference = string | null;
3
3
  /** Mesh reference */
4
4
  export type MeshReference = string | null;
5
+ /** Morph targets reference */
6
+ export type MorphTargetsReference = string | null;
5
7
  /** Texture reference */
6
8
  export type TextureReference = string | null;
7
9
  /** Shader reference */
@@ -33,14 +35,28 @@ export declare class SkySettings {
33
35
  /** Bloom settings */
34
36
  export declare class BloomSettings {
35
37
  enabled: boolean;
36
- kernelSize: number;
37
38
  passes: number;
38
39
  threshold: number;
39
40
  intensity: number;
41
+ width: number;
42
+ }
43
+ /** Tonemapping mode enum */
44
+ export declare enum TonemappingMode {
45
+ /** No tonemapping */
46
+ None = "none",
47
+ /** Tonemapping with a polynomial fit of the ACES transform */
48
+ ACES = "aces",
49
+ /** Tonemapping with a simpler fit of the ACES transform */
50
+ ACESApproximated = "aces approximated",
51
+ /** Tonemapping with the global Reinhard operator */
52
+ Reinhard = "reinhard",
53
+ /** Tonemapping with an exponential curve */
54
+ Exponential = "exponential"
40
55
  }
41
56
  /** HDR settings */
42
57
  export declare class HdrSettings {
43
58
  exposure: number;
59
+ tonemapping: TonemappingMode;
44
60
  }
45
61
  /** Texture streaming settings */
46
62
  export declare class TextureStreamingSettings {
@@ -364,9 +380,18 @@ export declare class LightComponent {
364
380
  shadowTexelSize: number;
365
381
  cascadeCount: number;
366
382
  }
383
+ /** View projection type enum */
384
+ export declare enum ProjectionType {
385
+ /** Perspective projection */
386
+ Perspective = "perspective",
387
+ /** Orthographic projection */
388
+ Orthographic = "orthographic"
389
+ }
367
390
  /** 'view' component configuration */
368
391
  export declare class ViewComponent {
392
+ projectionType: ProjectionType;
369
393
  fov: number;
394
+ extent: number;
370
395
  near: number;
371
396
  far: number;
372
397
  }
@@ -436,6 +461,7 @@ export declare class MeshComponent {
436
461
  material: MaterialReference;
437
462
  mesh: MeshReference;
438
463
  skin: SkinReference;
464
+ morphTargets: MorphTargetsReference;
439
465
  }
440
466
  /** Text effect type enum */
441
467
  export declare enum TextEffectType {
@@ -445,7 +471,7 @@ export declare enum TextEffectType {
445
471
  /** 'text' component configuration */
446
472
  export declare class TextComponent {
447
473
  alignment: string;
448
- justification: string;
474
+ verticalAlignment: string;
449
475
  characterSpacing: number;
450
476
  lineSpacing: number;
451
477
  effect: TextEffectType;
package/dist/data.js CHANGED
@@ -13,14 +13,29 @@ export class SkySettings {
13
13
  /** Bloom settings */
14
14
  export class BloomSettings {
15
15
  enabled = false;
16
- kernelSize = 6;
17
- passes = 1;
16
+ passes = 3;
18
17
  threshold = 1.25;
19
18
  intensity = 2.0;
20
- }
19
+ width = 0.5;
20
+ }
21
+ /** Tonemapping mode enum */
22
+ export var TonemappingMode;
23
+ (function (TonemappingMode) {
24
+ /** No tonemapping */
25
+ TonemappingMode["None"] = "none";
26
+ /** Tonemapping with a polynomial fit of the ACES transform */
27
+ TonemappingMode["ACES"] = "aces";
28
+ /** Tonemapping with a simpler fit of the ACES transform */
29
+ TonemappingMode["ACESApproximated"] = "aces approximated";
30
+ /** Tonemapping with the global Reinhard operator */
31
+ TonemappingMode["Reinhard"] = "reinhard";
32
+ /** Tonemapping with an exponential curve */
33
+ TonemappingMode["Exponential"] = "exponential";
34
+ })(TonemappingMode || (TonemappingMode = {}));
21
35
  /** HDR settings */
22
36
  export class HdrSettings {
23
- exposure = 1.5;
37
+ exposure = 1.0;
38
+ tonemapping = TonemappingMode.Reinhard;
24
39
  }
25
40
  /** Texture streaming settings */
26
41
  export class TextureStreamingSettings {
@@ -360,9 +375,19 @@ export class LightComponent {
360
375
  shadowTexelSize = 1.0;
361
376
  cascadeCount = 4;
362
377
  }
378
+ /** View projection type enum */
379
+ export var ProjectionType;
380
+ (function (ProjectionType) {
381
+ /** Perspective projection */
382
+ ProjectionType["Perspective"] = "perspective";
383
+ /** Orthographic projection */
384
+ ProjectionType["Orthographic"] = "orthographic";
385
+ })(ProjectionType || (ProjectionType = {}));
363
386
  /** 'view' component configuration */
364
387
  export class ViewComponent {
388
+ projectionType = ProjectionType.Perspective;
365
389
  fov = 90;
390
+ extent = 10;
366
391
  near = 0.01;
367
392
  far = 100;
368
393
  }
@@ -433,6 +458,7 @@ export class MeshComponent {
433
458
  material = null;
434
459
  mesh = null;
435
460
  skin = null;
461
+ morphTargets = null;
436
462
  }
437
463
  /** Text effect type enum */
438
464
  export var TextEffectType;
@@ -443,7 +469,7 @@ export var TextEffectType;
443
469
  /** 'text' component configuration */
444
470
  export class TextComponent {
445
471
  alignment = 'center';
446
- justification = 'middle';
472
+ verticalAlignment = 'middle';
447
473
  characterSpacing = 0.0;
448
474
  lineSpacing = 1.2;
449
475
  effect = TextEffectType.None;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './data.js';
2
2
  export * as ui from './ui.js';
3
3
  export * as tools from './tools.js';
4
+ export * from './project.js';
4
5
  /** Editor plugin */
5
6
  export declare class EditorPlugin {
6
7
  name: string;
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import * as ui_1 from './ui.js';
3
3
  export { ui_1 as ui };
4
4
  import * as tools_1 from './tools.js';
5
5
  export { tools_1 as tools };
6
+ export * from './project.js';
6
7
  /** Editor plugin */
7
8
  export class EditorPlugin {
8
9
  name = 'Editor Plugin';
package/dist/native.d.ts CHANGED
@@ -21,9 +21,49 @@ interface NativeUiAPI {
21
21
  beginGroup(): void;
22
22
  endGroup(): void;
23
23
  }
24
+ export interface Project {
25
+ /**
26
+ * Root directory of the project
27
+ *
28
+ * Directory in which the project file resides in.
29
+ */
30
+ readonly rootPath: string;
31
+ /**
32
+ * Project filename
33
+ *
34
+ * File only without the root directory.
35
+ */
36
+ readonly filename: string;
37
+ /**
38
+ * Project deploy path
39
+ * @returns `<root>/deploy`
40
+ */
41
+ readonly deployPath: string;
42
+ /**
43
+ * Project cache path
44
+ * @returns `<root>/cache`
45
+ */
46
+ readonly cachePath: string;
47
+ /**
48
+ * Project package.json path
49
+ * @returns `<root>/package.json`
50
+ */
51
+ readonly packageJsonPath: string;
52
+ /**
53
+ * Project node_modules path
54
+ * @returns `<root>/node_modules`
55
+ */
56
+ readonly nodeModulesPath: string;
57
+ /**
58
+ * Project shaders path
59
+ * @returns `<root>/shaders`
60
+ */
61
+ readonly shadersPath: string;
62
+ }
24
63
  declare global {
25
64
  function _wl_internalBinding(moduleName: 'tools'): NativeToolsAPI;
26
65
  function _wl_internalBinding(moduleName: 'ui'): NativeUiAPI;
27
66
  function _wl_internalBinding(moduleName: 'data'): EditorData;
67
+ function _wl_internalBinding(moduleName: 'project'): Project;
28
68
  }
29
69
  export {};
@@ -0,0 +1 @@
1
+ export declare const project: import("./native.js").Project;
@@ -0,0 +1 @@
1
+ export const project = _wl_internalBinding('project');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wonderlandengine/editor-api",
3
- "version": "1.2.0-dev.1",
3
+ "version": "1.2.0-dev.3",
4
4
  "description": "Wonderland Engine's Editor API for plugins - very experimental.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -24,23 +24,25 @@
24
24
  "url": "https://discord.wonderlandengine.com/"
25
25
  },
26
26
  "homepage": "https://wonderlandengine.com/editor/plugins/",
27
+ "prettier": "@wonderlandengine/prettier-config",
27
28
  "scripts": {
28
29
  "build": "tsc",
29
30
  "build:watch": "tsc --watch",
30
31
  "defaults": "npm run build && npm run doc && node scripts/generate-defaults.mjs ./doc.json",
31
- "pretty": "prettier --config ./prettierrc.json --write ./src",
32
+ "pretty": "prettier --write ./src",
33
+ "pretty:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
32
34
  "doc": "typedoc --entryPoints ./src/index.ts --tsconfig tsconfig.json --json ./doc.json",
33
- "json-diff": "npm run defaults && npx json-diff ../../src/WonderlandEditor/defaults.json defaults.json",
35
+ "json-diff": "npm run defaults && npx json-diff ../../src/WonderlandEditor/Test/defaults.json defaults.json",
34
36
  "prepack": "npm run build"
35
37
  },
36
- "peerDependencies": {},
37
38
  "devDependencies": {
38
39
  "@types/node": "^18.11.9",
40
+ "@wonderlandengine/prettier-config": "^1.0.0",
39
41
  "prettier": "^2.8.0",
40
42
  "typedoc": "^0.23.21",
41
43
  "typescript": "^4.9.3"
42
44
  },
43
45
  "files": [
44
- "dist"
46
+ "dist"
45
47
  ]
46
48
  }