@praxisui/manual-form 10.0.0-rc.70 → 10.0.0-rc.72
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-11-
|
|
3
|
+
"generatedAt": "2026-11-30T08:57:00.866Z",
|
|
4
4
|
"packageName": "@praxisui/manual-form",
|
|
5
|
-
"packageVersion": "10.0.0-rc.
|
|
5
|
+
"packageVersion": "10.0.0-rc.72",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 1,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ensureIds, DynamicFormService, ASYNC_CONFIG_STORAGE, RULE_PROPERTY_SCHEMA, deepMerge, PRAXIS_RUNTIME_FORM_VALUE_PROPOSAL_SCHEMA_VERSION, resolveControlTypeAlias, FieldControlType, normalizeControlTypeKey, PraxisIconButtonComponent, FormHooksRegistry, ComponentKeyService, FIELD_SELECTOR_REGISTRY_DISABLE_DEFAULTS, DEFAULT_FIELD_SELECTOR_CONTROL_TYPE_MAP, FieldSelectorRegistry, PraxisRuntimeFormValueSessionJournal, previewRuntimeFormValueProposal, applyRuntimeFormValueProposal, undoRuntimeFormValueApply, instanceKeyFor, evaluateFieldAccess, providePraxisI18n, PraxisI18nService, API_URL, ComponentMetadataRegistry } from '@praxisui/core';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, Optional, Inject, Injectable, input, output, ChangeDetectionStrategy, Component, Input, InjectionToken, isDevMode, EventEmitter, HostListener, ViewChild, Output, ChangeDetectorRef, DestroyRef, PLATFORM_ID, effect, ContentChildren, signal, computed, Directive, ENVIRONMENT_INITIALIZER } from '@angular/core';
|
|
3
|
+
import { inject, Optional, Inject, Injectable, input, output, ChangeDetectionStrategy, Component, Input, InjectionToken, isDevMode, EventEmitter, HostListener, ViewChild, Output, ChangeDetectorRef, DestroyRef, PLATFORM_ID, effect, untracked, ContentChildren, signal, computed, Directive, ENVIRONMENT_INITIALIZER } from '@angular/core';
|
|
4
4
|
import { BehaviorSubject, firstValueFrom, debounceTime, fromEvent, of } from 'rxjs';
|
|
5
5
|
import { take } from 'rxjs/operators';
|
|
6
6
|
import { ActivatedRoute } from '@angular/router';
|
|
@@ -2285,14 +2285,31 @@ class ManualFormComponent {
|
|
|
2285
2285
|
aiApi = inject(AiBackendApiService);
|
|
2286
2286
|
assistantSessions = inject(PraxisAssistantSessionRegistryService);
|
|
2287
2287
|
aiTurnOrchestrator = inject(PraxisAssistantTurnOrchestratorService);
|
|
2288
|
+
aiAssistantSessionDismissed = false;
|
|
2289
|
+
lastSyncedAiAssistantSessionId = null;
|
|
2290
|
+
lastHandledDismissalSeq = this.assistantSessions.lastDismissedSession()?.seq ?? 0;
|
|
2288
2291
|
aiAssistantSessionEffect = effect(() => {
|
|
2289
2292
|
const session = this.assistantSessions.activeSession();
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
this.
|
|
2294
|
-
|
|
2293
|
+
untracked(() => {
|
|
2294
|
+
if (!session || session.id !== this.reconcileAiAssistantSessionIdentity())
|
|
2295
|
+
return;
|
|
2296
|
+
if (!this.aiAssistantOpen) {
|
|
2297
|
+
this.openAiAssistantFromSession(session);
|
|
2298
|
+
}
|
|
2299
|
+
});
|
|
2295
2300
|
}, ...(ngDevMode ? [{ debugName: "aiAssistantSessionEffect" }] : /* istanbul ignore next */ []));
|
|
2301
|
+
aiAssistantDismissEffect = effect(() => {
|
|
2302
|
+
const dismissedSeqs = this.assistantSessions.dismissedSessionSeqs();
|
|
2303
|
+
untracked(() => {
|
|
2304
|
+
const seq = dismissedSeqs[this.reconcileAiAssistantSessionIdentity()] ?? 0;
|
|
2305
|
+
if (seq <= this.lastHandledDismissalSeq)
|
|
2306
|
+
return;
|
|
2307
|
+
this.lastHandledDismissalSeq = seq;
|
|
2308
|
+
if (this.aiAssistantOpen || !this.aiAssistantSessionDismissed) {
|
|
2309
|
+
this.closeAiAssistant();
|
|
2310
|
+
}
|
|
2311
|
+
});
|
|
2312
|
+
}, ...(ngDevMode ? [{ debugName: "aiAssistantDismissEffect" }] : /* istanbul ignore next */ []));
|
|
2296
2313
|
warnedMissingId = false;
|
|
2297
2314
|
disableSelectorDefaults = inject(FIELD_SELECTOR_REGISTRY_DISABLE_DEFAULTS, { optional: true }) ?? false;
|
|
2298
2315
|
selectorToControlType = inject(MANUAL_FORM_SELECTOR_TO_CONTROL_TYPE, { optional: true }) ??
|
|
@@ -2412,7 +2429,9 @@ class ManualFormComponent {
|
|
|
2412
2429
|
this.toolbarOverlayRef?.dispose();
|
|
2413
2430
|
this.outsideClickSubscription?.unsubscribe();
|
|
2414
2431
|
this.clearRuntimeValueControlSubscriptions();
|
|
2432
|
+
this.reconcileAiAssistantSessionIdentity();
|
|
2415
2433
|
this.assistantSessions.removeContextSession(this.buildAiAssistantContextSnapshot().identity);
|
|
2434
|
+
this.lastSyncedAiAssistantSessionId = null;
|
|
2416
2435
|
this.aiAssistantStateSubscription?.unsubscribe();
|
|
2417
2436
|
}
|
|
2418
2437
|
get effectiveFormIsValid() {
|
|
@@ -2667,6 +2686,8 @@ class ManualFormComponent {
|
|
|
2667
2686
|
this.cdr.markForCheck();
|
|
2668
2687
|
}
|
|
2669
2688
|
openAiAssistant() {
|
|
2689
|
+
this.reconcileAiAssistantSessionIdentity();
|
|
2690
|
+
this.aiAssistantSessionDismissed = false;
|
|
2670
2691
|
this.initializeAiAssistantController();
|
|
2671
2692
|
this.aiAssistantOpen = true;
|
|
2672
2693
|
this.aiAssistantController?.setContextItems(this.buildAiAssistantContextItems());
|
|
@@ -2674,19 +2695,39 @@ class ManualFormComponent {
|
|
|
2674
2695
|
this.cdr.markForCheck();
|
|
2675
2696
|
}
|
|
2676
2697
|
openAiAssistantFromSession(session) {
|
|
2677
|
-
if (session.id !== this.
|
|
2698
|
+
if (session.id !== this.reconcileAiAssistantSessionIdentity())
|
|
2678
2699
|
return;
|
|
2700
|
+
this.aiAssistantSessionDismissed = false;
|
|
2679
2701
|
this.initializeAiAssistantController();
|
|
2680
2702
|
this.aiAssistantOpen = true;
|
|
2681
2703
|
this.aiAssistantController?.setContextItems(this.buildAiAssistantContextItems());
|
|
2682
2704
|
this.syncAiAssistantSession('active');
|
|
2683
2705
|
this.cdr.markForCheck();
|
|
2684
2706
|
}
|
|
2685
|
-
|
|
2707
|
+
minimizeAiAssistant() {
|
|
2708
|
+
this.reconcileAiAssistantSessionIdentity();
|
|
2709
|
+
this.aiAssistantSessionDismissed = false;
|
|
2686
2710
|
this.aiAssistantOpen = false;
|
|
2687
2711
|
this.syncAiAssistantSession('minimized');
|
|
2688
2712
|
this.cdr.markForCheck();
|
|
2689
2713
|
}
|
|
2714
|
+
closeAiAssistant() {
|
|
2715
|
+
const sessionId = this.reconcileAiAssistantSessionIdentity();
|
|
2716
|
+
this.aiAssistantSessionDismissed = true;
|
|
2717
|
+
this.aiAssistantOpen = false;
|
|
2718
|
+
this.lastSyncedAiAssistantSessionId = null;
|
|
2719
|
+
this.assistantSessions.removeSession(sessionId);
|
|
2720
|
+
if (this.aiAssistantViewState?.state === 'processing' || this.aiAssistantViewState?.state === 'applying') {
|
|
2721
|
+
this.aiAssistantController?.cancel().subscribe({
|
|
2722
|
+
next: (state) => {
|
|
2723
|
+
this.aiAssistantViewState = state;
|
|
2724
|
+
this.cdr.markForCheck();
|
|
2725
|
+
},
|
|
2726
|
+
error: () => undefined,
|
|
2727
|
+
});
|
|
2728
|
+
}
|
|
2729
|
+
this.cdr.markForCheck();
|
|
2730
|
+
}
|
|
2690
2731
|
onAiAssistantPromptChange(prompt) {
|
|
2691
2732
|
this.aiAssistantPrompt = prompt;
|
|
2692
2733
|
this.syncAiAssistantSession();
|
|
@@ -2881,6 +2922,9 @@ class ManualFormComponent {
|
|
|
2881
2922
|
syncAiAssistantSession(visibility = null) {
|
|
2882
2923
|
if (!this.showAiAssistant() && !this.enableCustomization())
|
|
2883
2924
|
return;
|
|
2925
|
+
const sessionId = this.reconcileAiAssistantSessionIdentity();
|
|
2926
|
+
if (visibility !== 'active' && !this.aiAssistantOpen && this.aiAssistantSessionDismissed)
|
|
2927
|
+
return;
|
|
2884
2928
|
if (!this.aiAssistantOpen && !this.hasAiAssistantSessionState() && visibility !== 'minimized')
|
|
2885
2929
|
return;
|
|
2886
2930
|
const state = this.aiAssistantViewState;
|
|
@@ -2893,6 +2937,16 @@ class ManualFormComponent {
|
|
|
2893
2937
|
badge: this.resolveAiAssistantBadge(),
|
|
2894
2938
|
icon: this.resolveAiAssistantIcon(),
|
|
2895
2939
|
});
|
|
2940
|
+
this.lastSyncedAiAssistantSessionId = sessionId;
|
|
2941
|
+
}
|
|
2942
|
+
reconcileAiAssistantSessionIdentity() {
|
|
2943
|
+
const sessionId = this.resolveAiAssistantSessionId();
|
|
2944
|
+
if (this.lastSyncedAiAssistantSessionId && this.lastSyncedAiAssistantSessionId !== sessionId) {
|
|
2945
|
+
this.assistantSessions.removeSession(this.lastSyncedAiAssistantSessionId);
|
|
2946
|
+
this.lastSyncedAiAssistantSessionId = null;
|
|
2947
|
+
this.aiAssistantSessionDismissed = false;
|
|
2948
|
+
}
|
|
2949
|
+
return sessionId;
|
|
2896
2950
|
}
|
|
2897
2951
|
hasAiAssistantSessionState() {
|
|
2898
2952
|
return !!this.aiAssistantPrompt.trim()
|
|
@@ -4043,7 +4097,7 @@ class ManualFormComponent {
|
|
|
4043
4097
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ManualFormComponent, isStandalone: true, selector: "praxis-manual-form", inputs: { formId: { classPropertyName: "formId", publicName: "formId", isSignal: true, isRequired: true, transformFunction: null }, formTitle: { classPropertyName: "formTitle", publicName: "formTitle", isSignal: true, isRequired: false, transformFunction: null }, formDescription: { classPropertyName: "formDescription", publicName: "formDescription", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, enableAutoSave: { classPropertyName: "enableAutoSave", publicName: "enableAutoSave", isSignal: true, isRequired: false, transformFunction: null }, componentInstanceId: { classPropertyName: "componentInstanceId", publicName: "componentInstanceId", isSignal: true, isRequired: false, transformFunction: null }, showAiAssistant: { classPropertyName: "showAiAssistant", publicName: "showAiAssistant", isSignal: true, isRequired: false, transformFunction: null }, enableCustomization: { classPropertyName: "enableCustomization", publicName: "enableCustomization", isSignal: true, isRequired: false, transformFunction: null }, persistenceOptions: { classPropertyName: "persistenceOptions", publicName: "persistenceOptions", isSignal: true, isRequired: false, transformFunction: null }, usePathNames: { classPropertyName: "usePathNames", publicName: "usePathNames", isSignal: true, isRequired: false, transformFunction: null }, autoSaveDebounceMs: { classPropertyName: "autoSaveDebounceMs", publicName: "autoSaveDebounceMs", isSignal: true, isRequired: false, transformFunction: null }, resourcePath: { classPropertyName: "resourcePath", publicName: "resourcePath", isSignal: true, isRequired: false, transformFunction: null }, governedSchema: { classPropertyName: "governedSchema", publicName: "governedSchema", isSignal: true, isRequired: false, transformFunction: null }, schemaHash: { classPropertyName: "schemaHash", publicName: "schemaHash", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, entityId: { classPropertyName: "entityId", publicName: "entityId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted", saved: "saved", resetEvent: "reset", metadataChange: "metadataChange" }, providers: [
|
|
4044
4098
|
// Provide a ControlContainer at the host boundary so projected formControlName can resolve it
|
|
4045
4099
|
{ provide: ControlContainer, useExisting: ManualFormComponent },
|
|
4046
|
-
], queries: [{ propertyName: "formControls", predicate: FormControlName, descendants: true }], ngImport: i0, template: "<div class=\"pdx-manual-form\">\n @if (showHeader()) {\n <praxis-manual-form-header [instance]=\"instance\" [title]=\"formTitle()\" [description]=\"formDescription()\"\n [enableCustomization]=\"enableCustomization()\" (editForm)=\"openFormEditor()\" (save)=\"handleSave()\"\n (reset)=\"handleReset()\"></praxis-manual-form-header>\n }\n\n @if (showAiAssistant() || enableCustomization()) {\n <div class=\"pdx-manual-form__assistant\">\n <button\n type=\"button\"\n class=\"pdx-manual-form__assistant-trigger\"\n (click)=\"openAiAssistant()\"\n [attr.aria-label]=\"enableCustomization() ? 'Abrir copiloto sem\u00E2ntico Praxis do formul\u00E1rio manual' : 'Abrir assistente de preenchimento do formul\u00E1rio manual'\"\n data-testid=\"praxis-manual-form-ai-assistant-trigger\"\n >\n {{ enableCustomization() ? 'Copiloto Praxis' : 'Assistente de preenchimento' }}\n </button>\n </div>\n }\n\n @if (aiAssistantOpen && aiAssistantViewState) {\n <praxis-ai-assistant-shell\n [labels]=\"aiAssistantLabels\"\n [mode]=\"aiAssistantViewState.mode\"\n [state]=\"aiAssistantViewState.state\"\n [contextItems]=\"aiAssistantViewState.contextItems\"\n [attachments]=\"aiAssistantViewState.attachments\"\n [messages]=\"aiAssistantViewState.messages\"\n [quickReplies]=\"aiAssistantViewState.quickReplies\"\n [prompt]=\"aiAssistantPrompt\"\n [statusText]=\"aiAssistantViewState.statusText\"\n [errorText]=\"aiAssistantViewState.errorText\"\n [busy]=\"aiAssistantViewState.state === 'processing' || aiAssistantViewState.state === 'applying'\"\n [canApply]=\"aiAssistantViewState.canApply\"\n [preview]=\"aiAssistantViewState.preview\"\n [layout]=\"aiAssistantLayout\"\n testIdPrefix=\"praxis-manual-form-ai-assistant\"\n (promptChange)=\"onAiAssistantPromptChange($event)\"\n (submitPrompt)=\"onAiAssistantSubmit($event)\"\n (apply)=\"onAiAssistantApply($event)\"\n (retryTurn)=\"onAiAssistantRetry()\"\n (cancelTurn)=\"onAiAssistantCancel()\"\n (close)=\"closeAiAssistant()\"\n (quickReply)=\"onAiAssistantQuickReply($event)\"\n (editMessage)=\"onAiAssistantEditMessage($event)\"\n (resendMessage)=\"onAiAssistantResendMessage($event)\"\n (layoutChange)=\"onAiAssistantLayoutChange($event)\"\n ></praxis-ai-assistant-shell>\n }\n\n <form class=\"pdx-manual-form__form\" [formGroup]=\"formGroup\" (submit)=\"handleSubmit(); $event.preventDefault()\">\n <ng-content></ng-content>\n </form>\n\n @if (showActions() && resolvedActions) {\n <praxis-manual-form-actions [actions]=\"resolvedActions\" [submitDisabled]=\"!effectiveFormIsValid\"\n (actionClick)=\"handleAction($event)\"></praxis-manual-form-actions>\n }\n</div>\n", styles: [".pdx-manual-form{display:flex;flex-direction:column;gap:var(--pdx-manual-form-gap, 24px);color:var(--md-sys-color-on-surface)}.pdx-manual-form__form{display:grid;gap:var(--pdx-manual-form-field-gap, 16px);padding:var(--pdx-manual-form-padding, 20px);border-radius:var(--pdx-manual-form-radius, 16px);background:var(--pdx-manual-form-surface, var(--md-sys-color-surface-container));border:1px solid var(--pdx-manual-form-outline, var(--md-sys-color-outline-variant));box-shadow:var(--pdx-manual-form-shadow, var(--md-sys-elevation-level1, none))}.pdx-manual-form__form:focus-within{border-color:var(--pdx-manual-form-focus, var(--md-sys-color-primary));box-shadow:0 0 0 2px var(--md-sys-color-primary),var(--pdx-manual-form-shadow, var(--md-sys-elevation-level1, none))}.pdx-manual-form__assistant{display:flex;justify-content:flex-end}.pdx-manual-form__assistant-trigger{border:0;border-radius:999px;padding:8px 14px;cursor:pointer;color:var(--md-sys-color-on-primary, #fff);background:var(--md-sys-color-primary, #3451d1);box-shadow:var(--md-sys-elevation-level2, 0 4px 12px rgba(0, 0, 0, .18))}.pdx-manual-form__assistant-trigger:hover{background:var(--md-sys-color-primary-container, #223fb6)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: PraxisAiAssistantShellComponent, selector: "praxis-ai-assistant-shell", inputs: ["labels", "mode", "state", "contextItems", "attachments", "messages", "quickReplies", "recommendedIntents", "prompt", "statusText", "errorText", "testIdPrefix", "panelTestId", "submitTestId", "applyTestId", "primaryAction", "secondaryActions", "governanceActions", "busy", "canSubmit", "canApply", "preview", "submitOnEnter", "showAttachAction", "enablePastedAttachments", "
|
|
4100
|
+
], queries: [{ propertyName: "formControls", predicate: FormControlName, descendants: true }], ngImport: i0, template: "<div class=\"pdx-manual-form\">\n @if (showHeader()) {\n <praxis-manual-form-header [instance]=\"instance\" [title]=\"formTitle()\" [description]=\"formDescription()\"\n [enableCustomization]=\"enableCustomization()\" (editForm)=\"openFormEditor()\" (save)=\"handleSave()\"\n (reset)=\"handleReset()\"></praxis-manual-form-header>\n }\n\n @if (showAiAssistant() || enableCustomization()) {\n <div class=\"pdx-manual-form__assistant\">\n <button\n type=\"button\"\n class=\"pdx-manual-form__assistant-trigger\"\n (click)=\"openAiAssistant()\"\n [attr.aria-label]=\"enableCustomization() ? 'Abrir copiloto sem\u00E2ntico Praxis do formul\u00E1rio manual' : 'Abrir assistente de preenchimento do formul\u00E1rio manual'\"\n data-testid=\"praxis-manual-form-ai-assistant-trigger\"\n >\n {{ enableCustomization() ? 'Copiloto Praxis' : 'Assistente de preenchimento' }}\n </button>\n </div>\n }\n\n @if (aiAssistantOpen && aiAssistantViewState) {\n <praxis-ai-assistant-shell\n [labels]=\"aiAssistantLabels\"\n [mode]=\"aiAssistantViewState.mode\"\n [state]=\"aiAssistantViewState.state\"\n [contextItems]=\"aiAssistantViewState.contextItems\"\n [attachments]=\"aiAssistantViewState.attachments\"\n [messages]=\"aiAssistantViewState.messages\"\n [quickReplies]=\"aiAssistantViewState.quickReplies\"\n [prompt]=\"aiAssistantPrompt\"\n [statusText]=\"aiAssistantViewState.statusText\"\n [errorText]=\"aiAssistantViewState.errorText\"\n [busy]=\"aiAssistantViewState.state === 'processing' || aiAssistantViewState.state === 'applying'\"\n [canApply]=\"aiAssistantViewState.canApply\"\n [preview]=\"aiAssistantViewState.preview\"\n [layout]=\"aiAssistantLayout\"\n [showMinimize]=\"true\"\n testIdPrefix=\"praxis-manual-form-ai-assistant\"\n (promptChange)=\"onAiAssistantPromptChange($event)\"\n (submitPrompt)=\"onAiAssistantSubmit($event)\"\n (apply)=\"onAiAssistantApply($event)\"\n (retryTurn)=\"onAiAssistantRetry()\"\n (cancelTurn)=\"onAiAssistantCancel()\"\n (minimize)=\"minimizeAiAssistant()\"\n (close)=\"closeAiAssistant()\"\n (quickReply)=\"onAiAssistantQuickReply($event)\"\n (editMessage)=\"onAiAssistantEditMessage($event)\"\n (resendMessage)=\"onAiAssistantResendMessage($event)\"\n (layoutChange)=\"onAiAssistantLayoutChange($event)\"\n ></praxis-ai-assistant-shell>\n }\n\n <form class=\"pdx-manual-form__form\" [formGroup]=\"formGroup\" (submit)=\"handleSubmit(); $event.preventDefault()\">\n <ng-content></ng-content>\n </form>\n\n @if (showActions() && resolvedActions) {\n <praxis-manual-form-actions [actions]=\"resolvedActions\" [submitDisabled]=\"!effectiveFormIsValid\"\n (actionClick)=\"handleAction($event)\"></praxis-manual-form-actions>\n }\n</div>\n", styles: [".pdx-manual-form{display:flex;flex-direction:column;gap:var(--pdx-manual-form-gap, 24px);color:var(--md-sys-color-on-surface)}.pdx-manual-form__form{display:grid;gap:var(--pdx-manual-form-field-gap, 16px);padding:var(--pdx-manual-form-padding, 20px);border-radius:var(--pdx-manual-form-radius, 16px);background:var(--pdx-manual-form-surface, var(--md-sys-color-surface-container));border:1px solid var(--pdx-manual-form-outline, var(--md-sys-color-outline-variant));box-shadow:var(--pdx-manual-form-shadow, var(--md-sys-elevation-level1, none))}.pdx-manual-form__form:focus-within{border-color:var(--pdx-manual-form-focus, var(--md-sys-color-primary));box-shadow:0 0 0 2px var(--md-sys-color-primary),var(--pdx-manual-form-shadow, var(--md-sys-elevation-level1, none))}.pdx-manual-form__assistant{display:flex;justify-content:flex-end}.pdx-manual-form__assistant-trigger{border:0;border-radius:999px;padding:8px 14px;cursor:pointer;color:var(--md-sys-color-on-primary, #fff);background:var(--md-sys-color-primary, #3451d1);box-shadow:var(--md-sys-elevation-level2, 0 4px 12px rgba(0, 0, 0, .18))}.pdx-manual-form__assistant-trigger:hover{background:var(--md-sys-color-primary-container, #223fb6)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: PraxisAiAssistantShellComponent, selector: "praxis-ai-assistant-shell", inputs: ["labels", "mode", "state", "contextItems", "attachments", "threadAttachments", "messages", "quickReplies", "recommendedIntents", "prompt", "statusText", "errorText", "testIdPrefix", "panelTestId", "submitTestId", "applyTestId", "primaryAction", "secondaryActions", "governanceActions", "busy", "canSubmit", "canApply", "preview", "submitOnEnter", "showAttachAction", "enableFileAttachments", "enablePastedAttachments", "allowAttachmentOnlySubmit", "enableAuthenticatedPreview", "attachmentAccept", "attachmentMultiple", "voiceInputMode", "voiceLanguage", "draggable", "resizable", "showMinimize", "minWidth", "minHeight", "margin", "layout"], outputs: ["promptChange", "submitPrompt", "apply", "retryTurn", "cancelTurn", "shellAction", "minimize", "close", "attach", "attachmentsPasted", "attachmentsSelected", "attachmentsDropped", "removeAttachment", "retryAttachment", "previewAttachment", "detachThreadAttachment", "previewMessageAttachment", "messageAction", "editMessage", "resendMessage", "quickReply", "recommendedIntent", "blockAction", "layoutChange"] }, { kind: "component", type: ManualFormHeaderComponent, selector: "praxis-manual-form-header", inputs: ["instance", "title", "description", "saveLabel", "resetLabel", "enableCustomization", "editFormLabel"], outputs: ["save", "reset", "editForm"] }, { kind: "component", type: ManualFormActionsComponent, selector: "praxis-manual-form-actions", inputs: ["actions", "submitDisabled", "trackByFn"], outputs: ["actionClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4047
4101
|
}
|
|
4048
4102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ManualFormComponent, decorators: [{
|
|
4049
4103
|
type: Component,
|
|
@@ -4055,7 +4109,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
4055
4109
|
], providers: [
|
|
4056
4110
|
// Provide a ControlContainer at the host boundary so projected formControlName can resolve it
|
|
4057
4111
|
{ provide: ControlContainer, useExisting: ManualFormComponent },
|
|
4058
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"pdx-manual-form\">\n @if (showHeader()) {\n <praxis-manual-form-header [instance]=\"instance\" [title]=\"formTitle()\" [description]=\"formDescription()\"\n [enableCustomization]=\"enableCustomization()\" (editForm)=\"openFormEditor()\" (save)=\"handleSave()\"\n (reset)=\"handleReset()\"></praxis-manual-form-header>\n }\n\n @if (showAiAssistant() || enableCustomization()) {\n <div class=\"pdx-manual-form__assistant\">\n <button\n type=\"button\"\n class=\"pdx-manual-form__assistant-trigger\"\n (click)=\"openAiAssistant()\"\n [attr.aria-label]=\"enableCustomization() ? 'Abrir copiloto sem\u00E2ntico Praxis do formul\u00E1rio manual' : 'Abrir assistente de preenchimento do formul\u00E1rio manual'\"\n data-testid=\"praxis-manual-form-ai-assistant-trigger\"\n >\n {{ enableCustomization() ? 'Copiloto Praxis' : 'Assistente de preenchimento' }}\n </button>\n </div>\n }\n\n @if (aiAssistantOpen && aiAssistantViewState) {\n <praxis-ai-assistant-shell\n [labels]=\"aiAssistantLabels\"\n [mode]=\"aiAssistantViewState.mode\"\n [state]=\"aiAssistantViewState.state\"\n [contextItems]=\"aiAssistantViewState.contextItems\"\n [attachments]=\"aiAssistantViewState.attachments\"\n [messages]=\"aiAssistantViewState.messages\"\n [quickReplies]=\"aiAssistantViewState.quickReplies\"\n [prompt]=\"aiAssistantPrompt\"\n [statusText]=\"aiAssistantViewState.statusText\"\n [errorText]=\"aiAssistantViewState.errorText\"\n [busy]=\"aiAssistantViewState.state === 'processing' || aiAssistantViewState.state === 'applying'\"\n [canApply]=\"aiAssistantViewState.canApply\"\n [preview]=\"aiAssistantViewState.preview\"\n [layout]=\"aiAssistantLayout\"\n testIdPrefix=\"praxis-manual-form-ai-assistant\"\n (promptChange)=\"onAiAssistantPromptChange($event)\"\n (submitPrompt)=\"onAiAssistantSubmit($event)\"\n (apply)=\"onAiAssistantApply($event)\"\n (retryTurn)=\"onAiAssistantRetry()\"\n (cancelTurn)=\"onAiAssistantCancel()\"\n (close)=\"closeAiAssistant()\"\n (quickReply)=\"onAiAssistantQuickReply($event)\"\n (editMessage)=\"onAiAssistantEditMessage($event)\"\n (resendMessage)=\"onAiAssistantResendMessage($event)\"\n (layoutChange)=\"onAiAssistantLayoutChange($event)\"\n ></praxis-ai-assistant-shell>\n }\n\n <form class=\"pdx-manual-form__form\" [formGroup]=\"formGroup\" (submit)=\"handleSubmit(); $event.preventDefault()\">\n <ng-content></ng-content>\n </form>\n\n @if (showActions() && resolvedActions) {\n <praxis-manual-form-actions [actions]=\"resolvedActions\" [submitDisabled]=\"!effectiveFormIsValid\"\n (actionClick)=\"handleAction($event)\"></praxis-manual-form-actions>\n }\n</div>\n", styles: [".pdx-manual-form{display:flex;flex-direction:column;gap:var(--pdx-manual-form-gap, 24px);color:var(--md-sys-color-on-surface)}.pdx-manual-form__form{display:grid;gap:var(--pdx-manual-form-field-gap, 16px);padding:var(--pdx-manual-form-padding, 20px);border-radius:var(--pdx-manual-form-radius, 16px);background:var(--pdx-manual-form-surface, var(--md-sys-color-surface-container));border:1px solid var(--pdx-manual-form-outline, var(--md-sys-color-outline-variant));box-shadow:var(--pdx-manual-form-shadow, var(--md-sys-elevation-level1, none))}.pdx-manual-form__form:focus-within{border-color:var(--pdx-manual-form-focus, var(--md-sys-color-primary));box-shadow:0 0 0 2px var(--md-sys-color-primary),var(--pdx-manual-form-shadow, var(--md-sys-elevation-level1, none))}.pdx-manual-form__assistant{display:flex;justify-content:flex-end}.pdx-manual-form__assistant-trigger{border:0;border-radius:999px;padding:8px 14px;cursor:pointer;color:var(--md-sys-color-on-primary, #fff);background:var(--md-sys-color-primary, #3451d1);box-shadow:var(--md-sys-elevation-level2, 0 4px 12px rgba(0, 0, 0, .18))}.pdx-manual-form__assistant-trigger:hover{background:var(--md-sys-color-primary-container, #223fb6)}\n"] }]
|
|
4112
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"pdx-manual-form\">\n @if (showHeader()) {\n <praxis-manual-form-header [instance]=\"instance\" [title]=\"formTitle()\" [description]=\"formDescription()\"\n [enableCustomization]=\"enableCustomization()\" (editForm)=\"openFormEditor()\" (save)=\"handleSave()\"\n (reset)=\"handleReset()\"></praxis-manual-form-header>\n }\n\n @if (showAiAssistant() || enableCustomization()) {\n <div class=\"pdx-manual-form__assistant\">\n <button\n type=\"button\"\n class=\"pdx-manual-form__assistant-trigger\"\n (click)=\"openAiAssistant()\"\n [attr.aria-label]=\"enableCustomization() ? 'Abrir copiloto sem\u00E2ntico Praxis do formul\u00E1rio manual' : 'Abrir assistente de preenchimento do formul\u00E1rio manual'\"\n data-testid=\"praxis-manual-form-ai-assistant-trigger\"\n >\n {{ enableCustomization() ? 'Copiloto Praxis' : 'Assistente de preenchimento' }}\n </button>\n </div>\n }\n\n @if (aiAssistantOpen && aiAssistantViewState) {\n <praxis-ai-assistant-shell\n [labels]=\"aiAssistantLabels\"\n [mode]=\"aiAssistantViewState.mode\"\n [state]=\"aiAssistantViewState.state\"\n [contextItems]=\"aiAssistantViewState.contextItems\"\n [attachments]=\"aiAssistantViewState.attachments\"\n [messages]=\"aiAssistantViewState.messages\"\n [quickReplies]=\"aiAssistantViewState.quickReplies\"\n [prompt]=\"aiAssistantPrompt\"\n [statusText]=\"aiAssistantViewState.statusText\"\n [errorText]=\"aiAssistantViewState.errorText\"\n [busy]=\"aiAssistantViewState.state === 'processing' || aiAssistantViewState.state === 'applying'\"\n [canApply]=\"aiAssistantViewState.canApply\"\n [preview]=\"aiAssistantViewState.preview\"\n [layout]=\"aiAssistantLayout\"\n [showMinimize]=\"true\"\n testIdPrefix=\"praxis-manual-form-ai-assistant\"\n (promptChange)=\"onAiAssistantPromptChange($event)\"\n (submitPrompt)=\"onAiAssistantSubmit($event)\"\n (apply)=\"onAiAssistantApply($event)\"\n (retryTurn)=\"onAiAssistantRetry()\"\n (cancelTurn)=\"onAiAssistantCancel()\"\n (minimize)=\"minimizeAiAssistant()\"\n (close)=\"closeAiAssistant()\"\n (quickReply)=\"onAiAssistantQuickReply($event)\"\n (editMessage)=\"onAiAssistantEditMessage($event)\"\n (resendMessage)=\"onAiAssistantResendMessage($event)\"\n (layoutChange)=\"onAiAssistantLayoutChange($event)\"\n ></praxis-ai-assistant-shell>\n }\n\n <form class=\"pdx-manual-form__form\" [formGroup]=\"formGroup\" (submit)=\"handleSubmit(); $event.preventDefault()\">\n <ng-content></ng-content>\n </form>\n\n @if (showActions() && resolvedActions) {\n <praxis-manual-form-actions [actions]=\"resolvedActions\" [submitDisabled]=\"!effectiveFormIsValid\"\n (actionClick)=\"handleAction($event)\"></praxis-manual-form-actions>\n }\n</div>\n", styles: [".pdx-manual-form{display:flex;flex-direction:column;gap:var(--pdx-manual-form-gap, 24px);color:var(--md-sys-color-on-surface)}.pdx-manual-form__form{display:grid;gap:var(--pdx-manual-form-field-gap, 16px);padding:var(--pdx-manual-form-padding, 20px);border-radius:var(--pdx-manual-form-radius, 16px);background:var(--pdx-manual-form-surface, var(--md-sys-color-surface-container));border:1px solid var(--pdx-manual-form-outline, var(--md-sys-color-outline-variant));box-shadow:var(--pdx-manual-form-shadow, var(--md-sys-elevation-level1, none))}.pdx-manual-form__form:focus-within{border-color:var(--pdx-manual-form-focus, var(--md-sys-color-primary));box-shadow:0 0 0 2px var(--md-sys-color-primary),var(--pdx-manual-form-shadow, var(--md-sys-elevation-level1, none))}.pdx-manual-form__assistant{display:flex;justify-content:flex-end}.pdx-manual-form__assistant-trigger{border:0;border-radius:999px;padding:8px 14px;cursor:pointer;color:var(--md-sys-color-on-primary, #fff);background:var(--md-sys-color-primary, #3451d1);box-shadow:var(--md-sys-elevation-level2, 0 4px 12px rgba(0, 0, 0, .18))}.pdx-manual-form__assistant-trigger:hover{background:var(--md-sys-color-primary-container, #223fb6)}\n"] }]
|
|
4059
4113
|
}], ctorParameters: () => [], propDecorators: { formId: [{ type: i0.Input, args: [{ isSignal: true, alias: "formId", required: true }] }], formTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "formTitle", required: false }] }], formDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "formDescription", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], showHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHeader", required: false }] }], showActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActions", required: false }] }], enableAutoSave: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableAutoSave", required: false }] }], componentInstanceId: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentInstanceId", required: false }] }], showAiAssistant: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAiAssistant", required: false }] }], enableCustomization: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCustomization", required: false }] }], persistenceOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistenceOptions", required: false }] }], usePathNames: [{ type: i0.Input, args: [{ isSignal: true, alias: "usePathNames", required: false }] }], autoSaveDebounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoSaveDebounceMs", required: false }] }], resourcePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourcePath", required: false }] }], governedSchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "governedSchema", required: false }] }], schemaHash: [{ type: i0.Input, args: [{ isSignal: true, alias: "schemaHash", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], entityId: [{ type: i0.Input, args: [{ isSignal: true, alias: "entityId", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }], saved: [{ type: i0.Output, args: ["saved"] }], resetEvent: [{ type: i0.Output, args: ["reset"] }], metadataChange: [{ type: i0.Output, args: ["metadataChange"] }], formControls: [{
|
|
4060
4114
|
type: ContentChildren,
|
|
4061
4115
|
args: [FormControlName, { descendants: true }]
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/manual-form",
|
|
3
|
-
"version": "10.0.0-rc.
|
|
3
|
+
"version": "10.0.0-rc.72",
|
|
4
4
|
"description": "Manual form toolkit for Praxis UI: container, instance factory and editor bridge for @praxisui/* fields.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
7
7
|
"@angular/core": "^21.0.0",
|
|
8
|
-
"@praxisui/core": "^10.0.0-rc.
|
|
9
|
-
"@praxisui/settings-panel": "^10.0.0-rc.
|
|
10
|
-
"@praxisui/metadata-editor": "^10.0.0-rc.
|
|
8
|
+
"@praxisui/core": "^10.0.0-rc.72",
|
|
9
|
+
"@praxisui/settings-panel": "^10.0.0-rc.72",
|
|
10
|
+
"@praxisui/metadata-editor": "^10.0.0-rc.72",
|
|
11
11
|
"@angular/cdk": "^21.0.0",
|
|
12
12
|
"@angular/forms": "^21.0.0",
|
|
13
13
|
"@angular/material": "^21.0.0",
|
|
14
14
|
"@angular/router": "^21.0.0",
|
|
15
|
-
"@praxisui/ai": "^10.0.0-rc.
|
|
15
|
+
"@praxisui/ai": "^10.0.0-rc.72",
|
|
16
16
|
"rxjs": "~7.8.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
@@ -198,7 +198,11 @@ declare class ManualFormComponent implements AfterContentInit, OnDestroy, Praxis
|
|
|
198
198
|
private readonly aiApi;
|
|
199
199
|
private readonly assistantSessions;
|
|
200
200
|
private readonly aiTurnOrchestrator;
|
|
201
|
+
private aiAssistantSessionDismissed;
|
|
202
|
+
private lastSyncedAiAssistantSessionId;
|
|
203
|
+
private lastHandledDismissalSeq;
|
|
201
204
|
private readonly aiAssistantSessionEffect;
|
|
205
|
+
private readonly aiAssistantDismissEffect;
|
|
202
206
|
private warnedMissingId;
|
|
203
207
|
private readonly disableSelectorDefaults;
|
|
204
208
|
private readonly selectorToControlType;
|
|
@@ -288,6 +292,7 @@ declare class ManualFormComponent implements AfterContentInit, OnDestroy, Praxis
|
|
|
288
292
|
applyConfigFromAdapter(config: FormConfig): void;
|
|
289
293
|
openAiAssistant(): void;
|
|
290
294
|
openAiAssistantFromSession(session: PraxisAssistantSessionSnapshot): void;
|
|
295
|
+
minimizeAiAssistant(): void;
|
|
291
296
|
closeAiAssistant(): void;
|
|
292
297
|
onAiAssistantPromptChange(prompt: string): void;
|
|
293
298
|
onAiAssistantSubmit(prompt: string): void;
|
|
@@ -302,6 +307,7 @@ declare class ManualFormComponent implements AfterContentInit, OnDestroy, Praxis
|
|
|
302
307
|
private buildAiAssistantContextItems;
|
|
303
308
|
private buildAiAssistantContextSnapshot;
|
|
304
309
|
private syncAiAssistantSession;
|
|
310
|
+
private reconcileAiAssistantSessionIdentity;
|
|
305
311
|
private hasAiAssistantSessionState;
|
|
306
312
|
private resolveAiAssistantSessionId;
|
|
307
313
|
private resolveAiAssistantOwnerId;
|