@configura/web-core 2.0.0-alpha.9 → 2.1.0-alpha.0
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/.eslintrc.json +5 -0
- package/dist/cm/core3D/GMaterialClassic.js +1 -1
- package/dist/cm/core3D/GMaterialPBR.js +2 -2
- package/dist/cm/format/cmsym/SymInv.js +3 -1
- package/dist/cm/format/cmsym/SymNode.d.ts +4 -3
- package/dist/cm/format/cmsym/components/SymComponent.js +3 -1
- package/dist/cm/format/cmsym/components/SymLODGroup.js +3 -1
- package/dist/cm/format/cmsym/components/SymMultiSelector.js +1 -1
- package/dist/cm/format/cmsym/components/SymParams.d.ts +1 -1
- package/dist/cm/format/cmsym/components/SymPlane.d.ts +2 -1
- package/dist/cm/format/cmsym/components/SymProgs.d.ts +2 -2
- package/dist/cm/format/cmsym/components/SymProgs.js +1 -1
- package/dist/cm/format/cmsym/components/SymProps.d.ts +2 -2
- package/dist/cm/format/cmsym/components/SymProps.js +2 -1
- package/dist/cm/format/cmsym/components/SymReps.js +5 -4
- package/dist/cm/format/cmsym/components/SymUVMapper.d.ts +1 -1
- package/dist/cm/format/dex/DexInternalizedXRef.js +2 -1
- package/dist/cm/format/dex/DexObj.d.ts +1 -1
- package/dist/cm/format/dex/DexReader.js +3 -3
- package/dist/cm/format/dex/DexReplacedXRefs.d.ts +2 -1
- package/dist/cm/format/dex/DexXRef.d.ts +2 -2
- package/dist/cm/geometry/DetailMask.d.ts +1 -1
- package/package.json +4 -4
package/.eslintrc.json
ADDED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DexObj } from "../format/dex/DexObj.js";
|
|
2
|
-
import { GMaterial3D, GMaterial3DTexture, imageUrlFromDex, textureWrapFromDex } from "./GMaterial3D.js";
|
|
2
|
+
import { GMaterial3D, GMaterial3DTexture, imageUrlFromDex, textureWrapFromDex, } from "./GMaterial3D.js";
|
|
3
3
|
// tslint:disable:max-classes-per-file
|
|
4
4
|
export class GMaterialClassic extends GMaterial3D {
|
|
5
5
|
constructor(log, obj) {
|
|
@@ -181,7 +181,7 @@ function loadTexture(log, type, dex) {
|
|
|
181
181
|
return undefined;
|
|
182
182
|
}
|
|
183
183
|
const txt = new PBRTexture(type, imageUrl);
|
|
184
|
-
|
|
184
|
+
const transform = dexTxt.get("transform");
|
|
185
185
|
if (transform instanceof DexObj) {
|
|
186
186
|
const inner = scope + ".transform";
|
|
187
187
|
txt.uScale = (_a = loadNumber(log, inner, transform, "uScale")) !== null && _a !== void 0 ? _a : txt.uScale;
|
|
@@ -190,7 +190,7 @@ function loadTexture(log, type, dex) {
|
|
|
190
190
|
txt.vOffset = (_d = loadNumber(log, inner, transform, "vOffset")) !== null && _d !== void 0 ? _d : txt.vOffset;
|
|
191
191
|
txt.rot = (_e = loadAngle(log, inner, transform, "rot")) !== null && _e !== void 0 ? _e : txt.rot;
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
const sampler = dexTxt.get("sampler");
|
|
194
194
|
if (sampler instanceof DexObj) {
|
|
195
195
|
const inner = scope + ".sampler";
|
|
196
196
|
txt.wrapU = (_f = textureWrapFromDex(sampler)) !== null && _f !== void 0 ? _f : txt.wrapU;
|
|
@@ -2,6 +2,7 @@ import { Logger } from "@configura/web-utilities";
|
|
|
2
2
|
import { DetailLevel } from "../../geometry/DetailMask.js";
|
|
3
3
|
import { DexManager } from "../dex/DexManager.js";
|
|
4
4
|
import { DexObj } from "../dex/DexObj.js";
|
|
5
|
+
import { TaggedNode } from "./components/mesh.js";
|
|
5
6
|
import { SymBox } from "./components/SymBox.js";
|
|
6
7
|
import { DexObjKey, SymComponent, SymComponentKey } from "./components/SymComponent.js";
|
|
7
8
|
import { SymDexObj } from "./components/SymDexObj.js";
|
|
@@ -40,8 +41,8 @@ export declare class SymNode {
|
|
|
40
41
|
set(key: string, value: unknown): void;
|
|
41
42
|
get(key: string): unknown;
|
|
42
43
|
has(key: string): boolean;
|
|
43
|
-
fillPropsAfterLoad(): (SymProps
|
|
44
|
-
hasDexComponent(key: string): boolean |
|
|
44
|
+
fillPropsAfterLoad(): (SymProps | Error) | undefined;
|
|
45
|
+
hasDexComponent(key: string): boolean | Error;
|
|
45
46
|
breakDexConnection(loadChildren?: boolean, descend?: boolean): void;
|
|
46
47
|
_breakDexConnection(env: SymImportEnv, loadChildren: boolean, descend: boolean): void;
|
|
47
48
|
dexObj(): DexObj | undefined;
|
|
@@ -85,7 +86,7 @@ export declare class SymNode {
|
|
|
85
86
|
addFeaturesFrom(component: SymComponent): void;
|
|
86
87
|
childrenProvider(): SymComponent | undefined;
|
|
87
88
|
meshProvider(): SymComponent | undefined;
|
|
88
|
-
get3DTmp(logger: Logger, detail: DetailLevel):
|
|
89
|
+
get3DTmp(logger: Logger, detail: DetailLevel): TaggedNode[];
|
|
89
90
|
toString(): string;
|
|
90
91
|
}
|
|
91
92
|
export declare function toSymNode(logger: Logger, obj: DexObj, parent?: SymNode, env?: SymImportEnv, putImportEnv?: boolean): SymNode;
|
|
@@ -32,7 +32,9 @@ export class SymComponent {
|
|
|
32
32
|
componentAdded(invalidate) {
|
|
33
33
|
// debug
|
|
34
34
|
}
|
|
35
|
-
load(logger, obj, _env, force = false) {
|
|
35
|
+
load(logger, obj, _env, force = false) {
|
|
36
|
+
// This method has been left intentionally blank
|
|
37
|
+
}
|
|
36
38
|
lazyLoad(logger, obj, _env) {
|
|
37
39
|
throw logger.errorAsObject("SymComponent.lazyLoad called on base class");
|
|
38
40
|
}
|
|
@@ -4,7 +4,9 @@ export class SymLODGroup extends SymComponent {
|
|
|
4
4
|
super(...arguments);
|
|
5
5
|
this.id = "symLODGroup";
|
|
6
6
|
}
|
|
7
|
-
load(logger, obj, env, force = false) {
|
|
7
|
+
load(logger, obj, env, force = false) {
|
|
8
|
+
// This method has been left intentionally blank
|
|
9
|
+
}
|
|
8
10
|
level() {
|
|
9
11
|
return 1;
|
|
10
12
|
}
|
|
@@ -8,7 +8,7 @@ export class SymMultiSelector {
|
|
|
8
8
|
logger.warn("SymMultiSelector loading error", "selectors not of type Array");
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
for (
|
|
11
|
+
for (const selector of selectors) {
|
|
12
12
|
if (!(selector instanceof DexObj)) {
|
|
13
13
|
logger.warn("SymMultiSelector loading error", "selector not of type DexObj");
|
|
14
14
|
continue;
|
|
@@ -5,7 +5,7 @@ import { SymComponent, SymComponentKey } from "./SymComponent.js";
|
|
|
5
5
|
export declare class SymParams extends SymComponent {
|
|
6
6
|
id: SymComponentKey;
|
|
7
7
|
private _params;
|
|
8
|
-
load(logger: Logger, obj: DexObj, _env: SymImportEnv, force?: boolean):
|
|
8
|
+
load(logger: Logger, obj: DexObj, _env: SymImportEnv, force?: boolean): void;
|
|
9
9
|
get params(): Map<string, ParamValue>;
|
|
10
10
|
}
|
|
11
11
|
export declare class ParamValue {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Logger } from "@configura/web-utilities";
|
|
2
2
|
import { Plane } from "../../../geometry/Plane.js";
|
|
3
|
+
import { Point } from "../../../geometry/Point.js";
|
|
3
4
|
import { DexObj } from "../../dex/DexObj.js";
|
|
4
5
|
import { SymImportEnv } from "../SymImportEnv.js";
|
|
5
6
|
import { SymComponent, SymComponentKey } from "./SymComponent.js";
|
|
@@ -8,7 +9,7 @@ export declare class SymPlane extends SymComponent {
|
|
|
8
9
|
id: SymComponentKey;
|
|
9
10
|
constructor(_plane?: Plane | undefined, src?: string);
|
|
10
11
|
get plane(): Plane | undefined;
|
|
11
|
-
get vector():
|
|
12
|
+
get vector(): Point | undefined;
|
|
12
13
|
get distance(): number | undefined;
|
|
13
14
|
load(logger: Logger, obj: DexObj, _env: SymImportEnv, force?: boolean): void;
|
|
14
15
|
}
|
|
@@ -12,8 +12,8 @@ export declare class SymProgs extends SymComponent {
|
|
|
12
12
|
export declare class SymProg {
|
|
13
13
|
readonly code: RCode;
|
|
14
14
|
readonly formalArgs: RParam[];
|
|
15
|
-
readonly isStretch:
|
|
16
|
-
constructor(code: RCode, formalArgs: RParam[], isStretch:
|
|
15
|
+
readonly isStretch: boolean;
|
|
16
|
+
constructor(code: RCode, formalArgs: RParam[], isStretch: boolean);
|
|
17
17
|
static load(obj: DexObj, logger: Logger): SymProg | undefined;
|
|
18
18
|
}
|
|
19
19
|
export declare class RCode {
|
|
@@ -92,7 +92,7 @@ export class RCode {
|
|
|
92
92
|
logger.warn("RCode loading error", "invalid properties");
|
|
93
93
|
return undefined;
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
const rParams = [];
|
|
96
96
|
for (const variable of variables) {
|
|
97
97
|
const param = RParam.load(variable, logger);
|
|
98
98
|
if (param === undefined) {
|
|
@@ -29,7 +29,7 @@ export declare class SymProps extends SymComponent {
|
|
|
29
29
|
id: SymComponentKey;
|
|
30
30
|
constructor(props?: Map<string, unknown> | undefined, src?: string);
|
|
31
31
|
load(logger: Logger, obj: DexObj, env: SymImportEnv, force?: boolean): void;
|
|
32
|
-
loadValue(logger: Logger, key: string, obj: DexSerializable, env: SymImportEnv):
|
|
32
|
+
loadValue(logger: Logger, key: string, obj: DexSerializable, env: SymImportEnv): DexSerializable;
|
|
33
33
|
loadDexObj(logger: Logger, key: string, obj: DexObj, env: SymImportEnv): void;
|
|
34
34
|
loadSymProp(logger: Logger, key: string, obj: DexObj, env: SymImportEnv): void;
|
|
35
35
|
set(key: string, value: unknown): void;
|
|
@@ -39,7 +39,7 @@ export declare class SymProps extends SymComponent {
|
|
|
39
39
|
empty(): boolean;
|
|
40
40
|
hasAttribute(key: string, attribute: symbol): boolean;
|
|
41
41
|
invalidation(): SymInv[];
|
|
42
|
-
toString():
|
|
42
|
+
toString(): string;
|
|
43
43
|
}
|
|
44
44
|
export declare class SymPropsInv extends SymInv {
|
|
45
45
|
key: string;
|
|
@@ -153,16 +153,17 @@ export class SymReps extends SymComponent {
|
|
|
153
153
|
return true;
|
|
154
154
|
}
|
|
155
155
|
removeAllExcept(other) {
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
const details = this._details;
|
|
157
|
+
if (details !== undefined) {
|
|
158
|
+
details.forEach((mask, mode) => {
|
|
158
159
|
const otherMask = other.detailMask(mode);
|
|
159
160
|
// tslint:disable-next-line:no-bitwise
|
|
160
161
|
mask.mask = mask.mask & otherMask.mask;
|
|
161
162
|
if (mask.mask === 0) {
|
|
162
|
-
|
|
163
|
+
details.delete(mode);
|
|
163
164
|
}
|
|
164
165
|
else {
|
|
165
|
-
|
|
166
|
+
details.set(mode, mask);
|
|
166
167
|
}
|
|
167
168
|
});
|
|
168
169
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Logger } from "@configura/web-utilities";
|
|
2
|
-
import { UVMapper } from "../../../core3D/uvmapper/UVMapper.js";
|
|
3
2
|
import { UVMapEnv } from "../../../core3D/uvmapper/UVMapEnv.js";
|
|
3
|
+
import { UVMapper } from "../../../core3D/uvmapper/UVMapper.js";
|
|
4
4
|
import { DexObj } from "../../dex/DexObj.js";
|
|
5
5
|
import { SymImportEnv } from "../SymImportEnv.js";
|
|
6
6
|
import { SymComponent, SymComponentKey } from "./SymComponent.js";
|
|
@@ -27,9 +27,10 @@ export class DexInternalizedXRef {
|
|
|
27
27
|
}
|
|
28
28
|
target() {
|
|
29
29
|
switch (this.style) {
|
|
30
|
-
case DexXRefStyle.Anonymous:
|
|
30
|
+
case DexXRefStyle.Anonymous: {
|
|
31
31
|
const filename = this.url.slice(this.url.lastIndexOf("/") + 1);
|
|
32
32
|
return this.hash + "." + this.hashId + "." + this.encoding + "." + filename;
|
|
33
|
+
}
|
|
33
34
|
case DexXRefStyle.Internal:
|
|
34
35
|
return this.url;
|
|
35
36
|
default:
|
|
@@ -11,6 +11,6 @@ export declare class DexObj {
|
|
|
11
11
|
put(key: string, value: DexSerializable): void;
|
|
12
12
|
has(key: string): boolean;
|
|
13
13
|
get(key: string): DexSerializable;
|
|
14
|
-
loadAll(visited?: DexObj[]):
|
|
14
|
+
loadAll(visited?: DexObj[]): Error | undefined;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=DexObj.d.ts.map
|
|
@@ -92,7 +92,7 @@ export class DexReader {
|
|
|
92
92
|
}
|
|
93
93
|
readPlane() {
|
|
94
94
|
const vector = this.readPoint();
|
|
95
|
-
|
|
95
|
+
const distance = this.stream.read_f64();
|
|
96
96
|
return new Plane(vector, distance);
|
|
97
97
|
}
|
|
98
98
|
readByteArray() {
|
|
@@ -345,7 +345,7 @@ export class DexReader {
|
|
|
345
345
|
}
|
|
346
346
|
readSetStr() {
|
|
347
347
|
const count = this.stream.read_i32();
|
|
348
|
-
|
|
348
|
+
const strings = new Set();
|
|
349
349
|
for (let i = 0; i < count; i++) {
|
|
350
350
|
const s = this.readStr();
|
|
351
351
|
if (s !== undefined) {
|
|
@@ -359,7 +359,7 @@ export class DexReader {
|
|
|
359
359
|
return id > 0 ? this.strs.get(id) : undefined;
|
|
360
360
|
}
|
|
361
361
|
readMapStrInt() {
|
|
362
|
-
|
|
362
|
+
const retMap = new Map();
|
|
363
363
|
const count = this.stream.read_i32();
|
|
364
364
|
for (let i = 0; i < count; i++) {
|
|
365
365
|
const key = this.readStr();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { DexSerializable } from "./DexReader.js";
|
|
2
|
+
import { DexRef } from "./DexRef.js";
|
|
2
3
|
import { DexXRef } from "./DexXRef.js";
|
|
3
4
|
export declare class DexReplacedXRefs {
|
|
4
5
|
xrefs: Map<DexSerializable, Map<string, DexXRef>>;
|
|
5
6
|
constructor();
|
|
6
|
-
get(obj: DexSerializable, k: string):
|
|
7
|
+
get(obj: DexSerializable, k: string): DexRef | undefined;
|
|
7
8
|
put(obj: DexSerializable, k: string, xref: DexXRef): void;
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=DexReplacedXRefs.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DexReader } from "./DexReader.js";
|
|
1
|
+
import { DexReader, DexSerializable } from "./DexReader.js";
|
|
2
2
|
export declare enum DexXRefStyle {
|
|
3
3
|
External = 0,
|
|
4
4
|
Internal = 1,
|
|
@@ -11,7 +11,7 @@ export declare class DexXRef {
|
|
|
11
11
|
internalizedKey?: string | undefined;
|
|
12
12
|
style?: DexXRefStyle | undefined;
|
|
13
13
|
constructor(reader: DexReader, url: string, path?: string | undefined, internalizedKey?: string | undefined, style?: DexXRefStyle | undefined);
|
|
14
|
-
load(key: string):
|
|
14
|
+
load(key: string): DexSerializable;
|
|
15
15
|
forwardSlashed(s: string): string;
|
|
16
16
|
relativeUrl(): boolean;
|
|
17
17
|
target(): string;
|
|
@@ -10,7 +10,7 @@ declare enum DetailLevel {
|
|
|
10
10
|
invisible = 254,
|
|
11
11
|
undefined = 255
|
|
12
12
|
}
|
|
13
|
-
export declare function detailLevelFromString(detailLevel:
|
|
13
|
+
export declare function detailLevelFromString(detailLevel: string): DetailLevel;
|
|
14
14
|
declare class DetailMask {
|
|
15
15
|
mask: number;
|
|
16
16
|
static withDetailSet(details: Set<DetailLevel>): DetailMask;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configura/web-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0-alpha.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@configura/internal": "2.
|
|
19
|
-
"@configura/web-utilities": "2.
|
|
18
|
+
"@configura/internal": "2.1.0-alpha.0",
|
|
19
|
+
"@configura/web-utilities": "2.1.0-alpha.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/uuid": "^8.3.0",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "883ad6e31a55f05124dd0a6b2047c36ef6e6cea1"
|
|
31
31
|
}
|