@onlyworlds/sdk 4.182.0 → 4.183.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/AGENTS.md +1 -1
- package/SCHEMA.md +1 -1
- package/dist/index.d.ts +45 -2
- package/dist/index.js +79 -6
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# For AI agents using @onlyworlds/sdk
|
|
2
2
|
|
|
3
|
-
**Current as of**: SDK **4.x** · schema-dist **v0.34.1-dist.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.34.1-dist.139** (canonical 00.34.01).
|
|
4
4
|
This line is asserted by `codegen:check` in CI — if the pin moves and this file is not
|
|
5
5
|
re-read against it, the check fails rather than letting this document rot quietly.
|
|
6
6
|
|
package/SCHEMA.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OnlyWorlds Schema Reference
|
|
2
2
|
|
|
3
|
-
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.1-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.1-dist.139** — canonical schema **00.34.01**, published 2026-11-19.
|
|
4
4
|
|
|
5
5
|
GENERATED from the canonical schema YAML — do not hand-edit (regenerate: `python codegen/generate_types.py`).
|
|
6
6
|
Written for both humans and AI agents reading this package locally.
|
package/dist/index.d.ts
CHANGED
|
@@ -6831,6 +6831,49 @@ interface OwLayoutOf {
|
|
|
6831
6831
|
*/
|
|
6832
6832
|
declare function layoutOf(map: unknown, maps: readonly unknown[], pins: readonly unknown[]): OwLayoutOf;
|
|
6833
6833
|
|
|
6834
|
+
/**
|
|
6835
|
+
* The map-space profile's frame reading (schema-dist profiles/map-space.md, rules 13 and 14): where a point on a child
|
|
6836
|
+
* Map lies on its parent, and on each Map above it. A child Map says where it lies on the Map its `parent_map` names
|
|
6837
|
+
* with `x_parent_frame`, a box `[x0, y0, x1, y1]` in the parent's pixels. The profile's `frame_cases` are the test.
|
|
6838
|
+
* The map-space reading (`mapSpace`) and the layout reading (`layoutOf`) do not read the key.
|
|
6839
|
+
*/
|
|
6840
|
+
/** Why the walk up `parent_map` ended (rule 14). */
|
|
6841
|
+
type OwCarryStop = 'top' | 'dangling' | 'cycle' | 'no_frame' | 'no_carry';
|
|
6842
|
+
/** What is wrong with a Map's own `x_parent_frame` (rule 13). */
|
|
6843
|
+
type OwCarryLint = 'no_parent' | 'not_four_numbers' | 'not_a_box';
|
|
6844
|
+
/** A point on one Map: its id and the point in its pixels, from its bottom left. */
|
|
6845
|
+
interface OwCarryPoint {
|
|
6846
|
+
map: string;
|
|
6847
|
+
x: number;
|
|
6848
|
+
y: number;
|
|
6849
|
+
}
|
|
6850
|
+
interface OwCarryOf {
|
|
6851
|
+
/** The Map's `x_parent_frame` as written when it is a parent frame, else null. The Map's own: it does not depend on the point. */
|
|
6852
|
+
parent_frame: number[] | null;
|
|
6853
|
+
/** `no_parent`, `not_four_numbers` or `not_a_box` when this Map's own key is one, else null. */
|
|
6854
|
+
lint: OwCarryLint | null;
|
|
6855
|
+
/** The point on this Map as given, then the point on each Map it is carried to, up the `parent_map` chain. */
|
|
6856
|
+
points: OwCarryPoint[];
|
|
6857
|
+
/** Why the last point is carried no further; null only for a row that is no Map. */
|
|
6858
|
+
stop: OwCarryStop | null;
|
|
6859
|
+
}
|
|
6860
|
+
/**
|
|
6861
|
+
* One Map's frame reading: `{parent_frame, lint, points, stop}`, every key always present.
|
|
6862
|
+
*
|
|
6863
|
+
* `map` is the Map read, `point` is `[x, y]` on it (two finite numbers in its pixels from its bottom left, as a Pin's
|
|
6864
|
+
* `x` and `y` or a tap gives them), and `maps` the Maps the reader is served: rows of any other type are skipped, a
|
|
6865
|
+
* row whose `type` is not exactly `map` or that has no non-empty string id is no Map, and of two rows with one id the
|
|
6866
|
+
* last served is read. A `map` that is no Map answers `{parent_frame: null, lint: null, points: [], stop: null}`.
|
|
6867
|
+
*
|
|
6868
|
+
* The point is carried one level at a time up `parent_map`, by each level's own frame, as
|
|
6869
|
+
* `x0 + ((x * (x1 - x0)) / width)` and `y0 + ((y * (y1 - y0)) / height)` in that order, never through one product
|
|
6870
|
+
* of the levels' ratios. The walk ends at a Map with no `parent_map` (`top`), one whose parent is not served
|
|
6871
|
+
* (`dangling`), one whose parent the walk has already reached, itself included (`cycle`), one with no parent frame
|
|
6872
|
+
* (`no_frame`), or one whose written `width` or `height` is not a whole number above 0 (`no_carry`). A point outside
|
|
6873
|
+
* the child is carried as written; `z` is not carried. Pure.
|
|
6874
|
+
*/
|
|
6875
|
+
declare function carryOf(map: unknown, point: readonly [number, number] | readonly number[], maps: readonly unknown[]): OwCarryOf;
|
|
6876
|
+
|
|
6834
6877
|
/** A place on the route, in travel order. Exactly one of `pin`, `between` or `parent` says where it sits. */
|
|
6835
6878
|
interface OwTrailPlace {
|
|
6836
6879
|
id: string;
|
|
@@ -8537,5 +8580,5 @@ declare class TokenResource {
|
|
|
8537
8580
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
8538
8581
|
}
|
|
8539
8582
|
|
|
8540
|
-
export { AGENT_DOORS, ASK_LIMITS, BY_LINKS_3D_REST, BY_LINKS_3D_VERSION, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, DATE_FIELD, DECLARED_LINKS, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, GROUP_COLORS, GROUP_ORDER, GameTier, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, OwAddressError, OwApiError, OwNetworkError, OwPreconditionFailedError, OwProposedError, OwSignInError, OwStaleProposalError, OwV2Client, OwWorldFileError, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, SPATIAL_TYPES, STRAND_FIELD, TOOLS, TRAIL_TIERS, TokenResource, VIEWS, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, absYearForEraYear, absoluteYear, approxYearLength, askerOf, base64url, breakdownStep, buildAskContext, buildWorldIndex, byCodePoint, charterOf, compareInstants, dateOf, degreeOf, designPartsOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, findOwLinks, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, instantOf, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isOpenWork, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutAround, layoutByKind, layoutByLinks3d, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readOwLinkAt, readReportLine, readReportLines, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, reportTalksOf, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, talksOf, threadOf, trailByPlace, trimAndFold, typeWord, unplacedAround, unplacedByKind, unplacedByLinks3d, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, workOf, workStateOf, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
|
8541
|
-
export type { AccessKeyResponse, CalendarConfig, CalendarEra, CalendarIntercalary, CalendarMonths, CalendarWeek, ElementFamily, ElementGroup, ElementType, EncryptionInfo, EraDomain, FieldInfo, FieldType, ListParams, OwAccountToken, OwAccountWorld, OwAddress, OwAddressAt, OwAddressForm, OwAddressFound, OwAddressReading, OwAddressReason, OwAddressingOptions, OwAgentJoined, OwAiAskAnswer, OwAiAskBody, OwAiMeter, OwAiRefusal, OwAiSortAnswer, OwAiSortBody, OwAiToken, OwAiUse, OwAllowance, OwAskAnswer, OwAskContext, OwAskContextOptions, OwAskLeftOut, OwAuthErrorCode, OwBulkItem, OwBulkItemResult, OwBulkResponse, OwCalendarElement, OwChange, OwChangeDelete, OwChangeUpsert, OwChangesPage, OwCharterWorld, OwClientConfig, OwCreateAccountWorldInput, OwCreatedAccountWorld, OwCreatedWorldLink, OwDeleteReason, OwDesignPart, OwDoor, OwDragField, OwDraught, OwDraughtCompact, OwDraughtComponent, OwDraughtItem, OwDraughtLens, OwDraughtPolicy, OwEdited, OwElement, OwElementBase, OwElementMark, OwErrorBody, OwFieldsRefusal, OwFileAddedBy, OwFileDownload, OwFileKind, OwFileRow, OwFileTicket, OwFrontDoor, OwFrontDoorCharter, OwFrontDoorSkill, OwGraphCutReason, OwGraphEdge, OwGraphMark, OwGraphNode, OwGraphOptions, OwHiddenRow, OwInstant, OwJoinPreview, OwJoined, OwJoinedMembership, OwKeyKind, OwLanding, OwLandingCluster, OwLandingGap, OwLandingGapKind, OwLandingMember, OwLandingMode, OwLandingOptions, OwLayout3dHow, OwLayout3dPart, OwLayoutAround, OwLayoutAroundOptions, OwLayoutAroundPoint, OwLayoutByKind, OwLayoutByLinks3d, OwLayoutByLinks3dOptions, OwLayoutGraph, OwLayoutOf, OwLayoutPoint, OwLensCutReason, OwLensMail, OwLensOptions, OwLensReader, OwLensReading, OwLensWorld, OwLinkEdit, OwLookupElement, OwLookupHit, OwLookupLink, OwLookupOptions, OwLookupReason, OwMapSpace, OwMapSpaceMap, OwMapSpaceOutReason, OwMapSpaceOutline, OwMapSpacePin, OwMapSpacePoint, OwMe, OwMediaTicket, OwMember, OwMemberLenses, OwMemberRole, OwMessageMember, OwMintedAiToken, OwMintedKey, OwMySeat, OwNamesMap, OwOpener, OwOpenerKind, OwOpenerState, OwOpenerSurface, OwOpenersOptions, OwPage, OwPaidBy, OwPhotoOptions, OwPhotoPlan, OwPlayerJoined, OwPreparedPhoto, OwProposal, OwProposalAccepted, OwProposalConflict, OwProposalList, OwProposalQuery, OwProposalState, OwProposeInput, OwProposed, OwProposedMark, OwProposedNewElement, OwReadWorldFile, OwReadWorldFileOptions, OwReadingAids, OwReadingAidsCharter, OwReadingAidsDomain, OwReadingAidsGuide, OwReadingAidsHub, OwRecord, OwRecordMark, OwRecordStory, OwRemovalTicket, OwRemovedImage, OwRenderOptions, OwReportGroup, OwReportLine, OwReportLineOptions, OwReportLint, OwReportParentKind, OwReportThreads, OwResyncReason, OwReviewInput, OwReviewed, OwSearchResult, OwSearchResults, OwSeat, OwSeatCreated, OwSender, OwSenderStatus, OwServedReadingAids, OwSignInBegin, OwSignInBegun, OwSignInComplete, OwSignInReason, OwSignInResult, OwSignInStorage, OwSignedIn, OwSortAddToRow, OwSortAnswer, OwSortAskRow, OwSortLinkRow, OwSortMakeRow, OwSortNote, OwSortRef, OwSortRow, OwStrand, OwStrandSlot, OwStrandWorld, OwTalk, OwTool, OwToolNeeds, OwToolOpen, OwTrailGround, OwTrailHanger, OwTrailInput, OwTrailLayout, OwTrailPin, OwTrailPlace, OwTrailSettings, OwTrailSpiral, OwTrailTier, OwUploadedFile, OwUploadedImage, OwView, OwViewRow, OwViewsTable, OwWordPair, OwWork, OwWorkElement, OwWorkLint, OwWorkState, OwWorkWorld, OwWorldFileEntry, OwWorldFileReason, OwWorldFileRow, OwWorldFiles, OwWorldGraph, OwWorldIndex, OwWorldKeyMember, OwWorldKeyRow, OwWorldLens, OwWorldLensReading, OwWorldLenses, OwWorldLink, OwWorldMeta, OwWorldOrigin, OwWorldProducer, OwWorldProposalList, OwWorldProposalQuery, OwWorldProposalRow, OwWorldPublicPage, OwWorldSource, OwWriteDoor, OwWriteWorldFileOptions, OwWriteWorldFileReport, ParseError, ParseOptions, ParseResult, RevokeAllSessionsResponse, RevokeSessionResponse, SectionInfo, StepBreakdown, TokenConsumeParams, TokenConsumeResponse, TokenStatus, TokenTransport, WorldCalendar };
|
|
8583
|
+
export { AGENT_DOORS, ASK_LIMITS, BY_LINKS_3D_REST, BY_LINKS_3D_VERSION, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, DATE_FIELD, DECLARED_LINKS, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, GROUP_COLORS, GROUP_ORDER, GameTier, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, OwAddressError, OwApiError, OwNetworkError, OwPreconditionFailedError, OwProposedError, OwSignInError, OwStaleProposalError, OwV2Client, OwWorldFileError, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, SPATIAL_TYPES, STRAND_FIELD, TOOLS, TRAIL_TIERS, TokenResource, VIEWS, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, absYearForEraYear, absoluteYear, approxYearLength, askerOf, base64url, breakdownStep, buildAskContext, buildWorldIndex, byCodePoint, carryOf, charterOf, compareInstants, dateOf, degreeOf, designPartsOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, findOwLinks, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, instantOf, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isOpenWork, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutAround, layoutByKind, layoutByLinks3d, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readOwLinkAt, readReportLine, readReportLines, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, reportTalksOf, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, talksOf, threadOf, trailByPlace, trimAndFold, typeWord, unplacedAround, unplacedByKind, unplacedByLinks3d, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, workOf, workStateOf, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
|
8584
|
+
export type { AccessKeyResponse, CalendarConfig, CalendarEra, CalendarIntercalary, CalendarMonths, CalendarWeek, ElementFamily, ElementGroup, ElementType, EncryptionInfo, EraDomain, FieldInfo, FieldType, ListParams, OwAccountToken, OwAccountWorld, OwAddress, OwAddressAt, OwAddressForm, OwAddressFound, OwAddressReading, OwAddressReason, OwAddressingOptions, OwAgentJoined, OwAiAskAnswer, OwAiAskBody, OwAiMeter, OwAiRefusal, OwAiSortAnswer, OwAiSortBody, OwAiToken, OwAiUse, OwAllowance, OwAskAnswer, OwAskContext, OwAskContextOptions, OwAskLeftOut, OwAuthErrorCode, OwBulkItem, OwBulkItemResult, OwBulkResponse, OwCalendarElement, OwCarryLint, OwCarryOf, OwCarryPoint, OwCarryStop, OwChange, OwChangeDelete, OwChangeUpsert, OwChangesPage, OwCharterWorld, OwClientConfig, OwCreateAccountWorldInput, OwCreatedAccountWorld, OwCreatedWorldLink, OwDeleteReason, OwDesignPart, OwDoor, OwDragField, OwDraught, OwDraughtCompact, OwDraughtComponent, OwDraughtItem, OwDraughtLens, OwDraughtPolicy, OwEdited, OwElement, OwElementBase, OwElementMark, OwErrorBody, OwFieldsRefusal, OwFileAddedBy, OwFileDownload, OwFileKind, OwFileRow, OwFileTicket, OwFrontDoor, OwFrontDoorCharter, OwFrontDoorSkill, OwGraphCutReason, OwGraphEdge, OwGraphMark, OwGraphNode, OwGraphOptions, OwHiddenRow, OwInstant, OwJoinPreview, OwJoined, OwJoinedMembership, OwKeyKind, OwLanding, OwLandingCluster, OwLandingGap, OwLandingGapKind, OwLandingMember, OwLandingMode, OwLandingOptions, OwLayout3dHow, OwLayout3dPart, OwLayoutAround, OwLayoutAroundOptions, OwLayoutAroundPoint, OwLayoutByKind, OwLayoutByLinks3d, OwLayoutByLinks3dOptions, OwLayoutGraph, OwLayoutOf, OwLayoutPoint, OwLensCutReason, OwLensMail, OwLensOptions, OwLensReader, OwLensReading, OwLensWorld, OwLinkEdit, OwLookupElement, OwLookupHit, OwLookupLink, OwLookupOptions, OwLookupReason, OwMapSpace, OwMapSpaceMap, OwMapSpaceOutReason, OwMapSpaceOutline, OwMapSpacePin, OwMapSpacePoint, OwMe, OwMediaTicket, OwMember, OwMemberLenses, OwMemberRole, OwMessageMember, OwMintedAiToken, OwMintedKey, OwMySeat, OwNamesMap, OwOpener, OwOpenerKind, OwOpenerState, OwOpenerSurface, OwOpenersOptions, OwPage, OwPaidBy, OwPhotoOptions, OwPhotoPlan, OwPlayerJoined, OwPreparedPhoto, OwProposal, OwProposalAccepted, OwProposalConflict, OwProposalList, OwProposalQuery, OwProposalState, OwProposeInput, OwProposed, OwProposedMark, OwProposedNewElement, OwReadWorldFile, OwReadWorldFileOptions, OwReadingAids, OwReadingAidsCharter, OwReadingAidsDomain, OwReadingAidsGuide, OwReadingAidsHub, OwRecord, OwRecordMark, OwRecordStory, OwRemovalTicket, OwRemovedImage, OwRenderOptions, OwReportGroup, OwReportLine, OwReportLineOptions, OwReportLint, OwReportParentKind, OwReportThreads, OwResyncReason, OwReviewInput, OwReviewed, OwSearchResult, OwSearchResults, OwSeat, OwSeatCreated, OwSender, OwSenderStatus, OwServedReadingAids, OwSignInBegin, OwSignInBegun, OwSignInComplete, OwSignInReason, OwSignInResult, OwSignInStorage, OwSignedIn, OwSortAddToRow, OwSortAnswer, OwSortAskRow, OwSortLinkRow, OwSortMakeRow, OwSortNote, OwSortRef, OwSortRow, OwStrand, OwStrandSlot, OwStrandWorld, OwTalk, OwTool, OwToolNeeds, OwToolOpen, OwTrailGround, OwTrailHanger, OwTrailInput, OwTrailLayout, OwTrailPin, OwTrailPlace, OwTrailSettings, OwTrailSpiral, OwTrailTier, OwUploadedFile, OwUploadedImage, OwView, OwViewRow, OwViewsTable, OwWordPair, OwWork, OwWorkElement, OwWorkLint, OwWorkState, OwWorkWorld, OwWorldFileEntry, OwWorldFileReason, OwWorldFileRow, OwWorldFiles, OwWorldGraph, OwWorldIndex, OwWorldKeyMember, OwWorldKeyRow, OwWorldLens, OwWorldLensReading, OwWorldLenses, OwWorldLink, OwWorldMeta, OwWorldOrigin, OwWorldProducer, OwWorldProposalList, OwWorldProposalQuery, OwWorldProposalRow, OwWorldPublicPage, OwWorldSource, OwWriteDoor, OwWriteWorldFileOptions, OwWriteWorldFileReport, ParseError, ParseOptions, ParseResult, RevokeAllSessionsResponse, RevokeSessionResponse, SectionInfo, StepBreakdown, TokenConsumeParams, TokenConsumeResponse, TokenStatus, TokenTransport, WorldCalendar };
|
package/dist/index.js
CHANGED
|
@@ -4594,6 +4594,78 @@ function layoutOf(map, maps, pins) {
|
|
|
4594
4594
|
return { layout: method, ground, hand };
|
|
4595
4595
|
}
|
|
4596
4596
|
|
|
4597
|
+
// src/carry-of.ts
|
|
4598
|
+
var isRow3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
4599
|
+
var idOf4 = (v) => typeof v === "string" && v !== "" ? v : null;
|
|
4600
|
+
var mapId = (v) => isRow3(v) && v.type === "map" ? idOf4(v.id) : null;
|
|
4601
|
+
var isNumber = (v) => typeof v === "number" && Number.isFinite(v);
|
|
4602
|
+
var isCarrySize = (v) => isNumber(v) && Number.isInteger(v) && v > 0;
|
|
4603
|
+
function frameOf(map) {
|
|
4604
|
+
const key3 = map.x_parent_frame;
|
|
4605
|
+
const present = key3 !== void 0 && key3 !== null;
|
|
4606
|
+
if (idOf4(map.parent_map) === null) return { frame: null, lint: present ? "no_parent" : null };
|
|
4607
|
+
if (!present) return { frame: null, lint: null };
|
|
4608
|
+
if (!Array.isArray(key3) || key3.length !== 4 || !key3.every(isNumber)) return { frame: null, lint: "not_four_numbers" };
|
|
4609
|
+
const [x0, y0, x1, y1] = key3;
|
|
4610
|
+
if (!(x0 < x1) || !(y0 < y1)) return { frame: null, lint: "not_a_box" };
|
|
4611
|
+
return { frame: key3, lint: null };
|
|
4612
|
+
}
|
|
4613
|
+
function carryOf(map, point2, maps) {
|
|
4614
|
+
if (!isRow3(map)) throw new TypeError("carryOf: map is one Map element.");
|
|
4615
|
+
if (!Array.isArray(point2) || point2.length !== 2 || !point2.every(isNumber)) {
|
|
4616
|
+
throw new TypeError(`carryOf: point is [x, y], two finite numbers; got ${JSON.stringify(point2) ?? String(point2)}.`);
|
|
4617
|
+
}
|
|
4618
|
+
if (!Array.isArray(maps)) throw new TypeError("carryOf: maps is a list of Map elements.");
|
|
4619
|
+
const id = mapId(map);
|
|
4620
|
+
if (id === null) return { parent_frame: null, lint: null, points: [], stop: null };
|
|
4621
|
+
const served = /* @__PURE__ */ new Map();
|
|
4622
|
+
for (const m of maps) {
|
|
4623
|
+
const mid = mapId(m);
|
|
4624
|
+
if (mid !== null) served.set(mid, m);
|
|
4625
|
+
}
|
|
4626
|
+
const own4 = frameOf(map);
|
|
4627
|
+
let x = point2[0];
|
|
4628
|
+
let y = point2[1];
|
|
4629
|
+
const points2 = [{ map: id, x, y }];
|
|
4630
|
+
const reached = /* @__PURE__ */ new Set([id]);
|
|
4631
|
+
let at = map;
|
|
4632
|
+
let frame = own4.frame;
|
|
4633
|
+
let stop;
|
|
4634
|
+
for (; ; ) {
|
|
4635
|
+
const parentId = idOf4(at.parent_map);
|
|
4636
|
+
if (parentId === null) {
|
|
4637
|
+
stop = "top";
|
|
4638
|
+
break;
|
|
4639
|
+
}
|
|
4640
|
+
const parent = served.get(parentId);
|
|
4641
|
+
if (parent === void 0) {
|
|
4642
|
+
stop = "dangling";
|
|
4643
|
+
break;
|
|
4644
|
+
}
|
|
4645
|
+
if (reached.has(parentId)) {
|
|
4646
|
+
stop = "cycle";
|
|
4647
|
+
break;
|
|
4648
|
+
}
|
|
4649
|
+
if (frame === null) {
|
|
4650
|
+
stop = "no_frame";
|
|
4651
|
+
break;
|
|
4652
|
+
}
|
|
4653
|
+
const { width, height } = at;
|
|
4654
|
+
if (!isCarrySize(width) || !isCarrySize(height)) {
|
|
4655
|
+
stop = "no_carry";
|
|
4656
|
+
break;
|
|
4657
|
+
}
|
|
4658
|
+
const [x0, y0, x1, y1] = frame;
|
|
4659
|
+
x = x0 + x * (x1 - x0) / width;
|
|
4660
|
+
y = y0 + y * (y1 - y0) / height;
|
|
4661
|
+
points2.push({ map: parentId, x, y });
|
|
4662
|
+
reached.add(parentId);
|
|
4663
|
+
at = parent;
|
|
4664
|
+
frame = frameOf(parent).frame;
|
|
4665
|
+
}
|
|
4666
|
+
return { parent_frame: own4.frame, lint: own4.lint, points: points2, stop };
|
|
4667
|
+
}
|
|
4668
|
+
|
|
4597
4669
|
// src/layout-trail.ts
|
|
4598
4670
|
var tier = (name, z, kinds) => /* @__PURE__ */ Object.freeze({ name, z, kinds: /* @__PURE__ */ Object.freeze(kinds) });
|
|
4599
4671
|
var TRAIL_TIERS = /* @__PURE__ */ Object.freeze([
|
|
@@ -6886,7 +6958,7 @@ function readUnit(u) {
|
|
|
6886
6958
|
}
|
|
6887
6959
|
return u;
|
|
6888
6960
|
}
|
|
6889
|
-
function
|
|
6961
|
+
function frameOf2(first, at, hflag, hat, unit) {
|
|
6890
6962
|
const cv = [], cx = [], cy = [];
|
|
6891
6963
|
for (const [id, q] of first) {
|
|
6892
6964
|
const v = at.get(id);
|
|
@@ -7076,7 +7148,7 @@ function layout3d(nodes, edges, rows2, table, opts = {}) {
|
|
|
7076
7148
|
if (rows2) {
|
|
7077
7149
|
plateAns = plate(rows2, new Set(ids));
|
|
7078
7150
|
if (plateAns && hflag) {
|
|
7079
|
-
frame =
|
|
7151
|
+
frame = frameOf2(plateAns.first, at, hflag, hat, unit);
|
|
7080
7152
|
if (frame) plateAns = plate(rows2, new Set(ids), { scale: frame.s });
|
|
7081
7153
|
}
|
|
7082
7154
|
plateAt = plateAns ? plateAns.at : null;
|
|
@@ -7419,15 +7491,15 @@ function layoutPieces(nodes, edges, rows2, table, opts = {}) {
|
|
|
7419
7491
|
}
|
|
7420
7492
|
|
|
7421
7493
|
// src/layout3d/space.ts
|
|
7422
|
-
var
|
|
7423
|
-
var
|
|
7494
|
+
var isRow4 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
7495
|
+
var idOf5 = (v) => typeof v === "string" && v !== "" ? v : null;
|
|
7424
7496
|
function spaceRows(elements) {
|
|
7425
7497
|
if (elements === null || elements === void 0) return null;
|
|
7426
7498
|
const space = mapSpace(elements);
|
|
7427
7499
|
const rawMaps = /* @__PURE__ */ new Map(), rawPins = /* @__PURE__ */ new Map();
|
|
7428
7500
|
for (const e of elements) {
|
|
7429
|
-
if (!
|
|
7430
|
-
const id =
|
|
7501
|
+
if (!isRow4(e) || typeof e.type !== "string") continue;
|
|
7502
|
+
const id = idOf5(e.id);
|
|
7431
7503
|
if (id === null) continue;
|
|
7432
7504
|
if (e.type === "map") rawMaps.set(id, e);
|
|
7433
7505
|
else if (e.type === "pin") rawPins.set(id, e);
|
|
@@ -9831,6 +9903,7 @@ export {
|
|
|
9831
9903
|
buildAskContext,
|
|
9832
9904
|
buildWorldIndex,
|
|
9833
9905
|
byCodePoint,
|
|
9906
|
+
carryOf,
|
|
9834
9907
|
charterOf,
|
|
9835
9908
|
compareInstants,
|
|
9836
9909
|
dateOf,
|