@pyreon/rocketstyle 0.14.0 → 0.16.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/lib/index.d.ts +67 -12
- package/lib/index.js +94 -45
- package/package.json +12 -11
- package/src/__tests__/attrs-overloads.test.ts +97 -0
- package/src/__tests__/cache-key-boolean-collision.test.ts +54 -0
- package/src/__tests__/native-marker.test.ts +9 -0
- package/src/__tests__/rocketstyle.browser.test.tsx +221 -0
- package/src/__tests__/rocketstyleIntegration.test.ts +134 -0
- package/src/constants/index.ts +1 -4
- package/src/context/context.ts +5 -1
- package/src/env.d.ts +6 -0
- package/src/index.ts +2 -1
- package/src/rocketstyle.ts +177 -67
- package/src/types/attrs.ts +20 -10
- package/src/types/rocketstyle.ts +68 -19
- package/src/types/styles.ts +1 -1
- package/src/types/utils.ts +45 -2
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
package/src/rocketstyle.ts
CHANGED
|
@@ -18,9 +18,6 @@ import { calculateStyles } from './utils/styles'
|
|
|
18
18
|
import { getDimensionThemes, getTheme, getThemeByMode, getThemeFromChain } from './utils/theme'
|
|
19
19
|
|
|
20
20
|
// Dev-time counter sink — see packages/internals/perf-harness for contract.
|
|
21
|
-
interface ViteMeta {
|
|
22
|
-
readonly env?: { readonly DEV?: boolean }
|
|
23
|
-
}
|
|
24
21
|
const _countSink = globalThis as { __pyreon_count__?: (name: string, n?: number) => void }
|
|
25
22
|
|
|
26
23
|
/**
|
|
@@ -41,18 +38,42 @@ type CloneAndEnhance = (
|
|
|
41
38
|
opts: Partial<ExtendedConfiguration>,
|
|
42
39
|
) => ReturnType<typeof rocketComponent>
|
|
43
40
|
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Clones the current configuration and merges new options, returning a fresh
|
|
43
|
+
* rocketComponent.
|
|
44
|
+
*
|
|
45
|
+
* Component-swap reset: when `opts.component` is set AND differs from the
|
|
46
|
+
* current `defaultOpts.component`, the prior `attrs`, `priorityAttrs`,
|
|
47
|
+
* `filterAttrs`, and `compose` chains are dropped — they were tailored to the
|
|
48
|
+
* previous component's prop shape, and applying them to a different component
|
|
49
|
+
* silently leaks invalid props through to the DOM (e.g. `disabled` on an
|
|
50
|
+
* `<a>`). Callers who want to preserve them must re-chain explicitly:
|
|
51
|
+
*
|
|
52
|
+
* const NewBtn = Button.config({ component: 'a' }).attrs(sharedAttrs)
|
|
53
|
+
*/
|
|
54
|
+
const cloneAndEnhance: CloneAndEnhance = (defaultOpts, opts) => {
|
|
55
|
+
const componentChanged =
|
|
56
|
+
opts.component != null && opts.component !== defaultOpts.component
|
|
57
|
+
|
|
58
|
+
return rocketComponent({
|
|
47
59
|
...defaultOpts,
|
|
48
|
-
attrs:
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
attrs: componentChanged
|
|
61
|
+
? chainOptions(opts.attrs, [])
|
|
62
|
+
: chainOptions(opts.attrs, defaultOpts.attrs),
|
|
63
|
+
filterAttrs: componentChanged
|
|
64
|
+
? [...(opts.filterAttrs ?? [])]
|
|
65
|
+
: [...(defaultOpts.filterAttrs ?? []), ...(opts.filterAttrs ?? [])],
|
|
66
|
+
priorityAttrs: componentChanged
|
|
67
|
+
? chainOptions(opts.priorityAttrs, [])
|
|
68
|
+
: chainOptions(opts.priorityAttrs, defaultOpts.priorityAttrs),
|
|
51
69
|
statics: { ...defaultOpts.statics, ...opts.statics },
|
|
52
|
-
compose:
|
|
70
|
+
compose: componentChanged
|
|
71
|
+
? { ...opts.compose }
|
|
72
|
+
: { ...defaultOpts.compose, ...opts.compose },
|
|
53
73
|
...chainOrOptions(CONFIG_KEYS, opts, defaultOpts),
|
|
54
74
|
...chainReservedKeyOptions([...defaultOpts.dimensionKeys, ...STYLING_KEYS], opts, defaultOpts),
|
|
55
75
|
} as Parameters<typeof rocketComponent>[0])
|
|
76
|
+
}
|
|
56
77
|
|
|
57
78
|
// --------------------------------------------------------
|
|
58
79
|
// rocketComponent
|
|
@@ -114,6 +135,28 @@ const rocketComponent: RocketComponent = (options) => {
|
|
|
114
135
|
// dimension-dependent reserved keys are known (first mount), then reused.
|
|
115
136
|
const _omitSetCache = new WeakMap<string[], Set<string>>()
|
|
116
137
|
|
|
138
|
+
// ── Dimension-prop memo (per-definition) ─────────────────────────────
|
|
139
|
+
// Keyed on theme identity → Map<keyString, { rocketstyle, rocketstate }>.
|
|
140
|
+
// The accessors below build a key from (mode, dimension prop tuple,
|
|
141
|
+
// pseudo state tuple) and look up here. On hit they return the SAME
|
|
142
|
+
// object identities for both `$rocketstyle` and `$rocketstate`, which
|
|
143
|
+
// lets the styler's existing `classCache` (keyed on those identities)
|
|
144
|
+
// skip the entire CSS resolve pipeline. On miss they compute fresh
|
|
145
|
+
// and store the result.
|
|
146
|
+
//
|
|
147
|
+
// Why this matters: B-FINDING.md (PR #342) showed every Button mount
|
|
148
|
+
// fires 22 styler.resolve calls even when the styler-sheet cache hits
|
|
149
|
+
// — the cache catches at the LAST step (insert dedup), but the resolve
|
|
150
|
+
// pipeline still runs to compute the hash. Stable accessor identities
|
|
151
|
+
// mean the styler's classCache hits earlier and the resolves don't run.
|
|
152
|
+
//
|
|
153
|
+
// LRU bound prevents unbounded growth from prop-tuple churn (e.g. a
|
|
154
|
+
// table where every cell has a unique state). 32 entries per theme
|
|
155
|
+
// covers ~99% of unique combos in real apps.
|
|
156
|
+
type RsMemoEntry = { readonly rocketstyle: object; readonly rocketstate: object }
|
|
157
|
+
const _rsMemo = new WeakMap<object, Map<string, RsMemoEntry>>()
|
|
158
|
+
const RS_MEMO_CAP = 32
|
|
159
|
+
|
|
117
160
|
// --------------------------------------------------------
|
|
118
161
|
// COMPOSE - high-order components
|
|
119
162
|
// --------------------------------------------------------
|
|
@@ -171,7 +214,7 @@ const rocketComponent: RocketComponent = (options) => {
|
|
|
171
214
|
// of the same component definition share the same dimension structure.
|
|
172
215
|
let dimResult = _dimensionsCache.get(initialDimensionThemes as object)
|
|
173
216
|
if (dimResult) {
|
|
174
|
-
if (
|
|
217
|
+
if (process.env.NODE_ENV !== 'production')
|
|
175
218
|
_countSink.__pyreon_count__?.('rocketstyle.dimensionsMap.hit')
|
|
176
219
|
} else {
|
|
177
220
|
dimResult = getDimensionsMap({
|
|
@@ -189,28 +232,113 @@ const rocketComponent: RocketComponent = (options) => {
|
|
|
189
232
|
_reservedKeysCache.set(reservedPropNames as object, RESERVED_STYLING_PROPS_KEYS)
|
|
190
233
|
}
|
|
191
234
|
|
|
235
|
+
// Silence "unused" warnings for initialBaseTheme / initialDimensionThemes —
|
|
236
|
+
// they're eagerly populated into ThemeManager caches so the first accessor
|
|
237
|
+
// call hits cache, but not referenced directly.
|
|
238
|
+
void initialBaseTheme
|
|
239
|
+
void initialDimensionThemes
|
|
240
|
+
|
|
241
|
+
// Capture pseudo from localCtx once at setup — pseudo properties are
|
|
242
|
+
// getters (from createLocalProvider) that read signals lazily.
|
|
243
|
+
// Passing them through preserves reactivity without subscribing here.
|
|
244
|
+
const localPseudo = localCtx?.pseudo
|
|
245
|
+
|
|
192
246
|
// --------------------------------------------------
|
|
193
|
-
//
|
|
194
|
-
//
|
|
195
|
-
//
|
|
196
|
-
// (
|
|
247
|
+
// Shared accessor resolver.
|
|
248
|
+
//
|
|
249
|
+
// Both `$rocketstyleAccessor` and `$rocketstateAccessor` derive from the
|
|
250
|
+
// same input set (theme, mode, dimension props, pseudo state). Folding
|
|
251
|
+
// them into one resolver lets the dimension-prop memo return the SAME
|
|
252
|
+
// object identities for both — which is what the styler's `classCache`
|
|
253
|
+
// (keyed on `(rocketstyle, rocketstate)` identity) needs to skip the
|
|
254
|
+
// resolve pipeline on cache hit.
|
|
255
|
+
//
|
|
256
|
+
// Reactive contract: this runs inside the styler's `computed()` (one per
|
|
257
|
+
// mounted instance). All signal reads — theme, mode, dimension props,
|
|
258
|
+
// pseudo getters from localCtx — are TRACKED, so any change re-runs the
|
|
259
|
+
// computed which re-resolves the entry. Same key → cached entry; new key
|
|
260
|
+
// → fresh computation, stored under LRU cap.
|
|
197
261
|
// --------------------------------------------------
|
|
198
|
-
const
|
|
199
|
-
|
|
262
|
+
const _resolveRsEntry = (): RsMemoEntry => {
|
|
263
|
+
// Read reactive inputs (tracks theme + mode signals)
|
|
264
|
+
const theme = themeAttrs.theme
|
|
265
|
+
const mode = themeAttrs.mode
|
|
266
|
+
const propsRec = props as Record<string, unknown>
|
|
267
|
+
|
|
268
|
+
// Resolve active dimensions FIRST so the cache key uses the RESOLVED
|
|
269
|
+
// dimension values, not the raw prop names. Under `useBooleans: true`
|
|
270
|
+
// the user writes `<X primary />` / `<X secondary />` — both map to
|
|
271
|
+
// `state="primary"` / `state="secondary"` after _calculateStylingAttrs
|
|
272
|
+
// resolves the boolean shorthand. Keying off `propsRec[dimName]` would
|
|
273
|
+
// read `undefined` for both (the dimension prop itself was never set)
|
|
274
|
+
// and collide every variant onto the first cached entry. Reading
|
|
275
|
+
// `rocketstateRaw[dimName]` gives the resolved string and partitions
|
|
276
|
+
// them correctly.
|
|
277
|
+
// Resolved from props (not localCtx which has pseudo getters).
|
|
278
|
+
const rocketstateRaw = _calculateStylingAttrs({
|
|
279
|
+
props: pickStyledAttrs(propsRec, reservedPropNames),
|
|
280
|
+
dimensions,
|
|
281
|
+
})
|
|
282
|
+
|
|
283
|
+
// Build key: mode | dimensionValues | pseudoState. Reading dimension
|
|
284
|
+
// props + pseudo signals here tracks them in the surrounding computed
|
|
285
|
+
// so any change re-runs us with a different key.
|
|
286
|
+
let key = mode as string
|
|
287
|
+
for (const dimName in dimensions) {
|
|
288
|
+
const v = rocketstateRaw[dimName]
|
|
289
|
+
// Multi-key dimensions (e.g. variant={['primary', 'rounded']}) are
|
|
290
|
+
// arrays. Sort + join so equivalent sets hash identically; without
|
|
291
|
+
// this both `['a','b']` and `['b','a']` would produce different keys.
|
|
292
|
+
if (Array.isArray(v)) {
|
|
293
|
+
key +=
|
|
294
|
+
'|' + (v.length === 0 ? '' : (v as unknown[]).slice().sort().join(','))
|
|
295
|
+
} else {
|
|
296
|
+
// String/number/boolean serialize directly. Anything else (including
|
|
297
|
+
// undefined / objects) gets a typeof tag so we don't collide.
|
|
298
|
+
key +=
|
|
299
|
+
'|' +
|
|
300
|
+
(typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean'
|
|
301
|
+
? String(v)
|
|
302
|
+
: v === undefined
|
|
303
|
+
? ''
|
|
304
|
+
: '~' + typeof v)
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
for (const k of ALL_PSEUDO_KEYS) {
|
|
308
|
+
const propV = propsRec[k]
|
|
309
|
+
const localV = localPseudo?.[k as keyof typeof localPseudo]
|
|
310
|
+
const v = propV !== undefined ? propV : localV
|
|
311
|
+
key += '|' + (v === undefined ? '' : v ? '1' : '0')
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Cache lookup
|
|
315
|
+
let themeMemo = _rsMemo.get(theme as object)
|
|
316
|
+
if (!themeMemo) {
|
|
317
|
+
themeMemo = new Map()
|
|
318
|
+
_rsMemo.set(theme as object, themeMemo)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const cached = themeMemo.get(key)
|
|
322
|
+
if (cached) {
|
|
323
|
+
if (process.env.NODE_ENV !== 'production')
|
|
324
|
+
_countSink.__pyreon_count__?.('rocketstyle.dimensionMemo.hit')
|
|
325
|
+
// LRU touch: move to end so eviction targets oldest unused entry
|
|
326
|
+
themeMemo.delete(key)
|
|
327
|
+
themeMemo.set(key, cached)
|
|
328
|
+
return cached
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Miss: compute fresh. Counter measures actual theme resolutions
|
|
332
|
+
// (not accessor invocations) — see COUNTERS.md.
|
|
333
|
+
if (process.env.NODE_ENV !== 'production')
|
|
200
334
|
_countSink.__pyreon_count__?.('rocketstyle.getTheme')
|
|
201
|
-
// Read theme + mode LAZILY via the getter-backed themeAttrs object.
|
|
202
|
-
// Both reads are tracked when this accessor runs inside a reactive
|
|
203
|
-
// scope (styler's effect), so theme swap / mode toggle re-runs the
|
|
204
|
-
// surrounding resolver and swaps the generated class.
|
|
205
|
-
const theme = themeAttrs.theme // reactive: tracks theme signal
|
|
206
|
-
const mode = themeAttrs.mode // reactive: tracks mode signal
|
|
207
335
|
|
|
208
336
|
// Resolve base + dimension themes for the CURRENT theme. WeakMap
|
|
209
337
|
// keyed on theme identity — stable-theme renders hit cache in O(1),
|
|
210
338
|
// theme swaps fall through to recompute (once per new theme).
|
|
211
339
|
const baseThemeHelper = ThemeManager.baseTheme
|
|
212
340
|
if (baseThemeHelper.has(theme)) {
|
|
213
|
-
if (
|
|
341
|
+
if (process.env.NODE_ENV !== 'production')
|
|
214
342
|
_countSink.__pyreon_count__?.('rocketstyle.localThemeManager.hit')
|
|
215
343
|
} else {
|
|
216
344
|
baseThemeHelper.set(theme, getThemeFromChain(options.theme, theme))
|
|
@@ -219,23 +347,17 @@ const rocketComponent: RocketComponent = (options) => {
|
|
|
219
347
|
|
|
220
348
|
const dimHelper = ThemeManager.dimensionsThemes
|
|
221
349
|
if (dimHelper.has(theme)) {
|
|
222
|
-
if (
|
|
350
|
+
if (process.env.NODE_ENV !== 'production')
|
|
223
351
|
_countSink.__pyreon_count__?.('rocketstyle.localThemeManager.hit')
|
|
224
352
|
} else {
|
|
225
353
|
dimHelper.set(theme, getDimensionThemes(theme, options))
|
|
226
354
|
}
|
|
227
355
|
const themes = dimHelper.get(theme)
|
|
228
356
|
|
|
229
|
-
// Resolve active dimensions from props (not localCtx which has pseudo getters)
|
|
230
|
-
const rocketstate = _calculateStylingAttrs({
|
|
231
|
-
props: pickStyledAttrs(props as Record<string, unknown>, reservedPropNames),
|
|
232
|
-
dimensions,
|
|
233
|
-
})
|
|
234
|
-
|
|
235
357
|
// Resolve mode-specific theme
|
|
236
358
|
const modeBaseHelper = ThemeManager.modeBaseTheme[mode]
|
|
237
359
|
if (modeBaseHelper.has(baseTheme)) {
|
|
238
|
-
if (
|
|
360
|
+
if (process.env.NODE_ENV !== 'production')
|
|
239
361
|
_countSink.__pyreon_count__?.('rocketstyle.localThemeManager.hit')
|
|
240
362
|
} else {
|
|
241
363
|
modeBaseHelper.set(baseTheme, getThemeByMode(baseTheme, mode))
|
|
@@ -244,54 +366,42 @@ const rocketComponent: RocketComponent = (options) => {
|
|
|
244
366
|
|
|
245
367
|
const modeDimHelper = ThemeManager.modeDimensionTheme[mode]
|
|
246
368
|
if (modeDimHelper.has(themes)) {
|
|
247
|
-
if (
|
|
369
|
+
if (process.env.NODE_ENV !== 'production')
|
|
248
370
|
_countSink.__pyreon_count__?.('rocketstyle.localThemeManager.hit')
|
|
249
371
|
} else {
|
|
250
372
|
modeDimHelper.set(themes, getThemeByMode(themes, mode))
|
|
251
373
|
}
|
|
252
374
|
const currentModeThemes = modeDimHelper.get(themes)
|
|
253
375
|
|
|
254
|
-
|
|
255
|
-
rocketstate,
|
|
376
|
+
const rocketstyle = getTheme({
|
|
377
|
+
rocketstate: rocketstateRaw,
|
|
256
378
|
themes: currentModeThemes,
|
|
257
379
|
baseTheme: currentModeBaseTheme,
|
|
258
380
|
transformKeys: options.transformKeys,
|
|
259
381
|
appTheme: theme,
|
|
260
382
|
})
|
|
261
|
-
}
|
|
262
383
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
// --------------------------------------------------
|
|
270
|
-
// $rocketstate as a FUNCTION ACCESSOR — reactive on prop changes.
|
|
271
|
-
// Re-evaluates active dimensions + pseudo state from current props.
|
|
272
|
-
// --------------------------------------------------
|
|
273
|
-
// Capture pseudo from localCtx once at setup — pseudo properties are
|
|
274
|
-
// getters (from createLocalProvider) that read signals lazily.
|
|
275
|
-
// Passing them through preserves reactivity without subscribing here.
|
|
276
|
-
const localPseudo = localCtx?.pseudo
|
|
277
|
-
|
|
278
|
-
const $rocketstateAccessor = () => {
|
|
279
|
-
const rocketstate = _calculateStylingAttrs({
|
|
280
|
-
props: pickStyledAttrs(props as Record<string, unknown>, reservedPropNames),
|
|
281
|
-
dimensions,
|
|
282
|
-
})
|
|
283
|
-
|
|
284
|
-
// Read pseudo props fresh each call — props may have reactive getters
|
|
285
|
-
// from _rp() wrapping. Reading inside the accessor (which runs in an
|
|
286
|
-
// effect) ensures changes to pseudo props like active={isDark()} are tracked.
|
|
287
|
-
const propPseudo = pick(props, ALL_PSEUDO_KEYS)
|
|
288
|
-
|
|
289
|
-
return {
|
|
290
|
-
...rocketstate,
|
|
384
|
+
// $rocketstate carries dimension state + pseudo flags so the styler
|
|
385
|
+
// emits matching pseudo selectors (`:hover`, `:focus`, etc.).
|
|
386
|
+
const propPseudo = pick(propsRec, ALL_PSEUDO_KEYS)
|
|
387
|
+
const rocketstate = {
|
|
388
|
+
...rocketstateRaw,
|
|
291
389
|
pseudo: { ...localPseudo, ...propPseudo },
|
|
292
390
|
}
|
|
391
|
+
|
|
392
|
+
// LRU eviction at cap — drop the oldest (first-inserted) entry.
|
|
393
|
+
if (themeMemo.size >= RS_MEMO_CAP) {
|
|
394
|
+
const oldestKey = themeMemo.keys().next().value
|
|
395
|
+
if (oldestKey !== undefined) themeMemo.delete(oldestKey)
|
|
396
|
+
}
|
|
397
|
+
const entry: RsMemoEntry = { rocketstyle, rocketstate }
|
|
398
|
+
themeMemo.set(key, entry)
|
|
399
|
+
return entry
|
|
293
400
|
}
|
|
294
401
|
|
|
402
|
+
const $rocketstyleAccessor = () => _resolveRsEntry().rocketstyle
|
|
403
|
+
const $rocketstateAccessor = () => _resolveRsEntry().rocketstate
|
|
404
|
+
|
|
295
405
|
// --------------------------------------------------
|
|
296
406
|
// final props passed to WrappedComponent
|
|
297
407
|
// --------------------------------------------------
|
|
@@ -299,7 +409,7 @@ const rocketComponent: RocketComponent = (options) => {
|
|
|
299
409
|
// the key array on every mount. Same dimension structure = same Set.
|
|
300
410
|
let omitSet = _omitSetCache.get(RESERVED_STYLING_PROPS_KEYS)
|
|
301
411
|
if (omitSet) {
|
|
302
|
-
if (
|
|
412
|
+
if (process.env.NODE_ENV !== 'production')
|
|
303
413
|
_countSink.__pyreon_count__?.('rocketstyle.omitSet.hit')
|
|
304
414
|
} else {
|
|
305
415
|
omitSet = new Set([...RESERVED_STYLING_PROPS_KEYS, ...STATIC_OMIT_KEYS])
|
|
@@ -460,8 +570,8 @@ const rocketComponent: RocketComponent = (options) => {
|
|
|
460
570
|
{
|
|
461
571
|
render,
|
|
462
572
|
mode,
|
|
463
|
-
isDark: mode === '
|
|
464
|
-
isLight: mode === '
|
|
573
|
+
isDark: mode === 'dark',
|
|
574
|
+
isLight: mode === 'light',
|
|
465
575
|
},
|
|
466
576
|
]),
|
|
467
577
|
})
|
package/src/types/attrs.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import type { render } from '@pyreon/ui-core'
|
|
2
2
|
import type { ThemeModeKeys } from './theme'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
) =>
|
|
4
|
+
/** Helpers object passed as the 3rd arg to every `.attrs(callback)`. */
|
|
5
|
+
export type AttrsHelpers = {
|
|
6
|
+
mode?: ThemeModeKeys
|
|
7
|
+
isDark?: boolean
|
|
8
|
+
isLight?: boolean
|
|
9
|
+
createElement: typeof render
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Callback signature for `.attrs((props, theme, helpers) => …)`.
|
|
14
|
+
*
|
|
15
|
+
* `Partial<A>` on the return is for the strict-typing form when callers
|
|
16
|
+
* pass `AttrsCb<DFP, Theme<T>>` directly. In the rocketstyle `.attrs()`
|
|
17
|
+
* callback overload itself we use a different shape that decouples the
|
|
18
|
+
* props arg (narrow, full DFP) from the return type (loose — only the
|
|
19
|
+
* user's explicit `<P>` generic is checked, with `Record<string,
|
|
20
|
+
* unknown>` allowing runtime extras like `_documentProps`). See
|
|
21
|
+
* `IRocketStyleComponent.attrs` for the call-site shape.
|
|
22
|
+
*/
|
|
23
|
+
export type AttrsCb<A, T> = (props: Partial<A>, theme: T, helpers: AttrsHelpers) => Partial<A>
|
package/src/types/rocketstyle.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VNodeChild } from '@pyreon/core'
|
|
2
|
-
import type {
|
|
2
|
+
import type { AttrsHelpers } from './attrs'
|
|
3
3
|
import type { ConfigAttrs } from './config'
|
|
4
4
|
import type { DefaultProps } from './configuration'
|
|
5
5
|
import type {
|
|
@@ -76,7 +76,27 @@ export interface IRocketStyleComponent<
|
|
|
76
76
|
// dimension key props
|
|
77
77
|
DKP extends TDKP = TDKP,
|
|
78
78
|
// calculated final props
|
|
79
|
-
|
|
79
|
+
//
|
|
80
|
+
// `OA extends infer O` distributes over OA's union branches — future-proofs
|
|
81
|
+
// against the overload-aware `ExtractProps` (follow-up PR); for today's
|
|
82
|
+
// single-typed OA the distribution collapses to a single branch.
|
|
83
|
+
//
|
|
84
|
+
// **OA-overlapping EA keys are widened**. When `.attrs({ tag: 'a' })` sets
|
|
85
|
+
// a default for `tag` on a wrapper whose OA has `tag: HTMLTags`, we strip
|
|
86
|
+
// `tag` from OA and re-add it as `Partial<Pick<O, 'tag'>>` — taking O's
|
|
87
|
+
// WIDER type (`HTMLTags`), not EA's narrow literal `'a'`. The runtime
|
|
88
|
+
// default is `'a'`; the JSX call site still accepts any `HTMLTags` value
|
|
89
|
+
// (so `<Btn tag="span" />` is valid). `Partial<Omit<EA, keyof O>>` handles
|
|
90
|
+
// net-new EA-only keys (no OA conflict) and marks them optional too —
|
|
91
|
+
// every `.attrs()` value is semantically a default, never required of the
|
|
92
|
+
// consumer. Mirrors vitus-labs/ui-system PR #225.
|
|
93
|
+
DFP = OA extends infer O
|
|
94
|
+
? Omit<O, keyof EA & keyof O> &
|
|
95
|
+
Partial<Pick<O, keyof EA & keyof O>> &
|
|
96
|
+
MergeTypes<
|
|
97
|
+
[Partial<Omit<EA, keyof O>>, DefaultProps, ExtractDimensionProps<D, DKP, UB>]
|
|
98
|
+
>
|
|
99
|
+
: never,
|
|
80
100
|
> {
|
|
81
101
|
// The component is callable — Pyreon components are plain functions
|
|
82
102
|
(props: DFP): VNodeChild
|
|
@@ -95,23 +115,52 @@ export interface IRocketStyleComponent<
|
|
|
95
115
|
: RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>
|
|
96
116
|
|
|
97
117
|
// ATTRS chaining method
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
//
|
|
119
|
+
// Two overloads. TS resolves in declaration order; the callback form is
|
|
120
|
+
// listed FIRST so a function argument matches it before falling through to
|
|
121
|
+
// the object form. Mirrors vitus-labs/ui-system PR #227 Issue 2 (callback
|
|
122
|
+
// overload split).
|
|
123
|
+
//
|
|
124
|
+
// **Callback overload — asymmetric props/return**: the `props` arg is
|
|
125
|
+
// typed strictly as `Partial<DFP & P>` (so reading `props.x` narrows
|
|
126
|
+
// against the wrapped component's full surface), while the RETURN is
|
|
127
|
+
// `Partial<P> & Record<string, unknown>` — only the user's explicit `<P>`
|
|
128
|
+
// generic is checked, with a wildcard for runtime extras. This preserves
|
|
129
|
+
// Pyreon's documented convention where `.attrs(callback)` returns can
|
|
130
|
+
// carry runtime-only fields (`_documentProps` markers for the document-
|
|
131
|
+
// export pipeline, `tag: 'a'` overrides on Text-based components where
|
|
132
|
+
// the rendered DOM tag is outside the component's narrow `tag` union,
|
|
133
|
+
// etc.). The runtime is loose by design — `.attrs(cb, { filter })`
|
|
134
|
+
// strips keys before forwarding to the DOM. Consumers wanting strict
|
|
135
|
+
// typed extras pass `<P>` with the precise keys they expect.
|
|
136
|
+
//
|
|
137
|
+
// **Object overload — `P & Partial<NoInfer<DFP>>`**: TS infers P from
|
|
138
|
+
// the param's keys. `NoInfer<DFP>` (TS 5.4+) prevents DFP from
|
|
139
|
+
// contributing to P inference. Combined with DFP widening above, this
|
|
140
|
+
// makes `.attrs({ tag: 'a' })` keys optional at the JSX call site —
|
|
141
|
+
// every `.attrs()` value is a default, not a required prop. Mirrors
|
|
142
|
+
// vitus-labs PR #225.
|
|
143
|
+
attrs: {
|
|
144
|
+
<P extends TObj = {}>(
|
|
145
|
+
param: (
|
|
146
|
+
props: Partial<DFP & P>,
|
|
147
|
+
theme: Theme<T>,
|
|
148
|
+
helpers: AttrsHelpers,
|
|
149
|
+
) => Partial<P> & Record<string, unknown>,
|
|
150
|
+
config?: Partial<{
|
|
151
|
+
priority: boolean
|
|
152
|
+
filter: (keyof MergeTypes<[EA, P]>)[]
|
|
153
|
+
}>,
|
|
154
|
+
): RocketStyleComponent<OA, MergeTypes<[EA, P]>, T, CSS, S, HOC, D, UB, DKP>
|
|
155
|
+
|
|
156
|
+
<P extends TObj = {}>(
|
|
157
|
+
param: P & Partial<NoInfer<DFP>>,
|
|
158
|
+
config?: Partial<{
|
|
159
|
+
priority: boolean
|
|
160
|
+
filter: (keyof MergeTypes<[EA, P]>)[]
|
|
161
|
+
}>,
|
|
162
|
+
): RocketStyleComponent<OA, MergeTypes<[EA, P]>, T, CSS, S, HOC, D, UB, DKP>
|
|
163
|
+
}
|
|
115
164
|
|
|
116
165
|
// THEME chaining method
|
|
117
166
|
theme: <P extends TObj = TObj>(
|
package/src/types/styles.ts
CHANGED
package/src/types/utils.ts
CHANGED
|
@@ -51,5 +51,48 @@ export type Spread<A extends readonly [...any]> = A extends [infer L, ...infer R
|
|
|
51
51
|
export type MergeTypes<A extends readonly [...any]> = ExtractNullableKeys<Spread<A>>
|
|
52
52
|
|
|
53
53
|
// ─── ExtractProps ─────────────────────────────────────────────
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Extracts the props type from a Pyreon component function — or passes
|
|
56
|
+
* through the input unchanged when it's already a props type.
|
|
57
|
+
*
|
|
58
|
+
* Multi-overload aware: matches up to 4 call signatures and produces the
|
|
59
|
+
* UNION of their first-argument types. A single-overload function still
|
|
60
|
+
* works (the union of 4 copies of the same props type dedupes back to
|
|
61
|
+
* the single shape).
|
|
62
|
+
*
|
|
63
|
+
* **Why this shape**. `T extends (props: infer P) => any ? P : never` only
|
|
64
|
+
* captures the LAST overload of a multi-overload function — TS's overload-
|
|
65
|
+
* resolution-against-conditional-types semantics. Iterator / List / Element
|
|
66
|
+
* are 3-overload primitives where the LAST overload (`ChildrenProps`) is the
|
|
67
|
+
* loosest; without overload-aware extraction, `ExtractProps<Iterator>`
|
|
68
|
+
* returned just `ChildrenProps` and lost both `SimpleProps<T>` and
|
|
69
|
+
* `ObjectProps<T>` — wrapping Iterator through `rocketstyle()` /
|
|
70
|
+
* `attrs()` silently downgraded the public prop surface.
|
|
71
|
+
*
|
|
72
|
+
* The pattern-match shape `T extends { (props: infer P1, ...args: any): any;
|
|
73
|
+
* (props: infer P2, ...args: any): any; ... }` is the canonical TS trick
|
|
74
|
+
* for extracting overload sets — see also `Parameters<T>` semantics.
|
|
75
|
+
*
|
|
76
|
+
* Mirrors vitus-labs PR #222.
|
|
77
|
+
*/
|
|
78
|
+
export type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends {
|
|
79
|
+
(props: infer P1, ...args: any): any
|
|
80
|
+
(props: infer P2, ...args: any): any
|
|
81
|
+
(props: infer P3, ...args: any): any
|
|
82
|
+
(props: infer P4, ...args: any): any
|
|
83
|
+
}
|
|
84
|
+
? P1 | P2 | P3 | P4
|
|
85
|
+
: TComponentOrTProps extends {
|
|
86
|
+
(props: infer P1, ...args: any): any
|
|
87
|
+
(props: infer P2, ...args: any): any
|
|
88
|
+
(props: infer P3, ...args: any): any
|
|
89
|
+
}
|
|
90
|
+
? P1 | P2 | P3
|
|
91
|
+
: TComponentOrTProps extends {
|
|
92
|
+
(props: infer P1, ...args: any): any
|
|
93
|
+
(props: infer P2, ...args: any): any
|
|
94
|
+
}
|
|
95
|
+
? P1 | P2
|
|
96
|
+
: TComponentOrTProps extends ComponentFn<infer TProps>
|
|
97
|
+
? TProps
|
|
98
|
+
: TComponentOrTProps
|
package/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index2.d.ts","names":[],"sources":["../../src/context/context.ts","../../src/constants/defaultDimensions.ts","../../src/types/pseudo.ts","../../src/types/utils.ts","../../src/types/styles.ts","../../src/constants/index.ts","../../src/types/theme.ts","../../src/types/dimensions.ts","../../src/types/config.ts","../../src/types/configuration.ts","../../src/types/attrs.ts","../../src/types/hoc.ts","../../src/types/rocketstyle.ts","../../src/types/rocketComponent.ts","../../src/init.ts","../../src/isRocketComponent.ts","../../src/index.ts"],"mappings":";;;;;KAKK,OAAA;EACH,QAAA;EACA,WAAA,GAAc,MAAA;AAAA,IACZ,MAAA;AAAA,KAEQ,SAAA;EACV,QAAA,EAAU,UAAA;EACV,KAAA,GAAQ,OAAA;EACR,IAAA;EACA,QAAA;EACA,QAAA,KAAa,KAAA,EAAO,MAAA,sBAA4B,UAAA;AAAA;;;AALlD;;;;;cAeM,QAAA;EAAY,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAAiD,SAAA,KAAY,UAAA;;;;;;;;cCpBzE,kBAAA;EAAA;;;;;;;;;;;;;KAeM,iBAAA,UAA2B,kBAAA;;;KCpB3B,aAAA;EACV,YAAA,GAAe,CAAA,EAAG,UAAA;EAClB,YAAA,GAAe,CAAA,EAAG,UAAA;EAClB,WAAA,GAAc,CAAA,EAAG,UAAA;EACjB,SAAA,GAAY,CAAA,EAAG,UAAA;EACf,OAAA,GAAU,CAAA,EAAG,UAAA;EACb,MAAA,GAAS,CAAA,EAAG,UAAA;AAAA;AAAA,KAGF,WAAA;EACV,MAAA;EACA,KAAA;EACA,KA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