@lovelace_lol/loom3 1.0.40 → 1.0.41
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/README.md +3 -3
- package/dist/index.cjs +38 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +38 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -92,7 +92,7 @@ declare const CC4_PRESET: Profile;
|
|
|
92
92
|
* - Scalars: extension wins when provided.
|
|
93
93
|
* - Maps: shallow-merged by key, values cloned.
|
|
94
94
|
* - Arrays: replaced when the extension provides them (except annotationRegions).
|
|
95
|
-
* - annotationRegions: merged by region name,
|
|
95
|
+
* - annotationRegions: merged by region name, with nested camera/style fields preserved.
|
|
96
96
|
*/
|
|
97
97
|
declare function extendPresetWithProfile(base: Profile, extension?: Partial<Profile>): Profile;
|
|
98
98
|
|
|
@@ -224,7 +224,7 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
224
224
|
* Loom3 - Preset Exports
|
|
225
225
|
*
|
|
226
226
|
* All AU presets are exported from here.
|
|
227
|
-
* Frontend passes a presetType string and Loom3 looks up the preset internally.
|
|
227
|
+
* Frontend passes a presetType string and Loom3 looks up or extends the preset internally.
|
|
228
228
|
*/
|
|
229
229
|
|
|
230
230
|
/**
|
|
@@ -2058,10 +2058,9 @@ declare function applyCharacterProfileToPreset(config: CharacterConfig): Profile
|
|
|
2058
2058
|
*
|
|
2059
2059
|
* Precedence:
|
|
2060
2060
|
* 1. preset defaults
|
|
2061
|
-
* 2.
|
|
2062
|
-
* is present
|
|
2061
|
+
* 2. canonical flattened `annotationRegions` / top-level profile overrides
|
|
2063
2062
|
* 3. legacy nested `config.profile` overrides (compatibility only)
|
|
2064
|
-
* 4.
|
|
2063
|
+
* 4. legacy `config.regions` fallback only when canonical annotation overrides are absent
|
|
2065
2064
|
*/
|
|
2066
2065
|
declare function extendCharacterConfigWithPreset(config: CharacterConfig): CharacterConfig;
|
|
2067
2066
|
|
package/dist/index.d.ts
CHANGED
|
@@ -92,7 +92,7 @@ declare const CC4_PRESET: Profile;
|
|
|
92
92
|
* - Scalars: extension wins when provided.
|
|
93
93
|
* - Maps: shallow-merged by key, values cloned.
|
|
94
94
|
* - Arrays: replaced when the extension provides them (except annotationRegions).
|
|
95
|
-
* - annotationRegions: merged by region name,
|
|
95
|
+
* - annotationRegions: merged by region name, with nested camera/style fields preserved.
|
|
96
96
|
*/
|
|
97
97
|
declare function extendPresetWithProfile(base: Profile, extension?: Partial<Profile>): Profile;
|
|
98
98
|
|
|
@@ -224,7 +224,7 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
224
224
|
* Loom3 - Preset Exports
|
|
225
225
|
*
|
|
226
226
|
* All AU presets are exported from here.
|
|
227
|
-
* Frontend passes a presetType string and Loom3 looks up the preset internally.
|
|
227
|
+
* Frontend passes a presetType string and Loom3 looks up or extends the preset internally.
|
|
228
228
|
*/
|
|
229
229
|
|
|
230
230
|
/**
|
|
@@ -2058,10 +2058,9 @@ declare function applyCharacterProfileToPreset(config: CharacterConfig): Profile
|
|
|
2058
2058
|
*
|
|
2059
2059
|
* Precedence:
|
|
2060
2060
|
* 1. preset defaults
|
|
2061
|
-
* 2.
|
|
2062
|
-
* is present
|
|
2061
|
+
* 2. canonical flattened `annotationRegions` / top-level profile overrides
|
|
2063
2062
|
* 3. legacy nested `config.profile` overrides (compatibility only)
|
|
2064
|
-
* 4.
|
|
2063
|
+
* 4. legacy `config.regions` fallback only when canonical annotation overrides are absent
|
|
2065
2064
|
*/
|
|
2066
2065
|
declare function extendCharacterConfigWithPreset(config: CharacterConfig): CharacterConfig;
|
|
2067
2066
|
|
package/dist/index.js
CHANGED
|
@@ -3552,7 +3552,7 @@ var mergeAnnotationRegion = (base, override) => {
|
|
|
3552
3552
|
merged.meshes = override.meshes ? [...override.meshes] : base.meshes ? [...base.meshes] : void 0;
|
|
3553
3553
|
merged.objects = override.objects ? [...override.objects] : base.objects ? [...base.objects] : void 0;
|
|
3554
3554
|
merged.children = override.children ? [...override.children] : base.children ? [...base.children] : void 0;
|
|
3555
|
-
merged.cameraOffset = override.cameraOffset ? { ...override.cameraOffset } : base.cameraOffset ? { ...base.cameraOffset } : void 0;
|
|
3555
|
+
merged.cameraOffset = override.cameraOffset ? { ...base.cameraOffset, ...override.cameraOffset } : base.cameraOffset ? { ...base.cameraOffset } : void 0;
|
|
3556
3556
|
merged.style = override.style ? {
|
|
3557
3557
|
...base.style,
|
|
3558
3558
|
...override.style,
|
|
@@ -6391,22 +6391,32 @@ function mergeRegionsByName(base, override) {
|
|
|
6391
6391
|
}
|
|
6392
6392
|
return Array.from(merged.values());
|
|
6393
6393
|
}
|
|
6394
|
+
function getAnnotationRegions(value) {
|
|
6395
|
+
return Array.isArray(value) ? value : void 0;
|
|
6396
|
+
}
|
|
6397
|
+
function getLegacyNestedOverrides(config) {
|
|
6398
|
+
return isPlainObject2(config.profile) ? config.profile : {};
|
|
6399
|
+
}
|
|
6400
|
+
function getLegacyRuntimeRegions(config) {
|
|
6401
|
+
return Array.isArray(config.regions) && config.regions.length > 0 ? config.regions : void 0;
|
|
6402
|
+
}
|
|
6403
|
+
function getCanonicalAnnotationOverrides(config) {
|
|
6404
|
+
return mergeRegionsByName(
|
|
6405
|
+
getAnnotationRegions(getLegacyNestedOverrides(config).annotationRegions),
|
|
6406
|
+
getAnnotationRegions(config.annotationRegions)
|
|
6407
|
+
);
|
|
6408
|
+
}
|
|
6394
6409
|
function extractProfileOverrides(config) {
|
|
6395
6410
|
const topLevelConfig = config;
|
|
6396
|
-
const legacyNestedOverrides =
|
|
6411
|
+
const legacyNestedOverrides = getLegacyNestedOverrides(config);
|
|
6412
|
+
const canonicalAnnotationOverrides = getCanonicalAnnotationOverrides(config);
|
|
6413
|
+
const legacyRuntimeRegions = getLegacyRuntimeRegions(config);
|
|
6414
|
+
const annotationOverrides = canonicalAnnotationOverrides ?? (legacyRuntimeRegions ? legacyRuntimeRegions.map((region) => cloneRegion(region)) : void 0);
|
|
6397
6415
|
const overrides = {};
|
|
6398
6416
|
for (const key of PROFILE_OVERRIDE_KEYS) {
|
|
6399
6417
|
if (key === "annotationRegions") {
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
const legacyRegionFallback = Array.isArray(config.regions) && config.regions.length > 0 ? config.regions : void 0;
|
|
6403
|
-
const legacyProfileRegions = mergeRegionsByName(legacyRegionFallback, legacyAnnotationRegions);
|
|
6404
|
-
const regions = mergeRegionsByName(
|
|
6405
|
-
legacyProfileRegions,
|
|
6406
|
-
topLevelAnnotationRegions
|
|
6407
|
-
);
|
|
6408
|
-
if (regions) {
|
|
6409
|
-
overrides.annotationRegions = regions.map((region) => cloneRegion(region));
|
|
6418
|
+
if (annotationOverrides) {
|
|
6419
|
+
overrides.annotationRegions = annotationOverrides.map((region) => cloneRegion(region));
|
|
6410
6420
|
}
|
|
6411
6421
|
continue;
|
|
6412
6422
|
}
|
|
@@ -6419,13 +6429,6 @@ function extractProfileOverrides(config) {
|
|
|
6419
6429
|
}
|
|
6420
6430
|
return overrides;
|
|
6421
6431
|
}
|
|
6422
|
-
function hasCanonicalAnnotationRegionOverrides(config) {
|
|
6423
|
-
const topLevelConfig = config;
|
|
6424
|
-
if (Array.isArray(topLevelConfig.annotationRegions)) {
|
|
6425
|
-
return true;
|
|
6426
|
-
}
|
|
6427
|
-
return isPlainObject2(config.profile) && Array.isArray(config.profile.annotationRegions);
|
|
6428
|
-
}
|
|
6429
6432
|
function applyCharacterProfileToPreset(config) {
|
|
6430
6433
|
const presetType = config.auPresetType;
|
|
6431
6434
|
if (!presetType) {
|
|
@@ -6457,24 +6460,34 @@ function extendCharacterConfigWithPreset(config) {
|
|
|
6457
6460
|
if (!presetType || presetType === "custom") {
|
|
6458
6461
|
return config;
|
|
6459
6462
|
}
|
|
6463
|
+
const canonicalAnnotationOverrides = getCanonicalAnnotationOverrides(config);
|
|
6464
|
+
const legacyRuntimeRegions = getLegacyRuntimeRegions(config);
|
|
6460
6465
|
const profileOverrides = extractProfileOverrides(config);
|
|
6461
6466
|
const extendedPresetProfile = applyCharacterProfileToPreset(config);
|
|
6462
6467
|
if (!extendedPresetProfile) {
|
|
6463
6468
|
return config;
|
|
6464
6469
|
}
|
|
6465
|
-
const
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6470
|
+
const presetRegionNames = new Set(
|
|
6471
|
+
(getPreset(presetType).annotationRegions ?? []).map((region) => region.name)
|
|
6472
|
+
);
|
|
6473
|
+
const extendedAnnotationRegions = normalizeRegionTree(
|
|
6474
|
+
extendedPresetProfile.annotationRegions,
|
|
6475
|
+
profileOverrides.disabledRegions
|
|
6476
|
+
);
|
|
6477
|
+
const extendedRegionNames = new Set((extendedAnnotationRegions ?? []).map((region) => region.name));
|
|
6478
|
+
const legacyExtraRegions = canonicalAnnotationOverrides && legacyRuntimeRegions ? legacyRuntimeRegions.filter((region) => !presetRegionNames.has(region.name) && !extendedRegionNames.has(region.name)).map((region) => cloneRegion(region)) : void 0;
|
|
6479
|
+
const mergedRegions = normalizeRegionTree(
|
|
6480
|
+
mergeRegionsByName(extendedAnnotationRegions, legacyExtraRegions),
|
|
6469
6481
|
profileOverrides.disabledRegions
|
|
6470
6482
|
);
|
|
6471
6483
|
const extendedRegions = orderExtendedRegions(
|
|
6472
|
-
|
|
6473
|
-
[
|
|
6484
|
+
mergedRegions,
|
|
6485
|
+
canonicalAnnotationOverrides ? [extendedAnnotationRegions, legacyExtraRegions] : [legacyRuntimeRegions, extendedAnnotationRegions]
|
|
6474
6486
|
);
|
|
6475
6487
|
return {
|
|
6476
6488
|
...config,
|
|
6477
6489
|
...extendedPresetProfile,
|
|
6490
|
+
annotationRegions: extendedRegions ?? extendedAnnotationRegions,
|
|
6478
6491
|
regions: extendedRegions ?? config.regions
|
|
6479
6492
|
};
|
|
6480
6493
|
}
|