@roxyapi/ui-react 0.12.3 → 0.14.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 +43 -8
- package/README.md +38 -7
- package/dist/components/angel-number-card.js.map +1 -1
- package/dist/components/angel-number-lookup.js.map +1 -1
- package/dist/components/ashtakavarga-grid.js.map +1 -1
- package/dist/components/aspects-table.js.map +1 -1
- package/dist/components/astrocartography-map.js.map +1 -1
- package/dist/components/biorhythm-chart.js.map +1 -1
- package/dist/components/bodygraph.d.ts +14 -1
- package/dist/components/bodygraph.d.ts.map +1 -1
- package/dist/components/bodygraph.js +1 -1
- package/dist/components/bodygraph.js.map +3 -3
- package/dist/components/choghadiya-grid.js.map +1 -1
- package/dist/components/compatibility-card.js.map +1 -1
- package/dist/components/crystal-card.js.map +1 -1
- package/dist/components/crystal-grid.js.map +1 -1
- package/dist/components/dasha-timeline.js.map +1 -1
- package/dist/components/data.js.map +1 -1
- package/dist/components/divisional-chart.js.map +1 -1
- package/dist/components/dosha-card.js.map +1 -1
- package/dist/components/dream-card.js.map +1 -1
- package/dist/components/dream-search.js.map +1 -1
- package/dist/components/endpoint-form.js.map +1 -1
- package/dist/components/fixed-stars.js.map +1 -1
- package/dist/components/forecast-digest.js.map +1 -1
- package/dist/components/forecast-timeline.js.map +1 -1
- package/dist/components/guna-milan.js.map +1 -1
- package/dist/components/hd-connection.js.map +1 -1
- package/dist/components/hd-penta.js.map +1 -1
- package/dist/components/hd-type-card.d.ts +22 -0
- package/dist/components/hd-type-card.d.ts.map +1 -0
- package/dist/components/hd-type-card.js +2 -0
- package/dist/components/hd-type-card.js.map +7 -0
- package/dist/components/hd-variables.js.map +1 -1
- package/dist/components/hexagram.js.map +1 -1
- package/dist/components/hora-table.js.map +1 -1
- package/dist/components/horoscope-card.js.map +1 -1
- package/dist/components/kp-chart.js.map +1 -1
- package/dist/components/kp-planets-table.js.map +1 -1
- package/dist/components/kp-ruling-planets.js.map +1 -1
- package/dist/components/local-space-compass.js.map +1 -1
- package/dist/components/location-search.js.map +1 -1
- package/dist/components/moon-phase.js.map +1 -1
- package/dist/components/nakshatra-card.js.map +1 -1
- package/dist/components/natal-chart.js.map +1 -1
- package/dist/components/numerology-card.js.map +1 -1
- package/dist/components/panchang-table.js.map +1 -1
- package/dist/components/positions-table.js.map +1 -1
- package/dist/components/profection-card.js.map +1 -1
- package/dist/components/reference-card.js.map +1 -1
- package/dist/components/relocation-wheel.js.map +1 -1
- package/dist/components/shadbala-table.js.map +1 -1
- package/dist/components/synastry-chart.js.map +1 -1
- package/dist/components/tarot-card.js.map +1 -1
- package/dist/components/tarot-catalog.js.map +1 -1
- package/dist/components/tarot-spread.js.map +1 -1
- package/dist/components/transits-table.js.map +1 -1
- package/dist/components/vedic-aspects.js.map +1 -1
- package/dist/components/vedic-kundli.js.map +1 -1
- package/dist/components/vedic-planets-table.js.map +1 -1
- package/dist/components/western-planets-table.js.map +1 -1
- package/dist/components/yoga-list.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/load-ui.d.ts +1 -1
- package/dist/load-ui.js +1 -1
- package/dist/load-ui.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This file teaches AI coding agents (Claude Code, Cursor, Copilot, Codex, Gemini CLI, and any MCP-compatible client) how to use Roxy UI when integrating RoxyAPI into a project.
|
|
4
4
|
|
|
5
|
-
This file ships inside
|
|
5
|
+
This file ships inside `@roxyapi/ui`, `@roxyapi/ui-react`, and `@roxyapi/ui-vue` on npm. After install, read it at `node_modules/@roxyapi/ui/AGENTS.md`.
|
|
6
6
|
|
|
7
7
|
Live preview: <https://roxyapi.github.io/ui/>. Source of truth for component types: the combined OpenAPI spec at `https://roxyapi.com/api/v2/openapi.json`, regenerated into `packages/ui/src/types/types.gen.ts`. Per-product specs live at `https://roxyapi.com/api/v2/{slug}/openapi.json`.
|
|
8
8
|
|
|
@@ -32,7 +32,7 @@ Map the natural-language request to a component first; fall back to the table be
|
|
|
32
32
|
| "life path number", "expression number", "personal year", "numerology chart" | `<roxy-numerology-card>` |
|
|
33
33
|
| "draw a tarot card", "card of the day", "card meaning" | `<roxy-tarot-card>` |
|
|
34
34
|
| "tarot reading", "three-card spread", "Celtic Cross", "yes or no tarot" | `<roxy-tarot-spread>` |
|
|
35
|
-
| "Human Design chart", "bodygraph", "my type and authority", "defined centers", "channels and gates" | `<roxy-bodygraph>` |
|
|
35
|
+
| "Human Design chart", "bodygraph", "my type and authority", "defined centers", "channels and gates", "what does my profile mean", "what does gate 61 line 5 mean" | `<roxy-bodygraph>` |
|
|
36
36
|
| "forecast", "what is coming up", "upcoming transits and events", "timeline of my year" | `<roxy-forecast-timeline>` |
|
|
37
37
|
| "biorhythm", "physical/emotional/intellectual cycle", "critical days" | `<roxy-biorhythm-chart>` |
|
|
38
38
|
| "I Ching", "hexagram", "cast the coins", "Book of Changes" | `<roxy-hexagram>` |
|
|
@@ -88,14 +88,15 @@ Use the table below for the formal endpoint to component mapping.
|
|
|
88
88
|
| `<roxy-tarot-card>` | Tarot | GET /tarot/cards/{id}, POST /tarot/daily | Single card with upright and reversed flip |
|
|
89
89
|
| `<roxy-tarot-catalog>` | Tarot | GET /tarot/cards | Deck gallery tiles with card art, name, and arcana and suit |
|
|
90
90
|
| `<roxy-tarot-spread>` | Tarot | POST /tarot/spreads/{three-card,celtic-cross,love}, /tarot/yes-no, /tarot/draw | Spreads with positions and reading |
|
|
91
|
-
| `<roxy-bodygraph>` | Human Design | POST /human-design/bodygraph | Nine-center chart with defined and open centers, active channels, gates,
|
|
91
|
+
| `<roxy-bodygraph>` | Human Design | POST /human-design/bodygraph | Nine-center chart with defined and open centers, active channels, and gates, plus the type, strategy, authority, profile, and definition readings, the channels by circuit, the centers, and every activation with its gate and line meaning |
|
|
92
|
+
| `<roxy-hd-type-card>` | Human Design | POST /human-design/type, /human-design/profile | Type, strategy, authority, and profile tiles with the aura, signature, and not-self themes, plus the reading behind each label and the profile line keynotes |
|
|
92
93
|
| `<roxy-hd-connection>` | Human Design | POST /human-design/connection | Electromagnetic, compromise, and dominance channels between two charts |
|
|
93
94
|
| `<roxy-hd-penta>` | Human Design | POST /human-design/penta | Group penta channels split into upper and lower triangles |
|
|
94
|
-
| `<roxy-hd-variables>` | Human Design | POST /human-design/variables | The four transformation arrows with direction and
|
|
95
|
+
| `<roxy-hd-variables>` | Human Design | POST /human-design/variables | The four transformation arrows with direction, color, tone, and base, plus a reading per arrow grouped by layer and the cognition |
|
|
95
96
|
| `<roxy-forecast-timeline>` | Forecast | POST /forecast/timeline | Date-grouped events across Western, Vedic, and biorhythm domains, weighted by significance |
|
|
96
97
|
| `<roxy-forecast-digest>` | Forecast | POST /forecast/digest | Per-window event counts, domain breakdown, and the highest-significance events |
|
|
97
98
|
| `<roxy-biorhythm-chart>` | Biorhythm | POST /biorhythm/{daily,forecast,critical-days} | Daily bars, forecast cycle lines, critical days |
|
|
98
|
-
| `<roxy-hexagram>` | I Ching | GET /iching/hexagrams/{number}, /iching/cast, POST /iching/daily, /iching/daily/cast | Hexagram with trigrams, judgment, image,
|
|
99
|
+
| `<roxy-hexagram>` | I Ching | GET /iching/hexagrams/{number}, /iching/cast, POST /iching/daily, /iching/daily/cast | Hexagram figure with trigrams, judgment, image, and a reading per line (statement plus meaning); a cast highlights the moving lines and the resulting hexagram |
|
|
99
100
|
| `<roxy-crystal-card>` | Crystals | GET /crystals/{id} | Photo, meaning sections, chakra, zodiac, element, hardness, keywords, and pairings |
|
|
100
101
|
| `<roxy-crystal-grid>` | Crystals | GET /crystals, /crystals/chakra/{chakra}, /crystals/element/{element}, /crystals/zodiac/{sign}, /crystals/birthstone/{month}, /crystals/search | Crystal gallery tiles with photo, name, and colour swatches |
|
|
101
102
|
| `<roxy-dream-card>` | Dreams | GET /dreams/symbols/{id} | Symbol name, interpretation body, and letter chip |
|
|
@@ -200,7 +201,24 @@ Several components select a view, mode, or chart layout in addition to `data`. T
|
|
|
200
201
|
<RoxyPanchangTable data={panchang} detail="detailed" />
|
|
201
202
|
```
|
|
202
203
|
|
|
203
|
-
The full set: `RoxyNatalChart` `houseSystem`, `RoxyHoroscopeCard` `period`, `RoxyMoonPhase` `mode`, `RoxyCompatibilityCard` `mode`, `RoxyVedicKundli` and `RoxyDivisionalChart` `chartStyle`, `RoxyPanchangTable` `detail`, `RoxyDashaTimeline` `period`, `RoxyDoshaCard` `type`, `RoxyNumerologyCard` `type`, `RoxyTarotSpread` `spread`, `RoxyBiorhythmChart` `mode`, `RoxyHexagram` `mode`. Outside React, set the same value as a kebab-case attribute or a JS property on the element (for example `chart-style="south"` or `el.chartStyle = 'south'`).
|
|
204
|
+
The full set: `RoxyNatalChart` `houseSystem`, `RoxyHoroscopeCard` `period`, `RoxyMoonPhase` `mode`, `RoxyCompatibilityCard` `mode`, `RoxyVedicKundli` and `RoxyDivisionalChart` `chartStyle`, `RoxyPanchangTable` `detail`, `RoxyDashaTimeline` `period`, `RoxyDoshaCard` `type`, `RoxyNumerologyCard` `type`, `RoxyTarotSpread` `spread`, `RoxyBiorhythmChart` `mode`, `RoxyHexagram` `mode`. Outside React and Vue, set the same value as a kebab-case attribute or a JS property on the element (for example `chart-style="south"` or `el.chartStyle = 'south'`).
|
|
205
|
+
|
|
206
|
+
### 6c. Vue and Nuxt
|
|
207
|
+
|
|
208
|
+
`@roxyapi/ui-vue` exposes the same components with the same prop names. Bind `data` and the config props normally; the package sets them as DOM properties for you, so an object payload never gets stringified into an attribute. Listen to widget events with the usual `@` syntax.
|
|
209
|
+
|
|
210
|
+
```vue
|
|
211
|
+
<script setup lang="ts">
|
|
212
|
+
import { RoxyVedicKundli, RoxyLocationSearch } from '@roxyapi/ui-vue';
|
|
213
|
+
</script>
|
|
214
|
+
|
|
215
|
+
<template>
|
|
216
|
+
<RoxyVedicKundli :data="chart" chart-style="south" />
|
|
217
|
+
<RoxyLocationSearch @roxy-location-select="onCity" />
|
|
218
|
+
</template>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
In Nuxt, render these in a client context (`<ClientOnly>` or a `.client.vue` component): they mount Custom Elements and need the DOM, the same constraint as `'use client'` in the Next.js App Router.
|
|
204
222
|
|
|
205
223
|
### 7. Local response interface drift
|
|
206
224
|
|
|
@@ -391,6 +409,23 @@ Rules for this pattern:
|
|
|
391
409
|
|
|
392
410
|
This is how the WordPress plugin renders: PHP fetches the response server-side, caches it, and writes the script into the page. The same shape works in any framework that emits HTML.
|
|
393
411
|
|
|
412
|
+
## Localized responses
|
|
413
|
+
|
|
414
|
+
Most RoxyAPI endpoints return their interpretation text in eight languages, selected with the `lang` query parameter (`en`, `tr`, `de`, `es`, `hi`, `pt`, `fr`, `ru`). Human Design, for example, returns the type, strategy, authority, profile, channel, center, gate, and line readings in the requested language.
|
|
415
|
+
|
|
416
|
+
The components hold no copy of their own; they print the prose the response carries. So the language of the response is the language of the render, and there is no locale prop to set.
|
|
417
|
+
|
|
418
|
+
```ts
|
|
419
|
+
const { data } = await roxy.humanDesign.generateBodygraph({
|
|
420
|
+
body: { date: '1990-01-15', time: '14:30:00', timezone: 5.5 },
|
|
421
|
+
query: { lang: 'de' },
|
|
422
|
+
});
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
`lang` is a query parameter even on a POST endpoint. Put it in `query`, never in `body`; a `lang` key in the body is ignored and you get English back. In the self-fetch pattern the component reads the parameter from the spec and sends it correctly, so the generated form simply offers the language as a field.
|
|
426
|
+
|
|
427
|
+
The structural labels the components draw (section headings such as Reading or Centers, and column headers) are English.
|
|
428
|
+
|
|
394
429
|
## Theming and dark mode
|
|
395
430
|
|
|
396
431
|
Components react to three signals in priority order. No events to dispatch. No JS bridge to write. The CDN bundle (`dist/cdn/roxy-ui.js`) auto-loads the design tokens, so a single script tag yields full theming and dark mode with nothing else to add. The npm and React paths inherit the same tokens through the components; only set up `tokens.css` yourself if you import per component without the full bundle.
|
|
@@ -433,8 +468,8 @@ When listing domains in user-visible copy, use the canonical order: Western astr
|
|
|
433
468
|
|
|
434
469
|
## What not to ship
|
|
435
470
|
|
|
436
|
-
- Do not bundle `@roxyapi/ui`
|
|
437
|
-
- Use `@roxyapi/ui-react` for React projects. Use `@roxyapi/ui` directly elsewhere.
|
|
471
|
+
- Do not bundle `@roxyapi/ui` with `@roxyapi/ui-react` or `@roxyapi/ui-vue`; they ship independently.
|
|
472
|
+
- Use `@roxyapi/ui-react` for React projects and `@roxyapi/ui-vue` for Vue and Nuxt projects. Use `@roxyapi/ui` directly elsewhere.
|
|
438
473
|
- Do not write your own kundli component. The lifted layout in `<roxy-vedic-kundli>` is the canonical RoxyAPI render path.
|
|
439
474
|
- Do not call astrology endpoints with hardcoded coordinates. Always geocode first via `<roxy-location-search>` or `roxy.location.searchCities()`.
|
|
440
475
|
- Do not declare a local `interface XyzData` to describe a RoxyAPI response. Import the type from the spec-derived bundle: `import type { XyzResponse } from '@roxyapi/sdk'`. Local interfaces drift the moment the spec changes.
|
package/README.md
CHANGED
|
@@ -196,7 +196,7 @@ Every chart, table, and card adapts to light and dark automatically. Hover any i
|
|
|
196
196
|
<td width="50%"><strong>I Ching hexagram</strong> · <code><roxy-hexagram></code><br><sub>GET /iching/hexagrams/{number}, /iching/cast</sub><br>
|
|
197
197
|
<picture>
|
|
198
198
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/hexagram-dark.png">
|
|
199
|
-
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/hexagram-light.png" alt="Hexagram with trigrams, judgment, image,
|
|
199
|
+
<img src="https://raw.githubusercontent.com/RoxyAPI/ui/main/assets/screenshots/hexagram-light.png" alt="Hexagram figure with trigrams, judgment, image, and a reading for every line">
|
|
200
200
|
</picture>
|
|
201
201
|
</td>
|
|
202
202
|
<td width="50%"><strong>Numerology</strong> · <code><roxy-numerology-card></code><br><sub>POST /numerology/{life-path,expression,personal-year,chart}</sub><br>
|
|
@@ -256,7 +256,7 @@ export function Chart({ data }: { data: NatalChart }) {
|
|
|
256
256
|
}
|
|
257
257
|
```
|
|
258
258
|
|
|
259
|
-
For frameworks that consume custom elements directly (
|
|
259
|
+
For frameworks that consume custom elements directly (Svelte, Angular, Solid, vanilla HTML, WordPress) install `@roxyapi/ui` instead.
|
|
260
260
|
|
|
261
261
|
```bash
|
|
262
262
|
npm install @roxyapi/ui
|
|
@@ -292,6 +292,24 @@ Serialize with the shipped helper, never a bare `JSON.stringify`. `@roxyapi/ui`
|
|
|
292
292
|
|
|
293
293
|
Load the bundle once anywhere on the page. It registers every `roxy-*` element and loads the design tokens, so every component on the page renders themed, in light or dark, from that single tag. Nothing else to add.
|
|
294
294
|
|
|
295
|
+
### No-JavaScript fallback
|
|
296
|
+
|
|
297
|
+
The two modes degrade differently, and only one of them can be rescued.
|
|
298
|
+
|
|
299
|
+
**Controlled mode** (the `<script class="roxy-data">` island above) already holds the reading in the page. Render it server-side as ordinary HTML alongside the island and put that markup *inside* the element. Components render into a shadow root and none of them expose a `<slot>`, so light-DOM children are painted only while the element is un-upgraded, and disappear the moment the bundle registers it. You get the server HTML without JavaScript and the live component with it, from the same markup, with no flash of both.
|
|
300
|
+
|
|
301
|
+
**Form mode** (`data-endpoint` + a `pk_` key) is a self-fetch widget: it cannot work without JavaScript, because there is nothing to render until the visitor submits the form. Give it a light-DOM fallback that says so and links out.
|
|
302
|
+
|
|
303
|
+
```html
|
|
304
|
+
<roxy-natal-chart data-endpoint="astrology/natal-chart" publishable-key="pk_live_…">
|
|
305
|
+
<!-- Painted only when JavaScript is off. Replaced by the component otherwise. -->
|
|
306
|
+
<p>JavaScript is required to generate this chart.
|
|
307
|
+
<a href="https://roxyapi.com/products/astrology">Open it on roxyapi.com</a>.</p>
|
|
308
|
+
</roxy-natal-chart>
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
A `<noscript>` block works too, and is the safer choice if you also need to hide the fallback from screen readers once the component takes over.
|
|
312
|
+
|
|
295
313
|
```ts
|
|
296
314
|
import { roxyDataScript } from '@roxyapi/ui';
|
|
297
315
|
|
|
@@ -458,6 +476,8 @@ const { data: cc } = await roxy.tarot.castCelticCross({
|
|
|
458
476
|
|
|
459
477
|
The breakout 2026 self-knowledge category, computed from the same ephemeris as Western astrology plus the I Ching gate wheel and chakra-style centers. Self-discovery apps, dating and compatibility products, and AI coaching bots ship the full bodygraph first. No coordinates needed; Human Design uses the birth instant, not the observer location.
|
|
460
478
|
|
|
479
|
+
The response is a reading, not a set of labels: the type, strategy, authority, profile, and definition each arrive with the text that explains them, every defined channel and every center carry their own interpretation, and each of the activations carries a gate meaning and the meaning of its line. `<RoxyBodygraph>` lays that out for you. The chart and the identity read at a glance, and every body of prose sits behind a disclosure, so one component renders a complete reading without becoming a wall of text.
|
|
480
|
+
|
|
461
481
|
```tsx
|
|
462
482
|
import { RoxyBodygraph } from '@roxyapi/ui-react';
|
|
463
483
|
|
|
@@ -470,6 +490,15 @@ const { data: bodygraph } = await roxy.humanDesign.generateBodygraph({
|
|
|
470
490
|
<RoxyBodygraph data={bodygraph} />
|
|
471
491
|
```
|
|
472
492
|
|
|
493
|
+
Every interpretation is localized. Ask for the language on the request and the component renders it, because the component prints the prose the API returned and holds no copy of its own.
|
|
494
|
+
|
|
495
|
+
```tsx
|
|
496
|
+
const { data: bodygraph } = await roxy.humanDesign.generateBodygraph({
|
|
497
|
+
body: { date: '1990-01-15', time: '14:30:00', timezone: 5.5 },
|
|
498
|
+
query: { lang: 'de' },
|
|
499
|
+
});
|
|
500
|
+
```
|
|
501
|
+
|
|
473
502
|
### 6. Forecast (transits, cross-domain timeline)
|
|
474
503
|
|
|
475
504
|
The first cross-domain, stateless forecast in the catalog: one call merges Western transits, Vedic Vimshottari dasha boundaries, and biorhythm critical days into a single significance-scored, time-ordered timeline. Forecast feeds, transit alerts, and timing tools are the buyers. Acquire on the high-volume `astrology transits` search, convert on the cross-domain timeline no competitor ships. No coordinates needed.
|
|
@@ -553,6 +582,7 @@ Set `ROXY_API_KEY` to your secret key in your server env for the server-side SDK
|
|
|
553
582
|
|---|---|
|
|
554
583
|
| npm `@roxyapi/ui` | `npmjs.com/package/@roxyapi/ui` |
|
|
555
584
|
| npm `@roxyapi/ui-react` | `npmjs.com/package/@roxyapi/ui-react` |
|
|
585
|
+
| npm `@roxyapi/ui-vue` | `npmjs.com/package/@roxyapi/ui-vue` |
|
|
556
586
|
| jsDelivr CDN (full bundle) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js` |
|
|
557
587
|
| jsDelivr CDN (per component) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/components/{name}.js` |
|
|
558
588
|
| Widgets auto-mount (with browser keys, coming soon) | `cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/widgets.js` |
|
|
@@ -599,14 +629,15 @@ Set `ROXY_API_KEY` to your secret key in your server env for the server-side SDK
|
|
|
599
629
|
| `<roxy-tarot-card>` | Tarot | GET /tarot/cards/{id}, POST /tarot/daily | Single card with upright and reversed flip |
|
|
600
630
|
| `<roxy-tarot-catalog>` | Tarot | GET /tarot/cards | Deck gallery tiles with card art, name, and arcana and suit |
|
|
601
631
|
| `<roxy-tarot-spread>` | Tarot | POST /tarot/spreads/{three-card,celtic-cross,love}, /tarot/yes-no, /tarot/draw | Spreads with positions and reading |
|
|
602
|
-
| `<roxy-bodygraph>` | Human Design | POST /human-design/bodygraph | Nine-center chart with defined and open centers, active channels, gates,
|
|
632
|
+
| `<roxy-bodygraph>` | Human Design | POST /human-design/bodygraph | Nine-center chart with defined and open centers, active channels, and gates, plus the type, strategy, authority, profile, and definition readings, the channels by circuit, the centers, and every activation with its gate and line meaning |
|
|
633
|
+
| `<roxy-hd-type-card>` | Human Design | POST /human-design/type, /human-design/profile | Type, strategy, authority, and profile tiles with the aura, signature, and not-self themes, plus the reading behind each label and the profile line keynotes |
|
|
603
634
|
| `<roxy-hd-connection>` | Human Design | POST /human-design/connection | Electromagnetic, compromise, and dominance channels between two charts |
|
|
604
635
|
| `<roxy-hd-penta>` | Human Design | POST /human-design/penta | Group penta channels split into upper and lower triangles |
|
|
605
|
-
| `<roxy-hd-variables>` | Human Design | POST /human-design/variables | The four transformation arrows with direction and
|
|
636
|
+
| `<roxy-hd-variables>` | Human Design | POST /human-design/variables | The four transformation arrows with direction, color, tone, and base, plus a reading per arrow grouped by layer and the cognition |
|
|
606
637
|
| `<roxy-forecast-timeline>` | Forecast | POST /forecast/timeline | Date-grouped events across Western, Vedic, and biorhythm domains, weighted by significance |
|
|
607
638
|
| `<roxy-forecast-digest>` | Forecast | POST /forecast/digest | Per-window event counts, domain breakdown, and the highest-significance events |
|
|
608
639
|
| `<roxy-biorhythm-chart>` | Biorhythm | POST /biorhythm/{daily,forecast,critical-days} | Daily bars, forecast cycle lines, critical days |
|
|
609
|
-
| `<roxy-hexagram>` | I Ching | GET /iching/hexagrams/{number}, /iching/cast, POST /iching/daily, /iching/daily/cast | Hexagram with trigrams, judgment, image,
|
|
640
|
+
| `<roxy-hexagram>` | I Ching | GET /iching/hexagrams/{number}, /iching/cast, POST /iching/daily, /iching/daily/cast | Hexagram figure with trigrams, judgment, image, and a reading per line (statement plus meaning); a cast highlights the moving lines and the resulting hexagram |
|
|
610
641
|
| `<roxy-crystal-card>` | Crystals | GET /crystals/{id} | Photo, meaning sections, chakra, zodiac, element, hardness, keywords, and pairings |
|
|
611
642
|
| `<roxy-crystal-grid>` | Crystals | GET /crystals, /crystals/chakra/{chakra}, /crystals/element/{element}, /crystals/zodiac/{sign}, /crystals/birthstone/{month}, /crystals/search | Crystal gallery tiles with photo, name, and colour swatches |
|
|
612
643
|
| `<roxy-dream-card>` | Dreams | GET /dreams/symbols/{id} | Symbol name, interpretation body, and letter chip |
|
|
@@ -655,7 +686,7 @@ roxy-natal-chart {
|
|
|
655
686
|
|
|
656
687
|
## Built for AI agents
|
|
657
688
|
|
|
658
|
-
[`AGENTS.md`](AGENTS.md) is bundled inside
|
|
689
|
+
[`AGENTS.md`](AGENTS.md) is bundled inside every npm package. Once installed, agents can read it from `node_modules/@roxyapi/ui/AGENTS.md` (or `@roxyapi/ui-react/AGENTS.md`, `@roxyapi/ui-vue/AGENTS.md`) for the component decision tree, integration patterns, and rules.
|
|
659
690
|
|
|
660
691
|
- Works with Claude Code, Cursor, Copilot, Codex, Gemini CLI, and any MCP-compatible client.
|
|
661
692
|
- Component decision tree maps each RoxyAPI endpoint to the component that renders its response.
|
|
@@ -714,7 +745,7 @@ Persist the choice in `localStorage` from your own code; the components do not o
|
|
|
714
745
|
<details>
|
|
715
746
|
<summary><strong>How big is each component? What is the bundle cost?</strong></summary>
|
|
716
747
|
|
|
717
|
-
Per-component bundles run 9-21 KB gzipped, capped at 30 KB by CI. The full bundle (every component, helpers, base styles, and the inlined design tokens) stays well under the 150 KB CI cap, around 85 KB gzipped today. The React
|
|
748
|
+
Per-component bundles run 9-21 KB gzipped, capped at 30 KB by CI. The full bundle (every component, helpers, base styles, and the inlined design tokens) stays well under the 150 KB CI cap, around 85 KB gzipped today. The React and Vue packages load the runtime on mount, so a route that renders one chart pays for one component, not the whole catalog. Pin a concrete version in production for byte-stable cache hits.
|
|
718
749
|
</details>
|
|
719
750
|
|
|
720
751
|
<details>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/angel-number-card.tsx", "../../src/load-ui.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { GetAngelNumberResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAngelNumberCardProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: GetAngelNumberResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAngelNumberCard = React.forwardRef<HTMLElement | null, RoxyAngelNumberCardProps>(\n\tfunction RoxyAngelNumberCard({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-angel-number-card', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { GetAngelNumberResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAngelNumberCardProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: GetAngelNumberResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAngelNumberCard = React.forwardRef<HTMLElement | null, RoxyAngelNumberCardProps>(\n\tfunction RoxyAngelNumberCard({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-angel-number-card', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.14.0\";\n"],
|
|
5
5
|
"mappings": "AAAA,UAAYA,MAAW,QCSvB,IAAMC,EAAY,oBACZC,EAA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AAC,EACA,GAAGM,CACJ,CAAC,CACF,CACD",
|
|
6
6
|
"names": ["React", "SCRIPT_ID", "CDN_BASE_LATEST", "CDN_BASE_PREFIX", "CDN_BASE_SUFFIX", "loaded", "buildBase", "version", "ensureScriptLoaded", "resolve", "reject", "url", "existing", "RoxyAngelNumberCard", "data", "className", "style", "endpoint", "method", "publishableKey", "baseUrl", "specUrl", "rest", "ref", "internal", "loaded", "setLoaded", "error", "setError", "active", "ensureScriptLoaded", "err", "el"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/angel-number-lookup.tsx", "../../src/load-ui.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { AnalyzeNumberSequenceResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAngelNumberLookupProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: AnalyzeNumberSequenceResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAngelNumberLookup = React.forwardRef<HTMLElement | null, RoxyAngelNumberLookupProps>(\n\tfunction RoxyAngelNumberLookup({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-angel-number-lookup', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { AnalyzeNumberSequenceResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAngelNumberLookupProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: AnalyzeNumberSequenceResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAngelNumberLookup = React.forwardRef<HTMLElement | null, RoxyAngelNumberLookupProps>(\n\tfunction RoxyAngelNumberLookup({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-angel-number-lookup', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.14.0\";\n"],
|
|
5
5
|
"mappings": "AAAA,UAAYA,MAAW,QCSvB,IAAMC,EAAY,oBACZC,EAAkB,2DAClBC,EAAkB,4CAClBC,EAAkB,YAEpBC,EAA+B,KAEnC,SAASC,EAAUC,EAAyB,CAC3C,MAAI,CAACA,GAAWA,IAAY,SAAiBL,EACtC,GAAGC,CAAe,GAAGI,CAAO,GAAGH,CAAe,EACtD,CAEO,SAASI,EAAmBD,EAAkB,SAAyB,CAC7E,OAAI,OAAO,SAAa,IAAoB,QAAQ,QAAQ,EACxDF,IAEJA,EAAS,IAAI,QAAc,CAACI,EAASC,IAAW,CAC/C,IAAMC,EAAM,GAAGL,EAAUC,CAAO,CAAC,cAC7BK,EAAW,SAAS,eAAeX,CAAS,EAChD,GAAIW,EAAU,CACTA,EAAS,QAAQ,SAAW,OAC/BH,EAAQ,GAERG,EAAS,iBAAiB,OAAQ,IAAMH,EAAQ,CAAC,EACjDG,EAAS,iBAAiB,QAAS,IAAMF,EAAO,I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G,CAACA,EAAUQ,CAAM,CAAC,EAEf,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMd,IAAW,SACnBc,EAA6C,OAASd,EAEzD,EAAG,CAACA,EAAQO,CAAM,CAAC,EAEb,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMb,IAAmB,SAC3Ba,EAA6C,eAAiBb,EAEjE,EAAG,CAACA,EAAgBM,CAAM,CAAC,EAErB,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMZ,IAAY,SACpBY,EAAsC,QAAUZ,EAEnD,EAAG,CAACA,EAASK,CAAM,CAAC,EAEd,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMX,IAAY,SACpBW,EAAsC,QAAUX,EAEnD,EAAG,CAACA,EAASI,CAAM,CAAC,EAEhBE,EACU,gBACZ,MACA,CAAE,KAAM,QAAS,UAAAZ,EAAW,MAAAC,CAAM,EAClC,+BAA+BW,EAAM,OAAO,EAC7C,EAGY,gBAAc,2BAA4B,CACtD,IAAKH,EACL,UAAAT,EACA,MAAAC,EACA,GAAGM,CACJ,CAAC,CACF,CACD",
|
|
6
6
|
"names": ["React", "SCRIPT_ID", "CDN_BASE_LATEST", "CDN_BASE_PREFIX", "CDN_BASE_SUFFIX", "loaded", "buildBase", "version", "ensureScriptLoaded", "resolve", "reject", "url", "existing", "RoxyAngelNumberLookup", "data", "className", "style", "endpoint", "method", "publishableKey", "baseUrl", "specUrl", "rest", "ref", "internal", "loaded", "setLoaded", "error", "setError", "active", "ensureScriptLoaded", "err", "el"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/ashtakavarga-grid.tsx", "../../src/load-ui.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { AshtakavargaResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAshtakavargaGridProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: AshtakavargaResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAshtakavargaGrid = React.forwardRef<HTMLElement | null, RoxyAshtakavargaGridProps>(\n\tfunction RoxyAshtakavargaGrid({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-ashtakavarga-grid', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { AshtakavargaResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAshtakavargaGridProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: AshtakavargaResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAshtakavargaGrid = React.forwardRef<HTMLElement | null, RoxyAshtakavargaGridProps>(\n\tfunction RoxyAshtakavargaGrid({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-ashtakavarga-grid', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @ro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U,gBACZ,MACA,CAAE,KAAM,QAAS,UAAAZ,EAAW,MAAAC,CAAM,EAClC,+BAA+BW,EAAM,OAAO,EAC7C,EAGY,gBAAc,yBAA0B,CACpD,IAAKH,EACL,UAAAT,EACA,MAAAC,EACA,GAAGM,CACJ,CAAC,CACF,CACD",
|
|
6
6
|
"names": ["React", "SCRIPT_ID", "CDN_BASE_LATEST", "CDN_BASE_PREFIX", "CDN_BASE_SUFFIX", "loaded", "buildBase", "version", "ensureScriptLoaded", "resolve", "reject", "url", "existing", "RoxyAshtakavargaGrid", "data", "className", "style", "endpoint", "method", "publishableKey", "baseUrl", "specUrl", "rest", "ref", "internal", "loaded", "setLoaded", "error", "setError", "active", "ensureScriptLoaded", "err", "el"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/aspects-table.tsx", "../../src/load-ui.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { CalculateAspectsResponse, CalculateTransitAspectsResponse, DetectAspectPatternsResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAspectsTableProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: CalculateAspectsResponse | CalculateTransitAspectsResponse | DetectAspectPatternsResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAspectsTable = React.forwardRef<HTMLElement | null, RoxyAspectsTableProps>(\n\tfunction RoxyAspectsTable({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-aspects-table', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { CalculateAspectsResponse, CalculateTransitAspectsResponse, DetectAspectPatternsResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAspectsTableProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: CalculateAspectsResponse | CalculateTransitAspectsResponse | DetectAspectPatternsResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAspectsTable = React.forwardRef<HTMLElement | null, RoxyAspectsTableProps>(\n\tfunction RoxyAspectsTable({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-aspects-table', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.14.0\";\n"],
|
|
5
5
|
"mappings": "AAAA,UAAYA,MAAW,QCSvB,IAAMC,EAAY,oBACZC,EAAkB,2DAClBC,EAAkB,4CAClBC,EAAkB,YAEpBC,EAA+B,KAEnC,SAASC,EAAUC,EAAyB,CAC3C,MAAI,CAACA,GAAWA,IAAY,SAAiBL,EACtC,GAAGC,CAAe,GAAGI,CAAO,GAAGH,CAAe,EACtD,CAEO,SAASI,EAAmBD,EAAkB,SAAyB,CAC7E,OAAI,OAAO,SAAa,IAAoB,QAAQ,QAAQ,EACxDF,IAEJA,EAAS,IAAI,QAAc,CAACI,EAASC,IAAW,CAC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EC,YAAU,IAAM,CACrB,IAAMG,EAAKR,EAAS,QAChBQ,GAAMlB,IAAS,SACjBkB,EAAoC,KAAOlB,EAE9C,EAAG,CAACA,EAAMW,CAAM,CAAC,EAEX,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMf,IAAa,SACrBe,EAAuC,SAAWf,EAErD,EAAG,CAACA,EAAUQ,CAAM,CAAC,EAEf,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMd,IAAW,SACnBc,EAA6C,OAASd,EAEzD,EAAG,CAACA,EAAQO,CAAM,CAAC,EAEb,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMb,IAAmB,SAC3Ba,EAA6C,eAAiBb,EAEjE,EAAG,CAACA,EAAgBM,CAAM,CAAC,EAErB,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMZ,IAAY,SACpBY,EAAsC,QAAUZ,EAEnD,EAAG,CAACA,EAASK,CAAM,CAAC,EAEd,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMX,IAAY,SACpBW,EAAsC,QAAUX,EAEnD,EAAG,CAACA,EAASI,CAAM,CAAC,EAEhBE,EACU,gBACZ,MACA,CAAE,KAAM,QAAS,UAAAZ,EAAW,MAAAC,CAAM,EAClC,+BAA+BW,EAAM,OAAO,EAC7C,EAGY,gBAAc,qBAAsB,CAChD,IAAKH,EACL,UAAAT,EACA,MAAAC,EACA,GAAGM,CACJ,CAAC,CACF,CACD",
|
|
6
6
|
"names": ["React", "SCRIPT_ID", "CDN_BASE_LATEST", "CDN_BASE_PREFIX", "CDN_BASE_SUFFIX", "loaded", "buildBase", "version", "ensureScriptLoaded", "resolve", "reject", "url", "existing", "RoxyAspectsTable", "data", "className", "style", "endpoint", "method", "publishableKey", "baseUrl", "specUrl", "rest", "ref", "internal", "loaded", "setLoaded", "error", "setError", "active", "ensureScriptLoaded", "err", "el"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/astrocartography-map.tsx", "../../src/load-ui.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { AstrocartographyResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAstrocartographyMapProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: AstrocartographyResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAstrocartographyMap = React.forwardRef<HTMLElement | null, RoxyAstrocartographyMapProps>(\n\tfunction RoxyAstrocartographyMap({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-astrocartography-map', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { AstrocartographyResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyAstrocartographyMapProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: AstrocartographyResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyAstrocartographyMap = React.forwardRef<HTMLElement | null, RoxyAstrocartographyMapProps>(\n\tfunction RoxyAstrocartographyMap({ data, className, style, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-astrocartography-map', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.14.0\";\n"],
|
|
5
5
|
"mappings": "AAAA,UAAYA,MAAW,QCSvB,IAAMC,EAAY,oBACZC,EAAkB,2DAClBC,EAAkB,4CAClBC,EAAkB,YAEpBC,EAA+B,KAEnC,SAASC,EAAUC,EAAyB,CAC3C,MAAI,CAACA,GAAWA,IAAY,SAAiBL,EACtC,GAAGC,CAAe,GAAGI,CAAO,GAAGH,CAAe,EACtD,CAEO,SAASI,EAAmBD,EAAkB,SAAyB,CAC7E,OAAI,OAAO,SAAa,IAAoB,QAAQ,QAAQ,EACxDF,IAEJA,EAAS,IAAI,QAAc,CAACI,EAASC,IAAW,CAC/C,IAAMC,EAAM,GAAGL,EAAUC,CAAO,CAAC,cAC7BK,EAAW,SAAS,eAAeX,CAAS,EAChD,GAAIW,EAAU,CACTA,EAAS,QAAQ,SAAW,OAC/BH,EAAQ,GAERG,EAAS,iBAAiB,OAAQ,IAAMH,EAAQ,CAAC,EACjDG,EAAS,iBAAiB,QAAS,IAAMF,EAAO,IAAI,MAAM,qBAAqB,CAAC,CAAC,GAElF,MACD,CACAE,EAAW,SAAS,cAAc,QAAQ,EAC1CA,EAAS,GAAKX,EACdW,EAAS,IAAMD,EACfC,EAAS,MAAQ,GACjBA,EAAS,YAAc,YACvBA,EAAS,iBAAiB,OAAQ,IAAM,CACvCA,EAAU,QAAQ,OAAS,OAC3BH,EAAQ,CACT,CAAC,EACDG,EAAS,iBAAiB,QAAS,IAAMF,EAAO,IAAI,MAAM,qBAAqB,CAAC,CAAC,EACjF,SAAS,KAAK,YAAYE,CAAQ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MZ,IAAY,SACpBY,EAAsC,QAAUZ,EAEnD,EAAG,CAACA,EAASK,CAAM,CAAC,EAEd,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMX,IAAY,SACpBW,EAAsC,QAAUX,EAEnD,EAAG,CAACA,EAASI,CAAM,CAAC,EAEhBE,EACU,gBACZ,MACA,CAAE,KAAM,QAAS,UAAAZ,EAAW,MAAAC,CAAM,EAClC,+BAA+BW,EAAM,OAAO,EAC7C,EAGY,gBAAc,4BAA6B,CACvD,IAAKH,EACL,UAAAT,EACA,MAAAC,EACA,GAAGM,CACJ,CAAC,CACF,CACD",
|
|
6
6
|
"names": ["React", "SCRIPT_ID", "CDN_BASE_LATEST", "CDN_BASE_PREFIX", "CDN_BASE_SUFFIX", "loaded", "buildBase", "version", "ensureScriptLoaded", "resolve", "reject", "url", "existing", "RoxyAstrocartographyMap", "data", "className", "style", "endpoint", "method", "publishableKey", "baseUrl", "specUrl", "rest", "ref", "internal", "loaded", "setLoaded", "error", "setError", "active", "ensureScriptLoaded", "err", "el"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/biorhythm-chart.tsx", "../../src/load-ui.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { GetCriticalDaysResponse, GetDailyBiorhythmResponse, GetForecastResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyBiorhythmChartProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: GetDailyBiorhythmResponse | GetForecastResponse | GetCriticalDaysResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Which biorhythm response shape to render: a single day, a multi-day forecast, or the critical days list. */\n\tmode?: 'daily' | 'forecast' | 'critical-days';\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyBiorhythmChart = React.forwardRef<HTMLElement | null, RoxyBiorhythmChartProps>(\n\tfunction RoxyBiorhythmChart({ data, className, style, mode, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && mode !== undefined) {\n\t\t\t\t(el as unknown as { mode: 'daily' | 'forecast' | 'critical-days' }).mode = mode;\n\t\t\t}\n\t\t}, [mode, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-biorhythm-chart', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { ensureScriptLoaded } from '../load-ui.js';\nimport type { GetCriticalDaysResponse, GetDailyBiorhythmResponse, GetForecastResponse } from '@roxyapi/ui/types';\n\ntype ElementAttrs = Omit<\n\tReact.HTMLAttributes<HTMLElement>,\n\t'children' | 'data'\n>;\n\nexport interface RoxyBiorhythmChartProps extends ElementAttrs {\n\t/** Spec-derived response payload. Pass the raw RoxyAPI response. */\n\tdata?: GetDailyBiorhythmResponse | GetForecastResponse | GetCriticalDaysResponse;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\t/** Which biorhythm response shape to render: a single day, a multi-day forecast, or the critical days list. */\n\tmode?: 'daily' | 'forecast' | 'critical-days';\n\t/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. \"astrology/natal-chart\". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */\n\tendpoint?: string;\n\t/** HTTP method for the self-fetch request. Defaults to POST. */\n\tmethod?: 'GET' | 'POST';\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */\n\tpublishableKey?: string;\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\tbaseUrl?: string;\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\tspecUrl?: string;\n\n}\n\nexport const RoxyBiorhythmChart = React.forwardRef<HTMLElement | null, RoxyBiorhythmChartProps>(\n\tfunction RoxyBiorhythmChart({ data, className, style, mode, endpoint, method, publishableKey, baseUrl, specUrl, ...rest }, ref) {\n\t\tconst internal = React.useRef<HTMLElement | null>(null);\n\t\tReact.useImperativeHandle<HTMLElement | null, HTMLElement | null>(\n\t\t\tref,\n\t\t\t() => internal.current,\n\t\t\t[],\n\t\t);\n\t\tconst [loaded, setLoaded] = React.useState(false);\n\t\tconst [error, setError] = React.useState<Error | null>(null);\n\n\t\tReact.useEffect(() => {\n\t\t\tlet active = true;\n\t\t\tensureScriptLoaded()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif (active) setLoaded(true);\n\t\t\t\t})\n\t\t\t\t.catch((err: unknown) => {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t};\n\t\t}, []);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && data !== undefined) {\n\t\t\t\t(el as unknown as { data: unknown }).data = data;\n\t\t\t}\n\t\t}, [data, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && mode !== undefined) {\n\t\t\t\t(el as unknown as { mode: 'daily' | 'forecast' | 'critical-days' }).mode = mode;\n\t\t\t}\n\t\t}, [mode, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && endpoint !== undefined) {\n\t\t\t\t(el as unknown as { endpoint: string }).endpoint = endpoint;\n\t\t\t}\n\t\t}, [endpoint, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && method !== undefined) {\n\t\t\t\t(el as unknown as { method: 'GET' | 'POST' }).method = method;\n\t\t\t}\n\t\t}, [method, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && publishableKey !== undefined) {\n\t\t\t\t(el as unknown as { publishableKey: string }).publishableKey = publishableKey;\n\t\t\t}\n\t\t}, [publishableKey, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && baseUrl !== undefined) {\n\t\t\t\t(el as unknown as { baseUrl: string }).baseUrl = baseUrl;\n\t\t\t}\n\t\t}, [baseUrl, loaded]);\n\n\t\tReact.useEffect(() => {\n\t\t\tconst el = internal.current;\n\t\t\tif (el && specUrl !== undefined) {\n\t\t\t\t(el as unknown as { specUrl: string }).specUrl = specUrl;\n\t\t\t}\n\t\t}, [specUrl, loaded]);\n\n\t\tif (error) {\n\t\t\treturn React.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ role: 'alert', className, style },\n\t\t\t\t`Roxy UI script load failed: ${error.message}`,\n\t\t\t);\n\t\t}\n\n\t\treturn React.createElement('roxy-biorhythm-chart', {\n\t\t\tref: internal,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\t...rest,\n\t\t});\n\t},\n);\n", "/**\n * Loads the matching component bundle on first mount. Idempotent across\n * many components on the same page. Skips on the server (no document) so\n * React server components and Next.js SSR work without a flash.\n *\n * Pass an explicit `version` (e.g. `'0.1.5'`) to pin the loaded bundle to a\n * specific @roxyapi/ui release; the default ('latest') resolves to whatever\n * the CDN currently serves for @latest.\n */\nconst SCRIPT_ID = 'roxyapi-ui-loader';\nconst CDN_BASE_LATEST = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn\";\nconst CDN_BASE_PREFIX = \"https://cdn.jsdelivr.net/npm/@roxyapi/ui@\";\nconst CDN_BASE_SUFFIX = \"/dist/cdn\";\n\nlet loaded: Promise<void> | null = null;\n\nfunction buildBase(version: string): string {\n\tif (!version || version === 'latest') return CDN_BASE_LATEST;\n\treturn `${CDN_BASE_PREFIX}${version}${CDN_BASE_SUFFIX}`;\n}\n\nexport function ensureScriptLoaded(version: string = 'latest'): Promise<void> {\n\tif (typeof document === 'undefined') return Promise.resolve();\n\tif (loaded) return loaded;\n\n\tloaded = new Promise<void>((resolve, reject) => {\n\t\tconst url = `${buildBase(version)}/roxy-ui.js`;\n\t\tlet existing = document.getElementById(SCRIPT_ID) as HTMLScriptElement | null;\n\t\tif (existing) {\n\t\t\tif (existing.dataset.loaded === 'true') {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\texisting = document.createElement('script');\n\t\texisting.id = SCRIPT_ID;\n\t\texisting.src = url;\n\t\texisting.async = true;\n\t\texisting.crossOrigin = 'anonymous';\n\t\texisting.addEventListener('load', () => {\n\t\t\texisting!.dataset.loaded = 'true';\n\t\t\tresolve();\n\t\t});\n\t\texisting.addEventListener('error', () => reject(new Error('roxy-ui load failed')));\n\t\tdocument.head.appendChild(existing);\n\t});\n\treturn loaded;\n}\n\n// Default export retained for convenience; matches the named export.\nexport default ensureScriptLoaded;\n// Surfaces the embedded @roxyapi/ui version this build of @roxyapi/ui-react\n// was generated against. Useful for diagnostics; not load-bearing.\nexport const ROXY_UI_VERSION = \"0.14.0\";\n"],
|
|
5
5
|
"mappings": "AAAA,UAAYA,MAAW,QCSvB,IAAMC,EAAY,oBACZC,EAAkB,2DAClBC,EAAkB,4CAClBC,EAAkB,YAEpBC,EAA+B,KAEnC,SAASC,EAAUC,EAAyB,CAC3C,MAAI,CAACA,GAAWA,IAAY,SAAiBL,EACtC,GAAGC,CAAe,GAAGI,CAAO,GAAGH,CAAe,EACtD,CAEO,SAASI,EAAmBD,EAAkB,SAAyB,CAC7E,OAAI,OAAO,SAAa,IAAoB,QAAQ,QAAQ,EACxDF,IAEJA,EAAS,IAAI,QAAc,CAACI,EAASC,IAAW,CAC/C,IAAMC,EAAM,GAAGL,EAAUC,CAAO,CAAC,cAC7BK,EAAW,SAAS,eAAeX,CAAS,EAChD,GAAIW,EAAU,CACTA,EAAS,QAAQ,SAAW,OAC/BH,EAAQ,GAERG,EAAS,iBAAiB,OAAQ,IAAMH,EAAQ,CAAC,EACjDG,EAAS,iBAAiB,QAAS,IAAMF,EAAO,IAAI,MAAM,qBAAqB,CAAC,CAAC,GAElF,MACD,CACAE,EAAW,SAAS,cAAc,QAAQ,EAC1CA,EAAS,GAAKX,EACdW,EAAS,IAAMD,EACfC,EAAS,MAAQ,GACjBA,EAAS,YAAc,YACvBA,EAAS,iBAAiB,OAAQ,IAAM,CACvCA,EAAU,QAAQ,OAAS,OAC3BH,EAAQ,CACT,CAAC,EACDG,EAAS,iBAAiB,QAAS,IAAMF,EAAO,IAAI,MAAM,qBAAqB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b,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMb,IAAmB,SAC3Ba,EAA6C,eAAiBb,EAEjE,EAAG,CAACA,EAAgBM,CAAM,CAAC,EAErB,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMZ,IAAY,SACpBY,EAAsC,QAAUZ,EAEnD,EAAG,CAACA,EAASK,CAAM,CAAC,EAEd,YAAU,IAAM,CACrB,IAAMO,EAAKR,EAAS,QAChBQ,GAAMX,IAAY,SACpBW,EAAsC,QAAUX,EAEnD,EAAG,CAACA,EAASI,CAAM,CAAC,EAEhBE,EACU,gBACZ,MACA,CAAE,KAAM,QAAS,UAAAb,EAAW,MAAAC,CAAM,EAClC,+BAA+BY,EAAM,OAAO,EAC7C,EAGY,gBAAc,uBAAwB,CAClD,IAAKH,EACL,UAAAV,EACA,MAAAC,EACA,GAAGO,CACJ,CAAC,CACF,CACD",
|
|
6
6
|
"names": ["React", "SCRIPT_ID", "CDN_BASE_LATEST", "CDN_BASE_PREFIX", "CDN_BASE_SUFFIX", "loaded", "buildBase", "version", "ensureScriptLoaded", "resolve", "reject", "url", "existing", "RoxyBiorhythmChart", "data", "className", "style", "mode", "endpoint", "method", "publishableKey", "baseUrl", "specUrl", "rest", "ref", "internal", "loaded", "setLoaded", "error", "setError", "active", "ensureScriptLoaded", "err", "el"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
type
|
|
2
|
+
import type { GenerateBodygraphResponse } from '@roxyapi/ui/types';
|
|
3
|
+
type ElementAttrs = Omit<React.HTMLAttributes<HTMLElement>, 'children' | 'data'>;
|
|
3
4
|
export interface RoxyBodygraphProps extends ElementAttrs {
|
|
5
|
+
/** Spec-derived response payload. Pass the raw RoxyAPI response. */
|
|
6
|
+
data?: GenerateBodygraphResponse;
|
|
4
7
|
className?: string;
|
|
5
8
|
style?: React.CSSProperties;
|
|
9
|
+
/** Endpoint path for built-in self-fetch (uncontrolled mode), e.g. "astrology/natal-chart". The component renders its own input form, fetches with the publishable key, and displays the result. Leave unset for controlled mode (pass `data`). */
|
|
10
|
+
endpoint?: string;
|
|
11
|
+
/** HTTP method for the self-fetch request. Defaults to POST. */
|
|
12
|
+
method?: 'GET' | 'POST';
|
|
13
|
+
/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side and never sent. */
|
|
14
|
+
publishableKey?: string;
|
|
15
|
+
/** Override the API origin for self-hosted or proxied deployments. */
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
/** Override the OpenAPI spec URL the self-fetch form introspects. */
|
|
18
|
+
specUrl?: string;
|
|
6
19
|
}
|
|
7
20
|
export declare const RoxyBodygraph: React.ForwardRefExoticComponent<RoxyBodygraphProps & React.RefAttributes<HTMLElement | null>>;
|
|
8
21
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodygraph.d.ts","sourceRoot":"","sources":["../../src/components/bodygraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"bodygraph.d.ts","sourceRoot":"","sources":["../../src/components/bodygraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,KAAK,YAAY,GAAG,IAAI,CACvB,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,UAAU,GAAG,MAAM,CACnB,CAAC;AAEF,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACvD,oEAAoE;IACpE,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,mPAAmP;IACnP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,6GAA6G;IAC7G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;CAEjB;AAED,eAAO,MAAM,aAAa,+FAmFzB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as t from"react";var
|
|
1
|
+
import*as t from"react";var R="roxyapi-ui-loader",L="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn",T="https://cdn.jsdelivr.net/npm/@roxyapi/ui@",w="/dist/cdn",u=null;function B(o){return!o||o==="latest"?L:`${T}${o}${w}`}function y(o="latest"){return typeof document>"u"?Promise.resolve():u||(u=new Promise((s,i)=>{let d=`${B(o)}/roxy-ui.js`,n=document.getElementById(R);if(n){n.dataset.loaded==="true"?s():(n.addEventListener("load",()=>s()),n.addEventListener("error",()=>i(new Error("roxy-ui load failed"))));return}n=document.createElement("script"),n.id=R,n.src=d,n.async=!0,n.crossOrigin="anonymous",n.addEventListener("load",()=>{n.dataset.loaded="true",s()}),n.addEventListener("error",()=>i(new Error("roxy-ui load failed"))),document.head.appendChild(n)}),u)}var I=t.forwardRef(function({data:s,className:i,style:d,endpoint:n,method:c,publishableKey:l,baseUrl:f,specUrl:p,...g},x){let r=t.useRef(null);t.useImperativeHandle(x,()=>r.current,[]);let[a,S]=t.useState(!1),[m,h]=t.useState(null);return t.useEffect(()=>{let e=!0;return y().then(()=>{e&&S(!0)}).catch(E=>{e&&h(E instanceof Error?E:new Error(String(E)))}),()=>{e=!1}},[]),t.useEffect(()=>{let e=r.current;e&&s!==void 0&&(e.data=s)},[s,a]),t.useEffect(()=>{let e=r.current;e&&n!==void 0&&(e.endpoint=n)},[n,a]),t.useEffect(()=>{let e=r.current;e&&c!==void 0&&(e.method=c)},[c,a]),t.useEffect(()=>{let e=r.current;e&&l!==void 0&&(e.publishableKey=l)},[l,a]),t.useEffect(()=>{let e=r.current;e&&f!==void 0&&(e.baseUrl=f)},[f,a]),t.useEffect(()=>{let e=r.current;e&&p!==void 0&&(e.specUrl=p)},[p,a]),m?t.createElement("div",{role:"alert",className:i,style:d},`Roxy UI script load failed: ${m.message}`):t.createElement("roxy-bodygraph",{ref:r,className:i,style:d,...g})});export{I as RoxyBodygraph};
|
|
2
2
|
//# sourceMappingURL=bodygraph.js.map
|