Skip to content

Commit 898a7ab

Browse files
committed
feat: adopt roxyapi-ui 0.11.0, map 10 new components, fix numeric anyOf attribute coercion, tokenize error colors, sync readme counts and examples
1 parent db79490 commit 898a7ab

56 files changed

Lines changed: 401 additions & 149 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
## Ship a complete astrology, numerology, or tarot site this weekend. Not this quarter.
1616

17-
The only multi domain spiritual intelligence plugin for WordPress. Drop daily horoscopes, numerology charts, tarot pulls, I Ching casts, dream symbol lookups, and natal chart calculators onto any page. One API key, ten spiritual data domains, 130+ endpoints. Verified against NASA JPL Horizons.
17+
The only multi domain spiritual intelligence plugin for WordPress. Drop daily horoscopes, numerology charts, tarot pulls, I Ching casts, dream symbol lookups, and natal chart calculators onto any page. One API key, 12 spiritual data domains, 150+ endpoints. Verified against NASA JPL Horizons.
1818

1919
Interactive forms for your visitors. Gutenberg blocks for your editor. Shortcodes for anywhere else. Server side rendering keeps your API key out of the browser. Transient caching keeps your quota intact.
2020

21-
- **17 hero blocks and shortcodes** covering western astrology, vedic astrology (kundli, panchang, mangal dosha, KP chart, gun milan), tarot (daily, three card, yes or no), numerology, biorhythm, angel numbers, crystals by zodiac, current moon phase, and two-chart compatibility (synastry, gun milan, Western compatibility).
21+
- **17 hero shortcodes** covering western astrology, vedic astrology (kundli, panchang, mangal dosha, KP chart, gun milan), tarot (daily, three card, yes or no), numerology, biorhythm, angel numbers, crystals by zodiac, current moon phase, and two-chart compatibility (synastry, gun milan, Western compatibility). Six of them (horoscope, natal chart, tarot, numerology, biorhythm, angel number) also ship a hand-written Gutenberg block; the rest render through their shortcode.
2222
- **Auto generated shortcodes** for the long tail. Every endpoint in the RoxyAPI OpenAPI spec is reachable from a shortcode.
2323
- **Form mode on every hero shortcode.** Let visitors submit their own sign, name, birth date, or question and render a personalized reading. No JavaScript required.
2424
- **Zero client side secrets.** All calls run in PHP. The API key never reaches the browser.
@@ -85,18 +85,18 @@ Form submissions post back to the same page over HTTPS. The plugin validates the
8585

8686
## Gutenberg blocks
8787

88-
In the block editor, open the inserter and pick a block from the **RoxyAPI** category. Ten hero blocks, each with a variation picker:
88+
In the block editor, open the inserter and pick a block from the **RoxyAPI** category. Six hand-written hero blocks (Horoscope, Tarot, and Numerology include a variation picker):
8989

9090
- **Horoscope** (daily, weekly, monthly, love, career, Chinese)
9191
- **Natal Chart**
9292
- **Tarot** (daily, three card, Celtic Cross)
9393
- **Numerology** (life path, expression, soul urge, full chart)
94-
- **I Ching**
95-
- **Dream Symbol**
9694
- **Biorhythm**
9795
- **Angel Number**
98-
- **Crystal**
99-
- **Astrology Section** wrapper that shares a default zodiac sign and birth date with every child block inside it via block context
96+
97+
Beyond these, 125 long-tail endpoints (I Ching, dream symbols, crystals, human design, forecasts, and more) each auto-generate a matching block, for 131 blocks in total. The remaining endpoints render through their shortcode or a visitor form.
98+
99+
The **Astrology Section** wrapper block shares a default zodiac sign and birth date with every child block inside it via block context.
100100

101101
Every block renders server side through the same RoxyAPI client the shortcodes use. Same caching, same rate limiting, same secret handling.
102102

