0.1.0-next.0
0.1.0-next.0 のリリースノート。
Released: 2026-05-24
名称変更 — npm package is now @takazudo/zdtp
Package name changed from
@takazudo/zudo-design-token-panelto@takazudo/zdtp. Update imports accordingly (import { configurePanel } from '@takazudo/zdtp',import '@takazudo/,zdtp/ styles' @takazudo/, etc.).zdtp/ astro CLI bin renamed from
design-token-panel-servertozdtp-server.First public prerelease is published to npm under the
nextdist-tag; install withpnpm add @takazudo/zdtp@next preact.
バグ修正 (panel renders unstyled without a consumer CSS import — #219)
Self-injected stylesheet — the panel now injects its own bundled CSS as a
<style>element on first mount (ensurePanelStyles()insrc/). Previously the panel painted unstyled unless the consumer manually addedindex. tsx import '@takazudo/to its static module graph — Vite library mode strips the package-internal CSS side-effect import fromzdtp/ styles' dist/, so the emitted JS never loaded its own CSS. The CSS is now also imported viaindex. js ?inline(a string constant that survives library-mode bundling) and injected at runtime. Because injection happens inensureMounted(), the CSS loads exactly when the panel first opens — no eager cost on pages where the panel is never used. The.// styles .exports still resolve (the standalone/ styles. css dist/is still emitted) and remain valid but optional; the install doc's "Don't skip the styles import" warning is downgraded accordingly. Public API unchanged.zdtp. css
バグ修正 (panel-singleton & first-toggle bugfixes — #108, root PR #113)
Cross-instance singleton sharing — configuration singletons (
configuredConfig, post-configure hooks) are now stored onglobalThis[Symbol.instead of module-scope variables. When a bundler produces two separate module instances offor('@takazudo/ zudo- design- token- panel: singleton')] panel-config.ts(e.g. Vite chunk-dedup in Astro consumers), both instances now share the same slot, soconfigurePanel()writes andgetPanelConfig()reads from the same object regardless of which module instance each call landed in. Public API is bit-identical. (#109)Deferred reapply via post-configure hooks —
reapplyPersistedOverrides()andreapplyFromStorage()are no longer called at module-init time. They are now registered as a post-configure hook (via the newregisterPostConfigureHookAPI) and fire only afterconfigurePanel()supplies the host's storage prefix. This prevents a default-prefix Preact panel from mounting before the host's prefix is known, which was the root cause of the firsttoggleDesignPanel()call being a no-op when legacy default-prefix keys existed in localStorage. Late-registration semantics: ifconfigurePanel()has already been called when a hook is registered, the hook fires immediately. View-transition re-run safety is preserved via a stable module-level hook constant. (#111)
追加 (abstract-token-tiers epic — #69, root PR #91)
Note: the package version is still
0.0.0(pre-1.0, in active development). The changes below are unreleased additions tracked under the abstract-token-tiers epic.
Tier model types (
TierValueKind,TierItem,TierConfig,TabConfig,ColorClusterExtras) insrc/— the data model that backs the new tab-driven panel. Narrowing helpers (tokens/ tier- model. ts isLengthKind,isNumberKind,isSelectKind,isTextKind,isColorKind) are exported.TierRefSelectorcontrol — when aTierConfigcarriesreferencesTier, each item's persisted value is the id of an item in the base tier, and the apply pipeline emitsvar(--target-cssvar).GenericTabcomponent — data-driven tab renderer that handles any host-coined tab id using kind-appropriate editors forlength,number,select,text, andcolorkinds.PanelConfig.tabs(required) — replaces the previoustokensandcolorClusterfields. Every visible tab, including the color tab, is expressed as aTabConfigentry. The color tab (id'color') carries palette and semantic data asTierItemarrays inside itstiers, with structural metadata incolorExtras.Persist envelope v3 (
${storagePrefix}-state-v3) — adds atabsmap alongside the existing per-category slices so host-coined tabs can persist their overrides without schema changes.JSON serde v2 (
$schema: 'zudo-design-tokens/v2') —tabs-keyed wrapper with cssVar-keyed leaves.serialize()always emits v2.deserialize()accepts both v1 and v2 and normalises toTweakState. Tier-2 ref values are stored as literalvar(--tier1-cssvar)CSS strings.Host-tabs validation in
assertValidPanelConfig— enforces tier-id uniqueness, item-id uniqueness across tiers, cssVar format, kind consistency within a tier, andreferencesTierintegrity (existence + kind compatibility).v2 → v3 storage migration in
loadPersistedState— lifts existing per-category overrides into the v3 envelope on first load, then deletes the v2 key.Export
TweakState(type) andemptyOverridesfrom main entry (#49) — external SerDe layers (e.g. zudo-doc'sdesign-token-serde.ts) can now construct a fully-populatedTweakStatewithout reaching into the test-only.sub-export./ testing Framework-agnostic
setLifecycleAdapter(adapter)API for non-Astro hosts (zfb, vite, etc.) (#50). The astroastro:before-swap/astro:page-loadfallback is preserved when no adapter is registered, and is actively unbound when a host installs an adapter so the internal handlers do not double-fire. A partial adapter (one that registers onlyonBeforeSwapor onlyonPageLoad) keeps the astro fallback for the unregistered channel and emits aconsole.warnso authors notice the silent gap.
変更 (abstract-token-tiers epic — #69)
PanelConfig.tokensdropped — replaced byPanelConfig.tabs. This is a breaking change for any host that relied on thetokens: TokenManifestfield. Wire per-tab token arrays asTierItem[]inside aTierConfiginside aTabConfigonPanelConfig.tabs.PanelConfig.colorCluster/secondaryColorClusterdropped — replaced by aTabConfigwithid: 'color'(or'color-secondary') and acolorExtrasfield. Palette and semantic tokens move into the tab'stiersasTierItementries;colorExtrascarries the structural metadata (baseRoles,colorSchemes,panelSettings, etc.).TokenManifest/TokenDeftypes removed from the public surface — superseded by theTabConfig/TierConfig/TierItemmodel.ColorClusterConfig— previously accepted as a top-levelPanelConfigfield. Now the equivalent data lives onTabConfig.colorExtras. The public aliasColorClusterConfigcontinues to re-exportColorClusterDataConfigfor backward-compatible type imports.Make typography-id rename map configurable via
PanelConfig.legacyIdRenameMap(#51). The default is an empty map (no renaming) so hosts whose manifest ids are stable (e.g. zudo-doc) are not corrupted. The historical zdtp-internal map is exported asZDTP_LEGACY_TYPOGRAPHY_RENAME_MAPfor opt-in callers; the bundled astro host adapter wires it in automatically so existing zdtp deployments keep their behaviour. Map shape isRecord<string, string | null>— anullvalue preserves the historical "drop this id" semantic for callers whose original behaviour dropped certain ids without replacement.After the typography migration runs (rename or null-drop),
loadPersistedStaterewrites the normalized envelope back tolocalStorageso legacy ids and dropped entries do not survive on disk indefinitely as dead data, and a host that later removes the opt-in rename map does not regress every user back to non-applying overrides.