@praxisui/page-builder 3.0.0-beta.9 → 4.0.0-beta.0
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 +44 -140
- package/fesm2022/praxisui-page-builder.mjs +117 -2929
- package/index.d.ts +12 -162
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# @praxisui/page-builder
|
|
2
2
|
|
|
3
|
-
Ferramentas de edicao para paginas dinamicas canonicas baseadas em `praxis-dynamic-page`, com
|
|
3
|
+
Ferramentas de edicao para paginas dinamicas canonicas baseadas em `praxis-dynamic-page`, com palette, configuracao de pagina/widget e integracao com `@praxisui/settings-panel`.
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- Indicado para: times que precisam
|
|
7
|
+
- Documentacao oficial: https://praxisui.dev
|
|
8
|
+
- Aplicacao de referencia: https://github.com/codexrodrigues/praxis-ui-quickstart
|
|
9
|
+
- Indicado para: times que precisam configurar paginas metadata-driven sobre o runtime canonico
|
|
10
10
|
|
|
11
11
|
## When to use
|
|
12
12
|
|
|
13
|
-
- Montar paginas dinamicas com widgets
|
|
14
|
-
- Entregar experiencia de
|
|
13
|
+
- Montar paginas dinamicas com widgets e layout visual sobre o runtime canonico
|
|
14
|
+
- Entregar experiencia de configuracao de pagina/widget sem depender de editor visual de conexoes
|
|
15
15
|
- Integrar page composition com IA, settings panel e contratos compartilhados do Praxis UI
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
O pacote permanece focado no shell canonico de authoring em torno de `praxis-dynamic-page`: palette, page settings, widget shell e catalogos de IA. A composicao declarativa de conexoes deve ser feita exclusivamente via JSON/configuracao canonica no `@praxisui/core`; os editores visuais legados de conexoes sairam do escopo ativo desta fase.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Instalacao
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
npm i @praxisui/page-builder
|
|
@@ -31,23 +31,20 @@ Peer dependencies (Angular v20):
|
|
|
31
31
|
- `@praxisui/core` `*`
|
|
32
32
|
- `@praxisui/settings-panel` `*`
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Visao Geral
|
|
35
35
|
|
|
36
|
-
Este pacote
|
|
37
|
-
- `
|
|
38
|
-
- `
|
|
39
|
-
- `
|
|
40
|
-
- `FloatingToolbar` e `TileToolbar` — ações rápidas (adicionar, conexões, configurar widget, configurar card, salvar, pré‑visualizar).
|
|
36
|
+
Este pacote expoe o shell ativo do builder canonico de pagina dinamica:
|
|
37
|
+
- `ComponentPaletteDialogComponent` para adicionar widgets a pagina.
|
|
38
|
+
- `FloatingToolbarComponent` e `TileToolbarComponent` para acoes rapidas de add/save/preview/configuracao.
|
|
39
|
+
- `WidgetShellEditorComponent` e `DynamicPageConfigEditorComponent` para authoring de shell/canvas sem redefinir a semantica canonica de composicao.
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
- Via `SettingsPanelService` (painel lateral) — recomendado para fluxo dentro do app.
|
|
44
|
-
- Como diálogo fullscreen (Material Dialog) para uma experiência imersiva de edição.
|
|
41
|
+
Conexoes continuam pertencendo ao contrato `WidgetPageDefinition`, mas a criacao/manutencao delas nesta fase deve acontecer por JSON/configuracao canonica e nao por builder/graph/editor visual legado.
|
|
45
42
|
|
|
46
43
|
## AI Capabilities Registration
|
|
47
44
|
|
|
48
|
-
Para que o assistente de IA consiga configurar os inputs dos widgets, registre os
|
|
45
|
+
Para que o assistente de IA consiga configurar os inputs dos widgets, registre os catalogos de capacidades no bootstrap da aplicacao.
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
Opcao recomendada (registro automatico via provider + InjectionToken):
|
|
51
48
|
|
|
52
49
|
```ts
|
|
53
50
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
@@ -70,7 +67,7 @@ bootstrapApplication(AppComponent, {
|
|
|
70
67
|
});
|
|
71
68
|
```
|
|
72
69
|
|
|
73
|
-
Registro manual (
|
|
70
|
+
Registro manual (util para apps que precisam customizar o mapa):
|
|
74
71
|
|
|
75
72
|
```ts
|
|
76
73
|
import { registerWidgetAiCatalogs } from '@praxisui/page-builder';
|
|
@@ -88,8 +85,7 @@ Registro via token:
|
|
|
88
85
|
|
|
89
86
|
## Settings Panel Bridge
|
|
90
87
|
|
|
91
|
-
Para abrir "
|
|
92
|
-
registrar o bridge do Settings Panel:
|
|
88
|
+
Para abrir "Configuracoes da Pagina" e editores de shell no painel lateral, o host deve registrar o bridge do Settings Panel:
|
|
93
89
|
|
|
94
90
|
```ts
|
|
95
91
|
import { SETTINGS_PANEL_BRIDGE } from '@praxisui/core';
|
|
@@ -103,19 +99,19 @@ providers: [
|
|
|
103
99
|
]
|
|
104
100
|
```
|
|
105
101
|
|
|
106
|
-
|
|
107
|
-
- `TABLE_AI_CAPABILITIES`
|
|
108
|
-
- `CRUD_AI_CAPABILITIES`
|
|
109
|
-
- `LIST_AI_CAPABILITIES`
|
|
110
|
-
- `FORM_AI_CAPABILITIES`
|
|
111
|
-
- `FILES_UPLOAD_AI_CAPABILITIES`
|
|
112
|
-
- `STEPPER_AI_CAPABILITIES`
|
|
113
|
-
- `TABS_AI_CAPABILITIES`
|
|
114
|
-
- `EXPANSION_AI_CAPABILITIES`
|
|
102
|
+
Catalogos conhecidos (exports):
|
|
103
|
+
- `TABLE_AI_CAPABILITIES` - `@praxisui/table` (`praxis-table`)
|
|
104
|
+
- `CRUD_AI_CAPABILITIES` - `@praxisui/crud` (`praxis-crud`)
|
|
105
|
+
- `LIST_AI_CAPABILITIES` - `@praxisui/list` (`praxis-list`)
|
|
106
|
+
- `FORM_AI_CAPABILITIES` - `@praxisui/dynamic-form` (`praxis-dynamic-form`)
|
|
107
|
+
- `FILES_UPLOAD_AI_CAPABILITIES` - `@praxisui/files-upload` (`praxis-files-upload`)
|
|
108
|
+
- `STEPPER_AI_CAPABILITIES` - `@praxisui/stepper` (`praxis-stepper`)
|
|
109
|
+
- `TABS_AI_CAPABILITIES` - `@praxisui/tabs` (`praxis-tabs`)
|
|
110
|
+
- `EXPANSION_AI_CAPABILITIES` - `@praxisui/expansion` (`praxis-expansion`)
|
|
115
111
|
|
|
116
112
|
## Quick Start
|
|
117
113
|
|
|
118
|
-
O builder
|
|
114
|
+
O builder canonico expoe authoring de shell/palette sobre `praxis-dynamic-page`. Exemplo de uso no template:
|
|
119
115
|
|
|
120
116
|
```html
|
|
121
117
|
<praxis-dynamic-page-builder
|
|
@@ -124,89 +120,25 @@ O builder canônico expõe os métodos utilitários de authoring sobre `praxis-d
|
|
|
124
120
|
[enableCustomization]="true"
|
|
125
121
|
(pageChange)="onPageChange($event)">
|
|
126
122
|
</praxis-dynamic-page-builder>
|
|
127
|
-
|
|
128
|
-
<!-- Ações auxiliares -->
|
|
129
|
-
<button (click)="page.openConnectionsGraph()">Conexões (Graph)</button>
|
|
130
|
-
<button (click)="page.openConnectionsBuilder()">Conexões (Builder)</button>
|
|
131
|
-
<button (click)="page.openConnectionsEditor()">Editor Visual (Dialog)</button>
|
|
132
123
|
```
|
|
133
124
|
|
|
134
|
-
`page`
|
|
125
|
+
`page` e um `WidgetPageDefinition` (do `@praxisui/core`) contendo `widgets` e opcionalmente `connections`. O campo `connections` deve ser preenchido e versionado via JSON canonico.
|
|
135
126
|
|
|
136
127
|
## Widget Shell (Dashboard Cards)
|
|
137
128
|
|
|
138
|
-
Cada widget pode declarar um `shell` para renderizar um card padronizado com
|
|
139
|
-
ações de contexto e controles de janela (expandir/recolher). Exemplo:
|
|
129
|
+
Cada widget pode declarar um `shell` para renderizar um card padronizado com cabecalho rico, acoes de contexto e controles de janela (expandir/recolher).
|
|
140
130
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
{
|
|
145
|
-
"key": "dados-cadastrais",
|
|
146
|
-
"definition": { "id": "praxis-list", "inputs": { "listId": "dados", "config": {} } },
|
|
147
|
-
"layout": { "col": 1, "row": 1, "colSpan": 6, "rowSpan": 4 },
|
|
148
|
-
"shell": {
|
|
149
|
-
"kind": "dashboard-card",
|
|
150
|
-
"icon": "badge",
|
|
151
|
-
"title": "Dados Cadastrais",
|
|
152
|
-
"subtitle": "Servidor: Jéssica Techne",
|
|
153
|
-
"actions": [
|
|
154
|
-
{ "id": "editar", "label": "Editar", "icon": "edit", "variant": "outlined", "emit": "editar" },
|
|
155
|
-
{ "id": "imprimir", "label": "Imprimir", "icon": "print", "variant": "text", "emit": "imprimir" }
|
|
156
|
-
],
|
|
157
|
-
"windowActions": { "collapsible": true, "expandable": true },
|
|
158
|
-
"appearance": {
|
|
159
|
-
"card": { "background": "#0b1220", "borderColor": "rgba(255,255,255,0.12)", "borderRadius": "16px" },
|
|
160
|
-
"header": { "titleColor": "#e6edf3", "subtitleColor": "#9fb0c4", "iconColor": "#8ab4ff" },
|
|
161
|
-
"typography": { "titleSize": "14px", "titleWeight": "600", "subtitleSize": "12px" }
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
Quando uma ação é clicada, o shell:
|
|
170
|
-
- dispara um evento para o page-builder (`emit`, ou `shell:<id>` por padrão) para uso em `connections`;
|
|
171
|
-
- tenta despachar a ação para o componente interno via método `handleShellAction(action)`.
|
|
131
|
+
Quando uma acao e clicada, o shell:
|
|
132
|
+
- dispara um evento para o page-builder (`emit`, ou `shell:<id>` por padrao) para uso em `connections`;
|
|
133
|
+
- tenta despachar a acao para o componente interno via metodo `handleShellAction(action)`.
|
|
172
134
|
|
|
173
135
|
### Presets visuais (global)
|
|
174
136
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
```json
|
|
178
|
-
{
|
|
179
|
-
"context": {
|
|
180
|
-
"ui": {
|
|
181
|
-
"shell": {
|
|
182
|
-
"preset": "dark-glass",
|
|
183
|
-
"presets": {
|
|
184
|
-
"dark-glass": {
|
|
185
|
-
"card": { "background": "#0b1220", "borderColor": "rgba(255,255,255,0.12)", "borderRadius": "16px" }
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
O widget pode sobrescrever:
|
|
195
|
-
|
|
196
|
-
```json
|
|
197
|
-
{
|
|
198
|
-
"shell": {
|
|
199
|
-
"preset": "light-neutral",
|
|
200
|
-
"appearance": { "header": { "titleColor": "#1f2937" } }
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
```
|
|
137
|
+
Voce pode definir presets globais na pagina e escolher um preset padrao para todos os cards por JSON no contexto da pagina.
|
|
204
138
|
|
|
205
139
|
## Editor do Card (Shell)
|
|
206
140
|
|
|
207
|
-
O
|
|
208
|
-
titulo, subtitulo, icone e acoes do cabecalho. O editor grava os metadados no campo
|
|
209
|
-
`shell` do widget.
|
|
141
|
+
O botao "Configurar card" na toolbar do tile abre o editor de shell, permitindo editar titulo, subtitulo, icone e acoes do cabecalho. O editor grava os metadados no campo `shell` do widget.
|
|
210
142
|
|
|
211
143
|
Para abrir via API (Settings Panel):
|
|
212
144
|
|
|
@@ -223,53 +155,25 @@ this.settingsPanel.open({
|
|
|
223
155
|
});
|
|
224
156
|
```
|
|
225
157
|
|
|
226
|
-
## Abrindo editores via Settings Panel
|
|
227
|
-
|
|
228
|
-
Para abrir o Builder/Graph em um painel lateral, injete o `SettingsPanelService` e forneça o conteúdo. O `ConnectionBuilderComponent` é exportado por este pacote.
|
|
229
|
-
|
|
230
|
-
```ts
|
|
231
|
-
import { Component } from '@angular/core';
|
|
232
|
-
import { SettingsPanelService } from '@praxisui/settings-panel';
|
|
233
|
-
import { ConnectionBuilderComponent } from '@praxisui/page-builder';
|
|
234
|
-
import type { WidgetInstance, WidgetPageDefinition } from '@praxisui/core';
|
|
235
|
-
|
|
236
|
-
@Component({ selector: 'app-page-tools', standalone: true })
|
|
237
|
-
export class PageToolsComponent {
|
|
238
|
-
constructor(private settings: SettingsPanelService) {}
|
|
239
|
-
|
|
240
|
-
openBuilder(page: WidgetPageDefinition, widgets: WidgetInstance[]) {
|
|
241
|
-
this.settings.open({
|
|
242
|
-
id: 'grid-connections:builder',
|
|
243
|
-
title: 'Conexões (Builder)',
|
|
244
|
-
content: { component: ConnectionBuilderComponent, inputs: { page, widgets } },
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
Para abrir o Graph visual como painel, utilize os métodos do componente da página (`page.openConnectionsGraph()`), que encapsulam o componente interno do gráfico.
|
|
251
|
-
|
|
252
|
-
## Diálogo fullscreen (Graph/Editor Visual)
|
|
253
|
-
|
|
254
|
-
O fluxo visual completo pode ser aberto em diálogo Material (fullscreen). Caso esteja usando o componente de página, utilize `page.openConnectionsEditor()` para abrir o editor visual; ele lida com a passagem de `page` e `widgets` e propaga o resultado em `pageChange` quando o usuário salva.
|
|
255
|
-
|
|
256
158
|
## Dicas
|
|
257
|
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
159
|
+
|
|
160
|
+
- Trate `connections` como parte do contrato canonico salvo no JSON da pagina.
|
|
161
|
+
- Quando precisar revisar ligacoes, prefira inspecao textual/versionada do contrato e do runtime, nao um editor visual legado.
|
|
260
162
|
|
|
261
163
|
## API (resumo)
|
|
262
164
|
|
|
263
165
|
Exports deste pacote:
|
|
264
|
-
- `ConnectionBuilderComponent`
|
|
265
166
|
- `ComponentPaletteDialogComponent`
|
|
266
167
|
- `FloatingToolbarComponent`
|
|
267
168
|
- `TileToolbarComponent`
|
|
169
|
+
- `WidgetShellEditorComponent`
|
|
170
|
+
- `DynamicPageConfigEditorComponent`
|
|
171
|
+
- `DynamicPageBuilderComponent`
|
|
268
172
|
|
|
269
|
-
|
|
270
|
-
- `SettingsPanelService.open({ id, title, content: { component, inputs } })`
|
|
271
|
-
- Métodos do componente da página: `openConnectionsGraph()`, `openConnectionsBuilder()`, `openConnectionsEditor()`
|
|
173
|
+
Integracoes comuns:
|
|
174
|
+
- `SettingsPanelService.open({ id, title, content: { component, inputs } })` para page settings e shell editors
|
|
272
175
|
|
|
273
176
|
## Links
|
|
177
|
+
|
|
274
178
|
- Repo: https://github.com/codexrodrigues/praxis
|
|
275
179
|
- Issues: https://github.com/codexrodrigues/praxis/issues
|