@praxisui/page-builder 3.0.0-beta.8 → 3.0.0-beta.9

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.
@@ -6354,11 +6354,22 @@ class ConnectionGraphComponent {
6354
6354
  isWidgetTarget(to) {
6355
6355
  return 'widget' in to;
6356
6356
  }
6357
+ connectionKind(connection) {
6358
+ const fromWidget = this.isWidgetSource(connection.from);
6359
+ const toWidget = this.isWidgetTarget(connection.to);
6360
+ if (fromWidget && toWidget)
6361
+ return 'widget-to-widget';
6362
+ if (fromWidget && !toWidget)
6363
+ return 'widget-to-state';
6364
+ if (!fromWidget && toWidget)
6365
+ return 'state-to-widget';
6366
+ return 'state-to-state';
6367
+ }
6357
6368
  fromLabel(c) {
6358
- return this.currentEdge()?.meta?.fromLabel || (this.isWidgetSource(c.from) ? `${c.from.widget}.${c.from.output}` : `state:${c.from.state}`);
6369
+ return this.selectedEdgeMeta()?.fromLabel || (this.isWidgetSource(c.from) ? `${c.from.widget}.${c.from.output}` : `state:${c.from.state}`);
6359
6370
  }
6360
6371
  toLabel(c) {
6361
- return this.currentEdge()?.meta?.toLabel || (this.isWidgetTarget(c.to) ? `${c.to.widget}.${c.to.input}` : `state:${c.to.state}`);
6372
+ return this.selectedEdgeMeta()?.toLabel || (this.isWidgetTarget(c.to) ? `${c.to.widget}.${c.to.input}` : `state:${c.to.state}`);
6362
6373
  }
6363
6374
  bindingOrderLabel(c) {
6364
6375
  return this.isWidgetTarget(c.to) && c.to.bindingOrder?.length ? c.to.bindingOrder.join(', ') : '';
@@ -6405,10 +6416,11 @@ class ConnectionGraphComponent {
6405
6416
  }
6406
6417
  ngOnInit() {
6407
6418
  const data = this.injectedData || {};
6408
- const p = this.parsePage(data.page);
6419
+ const sourcePage = data.page || this.page;
6420
+ const p = this.parsePage(sourcePage);
6409
6421
  const ws = data.widgets || this.widgets || p?.widgets || [];
6410
6422
  this.widgets = ws;
6411
- this.page = data.page || this.page;
6423
+ this.page = sourcePage;
6412
6424
  const conns = [...(p?.connections || [])];
6413
6425
  this.connections.set(conns);
6414
6426
  this.initialSnapshot = JSON.stringify(conns);
@@ -6524,24 +6536,34 @@ class ConnectionGraphComponent {
6524
6536
  return routeElbow(from, to);
6525
6537
  }
6526
6538
  edgeTooltip(e) {
6539
+ const meta = this.edgeMeta(e);
6540
+ const connection = e ? this.connectionForEdge(e) : this.currentConn();
6541
+ if (!e && !connection) {
6542
+ return 'Conexao indisponivel';
6543
+ }
6544
+ const fallbackFromLabel = connection
6545
+ ? (this.isWidgetSource(connection.from) ? `${connection.from.widget}.${connection.from.output}` : `state:${connection.from.state}`)
6546
+ : `${e?.from.nodeId}.${e?.from.portId.replace('out:', '')}`;
6547
+ const fallbackToLabel = connection
6548
+ ? (this.isWidgetTarget(connection.to) ? `${connection.to.widget}.${connection.to.input}` : `state:${connection.to.state}`)
6549
+ : `${e?.to.nodeId}.${e?.to.portId.replace('in:', '')}`;
6527
6550
  const parts = [
6528
- `Tipo: ${this.connectionKindLabel(e.meta?.connectionKind)}`,
6529
- `De: ${e.meta?.fromLabel || e.from.nodeId}.${e.from.portId.replace('out:', '')}`,
6530
- `Para: ${e.meta?.toLabel || e.to.nodeId}.${e.to.portId.replace('in:', '')}`,
6551
+ `Tipo: ${this.connectionKindLabel(meta?.connectionKind)}`,
6552
+ `De: ${meta?.fromLabel || fallbackFromLabel}`,
6553
+ `Para: ${meta?.toLabel || fallbackToLabel}`,
6531
6554
  ];
6532
- if (e.meta && e.meta.friendlyPath)
6533
- parts.push(`Destino: ${e.meta.friendlyPath}`);
6534
- if (e.meta?.map)
6535
- parts.push(`map: ${e.meta.map}`);
6536
- const connection = this.connectionForEdge(e);
6555
+ if (meta && meta.friendlyPath)
6556
+ parts.push(`Destino: ${meta.friendlyPath}`);
6557
+ if (meta?.map)
6558
+ parts.push(`map: ${meta.map}`);
6537
6559
  if (connection) {
6538
6560
  parts.push(`Persistido: ${this.persistedSummary(connection)}`);
6539
6561
  parts.push(`Leitura observada: ${this.observedTargetPreview(connection)}`);
6540
6562
  }
6541
- if (e.meta?.canonicalLink) {
6542
- parts.push(`Canonico derivado: ${this.canonicalSummary(e.meta.canonicalLink)}`);
6563
+ if (meta?.canonicalLink) {
6564
+ parts.push(`Canonico derivado: ${this.canonicalSummary(meta.canonicalLink)}`);
6543
6565
  }
6544
- parts.push(`Diagnosticos: ${describeAuthoringDiagnostics(e.meta?.diagnostics)}`);
6566
+ parts.push(`Diagnosticos: ${describeAuthoringDiagnostics(meta?.diagnostics)}`);
6545
6567
  return parts.join('\n');
6546
6568
  }
6547
6569
  persistedSummary(connection) {
@@ -6552,8 +6574,14 @@ class ConnectionGraphComponent {
6552
6574
  ? describeCanonicalLink(canonicalLink)
6553
6575
  : 'sem link canonico derivado';
6554
6576
  }
6577
+ currentConnectionKind() {
6578
+ return this.selectedEdgeMeta()?.connectionKind;
6579
+ }
6580
+ currentCanonicalLink() {
6581
+ return this.selectedEdgeMeta()?.canonicalLink;
6582
+ }
6555
6583
  currentDiagnosticsSummary() {
6556
- return describeAuthoringDiagnostics(this.currentEdge()?.meta?.diagnostics);
6584
+ return describeAuthoringDiagnostics(this.selectedEdgeMeta()?.diagnostics);
6557
6585
  }
6558
6586
  observedTargetPreview(connection) {
6559
6587
  return describeObservedTargetValue(connection, this.widgets);
@@ -6752,6 +6780,24 @@ class ConnectionGraphComponent {
6752
6780
  const index = this.edges().indexOf(edge);
6753
6781
  return index >= 0 ? this.connections()[index] : undefined;
6754
6782
  }
6783
+ selectedEdgeMeta() {
6784
+ return this.edgeMeta(this.currentEdge());
6785
+ }
6786
+ edgeMeta(edge) {
6787
+ if (edge?.meta) {
6788
+ return edge.meta;
6789
+ }
6790
+ const connection = edge ? this.connectionForEdge(edge) : this.currentConn();
6791
+ if (!connection) {
6792
+ return undefined;
6793
+ }
6794
+ const canonicalLink = deriveAuthoringCanonicalLink(connection);
6795
+ return {
6796
+ connectionKind: this.connectionKind(connection),
6797
+ canonicalLink,
6798
+ diagnostics: canonicalLink.diagnostics,
6799
+ };
6800
+ }
6755
6801
  emitPageChange() {
6756
6802
  const parsed = this.parsePage(this.page) || { widgets: this.widgets || [] };
6757
6803
  const updated = { ...parsed, connections: this.connections() };
@@ -6864,11 +6910,11 @@ class ConnectionGraphComponent {
6864
6910
  <button mat-icon-button (click)="showDetails=false" aria-label="Fechar"><mat-icon>close</mat-icon></button>
6865
6911
  </div>
6866
6912
  <div class="details-body" *ngIf="currentConn() as c">
6867
- <div><b>Tipo:</b> {{ connectionKindLabel(currentEdge()?.meta?.connectionKind) }}</div>
6913
+ <div><b>Tipo:</b> {{ connectionKindLabel(currentConnectionKind()) }}</div>
6868
6914
  <div><b>De:</b> {{ fromLabel(c) }}</div>
6869
6915
  <div><b>Para:</b> {{ toLabel(c) }}</div>
6870
6916
  <div><b>Persistido:</b> {{ persistedSummary(c) }}</div>
6871
- <div *ngIf="currentEdge()?.meta?.canonicalLink as canonicalLink">
6917
+ <div *ngIf="currentCanonicalLink() as canonicalLink">
6872
6918
  <b>Canonico derivado:</b> {{ canonicalSummary(canonicalLink) }}
6873
6919
  </div>
6874
6920
  <div><b>Diagnosticos:</b> {{ currentDiagnosticsSummary() }}</div>
@@ -7010,11 +7056,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
7010
7056
  <button mat-icon-button (click)="showDetails=false" aria-label="Fechar"><mat-icon>close</mat-icon></button>
7011
7057
  </div>
7012
7058
  <div class="details-body" *ngIf="currentConn() as c">
7013
- <div><b>Tipo:</b> {{ connectionKindLabel(currentEdge()?.meta?.connectionKind) }}</div>
7059
+ <div><b>Tipo:</b> {{ connectionKindLabel(currentConnectionKind()) }}</div>
7014
7060
  <div><b>De:</b> {{ fromLabel(c) }}</div>
7015
7061
  <div><b>Para:</b> {{ toLabel(c) }}</div>
7016
7062
  <div><b>Persistido:</b> {{ persistedSummary(c) }}</div>
7017
- <div *ngIf="currentEdge()?.meta?.canonicalLink as canonicalLink">
7063
+ <div *ngIf="currentCanonicalLink() as canonicalLink">
7018
7064
  <b>Canonico derivado:</b> {{ canonicalSummary(canonicalLink) }}
7019
7065
  </div>
7020
7066
  <div><b>Diagnosticos:</b> {{ currentDiagnosticsSummary() }}</div>
@@ -7712,4 +7758,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
7712
7758
  */
7713
7759
 
7714
7760
  export { ComponentPaletteDialogComponent, ConfirmDialogComponent, ConnectionBuilderComponent, DynamicPageBuilderComponent, DynamicPageConfigEditorComponent, FloatingToolbarComponent, PAGE_BUILDER_AI_CAPABILITIES, PAGE_BUILDER_WIDGET_AI_CATALOGS, PLACEHOLDER, PageConfigEditorComponent, TileToolbarComponent, WidgetShellEditorComponent, clearWidgetAiCatalogs, getPageAiCatalog, getWidgetAiCapabilities, providePageBuilderWidgetAiCatalogs, registerWidgetAiCatalog, registerWidgetAiCatalogs };
7715
- //# sourceMappingURL=praxisui-page-builder.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/page-builder",
3
- "version": "3.0.0-beta.8",
3
+ "version": "3.0.0-beta.9",
4
4
  "description": "Page and widget builder utilities for Praxis UI (grid, dynamic widgets, editors).",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.0.0",
@@ -8,8 +8,8 @@
8
8
  "@angular/forms": "^20.0.0",
9
9
  "@angular/cdk": "^20.0.0",
10
10
  "@angular/material": "^20.0.0",
11
- "@praxisui/core": "^3.0.0-beta.8",
12
- "@praxisui/settings-panel": "^3.0.0-beta.8"
11
+ "@praxisui/core": "^3.0.0-beta.9",
12
+ "@praxisui/settings-panel": "^3.0.0-beta.9"
13
13
  },
14
14
  "dependencies": {
15
15
  "tslib": "^2.3.0"