@onlyworlds/sdk 4.135.0 → 4.135.2
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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.135.2] - 2026-11-09
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- A tool that never calls `trailByPlace` no longer carries its default floors. `TRAIL_TIERS` was built by a top-level call a bundler could not drop, so 4.135.0 and 4.135.1 added about 450 bytes to every bundle. Its freezes are now marked pure, and a bundle that imports only `mapSpace`, `worldGraph` or `OwV2Client` comes out the size it was on 4.134.1. The table is the same, frozen as before.
|
|
13
|
+
|
|
14
|
+
## [4.135.1] - 2026-11-09
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- `trailByPlace` no longer runs forever when a row of the frame has no free point left: more Pins on one row (one y and z) than the frame is wide plus one. It is refused with a TypeError naming the element, its row and the frame's width. A taken point tries every x on its row first, as before. The shared fixture gains the boundary pair (two on one point in a frame 1 wide fit; a third is refused) and a pin given as whole floats, whose words read as whole numbers.
|
|
19
|
+
|
|
8
20
|
## [4.135.0] - 2026-11-09
|
|
9
21
|
|
|
10
22
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -5974,7 +5974,7 @@ declare function roundHalfEven(v: number): number;
|
|
|
5974
5974
|
* `r0 + c * sqrt(n)` and `n * angle`), at its tier's height. Last, every point is rounded half to even, kept inside
|
|
5975
5975
|
* the frame, and, by element id order, a point already taken moves along x from its own point (one pixel right, one
|
|
5976
5976
|
* left, two right, two left, and on), so no two Pins share a point. Throws a TypeError, naming what, on an input it cannot place: an unknown key, a place with no one rule, a
|
|
5977
|
-
* reference to a place it does not hold, a kind with no tier, an id twice.
|
|
5977
|
+
* reference to a place it does not hold, a kind with no tier, an id twice, a row of the frame with no free point left.
|
|
5978
5978
|
*/
|
|
5979
5979
|
declare function trailByPlace(input: OwTrailInput): OwTrailLayout;
|
|
5980
5980
|
|
package/dist/index.js
CHANGED
|
@@ -4036,12 +4036,13 @@ function mapSpace(elements) {
|
|
|
4036
4036
|
}
|
|
4037
4037
|
|
|
4038
4038
|
// src/layout-trail.ts
|
|
4039
|
-
var
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4039
|
+
var tier = (name, z, kinds) => /* @__PURE__ */ Object.freeze({ name, z, kinds: /* @__PURE__ */ Object.freeze(kinds) });
|
|
4040
|
+
var TRAIL_TIERS = /* @__PURE__ */ Object.freeze([
|
|
4041
|
+
/* @__PURE__ */ tier("ground: places and things", 0, ["location", "object", "zone"]),
|
|
4042
|
+
/* @__PURE__ */ tier("people and the living", 240, ["character", "collective", "creature", "species"]),
|
|
4043
|
+
/* @__PURE__ */ tier("what happened", 480, ["event"]),
|
|
4044
|
+
/* @__PURE__ */ tier("told or abstract", 720, ["ability", "construct", "family", "institution", "language", "law", "narrative", "phenomenon", "relation", "title", "trait"])
|
|
4045
|
+
]);
|
|
4045
4046
|
var DEFAULT_SPIRAL = { r0: 140, c: 20, angle: 2.399963 };
|
|
4046
4047
|
var DEFAULT_PARENT_RING = 140;
|
|
4047
4048
|
function roundHalfEven(v) {
|
|
@@ -4189,11 +4190,11 @@ function trailByPlace(input) {
|
|
|
4189
4190
|
const heroId = hero?.id;
|
|
4190
4191
|
for (const { cx, cy, hs } of clusters.values()) {
|
|
4191
4192
|
hs.sort((p, q) => Number(p.h.id !== heroId) - Number(q.h.id !== heroId) || p.tier - q.tier || byCodePoint(p.h.id, q.h.id));
|
|
4192
|
-
hs.forEach(({ h, tier }, n) => {
|
|
4193
|
+
hs.forEach(({ h, tier: tier2 }, n) => {
|
|
4193
4194
|
const r = spiral.r0 + spiral.c * Math.sqrt(n);
|
|
4194
4195
|
const a = n * spiral.angle;
|
|
4195
|
-
const where = `tier ${tiers[
|
|
4196
|
-
raw.push({ element_type: h.type, element_id: h.id, name: h.name, x: cx + r * Math.cos(a), y: cy + r * Math.sin(a), z: tiers[
|
|
4196
|
+
const where = `tier ${tiers[tier2].name}; ${n + 1} of ${hs.length} on the spiral round it`;
|
|
4197
|
+
raw.push({ element_type: h.type, element_id: h.id, name: h.name, x: cx + r * Math.cos(a), y: cy + r * Math.sin(a), z: tiers[tier2].z, by: h.by ? `${h.by}; ${where}` : where });
|
|
4197
4198
|
});
|
|
4198
4199
|
}
|
|
4199
4200
|
raw.sort((p, q) => byCodePoint(p.element_id, q.element_id));
|
|
@@ -4209,6 +4210,7 @@ function trailByPlace(input) {
|
|
|
4209
4210
|
}
|
|
4210
4211
|
const x0 = p.x;
|
|
4211
4212
|
for (let step = 1; taken.has(`${p.x},${p.y},${p.z}`); step++) {
|
|
4213
|
+
if (step > 2 * W + 2) fail(`no free point left for ${p.name} (${p.element_id}) on its row (y ${p.y}, z ${p.z}): the frame is ${W} wide`);
|
|
4212
4214
|
p.x = Math.min(Math.max(x0 + (step % 2 ? 1 : -1) * Math.floor((step + 1) / 2), 0), W);
|
|
4213
4215
|
nudged++;
|
|
4214
4216
|
}
|