@roxyapi/ui 0.18.2 → 0.18.4

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/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const ROXY_UI_VERSION = "0.18.2";
1
+ export declare const ROXY_UI_VERSION = "0.18.4";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roxyapi/ui",
3
- "version": "0.18.2",
3
+ "version": "0.18.4",
4
4
  "description": "Web components for the RoxyAPI catalog. Drop-in charts, tables, cards, forms for astrology, tarot, numerology, biorhythm, I Ching, crystals, dreams, angel numbers, and more. One key, beautiful in 30 minutes.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -239,7 +239,8 @@ export class RoxyDashaTimeline extends RoxyDataElement<DashaData> {
239
239
  * Which dasha endpoint fed this element. `sub`, `antara` and `sookshma` are the
240
240
  * three drill-down levels and render identically; they stay distinct because
241
241
  * each maps one-to-one onto its endpoint binding, which is what lets a widget
242
- * pick a level. The LABELS come from the payload, not from here.
242
+ * pick a level. The heading and the level LABELS come from the payload, not
243
+ * from here, so a host that cannot set attributes still renders correctly.
243
244
  */
244
245
  @property({ type: String, reflect: true })
245
246
  period: 'current' | 'major' | 'sub' | 'antara' | 'sookshma' = 'current';
@@ -248,11 +249,6 @@ export class RoxyDashaTimeline extends RoxyDataElement<DashaData> {
248
249
  @state()
249
250
  private view: 'timeline' | 'readings' | 'frame' = 'timeline';
250
251
 
251
- /** True for any of the drill-down levels, which share one layout. */
252
- private get isDrillDown(): boolean {
253
- return this.period !== 'current' && this.period !== 'major';
254
- }
255
-
256
252
  protected renderEmpty() {
257
253
  return html`<div class="roxy-empty" role="status">No dasha data</div>`;
258
254
  }
@@ -274,7 +270,12 @@ export class RoxyDashaTimeline extends RoxyDataElement<DashaData> {
274
270
  ...(readings.length
275
271
  ? [{ id: 'readings' as const, label: `Readings (${readings.length})` }]
276
272
  : []),
277
- ...(frame.length ? [{ id: 'frame' as const, label: 'Chart' }] : []),
273
+ // "Chart details", never "Chart": this panel is the sidereal frame the
274
+ // dates came from, not a wheel. A reader who clicks a tab labelled Chart
275
+ // expects to see one drawn.
276
+ ...(frame.length
277
+ ? [{ id: 'frame' as const, label: 'Chart details' }]
278
+ : []),
278
279
  ];
279
280
  // A tab that no longer exists (data changed under a selection) must not
280
281
  // blank the card, so fall back to the first.
@@ -412,16 +413,25 @@ export class RoxyDashaTimeline extends RoxyDataElement<DashaData> {
412
413
  </dl>`;
413
414
  }
414
415
 
416
+ /**
417
+ * Heading, decided by the PAYLOAD first and the `period` attribute only as a
418
+ * tie-break.
419
+ *
420
+ * Not every host can set the attribute. The WordPress plugin maps an
421
+ * operationId to a bare component tag with no attrs, so every dasha shortcode
422
+ * arrives with the default `period="current"`; keying off the attribute alone
423
+ * titled an antardasha list "Active dashas" there. A drill-down response is
424
+ * self-identifying (it carries a parent period), so the markup does not need
425
+ * to be told.
426
+ */
415
427
  private heading(d: DashaData): string {
416
- if (this.period === 'major') return 'Vimshottari Mahadasha';
417
- if (this.isDrillDown) {
418
- const parent = parentOf(d);
419
- const level = levelOf(d);
420
- return parent
421
- ? `${level}s in ${parent.period.planet} ${parent.label}`
422
- : `${level}s`;
428
+ const parent = parentOf(d);
429
+ if (parent) {
430
+ return `${levelOf(d)}s in ${parent.period.planet} ${parent.label}`;
423
431
  }
424
- return 'Active dashas';
432
+ if ('mahadashas' in d) return 'Vimshottari Mahadasha';
433
+ if ('mahadasha' in d) return 'Active dashas';
434
+ return this.period === 'major' ? 'Vimshottari Mahadasha' : 'Active dashas';
425
435
  }
426
436
 
427
437
  /**
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/sync-version.ts. Do not edit.
2
- export const ROXY_UI_VERSION = '0.18.2';
2
+ export const ROXY_UI_VERSION = '0.18.4';