@wcstack/state 1.9.0 → 1.9.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.
package/dist/auto.js CHANGED
@@ -1,3 +1,3 @@
1
- import { bootstrapState } from "./index.esm.js";
2
-
3
- await bootstrapState();
1
+ import { bootstrapState } from "./index.esm.js";
2
+
3
+ await bootstrapState();
package/dist/auto.min.js CHANGED
@@ -1,3 +1,3 @@
1
- import { bootstrapState } from "./index.esm.min.js";
2
-
3
- await bootstrapState();
1
+ import { bootstrapState } from "./index.esm.min.js";
2
+
3
+ await bootstrapState();
package/dist/index.esm.js CHANGED
@@ -59,7 +59,7 @@ function setConfig(partialConfig) {
59
59
  }
60
60
  }
61
61
 
62
- var version$1 = "1.9.0";
62
+ var version$1 = "1.9.1";
63
63
  var pkg = {
64
64
  version: version$1};
65
65
 
@@ -2063,7 +2063,7 @@ function getWcBindable(element) {
2063
2063
  }
2064
2064
  function applyChangeToCommand(binding, _context, newValue) {
2065
2065
  if (!isCommandToken(newValue)) {
2066
- raiseError(`command binding requires a CommandToken value (use $commandToken or $commandTokens declaration).`);
2066
+ raiseError(`command binding requires a CommandToken value (use $command.<tokenName> with a name declared in $commandTokens).`);
2067
2067
  }
2068
2068
  const token = newValue;
2069
2069
  const existing = subscribedBindings.get(binding);
@@ -5411,6 +5411,19 @@ function checkDependency(handler, address) {
5411
5411
  * - finallyでキャッシュへの格納を保証
5412
5412
  */
5413
5413
  function _getByAddress(target, address, receiver, handler, stateElement) {
5414
+ if (address.pathInfo.segments[0] === STATE_COMMAND_NAMESPACE_NAME) {
5415
+ // $command 名前空間配下のパスは raw state を持たないため、proxy の get トラップと
5416
+ // 同じ namespace を辿る。1セグメント目は namespace 本体、2セグメント目以降は
5417
+ // namespace 上のキー (= 宣言済み command token 名) を順に走査する。
5418
+ let value = getCommandNamespace(stateElement);
5419
+ for (let i = 1; i < address.pathInfo.segments.length; i++) {
5420
+ if (value == null) {
5421
+ return undefined;
5422
+ }
5423
+ value = Reflect.get(value, address.pathInfo.segments[i]);
5424
+ }
5425
+ return value;
5426
+ }
5414
5427
  if (address.pathInfo.path in target) {
5415
5428
  // getterの中で参照の可能性があるので、addressをプッシュする
5416
5429
  if (stateElement.getterPaths.has(address.pathInfo.path)) {