@praxisui/page-builder 3.0.0-beta.1 → 3.0.0-beta.10
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 +47 -144
- package/fesm2022/praxisui-page-builder.mjs +2831 -3264
- package/index.d.ts +349 -318
- package/package.json +3 -4
- package/fesm2022/praxisui-page-builder.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# @praxisui/page-builder
|
|
2
2
|
|
|
3
|
-
Ferramentas de edicao para paginas dinamicas baseadas em
|
|
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
|
|
@@ -28,27 +28,23 @@ Peer dependencies (Angular v20):
|
|
|
28
28
|
- `@angular/forms` `^20.0.0`
|
|
29
29
|
- `@angular/cdk` `^20.0.0`
|
|
30
30
|
- `@angular/material` `^20.0.0`
|
|
31
|
-
- `angular-gridster2` `^20.2.2`
|
|
32
31
|
- `@praxisui/core` `*`
|
|
33
32
|
- `@praxisui/settings-panel` `*`
|
|
34
33
|
|
|
35
|
-
##
|
|
34
|
+
## Visao Geral
|
|
36
35
|
|
|
37
|
-
Este pacote
|
|
38
|
-
- `
|
|
39
|
-
- `
|
|
40
|
-
- `
|
|
41
|
-
- `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.
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
- Via `SettingsPanelService` (painel lateral) — recomendado para fluxo dentro do app.
|
|
45
|
-
- 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.
|
|
46
42
|
|
|
47
43
|
## AI Capabilities Registration
|
|
48
44
|
|
|
49
|
-
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.
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
Opcao recomendada (registro automatico via provider + InjectionToken):
|
|
52
48
|
|
|
53
49
|
```ts
|
|
54
50
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
@@ -71,7 +67,7 @@ bootstrapApplication(AppComponent, {
|
|
|
71
67
|
});
|
|
72
68
|
```
|
|
73
69
|
|
|
74
|
-
Registro manual (
|
|
70
|
+
Registro manual (util para apps que precisam customizar o mapa):
|
|
75
71
|
|
|
76
72
|
```ts
|
|
77
73
|
import { registerWidgetAiCatalogs } from '@praxisui/page-builder';
|
|
@@ -89,8 +85,7 @@ Registro via token:
|
|
|
89
85
|
|
|
90
86
|
## Settings Panel Bridge
|
|
91
87
|
|
|
92
|
-
Para abrir "
|
|
93
|
-
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:
|
|
94
89
|
|
|
95
90
|
```ts
|
|
96
91
|
import { SETTINGS_PANEL_BRIDGE } from '@praxisui/core';
|
|
@@ -104,110 +99,46 @@ providers: [
|
|
|
104
99
|
]
|
|
105
100
|
```
|
|
106
101
|
|
|
107
|
-
|
|
108
|
-
- `TABLE_AI_CAPABILITIES`
|
|
109
|
-
- `CRUD_AI_CAPABILITIES`
|
|
110
|
-
- `LIST_AI_CAPABILITIES`
|
|
111
|
-
- `FORM_AI_CAPABILITIES`
|
|
112
|
-
- `FILES_UPLOAD_AI_CAPABILITIES`
|
|
113
|
-
- `STEPPER_AI_CAPABILITIES`
|
|
114
|
-
- `TABS_AI_CAPABILITIES`
|
|
115
|
-
- `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`)
|
|
116
111
|
|
|
117
|
-
## Quick Start
|
|
112
|
+
## Quick Start
|
|
118
113
|
|
|
119
|
-
O
|
|
114
|
+
O builder canonico expoe authoring de shell/palette sobre `praxis-dynamic-page`. Exemplo de uso no template:
|
|
120
115
|
|
|
121
116
|
```html
|
|
122
|
-
<praxis-dynamic-
|
|
117
|
+
<praxis-dynamic-page-builder
|
|
123
118
|
#page
|
|
124
119
|
[page]="page"
|
|
125
120
|
[enableCustomization]="true"
|
|
126
121
|
(pageChange)="onPageChange($event)">
|
|
127
|
-
</praxis-dynamic-
|
|
128
|
-
|
|
129
|
-
<!-- Ações auxiliares -->
|
|
130
|
-
<button (click)="page.openConnectionsGraph()">Conexões (Graph)</button>
|
|
131
|
-
<button (click)="page.openConnectionsBuilder()">Conexões (Builder)</button>
|
|
132
|
-
<button (click)="page.openConnectionsEditor()">Editor Visual (Dialog)</button>
|
|
122
|
+
</praxis-dynamic-page-builder>
|
|
133
123
|
```
|
|
134
124
|
|
|
135
|
-
`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.
|
|
136
126
|
|
|
137
127
|
## Widget Shell (Dashboard Cards)
|
|
138
128
|
|
|
139
|
-
Cada widget pode declarar um `shell` para renderizar um card padronizado com
|
|
140
|
-
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).
|
|
141
130
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
{
|
|
146
|
-
"key": "dados-cadastrais",
|
|
147
|
-
"definition": { "id": "praxis-list", "inputs": { "listId": "dados", "config": {} } },
|
|
148
|
-
"layout": { "col": 1, "row": 1, "colSpan": 6, "rowSpan": 4 },
|
|
149
|
-
"shell": {
|
|
150
|
-
"kind": "dashboard-card",
|
|
151
|
-
"icon": "badge",
|
|
152
|
-
"title": "Dados Cadastrais",
|
|
153
|
-
"subtitle": "Servidor: Jéssica Techne",
|
|
154
|
-
"actions": [
|
|
155
|
-
{ "id": "editar", "label": "Editar", "icon": "edit", "variant": "outlined", "emit": "editar" },
|
|
156
|
-
{ "id": "imprimir", "label": "Imprimir", "icon": "print", "variant": "text", "emit": "imprimir" }
|
|
157
|
-
],
|
|
158
|
-
"windowActions": { "collapsible": true, "expandable": true },
|
|
159
|
-
"appearance": {
|
|
160
|
-
"card": { "background": "#0b1220", "borderColor": "rgba(255,255,255,0.12)", "borderRadius": "16px" },
|
|
161
|
-
"header": { "titleColor": "#e6edf3", "subtitleColor": "#9fb0c4", "iconColor": "#8ab4ff" },
|
|
162
|
-
"typography": { "titleSize": "14px", "titleWeight": "600", "subtitleSize": "12px" }
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
Quando uma ação é clicada, o shell:
|
|
171
|
-
- dispara um evento para o page-builder (`emit`, ou `shell:<id>` por padrão) para uso em `connections`;
|
|
172
|
-
- 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)`.
|
|
173
134
|
|
|
174
135
|
### Presets visuais (global)
|
|
175
136
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```json
|
|
179
|
-
{
|
|
180
|
-
"context": {
|
|
181
|
-
"ui": {
|
|
182
|
-
"shell": {
|
|
183
|
-
"preset": "dark-glass",
|
|
184
|
-
"presets": {
|
|
185
|
-
"dark-glass": {
|
|
186
|
-
"card": { "background": "#0b1220", "borderColor": "rgba(255,255,255,0.12)", "borderRadius": "16px" }
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
O widget pode sobrescrever:
|
|
196
|
-
|
|
197
|
-
```json
|
|
198
|
-
{
|
|
199
|
-
"shell": {
|
|
200
|
-
"preset": "light-neutral",
|
|
201
|
-
"appearance": { "header": { "titleColor": "#1f2937" } }
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
```
|
|
137
|
+
Voce pode definir presets globais na pagina e escolher um preset padrao para todos os cards por JSON no contexto da pagina.
|
|
205
138
|
|
|
206
139
|
## Editor do Card (Shell)
|
|
207
140
|
|
|
208
|
-
O
|
|
209
|
-
titulo, subtitulo, icone e acoes do cabecalho. O editor grava os metadados no campo
|
|
210
|
-
`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.
|
|
211
142
|
|
|
212
143
|
Para abrir via API (Settings Panel):
|
|
213
144
|
|
|
@@ -224,53 +155,25 @@ this.settingsPanel.open({
|
|
|
224
155
|
});
|
|
225
156
|
```
|
|
226
157
|
|
|
227
|
-
## Abrindo editores via Settings Panel
|
|
228
|
-
|
|
229
|
-
Para abrir o Builder/Graph em um painel lateral, injete o `SettingsPanelService` e forneça o conteúdo. O `ConnectionBuilderComponent` é exportado por este pacote.
|
|
230
|
-
|
|
231
|
-
```ts
|
|
232
|
-
import { Component } from '@angular/core';
|
|
233
|
-
import { SettingsPanelService } from '@praxisui/settings-panel';
|
|
234
|
-
import { ConnectionBuilderComponent } from '@praxisui/page-builder';
|
|
235
|
-
import type { GridPageDefinition, GridWidgetInstance } from '@praxisui/core';
|
|
236
|
-
|
|
237
|
-
@Component({ selector: 'app-page-tools', standalone: true })
|
|
238
|
-
export class PageToolsComponent {
|
|
239
|
-
constructor(private settings: SettingsPanelService) {}
|
|
240
|
-
|
|
241
|
-
openBuilder(page: GridPageDefinition, widgets: GridWidgetInstance[]) {
|
|
242
|
-
this.settings.open({
|
|
243
|
-
id: 'grid-connections:builder',
|
|
244
|
-
title: 'Conexões (Builder)',
|
|
245
|
-
content: { component: ConnectionBuilderComponent, inputs: { page, widgets } },
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
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.
|
|
252
|
-
|
|
253
|
-
## Diálogo fullscreen (Graph/Editor Visual)
|
|
254
|
-
|
|
255
|
-
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.
|
|
256
|
-
|
|
257
158
|
## Dicas
|
|
258
|
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
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.
|
|
261
162
|
|
|
262
163
|
## API (resumo)
|
|
263
164
|
|
|
264
165
|
Exports deste pacote:
|
|
265
|
-
- `ConnectionBuilderComponent`
|
|
266
166
|
- `ComponentPaletteDialogComponent`
|
|
267
167
|
- `FloatingToolbarComponent`
|
|
268
168
|
- `TileToolbarComponent`
|
|
169
|
+
- `WidgetShellEditorComponent`
|
|
170
|
+
- `DynamicPageConfigEditorComponent`
|
|
171
|
+
- `DynamicPageBuilderComponent`
|
|
269
172
|
|
|
270
|
-
|
|
271
|
-
- `SettingsPanelService.open({ id, title, content: { component, inputs } })`
|
|
272
|
-
- 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
|
|
273
175
|
|
|
274
176
|
## Links
|
|
177
|
+
|
|
275
178
|
- Repo: https://github.com/codexrodrigues/praxis
|
|
276
179
|
- Issues: https://github.com/codexrodrigues/praxis/issues
|