@roxyapi/ui 0.4.1 → 0.6.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 +21 -0
- package/README.md +17 -1
- package/dist/cdn/components/ashtakavarga-grid.js +3 -362
- package/dist/cdn/components/ashtakavarga-grid.js.map +4 -4
- package/dist/cdn/components/biorhythm-chart.js +3 -226
- package/dist/cdn/components/biorhythm-chart.js.map +4 -4
- package/dist/cdn/components/choghadiya-grid.js +3 -232
- package/dist/cdn/components/choghadiya-grid.js.map +4 -4
- package/dist/cdn/components/compatibility-card.js +3 -231
- package/dist/cdn/components/compatibility-card.js.map +4 -4
- package/dist/cdn/components/dasha-timeline.js +3 -283
- package/dist/cdn/components/dasha-timeline.js.map +4 -4
- package/dist/cdn/components/data.js +3 -230
- package/dist/cdn/components/data.js.map +4 -4
- package/dist/cdn/components/divisional-chart.js +3 -356
- package/dist/cdn/components/divisional-chart.js.map +4 -4
- package/dist/cdn/components/dosha-card.js +3 -226
- package/dist/cdn/components/dosha-card.js.map +4 -4
- package/dist/cdn/components/endpoint-form.js +2 -243
- package/dist/cdn/components/endpoint-form.js.map +2 -2
- package/dist/cdn/components/guna-milan.js +3 -270
- package/dist/cdn/components/guna-milan.js.map +4 -4
- package/dist/cdn/components/hexagram.js +3 -247
- package/dist/cdn/components/hexagram.js.map +4 -4
- package/dist/cdn/components/horoscope-card.js +3 -281
- package/dist/cdn/components/horoscope-card.js.map +4 -4
- package/dist/cdn/components/kp-chart.js +3 -278
- package/dist/cdn/components/kp-chart.js.map +4 -4
- package/dist/cdn/components/kp-planets-table.js +3 -196
- package/dist/cdn/components/kp-planets-table.js.map +4 -4
- package/dist/cdn/components/kp-ruling-planets.js +3 -241
- package/dist/cdn/components/kp-ruling-planets.js.map +4 -4
- package/dist/cdn/components/location-search.js +2 -240
- package/dist/cdn/components/location-search.js.map +2 -2
- package/dist/cdn/components/moon-phase.js +3 -223
- package/dist/cdn/components/moon-phase.js.map +4 -4
- package/dist/cdn/components/nakshatra-card.js +3 -201
- package/dist/cdn/components/nakshatra-card.js.map +4 -4
- package/dist/cdn/components/natal-chart.js +3 -563
- package/dist/cdn/components/natal-chart.js.map +4 -4
- package/dist/cdn/components/numerology-card.js +3 -233
- package/dist/cdn/components/numerology-card.js.map +4 -4
- package/dist/cdn/components/panchang-table.js +3 -220
- package/dist/cdn/components/panchang-table.js.map +4 -4
- package/dist/cdn/components/shadbala-table.js +3 -284
- package/dist/cdn/components/shadbala-table.js.map +4 -4
- package/dist/cdn/components/synastry-chart.js +3 -399
- package/dist/cdn/components/synastry-chart.js.map +4 -4
- package/dist/cdn/components/tarot-card.js +3 -261
- package/dist/cdn/components/tarot-card.js.map +4 -4
- package/dist/cdn/components/tarot-spread.js +3 -249
- package/dist/cdn/components/tarot-spread.js.map +4 -4
- package/dist/cdn/components/transits-table.js +3 -382
- package/dist/cdn/components/transits-table.js.map +4 -4
- package/dist/cdn/components/vedic-kundli.js +3 -305
- package/dist/cdn/components/vedic-kundli.js.map +4 -4
- package/dist/cdn/components/vedic-planets-table.js +3 -203
- package/dist/cdn/components/vedic-planets-table.js.map +4 -4
- package/dist/cdn/components/western-planets-table.js +3 -192
- package/dist/cdn/components/western-planets-table.js.map +4 -4
- package/dist/cdn/components/yoga-list.js +3 -306
- package/dist/cdn/components/yoga-list.js.map +4 -4
- package/dist/cdn/roxy-ui.js +3 -5102
- package/dist/cdn/roxy-ui.js.map +4 -4
- package/dist/cdn/widgets.js +1 -114
- package/dist/components/ashtakavarga-grid.d.ts +1 -0
- package/dist/components/ashtakavarga-grid.d.ts.map +1 -1
- package/dist/components/ashtakavarga-grid.js +1 -531
- package/dist/components/ashtakavarga-grid.js.map +4 -4
- package/dist/components/biorhythm-chart.d.ts +1 -0
- package/dist/components/biorhythm-chart.d.ts.map +1 -1
- package/dist/components/biorhythm-chart.js +1 -332
- package/dist/components/biorhythm-chart.js.map +4 -4
- package/dist/components/choghadiya-grid.d.ts +1 -0
- package/dist/components/choghadiya-grid.d.ts.map +1 -1
- package/dist/components/choghadiya-grid.js +1 -351
- package/dist/components/choghadiya-grid.js.map +4 -4
- package/dist/components/compatibility-card.d.ts +1 -0
- package/dist/components/compatibility-card.d.ts.map +1 -1
- package/dist/components/compatibility-card.js +1 -313
- package/dist/components/compatibility-card.js.map +4 -4
- package/dist/components/dasha-timeline.d.ts +1 -0
- package/dist/components/dasha-timeline.d.ts.map +1 -1
- package/dist/components/dasha-timeline.js +1 -401
- package/dist/components/dasha-timeline.js.map +4 -4
- package/dist/components/data.d.ts +1 -0
- package/dist/components/data.d.ts.map +1 -1
- package/dist/components/data.js +1 -362
- package/dist/components/data.js.map +4 -4
- package/dist/components/divisional-chart.d.ts +1 -0
- package/dist/components/divisional-chart.d.ts.map +1 -1
- package/dist/components/divisional-chart.js +1 -886
- package/dist/components/divisional-chart.js.map +4 -4
- package/dist/components/dosha-card.d.ts +1 -0
- package/dist/components/dosha-card.d.ts.map +1 -1
- package/dist/components/dosha-card.js +1 -293
- package/dist/components/dosha-card.js.map +4 -4
- package/dist/components/endpoint-form.js +1 -505
- package/dist/components/endpoint-form.js.map +3 -3
- package/dist/components/guna-milan.d.ts +1 -0
- package/dist/components/guna-milan.d.ts.map +1 -1
- package/dist/components/guna-milan.js +1 -374
- package/dist/components/guna-milan.js.map +4 -4
- package/dist/components/hexagram.d.ts +1 -0
- package/dist/components/hexagram.d.ts.map +1 -1
- package/dist/components/hexagram.js +1 -380
- package/dist/components/hexagram.js.map +4 -4
- package/dist/components/horoscope-card.d.ts +1 -0
- package/dist/components/horoscope-card.d.ts.map +1 -1
- package/dist/components/horoscope-card.js +1 -381
- package/dist/components/horoscope-card.js.map +4 -4
- package/dist/components/kp-chart.d.ts +1 -0
- package/dist/components/kp-chart.d.ts.map +1 -1
- package/dist/components/kp-chart.js +1 -395
- package/dist/components/kp-chart.js.map +4 -4
- package/dist/components/kp-planets-table.d.ts +1 -0
- package/dist/components/kp-planets-table.d.ts.map +1 -1
- package/dist/components/kp-planets-table.js +1 -246
- package/dist/components/kp-planets-table.js.map +4 -4
- package/dist/components/kp-ruling-planets.d.ts +1 -0
- package/dist/components/kp-ruling-planets.d.ts.map +1 -1
- package/dist/components/kp-ruling-planets.js +1 -288
- package/dist/components/kp-ruling-planets.js.map +4 -4
- package/dist/components/location-search.js +1 -461
- package/dist/components/location-search.js.map +3 -3
- package/dist/components/moon-phase.d.ts +1 -0
- package/dist/components/moon-phase.d.ts.map +1 -1
- package/dist/components/moon-phase.js +1 -327
- package/dist/components/moon-phase.js.map +4 -4
- package/dist/components/nakshatra-card.d.ts +1 -0
- package/dist/components/nakshatra-card.d.ts.map +1 -1
- package/dist/components/nakshatra-card.js +1 -244
- package/dist/components/nakshatra-card.js.map +4 -4
- package/dist/components/natal-chart.d.ts +1 -1
- package/dist/components/natal-chart.d.ts.map +1 -1
- package/dist/components/natal-chart.js +1 -1040
- package/dist/components/natal-chart.js.map +4 -4
- package/dist/components/numerology-card.d.ts +1 -0
- package/dist/components/numerology-card.d.ts.map +1 -1
- package/dist/components/numerology-card.js +1 -315
- package/dist/components/numerology-card.js.map +4 -4
- package/dist/components/panchang-table.d.ts +1 -0
- package/dist/components/panchang-table.d.ts.map +1 -1
- package/dist/components/panchang-table.js +1 -350
- package/dist/components/panchang-table.js.map +4 -4
- package/dist/components/shadbala-table.d.ts +1 -0
- package/dist/components/shadbala-table.d.ts.map +1 -1
- package/dist/components/shadbala-table.js +1 -413
- package/dist/components/shadbala-table.js.map +4 -4
- package/dist/components/synastry-chart.d.ts +1 -0
- package/dist/components/synastry-chart.d.ts.map +1 -1
- package/dist/components/synastry-chart.js +1 -658
- package/dist/components/synastry-chart.js.map +4 -4
- package/dist/components/tarot-card.d.ts +1 -0
- package/dist/components/tarot-card.d.ts.map +1 -1
- package/dist/components/tarot-card.js +1 -333
- package/dist/components/tarot-card.js.map +4 -4
- package/dist/components/tarot-spread.d.ts +1 -0
- package/dist/components/tarot-spread.d.ts.map +1 -1
- package/dist/components/tarot-spread.js +1 -310
- package/dist/components/tarot-spread.js.map +4 -4
- package/dist/components/transits-table.d.ts +3 -0
- package/dist/components/transits-table.d.ts.map +1 -1
- package/dist/components/transits-table.js +1 -548
- package/dist/components/transits-table.js.map +4 -4
- package/dist/components/vedic-kundli.d.ts +1 -0
- package/dist/components/vedic-kundli.d.ts.map +1 -1
- package/dist/components/vedic-kundli.js +1 -802
- package/dist/components/vedic-kundli.js.map +4 -4
- package/dist/components/vedic-planets-table.d.ts +1 -0
- package/dist/components/vedic-planets-table.d.ts.map +1 -1
- package/dist/components/vedic-planets-table.js +1 -368
- package/dist/components/vedic-planets-table.js.map +4 -4
- package/dist/components/western-planets-table.d.ts +1 -0
- package/dist/components/western-planets-table.d.ts.map +1 -1
- package/dist/components/western-planets-table.js +1 -363
- package/dist/components/western-planets-table.js.map +4 -4
- package/dist/components/yoga-list.d.ts +1 -0
- package/dist/components/yoga-list.d.ts.map +1 -1
- package/dist/components/yoga-list.js +1 -383
- package/dist/components/yoga-list.js.map +4 -4
- package/dist/index.cjs +1 -8653
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +1 -8633
- package/dist/index.js.map +4 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.gen.d.ts +590 -202
- package/dist/types/types.gen.d.ts.map +1 -1
- package/dist/utils/disclosure.d.ts +16 -0
- package/dist/utils/disclosure.d.ts.map +1 -0
- package/dist/utils/kundli-render.d.ts.map +1 -1
- package/dist/utils/kundli-styles.d.ts.map +1 -1
- package/dist/utils/markup-data.d.ts +57 -0
- package/dist/utils/markup-data.d.ts.map +1 -0
- package/dist/utils/tablist.d.ts +44 -0
- package/dist/utils/tablist.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -1
- package/src/components/ashtakavarga-grid.ts +9 -0
- package/src/components/biorhythm-chart.ts +9 -0
- package/src/components/choghadiya-grid.ts +9 -0
- package/src/components/compatibility-card.ts +9 -0
- package/src/components/dasha-timeline.ts +19 -1
- package/src/components/data.ts +9 -0
- package/src/components/divisional-chart.ts +11 -0
- package/src/components/dosha-card.ts +9 -0
- package/src/components/guna-milan.ts +9 -0
- package/src/components/hexagram.ts +9 -0
- package/src/components/horoscope-card.ts +9 -0
- package/src/components/kp-chart.ts +9 -0
- package/src/components/kp-planets-table.ts +9 -0
- package/src/components/kp-ruling-planets.ts +9 -0
- package/src/components/moon-phase.ts +9 -0
- package/src/components/nakshatra-card.ts +9 -0
- package/src/components/natal-chart.ts +46 -62
- package/src/components/numerology-card.ts +9 -0
- package/src/components/panchang-table.ts +9 -0
- package/src/components/shadbala-table.ts +9 -0
- package/src/components/synastry-chart.ts +9 -0
- package/src/components/tarot-card.ts +9 -0
- package/src/components/tarot-spread.ts +9 -0
- package/src/components/transits-table.ts +54 -18
- package/src/components/vedic-kundli.ts +11 -1
- package/src/components/vedic-planets-table.ts +9 -0
- package/src/components/western-planets-table.ts +9 -0
- package/src/components/yoga-list.ts +9 -0
- package/src/types/index.ts +1 -1
- package/src/types/types.gen.ts +602 -200
- package/src/utils/disclosure.ts +62 -0
- package/src/utils/kundli-render.ts +21 -35
- package/src/utils/kundli-styles.ts +0 -31
- package/src/utils/markup-data.ts +115 -0
- package/src/utils/tablist.ts +124 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the
|
|
4
|
+
* browser default triangle with a thin chevron that rotates when the host
|
|
5
|
+
* `<details>` opens. Render it inside the `<summary>` and pair with
|
|
6
|
+
* {@link disclosureStyles}.
|
|
7
|
+
*/
|
|
8
|
+
export declare function chevron(): TemplateResult;
|
|
9
|
+
/**
|
|
10
|
+
* Shared `<details>` accordion styling: hides the native disclosure triangle
|
|
11
|
+
* and rotates the {@link chevron} 180 degrees when the accordion is open.
|
|
12
|
+
* Import into any component that renders disclosure accordions so the chevron
|
|
13
|
+
* looks and behaves identically.
|
|
14
|
+
*/
|
|
15
|
+
export declare const disclosureStyles: import("lit").CSSResult;
|
|
16
|
+
//# sourceMappingURL=disclosure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../../src/utils/disclosure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C;;;;;GAKG;AACH,wBAAgB,OAAO,IAAI,cAAc,CAiBxC;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,yBA2B5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kundli-render.d.ts","sourceRoot":"","sources":["../../src/utils/kundli-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"kundli-render.d.ts","sourceRoot":"","sources":["../../src/utils/kundli-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAgC1C;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAsGpD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,MAAM,CACX,MAAM,EACN;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CACD,EACD,aAAa,CAAC,EAAE,MAAM,GACpB,eAAe,CAoBjB;AA8dD;;;;GAIG;AACH,wBAAgB,eAAe,CAC9B,EAAE,EAAE,eAAe,EACnB,KAAK,EAAE,UAAU,GACf,cAAc,CAShB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GAClC,cAAc,CAQhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kundli-styles.d.ts","sourceRoot":"","sources":["../../src/utils/kundli-styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"kundli-styles.d.ts","sourceRoot":"","sources":["../../src/utils/kundli-styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,yBA+ExB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.
|
|
4
|
+
*/
|
|
5
|
+
interface DataHost extends ReactiveControllerHost, HTMLElement {
|
|
6
|
+
data?: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type="application/json" class="roxy-data">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.
|
|
13
|
+
*
|
|
14
|
+
* Source resolution order on connect, first hit wins:
|
|
15
|
+
*
|
|
16
|
+
* 1. `host.data` already set in JavaScript -> leave it, read nothing.
|
|
17
|
+
* 2. A direct-child `<script type="application/json" class="roxy-data">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.
|
|
18
|
+
*
|
|
19
|
+
* Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.
|
|
20
|
+
*
|
|
21
|
+
* Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.
|
|
22
|
+
*
|
|
23
|
+
* Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.
|
|
24
|
+
*
|
|
25
|
+
* Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { MarkupDataController } from '../utils/markup-data.js';
|
|
30
|
+
*
|
|
31
|
+
* export class RoxyExample extends LitElement {
|
|
32
|
+
* constructor() {
|
|
33
|
+
* super();
|
|
34
|
+
* new MarkupDataController(this);
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* @property({ attribute: false })
|
|
38
|
+
* data: ExampleResponse | null = null;
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare class MarkupDataController<T = unknown> implements ReactiveController {
|
|
43
|
+
private readonly host;
|
|
44
|
+
constructor(host: DataHost);
|
|
45
|
+
hostConnected(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.
|
|
48
|
+
*/
|
|
49
|
+
private read;
|
|
50
|
+
/**
|
|
51
|
+
* Direct-child `<script type="application/json" class="roxy-data">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.
|
|
52
|
+
*/
|
|
53
|
+
private findInlineScript;
|
|
54
|
+
private parse;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=markup-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markup-data.d.ts","sourceRoot":"","sources":["../../src/utils/markup-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAuBtE;;GAEG;AACH,UAAU,QAAS,SAAQ,sBAAsB,EAAE,WAAW;IAC7D,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,oBAAoB,CAAC,CAAC,GAAG,OAAO,CAAE,YAAW,kBAAkB;IAC3E,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;gBAEpB,IAAI,EAAE,QAAQ;IAK1B,aAAa;IAYb;;OAEG;IACH,OAAO,CAAC,IAAI;IAKZ;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,KAAK;CAUb"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit';
|
|
2
|
+
/** A single tab in a {@link renderTablist} strip. */
|
|
3
|
+
export interface TablistItem<T extends string = string> {
|
|
4
|
+
id: T;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Shared styling for every horizontal tab strip in the library (natal chart
|
|
9
|
+
* views, transits, kundli styles). Keeping one rule set means the tabs look
|
|
10
|
+
* identical everywhere and theme through the same --roxy-* tokens.
|
|
11
|
+
*/
|
|
12
|
+
export declare const tablistStyles: import("lit").CSSResult;
|
|
13
|
+
/**
|
|
14
|
+
* Render a WAI-ARIA tablist. The host component owns the active-tab state; this
|
|
15
|
+
* helper draws the buttons, wires click plus Left/Right arrow navigation with a
|
|
16
|
+
* roving tabindex, and moves focus to the newly selected tab. Pair with
|
|
17
|
+
* {@link tablistStyles}.
|
|
18
|
+
*
|
|
19
|
+
* Pass `controls: true` when each tab governs a sibling
|
|
20
|
+
* `<div role="tabpanel" id="${idPrefix}-panel-${id}">` so the buttons advertise
|
|
21
|
+
* `aria-controls`. Omit it for tablists that swap a single rendered view in
|
|
22
|
+
* place with no separate panel element (the kundli style switch).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* renderTablist({
|
|
27
|
+
* items: [{ id: 'wheel', label: 'Wheel' }, { id: 'grid', label: 'Aspect grid' }],
|
|
28
|
+
* active: this.view,
|
|
29
|
+
* onSelect: (v) => { this.view = v; },
|
|
30
|
+
* label: 'Natal chart views',
|
|
31
|
+
* idPrefix: 'natal',
|
|
32
|
+
* controls: true,
|
|
33
|
+
* })
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function renderTablist<T extends string>(opts: {
|
|
37
|
+
items: ReadonlyArray<TablistItem<T>>;
|
|
38
|
+
active: T;
|
|
39
|
+
onSelect: (id: T) => void;
|
|
40
|
+
label: string;
|
|
41
|
+
idPrefix: string;
|
|
42
|
+
controls?: boolean;
|
|
43
|
+
}): TemplateResult;
|
|
44
|
+
//# sourceMappingURL=tablist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tablist.d.ts","sourceRoot":"","sources":["../../src/utils/tablist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C,qDAAqD;AACrD,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACrD,EAAE,EAAE,CAAC,CAAC;IACN,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,yBAgCzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE;IACrD,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,cAAc,CA6CjB"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ROXY_UI_VERSION = "0.
|
|
1
|
+
export declare const ROXY_UI_VERSION = "0.6.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roxyapi/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
+
"jsdelivr": "./dist/cdn/roxy-ui.js",
|
|
10
|
+
"unpkg": "./dist/cdn/roxy-ui.js",
|
|
9
11
|
"exports": {
|
|
10
12
|
".": {
|
|
11
13
|
"types": "./dist/index.d.ts",
|
|
@@ -3,6 +3,7 @@ import { customElement, property, state } from 'lit/decorators.js';
|
|
|
3
3
|
import { SIGN_GLYPH } from '../tokens/index.js';
|
|
4
4
|
import type { AshtakavargaResponse } from '../types/index.js';
|
|
5
5
|
import { baseStyles } from '../utils/base-styles.js';
|
|
6
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
6
7
|
|
|
7
8
|
type Tab = 'sarva' | 'bhinna' | 'pinda';
|
|
8
9
|
|
|
@@ -194,6 +195,14 @@ export class RoxyAshtakavargaGrid extends LitElement {
|
|
|
194
195
|
`,
|
|
195
196
|
];
|
|
196
197
|
|
|
198
|
+
constructor() {
|
|
199
|
+
super();
|
|
200
|
+
// Enables hydrating `data` from a direct-child
|
|
201
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
202
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
203
|
+
new MarkupDataController(this);
|
|
204
|
+
}
|
|
205
|
+
|
|
197
206
|
@property({ attribute: false })
|
|
198
207
|
data: AshtakavargaResponse | null = null;
|
|
199
208
|
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
GetForecastResponse,
|
|
7
7
|
} from '../types/index.js';
|
|
8
8
|
import { baseStyles } from '../utils/base-styles.js';
|
|
9
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
9
10
|
|
|
10
11
|
type BiorhythmData =
|
|
11
12
|
| GetDailyBiorhythmResponse
|
|
@@ -111,6 +112,14 @@ export class RoxyBiorhythmChart extends LitElement {
|
|
|
111
112
|
`,
|
|
112
113
|
];
|
|
113
114
|
|
|
115
|
+
constructor() {
|
|
116
|
+
super();
|
|
117
|
+
// Enables hydrating `data` from a direct-child
|
|
118
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
119
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
120
|
+
new MarkupDataController(this);
|
|
121
|
+
}
|
|
122
|
+
|
|
114
123
|
@property({ attribute: false })
|
|
115
124
|
data: BiorhythmData | null = null;
|
|
116
125
|
|
|
@@ -3,6 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
3
3
|
import { PLANET_GLYPH } from '../tokens/index.js';
|
|
4
4
|
import type { GetChoghadiyaResponse } from '../types/index.js';
|
|
5
5
|
import { baseStyles } from '../utils/base-styles.js';
|
|
6
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
6
7
|
import { capitalize } from '../utils/string.js';
|
|
7
8
|
|
|
8
9
|
type ChoghadiyaPeriod = GetChoghadiyaResponse['dayChoghadiya'][number];
|
|
@@ -132,6 +133,14 @@ export class RoxyChoghadiyaGrid extends LitElement {
|
|
|
132
133
|
`,
|
|
133
134
|
];
|
|
134
135
|
|
|
136
|
+
constructor() {
|
|
137
|
+
super();
|
|
138
|
+
// Enables hydrating `data` from a direct-child
|
|
139
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
140
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
141
|
+
new MarkupDataController(this);
|
|
142
|
+
}
|
|
143
|
+
|
|
135
144
|
@property({ attribute: false })
|
|
136
145
|
data: GetChoghadiyaResponse | null = null;
|
|
137
146
|
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
} from '../types/index.js';
|
|
8
8
|
import { baseStyles } from '../utils/base-styles.js';
|
|
9
9
|
import { formatNumber } from '../utils/format.js';
|
|
10
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
10
11
|
|
|
11
12
|
type CompatibilityData =
|
|
12
13
|
| CalculateCompatibilityResponse
|
|
@@ -108,6 +109,14 @@ export class RoxyCompatibilityCard extends LitElement {
|
|
|
108
109
|
`,
|
|
109
110
|
];
|
|
110
111
|
|
|
112
|
+
constructor() {
|
|
113
|
+
super();
|
|
114
|
+
// Enables hydrating `data` from a direct-child
|
|
115
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
116
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
117
|
+
new MarkupDataController(this);
|
|
118
|
+
}
|
|
119
|
+
|
|
111
120
|
@property({ attribute: false })
|
|
112
121
|
data: CompatibilityData | null = null;
|
|
113
122
|
|
|
@@ -6,7 +6,9 @@ import type {
|
|
|
6
6
|
GetSubDashasResponse,
|
|
7
7
|
} from '../types/index.js';
|
|
8
8
|
import { baseStyles } from '../utils/base-styles.js';
|
|
9
|
+
import { chevron, disclosureStyles } from '../utils/disclosure.js';
|
|
9
10
|
import { formatNumber } from '../utils/format.js';
|
|
11
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
10
12
|
|
|
11
13
|
type DashaData =
|
|
12
14
|
| GetCurrentDashaResponse
|
|
@@ -24,6 +26,7 @@ type DashaPeriod = GetMajorDashasResponse['mahadashas'][number];
|
|
|
24
26
|
export class RoxyDashaTimeline extends LitElement {
|
|
25
27
|
static styles = [
|
|
26
28
|
baseStyles,
|
|
29
|
+
disclosureStyles,
|
|
27
30
|
css`
|
|
28
31
|
.wrap {
|
|
29
32
|
display: grid;
|
|
@@ -143,6 +146,10 @@ export class RoxyDashaTimeline extends LitElement {
|
|
|
143
146
|
cursor: pointer;
|
|
144
147
|
font-size: var(--roxy-text-sm, 0.875rem);
|
|
145
148
|
font-weight: var(--roxy-weight-bold, 600);
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: space-between;
|
|
152
|
+
gap: var(--roxy-space-md, 1rem);
|
|
146
153
|
}
|
|
147
154
|
details.interp p {
|
|
148
155
|
margin: var(--roxy-space-sm, 0.5rem) 0 0;
|
|
@@ -152,6 +159,14 @@ export class RoxyDashaTimeline extends LitElement {
|
|
|
152
159
|
`,
|
|
153
160
|
];
|
|
154
161
|
|
|
162
|
+
constructor() {
|
|
163
|
+
super();
|
|
164
|
+
// Enables hydrating `data` from a direct-child
|
|
165
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
166
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
167
|
+
new MarkupDataController(this);
|
|
168
|
+
}
|
|
169
|
+
|
|
155
170
|
@property({ attribute: false })
|
|
156
171
|
data: DashaData | null = null;
|
|
157
172
|
|
|
@@ -224,7 +239,10 @@ export class RoxyDashaTimeline extends LitElement {
|
|
|
224
239
|
const active = periods.find((p) => this.isCurrent(p));
|
|
225
240
|
if (!active?.interpretation) return nothing;
|
|
226
241
|
return html`<details class="interp">
|
|
227
|
-
<summary
|
|
242
|
+
<summary>
|
|
243
|
+
<span>${active.planet} mahadasha interpretation</span>
|
|
244
|
+
${chevron()}
|
|
245
|
+
</summary>
|
|
228
246
|
<p>${active.interpretation}</p>
|
|
229
247
|
</details>`;
|
|
230
248
|
}
|
package/src/components/data.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css, html, LitElement, nothing, type TemplateResult } from 'lit';
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import { baseStyles } from '../utils/base-styles.js';
|
|
4
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
4
5
|
import { humanize } from '../utils/string.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -134,6 +135,14 @@ export class RoxyData extends LitElement {
|
|
|
134
135
|
`,
|
|
135
136
|
];
|
|
136
137
|
|
|
138
|
+
constructor() {
|
|
139
|
+
super();
|
|
140
|
+
// Enables hydrating `data` from a direct-child
|
|
141
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
142
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
143
|
+
new MarkupDataController(this);
|
|
144
|
+
}
|
|
145
|
+
|
|
137
146
|
@property({ attribute: false })
|
|
138
147
|
data: Json = null;
|
|
139
148
|
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
toKundliViewModel,
|
|
12
12
|
} from '../utils/kundli-render.js';
|
|
13
13
|
import { kundliStyles } from '../utils/kundli-styles.js';
|
|
14
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
15
|
+
import { tablistStyles } from '../utils/tablist.js';
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Divisional chart renderer (D2-D60). Accepts a DivisionalChartResponse and
|
|
@@ -25,6 +27,7 @@ export class RoxyDivisionalChart extends LitElement {
|
|
|
25
27
|
static styles = [
|
|
26
28
|
baseStyles,
|
|
27
29
|
kundliStyles,
|
|
30
|
+
tablistStyles,
|
|
28
31
|
css`
|
|
29
32
|
.division-meta {
|
|
30
33
|
font-size: var(--roxy-text-sm, 0.875rem);
|
|
@@ -65,6 +68,14 @@ export class RoxyDivisionalChart extends LitElement {
|
|
|
65
68
|
`,
|
|
66
69
|
];
|
|
67
70
|
|
|
71
|
+
constructor() {
|
|
72
|
+
super();
|
|
73
|
+
// Enables hydrating `data` from a direct-child
|
|
74
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
75
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
76
|
+
new MarkupDataController(this);
|
|
77
|
+
}
|
|
78
|
+
|
|
68
79
|
@property({ attribute: false })
|
|
69
80
|
data: DivisionalChartResponse | null = null;
|
|
70
81
|
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
SadhesatiResponse,
|
|
7
7
|
} from '../types/index.js';
|
|
8
8
|
import { baseStyles } from '../utils/base-styles.js';
|
|
9
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
9
10
|
|
|
10
11
|
type DoshaData = ManglikResponse | KalsarpaResponse | SadhesatiResponse;
|
|
11
12
|
|
|
@@ -114,6 +115,14 @@ export class RoxyDoshaCard extends LitElement {
|
|
|
114
115
|
`,
|
|
115
116
|
];
|
|
116
117
|
|
|
118
|
+
constructor() {
|
|
119
|
+
super();
|
|
120
|
+
// Enables hydrating `data` from a direct-child
|
|
121
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
122
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
123
|
+
new MarkupDataController(this);
|
|
124
|
+
}
|
|
125
|
+
|
|
117
126
|
@property({ attribute: false })
|
|
118
127
|
data: DoshaData | null = null;
|
|
119
128
|
|
|
@@ -3,6 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
3
3
|
import type { CompatibilityResponse } from '../types/index.js';
|
|
4
4
|
import { baseStyles } from '../utils/base-styles.js';
|
|
5
5
|
import { formatNumber, formatPercent } from '../utils/format.js';
|
|
6
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
6
7
|
|
|
7
8
|
const STANDARD_CATEGORIES = [
|
|
8
9
|
'Varna',
|
|
@@ -146,6 +147,14 @@ export class RoxyGunaMilan extends LitElement {
|
|
|
146
147
|
`,
|
|
147
148
|
];
|
|
148
149
|
|
|
150
|
+
constructor() {
|
|
151
|
+
super();
|
|
152
|
+
// Enables hydrating `data` from a direct-child
|
|
153
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
154
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
155
|
+
new MarkupDataController(this);
|
|
156
|
+
}
|
|
157
|
+
|
|
149
158
|
@property({ attribute: false })
|
|
150
159
|
data: CompatibilityResponse | null = null;
|
|
151
160
|
|
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
LookupHexagramResponse,
|
|
11
11
|
} from '../types/index.js';
|
|
12
12
|
import { baseStyles } from '../utils/base-styles.js';
|
|
13
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
13
14
|
|
|
14
15
|
type HexagramData =
|
|
15
16
|
| GetHexagramResponse
|
|
@@ -136,6 +137,14 @@ export class RoxyHexagram extends LitElement {
|
|
|
136
137
|
`,
|
|
137
138
|
];
|
|
138
139
|
|
|
140
|
+
constructor() {
|
|
141
|
+
super();
|
|
142
|
+
// Enables hydrating `data` from a direct-child
|
|
143
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
144
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
145
|
+
new MarkupDataController(this);
|
|
146
|
+
}
|
|
147
|
+
|
|
139
148
|
@property({ attribute: false })
|
|
140
149
|
data: HexagramData | null = null;
|
|
141
150
|
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
GetWeeklyHoroscopeResponse,
|
|
8
8
|
} from '../types/index.js';
|
|
9
9
|
import { baseStyles } from '../utils/base-styles.js';
|
|
10
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
10
11
|
import { capitalize } from '../utils/string.js';
|
|
11
12
|
|
|
12
13
|
type HoroscopeData =
|
|
@@ -147,6 +148,14 @@ export class RoxyHoroscopeCard extends LitElement {
|
|
|
147
148
|
`,
|
|
148
149
|
];
|
|
149
150
|
|
|
151
|
+
constructor() {
|
|
152
|
+
super();
|
|
153
|
+
// Enables hydrating `data` from a direct-child
|
|
154
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
155
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
156
|
+
new MarkupDataController(this);
|
|
157
|
+
}
|
|
158
|
+
|
|
150
159
|
@property({ attribute: false })
|
|
151
160
|
data: HoroscopeData | null = null;
|
|
152
161
|
|
|
@@ -3,6 +3,7 @@ import { customElement, property, state } from 'lit/decorators.js';
|
|
|
3
3
|
import type { KpChartResponse } from '../types/index.js';
|
|
4
4
|
import { baseStyles } from '../utils/base-styles.js';
|
|
5
5
|
import { formatNumber } from '../utils/format.js';
|
|
6
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
6
7
|
|
|
7
8
|
type Tab = 'planets' | 'cusps';
|
|
8
9
|
|
|
@@ -123,6 +124,14 @@ export class RoxyKpChart extends LitElement {
|
|
|
123
124
|
`,
|
|
124
125
|
];
|
|
125
126
|
|
|
127
|
+
constructor() {
|
|
128
|
+
super();
|
|
129
|
+
// Enables hydrating `data` from a direct-child
|
|
130
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
131
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
132
|
+
new MarkupDataController(this);
|
|
133
|
+
}
|
|
134
|
+
|
|
126
135
|
@property({ attribute: false })
|
|
127
136
|
data: KpChartResponse | null = null;
|
|
128
137
|
|
|
@@ -3,6 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
3
3
|
import type { KpPlanetsResponse } from '../types/index.js';
|
|
4
4
|
import { baseStyles } from '../utils/base-styles.js';
|
|
5
5
|
import { formatNumber } from '../utils/format.js';
|
|
6
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* KP planets table with sub-lord and sub-sub-lord columns. Renders
|
|
@@ -74,6 +75,14 @@ export class RoxyKpPlanetsTable extends LitElement {
|
|
|
74
75
|
`,
|
|
75
76
|
];
|
|
76
77
|
|
|
78
|
+
constructor() {
|
|
79
|
+
super();
|
|
80
|
+
// Enables hydrating `data` from a direct-child
|
|
81
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
82
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
83
|
+
new MarkupDataController(this);
|
|
84
|
+
}
|
|
85
|
+
|
|
77
86
|
@property({ attribute: false })
|
|
78
87
|
data: KpPlanetsResponse | null = null;
|
|
79
88
|
|
|
@@ -2,6 +2,7 @@ import { css, html, LitElement, nothing } from 'lit';
|
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import type { KpRulingPlanetsResponse } from '../types/index.js';
|
|
4
4
|
import { baseStyles } from '../utils/base-styles.js';
|
|
5
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* KP ruling planets card. Renders /vedic-astrology/kp/ruling-planets: the day
|
|
@@ -113,6 +114,14 @@ export class RoxyKpRulingPlanets extends LitElement {
|
|
|
113
114
|
`,
|
|
114
115
|
];
|
|
115
116
|
|
|
117
|
+
constructor() {
|
|
118
|
+
super();
|
|
119
|
+
// Enables hydrating `data` from a direct-child
|
|
120
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
121
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
122
|
+
new MarkupDataController(this);
|
|
123
|
+
}
|
|
124
|
+
|
|
116
125
|
@property({ attribute: false })
|
|
117
126
|
data: KpRulingPlanetsResponse | null = null;
|
|
118
127
|
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
} from '../types/index.js';
|
|
9
9
|
import { baseStyles } from '../utils/base-styles.js';
|
|
10
10
|
import { formatNumber } from '../utils/format.js';
|
|
11
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
11
12
|
|
|
12
13
|
type MoonPhaseData =
|
|
13
14
|
| GetCurrentMoonPhaseResponse
|
|
@@ -109,6 +110,14 @@ export class RoxyMoonPhase extends LitElement {
|
|
|
109
110
|
`,
|
|
110
111
|
];
|
|
111
112
|
|
|
113
|
+
constructor() {
|
|
114
|
+
super();
|
|
115
|
+
// Enables hydrating `data` from a direct-child
|
|
116
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
117
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
118
|
+
new MarkupDataController(this);
|
|
119
|
+
}
|
|
120
|
+
|
|
112
121
|
@property({ attribute: false })
|
|
113
122
|
data: MoonPhaseData | null = null;
|
|
114
123
|
|
|
@@ -2,6 +2,7 @@ import { css, html, LitElement, nothing } from 'lit';
|
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import type { NakshatraResponse } from '../types/index.js';
|
|
4
4
|
import { baseStyles } from '../utils/base-styles.js';
|
|
5
|
+
import { MarkupDataController } from '../utils/markup-data.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Nakshatra reference card. Renders /vedic-astrology/nakshatras/{id}: the
|
|
@@ -91,6 +92,14 @@ export class RoxyNakshatraCard extends LitElement {
|
|
|
91
92
|
`,
|
|
92
93
|
];
|
|
93
94
|
|
|
95
|
+
constructor() {
|
|
96
|
+
super();
|
|
97
|
+
// Enables hydrating `data` from a direct-child
|
|
98
|
+
// <script type="application/json" class="roxy-data"> for server-rendered
|
|
99
|
+
// and cached consumers. The JavaScript `data` property still wins.
|
|
100
|
+
new MarkupDataController(this);
|
|
101
|
+
}
|
|
102
|
+
|
|
94
103
|
@property({ attribute: false })
|
|
95
104
|
data: NakshatraResponse | null = null;
|
|
96
105
|
|