@wcstack/state 3.5.4 → 4.0.0-rc.2

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.
Files changed (82) hide show
  1. package/README.ja.md +669 -428
  2. package/README.md +667 -426
  3. package/dist/auto.min.js +1 -2
  4. package/dist/define.d.ts +4 -8
  5. package/dist/define.js +1 -1
  6. package/dist/index.d.ts +139 -1483
  7. package/dist/index.esm.js +1 -2
  8. package/dist/manifest.d.ts +18 -59
  9. package/dist/manifest.esm.js +542 -1202
  10. package/dist/parser.d.ts +49 -103
  11. package/dist/parser.esm.js +662 -831
  12. package/dist/split/auto.js +1 -0
  13. package/dist/split/chunks/chunk-732CB4QN.js +1 -0
  14. package/dist/split/chunks/chunk-7PN5YNZZ.js +1 -0
  15. package/dist/split/chunks/chunk-FF6KHTYS.js +1 -0
  16. package/dist/split/chunks/chunk-HFKGUDDJ.js +1 -0
  17. package/dist/split/chunks/chunk-PKDBVBAP.js +1 -0
  18. package/dist/split/chunks/chunk-QI7P7YPP.js +1 -0
  19. package/dist/split/chunks/chunk-QQH6N5CJ.js +1 -0
  20. package/dist/split/chunks/chunk-UM3O6QXD.js +1 -0
  21. package/dist/split/chunks/chunk-WEL3YSG7.js +1 -0
  22. package/dist/split/chunks/chunk-WWJNAZVP.js +1 -0
  23. package/dist/split/chunks/chunk-YOPPVWPQ.js +1 -0
  24. package/dist/split/core.d.ts +114 -1168
  25. package/dist/split/core.js +1 -2
  26. package/dist/split/features/devtools.d.ts +23 -3
  27. package/dist/split/features/devtools.js +1 -2
  28. package/dist/split/features/diagnostics.d.ts +27 -5
  29. package/dist/split/features/diagnostics.js +1 -2
  30. package/dist/split/features/formats.d.ts +21 -5
  31. package/dist/split/features/formats.js +1 -2
  32. package/dist/split/features/list-keys.d.ts +24 -0
  33. package/dist/split/features/list-keys.js +1 -0
  34. package/dist/split/features/recursion.d.ts +23 -3
  35. package/dist/split/features/recursion.js +1 -2
  36. package/dist/split/features/scopes.d.ts +25 -4
  37. package/dist/split/features/scopes.js +1 -2
  38. package/dist/split/features/ssr.d.ts +23 -3
  39. package/dist/split/features/ssr.js +1 -2
  40. package/dist/split/features/temporal.d.ts +19 -4
  41. package/dist/split/features/temporal.js +1 -2
  42. package/dist/wcs-manifest.json +43 -49
  43. package/package.json +15 -17
  44. package/dist/auto.min.js.map +0 -1
  45. package/dist/index.esm.js.map +0 -1
  46. package/dist/split/chunks/binder.js +0 -2
  47. package/dist/split/chunks/binder.js.map +0 -1
  48. package/dist/split/chunks/checkDependency.js +0 -2
  49. package/dist/split/chunks/checkDependency.js.map +0 -1
  50. package/dist/split/chunks/declarationAliases.js +0 -2
  51. package/dist/split/chunks/declarationAliases.js.map +0 -1
  52. package/dist/split/chunks/declarationHooks.js +0 -2
  53. package/dist/split/chunks/declarationHooks.js.map +0 -1
  54. package/dist/split/chunks/diagnosticsHooks.js +0 -2
  55. package/dist/split/chunks/diagnosticsHooks.js.map +0 -1
  56. package/dist/split/chunks/errorGuidance.js +0 -2
  57. package/dist/split/chunks/errorGuidance.js.map +0 -1
  58. package/dist/split/chunks/featureBridge.js +0 -2
  59. package/dist/split/chunks/featureBridge.js.map +0 -1
  60. package/dist/split/chunks/features.d.ts +0 -29
  61. package/dist/split/chunks/filterRegistry.js +0 -2
  62. package/dist/split/chunks/filterRegistry.js.map +0 -1
  63. package/dist/split/chunks/getAllPropertyDescriptors.js +0 -2
  64. package/dist/split/chunks/getAllPropertyDescriptors.js.map +0 -1
  65. package/dist/split/chunks/lifecycleHooks.js +0 -2
  66. package/dist/split/chunks/lifecycleHooks.js.map +0 -1
  67. package/dist/split/chunks/pathDiagnostics.js +0 -2
  68. package/dist/split/chunks/pathDiagnostics.js.map +0 -1
  69. package/dist/split/chunks/registerComponents.js +0 -2
  70. package/dist/split/chunks/registerComponents.js.map +0 -1
  71. package/dist/split/chunks/setAll.js +0 -2
  72. package/dist/split/chunks/setAll.js.map +0 -1
  73. package/dist/split/chunks/version.js +0 -2
  74. package/dist/split/chunks/version.js.map +0 -1
  75. package/dist/split/core.js.map +0 -1
  76. package/dist/split/features/devtools.js.map +0 -1
  77. package/dist/split/features/diagnostics.js.map +0 -1
  78. package/dist/split/features/formats.js.map +0 -1
  79. package/dist/split/features/recursion.js.map +0 -1
  80. package/dist/split/features/scopes.js.map +0 -1
  81. package/dist/split/features/ssr.js.map +0 -1
  82. package/dist/split/features/temporal.js.map +0 -1
