@almadar/ui 4.54.11 → 4.54.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.
@@ -57651,24 +57651,26 @@ function collectUITransitions(orbital, filter) {
57651
57651
  function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData) {
57652
57652
  const nodes = [];
57653
57653
  const edges = [];
57654
- const stateNodeMap = /* @__PURE__ */ new Map();
57654
+ const stateRepresentativeMap = /* @__PURE__ */ new Map();
57655
57655
  for (const entry of transitions) {
57656
57656
  const key = `${entry.traitName}:${entry.transition.to}`;
57657
- const existing = stateNodeMap.get(key);
57657
+ const existing = stateRepresentativeMap.get(key);
57658
57658
  if (!existing || entry.patterns.length > existing.patterns.length) {
57659
- stateNodeMap.set(key, entry);
57659
+ stateRepresentativeMap.set(key, entry);
57660
57660
  }
57661
57661
  }
57662
- const transitionEntries = Array.from(stateNodeMap.values());
57662
+ const transitionEntries = transitions;
57663
57663
  const totalCards = transitionEntries.length + groupedBehaviors.length;
57664
57664
  if (totalCards === 0) return { nodes, edges };
57665
57665
  const cols = Math.min(totalCards, 3);
57666
57666
  const nodeIdMap = /* @__PURE__ */ new Map();
57667
57667
  transitionEntries.forEach((entry, i) => {
57668
57668
  const t = entry.transition;
57669
- const nodeId = `${orbitalName}-${entry.traitName}-${t.event}-${t.to}`;
57669
+ const nodeId = `${orbitalName}-${entry.traitName}-${t.event}-${t.from}-${t.to}`;
57670
57670
  const stateKey = `${entry.traitName}:${t.to}`;
57671
- nodeIdMap.set(stateKey, nodeId);
57671
+ if (stateRepresentativeMap.get(stateKey) === entry) {
57672
+ nodeIdMap.set(stateKey, nodeId);
57673
+ }
57672
57674
  const col = i % cols;
57673
57675
  const row = Math.floor(i / cols);
57674
57676
  nodes.push({
@@ -57737,7 +57739,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
57737
57739
  if (!sourceNodeId || !targetNodeId) continue;
57738
57740
  if (sourceNodeId === targetNodeId) continue;
57739
57741
  const backward = isBackwardTransition(t.from, t.to, entry.states);
57740
- const sourceEntry = stateNodeMap.get(sourceKey);
57742
+ const sourceEntry = stateRepresentativeMap.get(sourceKey);
57741
57743
  const triggerSource = sourceEntry?.eventSources.find((s) => s.event === t.event);
57742
57744
  edges.push({
57743
57745
  id: `ef-${entry.traitName}-${t.event}-${t.from}-${t.to}`,
package/dist/avl/index.js CHANGED
@@ -57605,24 +57605,26 @@ function collectUITransitions(orbital, filter) {
57605
57605
  function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData) {
57606
57606
  const nodes = [];
57607
57607
  const edges = [];
57608
- const stateNodeMap = /* @__PURE__ */ new Map();
57608
+ const stateRepresentativeMap = /* @__PURE__ */ new Map();
57609
57609
  for (const entry of transitions) {
57610
57610
  const key = `${entry.traitName}:${entry.transition.to}`;
57611
- const existing = stateNodeMap.get(key);
57611
+ const existing = stateRepresentativeMap.get(key);
57612
57612
  if (!existing || entry.patterns.length > existing.patterns.length) {
57613
- stateNodeMap.set(key, entry);
57613
+ stateRepresentativeMap.set(key, entry);
57614
57614
  }
57615
57615
  }
57616
- const transitionEntries = Array.from(stateNodeMap.values());
57616
+ const transitionEntries = transitions;
57617
57617
  const totalCards = transitionEntries.length + groupedBehaviors.length;
57618
57618
  if (totalCards === 0) return { nodes, edges };
57619
57619
  const cols = Math.min(totalCards, 3);
57620
57620
  const nodeIdMap = /* @__PURE__ */ new Map();
57621
57621
  transitionEntries.forEach((entry, i) => {
57622
57622
  const t = entry.transition;
57623
- const nodeId = `${orbitalName}-${entry.traitName}-${t.event}-${t.to}`;
57623
+ const nodeId = `${orbitalName}-${entry.traitName}-${t.event}-${t.from}-${t.to}`;
57624
57624
  const stateKey = `${entry.traitName}:${t.to}`;
57625
- nodeIdMap.set(stateKey, nodeId);
57625
+ if (stateRepresentativeMap.get(stateKey) === entry) {
57626
+ nodeIdMap.set(stateKey, nodeId);
57627
+ }
57626
57628
  const col = i % cols;
57627
57629
  const row = Math.floor(i / cols);
57628
57630
  nodes.push({
@@ -57691,7 +57693,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
57691
57693
  if (!sourceNodeId || !targetNodeId) continue;
57692
57694
  if (sourceNodeId === targetNodeId) continue;
57693
57695
  const backward = isBackwardTransition(t.from, t.to, entry.states);
57694
- const sourceEntry = stateNodeMap.get(sourceKey);
57696
+ const sourceEntry = stateRepresentativeMap.get(sourceKey);
57695
57697
  const triggerSource = sourceEntry?.eventSources.find((s) => s.event === t.event);
57696
57698
  edges.push({
57697
57699
  id: `ef-${entry.traitName}-${t.event}-${t.from}-${t.to}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.54.11",
3
+ "version": "4.54.12",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [