@csszyx/types 0.5.0 → 0.6.1

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.
@@ -1,9 +1,7 @@
1
1
  // src/config.ts
2
2
  var DEFAULT_DEVELOPMENT_CONFIG = {
3
- autoInjectRecovery: false,
4
3
  strictMode: false,
5
- debug: false,
6
- allowCSRRecovery: true
4
+ debug: false
7
5
  };
8
6
  var DEFAULT_PRODUCTION_CONFIG = {
9
7
  mangle: true,
@@ -51,10 +51,6 @@ interface CompilerOptions {
51
51
  * Enable development mode features
52
52
  */
53
53
  development?: boolean;
54
- /**
55
- * Auto-inject recovery tokens
56
- */
57
- autoInjectRecovery?: boolean;
58
54
  /**
59
55
  * Strict mode - fail build on warnings
60
56
  */
package/dist/config.d.ts CHANGED
@@ -8,13 +8,6 @@
8
8
  * Development mode configuration options.
9
9
  */
10
10
  interface DevelopmentConfig {
11
- /**
12
- * Automatically inject recovery tokens for all components.
13
- * When enabled, all components get szRecover="dev-only" by default.
14
- *
15
- * @default false
16
- */
17
- autoInjectRecovery: boolean;
18
11
  /**
19
12
  * Enable strict mode - fail build on warnings.
20
13
  * When enabled, warnings are treated as errors.
@@ -28,13 +21,6 @@ interface DevelopmentConfig {
28
21
  * @default false
29
22
  */
30
23
  debug: boolean;
31
- /**
32
- * Allow client-side recovery on hydration mismatch.
33
- * Only works in development mode.
34
- *
35
- * @default true
36
- */
37
- allowCSRRecovery: boolean;
38
24
  }
39
25
  /**
40
26
  * Production mode configuration options.
package/dist/config.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  DEFAULT_PERFORMANCE_CONFIG,
7
7
  DEFAULT_PRODUCTION_CONFIG,
8
8
  getCurrentEnvironment
9
- } from "./chunk-2KLMBDLU.js";
9
+ } from "./chunk-IFAXISDF.js";
10
10
  export {
11
11
  DEFAULT_BUILD_CONFIG,
12
12
  DEFAULT_CSSZYX_CONFIG,
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { BuildConfig, CsszyxConfig, DEFAULT_BUILD_CONFIG, DEFAULT_CSSZYX_CONFIG, DEFAULT_DEVELOPMENT_CONFIG, DEFAULT_HYDRATION_CONFIG, DEFAULT_PERFORMANCE_CONFIG, DEFAULT_PRODUCTION_CONFIG, DevelopmentConfig, Environment, HydrationConfig, PartialCsszyxConfig, PerformanceConfig, ProductionConfig, getCurrentEnvironment } from './config.js';
2
2
  export { AuditLogEntry, ComponentPropsWithSz, CsszyxWindow, HydrationError, HydrationErrorType, MangleMap, MangleMapMetadata, PerformanceMetrics, RecoveryManifest, RecoveryMode, RuntimeState, SzProp, TokenData, VerificationResult, isCsszyxWindow } from './runtime.js';
3
3
  export { BuildPhase, BuildPhaseResult, BuildPhaseStatus, BuildResult, BuildStatistics, CacheEntry, CacheManager, CollisionResult, CompilerContext, CompilerOptions, CompilerPlugin, FileCompilationResult, GeneratedToken, MangleMapEntry, NodeLocation, TokenMetadata, TransformOptions, ValidationError, ValidationResult } from './compiler.js';
4
- import { SzPropValue } from '@csszyx/compiler';
4
+ import { SzPropValue, RecoveryMode } from '@csszyx/compiler';
5
5
  export { SzPropValue, SzProps } from '@csszyx/compiler';
6
6
 
7
7
  /**
@@ -75,6 +75,22 @@ declare module 'react' {
75
75
  * ```
76
76
  */
77
77
  sz?: SzPropValue;
78
+ /**
79
+ * Hydration recovery mode for the element. The csszyx unplugin
80
+ * compiles this attribute into a `data-sz-recovery-token` and
81
+ * registers the element in the SSR recovery manifest read by
82
+ * `@csszyx/runtime/verify` at hydration time.
83
+ *
84
+ * - `'csr'` — recovery permitted in both dev and production
85
+ * - `'dev-only'` — recovery permitted in development only;
86
+ * stripped from the production manifest at build time.
87
+ *
88
+ * @example
89
+ * ```tsx
90
+ * <section szRecover="csr">…</section>
91
+ * ```
92
+ */
93
+ szRecover?: RecoveryMode;
78
94
  }
79
95
 
80
96
  /**
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  DEFAULT_PERFORMANCE_CONFIG,
7
7
  DEFAULT_PRODUCTION_CONFIG,
8
8
  getCurrentEnvironment
9
- } from "./chunk-2KLMBDLU.js";
9
+ } from "./chunk-IFAXISDF.js";
10
10
  import {
11
11
  isCsszyxWindow
12
12
  } from "./chunk-QAJB64L5.js";
package/dist/jsx.d.ts CHANGED
@@ -10,9 +10,9 @@
10
10
 
11
11
  import 'react';
12
12
 
13
- import type { SzProps, SzPropValue } from '@csszyx/compiler';
13
+ import type { RecoveryMode, SzProps, SzPropValue } from '@csszyx/compiler';
14
14
 
15
- export type { SzProps, SzPropValue };
15
+ export type { RecoveryMode, SzProps, SzPropValue };
16
16
 
17
17
  declare module 'react' {
18
18
  /**
@@ -30,6 +30,22 @@ declare module 'react' {
30
30
  * ```
31
31
  */
32
32
  sz?: SzPropValue;
33
+ /**
34
+ * Hydration recovery mode for the element. The csszyx unplugin
35
+ * compiles this attribute into a `data-sz-recovery-token` and
36
+ * registers the element in the SSR recovery manifest read by
37
+ * `@csszyx/runtime/verify` at hydration time.
38
+ *
39
+ * - `'csr'` — recovery permitted in both dev and production
40
+ * - `'dev-only'` — recovery permitted in development only;
41
+ * stripped from the production manifest at build time.
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * <section szRecover="csr">…</section>
46
+ * ```
47
+ */
48
+ szRecover?: RecoveryMode;
33
49
  }
34
50
 
35
51
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/types",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "TypeScript definitions for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -50,7 +50,7 @@
50
50
  "@types/node": "^20.11.0",
51
51
  "tsup": "^8.0.0",
52
52
  "typescript": "^5.3.3",
53
- "@csszyx/compiler": "0.5.0"
53
+ "@csszyx/compiler": "0.6.0"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "tsup src/index.ts src/config.ts src/runtime.ts src/compiler.ts --format esm --dts && cp src/jsx.d.ts dist/jsx.d.ts",