@praxisui/page-builder 9.0.0-beta.10 → 9.0.0-beta.11
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.
|
@@ -12999,7 +12999,7 @@ function compileUiCompositionPlan(plan) {
|
|
|
12999
12999
|
page: {
|
|
13000
13000
|
layoutPreset: plan.layoutPreset,
|
|
13001
13001
|
layoutPresetOptions: clone(plan.layoutPresetOptions),
|
|
13002
|
-
canvas:
|
|
13002
|
+
canvas: resolveCanvas(plan),
|
|
13003
13003
|
deviceLayouts: clone(plan.deviceLayouts),
|
|
13004
13004
|
grouping: clone(plan.grouping),
|
|
13005
13005
|
slotAssignments: clone(plan.slotAssignments),
|
|
@@ -13014,6 +13014,88 @@ function compileUiCompositionPlan(plan) {
|
|
|
13014
13014
|
diagnostics: [],
|
|
13015
13015
|
};
|
|
13016
13016
|
}
|
|
13017
|
+
function resolveCanvas(plan) {
|
|
13018
|
+
if (plan.canvas) {
|
|
13019
|
+
return clone(plan.canvas);
|
|
13020
|
+
}
|
|
13021
|
+
if (!plan.widgets?.length) {
|
|
13022
|
+
return undefined;
|
|
13023
|
+
}
|
|
13024
|
+
if (isMasterDetailPlan(plan)) {
|
|
13025
|
+
return masterDetailCanvas(plan.widgets);
|
|
13026
|
+
}
|
|
13027
|
+
return stackedCanvas(plan.widgets);
|
|
13028
|
+
}
|
|
13029
|
+
function isMasterDetailPlan(plan) {
|
|
13030
|
+
const preset = (plan.layoutPreset ?? '').toLocaleLowerCase('en-US');
|
|
13031
|
+
const hasPreset = preset.includes('master-detail') || preset.includes('master detail');
|
|
13032
|
+
const hasSemanticRoles = plan.widgets.some((widget) => widget.role === 'master')
|
|
13033
|
+
&& plan.widgets.some((widget) => widget.role === 'detail');
|
|
13034
|
+
return hasPreset || hasSemanticRoles;
|
|
13035
|
+
}
|
|
13036
|
+
function masterDetailCanvas(widgets) {
|
|
13037
|
+
const master = widgets.find((widget) => widget.role === 'master') ?? widgets[0];
|
|
13038
|
+
const details = widgets.filter((widget) => widget.key !== master.key);
|
|
13039
|
+
const items = {};
|
|
13040
|
+
let row = 1;
|
|
13041
|
+
items[master.key] = {
|
|
13042
|
+
col: 1,
|
|
13043
|
+
row,
|
|
13044
|
+
colSpan: 12,
|
|
13045
|
+
rowSpan: preferredRowSpan(master),
|
|
13046
|
+
};
|
|
13047
|
+
row += items[master.key].rowSpan;
|
|
13048
|
+
for (const widget of details) {
|
|
13049
|
+
const rowSpan = preferredRowSpan(widget);
|
|
13050
|
+
items[widget.key] = {
|
|
13051
|
+
col: 1,
|
|
13052
|
+
row,
|
|
13053
|
+
colSpan: 12,
|
|
13054
|
+
rowSpan,
|
|
13055
|
+
};
|
|
13056
|
+
row += rowSpan;
|
|
13057
|
+
}
|
|
13058
|
+
return defaultCanvas(items);
|
|
13059
|
+
}
|
|
13060
|
+
function stackedCanvas(widgets) {
|
|
13061
|
+
const items = {};
|
|
13062
|
+
let row = 1;
|
|
13063
|
+
for (const widget of widgets) {
|
|
13064
|
+
const rowSpan = preferredRowSpan(widget);
|
|
13065
|
+
items[widget.key] = {
|
|
13066
|
+
col: 1,
|
|
13067
|
+
row,
|
|
13068
|
+
colSpan: 12,
|
|
13069
|
+
rowSpan,
|
|
13070
|
+
};
|
|
13071
|
+
row += rowSpan;
|
|
13072
|
+
}
|
|
13073
|
+
return defaultCanvas(items);
|
|
13074
|
+
}
|
|
13075
|
+
function defaultCanvas(items) {
|
|
13076
|
+
return {
|
|
13077
|
+
mode: 'grid',
|
|
13078
|
+
columns: 12,
|
|
13079
|
+
rowUnit: '80px',
|
|
13080
|
+
gap: '16px',
|
|
13081
|
+
autoRows: 'fixed',
|
|
13082
|
+
items,
|
|
13083
|
+
};
|
|
13084
|
+
}
|
|
13085
|
+
function preferredRowSpan(widget) {
|
|
13086
|
+
const componentId = widget.componentId.toLocaleLowerCase('en-US');
|
|
13087
|
+
if (componentId.includes('dynamic-form') || widget.role === 'detail')
|
|
13088
|
+
return 8;
|
|
13089
|
+
if (componentId.includes('table') || componentId.includes('list'))
|
|
13090
|
+
return 7;
|
|
13091
|
+
if (componentId.includes('chart'))
|
|
13092
|
+
return 5;
|
|
13093
|
+
if (componentId.includes('kpi') || componentId.includes('filter'))
|
|
13094
|
+
return 2;
|
|
13095
|
+
if (componentId.includes('rich-content'))
|
|
13096
|
+
return 3;
|
|
13097
|
+
return 4;
|
|
13098
|
+
}
|
|
13017
13099
|
function validateUiCompositionPlan(plan) {
|
|
13018
13100
|
const diagnostics = [];
|
|
13019
13101
|
const widgetKeys = new Set();
|
|
@@ -14165,6 +14247,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
14165
14247
|
diagnostics: this.buildTurnDiagnostics(intentResolution, preview),
|
|
14166
14248
|
};
|
|
14167
14249
|
}
|
|
14250
|
+
this.normalizeDashboardPreviewPresentation(intentResolution, preview);
|
|
14168
14251
|
const applied = await this.context.applyLocalPreview(preview);
|
|
14169
14252
|
if (!applied.success) {
|
|
14170
14253
|
const message = applied.error || this.context.tx('agentic.errors.applyLocal', 'Preview could not be applied.');
|
|
@@ -14326,6 +14409,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
14326
14409
|
return this.completeExecutableStreamPreview(request, prompt, intentResolution, undefined);
|
|
14327
14410
|
}
|
|
14328
14411
|
async applyDashboardRepairPreview(preview, intentResolution) {
|
|
14412
|
+
this.normalizeDashboardPreviewPresentation(intentResolution, preview);
|
|
14329
14413
|
const applied = await this.context.applyLocalPreview(preview);
|
|
14330
14414
|
if (!applied.success) {
|
|
14331
14415
|
const message = applied.error || this.context.tx('agentic.errors.applyLocal', 'Preview could not be applied.');
|
|
@@ -15543,6 +15627,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15543
15627
|
diagnostics: this.buildTurnDiagnostics(intentResolution, preview),
|
|
15544
15628
|
};
|
|
15545
15629
|
}
|
|
15630
|
+
this.normalizeDashboardPreviewPresentation(intentResolution, preview);
|
|
15546
15631
|
const applied = await this.context.applyLocalPreview(preview);
|
|
15547
15632
|
if (!applied.success) {
|
|
15548
15633
|
const message = applied.error || this.context.tx('agentic.errors.applyLocal', 'Preview could not be applied.');
|
|
@@ -15692,6 +15777,139 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15692
15777
|
validation,
|
|
15693
15778
|
};
|
|
15694
15779
|
}
|
|
15780
|
+
normalizeDashboardPreviewPresentation(intentResolution, preview) {
|
|
15781
|
+
if (!this.isDashboardQualityPreview(intentResolution, preview)) {
|
|
15782
|
+
return;
|
|
15783
|
+
}
|
|
15784
|
+
const patch = this.toJsonObject(preview.compiledFormPatch)?.['patch'];
|
|
15785
|
+
const page = this.toJsonObject(this.toJsonObject(patch)?.['page']);
|
|
15786
|
+
if (page) {
|
|
15787
|
+
this.normalizeDashboardPagePresentation(intentResolution, page);
|
|
15788
|
+
}
|
|
15789
|
+
const plan = this.toJsonObject(preview.uiCompositionPlan);
|
|
15790
|
+
if (plan) {
|
|
15791
|
+
this.normalizeDashboardPagePresentation(intentResolution, plan);
|
|
15792
|
+
for (const widget of this.arrayFromUnknown(plan['widgets'])) {
|
|
15793
|
+
const normalizedWidget = this.toJsonObject(widget);
|
|
15794
|
+
if (normalizedWidget) {
|
|
15795
|
+
this.normalizeDashboardWidgetPresentation(intentResolution, normalizedWidget);
|
|
15796
|
+
}
|
|
15797
|
+
}
|
|
15798
|
+
}
|
|
15799
|
+
}
|
|
15800
|
+
normalizeDashboardPagePresentation(intentResolution, page) {
|
|
15801
|
+
for (const widget of this.dashboardPageWidgets(page)) {
|
|
15802
|
+
this.normalizeDashboardWidgetPresentation(intentResolution, widget);
|
|
15803
|
+
}
|
|
15804
|
+
}
|
|
15805
|
+
normalizeDashboardWidgetPresentation(intentResolution, widget) {
|
|
15806
|
+
const resourcePath = this.dashboardWidgetResourcePath(widget)
|
|
15807
|
+
?? this.intentResourcePath(intentResolution);
|
|
15808
|
+
const businessTitle = this.dashboardBusinessTitle(resourcePath);
|
|
15809
|
+
if (!businessTitle) {
|
|
15810
|
+
return;
|
|
15811
|
+
}
|
|
15812
|
+
const shell = this.toJsonObject(widget['shell']);
|
|
15813
|
+
if (shell) {
|
|
15814
|
+
if (this.isTechnicalDashboardResourceTitle(this.readString(shell, 'title'), resourcePath)) {
|
|
15815
|
+
shell['title'] = businessTitle;
|
|
15816
|
+
}
|
|
15817
|
+
const subtitle = this.readString(shell, 'subtitle');
|
|
15818
|
+
if (subtitle && this.containsTechnicalDashboardResourceLabel(subtitle, resourcePath)) {
|
|
15819
|
+
shell['subtitle'] = this.dashboardBusinessSubtitle(businessTitle);
|
|
15820
|
+
}
|
|
15821
|
+
widget['shell'] = shell;
|
|
15822
|
+
}
|
|
15823
|
+
const inputs = this.dashboardWidgetInputs(widget);
|
|
15824
|
+
let inputsChanged = false;
|
|
15825
|
+
if (this.isTechnicalDashboardResourceTitle(this.readString(inputs, 'title'), resourcePath)) {
|
|
15826
|
+
inputs['title'] = businessTitle;
|
|
15827
|
+
inputsChanged = true;
|
|
15828
|
+
}
|
|
15829
|
+
const inputSubtitle = this.readString(inputs, 'subtitle');
|
|
15830
|
+
if (inputSubtitle && this.containsTechnicalDashboardResourceLabel(inputSubtitle, resourcePath)) {
|
|
15831
|
+
inputs['subtitle'] = this.dashboardBusinessSubtitle(businessTitle);
|
|
15832
|
+
inputsChanged = true;
|
|
15833
|
+
}
|
|
15834
|
+
if (inputsChanged) {
|
|
15835
|
+
this.setDashboardWidgetInputs(widget, inputs);
|
|
15836
|
+
}
|
|
15837
|
+
}
|
|
15838
|
+
dashboardWidgetResourcePath(widget) {
|
|
15839
|
+
const inputs = this.dashboardWidgetInputs(widget);
|
|
15840
|
+
const source = this.toJsonObject(inputs['source']);
|
|
15841
|
+
return this.readString(inputs, 'resourcePath')
|
|
15842
|
+
?? this.readString(source ?? {}, 'resource')
|
|
15843
|
+
?? this.readString(source ?? {}, 'resourcePath')
|
|
15844
|
+
?? null;
|
|
15845
|
+
}
|
|
15846
|
+
intentResourcePath(intentResolution) {
|
|
15847
|
+
const selectedCandidate = this.toJsonObject(intentResolution.selectedCandidate);
|
|
15848
|
+
const target = this.toJsonObject(intentResolution.target);
|
|
15849
|
+
const contextHints = this.toJsonObject(intentResolution.contextHints);
|
|
15850
|
+
return this.readString(selectedCandidate ?? {}, 'resourcePath')
|
|
15851
|
+
?? this.readString(target ?? {}, 'resourcePath')
|
|
15852
|
+
?? this.readString(contextHints ?? {}, 'resourcePath')
|
|
15853
|
+
?? null;
|
|
15854
|
+
}
|
|
15855
|
+
isTechnicalDashboardResourceTitle(value, resourcePath) {
|
|
15856
|
+
const normalized = this.normalizeText(value ?? '');
|
|
15857
|
+
if (!normalized) {
|
|
15858
|
+
return false;
|
|
15859
|
+
}
|
|
15860
|
+
if (normalized.includes('/api/')) {
|
|
15861
|
+
return true;
|
|
15862
|
+
}
|
|
15863
|
+
const resourceLabel = this.normalizeText(this.resourceLabelFromPath(resourcePath));
|
|
15864
|
+
if (resourceLabel && normalized === resourceLabel) {
|
|
15865
|
+
return true;
|
|
15866
|
+
}
|
|
15867
|
+
return /\b(vw|view|analytics|analytic|indicadores)\b/.test(normalized);
|
|
15868
|
+
}
|
|
15869
|
+
containsTechnicalDashboardResourceLabel(value, resourcePath) {
|
|
15870
|
+
const normalized = this.normalizeText(value);
|
|
15871
|
+
if (normalized.includes('/api/') || /\b(vw|view)\b/.test(normalized)) {
|
|
15872
|
+
return true;
|
|
15873
|
+
}
|
|
15874
|
+
const resourceLabel = this.normalizeText(this.resourceLabelFromPath(resourcePath));
|
|
15875
|
+
return !!resourceLabel && normalized.includes(resourceLabel);
|
|
15876
|
+
}
|
|
15877
|
+
dashboardBusinessTitle(resourcePath) {
|
|
15878
|
+
const subject = this.dashboardBusinessSubject(resourcePath);
|
|
15879
|
+
return subject ? `Dashboard de ${subject}` : null;
|
|
15880
|
+
}
|
|
15881
|
+
dashboardBusinessSubtitle(title) {
|
|
15882
|
+
return `Visao executiva orientada a decisao para ${title.replace(/^Dashboard de\s+/i, '')}.`;
|
|
15883
|
+
}
|
|
15884
|
+
dashboardBusinessSubject(resourcePath) {
|
|
15885
|
+
const label = this.resourceLabelFromPath(resourcePath);
|
|
15886
|
+
if (!label) {
|
|
15887
|
+
return null;
|
|
15888
|
+
}
|
|
15889
|
+
const words = label
|
|
15890
|
+
.replace(/\b(vw|view|analytics|analytic|indicadores|dashboard|resource)\b/gi, ' ')
|
|
15891
|
+
.replace(/[_-]+/g, ' ')
|
|
15892
|
+
.replace(/\s+/g, ' ')
|
|
15893
|
+
.trim()
|
|
15894
|
+
.toLowerCase();
|
|
15895
|
+
if (!words) {
|
|
15896
|
+
return null;
|
|
15897
|
+
}
|
|
15898
|
+
return words;
|
|
15899
|
+
}
|
|
15900
|
+
resourceLabelFromPath(resourcePath) {
|
|
15901
|
+
if (!resourcePath) {
|
|
15902
|
+
return '';
|
|
15903
|
+
}
|
|
15904
|
+
return resourcePath
|
|
15905
|
+
.split('?')[0]
|
|
15906
|
+
.split('/')
|
|
15907
|
+
.filter(Boolean)
|
|
15908
|
+
.pop()
|
|
15909
|
+
?.replace(/[_-]+/g, ' ')
|
|
15910
|
+
.replace(/\s+/g, ' ')
|
|
15911
|
+
.trim() ?? '';
|
|
15912
|
+
}
|
|
15695
15913
|
extractDashboardPlannerDiagnostics(plan) {
|
|
15696
15914
|
const diagnostics = this.toJsonObject(plan?.['diagnostics']);
|
|
15697
15915
|
if (!diagnostics) {
|
|
@@ -18127,6 +18345,7 @@ class DynamicPageBuilderComponent {
|
|
|
18127
18345
|
margin: 24,
|
|
18128
18346
|
}), ...(ngDevMode ? [{ debugName: "agenticAuthoringPanelLayout" }] : /* istanbul ignore next */ []));
|
|
18129
18347
|
previewMode = false;
|
|
18348
|
+
runtimePreviewPageCache;
|
|
18130
18349
|
agenticComponentCapabilities;
|
|
18131
18350
|
agenticComponentCapabilitiesPromise;
|
|
18132
18351
|
agenticTurnController;
|
|
@@ -18164,6 +18383,18 @@ class DynamicPageBuilderComponent {
|
|
|
18164
18383
|
isPreviewMode() {
|
|
18165
18384
|
return this.previewMode;
|
|
18166
18385
|
}
|
|
18386
|
+
runtimePage() {
|
|
18387
|
+
const page = this.currentPage();
|
|
18388
|
+
if (!this.previewMode) {
|
|
18389
|
+
return page;
|
|
18390
|
+
}
|
|
18391
|
+
if (this.runtimePreviewPageCache?.source === page) {
|
|
18392
|
+
return this.runtimePreviewPageCache.value;
|
|
18393
|
+
}
|
|
18394
|
+
const value = this.toPresentationRuntimePage(page);
|
|
18395
|
+
this.runtimePreviewPageCache = { source: page, value };
|
|
18396
|
+
return value;
|
|
18397
|
+
}
|
|
18167
18398
|
builderModeLabel() {
|
|
18168
18399
|
if (this.previewMode) {
|
|
18169
18400
|
return this.tx('builderMode.preview', 'Prévia');
|
|
@@ -18219,11 +18450,7 @@ class DynamicPageBuilderComponent {
|
|
|
18219
18450
|
togglePreview() {
|
|
18220
18451
|
this.previewMode = !this.previewMode;
|
|
18221
18452
|
if (this.previewMode) {
|
|
18222
|
-
this.
|
|
18223
|
-
this.agenticAuthoringLlmDiagnostics.set(null);
|
|
18224
|
-
this.sharedRuleCockpitCollapsed.set(true);
|
|
18225
|
-
this.projectKnowledgeCockpitCollapsed.set(true);
|
|
18226
|
-
this.selectedWidgetKey.set(null);
|
|
18453
|
+
this.enterPreviewMode();
|
|
18227
18454
|
}
|
|
18228
18455
|
}
|
|
18229
18456
|
toggleAgenticAuthoringLlmDiagnostics() {
|
|
@@ -18560,12 +18787,19 @@ class DynamicPageBuilderComponent {
|
|
|
18560
18787
|
this.agenticAuthoringPanelLayout.set(layout);
|
|
18561
18788
|
}
|
|
18562
18789
|
agenticAuthoringReviewRailActive() {
|
|
18563
|
-
return this.
|
|
18564
|
-
&& this.enableAgenticAuthoring
|
|
18565
|
-
&& this.agenticAuthoringOpen()
|
|
18790
|
+
return this.showAgenticAuthoringPanel()
|
|
18566
18791
|
&& !!this.agenticAuthoringPreviewResult()?.valid
|
|
18567
18792
|
&& !this.agenticAuthoringPanelLayoutTouched;
|
|
18568
18793
|
}
|
|
18794
|
+
showAgenticAuthoringPanel() {
|
|
18795
|
+
if (!this.enableAgenticAuthoring || !this.agenticAuthoringOpen()) {
|
|
18796
|
+
return false;
|
|
18797
|
+
}
|
|
18798
|
+
if (this.showSettings()) {
|
|
18799
|
+
return true;
|
|
18800
|
+
}
|
|
18801
|
+
return this.previewMode && this.hasAgenticAuthoringSession();
|
|
18802
|
+
}
|
|
18569
18803
|
showAgenticAuthoringDock() {
|
|
18570
18804
|
return this.showSettings()
|
|
18571
18805
|
&& this.enableAgenticAuthoring
|
|
@@ -19147,7 +19381,7 @@ class DynamicPageBuilderComponent {
|
|
|
19147
19381
|
id: 'semantic-decision-resource',
|
|
19148
19382
|
kind: 'custom',
|
|
19149
19383
|
label: this.tx('agentic.context.semanticDecisionResource', 'Fonte'),
|
|
19150
|
-
value: this.humanizeAgenticResourcePath(resourcePath),
|
|
19384
|
+
value: this.agenticSemanticResourceLabel(selectedResource) ?? this.humanizeAgenticResourcePath(resourcePath),
|
|
19151
19385
|
icon: 'dataset',
|
|
19152
19386
|
});
|
|
19153
19387
|
}
|
|
@@ -19202,6 +19436,15 @@ class DynamicPageBuilderComponent {
|
|
|
19202
19436
|
.replace(/[-_]+/g, ' ')
|
|
19203
19437
|
.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
19204
19438
|
}
|
|
19439
|
+
agenticSemanticResourceLabel(resource) {
|
|
19440
|
+
return this.trimmedString(resource?.['selectedResourceLabel'])
|
|
19441
|
+
?? this.trimmedString(resource?.['resourceLabel'])
|
|
19442
|
+
?? this.trimmedString(resource?.['publicLabel'])
|
|
19443
|
+
?? this.trimmedString(resource?.['displayName'])
|
|
19444
|
+
?? this.trimmedString(resource?.['title'])
|
|
19445
|
+
?? this.trimmedString(resource?.['label'])
|
|
19446
|
+
?? this.trimmedString(resource?.['name']);
|
|
19447
|
+
}
|
|
19205
19448
|
humanizeAgenticDecisionSummary(operationKind, artifactKind, changeKind) {
|
|
19206
19449
|
const operation = this.humanizeAgenticOperationKind(operationKind);
|
|
19207
19450
|
const artifact = this.humanizeAgenticArtifactKind(artifactKind);
|
|
@@ -20479,8 +20722,41 @@ class DynamicPageBuilderComponent {
|
|
|
20479
20722
|
error: this.tx('agentic.errors.invalidTableContract', 'Encontrei a fonte de dados, mas a tabela proposta usa informações que esse componente não aceita. Vou ajustar para usar apenas campos compatíveis.'),
|
|
20480
20723
|
};
|
|
20481
20724
|
}
|
|
20725
|
+
if (applied.success && this.enableCustomization) {
|
|
20726
|
+
this.enterPreviewMode();
|
|
20727
|
+
}
|
|
20482
20728
|
return applied;
|
|
20483
20729
|
}
|
|
20730
|
+
enterPreviewMode() {
|
|
20731
|
+
this.previewMode = true;
|
|
20732
|
+
this.runtimePreviewPageCache = undefined;
|
|
20733
|
+
this.connectionsViewerOpen.set(false);
|
|
20734
|
+
this.agenticAuthoringLlmDiagnostics.set(null);
|
|
20735
|
+
this.sharedRuleCockpitCollapsed.set(true);
|
|
20736
|
+
this.projectKnowledgeCockpitCollapsed.set(true);
|
|
20737
|
+
this.selectedWidgetKey.set(null);
|
|
20738
|
+
}
|
|
20739
|
+
toPresentationRuntimePage(page) {
|
|
20740
|
+
const cloned = this.clonePage(page);
|
|
20741
|
+
cloned.widgets = (cloned.widgets || []).map((widget) => this.toPresentationRuntimeWidget(widget));
|
|
20742
|
+
return cloned;
|
|
20743
|
+
}
|
|
20744
|
+
toPresentationRuntimeWidget(widget) {
|
|
20745
|
+
const inputs = widget.definition?.inputs;
|
|
20746
|
+
if (!inputs || inputs['enableCustomization'] !== true) {
|
|
20747
|
+
return widget;
|
|
20748
|
+
}
|
|
20749
|
+
return {
|
|
20750
|
+
...widget,
|
|
20751
|
+
definition: {
|
|
20752
|
+
...widget.definition,
|
|
20753
|
+
inputs: {
|
|
20754
|
+
...inputs,
|
|
20755
|
+
enableCustomization: false,
|
|
20756
|
+
},
|
|
20757
|
+
},
|
|
20758
|
+
};
|
|
20759
|
+
}
|
|
20484
20760
|
async applyAgenticTurnState(state) {
|
|
20485
20761
|
const preview = state.preview ?? null;
|
|
20486
20762
|
const handoff = this.resolveAgenticSharedRuleHandoff(state);
|
|
@@ -20789,7 +21065,32 @@ class DynamicPageBuilderComponent {
|
|
|
20789
21065
|
resolveAgenticSemanticDecision(diagnostics) {
|
|
20790
21066
|
const intentResolution = this.toRecord(diagnostics?.['intentResolution']);
|
|
20791
21067
|
const semanticDecision = this.toRecord(intentResolution?.['semanticDecision']);
|
|
20792
|
-
|
|
21068
|
+
if (!semanticDecision) {
|
|
21069
|
+
return null;
|
|
21070
|
+
}
|
|
21071
|
+
const selectedResource = this.toRecord(semanticDecision['selectedResource']);
|
|
21072
|
+
if (!selectedResource) {
|
|
21073
|
+
return semanticDecision;
|
|
21074
|
+
}
|
|
21075
|
+
const selectedResourceLabel = this.agenticSemanticResourceLabel(selectedResource);
|
|
21076
|
+
if (selectedResourceLabel) {
|
|
21077
|
+
return semanticDecision;
|
|
21078
|
+
}
|
|
21079
|
+
const selectedCandidate = this.toRecord(intentResolution?.['selectedCandidate']);
|
|
21080
|
+
const contextHints = this.toRecord(intentResolution?.['contextHints']);
|
|
21081
|
+
const label = this.agenticSemanticResourceLabel(semanticDecision)
|
|
21082
|
+
?? this.agenticSemanticResourceLabel(selectedCandidate)
|
|
21083
|
+
?? this.agenticSemanticResourceLabel(contextHints);
|
|
21084
|
+
if (!label) {
|
|
21085
|
+
return semanticDecision;
|
|
21086
|
+
}
|
|
21087
|
+
return {
|
|
21088
|
+
...semanticDecision,
|
|
21089
|
+
selectedResource: {
|
|
21090
|
+
...selectedResource,
|
|
21091
|
+
label,
|
|
21092
|
+
},
|
|
21093
|
+
};
|
|
20793
21094
|
}
|
|
20794
21095
|
cloneAgenticContextHints(contextHints) {
|
|
20795
21096
|
if (!contextHints || typeof contextHints !== 'object' || Array.isArray(contextHints)) {
|
|
@@ -21126,7 +21427,7 @@ class DynamicPageBuilderComponent {
|
|
|
21126
21427
|
|
|
21127
21428
|
<praxis-dynamic-page
|
|
21128
21429
|
#runtime
|
|
21129
|
-
[page]="
|
|
21430
|
+
[page]="runtimePage()"
|
|
21130
21431
|
[context]="context"
|
|
21131
21432
|
[strictValidation]="strictValidation"
|
|
21132
21433
|
[autoPersist]="false"
|
|
@@ -21135,7 +21436,7 @@ class DynamicPageBuilderComponent {
|
|
|
21135
21436
|
[pageIdentity]="pageIdentity"
|
|
21136
21437
|
[componentInstanceId]="componentInstanceId"
|
|
21137
21438
|
[pageEditorComponent]="pageEditorComponent"
|
|
21138
|
-
[showWidgetAssistantButton]="enableAgenticAuthoring"
|
|
21439
|
+
[showWidgetAssistantButton]="showSettings() && enableAgenticAuthoring"
|
|
21139
21440
|
(pageChange)="onRuntimePageChange($event)"
|
|
21140
21441
|
(widgetEvent)="onRuntimeWidgetEvent($event)"
|
|
21141
21442
|
(widgetSelectionChange)="onRuntimeWidgetSelectionChange($event)"
|
|
@@ -21151,7 +21452,7 @@ class DynamicPageBuilderComponent {
|
|
|
21151
21452
|
(close)="connectionsViewerOpen.set(false)"
|
|
21152
21453
|
/>
|
|
21153
21454
|
|
|
21154
|
-
@if (
|
|
21455
|
+
@if (showAgenticAuthoringPanel()) {
|
|
21155
21456
|
<praxis-ai-assistant-shell
|
|
21156
21457
|
panelTestId="page-builder-agentic-authoring-panel"
|
|
21157
21458
|
testIdPrefix="page-builder-agentic"
|
|
@@ -21617,7 +21918,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
21617
21918
|
|
|
21618
21919
|
<praxis-dynamic-page
|
|
21619
21920
|
#runtime
|
|
21620
|
-
[page]="
|
|
21921
|
+
[page]="runtimePage()"
|
|
21621
21922
|
[context]="context"
|
|
21622
21923
|
[strictValidation]="strictValidation"
|
|
21623
21924
|
[autoPersist]="false"
|
|
@@ -21626,7 +21927,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
21626
21927
|
[pageIdentity]="pageIdentity"
|
|
21627
21928
|
[componentInstanceId]="componentInstanceId"
|
|
21628
21929
|
[pageEditorComponent]="pageEditorComponent"
|
|
21629
|
-
[showWidgetAssistantButton]="enableAgenticAuthoring"
|
|
21930
|
+
[showWidgetAssistantButton]="showSettings() && enableAgenticAuthoring"
|
|
21630
21931
|
(pageChange)="onRuntimePageChange($event)"
|
|
21631
21932
|
(widgetEvent)="onRuntimeWidgetEvent($event)"
|
|
21632
21933
|
(widgetSelectionChange)="onRuntimeWidgetSelectionChange($event)"
|
|
@@ -21642,7 +21943,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
21642
21943
|
(close)="connectionsViewerOpen.set(false)"
|
|
21643
21944
|
/>
|
|
21644
21945
|
|
|
21645
|
-
@if (
|
|
21946
|
+
@if (showAgenticAuthoringPanel()) {
|
|
21646
21947
|
<praxis-ai-assistant-shell
|
|
21647
21948
|
panelTestId="page-builder-agentic-authoring-panel"
|
|
21648
21949
|
testIdPrefix="page-builder-agentic"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/page-builder",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.11",
|
|
4
4
|
"description": "Page and widget builder utilities for Praxis UI (grid, dynamic widgets, editors).",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"@angular/forms": "^21.0.0",
|
|
9
9
|
"@angular/cdk": "^21.0.0",
|
|
10
10
|
"@angular/material": "^21.0.0",
|
|
11
|
-
"@praxisui/ai": "^9.0.0-beta.
|
|
12
|
-
"@praxisui/core": "^9.0.0-beta.
|
|
13
|
-
"@praxisui/settings-panel": "^9.0.0-beta.
|
|
11
|
+
"@praxisui/ai": "^9.0.0-beta.11",
|
|
12
|
+
"@praxisui/core": "^9.0.0-beta.11",
|
|
13
|
+
"@praxisui/settings-panel": "^9.0.0-beta.11",
|
|
14
14
|
"rxjs": "~7.8.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
@@ -1728,6 +1728,7 @@ declare class DynamicPageBuilderComponent implements OnChanges, OnDestroy {
|
|
|
1728
1728
|
readonly agenticAuthoringWidgetContextKey: _angular_core.WritableSignal<string | null>;
|
|
1729
1729
|
readonly agenticAuthoringPanelLayout: _angular_core.WritableSignal<PraxisAssistantShellLayout>;
|
|
1730
1730
|
private previewMode;
|
|
1731
|
+
private runtimePreviewPageCache?;
|
|
1731
1732
|
private agenticComponentCapabilities?;
|
|
1732
1733
|
private agenticComponentCapabilitiesPromise?;
|
|
1733
1734
|
private agenticTurnController?;
|
|
@@ -1741,6 +1742,7 @@ declare class DynamicPageBuilderComponent implements OnChanges, OnDestroy {
|
|
|
1741
1742
|
ngOnDestroy(): void;
|
|
1742
1743
|
showSettings(): boolean;
|
|
1743
1744
|
isPreviewMode(): boolean;
|
|
1745
|
+
runtimePage(): WidgetPageDefinition;
|
|
1744
1746
|
builderModeLabel(): string;
|
|
1745
1747
|
onRuntimePageChange(next: WidgetPageDefinition): void;
|
|
1746
1748
|
onRuntimeWidgetEvent(event: WidgetEventEnvelope): void;
|
|
@@ -1774,6 +1776,7 @@ declare class DynamicPageBuilderComponent implements OnChanges, OnDestroy {
|
|
|
1774
1776
|
minimizeAgenticAuthoring(): void;
|
|
1775
1777
|
onAgenticAuthoringLayoutChange(layout: AgenticAuthoringPanelLayout): void;
|
|
1776
1778
|
agenticAuthoringReviewRailActive(): boolean;
|
|
1779
|
+
showAgenticAuthoringPanel(): boolean;
|
|
1777
1780
|
showAgenticAuthoringDock(): boolean;
|
|
1778
1781
|
agenticAuthoringMinimized(): boolean;
|
|
1779
1782
|
agenticAuthoringToggleLabel(): string;
|
|
@@ -1811,6 +1814,7 @@ declare class DynamicPageBuilderComponent implements OnChanges, OnDestroy {
|
|
|
1811
1814
|
private agenticAuthoringSemanticDecisionContextItems;
|
|
1812
1815
|
private shouldHideSemanticDecisionContextItems;
|
|
1813
1816
|
private humanizeAgenticResourcePath;
|
|
1817
|
+
private agenticSemanticResourceLabel;
|
|
1814
1818
|
private humanizeAgenticDecisionSummary;
|
|
1815
1819
|
private humanizeAgenticOperationKind;
|
|
1816
1820
|
private humanizeAgenticArtifactKind;
|
|
@@ -1896,6 +1900,9 @@ declare class DynamicPageBuilderComponent implements OnChanges, OnDestroy {
|
|
|
1896
1900
|
private collectRuntimeComponentObservationsForAgenticTurn;
|
|
1897
1901
|
private ensureAgenticTurnController;
|
|
1898
1902
|
private applyAgenticPreviewLocally;
|
|
1903
|
+
private enterPreviewMode;
|
|
1904
|
+
private toPresentationRuntimePage;
|
|
1905
|
+
private toPresentationRuntimeWidget;
|
|
1899
1906
|
private applyAgenticTurnState;
|
|
1900
1907
|
private primeSharedRuleHandoff;
|
|
1901
1908
|
private moveAgenticAuthoringPanelToReviewSidecar;
|