@praxisui/manual-form 9.0.0-beta.2 → 9.0.0-beta.21
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.
- package/README.md +8 -46
- package/ai/component-registry.json +4328 -0
- package/fesm2022/praxisui-manual-form.mjs +52 -22
- package/package.json +12 -15
- package/types/praxisui-manual-form.d.ts +8 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ensureIds, DynamicFormService, ASYNC_CONFIG_STORAGE, RULE_PROPERTY_SCHEMA, deepMerge, resolveControlTypeAlias, FieldControlType, normalizeControlTypeKey, FormHooksRegistry, ComponentKeyService, FIELD_SELECTOR_REGISTRY_DISABLE_DEFAULTS, DEFAULT_FIELD_SELECTOR_CONTROL_TYPE_MAP, FieldSelectorRegistry, providePraxisI18n, PraxisI18nService, API_URL } from '@praxisui/core';
|
|
1
|
+
import { ensureIds, DynamicFormService, ASYNC_CONFIG_STORAGE, RULE_PROPERTY_SCHEMA, deepMerge, resolveControlTypeAlias, FieldControlType, normalizeControlTypeKey, FormHooksRegistry, ComponentKeyService, FIELD_SELECTOR_REGISTRY_DISABLE_DEFAULTS, DEFAULT_FIELD_SELECTOR_CONTROL_TYPE_MAP, FieldSelectorRegistry, 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 } 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';
|
|
4
4
|
import { BehaviorSubject, firstValueFrom, debounceTime, fromEvent, of } from 'rxjs';
|
|
5
5
|
import { take } from 'rxjs/operators';
|
|
6
6
|
import { ActivatedRoute } from '@angular/router';
|
|
7
7
|
import { isPlatformBrowser } from '@angular/common';
|
|
8
|
-
import { BaseAiAdapter, shouldRoutePromptToGovernedDecision, AiBackendApiService, PraxisAssistantSessionRegistryService, PraxisAssistantTurnOrchestratorService, createPraxisAssistantViewportLayout, PraxisAiAssistantShellComponent } from '@praxisui/ai';
|
|
8
|
+
import { BaseAiAdapter, withAuthoringScopePolicy, shouldRoutePromptToGovernedDecision, AiBackendApiService, PraxisAssistantSessionRegistryService, PraxisAssistantTurnOrchestratorService, createPraxisAssistantViewportLayout, PraxisAiAssistantShellComponent } from '@praxisui/ai';
|
|
9
9
|
import * as i1 from '@angular/forms';
|
|
10
10
|
import { FormGroupDirective, FormGroup, FormControl, Validators, ReactiveFormsModule, FormControlName, ControlContainer, FormsModule } from '@angular/forms';
|
|
11
11
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -586,13 +586,15 @@ function generateRulePropertyCapabilities(targetType, properties) {
|
|
|
586
586
|
properties.forEach((prop) => {
|
|
587
587
|
const valueKind = prop.type === 'object'
|
|
588
588
|
? 'object'
|
|
589
|
-
: prop.type === '
|
|
590
|
-
? '
|
|
591
|
-
: prop.type === '
|
|
592
|
-
? '
|
|
593
|
-
: prop.type === '
|
|
594
|
-
? '
|
|
595
|
-
: '
|
|
589
|
+
: prop.type === 'array'
|
|
590
|
+
? 'array'
|
|
591
|
+
: prop.type === 'enum'
|
|
592
|
+
? 'enum'
|
|
593
|
+
: prop.type === 'boolean'
|
|
594
|
+
? 'boolean'
|
|
595
|
+
: prop.type === 'number'
|
|
596
|
+
? 'number'
|
|
597
|
+
: 'string';
|
|
596
598
|
const capability = {
|
|
597
599
|
path: `formRules[].effect.properties.${prop.name}`,
|
|
598
600
|
category: 'rules',
|
|
@@ -605,7 +607,7 @@ function generateRulePropertyCapabilities(targetType, properties) {
|
|
|
605
607
|
: prop.type === 'enum'
|
|
606
608
|
? (prop.enumValues?.[0]?.value || 'valor')
|
|
607
609
|
: 'valor',
|
|
608
|
-
safetyNotes: prop.type === 'object' ? 'O objeto deve seguir o schema esperado pelo componente alvo.' : undefined,
|
|
610
|
+
safetyNotes: prop.type === 'object' ? 'O objeto deve seguir o schema esperado pelo componente alvo.' : prop.type === 'array' ? 'A lista deve seguir o schema esperado pelo componente alvo.' : undefined,
|
|
609
611
|
};
|
|
610
612
|
if (prop.enumValues) {
|
|
611
613
|
capability.allowedValues = prop.enumValues.map((ev) => ev.value);
|
|
@@ -619,13 +621,15 @@ function generateRulePropertyWhenFalseCapabilities(targetType, properties) {
|
|
|
619
621
|
properties.forEach((prop) => {
|
|
620
622
|
const valueKind = prop.type === 'object'
|
|
621
623
|
? 'object'
|
|
622
|
-
: prop.type === '
|
|
623
|
-
? '
|
|
624
|
-
: prop.type === '
|
|
625
|
-
? '
|
|
626
|
-
: prop.type === '
|
|
627
|
-
? '
|
|
628
|
-
: '
|
|
624
|
+
: prop.type === 'array'
|
|
625
|
+
? 'array'
|
|
626
|
+
: prop.type === 'enum'
|
|
627
|
+
? 'enum'
|
|
628
|
+
: prop.type === 'boolean'
|
|
629
|
+
? 'boolean'
|
|
630
|
+
: prop.type === 'number'
|
|
631
|
+
? 'number'
|
|
632
|
+
: 'string';
|
|
629
633
|
const capability = {
|
|
630
634
|
path: `formRules[].effect.propertiesWhenFalse.${prop.name}`,
|
|
631
635
|
category: 'rules',
|
|
@@ -638,7 +642,7 @@ function generateRulePropertyWhenFalseCapabilities(targetType, properties) {
|
|
|
638
642
|
: prop.type === 'enum'
|
|
639
643
|
? (prop.enumValues?.[0]?.value || 'valor')
|
|
640
644
|
: 'valor',
|
|
641
|
-
safetyNotes: prop.type === 'object' ? 'O objeto deve seguir o schema esperado pelo componente alvo.' : undefined,
|
|
645
|
+
safetyNotes: prop.type === 'object' ? 'O objeto deve seguir o schema esperado pelo componente alvo.' : prop.type === 'array' ? 'A lista deve seguir o schema esperado pelo componente alvo.' : undefined,
|
|
642
646
|
};
|
|
643
647
|
if (prop.enumValues) {
|
|
644
648
|
capability.allowedValues = prop.enumValues.map((ev) => ev.value);
|
|
@@ -1251,7 +1255,7 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1251
1255
|
if (this.shouldRouteToGovernedDecision(prompt, contextHints)) {
|
|
1252
1256
|
return this.toGovernedDecisionHandoff(prompt, request);
|
|
1253
1257
|
}
|
|
1254
|
-
const response = await firstValueFrom(this.aiApi.getPatch({
|
|
1258
|
+
const response = await firstValueFrom(this.aiApi.getPatch(withAuthoringScopePolicy({
|
|
1255
1259
|
componentId,
|
|
1256
1260
|
componentType,
|
|
1257
1261
|
userPrompt: prompt,
|
|
@@ -1268,7 +1272,11 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1268
1272
|
...(runtimeState ? { runtimeState } : {}),
|
|
1269
1273
|
...(schemaFields?.length ? { schemaFields } : {}),
|
|
1270
1274
|
...(contextHints ? { contextHints } : {}),
|
|
1271
|
-
}
|
|
1275
|
+
}, {
|
|
1276
|
+
componentId,
|
|
1277
|
+
componentType,
|
|
1278
|
+
componentLabel: this.adapter.componentName || 'formulario',
|
|
1279
|
+
})));
|
|
1272
1280
|
return this.toTurnResult(this.compileAdapterResponse(response), request);
|
|
1273
1281
|
}
|
|
1274
1282
|
async apply(_request) {
|
|
@@ -6412,6 +6420,28 @@ const PRAXIS_MANUAL_FORM_AUTHORING_MANIFEST = {
|
|
|
6412
6420
|
],
|
|
6413
6421
|
};
|
|
6414
6422
|
|
|
6423
|
+
/** Metadata for Praxis Manual Form component */
|
|
6424
|
+
const PRAXIS_MANUAL_FORM_COMPONENT_METADATA = {
|
|
6425
|
+
id: 'praxis-manual-form',
|
|
6426
|
+
selector: 'praxis-manual-form',
|
|
6427
|
+
component: ManualFormComponent,
|
|
6428
|
+
friendlyName: 'Praxis Manual Form',
|
|
6429
|
+
description: 'Form builder with manual field selection and layout controls.',
|
|
6430
|
+
tags: ['widget', 'form', 'configurable'],
|
|
6431
|
+
lib: '@praxisui/manual-form',
|
|
6432
|
+
};
|
|
6433
|
+
/** Provider para auto-registrar metadados do componente Manual Form. */
|
|
6434
|
+
function providePraxisManualFormMetadata() {
|
|
6435
|
+
return {
|
|
6436
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
6437
|
+
multi: true,
|
|
6438
|
+
useFactory: (registry) => () => {
|
|
6439
|
+
registry.register(PRAXIS_MANUAL_FORM_COMPONENT_METADATA);
|
|
6440
|
+
},
|
|
6441
|
+
deps: [ComponentMetadataRegistry],
|
|
6442
|
+
};
|
|
6443
|
+
}
|
|
6444
|
+
|
|
6415
6445
|
/*
|
|
6416
6446
|
* Public API Surface of praxis-manual-form
|
|
6417
6447
|
*/
|
|
@@ -6420,4 +6450,4 @@ const PRAXIS_MANUAL_FORM_AUTHORING_MANIFEST = {
|
|
|
6420
6450
|
* Generated bundle index. Do not edit.
|
|
6421
6451
|
*/
|
|
6422
6452
|
|
|
6423
|
-
export { MANUAL_FORM_AI_CAPABILITIES, MANUAL_FORM_CONSTRUCTOR_TO_CONTROL_TYPE, MANUAL_FORM_SELECTOR_TO_CONTROL_TYPE, ManualFieldDirective, ManualFieldEditorOnDblclickDirective, ManualFieldKeyService, ManualFieldMetadataBridgeService, ManualFormActionsComponent, ManualFormComponent, ManualFormConfigEditorComponent, ManualFormDocExampleComponent, ManualFormDocExampleShowcaseComponent, ManualFormHeaderComponent, ManualFormInstance, ManualFormInstanceFactory, PRAXIS_MANUAL_FORM_AUTHORING_MANIFEST, createManualFormSeed, toFieldMetadataMap };
|
|
6453
|
+
export { MANUAL_FORM_AI_CAPABILITIES, MANUAL_FORM_CONSTRUCTOR_TO_CONTROL_TYPE, MANUAL_FORM_SELECTOR_TO_CONTROL_TYPE, ManualFieldDirective, ManualFieldEditorOnDblclickDirective, ManualFieldKeyService, ManualFieldMetadataBridgeService, ManualFormActionsComponent, ManualFormComponent, ManualFormConfigEditorComponent, ManualFormDocExampleComponent, ManualFormDocExampleShowcaseComponent, ManualFormHeaderComponent, ManualFormInstance, ManualFormInstanceFactory, PRAXIS_MANUAL_FORM_AUTHORING_MANIFEST, PRAXIS_MANUAL_FORM_COMPONENT_METADATA, createManualFormSeed, providePraxisManualFormMetadata, toFieldMetadataMap };
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/manual-form",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.21",
|
|
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": "^9.0.0-beta.
|
|
9
|
-
"@praxisui/dynamic-fields": "^9.0.0-beta.
|
|
10
|
-
"@praxisui/settings-panel": "^9.0.0-beta.
|
|
11
|
-
"@praxisui/metadata-editor": "^9.0.0-beta.
|
|
8
|
+
"@praxisui/core": "^9.0.0-beta.21",
|
|
9
|
+
"@praxisui/dynamic-fields": "^9.0.0-beta.21",
|
|
10
|
+
"@praxisui/settings-panel": "^9.0.0-beta.21",
|
|
11
|
+
"@praxisui/metadata-editor": "^9.0.0-beta.21",
|
|
12
12
|
"@angular/cdk": "^21.0.0",
|
|
13
13
|
"@angular/forms": "^21.0.0",
|
|
14
14
|
"@angular/material": "^21.0.0",
|
|
15
15
|
"@angular/router": "^21.0.0",
|
|
16
|
-
"@praxisui/ai": "^9.0.0-beta.
|
|
16
|
+
"@praxisui/ai": "^9.0.0-beta.21",
|
|
17
17
|
"rxjs": "~7.8.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
@@ -23,17 +23,11 @@
|
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
|
-
"
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/codexrodrigues/praxis-ui-angular.git"
|
|
29
|
-
},
|
|
30
|
-
"homepage": "https://praxisui.dev",
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/codexrodrigues/praxis-ui-angular/issues"
|
|
33
|
-
},
|
|
26
|
+
"homepage": "https://praxisui.dev/components/manual-form",
|
|
34
27
|
"keywords": [
|
|
35
28
|
"angular",
|
|
36
29
|
"praxisui",
|
|
30
|
+
"praxis",
|
|
37
31
|
"manual-form",
|
|
38
32
|
"forms",
|
|
39
33
|
"autosave",
|
|
@@ -49,7 +43,10 @@
|
|
|
49
43
|
".": {
|
|
50
44
|
"types": "./types/praxisui-manual-form.d.ts",
|
|
51
45
|
"default": "./fesm2022/praxisui-manual-form.mjs"
|
|
46
|
+
},
|
|
47
|
+
"./ai/component-registry.json": {
|
|
48
|
+
"default": "./ai/component-registry.json"
|
|
52
49
|
}
|
|
53
50
|
},
|
|
54
51
|
"type": "module"
|
|
55
|
-
}
|
|
52
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FormConfig, FieldMetadata, DynamicFormService, AsyncConfigStorage, FormActionsLayout, FormActionButton, AiCapability, FormMessagesLayout, FormBehaviorLayout, FormHookStage, FieldDefinition, FieldControlType, AiCapabilityCategory, AiCapabilityCatalog, AiValueKind, ComponentAuthoringManifest } from '@praxisui/core';
|
|
1
|
+
import { FormConfig, FieldMetadata, DynamicFormService, AsyncConfigStorage, FormActionsLayout, FormActionButton, AiCapability, FormMessagesLayout, FormBehaviorLayout, FormHookStage, FieldDefinition, FieldControlType, AiCapabilityCategory, AiCapabilityCatalog, AiValueKind, ComponentAuthoringManifest, ComponentDocMeta } from '@praxisui/core';
|
|
2
2
|
import { FormGroup, FormControlName, FormGroupName, AbstractControl, FormControl } from '@angular/forms';
|
|
3
3
|
import { Observable, BehaviorSubject } from 'rxjs';
|
|
4
4
|
import * as _angular_core from '@angular/core';
|
|
5
|
-
import { AfterContentInit, OnDestroy, OnInit, OnChanges, TemplateRef, ViewContainerRef, SimpleChanges, InjectionToken } from '@angular/core';
|
|
5
|
+
import { AfterContentInit, OnDestroy, OnInit, OnChanges, TemplateRef, ViewContainerRef, SimpleChanges, InjectionToken, Provider } from '@angular/core';
|
|
6
6
|
import { BaseAiAdapter, PatchResult, PraxisAssistantTurnViewState, PraxisAssistantShellLayout, PraxisAssistantShellLabels, PraxisAssistantSessionSnapshot, PraxisAssistantShellQuickReply, PraxisAssistantShellMessage } from '@praxisui/ai';
|
|
7
7
|
import { SettingsPanelRef } from '@praxisui/settings-panel';
|
|
8
8
|
|
|
@@ -568,5 +568,10 @@ declare const MANUAL_FORM_AI_CAPABILITIES: CapabilityCatalog;
|
|
|
568
568
|
|
|
569
569
|
declare const PRAXIS_MANUAL_FORM_AUTHORING_MANIFEST: ComponentAuthoringManifest;
|
|
570
570
|
|
|
571
|
-
|
|
571
|
+
/** Metadata for Praxis Manual Form component */
|
|
572
|
+
declare const PRAXIS_MANUAL_FORM_COMPONENT_METADATA: ComponentDocMeta;
|
|
573
|
+
/** Provider para auto-registrar metadados do componente Manual Form. */
|
|
574
|
+
declare function providePraxisManualFormMetadata(): Provider;
|
|
575
|
+
|
|
576
|
+
export { MANUAL_FORM_AI_CAPABILITIES, MANUAL_FORM_CONSTRUCTOR_TO_CONTROL_TYPE, MANUAL_FORM_SELECTOR_TO_CONTROL_TYPE, ManualFieldDirective, ManualFieldEditorOnDblclickDirective, ManualFieldKeyService, ManualFieldMetadataBridgeService, ManualFormActionsComponent, ManualFormComponent, ManualFormConfigEditorComponent, ManualFormDocExampleComponent, ManualFormDocExampleShowcaseComponent, ManualFormHeaderComponent, ManualFormInstance, ManualFormInstanceFactory, PRAXIS_MANUAL_FORM_AUTHORING_MANIFEST, PRAXIS_MANUAL_FORM_COMPONENT_METADATA, createManualFormSeed, providePraxisManualFormMetadata, toFieldMetadataMap };
|
|
572
577
|
export type { Capability, CapabilityCatalog, CapabilityCategory, ManualFieldKeyResolution, ManualFieldMetadataMap, ManualFormDocExampleLevel, ManualFormDocExampleTab, ManualFormId, ManualFormPersistenceOptions, ManualFormSeed, ManualFormSeedOptions, ManualFormSnapshot, ManualFormState, ValueKind };
|