@@ -121,14 +121,16 @@ define( 'ROXYAPI_ENCRYPTION_SALT', getenv( 'ROXYAPI_ENCRYPTION_SALT' ) );
121121

122122
When `ROXYAPI_KEY` is defined, the settings field is read only and the constant takes priority. Your key never enters the database.
123123

124-
## Ten domains, 130+ endpoints, one key
124+
## 12 domains, 150+ endpoints, one key
125125

126126
| Domain | What you get |
127127
| ----------------- | --------------------------------------------------------------------------------------------------------------- |
128128
| Western astrology | Natal charts, horoscopes (daily, weekly, monthly, love, career), transits, synastry, moon phases, compatibility |
129129
| Vedic astrology | Kundli, nakshatras, Dasha, Panchang, KP system, doshas, yogas, muhurta |
130130
| Numerology | Life path, expression, soul urge, personal year, personality, karmic analysis |
131131
| Tarot | Rider Waite Smith deck, single card, three card, Celtic Cross, custom spreads |
132+
| Human Design | Bodygraph with type, authority, profile, centers, channels, gates, plus two chart connection charts |
133+
| Forecast | Cross domain timelines, transit forecasts, solar returns, and significant dates |
132134
| Biorhythm | Physical, emotional, intellectual, intuitive cycles plus six extended cycles |
133135
| I Ching | Hexagrams, trigrams, coin casting, daily readings |
134136
| Crystals | Healing properties, zodiac and chakra pairings, birthstones |

