@praxisui/core 10.0.0-rc.33 → 10.0.0-rc.34
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-10-
|
|
3
|
+
"generatedAt": "2026-10-19T09:48:25.455Z",
|
|
4
4
|
"packageName": "@praxisui/core",
|
|
5
|
-
"packageVersion": "10.0.0-rc.
|
|
5
|
+
"packageVersion": "10.0.0-rc.34",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 4,
|
|
@@ -2049,6 +2049,7 @@
|
|
|
2049
2049
|
"Payloads legados de layout ainda podem ser ingeridos, mas sao normalizados para canvas e nao devem ser reemitidos.",
|
|
2050
2050
|
"pageIdentity identifica o escopo de persistencia e nao pertence ao objeto page.",
|
|
2051
2051
|
"authoringCapabilities é um grant transitório do host para limitar affordances visíveis; não integra WidgetPageDefinition, não é persistido e não concede autoridade de edição à IA.",
|
|
2052
|
+
"Tokens de interpolacao de estado/contexto em inputs de widgets ({{state.<path> | pipe}} ou ${state.<path> | pipe}) suportam pipes declarativos CSP-safe encadeaveis: default:<fallback>, number, round[:decimals], percent[:decimals], currency[:code], uppercase e lowercase.",
|
|
2052
2053
|
"Este catálogo é específico para o runtime praxis-dynamic-page; operações de authoring/mutação pertencem ao manifesto do praxis-page-builder.",
|
|
2053
2054
|
"WidgetPageDefinition e o contrato canonico persistido: widgets, composition.links, state, context, i18n, layout, canvas, presets, grouping, slotAssignments, deviceLayouts e themePreset.",
|
|
2054
2055
|
"Widgets e page.composition.links sao arrays; ferramentas de patch legadas fazem merge por key estavel e id estavel.",
|
|
@@ -3153,9 +3154,9 @@
|
|
|
3153
3154
|
{
|
|
3154
3155
|
"chunkIndex": 6,
|
|
3155
3156
|
"chunkKind": "capabilities",
|
|
3156
|
-
"content": "Component Capability:\n - Path: page.deviceLayouts.mobile\n Category: layout\n Kind: object\n Description: Overrides de layout para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.layout\n Category: layout\n Kind: object\n Description: Override de WidgetPageLayout para desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.canvas\n Category: layout\n Kind: object\n Description: Override de canvas para desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.groupingOverrides\n Category: layout\n Kind: array\n Description: Overrides de agrupamentos para desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.widgetOverrides\n Category: layout\n Kind: object\n Description: Overrides por widget key para desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.widgetOverrides.<widgetKey>.hidden\n Category: layout\n Kind: boolean\n Description: Oculta o widget em desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.layout\n Category: layout\n Kind: object\n Description: Override de WidgetPageLayout para tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.canvas\n Category: layout\n Kind: object\n Description: Override de canvas para tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.groupingOverrides\n Category: layout\n Kind: array\n Description: Overrides de agrupamentos para tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.widgetOverrides\n Category: layout\n Kind: object\n Description: Overrides por widget key para tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.widgetOverrides.<widgetKey>.hidden\n Category: layout\n Kind: boolean\n Description: Oculta o widget em tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.layout\n Category: layout\n Kind: object\n Description: Override de WidgetPageLayout para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.canvas\n Category: layout\n Kind: object\n Description: Override de canvas para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.groupingOverrides\n Category: layout\n Kind: array\n Description: Overrides de agrupamentos para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.widgetOverrides\n Category: layout\n Kind: object\n Description: Overrides por widget key para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.widgetOverrides.<widgetKey>.hidden\n Category: layout\n Kind: boolean\n Description: Oculta o widget em mobile.\n\nCapability Note:\n - page segue o modelo canonico WidgetPageDefinition (widgets, composition.links, context e state opcional); composition.links pode despachar actions globais via to.kind = global-action e receber continuations exatas via from.kind = global-action.\n\nCapability Note:\n - Conteudo editorial rico deve ser modelado como widget praxis-rich-content com definition.inputs.document: RichContentDocument, nao como DSL local do page-builder.\n\nCapability Note:\n - Quando definition.id = praxis-rich-content em uma pagina dinamica, definition.inputs.document continua sendo o contrato persistido; hostCapabilities e mediado em runtime pelo host praxis-dynamic-page e nao deve ser serializado no JSON da pagina.\n\nCapability Note:\n - Edicao visual de inputs de widget deve usar ComponentDocMeta.configEditor ou ComponentDocMeta.authoringManifestRef publicado pela lib dona do componente; nao criar editor local no page-builder para semantica de outro pacote.\n\nCapability Note:\n - Canvas e o modelo espacial canonico da pagina quando houver posicionamento explicito.\n\nCapability Note:\n - Taxonomia editorial: condition usa Json Logic canonico; transform usa pipeline declarativo; policy cobre apenas comportamento operacional.\n\nCapability Note:\n - Para criacao agentic de paginas, o preview pode trazer uiCompositionPlan como plano intermediario validavel; o page-builder compila esse plano para WidgetPageDefinition antes de aplicar.\n\nCapability Note:\n - UiCompositionPlan usa widgets[].componentId e bindings declarativos. UiCompositionPlanTemplateReference pode piná-lo por registryKey + configSha256, mas precisa ser resolvido pelo backend governado antes da compilação. O JSON persistido continua sendo page.widgets[].definition.id e page.composition.links.\n\nCapability Note:\n - Nested component ports usam endpoint component-port com nestedPath. O owner em ref.widget ou bindings[].*.widget continua sendo o widget top-level; a porta real do filho fica em port/direction e o caminho ate o filho fica em nestedPath.\n\nCapability Note:\n - Nao gere links nested via owner.widgetEvent, bindingPath profundo, page.connections ou wrappers host-specific. widgetEvent e bridge legada/avancada, nao contrato principal de authoring.\n\nCapability Note:\n - Payloads legados de layout ainda podem ser ingeridos, mas sao normalizados para canvas e nao devem ser reemitidos.\n\nCapability Note:\n - pageIdentity identifica o escopo de persistencia e nao pertence ao objeto page.\n\nCapability Note:\n - authoringCapabilities é um grant transitório do host para limitar affordances visíveis; não integra WidgetPageDefinition, não é persistido e não concede autoridade de edição à IA.\n\nCapability Note:\n - Este catálogo é específico para o runtime praxis-dynamic-page; operações de authoring/mutação pertencem ao manifesto do praxis-page-builder.\n\nCapability Note:\n - WidgetPageDefinition e o contrato canonico persistido: widgets, composition.links, state, context, i18n, layout, canvas, presets, grouping, slotAssignments, deviceLayouts e themePreset.\n\nCapability Note:\n - Widgets e page.composition.links sao arrays; ferramentas de patch legadas fazem merge por key estavel e id estavel.\n\nCapability Note:\n - page.canvas.items é um mapa por widget key; não modele canvas.items como array.\n\nCapability Note:\n - Taxonomia editorial: condition usa Json Logic canônico; transform usa pipeline declarativo; não trate ambos como a mesma \"expression\".\n\nCapability Note:\n - Para remocao/replace, use flags {_remove:true} ou {_replace:true} no item.\n\nCapability Note:\n - Para renomear um link, inclua {_beforeKey:\"link-id-anterior\"} no item.\n\nCapability Note:\n - Inputs de widgets dependem do componente (ex: praxis-table, praxis-dynamic-form). Evite inventar campos; prefira pedir confirmação.\n\nCapability Note:\n - Quando page.widgets[].definition.id for praxis-rich-content, o host praxis-dynamic-page injeta hostCapabilities em runtime para actions e capability gating; não serialize funções nem tente persistir page.widgets[].definition.inputs.hostCapabilities.\n\nCapability Note:\n - Use ids estaveis para links e keys estaveis para widgets.\n\nCapability Note:\n - Nested component ports usam endpoint component-port com nestedPath; o owner em ref.widget continua sendo o widget top-level.\n\nCapability Note:\n - Objetivo: compor widgets e relacionamentos canonicos (ex.: master-detail).\n\nCapability Note:\n - Link tipico de master-detail: component-port(table.rowClick) -> component-port(form.resourceId) com transform map payload.row.id.\n\nCapability Note:\n - Templates {{state.<path> | pipe}} e ${state.<path> | pipe} em inputs de widgets suportam pipes declarativos CSP-safe (default/coalesce, round[:N], number[:N], percent[:N], currency[:BRL|USD|EUR|GBP], uppercase, lowercase) via applyDeclarativeValuePipe, tratando tokens não resolvidos e NaN como ausentes no fallback.",
|
|
3157
|
+
"content": "Component Capability:\n - Path: page.deviceLayouts.mobile\n Category: layout\n Kind: object\n Description: Overrides de layout para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.layout\n Category: layout\n Kind: object\n Description: Override de WidgetPageLayout para desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.canvas\n Category: layout\n Kind: object\n Description: Override de canvas para desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.groupingOverrides\n Category: layout\n Kind: array\n Description: Overrides de agrupamentos para desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.widgetOverrides\n Category: layout\n Kind: object\n Description: Overrides por widget key para desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.desktop.widgetOverrides.<widgetKey>.hidden\n Category: layout\n Kind: boolean\n Description: Oculta o widget em desktop.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.layout\n Category: layout\n Kind: object\n Description: Override de WidgetPageLayout para tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.canvas\n Category: layout\n Kind: object\n Description: Override de canvas para tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.groupingOverrides\n Category: layout\n Kind: array\n Description: Overrides de agrupamentos para tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.widgetOverrides\n Category: layout\n Kind: object\n Description: Overrides por widget key para tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.tablet.widgetOverrides.<widgetKey>.hidden\n Category: layout\n Kind: boolean\n Description: Oculta o widget em tablet.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.layout\n Category: layout\n Kind: object\n Description: Override de WidgetPageLayout para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.canvas\n Category: layout\n Kind: object\n Description: Override de canvas para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.groupingOverrides\n Category: layout\n Kind: array\n Description: Overrides de agrupamentos para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.widgetOverrides\n Category: layout\n Kind: object\n Description: Overrides por widget key para mobile.\n\nComponent Capability:\n - Path: page.deviceLayouts.mobile.widgetOverrides.<widgetKey>.hidden\n Category: layout\n Kind: boolean\n Description: Oculta o widget em mobile.\n\nCapability Note:\n - page segue o modelo canonico WidgetPageDefinition (widgets, composition.links, context e state opcional); composition.links pode despachar actions globais via to.kind = global-action e receber continuations exatas via from.kind = global-action.\n\nCapability Note:\n - Conteudo editorial rico deve ser modelado como widget praxis-rich-content com definition.inputs.document: RichContentDocument, nao como DSL local do page-builder.\n\nCapability Note:\n - Quando definition.id = praxis-rich-content em uma pagina dinamica, definition.inputs.document continua sendo o contrato persistido; hostCapabilities e mediado em runtime pelo host praxis-dynamic-page e nao deve ser serializado no JSON da pagina.\n\nCapability Note:\n - Edicao visual de inputs de widget deve usar ComponentDocMeta.configEditor ou ComponentDocMeta.authoringManifestRef publicado pela lib dona do componente; nao criar editor local no page-builder para semantica de outro pacote.\n\nCapability Note:\n - Canvas e o modelo espacial canonico da pagina quando houver posicionamento explicito.\n\nCapability Note:\n - Taxonomia editorial: condition usa Json Logic canonico; transform usa pipeline declarativo; policy cobre apenas comportamento operacional.\n\nCapability Note:\n - Para criacao agentic de paginas, o preview pode trazer uiCompositionPlan como plano intermediario validavel; o page-builder compila esse plano para WidgetPageDefinition antes de aplicar.\n\nCapability Note:\n - UiCompositionPlan usa widgets[].componentId e bindings declarativos. UiCompositionPlanTemplateReference pode piná-lo por registryKey + configSha256, mas precisa ser resolvido pelo backend governado antes da compilação. O JSON persistido continua sendo page.widgets[].definition.id e page.composition.links.\n\nCapability Note:\n - Nested component ports usam endpoint component-port com nestedPath. O owner em ref.widget ou bindings[].*.widget continua sendo o widget top-level; a porta real do filho fica em port/direction e o caminho ate o filho fica em nestedPath.\n\nCapability Note:\n - Nao gere links nested via owner.widgetEvent, bindingPath profundo, page.connections ou wrappers host-specific. widgetEvent e bridge legada/avancada, nao contrato principal de authoring.\n\nCapability Note:\n - Payloads legados de layout ainda podem ser ingeridos, mas sao normalizados para canvas e nao devem ser reemitidos.\n\nCapability Note:\n - pageIdentity identifica o escopo de persistencia e nao pertence ao objeto page.\n\nCapability Note:\n - authoringCapabilities é um grant transitório do host para limitar affordances visíveis; não integra WidgetPageDefinition, não é persistido e não concede autoridade de edição à IA.\n\nCapability Note:\n - Tokens de interpolacao de estado/contexto em inputs de widgets ({{state.<path> | pipe}} ou ${state.<path> | pipe}) suportam pipes declarativos CSP-safe encadeaveis: default:<fallback>, number, round[:decimals], percent[:decimals], currency[:code], uppercase e lowercase.\n\nCapability Note:\n - Este catálogo é específico para o runtime praxis-dynamic-page; operações de authoring/mutação pertencem ao manifesto do praxis-page-builder.\n\nCapability Note:\n - WidgetPageDefinition e o contrato canonico persistido: widgets, composition.links, state, context, i18n, layout, canvas, presets, grouping, slotAssignments, deviceLayouts e themePreset.\n\nCapability Note:\n - Widgets e page.composition.links sao arrays; ferramentas de patch legadas fazem merge por key estavel e id estavel.\n\nCapability Note:\n - page.canvas.items é um mapa por widget key; não modele canvas.items como array.\n\nCapability Note:\n - Taxonomia editorial: condition usa Json Logic canônico; transform usa pipeline declarativo; não trate ambos como a mesma \"expression\".\n\nCapability Note:\n - Para remocao/replace, use flags {_remove:true} ou {_replace:true} no item.\n\nCapability Note:\n - Para renomear um link, inclua {_beforeKey:\"link-id-anterior\"} no item.\n\nCapability Note:\n - Inputs de widgets dependem do componente (ex: praxis-table, praxis-dynamic-form). Evite inventar campos; prefira pedir confirmação.\n\nCapability Note:\n - Quando page.widgets[].definition.id for praxis-rich-content, o host praxis-dynamic-page injeta hostCapabilities em runtime para actions e capability gating; não serialize funções nem tente persistir page.widgets[].definition.inputs.hostCapabilities.\n\nCapability Note:\n - Use ids estaveis para links e keys estaveis para widgets.\n\nCapability Note:\n - Nested component ports usam endpoint component-port com nestedPath; o owner em ref.widget continua sendo o widget top-level.\n\nCapability Note:\n - Objetivo: compor widgets e relacionamentos canonicos (ex.: master-detail).\n\nCapability Note:\n - Link tipico de master-detail: component-port(table.rowClick) -> component-port(form.resourceId) com transform map payload.row.id.\n\nCapability Note:\n - Templates {{state.<path> | pipe}} e ${state.<path> | pipe} em inputs de widgets suportam pipes declarativos CSP-safe (default/coalesce, round[:N], number[:N], percent[:N], currency[:BRL|USD|EUR|GBP], uppercase, lowercase) via applyDeclarativeValuePipe, tratando tokens não resolvidos e NaN como ausentes no fallback.",
|
|
3157
3158
|
"sourcePointer": "projects/praxis-core/src/lib/ai/dynamic-page-ai-capabilities.ts",
|
|
3158
|
-
"contentHash": "
|
|
3159
|
+
"contentHash": "f9b25975c7ce7b73f598ef1bb70ad86739939adbc26ca85736a126f9ac79f915",
|
|
3159
3160
|
"sourceKind": "component_definition",
|
|
3160
3161
|
"sourceId": "praxis-dynamic-page",
|
|
3161
3162
|
"corpusVersion": "1.0.0"
|
|
@@ -3443,9 +3444,9 @@
|
|
|
3443
3444
|
{
|
|
3444
3445
|
"chunkIndex": 35,
|
|
3445
3446
|
"chunkKind": "recipe",
|
|
3446
|
-
"content": "{\"_comment\":\"Template de pagina com CRUD (Praxis Dynamic Page), usando acoes canonicas inferidas no metadata do CRUD.\",\"_comment2\":\"resourcePath deve ser o path base do recurso (sem /filter).\",\"templateMeta\":{\"registryKey\":\"praxis-dynamic-page\",\"variantId\":\"crud\",\"useWhen\":\"Create a dynamic page with a CRUD widget.\",\"examplePrompts\":[\"pagina com crud\",\"crie um crud completo\",\"tela de cadastro completa\"]},\"page\":{\"layout\":{\"orientation\":\"columns\",\"columns\":2,\"gap\":\"16px\"},\"widgets\":[{\"key\":\"mainCrud\",\"definition\":{\"id\":\"praxis-crud\",\"bindingOrder\":[\"metadata\"],\"inputs\":{\"crudId\":\"{{resourceKey}}-crud\",\"metadata\":{\"component\":\"praxis-crud\",\"resource\":{\"path\":\"{{resourcePath}}\",\"idField\":\"{{idField}}\",\"endpointKey\":\"{{resourceKey}}\"},\"table\":{\"toolbar\":{\"visible\":true}},\"actions\":[{\"action\":\"create\",\"openMode\":\"modal\"}]}},\"outputs\":{\"afterSave\":\"emit\",\"afterDelete\":\"emit\"}}}]}}",
|
|
3447
|
+
"content": "{\"_comment\":\"Template de pagina com CRUD (Praxis Dynamic Page), usando acoes canonicas inferidas no metadata do CRUD.\",\"_comment2\":\"resourcePath deve ser o path base do recurso (sem /filter).\",\"templateMeta\":{\"registryKey\":\"praxis-dynamic-page\",\"variantId\":\"crud\",\"useWhen\":\"Create a dynamic page with a CRUD widget.\",\"examplePrompts\":[\"pagina com crud\",\"crie um crud completo\",\"tela de cadastro completa\"]},\"page\":{\"layout\":{\"orientation\":\"columns\",\"columns\":2,\"gap\":\"16px\"},\"widgets\":[{\"key\":\"mainCrud\",\"definition\":{\"id\":\"praxis-crud\",\"bindingOrder\":[\"metadata\"],\"inputs\":{\"crudId\":\"{{resourceKey}}-crud\",\"metadata\":{\"component\":\"praxis-crud\",\"resource\":{\"path\":\"{{resourcePath}}\",\"idField\":\"{{idField}}\",\"endpointKey\":\"{{resourceKey}}\"},\"kpiBand\":{\"enabled\":true,\"source\":\"{{resourcePath}}/stats/group-by\",\"method\":\"POST\",\"payload\":{\"field\":\"status\",\"filter\":{},\"metrics\":[{\"operation\":\"COUNT\",\"alias\":\"total\"}]},\"cards\":[{\"id\":\"total-items\",\"label\":\"Total\",\"value\":\"0\",\"valueExpr\":\"${totalCount} | number\",\"variant\":\"primary\",\"filter\":{}}]},\"table\":{\"toolbar\":{\"visible\":true}},\"actions\":[{\"action\":\"create\",\"openMode\":\"modal\"}]}},\"outputs\":{\"afterSave\":\"emit\",\"afterDelete\":\"emit\"}}}]}}",
|
|
3447
3448
|
"sourcePointer": "examples/ai-recipes/praxis-dynamic-page.crud.json",
|
|
3448
|
-
"contentHash": "
|
|
3449
|
+
"contentHash": "c2d2fa05a42ee0eba8ac278a05d69e08642dbcc70ce815951aa60e2e0eb765fd",
|
|
3449
3450
|
"sourceKind": "component_definition",
|
|
3450
3451
|
"sourceId": "praxis-dynamic-page",
|
|
3451
3452
|
"corpusVersion": "1.0.0"
|
|
@@ -42039,7 +42039,8 @@ class WidgetPageDataSourceRuntimeService {
|
|
|
42039
42039
|
: 'GET');
|
|
42040
42040
|
let request$;
|
|
42041
42041
|
if (method === 'POST') {
|
|
42042
|
-
|
|
42042
|
+
const postBody = this.normalizeCanonicalStatsRequestBody(url, dataSource.query);
|
|
42043
|
+
request$ = this.http.post(url, postBody);
|
|
42043
42044
|
}
|
|
42044
42045
|
else {
|
|
42045
42046
|
let params = new HttpParams();
|
|
@@ -42061,6 +42062,54 @@ class WidgetPageDataSourceRuntimeService {
|
|
|
42061
42062
|
}
|
|
42062
42063
|
return request$.pipe(map((res) => this.transformPayload(res, dataSource)));
|
|
42063
42064
|
}
|
|
42065
|
+
normalizeCanonicalStatsRequestBody(url, rawQuery) {
|
|
42066
|
+
const base = rawQuery && typeof rawQuery === 'object' && !Array.isArray(rawQuery)
|
|
42067
|
+
? { ...rawQuery }
|
|
42068
|
+
: {};
|
|
42069
|
+
if (!/\/stats\/(?:group-by|timeseries|distribution|comparison)(?:$|\?|\/)/i.test(url)) {
|
|
42070
|
+
return base;
|
|
42071
|
+
}
|
|
42072
|
+
if (/\/stats\/group-by(?:$|\?|\/)/i.test(url) &&
|
|
42073
|
+
(!base['field'] || typeof base['field'] !== 'string' || !base['field'].trim()) &&
|
|
42074
|
+
typeof base['groupBy'] === 'string' &&
|
|
42075
|
+
base['groupBy'].trim()) {
|
|
42076
|
+
base['field'] = base['groupBy'].trim();
|
|
42077
|
+
}
|
|
42078
|
+
if (!base['filter'] || typeof base['filter'] !== 'object' || Array.isArray(base['filter'])) {
|
|
42079
|
+
base['filter'] = {};
|
|
42080
|
+
}
|
|
42081
|
+
const sanitizeMetric = (m) => {
|
|
42082
|
+
const copy = { ...m };
|
|
42083
|
+
const rawOp = typeof copy['operation'] === 'string' && copy['operation'].trim()
|
|
42084
|
+
? copy['operation'].trim()
|
|
42085
|
+
: typeof copy['op'] === 'string' && copy['op'].trim()
|
|
42086
|
+
? copy['op'].trim()
|
|
42087
|
+
: 'COUNT';
|
|
42088
|
+
const operation = rawOp.toUpperCase();
|
|
42089
|
+
copy['operation'] = operation;
|
|
42090
|
+
if (operation === 'COUNT') {
|
|
42091
|
+
delete copy['field'];
|
|
42092
|
+
if (typeof copy['alias'] !== 'string' || !copy['alias'].trim()) {
|
|
42093
|
+
copy['alias'] = 'total';
|
|
42094
|
+
}
|
|
42095
|
+
}
|
|
42096
|
+
return copy;
|
|
42097
|
+
};
|
|
42098
|
+
if (base['metric'] && typeof base['metric'] === 'object' && !Array.isArray(base['metric'])) {
|
|
42099
|
+
base['metric'] = sanitizeMetric(base['metric']);
|
|
42100
|
+
}
|
|
42101
|
+
if (Array.isArray(base['metrics']) && base['metrics'].length > 0) {
|
|
42102
|
+
base['metrics'] = base['metrics']
|
|
42103
|
+
.filter((item) => !!item && typeof item === 'object' && !Array.isArray(item))
|
|
42104
|
+
.map(sanitizeMetric);
|
|
42105
|
+
}
|
|
42106
|
+
const hasMetric = !!base['metric'];
|
|
42107
|
+
const hasMetrics = Array.isArray(base['metrics']) && base['metrics'].length > 0;
|
|
42108
|
+
if (!hasMetric && !hasMetrics) {
|
|
42109
|
+
base['metrics'] = [{ operation: 'COUNT', alias: 'total' }];
|
|
42110
|
+
}
|
|
42111
|
+
return base;
|
|
42112
|
+
}
|
|
42064
42113
|
/**
|
|
42065
42114
|
* Normaliza `page.dataSources` aceitando tanto o formato canônico em Array quanto Object Map indexado por id.
|
|
42066
42115
|
*/
|
|
@@ -42276,22 +42325,37 @@ class WidgetPageDataSourceRuntimeService {
|
|
|
42276
42325
|
let totalWeight = 0;
|
|
42277
42326
|
for (const bucket of buckets) {
|
|
42278
42327
|
const hasExplicitKey = bucket?.key !== undefined;
|
|
42279
|
-
const keyStr = String(hasExplicitKey ? bucket.key : (bucket?.value ?? ''));
|
|
42328
|
+
const keyStr = String(hasExplicitKey ? bucket.key : (bucket?.value ?? '')).trim();
|
|
42329
|
+
const labelStr = typeof bucket?.label === 'string' ? bucket.label.trim() : '';
|
|
42330
|
+
const valuesObj = bucket?.values && typeof bucket.values === 'object' && !Array.isArray(bucket.values)
|
|
42331
|
+
? bucket.values
|
|
42332
|
+
: null;
|
|
42333
|
+
const firstValuesMetric = valuesObj
|
|
42334
|
+
? Object.values(valuesObj).find((v) => typeof v === 'number' && Number.isFinite(v))
|
|
42335
|
+
: undefined;
|
|
42336
|
+
const valuesMetric = valuesObj?.['total'] ?? valuesObj?.['count'] ?? firstValuesMetric;
|
|
42280
42337
|
const val = hasExplicitKey
|
|
42281
|
-
? Number(bucket?.value ?? bucket?.count ?? 0)
|
|
42282
|
-
: Number(bucket?.count ?? bucket?.value ?? 0);
|
|
42338
|
+
? Number(bucket?.value ?? bucket?.count ?? valuesMetric ?? 0)
|
|
42339
|
+
: Number(bucket?.count ?? valuesMetric ?? bucket?.value ?? 0);
|
|
42283
42340
|
const safeVal = Number.isFinite(val) ? val : 0;
|
|
42284
42341
|
total += safeVal;
|
|
42285
42342
|
const rawWeight = bucket?.count !== undefined ? Number(bucket.count) : 1;
|
|
42286
42343
|
const safeWeight = Number.isFinite(rawWeight) && rawWeight > 0 ? rawWeight : 0;
|
|
42287
42344
|
const bucketMetric = hasExplicitKey
|
|
42288
|
-
? Number(bucket?.value ?? bucket?.key ?? 0)
|
|
42289
|
-
: Number(bucket?.value ?? 0);
|
|
42345
|
+
? Number(bucket?.value ?? valuesMetric ?? bucket?.key ?? 0)
|
|
42346
|
+
: Number(bucket?.value ?? valuesMetric ?? 0);
|
|
42290
42347
|
if (Number.isFinite(bucketMetric) && safeWeight > 0) {
|
|
42291
42348
|
weightedSum += bucketMetric * safeWeight;
|
|
42292
42349
|
totalWeight += safeWeight;
|
|
42293
42350
|
}
|
|
42294
|
-
const mappedField = mappings[keyStr]
|
|
42351
|
+
const mappedField = mappings[keyStr] ??
|
|
42352
|
+
mappings[keyStr.toUpperCase()] ??
|
|
42353
|
+
mappings[keyStr.toLowerCase()] ??
|
|
42354
|
+
(labelStr
|
|
42355
|
+
? (mappings[labelStr] ??
|
|
42356
|
+
mappings[labelStr.toUpperCase()] ??
|
|
42357
|
+
mappings[labelStr.toLowerCase()])
|
|
42358
|
+
: undefined);
|
|
42295
42359
|
if (mappedField) {
|
|
42296
42360
|
result[mappedField] = (result[mappedField] || 0) + safeVal;
|
|
42297
42361
|
}
|
|
@@ -58621,6 +58685,7 @@ let nextQuickConnectInstanceId = 0;
|
|
|
58621
58685
|
class ResourceQuickConnectComponent {
|
|
58622
58686
|
resourcePath = '';
|
|
58623
58687
|
resourcePathChange = new EventEmitter();
|
|
58688
|
+
resourceSelected = new EventEmitter();
|
|
58624
58689
|
endpointKey;
|
|
58625
58690
|
apiUrlEntry;
|
|
58626
58691
|
intent = 'any';
|
|
@@ -58754,13 +58819,17 @@ class ResourceQuickConnectComponent {
|
|
|
58754
58819
|
if (!this.discovery) {
|
|
58755
58820
|
return;
|
|
58756
58821
|
}
|
|
58822
|
+
const requestOpts = this.requestOptions();
|
|
58823
|
+
if (typeof this.discovery.canResolveSchemas === 'function' &&
|
|
58824
|
+
!this.discovery.canResolveSchemas(requestOpts)) {
|
|
58825
|
+
return;
|
|
58826
|
+
}
|
|
58757
58827
|
const requestId = ++this.catalogRequestId;
|
|
58758
58828
|
this.catalogLoading = true;
|
|
58759
58829
|
this.catalogError = false;
|
|
58760
58830
|
this.isBusy$.next(true);
|
|
58761
58831
|
this.cdr?.markForCheck();
|
|
58762
58832
|
try {
|
|
58763
|
-
const requestOpts = this.requestOptions();
|
|
58764
58833
|
const catalog = await firstValueFrom(this.discovery.getSchemaCatalog({}, requestOpts).pipe(timeout$1(30000)));
|
|
58765
58834
|
if (requestId !== this.catalogRequestId) {
|
|
58766
58835
|
return;
|
|
@@ -58924,6 +58993,7 @@ class ResourceQuickConnectComponent {
|
|
|
58924
58993
|
const emitted = this.resourcePath;
|
|
58925
58994
|
this.cvaOnChange(emitted);
|
|
58926
58995
|
this.resourcePathChange.emit(emitted);
|
|
58996
|
+
this.resourceSelected.emit(this.selectedResource());
|
|
58927
58997
|
}
|
|
58928
58998
|
this.cdr?.markForCheck();
|
|
58929
58999
|
}
|
|
@@ -58935,6 +59005,7 @@ class ResourceQuickConnectComponent {
|
|
|
58935
59005
|
this.syncSelectorValue();
|
|
58936
59006
|
this.cvaOnChange(this.resourcePath);
|
|
58937
59007
|
this.resourcePathChange.emit(this.resourcePath);
|
|
59008
|
+
this.resourceSelected.emit(this.selectedResource());
|
|
58938
59009
|
this.cdr?.markForCheck();
|
|
58939
59010
|
}
|
|
58940
59011
|
acceptAppliedValue(value) {
|
|
@@ -59161,7 +59232,7 @@ class ResourceQuickConnectComponent {
|
|
|
59161
59232
|
return /^\/?[a-zA-Z0-9][a-zA-Z0-9/_-]*$/.test(value);
|
|
59162
59233
|
}
|
|
59163
59234
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ResourceQuickConnectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
59164
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ResourceQuickConnectComponent, isStandalone: true, selector: "praxis-resource-quick-connect", inputs: { resourcePath: "resourcePath", endpointKey: "endpointKey", apiUrlEntry: "apiUrlEntry", intent: "intent", resources: "resources", label: "label", placeholder: "placeholder", hint: "hint", disabled: "disabled" }, outputs: { resourcePathChange: "resourcePathChange" }, providers: [
|
|
59235
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: ResourceQuickConnectComponent, isStandalone: true, selector: "praxis-resource-quick-connect", inputs: { resourcePath: "resourcePath", endpointKey: "endpointKey", apiUrlEntry: "apiUrlEntry", intent: "intent", resources: "resources", label: "label", placeholder: "placeholder", hint: "hint", disabled: "disabled" }, outputs: { resourcePathChange: "resourcePathChange", resourceSelected: "resourceSelected" }, providers: [
|
|
59165
59236
|
providePraxisI18nConfig(RESOURCE_DISCOVERY_I18N_CONFIG),
|
|
59166
59237
|
{
|
|
59167
59238
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -59479,6 +59550,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
59479
59550
|
type: Input
|
|
59480
59551
|
}], resourcePathChange: [{
|
|
59481
59552
|
type: Output
|
|
59553
|
+
}], resourceSelected: [{
|
|
59554
|
+
type: Output
|
|
59482
59555
|
}], endpointKey: [{
|
|
59483
59556
|
type: Input
|
|
59484
59557
|
}], apiUrlEntry: [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/core",
|
|
3
|
-
"version": "10.0.0-rc.
|
|
3
|
+
"version": "10.0.0-rc.34",
|
|
4
4
|
"description": "Core library for Praxis UI Workspace: types, tokens, services and utilities shared across @praxisui/* packages.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/cdk": "^21.0.0",
|
package/types/praxisui-core.d.ts
CHANGED
|
@@ -18635,6 +18635,7 @@ declare class WidgetPageDataSourceRuntimeService {
|
|
|
18635
18635
|
*/
|
|
18636
18636
|
fetchDataSource(dataSource: WidgetPageDataSourceDefinition): Observable<unknown>;
|
|
18637
18637
|
private executeRawRequest;
|
|
18638
|
+
private normalizeCanonicalStatsRequestBody;
|
|
18638
18639
|
/**
|
|
18639
18640
|
* Normaliza `page.dataSources` aceitando tanto o formato canônico em Array quanto Object Map indexado por id.
|
|
18640
18641
|
*/
|
|
@@ -19906,6 +19907,7 @@ declare class EmptyStateCardComponent {
|
|
|
19906
19907
|
declare class ResourceQuickConnectComponent implements SettingsValueProvider, ControlValueAccessor, OnChanges, OnInit, AfterViewChecked {
|
|
19907
19908
|
resourcePath: string;
|
|
19908
19909
|
readonly resourcePathChange: EventEmitter<string>;
|
|
19910
|
+
readonly resourceSelected: EventEmitter<DiscoveredResourceOption | null>;
|
|
19909
19911
|
endpointKey?: ApiEndpoint;
|
|
19910
19912
|
apiUrlEntry?: ApiUrlEntry | null;
|
|
19911
19913
|
intent: ResourceDiscoveryIntent;
|
|
@@ -19983,7 +19985,7 @@ declare class ResourceQuickConnectComponent implements SettingsValueProvider, Co
|
|
|
19983
19985
|
private updateValidity;
|
|
19984
19986
|
private isValidPath;
|
|
19985
19987
|
static ɵfac: i0.ɵɵFactoryDeclaration<ResourceQuickConnectComponent, never>;
|
|
19986
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ResourceQuickConnectComponent, "praxis-resource-quick-connect", never, { "resourcePath": { "alias": "resourcePath"; "required": false; }; "endpointKey": { "alias": "endpointKey"; "required": false; }; "apiUrlEntry": { "alias": "apiUrlEntry"; "required": false; }; "intent": { "alias": "intent"; "required": false; }; "resources": { "alias": "resources"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "resourcePathChange": "resourcePathChange"; }, never, never, true, never>;
|
|
19988
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ResourceQuickConnectComponent, "praxis-resource-quick-connect", never, { "resourcePath": { "alias": "resourcePath"; "required": false; }; "endpointKey": { "alias": "endpointKey"; "required": false; }; "apiUrlEntry": { "alias": "apiUrlEntry"; "required": false; }; "intent": { "alias": "intent"; "required": false; }; "resources": { "alias": "resources"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "resourcePathChange": "resourcePathChange"; "resourceSelected": "resourceSelected"; }, never, never, true, never>;
|
|
19987
19989
|
}
|
|
19988
19990
|
|
|
19989
19991
|
declare class PraxisIconPickerComponent {
|