@csszyx/runtime 0.10.5 → 0.10.7

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/index.cjs CHANGED
@@ -334,6 +334,7 @@ function transform(szProp) {
334
334
  function _sz(...classes) {
335
335
  return szJoin(classes, 0);
336
336
  }
337
+ const szr = _sz;
337
338
  function szJoin(classes, depth) {
338
339
  if (depth >= browser.MAX_SZ_DEPTH) {
339
340
  throw new browser.SzDepthError();
@@ -1376,6 +1377,9 @@ function mergeClassify(token) {
1376
1377
  if (!norm) {
1377
1378
  return null;
1378
1379
  }
1380
+ if (base.indexOf("--") > 0) {
1381
+ return null;
1382
+ }
1379
1383
  if (BOX_ROLE_TOKENS.has(norm)) {
1380
1384
  return null;
1381
1385
  }
@@ -1677,6 +1681,7 @@ exports.splitBoxSz = splitBoxSz;
1677
1681
  exports.startHydration = startHydration;
1678
1682
  exports.stripSzProps = stripSzProps;
1679
1683
  exports.szcn = szcn;
1684
+ exports.szr = szr;
1680
1685
  exports.szv = szv;
1681
1686
  exports.validateHydrationClass = validateHydrationClass;
1682
1687
  exports.verifyAllTokens = verifyAllTokens;
package/dist/index.d.cts CHANGED
@@ -43,6 +43,30 @@ type SzInput = string | SzObject | SzInput[] | null | undefined | false;
43
43
  * ```
44
44
  */
45
45
  declare function _sz(...classes: SzInput[]): string;
46
+ /**
47
+ * Resolve sz object(s) and/or class strings into a single className string,
48
+ * mangle-aware. This is the PUBLIC, hand-written name for the otherwise
49
+ * compiler-injected `_sz` helper (the `_` prefix marks compiler-generated code
50
+ * you should not hand-author; `szr` is the one you call by hand).
51
+ *
52
+ * Reach for `szr` when you build a className from `szv` factory output or sz
53
+ * objects — e.g. a split/layered design system that declares variants in a
54
+ * module and resolves them at the leaf:
55
+ *
56
+ * ```ts
57
+ * import { szr, szv } from '@csszyx/runtime';
58
+ * const cardSz = szv({ variants: { pad: { lg: { p: 8 } } } });
59
+ * const cls = szr(cardSz({ pad: 'lg' }), isWide && stackSz({ gap: 'xl' }));
60
+ * ```
61
+ *
62
+ * Falsy inputs are skipped (clsx-style). `szr` CONCATENATES (keeps every class);
63
+ * to combine with last-wins OVERRIDE on a same-utility conflict, use `szcn`.
64
+ * `szr` accepts sz OBJECTS; `szcn` accepts className STRINGS.
65
+ *
66
+ * @param classes - sz objects, class strings, or falsy values (skipped).
67
+ * @returns The resolved className string (mangled in a production build).
68
+ */
69
+ declare const szr: (...classes: SzInput[]) => string;
46
70
  /**
47
71
  * Merges className strings, removing duplicates.
48
72
  *
@@ -961,5 +985,5 @@ declare function isRuntimeInitialized(): boolean;
961
985
  */
962
986
  declare function resetRuntime(): void;
963
987
 
964
- export { DEFAULT_RUNTIME_CONFIG, VERSION, _sz, _sz2, _sz3, _szMerge, abortHydration, attemptCSRRecovery, classify, classifySzKey, clearHydrationErrors, computeMangleChecksumAsync, disableCSRRecovery, enableCSRRecovery, endHydration, getAbortedSubtreeCount, getHydrationErrors, getRecoveryMode, getRuntimeConfig, getSSRContext, guardHydration, has, hasRecoveryToken, hasSz, initRuntime, isCSRRecoveryAllowed, isHydrating, isHydrationAborted, isRuntimeInitialized, isSSREnvironment, isValidMangleMap, isValidManifest, loadMangleMapFromDOM, loadManifestFromDOM, omit, omitSz, pick, pickSz, resetRuntime, splitBox, splitBoxSz, startHydration, stripSzProps, szcn, szv, validateHydrationClass, verifyAllTokens, verifyMangleChecksum, verifyMangleChecksumAsync, verifyMangleMapIntegrity, verifyRecoveryToken };
988
+ export { DEFAULT_RUNTIME_CONFIG, VERSION, _sz, _sz2, _sz3, _szMerge, abortHydration, attemptCSRRecovery, classify, classifySzKey, clearHydrationErrors, computeMangleChecksumAsync, disableCSRRecovery, enableCSRRecovery, endHydration, getAbortedSubtreeCount, getHydrationErrors, getRecoveryMode, getRuntimeConfig, getSSRContext, guardHydration, has, hasRecoveryToken, hasSz, initRuntime, isCSRRecoveryAllowed, isHydrating, isHydrationAborted, isRuntimeInitialized, isSSREnvironment, isValidMangleMap, isValidManifest, loadMangleMapFromDOM, loadManifestFromDOM, omit, omitSz, pick, pickSz, resetRuntime, splitBox, splitBoxSz, startHydration, stripSzProps, szcn, szr, szv, validateHydrationClass, verifyAllTokens, verifyMangleChecksum, verifyMangleChecksumAsync, verifyMangleMapIntegrity, verifyRecoveryToken };
965
989
  export type { BoxRole, BoxSelector, Classification, HydrationError, HydrationErrorType, MangleMap, RecoveryManifest, RecoveryMode, RuntimeConfig, SSRContext, SplitBoxOptions, SplitBoxResult, SplitBoxSzOptions, SplitBoxSzResult, SzInput, TokenData, VerificationResult };
package/dist/index.d.mts CHANGED
@@ -43,6 +43,30 @@ type SzInput = string | SzObject | SzInput[] | null | undefined | false;
43
43
  * ```
44
44
  */
45
45
  declare function _sz(...classes: SzInput[]): string;
46
+ /**
47
+ * Resolve sz object(s) and/or class strings into a single className string,
48
+ * mangle-aware. This is the PUBLIC, hand-written name for the otherwise
49
+ * compiler-injected `_sz` helper (the `_` prefix marks compiler-generated code
50
+ * you should not hand-author; `szr` is the one you call by hand).
51
+ *
52
+ * Reach for `szr` when you build a className from `szv` factory output or sz
53
+ * objects — e.g. a split/layered design system that declares variants in a
54
+ * module and resolves them at the leaf:
55
+ *
56
+ * ```ts
57
+ * import { szr, szv } from '@csszyx/runtime';
58
+ * const cardSz = szv({ variants: { pad: { lg: { p: 8 } } } });
59
+ * const cls = szr(cardSz({ pad: 'lg' }), isWide && stackSz({ gap: 'xl' }));
60
+ * ```
61
+ *
62
+ * Falsy inputs are skipped (clsx-style). `szr` CONCATENATES (keeps every class);
63
+ * to combine with last-wins OVERRIDE on a same-utility conflict, use `szcn`.
64
+ * `szr` accepts sz OBJECTS; `szcn` accepts className STRINGS.
65
+ *
66
+ * @param classes - sz objects, class strings, or falsy values (skipped).
67
+ * @returns The resolved className string (mangled in a production build).
68
+ */
69
+ declare const szr: (...classes: SzInput[]) => string;
46
70
  /**
47
71
  * Merges className strings, removing duplicates.
48
72
  *
@@ -961,5 +985,5 @@ declare function isRuntimeInitialized(): boolean;
961
985
  */
962
986
  declare function resetRuntime(): void;
963
987
 
964
- export { DEFAULT_RUNTIME_CONFIG, VERSION, _sz, _sz2, _sz3, _szMerge, abortHydration, attemptCSRRecovery, classify, classifySzKey, clearHydrationErrors, computeMangleChecksumAsync, disableCSRRecovery, enableCSRRecovery, endHydration, getAbortedSubtreeCount, getHydrationErrors, getRecoveryMode, getRuntimeConfig, getSSRContext, guardHydration, has, hasRecoveryToken, hasSz, initRuntime, isCSRRecoveryAllowed, isHydrating, isHydrationAborted, isRuntimeInitialized, isSSREnvironment, isValidMangleMap, isValidManifest, loadMangleMapFromDOM, loadManifestFromDOM, omit, omitSz, pick, pickSz, resetRuntime, splitBox, splitBoxSz, startHydration, stripSzProps, szcn, szv, validateHydrationClass, verifyAllTokens, verifyMangleChecksum, verifyMangleChecksumAsync, verifyMangleMapIntegrity, verifyRecoveryToken };
988
+ export { DEFAULT_RUNTIME_CONFIG, VERSION, _sz, _sz2, _sz3, _szMerge, abortHydration, attemptCSRRecovery, classify, classifySzKey, clearHydrationErrors, computeMangleChecksumAsync, disableCSRRecovery, enableCSRRecovery, endHydration, getAbortedSubtreeCount, getHydrationErrors, getRecoveryMode, getRuntimeConfig, getSSRContext, guardHydration, has, hasRecoveryToken, hasSz, initRuntime, isCSRRecoveryAllowed, isHydrating, isHydrationAborted, isRuntimeInitialized, isSSREnvironment, isValidMangleMap, isValidManifest, loadMangleMapFromDOM, loadManifestFromDOM, omit, omitSz, pick, pickSz, resetRuntime, splitBox, splitBoxSz, startHydration, stripSzProps, szcn, szr, szv, validateHydrationClass, verifyAllTokens, verifyMangleChecksum, verifyMangleChecksumAsync, verifyMangleMapIntegrity, verifyRecoveryToken };
965
989
  export type { BoxRole, BoxSelector, Classification, HydrationError, HydrationErrorType, MangleMap, RecoveryManifest, RecoveryMode, RuntimeConfig, SSRContext, SplitBoxOptions, SplitBoxResult, SplitBoxSzOptions, SplitBoxSzResult, SzInput, TokenData, VerificationResult };
package/dist/index.mjs CHANGED
@@ -332,6 +332,7 @@ function transform(szProp) {
332
332
  function _sz(...classes) {
333
333
  return szJoin(classes, 0);
334
334
  }
335
+ const szr = _sz;
335
336
  function szJoin(classes, depth) {
336
337
  if (depth >= MAX_SZ_DEPTH) {
337
338
  throw new SzDepthError();
@@ -1374,6 +1375,9 @@ function mergeClassify(token) {
1374
1375
  if (!norm) {
1375
1376
  return null;
1376
1377
  }
1378
+ if (base.indexOf("--") > 0) {
1379
+ return null;
1380
+ }
1377
1381
  if (BOX_ROLE_TOKENS.has(norm)) {
1378
1382
  return null;
1379
1383
  }
@@ -1630,4 +1634,4 @@ function resetRuntime() {
1630
1634
  runtimeState.initialized = false;
1631
1635
  }
1632
1636
 
1633
- export { DEFAULT_RUNTIME_CONFIG, VERSION, _sz, _sz2, _sz3, _szMerge, abortHydration, attemptCSRRecovery, classify, classifySzKey, clearHydrationErrors, computeMangleChecksumAsync, disableCSRRecovery, enableCSRRecovery, endHydration, getAbortedSubtreeCount, getHydrationErrors, getRecoveryMode, getRuntimeConfig, getSSRContext, guardHydration, has, hasRecoveryToken, hasSz, initRuntime, isCSRRecoveryAllowed, isHydrating, isHydrationAborted, isRuntimeInitialized, isSSREnvironment, isValidMangleMap, isValidManifest, loadMangleMapFromDOM, loadManifestFromDOM, omit, omitSz, pick, pickSz, resetRuntime, splitBox, splitBoxSz, startHydration, stripSzProps, szcn, szv, validateHydrationClass, verifyAllTokens, verifyMangleChecksum, verifyMangleChecksumAsync, verifyMangleMapIntegrity, verifyRecoveryToken };
1637
+ export { DEFAULT_RUNTIME_CONFIG, VERSION, _sz, _sz2, _sz3, _szMerge, abortHydration, attemptCSRRecovery, classify, classifySzKey, clearHydrationErrors, computeMangleChecksumAsync, disableCSRRecovery, enableCSRRecovery, endHydration, getAbortedSubtreeCount, getHydrationErrors, getRecoveryMode, getRuntimeConfig, getSSRContext, guardHydration, has, hasRecoveryToken, hasSz, initRuntime, isCSRRecoveryAllowed, isHydrating, isHydrationAborted, isRuntimeInitialized, isSSREnvironment, isValidMangleMap, isValidManifest, loadMangleMapFromDOM, loadManifestFromDOM, omit, omitSz, pick, pickSz, resetRuntime, splitBox, splitBoxSz, startHydration, stripSzProps, szcn, szr, szv, validateHydrationClass, verifyAllTokens, verifyMangleChecksum, verifyMangleChecksumAsync, verifyMangleMapIntegrity, verifyRecoveryToken };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/runtime",
3
- "version": "0.10.5",
3
+ "version": "0.10.7",
4
4
  "description": "Runtime helpers and hydration guards for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -49,8 +49,8 @@
49
49
  "dist"
50
50
  ],
51
51
  "dependencies": {
52
- "@csszyx/compiler": "0.10.5",
53
- "@csszyx/core": "0.10.5"
52
+ "@csszyx/compiler": "0.10.7",
53
+ "@csszyx/core": "0.10.7"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^20.11.0",