assets/css/frontend.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@
378378
padding: 0.75rem 1rem;
379379
border: 1px solid color-mix(in srgb, currentcolor 12%, transparent);
380380
border-inline-start-width: 4px;
381-
border-inline-start-color: color-mix(in srgb, #b91c1c 70%, currentColor);
381+
border-inline-start-color: color-mix(in srgb, var(--roxy-danger-fg, #b91c1c) 70%, currentColor);
382382
border-radius: var(--wp--custom--border--radius, 6px);
383383
background: color-mix(in srgb, #fee2e2 30%, transparent);
384384
color: var(--wp--preset--color--foreground, currentColor);
@@ -454,7 +454,7 @@
454454
}
455455

456456
:where(.roxyapi-form-required) {
457-
color: #b91c1c;
457+
color: var(--roxy-danger-fg, #b91c1c);
458458
}
459459

460460
:where(.roxyapi-form-field input),
@@ -476,12 +476,12 @@
476476

477477
:where(.roxyapi-form-field.has-error input),
478478
:where(.roxyapi-form-field.has-error select) {
479-
border-color: color-mix(in srgb, #b91c1c 70%, currentColor);
479+
border-color: color-mix(in srgb, var(--roxy-danger-fg, #b91c1c) 70%, currentColor);
480480
}
481481

482482
:where(.roxyapi-form-error) {
483483
font-size: 0.8125rem;
484-
color: #b91c1c;
484+
color: var(--roxy-danger-fg, #b91c1c);
485485
}
486486

487487
:where(.roxyapi-form-help) {
@@ -512,7 +512,7 @@
512512
}
513513

514514
:where(.roxyapi-form-consent.has-error) {
515-
border-color: color-mix(in srgb, #b91c1c 70%, currentColor);
515+
border-color: color-mix(in srgb, var(--roxy-danger-fg, #b91c1c) 70%, currentColor);
516516
}
517517

518518
:where(.roxyapi-form-actions) {

assets/css/roxy-ui-tokens.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
/* Color: surface */
4343
--roxy-bg: #ffffff;
44+
--roxy-surface: #ffffff;
4445
--roxy-fg: #0a0a0a;
4546
--roxy-muted: #71717a;
4647
--roxy-border: #e4e4e7;
@@ -123,6 +124,7 @@
123124
--roxy-info-fg: #7dd3fc;
124125

125126
--roxy-bg: #0a0a0a;
127+
--roxy-surface: #18181b;
126128
--roxy-fg: #fafafa;
127129
--roxy-muted: #a1a1aa;
128130
--roxy-border: #27272a;
@@ -164,6 +166,7 @@
164166
--roxy-info-fg: #075985;
165167

166168
--roxy-bg: #ffffff;
169+
--roxy-surface: #ffffff;
167170
--roxy-fg: #0a0a0a;
168171
--roxy-muted: #71717a;
169172
--roxy-border: #e4e4e7;
@@ -201,6 +204,7 @@
201204
--roxy-info-fg: #7dd3fc;
202205

203206
--roxy-bg: #0a0a0a;
207+
--roxy-surface: #18181b;
204208
--roxy-fg: #fafafa;
205209
--roxy-muted: #a1a1aa;
206210
--roxy-border: #27272a;

assets/js/roxy-ui.js

Lines changed: 93 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/check-component-map.mjs

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,34 @@ if ( ! manifestUrl ) {
3939
process.exit( 1 );
4040
}
4141

42+
// Pin-consistency guard (offline, deterministic). The @roxyapi/ui version is
43+
// hand-copied to THREE places that drift independently: ROXYAPI_UI_VERSION in
44+
// roxyapi.php (cache-bust + the version fetch-ui-bundle.mjs vendors), and both
45+
// _meta.ui_version_pinned and the version embedded in _meta.ui_manifest_url
46+
// here. A mismatch makes this very check validate against the wrong build (or
47+
// silently against a stale manifest while the vendored bundle is newer). Fail
48+
// loudly so all three move together on every UI bump.
49+
const phpSource = readFileSync( path.join( root, 'roxyapi.php' ), 'utf8' );
50+
const phpPin = phpSource.match(
51+
/const\s+ROXYAPI_UI_VERSION\s*=\s*'([^']+)'/
52+
)?.[ 1 ];
53+
const metaPin = map?._meta?.ui_version_pinned;
54+
const urlPin = String( manifestUrl ).match( /@roxyapi\/ui@([^/]+)\// )?.[ 1 ];
55+
if (
56+
phpPin &&
57+
metaPin &&
58+
urlPin &&
59+
! ( phpPin === metaPin && metaPin === urlPin )
60+
) {
61+
console.error(
62+
'@roxyapi/ui version pins disagree (align all three, then `npm run fetch:ui`):'
63+
);
64+
console.error( ` roxyapi.php ROXYAPI_UI_VERSION = ${ phpPin }` );
65+
console.error( ` component-map.json ui_version_pinned = ${ metaPin }` );
66+
console.error( ` component-map.json ui_manifest_url = ${ urlPin }` );
67+
process.exit( 1 );
68+
}
69+
4270
// Collect every tag referenced by the map, mapped to its slug form.
4371
const referenced = new Map(); // slug -> tag
4472
for ( const rows of Object.values( map.operations || {} ) ) {
@@ -139,10 +167,21 @@ if ( deadOps.length > 0 ) {
139167
process.exit( 1 );
140168
}
141169

170+
// Adoption signal (informational, never fatal). The map is intentionally a
171+
// subset of the build (helpers + reads that are fine as generic cards stay
172+
// unbound), but a jump in this count after a version bump means new upstream
173+
// components are available to wire up via a component-map row.
174+
const unbound = available.size - referenced.size;
175+
if ( unbound > 0 ) {
176+
console.log(
177+
`note: ${ unbound } of ${ available.size } component(s) in the pinned UI build are not bound to any operation. Bind in component-map.json to render them (unbound reads fall back to roxy-data).`
178+
);
179+
}
180+
142181
console.log(
143-
`component-map.json OK: ${
144-
referenced.size
145-
} component tag(s) in the pinned UI build, ${
182+
`component-map.json OK: ${ referenced.size } of ${
183+
available.size
184+
} component tag(s) bound in the pinned UI build, ${
146185
Object.keys( map.operations || {} ).length
147186
} operationId(s) present in the live spec`
148187
);

bin/component-map.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"_meta": {
33
"ui_package": "@roxyapi/ui",
4-
"ui_version_pinned": "0.10.0",
5-
"ui_manifest_url": "https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.10.0/dist/manifest.json"
4+
"ui_version_pinned": "0.11.0",
5+
"ui_manifest_url": "https://cdn.jsdelivr.net/npm/@roxyapi/ui@0.11.0/dist/manifest.json"
66
},
77
"operations": {
88
"generateNatalChart": [ { "component": "roxy-natal-chart", "kind": "chart" } ],
@@ -68,6 +68,27 @@
6868
"getDreamSymbol": [ { "component": "roxy-dream-card", "kind": "card" } ],
6969

7070
"getAngelNumber": [ { "component": "roxy-angel-number-card", "kind": "card" } ],
71-
"analyzeNumberSequence": [ { "component": "roxy-angel-number-lookup", "kind": "card" } ]
71+
"analyzeNumberSequence": [ { "component": "roxy-angel-number-lookup", "kind": "card" } ],
72+
73+
"calculateAspects": [ { "component": "roxy-aspects-table", "kind": "table" } ],
74+
"calculateTransitAspects": [ { "component": "roxy-aspects-table", "kind": "table" } ],
75+
"detectAspectPatterns": [ { "component": "roxy-aspects-table", "kind": "table" } ],
76+
"calculateDrishti": [ { "component": "roxy-vedic-aspects", "kind": "table" } ],
77+
"getHora": [ { "component": "roxy-hora-table", "kind": "table" } ],
78+
"generateDigest": [ { "component": "roxy-forecast-digest", "kind": "card" } ],
79+
"getCrystal": [ { "component": "roxy-crystal-card", "kind": "card" } ],
80+
"searchDreamSymbols": [ { "component": "roxy-dream-search", "kind": "card" } ],
81+
"calculateConnection": [ { "component": "roxy-hd-connection", "kind": "chart" } ],
82+
"calculatePenta": [ { "component": "roxy-hd-penta", "kind": "chart" } ],
83+
"calculateVariables": [ { "component": "roxy-hd-variables", "kind": "card" } ],
84+
85+
"getZodiacSign": [ { "component": "roxy-reference-card", "kind": "card" } ],
86+
"getPlanetMeaning": [ { "component": "roxy-reference-card", "kind": "card" } ],
87+
"getRashi": [ { "component": "roxy-reference-card", "kind": "card" } ],
88+
"getTrigram": [ { "component": "roxy-reference-card", "kind": "card" } ],
89+
"getGate": [ { "component": "roxy-reference-card", "kind": "card" } ],
90+
"getCenter": [ { "component": "roxy-reference-card", "kind": "card" } ],
91+
"getNumberMeaning": [ { "component": "roxy-reference-card", "kind": "card" } ],
92+
"getCompoundNumber": [ { "component": "roxy-reference-card", "kind": "card" } ]
7293
}
7394
}

bin/generate.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,22 @@ function extractBodyFields( op ) {
388388
const required = new Set( schema.required || [] );
389389
return Object.entries( props ).map( ( [ name, prop ] ) => {
390390
const resolvedProp = resolveRef( prop );
391+
// anyOf/oneOf of number + string (e.g. `timezone`: decimal hours OR IANA
392+
// name). resolvedProp.type is undefined for these, so the body builder
393+
// would send the shortcode attr as a raw string and the API rejects
394+
// "5.5" (matches neither the number nor the IANA-string pattern).
395+
const variants = resolvedProp.anyOf || resolvedProp.oneOf;
396+
const numericString =
397+
Array.isArray( variants ) &&
398+
variants.some( ( v ) => {
399+
const t = resolveRef( v ).type;
400+
return t === 'number' || t === 'integer';
401+
} );
391402
return {
392403
name,
393404
required: required.has( name ),
394405
type: resolvedProp.type || 'string',
406+
numericString,
395407
description: resolvedProp.description || '',
396408
example: resolvedProp.example,
397409
};
@@ -1110,6 +1122,9 @@ class ${ className } {
11101122
if ( f.type === 'boolean' ) {
11111123
return `\t\t\t\t'${ f.name }' => $atts['${ attr }'] !== '' ? filter_var( $atts['${ attr }'], FILTER_VALIDATE_BOOLEAN ) : '',`;
11121124
}
1125+
if ( f.numericString ) {
1126+
return `\t\t\t\t'${ f.name }' => $atts['${ attr }'] !== '' ? ( is_numeric( $atts['${ attr }'] ) ? (float) $atts['${ attr }'] : $atts['${ attr }'] ) : '',`;
1127+
}
11131128
return `\t\t\t\t'${ f.name }' => $atts['${ attr }'],`;
11141129
} )
11151130
.join(

readme.txt

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,52 @@ The plugin itself is GPLv2 or later and the source is available at https://githu
3838
* Server side caching with per endpoint TTL to keep your API quota low
3939
* API key stays server side. Never exposed to the browser.
4040

41+
== Shortcode examples ==
42+
43+
Every reading is a shortcode. Pass attributes for a fixed reading the site owner controls, or drop the shortcode with no attributes to render an accessible visitor form. Heroes that take two charts or nested birth details are form mode only.
44+
45+
**Hero shortcodes**
46+
47+
`[roxy_horoscope sign="aries"]`
48+
`[roxy_natal_chart birth_date="1990-05-15" birth_time="14:30" lat="40.7128" lon="-74.0060" tz="America/New_York"]`
49+
`[roxy_kundli birth_date="1990-05-15" birth_time="14:30" lat="28.6139" lon="77.2090" tz="Asia/Kolkata"]`
50+
`[roxy_panchang date="2026-04-28" lat="28.6139" lon="77.2090" tz="Asia/Kolkata"]`
51+
`[roxy_mangal_dosha birth_date="1990-05-15" birth_time="14:30" lat="28.6139" lon="77.2090" tz="Asia/Kolkata"]`
52+
`[roxy_kp_chart birth_date="1990-05-15" birth_time="14:30" lat="28.6139" lon="77.2090" tz="Asia/Kolkata"]`
53+
`[roxy_moon_phase]`
54+
`[roxy_tarot_card spread="three" question="What should I focus on this week"]`
55+
`[roxy_tarot_yes_no question="Should I take the new job"]`
56+
`[roxy_numerology name="Ada Lovelace" birth_date="1815-12-10"]`
57+
`[roxy_life_path birth_date="1990-05-15"]`
58+
`[roxy_biorhythm birth_date="1990-05-15" target_date="today"]`
59+
`[roxy_angel_number number="1111"]`
60+
`[roxy_crystals_by_zodiac sign="aries"]`
61+
62+
The three two chart compatibility heroes render a visitor form for both people and take no attributes:
63+
64+
`[roxy_synastry]`
65+
`[roxy_gun_milan]`
66+
`[roxy_compatibility]`
67+
68+
Leave the attributes off any hero shortcode to render a form instead. For example `[roxy_horoscope]` shows a zodiac sign picker and `[roxy_natal_chart]` shows a birth date, time, and city picker.
69+
70+
**Long-tail shortcodes**
71+
72+
A matching shortcode exists for every endpoint in the spec. A sample across the domains:
73+
74+
* Western astrology: `[roxy_calculate_aspects date="1990-07-15" time="14:30:00" timezone="UTC"]` and `[roxy_get_weekly_horoscope sign="aries"]`
75+
* Vedic astrology: `[roxy_get_hora date="2026-02-03" latitude="17.385044" longitude="78.486671" timezone="UTC"]` and `[roxy_calculate_drishti date="2026-02-03" time="12:00:00" latitude="17.385044" longitude="78.486671" timezone="UTC"]`
76+
* Tarot: `[roxy_cast_celtic_cross question="What should I know about this path"]`
77+
* Numerology: `[roxy_calculate_expression full_name="Ada Lovelace"]`
78+
* Human design: `[roxy_generate_bodygraph date="1990-07-15" time="13:00:00" timezone="UTC" latitude="40.7128" longitude="-74.0060"]`, `[roxy_calculate_variables date="1990-07-15" time="13:00:00" timezone="UTC" latitude="40.7128" longitude="-74.0060"]`, plus the two chart `[roxy_calculate_connection]` and `[roxy_calculate_penta]` which render visitor forms and take no attributes
79+
* Forecast: `[roxy_generate_digest]` (renders a visitor form, no attributes)
80+
* I Ching: `[roxy_get_daily_hexagram]`
81+
* Crystals: `[roxy_get_crystal id="amethyst"]`
82+
* Dreams: `[roxy_search_dream_symbols q="water"]`
83+
* Location: `[roxy_search_cities q="berlin"]`
84+
85+
Add lang to any shortcode to override the response language, for example `[roxy_get_crystal id="amethyst" lang="es"]`.
86+
4187
== Installation ==
4288

4389
1. In your WordPress admin, go to Plugins, Add New, search for "RoxyAPI", and click Install Now.
@@ -70,7 +116,7 @@ Not to get started. A limited number of free readings per day are allowed right
70116

71117
= What readings can I add to my site? =
72118

73-
One key covers 12 domains. Western astrology: natal chart, daily / weekly / monthly horoscopes, synastry, compatibility, transits, aspect patterns, and moon phases. Vedic astrology: kundli, KP chart, panchang, Vimshottari dasha, divisional charts, nakshatras, doshas (Manglik, Kaal Sarpa, Sade Sati), and classical yogas. Numerology: Life Path, Expression, Soul Urge, Personality, personal year, and compatibility. Tarot: single card, three card, Celtic Cross, and the full 78 card catalog. Human design: bodygraph, type, authority, profile, centers, channels, and gates. Forecasts: timelines, transit forecasts, solar returns, and significant dates. Plus biorhythm, I Ching hexagrams, crystal reference data, dream symbols, and angel numbers. Each one has a Gutenberg block and a matching shortcode. Browse the full list inside WordPress under RoxyAPI, Shortcodes.
119+
One key covers 12 domains. Western astrology: natal chart, daily / weekly / monthly horoscopes, synastry, compatibility, transits, aspect patterns, and moon phases. Vedic astrology: kundli, KP chart, panchang, Vimshottari dasha, divisional charts, nakshatras, doshas (Manglik, Kaal Sarpa, Sade Sati), and classical yogas. Numerology: Life Path, Expression, Soul Urge, Personality, personal year, and compatibility. Tarot: single card, three card, Celtic Cross, and the full 78 card catalog. Human design: bodygraph, type, authority, profile, centers, channels, and gates. Forecasts: timelines, transit forecasts, solar returns, and significant dates. Plus biorhythm, I Ching hexagrams, crystal reference data, dream symbols, and angel numbers. Every reading is available as a shortcode. The chart and reading heroes plus the 125 long-tail endpoints also ship a matching Gutenberg block. Interactive multi input readings such as two chart compatibility and nested birth forms are shortcode and visitor form mode, because the block editor cannot collect their nested input. Browse the full list inside WordPress under RoxyAPI, Shortcodes.
74120

75121
= Can I show readings in another language? =
76122

roxyapi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323

2424
const ROXYAPI_VERSION = '1.3.1';
25-
const ROXYAPI_UI_VERSION = '0.10.0';
25+
const ROXYAPI_UI_VERSION = '0.11.0';
2626
const ROXYAPI_PHP_MIN = '7.4.0';
2727
const ROXYAPI_PLUGIN_FILE = __FILE__;
2828

0 commit comments

Comments
 (0)