@roxyapi/ui 0.21.1 → 0.22.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 +2 -0
- package/components-catalog.json +123 -123
- package/dist/cdn/components/endpoint-form.js +4 -4
- package/dist/cdn/components/endpoint-form.js.map +3 -3
- package/dist/cdn/roxy-ui.js +37 -37
- package/dist/cdn/roxy-ui.js.map +3 -3
- package/dist/components/endpoint-form.d.ts +35 -2
- package/dist/components/endpoint-form.d.ts.map +1 -1
- package/dist/components/endpoint-form.js +1 -1
- package/dist/components/endpoint-form.js.map +3 -3
- package/dist/index.cjs +42 -42
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +51 -51
- package/dist/index.js.map +3 -3
- package/dist/schemas/post--astrology-relocation-chart.json +1 -1
- package/dist/schemas/post--tarot-spreads-career.json +1 -1
- package/dist/types/types.gen.d.ts +5 -5
- package/dist/utils/field-schema.d.ts +33 -0
- package/dist/utils/field-schema.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/endpoint-form.ts +75 -12
- package/src/types/types.gen.ts +5 -5
- package/src/utils/field-schema.ts +57 -1
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"title":"Generate relocation chart","fields":[{"key":"date","name":"date","kind":"date","required":true,"description":"Birth date in YYYY-MM-DD format. The birth moment is unchanged by relocation, so this still defines the planetary positions of the chart.","example":"1961-08-04"},{"key":"time","name":"time","kind":"time","required":true,"description":"Birth time in 24-hour HH:MM:SS format. Combined with the timezone it fixes the exact birth instant, which the relocated angles and houses are recomputed for.","example":"19:24:00"},{"key":"timezone","name":"timezone","kind":"number","required":true,"description":"Birth timezone: decimal hours from UTC (e.g. -5 for EST, 5.5 for IST) OR IANA name (e.g. \"America/New_York\"). Resolved to the DST-correct offset for the birth date. This is the birthplace timezone, not the new location timezone.","min":-14,"max":14,"example":-10},{"key":"birthLatitude","name":"
|
|
1
|
+
{"title":"Generate relocation chart","fields":[{"key":"date","name":"date","kind":"date","required":true,"description":"Birth date in YYYY-MM-DD format. The birth moment is unchanged by relocation, so this still defines the planetary positions of the chart.","example":"1961-08-04"},{"key":"time","name":"time","kind":"time","required":true,"description":"Birth time in 24-hour HH:MM:SS format. Combined with the timezone it fixes the exact birth instant, which the relocated angles and houses are recomputed for.","example":"19:24:00"},{"key":"timezone","name":"timezone","kind":"number","required":true,"description":"Birth timezone: decimal hours from UTC (e.g. -5 for EST, 5.5 for IST) OR IANA name (e.g. \"America/New_York\"). Resolved to the DST-correct offset for the birth date. This is the birthplace timezone, not the new location timezone.","min":-14,"max":14,"example":-10},{"key":"birthLatitude","name":"latitude","group":"birth","kind":"number","required":true,"description":"Birthplace latitude in decimal degrees (-90 to 90). Used for the original natal angles and houses that the relocated chart is compared against.","min":-90,"max":90,"example":21.3069},{"key":"birthLongitude","name":"longitude","group":"birth","kind":"number","required":true,"description":"Birthplace longitude in decimal degrees (-180 to 180). Positive East, negative West.","min":-180,"max":180,"example":-157.8583},{"key":"relocationLatitude","name":"latitude","group":"relocation","kind":"number","required":true,"description":"New location latitude in decimal degrees (-90 to 90). The relocated Ascendant and house cusps are most sensitive to north-south movement.","min":-90,"max":90,"example":40.7167},{"key":"relocationLongitude","name":"longitude","group":"relocation","kind":"number","required":true,"description":"New location longitude in decimal degrees (-180 to 180). The relocated Midheaven shifts roughly one degree per degree of longitude moved.","min":-180,"max":180,"example":-74.006},{"key":"houseSystem","name":"houseSystem","kind":"tiles","required":false,"description":"House system for dividing the relocated chart into 12 houses. Placidus (default) is time-sensitive and most popular in Western astrology. Whole Sign assigns one sign per house. Equal divides into 30 degree segments from the Ascendant. Koch emphasizes higher latitudes. Quadrant systems fall back to Whole Sign above the polar circle.","enum":["placidus","whole-sign","equal","koch"],"default":"placidus","example":"placidus"}],"hasLang":true}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"title":"Career Spread (7 cards)","fields":[{"key":"question","name":"question","kind":"text","required":false,"description":"Optional querent question to focus the career spread. It is echoed back on the reading and gives the
|
|
1
|
+
{"title":"Career Spread (7 cards)","fields":[{"key":"question","name":"question","kind":"text","required":false,"description":"Optional querent question to focus the career spread. It is echoed back on the reading and gives the seven career positions their context. Omit for general work and vocation guidance.","example":"What do I need to know about my career path?"},{"key":"seed","name":"seed","kind":"text","required":false,"description":"Optional seed for reproducible results. The same seed always draws the same seven cards into the same career positions, which is what lets a reading be shared or re-rendered. Omit for a random draw.","example":"reading-2f9c1a"}],"hasLang":true}
|
|
@@ -2937,7 +2937,7 @@ export type BirthChartResponse = {
|
|
|
2937
2937
|
*/
|
|
2938
2938
|
yogas?: Array<{
|
|
2939
2939
|
/**
|
|
2940
|
-
* Glossary id (lowercase, kebab-case) matching an entry in the
|
|
2940
|
+
* Glossary id (lowercase, kebab-case) matching an entry in the 301-entry planetary-yoga catalog. Use with GET /yoga/{id} to retrieve the full glossary text.
|
|
2941
2941
|
*/
|
|
2942
2942
|
id: string;
|
|
2943
2943
|
/**
|
|
@@ -3971,7 +3971,7 @@ export type SadhesatiRequest = {
|
|
|
3971
3971
|
};
|
|
3972
3972
|
export type YogaDetail = {
|
|
3973
3973
|
/**
|
|
3974
|
-
* Glossary id (lowercase, kebab-case) matching an entry in the
|
|
3974
|
+
* Glossary id (lowercase, kebab-case) matching an entry in the 301-entry planetary-yoga catalog. Use with GET /yoga/{id} to retrieve the full glossary text.
|
|
3975
3975
|
*/
|
|
3976
3976
|
id: string;
|
|
3977
3977
|
/**
|
|
@@ -4001,7 +4001,7 @@ export type YogaDetectResponse = {
|
|
|
4001
4001
|
*/
|
|
4002
4002
|
yogas: Array<{
|
|
4003
4003
|
/**
|
|
4004
|
-
* Glossary id (lowercase, kebab-case) matching an entry in the
|
|
4004
|
+
* Glossary id (lowercase, kebab-case) matching an entry in the 301-entry planetary-yoga catalog. Use with GET /yoga/{id} to retrieve the full glossary text.
|
|
4005
4005
|
*/
|
|
4006
4006
|
id: string;
|
|
4007
4007
|
/**
|
|
@@ -34298,11 +34298,11 @@ export type CastLoveSpreadResponse = CastLoveSpreadResponses[keyof CastLoveSprea
|
|
|
34298
34298
|
export type CastCareerSpreadData = {
|
|
34299
34299
|
body: {
|
|
34300
34300
|
/**
|
|
34301
|
-
* Optional querent question to focus the career spread. It is echoed back on the reading and gives the
|
|
34301
|
+
* Optional querent question to focus the career spread. It is echoed back on the reading and gives the seven career positions their context. Omit for general work and vocation guidance.
|
|
34302
34302
|
*/
|
|
34303
34303
|
question?: string;
|
|
34304
34304
|
/**
|
|
34305
|
-
* Optional seed for reproducible results. The same seed always draws the same
|
|
34305
|
+
* Optional seed for reproducible results. The same seed always draws the same seven cards into the same career positions, which is what lets a reading be shared or re-rendered. Omit for a random draw.
|
|
34306
34306
|
*/
|
|
34307
34307
|
seed?: string;
|
|
34308
34308
|
};
|
|
@@ -92,6 +92,39 @@ export interface FormModel {
|
|
|
92
92
|
export declare const TILE_MAX = 12;
|
|
93
93
|
/** The latitude+longitude+timezone trio the form suppresses in favour of a city search. Centralised so the render path and tests agree. */
|
|
94
94
|
export declare const LOCATION_TRIO: readonly ["latitude", "longitude", "timezone"];
|
|
95
|
+
/**
|
|
96
|
+
* The coordinate pair that DEFINES a location group. `timezone` is deliberately absent.
|
|
97
|
+
*
|
|
98
|
+
* @remarks
|
|
99
|
+
* A group qualifies for a city search on latitude+longitude alone, because a timezone is not always
|
|
100
|
+
* part of the group that owns the coordinates: `generateRelocationChart` carries two coordinate
|
|
101
|
+
* pairs and exactly ONE top-level `timezone`, which is the BIRTH timezone (relocating does not move
|
|
102
|
+
* the birth moment), so the relocation pair correctly has no timezone of its own. Requiring all
|
|
103
|
+
* three would leave that operation rendering raw number inputs, which is the bug this exists to
|
|
104
|
+
* prevent.
|
|
105
|
+
*/
|
|
106
|
+
export declare const LOCATION_PAIR: readonly ["latitude", "longitude"];
|
|
107
|
+
/**
|
|
108
|
+
* Split a flat coordinate property into its group prefix and canonical leaf name, or `null` when the
|
|
109
|
+
* name is not a prefixed coordinate.
|
|
110
|
+
*
|
|
111
|
+
* @remarks
|
|
112
|
+
* **Two shapes carry two locations in one request and this handles the second one.** Most
|
|
113
|
+
* multi-location operations nest per person (`person1`/`person2`, `personA`/`personB`), so object
|
|
114
|
+
* nesting alone already groups them. `generateRelocationChart` is the only operation in the spec
|
|
115
|
+
* that instead puts both pairs at the TOP level and distinguishes them by a name prefix
|
|
116
|
+
* (`birthLatitude` / `relocationLatitude`). Keying the grouping off the prefix as well as off the
|
|
117
|
+
* nesting means both shapes converge on the same group machinery, and a future `partnerLatitude`
|
|
118
|
+
* needs no code change.
|
|
119
|
+
*
|
|
120
|
+
* Matching is deliberately restricted to the coordinate pair. A prefix is NOT harvested from any
|
|
121
|
+
* other field name, so `birthDate` stays an ordinary field in the flat group and does not invent a
|
|
122
|
+
* phantom `birth` group with a lone date in it.
|
|
123
|
+
*/
|
|
124
|
+
export declare function splitCoordinateName(name: string): {
|
|
125
|
+
group: string;
|
|
126
|
+
leaf: (typeof LOCATION_PAIR)[number];
|
|
127
|
+
} | null;
|
|
95
128
|
/** Resolve a `$ref` (one hop is all the spec uses) against the schema map; pass non-refs through. */
|
|
96
129
|
export declare function resolveSchema(schema: OpenApiSchema | OpenApiSchemaRef | undefined, all: Record<string, OpenApiSchema>): OpenApiSchema | undefined;
|
|
97
130
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-schema.d.ts","sourceRoot":"","sources":["../../src/utils/field-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,+DAA+D;AAC/D,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACtD,gKAAgK;IAChK,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IAC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HANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ROXY_UI_VERSION = "0.
|
|
1
|
+
export declare const ROXY_UI_VERSION = "0.22.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roxyapi/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Web components for the RoxyAPI catalog. Drop-in charts, tables, cards, forms for astrology, tarot, numerology, biorhythm, I Ching, crystals, dreams, angel numbers, and more. One key, beautiful in 30 minutes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type FieldDef,
|
|
11
11
|
type FormModel,
|
|
12
12
|
isZodiacEnum,
|
|
13
|
+
LOCATION_PAIR,
|
|
13
14
|
LOCATION_TRIO,
|
|
14
15
|
type OpenApiDoc,
|
|
15
16
|
type OperationSchema,
|
|
@@ -500,6 +501,14 @@ export class RoxyEndpointForm extends LitElement {
|
|
|
500
501
|
this.groupHasLocation(f.group)
|
|
501
502
|
)
|
|
502
503
|
return 'location';
|
|
504
|
+
// A flat timezone in a group with no coordinates of its own is still suppressed when a
|
|
505
|
+
// location group has claimed it, otherwise the prefixed shape shows a raw decimal-hours
|
|
506
|
+
// box beside two city searches that already know the answer.
|
|
507
|
+
if (
|
|
508
|
+
f.name === 'timezone' &&
|
|
509
|
+
this.locationGroups().some((g) => this.timezoneFieldFor(g)?.key === f.key)
|
|
510
|
+
)
|
|
511
|
+
return 'location';
|
|
503
512
|
return 'normal';
|
|
504
513
|
}
|
|
505
514
|
|
|
@@ -516,10 +525,39 @@ export class RoxyEndpointForm extends LitElement {
|
|
|
516
525
|
return keys;
|
|
517
526
|
}
|
|
518
527
|
|
|
519
|
-
/** True when the fields in `group` (or the flat top level) carry latitude+longitude
|
|
528
|
+
/** True when the fields in `group` (or the flat top level) carry a latitude+longitude pair, so a location-search can autofill them. Timezone is NOT required here, see {@link LOCATION_PAIR}. */
|
|
520
529
|
private groupHasLocation(group?: string): boolean {
|
|
521
530
|
const inGroup = this.fields.filter((f) => f.group === group);
|
|
522
|
-
return
|
|
531
|
+
return LOCATION_PAIR.every((n) => inGroup.some((f) => f.name === n));
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Location groups in field order. Order is load-bearing: when a request carries coordinate
|
|
536
|
+
* groups but only ONE unprefixed top-level `timezone`, the FIRST group owns it, because that
|
|
537
|
+
* timezone belongs to the primary moment (`generateRelocationChart` has one `timezone` and it is
|
|
538
|
+
* the birth timezone). Without an owner both city boxes would write the same key and the second
|
|
539
|
+
* pick would silently overwrite the first with the wrong offset.
|
|
540
|
+
*/
|
|
541
|
+
private locationGroups(): (string | undefined)[] {
|
|
542
|
+
return this.groupKeys().filter((g) => this.groupHasLocation(g));
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* The timezone field a group's city search should fill, or undefined when there is none.
|
|
547
|
+
*
|
|
548
|
+
* Prefers a timezone inside the group (the nested `person1`/`person2` shape has its own). Falls
|
|
549
|
+
* back to an unowned flat `timezone` for the first location group only, which is what makes the
|
|
550
|
+
* prefixed shape work without leaving a decimal-hours box for a visitor to guess at.
|
|
551
|
+
*/
|
|
552
|
+
private timezoneFieldFor(group?: string): FieldDef | undefined {
|
|
553
|
+
const own = this.fields.find(
|
|
554
|
+
(f) => f.group === group && f.name === 'timezone',
|
|
555
|
+
);
|
|
556
|
+
if (own) return own;
|
|
557
|
+
if (this.locationGroups()[0] !== group) return undefined;
|
|
558
|
+
return this.fields.find(
|
|
559
|
+
(f) => f.group === undefined && f.name === 'timezone',
|
|
560
|
+
);
|
|
523
561
|
}
|
|
524
562
|
|
|
525
563
|
/**
|
|
@@ -561,9 +599,16 @@ export class RoxyEndpointForm extends LitElement {
|
|
|
561
599
|
return this.lang || undefined;
|
|
562
600
|
}
|
|
563
601
|
|
|
564
|
-
/**
|
|
602
|
+
/**
|
|
603
|
+
* Location-select handler bound to a group: fills that group's coordinate keys plus whichever
|
|
604
|
+
* timezone field it owns.
|
|
605
|
+
*
|
|
606
|
+
* Keys are LOOKED UP from the model rather than built as `group.name`. That assumption held only
|
|
607
|
+
* while every group came from object nesting; a prefixed group stores under the original wire
|
|
608
|
+
* name (`birthLatitude`), so constructing `birth.latitude` would write a key the request builder
|
|
609
|
+
* never reads and the coordinates would silently stay empty.
|
|
610
|
+
*/
|
|
565
611
|
private onLocationFor(group?: string) {
|
|
566
|
-
const prefix = group ? `${group}.` : '';
|
|
567
612
|
return (e: Event) => {
|
|
568
613
|
const detail = (e as CustomEvent).detail as {
|
|
569
614
|
latitude?: number;
|
|
@@ -572,12 +617,16 @@ export class RoxyEndpointForm extends LitElement {
|
|
|
572
617
|
utcOffset?: number;
|
|
573
618
|
};
|
|
574
619
|
if (!detail) return;
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
620
|
+
const keyOf = (name: string) =>
|
|
621
|
+
this.fields.find((f) => f.group === group && f.name === name)?.key;
|
|
622
|
+
const next: Record<string, unknown> = { ...this.values };
|
|
623
|
+
const lat = keyOf('latitude');
|
|
624
|
+
const lon = keyOf('longitude');
|
|
625
|
+
if (lat) next[lat] = detail.latitude;
|
|
626
|
+
if (lon) next[lon] = detail.longitude;
|
|
627
|
+
const tz = this.timezoneFieldFor(group);
|
|
628
|
+
if (tz) next[tz.key] = detail.timezone ?? detail.utcOffset;
|
|
629
|
+
this.values = next;
|
|
581
630
|
};
|
|
582
631
|
}
|
|
583
632
|
|
|
@@ -848,6 +897,20 @@ export class RoxyEndpointForm extends LitElement {
|
|
|
848
897
|
}
|
|
849
898
|
}
|
|
850
899
|
|
|
900
|
+
/**
|
|
901
|
+
* The fields this group's city search actually fills, named in the help text.
|
|
902
|
+
*
|
|
903
|
+
* Not the hardcoded "latitude, longitude, timezone" it used to say: a group does not always own a
|
|
904
|
+
* timezone. `generateRelocationChart` has one top-level `timezone` that belongs to the birth
|
|
905
|
+
* moment, so the relocation block fills coordinates only, and promising a timezone there would be
|
|
906
|
+
* a visible lie on the one form that made this method necessary.
|
|
907
|
+
*/
|
|
908
|
+
private locationFillList(group?: string): string {
|
|
909
|
+
const names = [...LOCATION_PAIR] as string[];
|
|
910
|
+
if (this.timezoneFieldFor(group)) names.push('timezone');
|
|
911
|
+
return names.join(', ');
|
|
912
|
+
}
|
|
913
|
+
|
|
851
914
|
private locationBlock(group?: string) {
|
|
852
915
|
return html`<div class="location-block">
|
|
853
916
|
<label
|
|
@@ -860,10 +923,10 @@ export class RoxyEndpointForm extends LitElement {
|
|
|
860
923
|
<roxy-location-search
|
|
861
924
|
publishable-key=${ifDefined(this.publishableKey)}
|
|
862
925
|
@roxy-location-select=${this.onLocationFor(group)}
|
|
863
|
-
placeholder
|
|
926
|
+
placeholder=${group ? `${humanize(group)} city` : 'City of birth'}
|
|
864
927
|
></roxy-location-search>
|
|
865
928
|
<small class="help">
|
|
866
|
-
|
|
929
|
+
Fills ${this.locationFillList(group)}. Pick a city to autofill.
|
|
867
930
|
</small>
|
|
868
931
|
</div>`;
|
|
869
932
|
}
|
package/src/types/types.gen.ts
CHANGED
|
@@ -2967,7 +2967,7 @@ export type BirthChartResponse = {
|
|
|
2967
2967
|
*/
|
|
2968
2968
|
yogas?: Array<{
|
|
2969
2969
|
/**
|
|
2970
|
-
* Glossary id (lowercase, kebab-case) matching an entry in the
|
|
2970
|
+
* Glossary id (lowercase, kebab-case) matching an entry in the 301-entry planetary-yoga catalog. Use with GET /yoga/{id} to retrieve the full glossary text.
|
|
2971
2971
|
*/
|
|
2972
2972
|
id: string;
|
|
2973
2973
|
/**
|
|
@@ -4017,7 +4017,7 @@ export type SadhesatiRequest = {
|
|
|
4017
4017
|
|
|
4018
4018
|
export type YogaDetail = {
|
|
4019
4019
|
/**
|
|
4020
|
-
* Glossary id (lowercase, kebab-case) matching an entry in the
|
|
4020
|
+
* Glossary id (lowercase, kebab-case) matching an entry in the 301-entry planetary-yoga catalog. Use with GET /yoga/{id} to retrieve the full glossary text.
|
|
4021
4021
|
*/
|
|
4022
4022
|
id: string;
|
|
4023
4023
|
/**
|
|
@@ -4048,7 +4048,7 @@ export type YogaDetectResponse = {
|
|
|
4048
4048
|
*/
|
|
4049
4049
|
yogas: Array<{
|
|
4050
4050
|
/**
|
|
4051
|
-
* Glossary id (lowercase, kebab-case) matching an entry in the
|
|
4051
|
+
* Glossary id (lowercase, kebab-case) matching an entry in the 301-entry planetary-yoga catalog. Use with GET /yoga/{id} to retrieve the full glossary text.
|
|
4052
4052
|
*/
|
|
4053
4053
|
id: string;
|
|
4054
4054
|
/**
|
|
@@ -35055,11 +35055,11 @@ export type CastLoveSpreadResponse = CastLoveSpreadResponses[keyof CastLoveSprea
|
|
|
35055
35055
|
export type CastCareerSpreadData = {
|
|
35056
35056
|
body: {
|
|
35057
35057
|
/**
|
|
35058
|
-
* Optional querent question to focus the career spread. It is echoed back on the reading and gives the
|
|
35058
|
+
* Optional querent question to focus the career spread. It is echoed back on the reading and gives the seven career positions their context. Omit for general work and vocation guidance.
|
|
35059
35059
|
*/
|
|
35060
35060
|
question?: string;
|
|
35061
35061
|
/**
|
|
35062
|
-
* Optional seed for reproducible results. The same seed always draws the same
|
|
35062
|
+
* Optional seed for reproducible results. The same seed always draws the same seven cards into the same career positions, which is what lets a reading be shared or re-rendered. Omit for a random draw.
|
|
35063
35063
|
*/
|
|
35064
35064
|
seed?: string;
|
|
35065
35065
|
};
|
|
@@ -109,6 +109,47 @@ export const TILE_MAX = 12;
|
|
|
109
109
|
/** The latitude+longitude+timezone trio the form suppresses in favour of a city search. Centralised so the render path and tests agree. */
|
|
110
110
|
export const LOCATION_TRIO = ['latitude', 'longitude', 'timezone'] as const;
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* The coordinate pair that DEFINES a location group. `timezone` is deliberately absent.
|
|
114
|
+
*
|
|
115
|
+
* @remarks
|
|
116
|
+
* A group qualifies for a city search on latitude+longitude alone, because a timezone is not always
|
|
117
|
+
* part of the group that owns the coordinates: `generateRelocationChart` carries two coordinate
|
|
118
|
+
* pairs and exactly ONE top-level `timezone`, which is the BIRTH timezone (relocating does not move
|
|
119
|
+
* the birth moment), so the relocation pair correctly has no timezone of its own. Requiring all
|
|
120
|
+
* three would leave that operation rendering raw number inputs, which is the bug this exists to
|
|
121
|
+
* prevent.
|
|
122
|
+
*/
|
|
123
|
+
export const LOCATION_PAIR = ['latitude', 'longitude'] as const;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Split a flat coordinate property into its group prefix and canonical leaf name, or `null` when the
|
|
127
|
+
* name is not a prefixed coordinate.
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* **Two shapes carry two locations in one request and this handles the second one.** Most
|
|
131
|
+
* multi-location operations nest per person (`person1`/`person2`, `personA`/`personB`), so object
|
|
132
|
+
* nesting alone already groups them. `generateRelocationChart` is the only operation in the spec
|
|
133
|
+
* that instead puts both pairs at the TOP level and distinguishes them by a name prefix
|
|
134
|
+
* (`birthLatitude` / `relocationLatitude`). Keying the grouping off the prefix as well as off the
|
|
135
|
+
* nesting means both shapes converge on the same group machinery, and a future `partnerLatitude`
|
|
136
|
+
* needs no code change.
|
|
137
|
+
*
|
|
138
|
+
* Matching is deliberately restricted to the coordinate pair. A prefix is NOT harvested from any
|
|
139
|
+
* other field name, so `birthDate` stays an ordinary field in the flat group and does not invent a
|
|
140
|
+
* phantom `birth` group with a lone date in it.
|
|
141
|
+
*/
|
|
142
|
+
export function splitCoordinateName(
|
|
143
|
+
name: string,
|
|
144
|
+
): { group: string; leaf: (typeof LOCATION_PAIR)[number] } | null {
|
|
145
|
+
const m = name.match(/^(.+?)(Latitude|Longitude)$/);
|
|
146
|
+
if (!m) return null;
|
|
147
|
+
return {
|
|
148
|
+
group: m[1],
|
|
149
|
+
leaf: m[2].toLowerCase() as (typeof LOCATION_PAIR)[number],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
112
153
|
/** Canonical lowercase zodiac set, derived from {@link SIGNS_ORDER} so sign detection and the glyph map can never disagree. */
|
|
113
154
|
const ZODIAC_LOWER = SIGNS_ORDER.map((s) => s.toLowerCase());
|
|
114
155
|
|
|
@@ -232,8 +273,23 @@ export function buildFormModel(
|
|
|
232
273
|
);
|
|
233
274
|
}
|
|
234
275
|
} else {
|
|
276
|
+
// A prefixed coordinate joins a group named after its prefix and reports the
|
|
277
|
+
// canonical leaf name, so the trio logic and the city search match it unchanged.
|
|
278
|
+
// `key` stays the ORIGINAL property name because it is the storage and wire
|
|
279
|
+
// identity: rewriting it to `birth.latitude` would serialise a body the API
|
|
280
|
+
// rejects.
|
|
281
|
+
const coord = splitCoordinateName(name);
|
|
235
282
|
fields.push(
|
|
236
|
-
|
|
283
|
+
coord
|
|
284
|
+
? toField(coord.leaf, resolved, {
|
|
285
|
+
key: name,
|
|
286
|
+
group: coord.group,
|
|
287
|
+
required: required.has(name),
|
|
288
|
+
})
|
|
289
|
+
: toField(name, resolved, {
|
|
290
|
+
key: name,
|
|
291
|
+
required: required.has(name),
|
|
292
|
+
}),
|
|
237
293
|
);
|
|
238
294
|
}
|
|
239
295
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by scripts/sync-version.ts. Do not edit.
|
|
2
|
-
export const ROXY_UI_VERSION = '0.
|
|
2
|
+
export const ROXY_UI_VERSION = '0.22.0';
|