@sdux-vault/engine 0.11.0 → 0.13.0

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.
@@ -11,7 +11,7 @@ import { EventBus, initDevtoolsWidget } from '@sdux-vault/devtools';
11
11
  // cmd+alt+j (see .vscode/keybindings.json)
12
12
  // --- END AI MODEL FILE PATH ---
13
13
  const SDUX_PACKAGE = '@sdux-vault/engine';
14
- const SDUX_VERSION = '0.11.0';
14
+ const SDUX_VERSION = '0.13.0';
15
15
  registerVersion(SDUX_PACKAGE, SDUX_VERSION);
16
16
 
17
17
  /**
@@ -1520,6 +1520,7 @@ const KNOWN_VAULT_KEYS = new Set([
1520
1520
  'SDUX::Behavior::Core::Promise',
1521
1521
  'SDUX::Behavior::Core::Reducer',
1522
1522
  'SDUX::Behavior::Core::State',
1523
+ 'SDUX::Behavior::Core::TabSyncState',
1523
1524
  'SDUX::Behavior::Core::Value',
1524
1525
  // ---------------------------------------------------------------------------
1525
1526
  // Addon Behaviors (libs/addons)
@@ -2720,12 +2721,16 @@ class Orchestrator {
2720
2721
  });
2721
2722
  config.operators = config.operators ?? [];
2722
2723
  config.interceptors = config.interceptors ?? [];
2723
- const allBehaviors = [
2724
+ let allBehaviors = [
2724
2725
  ...defaultBehaviors,
2725
2726
  ...filteredUserBehaviors,
2726
2727
  ...config.operators,
2727
2728
  ...config.interceptors
2728
2729
  ];
2730
+ const hasTabSync = allBehaviors.some((behavior) => behavior.type === BehaviorTypes.TabSyncState);
2731
+ if (hasTabSync) {
2732
+ allBehaviors = allBehaviors.filter((behavior) => behavior.type !== BehaviorTypes.CoreState);
2733
+ }
2729
2734
  const behaviorInit = new BehaviorInitializationClass(this.cellKey);
2730
2735
  this.#registerBehaviorsWithVault(allBehaviors);
2731
2736
  this.#behaviors = behaviorInit.initializeBehaviors(allBehaviors, config.behaviorConfigs);
@@ -2738,6 +2743,7 @@ class Orchestrator {
2738
2743
  #registerStageBehaviors() {
2739
2744
  // Remove merge behavior from the pipeline list
2740
2745
  this.#stageBehaviors = this.#behaviors.filter((behavior) => !(behavior.type === BehaviorTypes.CoreState ||
2746
+ behavior.type === BehaviorTypes.TabSyncState ||
2741
2747
  behavior.type === BehaviorTypes.CoreEmitState ||
2742
2748
  behavior.type === BehaviorTypes.CoreError ||
2743
2749
  behavior.type === BehaviorTypes.ErrorTransform ||
@@ -2745,12 +2751,13 @@ class Orchestrator {
2745
2751
  behavior.type === BehaviorTypes.Merge));
2746
2752
  }
2747
2753
  #registerStateBehavior() {
2748
- // Extract and remove errot behavior
2749
- const coreState = this.#behaviors.filter((behaviort) => behaviort.type === BehaviorTypes.CoreState);
2750
- if (coreState.length > 1) {
2754
+ const tabSyncState = this.#behaviors.filter((behavior) => behavior.type === BehaviorTypes.TabSyncState);
2755
+ const coreState = this.#behaviors.filter((behavior) => behavior.type === BehaviorTypes.CoreState);
2756
+ const stateBehaviors = tabSyncState.length > 0 ? tabSyncState : coreState;
2757
+ if (stateBehaviors.length > 1) {
2751
2758
  throw new Error('Only one core state behavior can be registered for a FeatureCell.');
2752
2759
  }
2753
- this.#coreStateBehavior = coreState[0] ?? null;
2760
+ this.#coreStateBehavior = stateBehaviors[0] ?? null;
2754
2761
  this.#emitStateCallbackBehavior = this.#behaviors.filter((behavior) => isCoreEmitStateCallbackBehavior(behavior))[0];
2755
2762
  }
2756
2763
  #registerErrorBehavior() {