@praxisui/core 8.0.0-beta.48 → 8.0.0-beta.49

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.
@@ -29065,7 +29065,8 @@ class DynamicWidgetPageComponent {
29065
29065
  const tabSegment = nestedPath.find((segment) => segment.kind === 'tab' || segment.kind === 'nav');
29066
29066
  if (!widgetKey || !tabSegment)
29067
29067
  return false;
29068
- const page = this.ensurePageDefinition();
29068
+ const stateResult = this.applyRecordSurfaceSourceState(this.ensurePageDefinition(), fromKey, evt, surface, payload);
29069
+ const page = stateResult.page;
29069
29070
  const widgets = this.cloneWidgets(page.widgets || []);
29070
29071
  const widgetIndex = widgets.findIndex((widget) => widget.key === widgetKey);
29071
29072
  if (widgetIndex < 0)
@@ -29104,9 +29105,55 @@ class DynamicWidgetPageComponent {
29104
29105
  },
29105
29106
  },
29106
29107
  };
29107
- this.applyPageUpdate({ ...page, widgets }, false, undefined, false, true);
29108
+ this.applyPageUpdate({ ...page, widgets }, false, stateResult.runtime, false, true);
29108
29109
  return true;
29109
29110
  }
29111
+ applyRecordSurfaceSourceState(page, fromKey, evt, surface, payload) {
29112
+ const source = this.isRecord(surface?.['source']) ? surface['source'] : null;
29113
+ const selectedRow = payload?.['selectedRow'];
29114
+ if (!source || selectedRow == null) {
29115
+ return { page };
29116
+ }
29117
+ const sourceWidget = this.stringOrNull(source['widget']) || fromKey;
29118
+ const sourcePort = this.stringOrNull(source['port']) || 'rowClick';
29119
+ const sourceComponentId = this.stringOrNull(source['componentType']) || evt.sourceComponentId;
29120
+ const sourceNestedPath = Array.isArray(source['nestedPath'])
29121
+ ? source['nestedPath']
29122
+ : [];
29123
+ const sourceEvent = {
29124
+ ownerWidgetKey: sourceWidget,
29125
+ sourceComponentId,
29126
+ output: sourcePort,
29127
+ payload: {
29128
+ row: this.cloneStateValues(selectedRow),
29129
+ index: typeof payload?.['selectedIndex'] === 'number'
29130
+ ? payload['selectedIndex']
29131
+ : typeof payload?.['index'] === 'number'
29132
+ ? payload['index']
29133
+ : undefined,
29134
+ },
29135
+ ...(sourceNestedPath.length ? { path: sourceNestedPath } : {}),
29136
+ };
29137
+ const cycle = this.dispatchWidgetEventToComposition(page, sourceWidget, sourceEvent);
29138
+ if (!cycle || !cycle.matchedLinkIds.length) {
29139
+ return { page };
29140
+ }
29141
+ const state = this.stateFromCompositionSnapshot(page.state, cycle.snapshot.state.primaryValues);
29142
+ let widgets = this.cloneWidgets(page.widgets || []);
29143
+ widgets = this.applyCompositionWidgetDeliveries(widgets, cycle).widgets;
29144
+ if (this.compositionDefinition) {
29145
+ widgets = this.compositionRuntime.projectStateWidgetInputs(this.compositionDefinition, {
29146
+ widgets,
29147
+ state: cycle.snapshot.state,
29148
+ now: cycle.snapshot.generatedAt,
29149
+ }).widgets;
29150
+ }
29151
+ const runtime = this.buildStateRuntime(state, page.context);
29152
+ return {
29153
+ page: { ...page, widgets, state },
29154
+ runtime,
29155
+ };
29156
+ }
29110
29157
  findRecordSurfaceTabIndex(config, segment) {
29111
29158
  const collection = segment.kind === 'nav'
29112
29159
  ? (this.isRecord(config['nav']) && Array.isArray(config['nav']['links']) ? config['nav']['links'] : [])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/core",
3
- "version": "8.0.0-beta.48",
3
+ "version": "8.0.0-beta.49",
4
4
  "description": "Core library for Praxis UI Workspace: types, tokens, services and utilities shared across @praxisui/* packages.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
@@ -13574,6 +13574,7 @@ declare class DynamicWidgetPageComponent implements OnChanges, OnDestroy {
13574
13574
  private stringOrNull;
13575
13575
  private isRecord;
13576
13576
  private maybeOpenRecordRelatedSurface;
13577
+ private applyRecordSurfaceSourceState;
13577
13578
  private findRecordSurfaceTabIndex;
13578
13579
  private reportStateDiagnostics;
13579
13580
  private dispatchWidgetEventToComposition;