robobyte-front-builder 1.0.25 → 1.0.27
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/INTEGRATION.md +94 -10
- package/LICENSE +65 -0
- package/README.md +149 -21
- package/docs/ReportViewer.md +581 -0
- package/docs/fetchReportData.md +379 -0
- package/docs/printLayout.md +405 -0
- package/package.json +29 -1
- package/src/lib/agGridTheme.js +58 -0
- package/src/lib/agGridThemeContext.jsx +42 -0
- package/src/lib/index.js +7 -0
- package/src/lib/providers/RoboByteFrontBuilderProvider.jsx +14 -0
- package/src/views/builder/viewer/renderers/DataGridRenderer.jsx +4 -4
- package/src/views/genericTable/SGrid.js +5 -5
- package/src/views/genericTable/TAGGrid.js +3 -5
- package/src/views/rolePermissions/UpdateReportPermissionDialog.js +4 -0
- package/training/00-index.md +168 -0
- package/training/01-input.md +144 -0
- package/training/02-checkbox.md +107 -0
- package/training/03-dropdown.md +135 -0
- package/training/04-datepicker.md +139 -0
- package/training/05-radio.md +123 -0
- package/training/06-number.md +133 -0
- package/training/07-textarea.md +114 -0
- package/training/08-richtext.md +112 -0
- package/training/09-tag.md +110 -0
- package/training/10-time.md +107 -0
- package/training/11-toggle.md +108 -0
- package/training/12-signature.md +107 -0
- package/training/13-autocomplete.md +134 -0
- package/training/14-button.md +168 -0
- package/training/15-label.md +138 -0
- package/training/16-header.md +128 -0
- package/training/17-divider.md +96 -0
- package/training/18-image.md +105 -0
- package/training/19-link.md +108 -0
- package/training/20-banner.md +122 -0
- package/training/21-progress-circle.md +101 -0
- package/training/22-progress-line.md +93 -0
- package/training/23-menu.md +139 -0
- package/training/24-popover.md +114 -0
- package/training/25-layout.md +116 -0
- package/training/26-layout-cell.md +143 -0
- package/training/27-card.md +87 -0
- package/training/28-wizard.md +126 -0
- package/training/29-wizard-step.md +92 -0
- package/training/30-repeater.md +123 -0
- package/training/31-dialog.md +131 -0
- package/training/32-breadcrumb.md +121 -0
- package/training/33-dataGrid.md +129 -0
- package/training/34-dataTableViewer.md +115 -0
- package/training/35-reportViewer.md +673 -0
- package/training/36-viewRenderer.md +110 -0
- package/training/37-treeView.md +170 -0
- package/training/38-kpi-metric.md +148 -0
- package/training/39-kpi-trend.md +105 -0
- package/training/40-kpi-badge.md +112 -0
- package/training/41-kpi-statusDot.md +118 -0
- package/training/42-kpi-iconBox.md +114 -0
- package/training/43-kpi-gauge.md +143 -0
- package/training/44-kpi-bulletChart.md +126 -0
- package/training/45-kpi-colorScale.md +143 -0
- package/training/46-kpi-rating.md +125 -0
- package/training/47-kpi-countdown.md +151 -0
- package/training/48-fetchReportData.md +276 -0
- package/training/49-printLayout.md +215 -0
- package/training/examples/01-login-form.json +176 -0
- package/training/examples/02-contact-form.json +141 -0
- package/training/examples/03-kpi-cards-row.json +123 -0
- package/training/examples/04-settings-toggles.json +153 -0
- package/training/examples/05-user-profile-card.json +136 -0
- package/training/examples/06-date-range-filter.json +108 -0
- package/training/examples/07-search-bar-results.json +130 -0
- package/training/examples/08-notification-settings.json +131 -0
- package/training/examples/09-employee-profile-form.json +259 -0
- package/training/examples/10-invoice-form.json +241 -0
- package/training/examples/11-dashboard-overview.json +251 -0
- package/training/examples/12-registration-wizard.json +154 -0
- package/training/examples/13-product-catalog.json +168 -0
- package/training/examples/14-data-table-with-filters.json +180 -0
- package/training/examples/15-tabbed-profile.json +92 -0
- package/training/examples/16-kpi-full-row.json +203 -0
- package/training/examples/17-tree-detail-view.json +139 -0
- package/training/examples/18-employee-management.json +233 -0
- package/training/examples/19-sales-dashboard.json +272 -0
- package/training/examples/20-checkout-wizard.json +225 -0
- package/training/examples/21-analytics-page.json +222 -0
- package/training/examples/22-hr-onboarding.json +222 -0
- package/training/examples/23-document-browser.json +241 -0
- package/training/examples/24-order-management.json +290 -0
- package/training/examples/25-crm-contact-page.json +272 -0
package/INTEGRATION.md
CHANGED
|
@@ -173,6 +173,9 @@ function RoboByteBridge({ children }) {
|
|
|
173
173
|
user={auth.user}
|
|
174
174
|
accessToken={auth.accessToken}
|
|
175
175
|
agGridLicenseKey={process.env.NEXT_PUBLIC_AG_GRID_LICENSE_KEY}
|
|
176
|
+
// Optional — Quartz theme overrides for every <AgGridReact> in the
|
|
177
|
+
// package. Merged on top of the package defaults.
|
|
178
|
+
// agGridTheme={{ accentColor: '#3b82f6', headerHeight: 32 }}
|
|
176
179
|
>
|
|
177
180
|
{children}
|
|
178
181
|
</RoboByteFrontBuilderProvider>
|
|
@@ -200,11 +203,15 @@ export default function App({ Component, pageProps }) {
|
|
|
200
203
|
| `user` | object | Current user object from your auth context |
|
|
201
204
|
| `accessToken` | string | Bearer token — attached to every robobyte service call |
|
|
202
205
|
| `agGridLicenseKey` | string | AG Grid Enterprise license key. The provider calls `LicenseManager.setLicenseKey()` and registers `AllEnterpriseModule` + `IntegratedChartsModule.with(AgChartsEnterpriseModule)` internally. |
|
|
206
|
+
| `agGridTheme` | object | Optional. Quartz theme overrides applied to every `<AgGridReact>` in the package. Merged on top of `DEFAULT_AG_THEME_PARAMS` (see [`src/lib/agGridTheme.js`](src/lib/agGridTheme.js)). Example: `{ accentColor: '#3b82f6', headerHeight: 32 }`. |
|
|
203
207
|
| `navExtensions` | array | Static nav items to inject into the sidebar (optional) |
|
|
204
208
|
| `endpoints` | object | Full-URL overrides per endpoint group + name (optional) |
|
|
205
209
|
|
|
206
210
|
> **AG Grid note:** Do not call `LicenseManager` or `ModuleRegistry` in the
|
|
207
|
-
> host app — the provider handles it entirely via `agGridLicenseKey`.
|
|
211
|
+
> host app — the provider handles it entirely via `agGridLicenseKey`. The
|
|
212
|
+
> theme is also handled internally — do not pass `theme={...}` to
|
|
213
|
+
> individual `<AgGridReact>` instances rendered by the package; the
|
|
214
|
+
> `agGridTheme` prop is the single source of truth.
|
|
208
215
|
|
|
209
216
|
---
|
|
210
217
|
|
|
@@ -308,17 +315,35 @@ Paths to stub out:
|
|
|
308
315
|
Fetches report data by `pageId` without any AG Grid dependency. The canonical
|
|
309
316
|
implementation lives in the package at `services/reportData/fetchReportData`.
|
|
310
317
|
|
|
311
|
-
|
|
318
|
+
For the full host-app reference (cancellation in `useEffect`, memoizing
|
|
319
|
+
filters, paginated cursor hook, exporting to XLSX, all recipes and pitfalls),
|
|
320
|
+
see **[`docs/fetchReportData.md`](docs/fetchReportData.md)**. The companion
|
|
321
|
+
in-builder Calculation manual is **[`training/48-fetchReportData.md`](training/48-fetchReportData.md)**
|
|
322
|
+
(the auto-injected `fetchReportData` symbol).
|
|
312
323
|
|
|
313
|
-
|
|
314
|
-
of `services/reportData/fetchReportData` — from any file, host or package — to
|
|
315
|
-
the package's copy via `NormalModuleReplacementPlugin`. The host app's local
|
|
316
|
-
copy (if any) should be emptied out and never executed.
|
|
324
|
+
### Sourcing — both import paths work
|
|
317
325
|
|
|
318
|
-
|
|
326
|
+
Since v1.0.23, the recommended import is the package surface:
|
|
327
|
+
|
|
328
|
+
```js
|
|
329
|
+
import { fetchReportDataByPageId } from 'robobyte-front-builder'
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
The legacy bare-alias path also still works and resolves to the same module
|
|
333
|
+
via the `NormalModuleReplacementPlugin` rule:
|
|
319
334
|
|
|
320
335
|
```js
|
|
321
336
|
import fetchReportDataByPageId from 'services/reportData/fetchReportData'
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Both paths point to the same file, so the in-memory `builderModelCache` is
|
|
340
|
+
shared. Pick the package import for new code — it doesn't depend on the
|
|
341
|
+
webpack rule.
|
|
342
|
+
|
|
343
|
+
### Usage
|
|
344
|
+
|
|
345
|
+
```js
|
|
346
|
+
import { fetchReportDataByPageId } from 'robobyte-front-builder'
|
|
322
347
|
|
|
323
348
|
const result = await fetchReportDataByPageId({
|
|
324
349
|
pageId, // string | number — required
|
|
@@ -374,9 +399,18 @@ import { ReportViewer } from 'robobyte-front-builder'
|
|
|
374
399
|
noHeader={true}
|
|
375
400
|
filter={{ Tfilter: [...] }}
|
|
376
401
|
height="400px"
|
|
402
|
+
title="Q1 Orders" // toolbar title (left side)
|
|
403
|
+
caption="2026-01-01 → 2026-03-31"
|
|
377
404
|
/>
|
|
378
405
|
```
|
|
379
406
|
|
|
407
|
+
For the complete host-app reference — every prop, the new `viewerActions` /
|
|
408
|
+
`title` / `caption` / `debug` props, `setOutGridApi` for raw AG Grid API
|
|
409
|
+
access, building filters from React state, master/detail patterns, dialog
|
|
410
|
+
embedding, all pitfalls — see **[`docs/ReportViewer.md`](docs/ReportViewer.md)**.
|
|
411
|
+
The schema-side AI manual for the same component is
|
|
412
|
+
**[`training/35-reportViewer.md`](training/35-reportViewer.md)**.
|
|
413
|
+
|
|
380
414
|
### Props
|
|
381
415
|
|
|
382
416
|
| Prop | Type | Description |
|
|
@@ -858,9 +892,9 @@ The print builder persists layouts via four REST endpoints. The host API must im
|
|
|
858
892
|
|
|
859
893
|
The `value` field is the schema serialised with `JSON.stringify`. The print builder deserialises it with `JSON.parse` after fetching.
|
|
860
894
|
|
|
861
|
-
### Step 3 — Trigger print from a view
|
|
895
|
+
### Step 3 — Trigger print from a view (inside the builder)
|
|
862
896
|
|
|
863
|
-
Inside any action code (button `onClick`, row action, etc.) in a UI Builder view:
|
|
897
|
+
Inside any action code (button `onClick`, row action, viewer action, form `onSubmit`, etc.) in a UI Builder view:
|
|
864
898
|
|
|
865
899
|
```js
|
|
866
900
|
openPrintLayout('your-layout-id', {
|
|
@@ -871,7 +905,57 @@ openPrintLayout('your-layout-id', {
|
|
|
871
905
|
})
|
|
872
906
|
```
|
|
873
907
|
|
|
874
|
-
`openPrintLayout` is injected into every action's execution scope automatically by `ProductionViewer`. No import is needed.
|
|
908
|
+
`openPrintLayout` is injected into every action's execution scope automatically by `ProductionViewer`. No import is needed. The companion helper `closePrintLayout()` dismisses the dialog programmatically.
|
|
909
|
+
|
|
910
|
+
For the full Calculation-scope reference (data shape, all trigger points, recipes for row actions / viewer actions / form submits, pitfalls), see **[`training/49-printLayout.md`](training/49-printLayout.md)**.
|
|
911
|
+
|
|
912
|
+
### Step 3b — Trigger print from host-app code (outside the builder)
|
|
913
|
+
|
|
914
|
+
When you need to print from regular host-app React code — a custom page, an action handler, a dialog, a hook, anywhere outside a builder Calculation — use the imperative `PrintDialog` API.
|
|
915
|
+
|
|
916
|
+
The pattern, condensed:
|
|
917
|
+
|
|
918
|
+
```jsx
|
|
919
|
+
// host-app/pages/invoices.jsx (or any host React file)
|
|
920
|
+
import { useRef } from 'react'
|
|
921
|
+
import PrintDialog from 'views/builder/viewer/PrintDialog' // bare-aliased import
|
|
922
|
+
|
|
923
|
+
export default function InvoicesPage() {
|
|
924
|
+
const printDialogRef = useRef(null)
|
|
925
|
+
|
|
926
|
+
const viewerContext = {
|
|
927
|
+
printDialogRef,
|
|
928
|
+
data: {}, setData: () => {}, form: {}, setForm: () => {},
|
|
929
|
+
mode: 'preview', isEditMode: false, isPreviewMode: true, isPrintContext: true,
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
return (
|
|
933
|
+
<>
|
|
934
|
+
<Button
|
|
935
|
+
onClick={() => printDialogRef.current?.open('invoice-layout-id', {
|
|
936
|
+
invoiceNumber: 'INV-1042',
|
|
937
|
+
customerName: 'Acme Corp',
|
|
938
|
+
lines: [{ sku: 'A', qty: 2 }],
|
|
939
|
+
})}
|
|
940
|
+
>
|
|
941
|
+
Print Invoice
|
|
942
|
+
</Button>
|
|
943
|
+
|
|
944
|
+
<PrintDialog viewerContext={viewerContext} />
|
|
945
|
+
</>
|
|
946
|
+
)
|
|
947
|
+
}
|
|
948
|
+
```
|
|
949
|
+
|
|
950
|
+
Three things to know:
|
|
951
|
+
|
|
952
|
+
1. **The `PrintDialog` import is bare-aliased.** Either add `views/builder/viewer/PrintDialog` to your `packageOwnedServices` array in `next.config.js` (next to the existing `services/reportData/fetchReportData` entry), or use the longer path `'robobyte-front-builder/src/views/builder/viewer/PrintDialog'`. Both resolve to the same file.
|
|
953
|
+
|
|
954
|
+
2. **The dialog is mounted-but-hidden.** It registers itself on `printDialogRef.current` after first render and exposes `{ open(layoutId, data), openWithSchema(schema, data), close() }`.
|
|
955
|
+
|
|
956
|
+
3. **For multi-page apps, prefer a `PrintProvider` pattern** — mount the dialog once at `_app.js` level and expose `usePrintLayout()` from a React context so every page gets `openPrintLayout(id, data)` without re-mounting. The full pattern is in **[`docs/printLayout.md`](docs/printLayout.md)**.
|
|
957
|
+
|
|
958
|
+
For the complete host-app reference (the three mounting patterns, listing layouts, recipes for printing from a `<ReportViewer>` viewer action, all pitfalls), see **[`docs/printLayout.md`](docs/printLayout.md)**.
|
|
875
959
|
|
|
876
960
|
### Step 4 — Build the layout
|
|
877
961
|
|
package/LICENSE
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 RoboByte / Hossny37
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Third-party components and commercial dependencies
|
|
26
|
+
|
|
27
|
+
The MIT license above applies to the source code of `robobyte-front-builder`
|
|
28
|
+
itself. This package depends on third-party libraries with their own licenses
|
|
29
|
+
that consumers must comply with separately. The notable ones:
|
|
30
|
+
|
|
31
|
+
### AG Grid Enterprise (peer dependency)
|
|
32
|
+
|
|
33
|
+
This package's report and grid components rely on AG Grid Enterprise features
|
|
34
|
+
(server-side row model, side tool panel, integrated charts, etc.) via the
|
|
35
|
+
`ag-grid-enterprise` peer dependency. AG Grid Enterprise is a **commercial,
|
|
36
|
+
proprietary product owned by AG Grid Ltd**. Consumers deploying this package
|
|
37
|
+
in production must obtain a valid AG Grid Enterprise license from AG Grid
|
|
38
|
+
Ltd and comply with their license terms:
|
|
39
|
+
|
|
40
|
+
https://www.ag-grid.com/license-pricing/
|
|
41
|
+
|
|
42
|
+
AG Grid Community (the base library, MIT-licensed) is sufficient for
|
|
43
|
+
development with a watermark; production use requires a paid license.
|
|
44
|
+
|
|
45
|
+
### MUI X (peer dependency)
|
|
46
|
+
|
|
47
|
+
`@mui/x-data-grid`, `@mui/x-date-pickers`, and related packages have free
|
|
48
|
+
(MIT) and paid (Pro / Premium) tiers. This package uses only the free
|
|
49
|
+
tiers by default. If a consumer opts to install Pro / Premium variants,
|
|
50
|
+
they must comply with MUI's commercial license:
|
|
51
|
+
|
|
52
|
+
https://mui.com/pricing/
|
|
53
|
+
|
|
54
|
+
### Other dependencies
|
|
55
|
+
|
|
56
|
+
All other runtime and peer dependencies are open-source under permissive
|
|
57
|
+
licenses (MIT, Apache 2.0, ISC, BSD). Run `npm ls --omit dev` to inspect
|
|
58
|
+
the full graph and `npm-license-checker` (or similar) to enumerate licenses.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
The license above does not waive or modify the terms of any third-party
|
|
63
|
+
license referenced in this document. Consumers are responsible for
|
|
64
|
+
obtaining and complying with licenses required by their use of those
|
|
65
|
+
third-party components.
|
package/README.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
A low-code **UI Builder**, **Report Builder**, **Print Layout Designer**, and **Navigation Extension API** for Next.js applications.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/robobyte-front-builder)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
[](https://github.com/Hossny37/RoboByteFrontBuilder)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 📚 Documentation
|
|
12
|
+
|
|
13
|
+
| Document | Audience | What it covers |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| **[README.md](./README.md)** *(this file)* | Everyone | Public surface, provider props, every component's inspector schema, action-scope tables, troubleshooting, changelog. The exhaustive reference. |
|
|
16
|
+
| **[INTEGRATION.md](./INTEGRATION.md)** | Host-app developers | `next.config.js` setup, peer deps, page wrapper pattern, provider bridge, print layout integration steps. |
|
|
17
|
+
| **[docs/ReportViewer.md](./docs/ReportViewer.md)** | Host-app developers | Embedding `<ReportViewer>` in regular React (cancellation, memo'd filters, `viewerActions`, master/detail patterns). |
|
|
18
|
+
| **[docs/fetchReportData.md](./docs/fetchReportData.md)** | Host-app developers | Calling `fetchReportDataByPageId` directly from host code (hooks, KPI counters, XLSX export, paginated cursors). |
|
|
19
|
+
| **[docs/printLayout.md](./docs/printLayout.md)** | Host-app developers | Triggering print layouts via `PrintDialog` ref API, recommended `PrintProvider` + `usePrintLayout()` pattern. |
|
|
20
|
+
| **[training/00-index.md](./training/00-index.md)** | AI sessions / schema authors | Component catalog index — categories and one-page refs for every component the builder ships. |
|
|
21
|
+
| **[training/35-reportViewer.md](./training/35-reportViewer.md)** | AI sessions / schema authors | Full AI manual for the `reportViewer` component (Calculation scope, action arrays, filter shape, recipes). |
|
|
22
|
+
| **[training/48-fetchReportData.md](./training/48-fetchReportData.md)** | AI sessions / schema authors | In-builder Calculation reference for the auto-injected `fetchReportData` helper. |
|
|
23
|
+
| **[training/49-printLayout.md](./training/49-printLayout.md)** | AI sessions / schema authors | In-builder Calculation reference for `openPrintLayout` / `closePrintLayout`. |
|
|
24
|
+
| **[RoboByteBuilder_User_Manual.docx](./RoboByteBuilder_User_Manual.docx)** | End users | Visual user manual for the builder UI. Ships inside the package. |
|
|
25
|
+
|
|
26
|
+
> **Pair convention.** Most features have **two** manuals: a `docs/` one for host-app React code (consumer of the package) and a `training/` one for AI sessions emitting builder schemas / Calculation code. They cross-link each other; pick the audience that matches your task.
|
|
6
27
|
|
|
7
28
|
---
|
|
8
29
|
|
|
@@ -17,27 +38,28 @@ A low-code **UI Builder**, **Report Builder**, **Print Layout Designer**, and **
|
|
|
17
38
|
7. [Builder pages](#builder-pages)
|
|
18
39
|
8. [Navigation Extension API](#navigation-extension-api)
|
|
19
40
|
9. [Provider props reference](#provider-props-reference)
|
|
20
|
-
10. [
|
|
21
|
-
11. [
|
|
22
|
-
12. [
|
|
23
|
-
13. [
|
|
24
|
-
14. [
|
|
25
|
-
15. [
|
|
26
|
-
16. [
|
|
27
|
-
17. [
|
|
28
|
-
18. [
|
|
29
|
-
19. [
|
|
30
|
-
20. [
|
|
31
|
-
21. [
|
|
32
|
-
22. [
|
|
33
|
-
23. [
|
|
34
|
-
24. [
|
|
35
|
-
25. [
|
|
36
|
-
26. [
|
|
37
|
-
27. [
|
|
38
|
-
28. [
|
|
39
|
-
29. [
|
|
40
|
-
30. [
|
|
41
|
+
10. [AG Grid theme](#ag-grid-theme)
|
|
42
|
+
11. [fetchReportDataByPageId](#fetchreportdatabypageid)
|
|
43
|
+
12. [ReportViewer as a component](#reportviewer-as-a-component)
|
|
44
|
+
13. [Data Grid component](#data-grid-component)
|
|
45
|
+
14. [Dialog component](#dialog-component)
|
|
46
|
+
15. [Popover component](#popover-component)
|
|
47
|
+
16. [Excel Upload component](#excel-upload-component)
|
|
48
|
+
17. [Wizard component](#wizard-component)
|
|
49
|
+
18. [Repeater component](#repeater-component)
|
|
50
|
+
19. [Menu component](#menu-component)
|
|
51
|
+
20. [View Renderer component](#view-renderer-component)
|
|
52
|
+
21. [Layout Grid component](#layout-grid-component)
|
|
53
|
+
22. [Breadcrumb component](#breadcrumb-component)
|
|
54
|
+
23. [Print Layout Builder](#print-layout-builder)
|
|
55
|
+
24. [Calculation Scope Reference](#calculation-scope-reference)
|
|
56
|
+
25. [KPI Component Actions](#kpi-component-actions)
|
|
57
|
+
26. [Global Data Store](#global-data-store)
|
|
58
|
+
27. [Dark / Light theme](#dark--light-theme)
|
|
59
|
+
28. [Syncing local changes](#syncing-local-changes)
|
|
60
|
+
29. [Troubleshooting](#troubleshooting)
|
|
61
|
+
30. [Publishing](#publishing)
|
|
62
|
+
31. [Changelog](#changelog)
|
|
41
63
|
|
|
42
64
|
---
|
|
43
65
|
|
|
@@ -171,6 +193,11 @@ function RoboByteBridge({ children }) {
|
|
|
171
193
|
user={auth.user}
|
|
172
194
|
accessToken={auth.accessToken}
|
|
173
195
|
agGridLicenseKey={process.env.NEXT_PUBLIC_AG_GRID_LICENSE_KEY}
|
|
196
|
+
// Optional: Quartz theme overrides applied to every <AgGridReact>
|
|
197
|
+
// in the package. Merged on top of the package defaults — see the
|
|
198
|
+
// "AG Grid theme" section for the full list of params and the
|
|
199
|
+
// programmatic API. Omit to use the package defaults.
|
|
200
|
+
agGridTheme={{ accentColor: '#3b82f6' }}
|
|
174
201
|
>
|
|
175
202
|
{children}
|
|
176
203
|
</RoboByteFrontBuilderProvider>
|
|
@@ -316,6 +343,7 @@ function MyFeaturePlugin() {
|
|
|
316
343
|
| `user` | object | Current user object from your auth context |
|
|
317
344
|
| `accessToken` | string | Bearer token attached to every service call |
|
|
318
345
|
| `agGridLicenseKey` | string | AG Grid Enterprise license key — the provider calls `LicenseManager.setLicenseKey()` and registers all enterprise modules internally |
|
|
346
|
+
| `agGridTheme` | object | Quartz theme overrides applied to every `<AgGridReact>` in the package. Merged on top of `DEFAULT_AG_THEME_PARAMS`. Example: `{ accentColor: '#3b82f6', headerHeight: 32 }`. See [AG Grid theme](#ag-grid-theme). |
|
|
319
347
|
| `navExtensions` | array | Static nav items to inject into the sidebar |
|
|
320
348
|
| `endpoints` | object | Full-URL overrides per endpoint group + name |
|
|
321
349
|
|
|
@@ -323,6 +351,58 @@ function MyFeaturePlugin() {
|
|
|
323
351
|
|
|
324
352
|
---
|
|
325
353
|
|
|
354
|
+
## AG Grid theme
|
|
355
|
+
|
|
356
|
+
Every `<AgGridReact>` in the package — `reportViewer`, `dataGrid`, the role-permission editor, the navigator picker — reads its theme from a single context. The default lives in code at [`src/lib/agGridTheme.js`](src/lib/agGridTheme.js) and can be overridden in two places:
|
|
357
|
+
|
|
358
|
+
### 1. Host-app override via the provider
|
|
359
|
+
|
|
360
|
+
Pass an object of Quartz params to `agGridTheme`. The object is merged on top of the package defaults — keys you set win, everything else falls back.
|
|
361
|
+
|
|
362
|
+
```jsx
|
|
363
|
+
<RoboByteFrontBuilderProvider
|
|
364
|
+
agGridTheme={{
|
|
365
|
+
accentColor: '#3b82f6',
|
|
366
|
+
headerHeight: 32,
|
|
367
|
+
fontFamily: 'inherit',
|
|
368
|
+
}}
|
|
369
|
+
/* …other props… */
|
|
370
|
+
>
|
|
371
|
+
<App />
|
|
372
|
+
</RoboByteFrontBuilderProvider>
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
See the [AG Grid Quartz theming reference](https://www.ag-grid.com/react-data-grid/theming/) for the full list of params.
|
|
376
|
+
|
|
377
|
+
### 2. Package-wide default
|
|
378
|
+
|
|
379
|
+
Open [`src/lib/agGridTheme.js`](src/lib/agGridTheme.js) and edit `DEFAULT_AG_THEME_PARAMS`. Affects every consumer of `robobyte-front-builder` that doesn't supply its own `agGridTheme`.
|
|
380
|
+
|
|
381
|
+
### Programmatic use
|
|
382
|
+
|
|
383
|
+
```js
|
|
384
|
+
import {
|
|
385
|
+
DEFAULT_AG_THEME_PARAMS, // frozen params object
|
|
386
|
+
DEFAULT_AG_THEME, // pre-built Quartz theme
|
|
387
|
+
buildAgGridTheme, // (overrides) => Quartz theme
|
|
388
|
+
AgGridThemeProvider, // standalone provider (no other dependencies)
|
|
389
|
+
useAgGridTheme, // hook returning the resolved theme
|
|
390
|
+
} from 'robobyte-front-builder'
|
|
391
|
+
|
|
392
|
+
// In a host component that renders its own AG Grid:
|
|
393
|
+
import { AgGridReact } from 'ag-grid-react'
|
|
394
|
+
function MyGrid() {
|
|
395
|
+
const theme = useAgGridTheme()
|
|
396
|
+
return <AgGridReact theme={theme} columnDefs={[...]} />
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
The hook falls back to `DEFAULT_AG_THEME` when called outside `RoboByteFrontBuilderProvider`, so isolated grids still render correctly.
|
|
401
|
+
|
|
402
|
+
> **Future plan.** A "system settings" path will eventually layer between `DEFAULT_AG_THEME_PARAMS` and the host's `agGridTheme` prop, letting admins customize the theme without a code change. The provider API will stay the same.
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
326
406
|
## `fetchReportDataByPageId`
|
|
327
407
|
|
|
328
408
|
Fetches report data by `pageId` without any AG Grid dependency. Always imported from the package path — the `NormalModuleReplacementPlugin` in `next.config.js` routes it to the package's canonical implementation.
|
|
@@ -868,6 +948,9 @@ Hot-reload picks up all file changes automatically. Only `next.config.js` change
|
|
|
868
948
|
**AG Grid error #200 — IntegratedChartsModule not registered**
|
|
869
949
|
→ The provider registers `IntegratedChartsModule.with(AgChartsEnterpriseModule)` automatically. Ensure `ag-charts-enterprise` is installed in the package.
|
|
870
950
|
|
|
951
|
+
**AG Grid theme override not applying**
|
|
952
|
+
→ Pass it via `<RoboByteFrontBuilderProvider agGridTheme={{ … }}>`, not as a `theme={…}` prop on individual `<AgGridReact>` instances rendered by the package. Internal grids ignore per-instance themes; the provider's context is the single source of truth. See the *AG Grid theme* section.
|
|
953
|
+
|
|
871
954
|
**ReportViewer renders at half width**
|
|
872
955
|
→ The outer `Box` in `reportViewer/index.js` must use `display: 'block'`, not `display: 'flex'`.
|
|
873
956
|
|
|
@@ -903,6 +986,15 @@ npm publish --dry-run
|
|
|
903
986
|
|
|
904
987
|
## Changelog
|
|
905
988
|
|
|
989
|
+
### 1.0.25
|
|
990
|
+
- **Centralized AG Grid theme.** Every `<AgGridReact>` in the package (`reportViewer`, `dataGrid`, role-permission editor, navigator picker) now reads its Quartz theme from a single context. Host apps can override package-wide theme params (accent color, header height, fonts, border radius, etc.) via the new `agGridTheme` prop on `RoboByteFrontBuilderProvider`. Defaults live in [`src/lib/agGridTheme.js`](src/lib/agGridTheme.js). New exports: `DEFAULT_AG_THEME_PARAMS`, `DEFAULT_AG_THEME`, `buildAgGridTheme`, `AgGridThemeProvider`, `useAgGridTheme`.
|
|
991
|
+
- **`<ReportViewer>` redesigned toolbar.** Single-row toolbar: title + caption on the left; collapsible search, Filter (outlined button), Refresh (outlined button), and configurable viewer actions on the right. Auto-refresh interval, "Load all data" toggle, and Excel export moved into the side tool panel under *Display Settings*. Search popover navigable by keyboard (↑ ↓ Home End Enter Esc).
|
|
992
|
+
- **`<ReportViewer>` new inspector fields.** `title`, `caption`, `viewerActions` (array of page-level action buttons appended after Filter/Refresh), `debug` (renders a floating bug icon with a popover showing resolved `pageId`/`id`/builder model id/etc. — hidden in production by default).
|
|
993
|
+
- **Print Layout integration.** Host apps can now trigger print layouts directly via the imperative `PrintDialog` ref API — see [docs/printLayout.md](./docs/printLayout.md) for the recommended `PrintProvider` pattern with `usePrintLayout()`.
|
|
994
|
+
- **Public exports expanded.** `fetchReportDataByPageId` now exported from the package surface (`import { fetchReportDataByPageId } from 'robobyte-front-builder'`); the legacy bare-alias path still works.
|
|
995
|
+
- **Unsaved changes guard.** Builder pages now warn on tab close / refresh / in-app navigation when the schema has unsaved edits. `BuilderProvider` exposes `loadSchema(schema)` (clears history baseline), `markClean()` (post-save reset), and `isDirty`.
|
|
996
|
+
- **Session log + AI fine-tune pipeline.** Every successful save (UI Builder + Print Builder) is auto-logged to localStorage with the full schema. New *Session Logs* toolbar dialog lets developers add training prompts to entries and export a Together AI-ready JSONL. Together is now a first-class AI provider in `/api/ai`.
|
|
997
|
+
|
|
906
998
|
### 1.0.21
|
|
907
999
|
- Added Timer Engine — configurable auto-refresh timers per view
|
|
908
1000
|
- Added full Undo / Redo history with keyboard shortcuts (Ctrl+Z / Ctrl+Y)
|
|
@@ -925,4 +1017,40 @@ npm publish --dry-run
|
|
|
925
1017
|
|
|
926
1018
|
---
|
|
927
1019
|
|
|
1020
|
+
## License & third-party components
|
|
1021
|
+
|
|
1022
|
+
`robobyte-front-builder` itself is released under the **[MIT License](./LICENSE)** — the source code in this repository is free to use, modify, and distribute, including in commercial products.
|
|
1023
|
+
|
|
1024
|
+
> **Important:** this package depends on third-party libraries with their own licenses. The MIT license applies only to *this* package's source code; it does not relicense or waive obligations under those third-party licenses.
|
|
1025
|
+
|
|
1026
|
+
### AG Grid Enterprise — commercial license required for production
|
|
1027
|
+
|
|
1028
|
+
The report and grid components use AG Grid Enterprise features (server-side row model, side tool panel, status bar, integrated charts, master/detail). The `ag-grid-enterprise` package is a **commercial product** owned by AG Grid Ltd:
|
|
1029
|
+
|
|
1030
|
+
- **Development:** AG Grid Enterprise works without a license key, but renders a watermark and prints a console warning. Fine for local dev and evaluation.
|
|
1031
|
+
- **Production deployment:** requires a paid AG Grid Enterprise license. See [ag-grid.com/license-pricing](https://www.ag-grid.com/license-pricing/) for the current terms.
|
|
1032
|
+
|
|
1033
|
+
Pass your license key via the provider — the package calls `LicenseManager.setLicenseKey()` and registers `AllEnterpriseModule` + `IntegratedChartsModule.with(AgChartsEnterpriseModule)` internally:
|
|
1034
|
+
|
|
1035
|
+
```jsx
|
|
1036
|
+
<RoboByteFrontBuilderProvider
|
|
1037
|
+
agGridLicenseKey={process.env.NEXT_PUBLIC_AG_GRID_LICENSE_KEY}
|
|
1038
|
+
// …other props…
|
|
1039
|
+
>
|
|
1040
|
+
…
|
|
1041
|
+
</RoboByteFrontBuilderProvider>
|
|
1042
|
+
```
|
|
1043
|
+
|
|
1044
|
+
### MUI X — free vs. Pro / Premium tiers
|
|
1045
|
+
|
|
1046
|
+
`@mui/x-data-grid`, `@mui/x-date-pickers`, and related packages have a free MIT tier and paid Pro / Premium tiers. This package uses only the free tier. If you swap in `@mui/x-data-grid-pro` or `@mui/x-date-pickers-pro` in your host app, comply with MUI's commercial license: [mui.com/pricing](https://mui.com/pricing/).
|
|
1047
|
+
|
|
1048
|
+
### Everything else
|
|
1049
|
+
|
|
1050
|
+
All other runtime and peer dependencies are open-source under permissive licenses (MIT, Apache 2.0, ISC, BSD). Run `npm ls --omit dev` for the full dependency graph and a tool like `license-checker` for a license enumeration.
|
|
1051
|
+
|
|
1052
|
+
A condensed version of this notice lives in the [`LICENSE`](./LICENSE) file shipped with the package.
|
|
1053
|
+
|
|
1054
|
+
---
|
|
1055
|
+
|
|
928
1056
|
*Full user manual: [RoboByteBuilder_User_Manual.docx](./RoboByteBuilder_User_Manual.docx) (included in the package)*
|