@@ -30,83 +30,45 @@ interface IFilterMeta {
30
30
  /** 組み込みフィルタ名 → 構造化メタデータ。キー集合は builtinFilters と一致しなければならない。 */
31
31
  declare const builtinFilterMeta: Record<string, IFilterMeta>;
32
32
 
33
- /**
34
- * filters/filterAliases.ts — 組み込みフィルタの旧名 → 正式名(要件 B12・docs/state-3x-naming.ja.md V1〜V9)。
35
- *
36
- * 旧名は 3.x の間エイリアスとして残り、4.0 で外す(D4)。解決は登録簿(core/filterRegistry)が行い、
37
- * 実装・引数の個数・メタデータは正式名だけが持つ。formats の install と manifest(tooling)の両方が読むので、
38
- * 実装にもメタデータにも依存しない小さな表として独立させている。
39
- */
40
- declare const builtinFilterAliases: Readonly<Record<string, string>>;
41
-
42
- declare const DECLARATION_ALIASES: Readonly<Record<string, string>>;
43
-
44
33
  type BindingType = 'text' | 'prop' | 'event' | 'for' | 'if' | 'elseif' | 'else' | 'radio' | 'checkbox' | 'spread';
34
+ /** Bindings that must be the only binding of their attribute value. */
35
+ declare const STRUCTURAL_BINDING_TYPE_SET: ReadonlySet<BindingType>;
45
36
 
46
- declare const STRUCTURAL_BINDING_TYPE_SET: Set<BindingType>;
47
-
48
- /**
49
- * マニフェストのバージョン(構造を変えたら上げる)。
50
- *
51
- * 3.1 で `syntax.bindingTypes.explicitPropertyPrefix`、3.2 で `filterAliases`、
52
- * 3.x の次で `declarationAliases` / `apiAliases` を足したので 2。
53
- * 消費側(vscode-wcs)はまだこの定数を参照していないが、公開している以上ドリフトさせない。
54
- */
37
+ /** The manifest's shape version (the same shape as 3.x). */
55
38
  declare const WCS_MANIFEST_VERSION = 2;
56
- /**
57
- * state API の旧名 → 正式名(要件 B12・docs/state-3x-naming.ja.md)。正本は
58
- * `proxy/traps/get.ts` の case ラベルで、ここはそれを機械可読にした写し
59
- * (一致は `__tests__/manifest.test.ts` が固定する)。
60
- */
39
+ /** Filter old names → canonical (3.2): removed in 4.0. */
40
+ declare const builtinFilterAliases: Readonly<Record<string, string>>;
41
+ /** Declaration-key old names → canonical (3.2): removed in 4.0 (`$streams` fails as `[wcs/declaration-alias]`). */
42
+ declare const DECLARATION_ALIASES: Readonly<Record<string, string>>;
43
+ /** State API old names → canonical (3.2): removed in 4.0 (`$trackDependency` fails as `[wcs/name-alias]`). */
61
44
  declare const STATE_API_ALIASES: Readonly<Record<string, string>>;
62
45
  interface IWcsManifest {
63
46
  version: number;
64
47
  syntax: {
65
- /** バインド属性名(既定 data-wcs) */
66
48
  bindAttribute: string;
67
- /** タグ名(既定 wcs-state) */
68
49
  tagName: string;
69
- /** パス区切り(`.`) */
70
50
  pathDelimiter: string;
71
- /** ワイルドカード(`*`) */
72
51
  wildcard: string;
73
- /** バインディング構文 `[prop][#mod]: [path][|filter...]` の区切り文字 */
74
52
  delimiters: {
75
53
  binding: string;
76
54
  propValue: string;
77
55
  modifier: string;
78
56
  filter: string;
79
57
  };
80
- /** 構造ディレクティブ(`<template data-wcs="for: ...">` 等) */
81
58
  structuralDirectives: readonly string[];
82
- /**
83
- * 修飾子(`#` 後)の語彙。flags は値を取らない形(`#prevent`)、keyValue は
84
- * `=` で値を取る形(`#init=element`)、eventNamePrefix は `on` + イベント名の形
85
- * (`#onchange` — two-way / radio / checkbox のイベント名上書き。README「Modifiers」)。
86
- * define.ts の定数が単一正本で、ランタイムの消費箇所も同じ定数に分岐する。
87
- */
88
59
  modifiers: {
89
60
  flags: readonly string[];
90
61
  keyValue: readonly string[];
91
62
  eventNamePrefix: string;
92
63
  };
93
- /** リストインデックス参照名(`$1`..`$N`)。prefix + 1 始まり連番、maxDepth まで。 */
94
64
  indexParam: {
95
65
  prefix: string;
96
66
  maxDepth: number;
97
67
  };
98
- /**
99
- * bindingType 判別の語彙(parseBindTextsForElement の分岐と同一の定数から導出)。
100
- * 判別順: else → spread → 構造ディレクティブ/radio/checkbox → eventToken・`on*`
101
- * (event)→ prop。propNamespaces は左辺先頭セグメントの特殊 namespace で、
102
- * apply 層のディスパッチキー集合との一致はテストが強制する。
103
- * 既知の未収載: `radio` / `checkbox`(BindingType union のみが正本)。
104
- */
105
68
  bindingTypes: {
106
69
  elseKeyword: string;
107
70
  spread: string;
108
71
  eventPropertyPrefix: string;
109
- /** 左辺の先頭に付けると、名前が `on` で始まってもイベントにしない明示のプロパティ形(`.online:`、要件 B5) */
110
72
  explicitPropertyPrefix: string;
111
73
  propNamespaces: {
112
74
  eventToken: string;
@@ -117,27 +79,24 @@ interface IWcsManifest {
117
79
  };
118
80
  };
119
81
  };
120
- /** 組み込みフィルタ名(builtinFilters から自動導出=実装が正本) */
82
+ /** The built-in filter names: the core set, then the formats add-on's. */
121
83
  filters: string[];
122
- /** 組み込みフィルタの構造化メタデータ(説明・引数仕様・型)。vscode-wcs の手リスト撤去用。 */
123
84
  filterMeta: Record<string, IFilterMeta>;
124
- /** 組み込みフィルタの旧名 → 正式名(要件 B12)。旧名も解決するが、ツールは正式名を提案する */
125
85
  filterAliases: Readonly<Record<string, string>>;
126
- /**
127
- * 宣言キーの旧名 → 正式名(要件 B12。`$updatedCallback` → `$renderedCallback`、
128
- * `$streams` → `$stream`)。ランタイムは旧名も受けるが、ツールは正式名を提案する。
129
- * `reservedLifecycle` / `reservedStateApi` は**正式名だけ**なので、旧名が予約かどうかは
130
- * この表と併せて判断する
131
- */
132
86
  declarationAliases: Readonly<Record<string, string>>;
133
- /** state API の旧名 → 正式名(`$trackDependency` → `$dependOn` 等、要件 B12) */
134
87
  apiAliases: Readonly<Record<string, string>>;
135
- /** 予約ライフサイクルフック名(正式名のみ。旧名は `declarationAliases` を見る) */
88
+ /** Reserved lifecycle hooks. */
136
89
  reservedLifecycle: readonly string[];
137
- /** 予約 state API(プロトコル系の `$` 名前空間。正式名のみ) */
90
+ /** Reserved state keys and `$` namespaces. */
138
91
  reservedStateApi: readonly string[];
92
+ /** A state's `$behavior` options (4.0): each key, the type of its value and its value when left out. */
93
+ behaviorOptions: Readonly<Record<string, {
94
+ type: "boolean";
95
+ default: boolean;
96
+ }>>;
97
+ /** The add-on names `$features` and the root `<wcs-state features>` take (4.0). */
98
+ features: readonly string[];
139
99
  }
140
- /** 機械可読な単一正本を返す。vscode-wcs はこれを消費する想定。 */
141
100
  declare function getWcsManifest(): IWcsManifest;
142
101
 
143
102
  export { DECLARATION_ALIASES, STATE_API_ALIASES, STRUCTURAL_BINDING_TYPE_SET, WCS_MANIFEST_VERSION, builtinFilterAliases, builtinFilterMeta, getWcsManifest };