@takazudo/zdtp 0.4.11 → 0.4.12

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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.12
4
+
5
+ ### Fixed
6
+
7
+ - fix(doc): stabilize generated skill links (142420c)
8
+
9
+ ### Other Changes
10
+
11
+ - Merge pull request [#599](https://github.com/Takazudo/zudo-design-token-panel/pull/599) from Takazudo/base/sweep-260820: Complete portable storage and documentation refresh (1d78e89)
12
+ - Merge pull request [#609](https://github.com/Takazudo/zudo-design-token-panel/pull/609) from Takazudo/base/sweep-260820-zudo-doc-refresh: Refresh documentation site on zudo-doc 5.7 (157d736)
13
+ - Merge topic/zudo-doc-integration into zudo-doc refresh epic (5c199a0)
14
+ - Merge topic/zudo-doc-content into zudo-doc refresh epic (0b14ccf)
15
+ - docs: fix reviewed cross-locale links (0bc0081)
16
+ - docs: migrate bilingual zudo content (c572f05)
17
+ - Merge topic/zudo-doc-branding into zudo-doc refresh epic (e2e2cca)
18
+ - Brand zudo-doc hero and social metadata (b5c625f)
19
+ - Merge topic/zudo-doc-foundation-gate into zudo-doc refresh epic (68784c3)
20
+ - Harden deploy audit against missing workspaces (30c12c0)
21
+ - Fix deploy audit panel workspace filter (b494335)
22
+ - Merge topic/zudo-doc-scaffold into zudo-doc refresh epic (a0addac)
23
+ - Avoid missing branded favicon asset (f73995e)
24
+ - Rescaffold docs with zudo-doc 5.7 (6079124)
25
+ - = start zudo-doc refresh epic = [skip ci] (e3479d5)
26
+ - Merge pull request [#608](https://github.com/Takazudo/zudo-design-token-panel/pull/608) from Takazudo/base/sweep-260820-portable-storage-contract: Sync portable storage contract to state-v4 (b7997de)
27
+ - Merge branch 'topic/portable-contract-v4' into base/sweep-260820-portable-storage-contract (e6a27b8)
28
+ - docs(zdtp): document v4 portable storage contract (511f6fe)
29
+ - = start portable storage contract epic = [skip ci] (1605c3e)
30
+ - = start sweep-260820 super-epic = [skip ci] (c29cc50)
31
+
3
32
  ## 0.4.11
4
33
 
5
34
  ### Features
@@ -264,9 +264,10 @@ derives the keys at runtime from this single base.
264
264
 
265
265
  | Logical key | Derivation | Owner | Purpose |
266
266
  | ----------- | --------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
267
- | `state-v3` | `${storagePrefix}-state-v3` | tweak-state | Current unified envelope: tabs map + color + spacing + typography + size + panelPosition. Added `tabs` map for generic host-coined tabs. |
268
- | `state-v2` | `${storagePrefix}-state-v2` | tweak-state (legacy) | Pre-v3 unified envelope (color + spacing + typography + size + panelPosition). Migrated into `state-v3` on first load, then deleted. |
269
- | `state-v1` | `${storagePrefix}-state` | tweak-state (legacy) | Pre-v2 flat-state format (Color-only). Migrated into `state-v3` on first load, then deleted. |
267
+ | `state-v4` | `${storagePrefix}-state-v4` | tweak-state | Current unified envelope. `color` (and optional `secondary`) is keyed by active scheme/mode identity; global `tabs`, `spacing`, `typography`, and `size` slices remain unkeyed. |
268
+ | `state-v3` | `${storagePrefix}-state-v3` | tweak-state (legacy) | Retained downgrade-compatible envelope with a flat, single-slot `color` (plus global `tabs`, `spacing`, `typography`, and `size`). The selected v3 state is copied into v4; this key is not deleted by the v4 migration. |
269
+ | `state-v2` | `${storagePrefix}-state-v2` | tweak-state (legacy) | Pre-v3 unified envelope (color + spacing + typography + size). When selected, it is written to `state-v3` and the v2 key is deleted, then the result is copied into v4. |
270
+ | `state-v1` | `${storagePrefix}-state` | tweak-state (legacy) | Pre-v2 flat-state format (Color-only). When selected, it is written to `state-v3` and the v1 key is deleted, then the result is copied into v4. |
270
271
  | `open` | `${storagePrefix}-open` | panel | Mirror of the panel's `open` boolean state (so the next mount opens directly into the user's last state without a post-render toggle dispatch). |
271
272
  | `position` | `${storagePrefix}-position` | panel | Drag position (`{ top, left }`) so the panel reappears where the user left it. |
272
273
  | `visible` | `${storagePrefix}:visible` | adapter | Adapter-level visibility-intent flag, owned by the lazy-load gate (§6). |
@@ -283,6 +284,7 @@ The derivation MUST emit the colon literally; do not "fix" it during refactors.
283
284
  the derivation produces:
284
285
 
285
286
  ```
287
+ myapp-design-token-panel-state-v4
286
288
  myapp-design-token-panel-state-v3
287
289
  myapp-design-token-panel-state-v2
288
290
  myapp-design-token-panel-state
@@ -294,8 +296,39 @@ myapp-design-token-panel-domtweaker-enabled
294
296
  ```
295
297
 
296
298
  Unit tests in the package verify these derivations with literal-equality
297
- checks, and the v1 → v3 / v2 → v3 migration paths at first-load are part of
298
- the test matrix.
299
+ checks. The v4 precedence and legacy v1/v2/v3 migration paths at first load
300
+ are part of the test matrix; the version-agnostic `${storagePrefix}-state`
301
+ family probe in §6.2 continues to cover this key and future versions.
302
+
303
+ ### Current `state-v4` envelope
304
+
305
+ The current persisted envelope is stored under one `${storagePrefix}-state-v4`
306
+ key. Its color slices are keyed by the active scheme/mode identity, while the
307
+ non-color slices are global and unkeyed:
308
+
309
+ ```jsonc
310
+ {
311
+ "color": {
312
+ "Default Light": { "palette": [], "semanticMappings": {} /* ... */ },
313
+ "Default Dark": { "palette": [], "semanticMappings": {} /* ... */ }
314
+ },
315
+ "secondary": {
316
+ "Default Light": { "palette": [], "semanticMappings": {} /* ... */ }
317
+ },
318
+ "tabs": { "my-custom-tab": { "tier-id": { "item-id": "value" } } },
319
+ "spacing": { "item-id": "value" },
320
+ "typography": { "item-id": "value" },
321
+ "size": { "item-id": "value" }
322
+ }
323
+ ```
324
+
325
+ `secondary` is optional and, when present, uses the same identity keys as the
326
+ primary `color` map. On load, the active identity's color and secondary slots
327
+ are selected. If that identity has no color slot yet, color is seeded from the
328
+ active scheme's defaults; the global `tabs`, `spacing`, `typography`, and `size`
329
+ slices still load. A save replaces only the active identity's color/secondary
330
+ slots and preserves every other identity slot by merge, so editing one scheme
331
+ cannot overwrite another scheme's tweaks.
299
332
 
300
333
  ### 2.1 Default first-open geometry
301
334
 
@@ -899,7 +932,7 @@ panel bundle is NOT fetched and the page is completely free of panel JS.
899
932
  | Signal | Key derivation | Owner |
900
933
  |--------|---------------|-------|
901
934
  | `wasVisible` | `${storagePrefix}:visible`, OR its `${storagePrefix}-open` mirror | adapter |
902
- | `hasPersistedOverrides` | Content check across the `${storagePrefix}-state` family (`-state`, `-state-v2`, `-state-v3`, ... — every version, not a fixed list) | tweak-state |
935
+ | `hasPersistedOverrides` | Content check across the `${storagePrefix}-state` family (`-state`, `-state-v2`, `-state-v3`, `-state-v4`, ... — every version, not a fixed list) | tweak-state |
903
936
  | `shouldAutoload` | `${storagePrefix}:autoload`, matching `'1'` or `'auto'` | autoload-state |
904
937
  | `loadElementPathEnabled` | `${storagePrefix}-elpath-enabled` | element-path-state |
905
938
  | `loadDomTweakerEnabled` | `${storagePrefix}-domtweaker-enabled` | dom-tweaker-state |
@@ -1174,29 +1207,35 @@ For any host's chosen `storagePrefix`, the derivation produces deterministic,
1174
1207
  literal-equal storage keys (see §2). Unit tests pin the derived keys to
1175
1208
  literal strings.
1176
1209
 
1177
- ### 8.3 v1 / v2 → v3 in-place migration
1210
+ ### 8.3 v4 precedence and v1 / v2 / v3 migration
1178
1211
 
1179
- On first load, `loadPersistedState` migrates forward through the chain:
1212
+ `loadPersistedState` first looks for a valid `state-v4` envelope. If that key
1213
+ is absent or invalid, it falls through to the retained legacy chain. The
1214
+ precedence and deletion rules are explicit:
1180
1215
 
1181
- | Source key | Target key | Action after migration |
1182
- | ----------------------- | ------------------------ | ---------------------- |
1183
- | `${storagePrefix}-state` (v1) | `${storagePrefix}-state-v3` | v1 key deleted |
1184
- | `${storagePrefix}-state-v2` (v2) | `${storagePrefix}-state-v3` | v2 key deleted |
1216
+ | Storage condition | Selection / migration action | Key-retention result |
1217
+ | ----------------- | ---------------------------- | --------------------- |
1218
+ | Valid `${storagePrefix}-state-v4` (v4) | Select the active identity's `color` and optional `secondary` slots; load global `tabs`, `spacing`, `typography`, and `size`. | v4 wins; no legacy key is touched. |
1219
+ | v4 key absent or invalid | Fall through and inspect the legacy keys in order. | No deletion is caused by the v4 probe. |
1220
+ | Valid `${storagePrefix}-state-v3` (v3) | Use v3; do not inspect, rewrite, or delete lower legacy keys. | Copy the resulting state into v4 under the active identity; retain v3 for downgrade compatibility. |
1221
+ | Valid `${storagePrefix}-state-v2` (v2), with no valid v3 | Parse v2 and write the resulting flat state to v3. | Delete v2, then copy the resulting v3 state into v4; retain v3 for downgrade compatibility. |
1222
+ | Valid `${storagePrefix}-state` (v1), with no valid v3 or v2 | Lift the flat Color-only state into the unified state and write it to v3. | Delete v1, then copy the resulting v3 state into v4; retain v3 for downgrade compatibility. |
1185
1223
 
1186
- A user who last opened the panel before v3 landed gets their old color/spacing
1187
- tweaks lifted into the new envelope on first load.
1224
+ Thus a v3 key wins over v2 and v1, and a v4 migration never removes v3. The
1225
+ selected or newly written v3 state is always filed into the v4 envelope under
1226
+ the identity active at that moment. Subsequent loads read v4 first; a
1227
+ downgrade can still read the retained v3 envelope. Malformed legacy values are
1228
+ skipped in the same order so the next lower legacy key can be considered.
1188
1229
 
1189
- The v3 envelope adds a `tabs` map alongside the existing per-category slices:
1230
+ The retained v3 envelope has a flat, single-slot `color` and global slices:
1190
1231
 
1191
1232
  ```ts
1192
1233
  // Simplified v3 localStorage envelope shape
1193
1234
  {
1194
- // legacy category slices — preserved for round-trip compatibility
1195
1235
  color: { ... },
1196
1236
  spacing: { ... },
1197
1237
  typography: { ... },
1198
1238
  size: { ... },
1199
- // v3 extension — generic tab overrides keyed by tab id
1200
1239
  tabs: {
1201
1240
  "my-custom-tab": { "item-id-1": "some-value", ... },
1202
1241
  ...
@@ -1204,6 +1243,9 @@ The v3 envelope adds a `tabs` map alongside the existing per-category slices:
1204
1243
  }
1205
1244
  ```
1206
1245
 
1246
+ The current v4 envelope and its active-identity seeding and merge-write rules
1247
+ are specified in §2 above.
1248
+
1207
1249
  ### 8.4 Typography-id rename map
1208
1250
 
1209
1251
  The optional `PanelConfig.legacyIdRenameMap` (`Record<string, string | null>`)
@@ -1304,6 +1346,6 @@ Cross-reference table — what each section pins down.
1304
1346
  | Modal class prefix and `data-design-token-panel-modal` selector contract | §7.3 |
1305
1347
  | Self-contained panel chrome palette (no host theme reads) | §7.4 |
1306
1348
  | Host-adapter side-effect import (paired-unit obligation) | §7.5 |
1307
- | v1/v2 → v3 storage migration and typography-id rename map | §8.3, §8.4 |
1349
+ | v4 envelope precedence, v1/v2/v3 storage migration, and typography-id rename map | §2, §8.3, §8.4 |
1308
1350
  | JSON export/import schema v2 (serde v2) | §9 |
1309
1351
  | Out-of-scope / deferred concerns | §10 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zdtp",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "description": "Dynamic design-token tweak panel — host-config-driven, framework-agnostic Preact UI.",
5
5
  "private": false,
6
6
  "license": "MIT",