@genesislcap/foundation-react-utils 15.46.6-alpha-606571609.0 → 15.48.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 +0 -51
- package/dist/custom-elements.json +7 -124
- package/dist/dts/index.d.ts +0 -3
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -3
- package/dist/foundation-react-utils.api.json +0 -452
- package/dist/foundation-react-utils.d.ts +0 -115
- package/package.json +12 -12
- package/dist/dts/error-boundary/error-boundary-styles.d.ts +0 -6
- package/dist/dts/error-boundary/error-boundary-styles.d.ts.map +0 -1
- package/dist/dts/error-boundary/error-boundary.d.ts +0 -105
- package/dist/dts/error-boundary/error-boundary.d.ts.map +0 -1
- package/dist/dts/error-boundary/index.d.ts +0 -3
- package/dist/dts/error-boundary/index.d.ts.map +0 -1
- package/dist/esm/error-boundary/error-boundary-styles.js +0 -133
- package/dist/esm/error-boundary/error-boundary.js +0 -225
- package/dist/esm/error-boundary/index.js +0 -1
package/README.md
CHANGED
|
@@ -47,57 +47,6 @@ resolving a second copy of the library, which breaks the `instanceof` checks `fl
|
|
|
47
47
|
relies on internally; the entry point logs a warning when the version it loads differs from the one
|
|
48
48
|
the theme was generated against.
|
|
49
49
|
|
|
50
|
-
## Error boundaries
|
|
51
|
-
|
|
52
|
-
`AppErrorBoundary` wraps the whole app, and `TileErrorBoundary` (or the `withTileErrorBoundary`
|
|
53
|
-
HOC) wraps a single tile, so a crash replaces only that tile. Both render a fallback with a
|
|
54
|
-
reference ID, copyable diagnostics and a Retry button that remounts the children.
|
|
55
|
-
|
|
56
|
-
With `setupErrorMonitoring` from `@genesislcap/foundation-utils`, caught errors are reported with
|
|
57
|
-
their reference ID, scope, title, tile registration and component stack, and nothing else is
|
|
58
|
-
needed:
|
|
59
|
-
|
|
60
|
-
```tsx
|
|
61
|
-
import { AppErrorBoundary, onCaughtError } from '@genesislcap/foundation-react-utils';
|
|
62
|
-
|
|
63
|
-
createRoot(el, { onCaughtError }).render(
|
|
64
|
-
<AppErrorBoundary>
|
|
65
|
-
<App />
|
|
66
|
-
</AppErrorBoundary>,
|
|
67
|
-
);
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
```tsx
|
|
71
|
-
import { TileErrorBoundary, withTileErrorBoundary } from '@genesislcap/foundation-react-utils';
|
|
72
|
-
|
|
73
|
-
<TileErrorBoundary title="Trade Blotter" tileRegistration="tradeBlotter">
|
|
74
|
-
<TradeBlotter />
|
|
75
|
-
</TileErrorBoundary>;
|
|
76
|
-
|
|
77
|
-
export const TradeBlotterTile = withTileErrorBoundary(TradeBlotter, 'Trade Blotter', 'tradeBlotter');
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
To handle caught errors yourself, pass `onError`. It receives an `ErrorBoundaryReport` (`error`,
|
|
81
|
-
`componentStack`, `referenceId`, `scope`, `title`, `tileRegistration`). `withTileErrorBoundary`
|
|
82
|
-
takes it as a fourth argument.
|
|
83
|
-
|
|
84
|
-
Pass `onCaughtError` to `createRoot`. By default React 19 logs every error a boundary catches to
|
|
85
|
-
`console.error` before the boundary runs, so a console-capturing monitoring tool reports the bare
|
|
86
|
-
error first and can drop or duplicate the boundary's own report. `onCaughtError` skips that log
|
|
87
|
-
for these boundaries, and still logs errors caught by any other boundary.
|
|
88
|
-
|
|
89
|
-
Without `onError`, a boundary logs each caught error through a foundation logger named
|
|
90
|
-
`ERROR_BOUNDARY_LOGGER_NAME`: the error, then an object with its reference ID, scope, title, tile
|
|
91
|
-
registration and component stack. A global log reporter (`addGlobalLogReporter` from
|
|
92
|
-
`@genesislcap/foundation-logger`) receives it, which is how `setupErrorMonitoring` reports it. With
|
|
93
|
-
`onError` set, the boundary doesn't log the error, so it isn't reported twice. If `onError` throws,
|
|
94
|
-
the boundary logs the original error and the handler's error, so neither is lost.
|
|
95
|
-
|
|
96
|
-
The fallback reads its colours and fonts from `--eb-*` CSS custom properties (`--eb-bg`,
|
|
97
|
-
`--eb-surface`, `--eb-text`, `--eb-text-muted`, `--eb-border`, `--eb-accent`, `--eb-error`,
|
|
98
|
-
`--eb-font`, and others), so set them on an ancestor to theme it. The last 20 reports are also kept
|
|
99
|
-
on `window.__GENESIS_ERROR_BOUNDARY_REPORTS__` for dev tooling such as the Genesis Create preview.
|
|
100
|
-
|
|
101
50
|
## License
|
|
102
51
|
|
|
103
52
|
Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.
|
|
@@ -254,14 +254,6 @@
|
|
|
254
254
|
"module": "./create-grid-pro-cell-renderer"
|
|
255
255
|
}
|
|
256
256
|
},
|
|
257
|
-
{
|
|
258
|
-
"kind": "js",
|
|
259
|
-
"name": "*",
|
|
260
|
-
"declaration": {
|
|
261
|
-
"name": "*",
|
|
262
|
-
"package": "./error-boundary"
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
257
|
{
|
|
266
258
|
"kind": "js",
|
|
267
259
|
"name": "RendererControlProps",
|
|
@@ -274,109 +266,23 @@
|
|
|
274
266
|
},
|
|
275
267
|
{
|
|
276
268
|
"kind": "javascript-module",
|
|
277
|
-
"path": "src/
|
|
278
|
-
"declarations": [
|
|
279
|
-
{
|
|
280
|
-
"kind": "variable",
|
|
281
|
-
"name": "errorBoundaryStyles",
|
|
282
|
-
"default": "`\n.error-boundary {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 12px;\n align-items: flex-start;\n width: 100%;\n height: 100%;\n padding: 16px;\n background: var(--eb-bg, #f6f8fb);\n color: var(--eb-text, #18212f);\n font-family: var(--eb-font, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif);\n}\n\n.error-boundary__top,\n.error-boundary__title,\n.error-boundary__subtitle,\n.error-boundary__details,\n.error-boundary__actions,\n.error-boundary__manual-copy-help {\n width: 100%;\n}\n\n.error-boundary__top {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n flex-wrap: wrap;\n}\n\n.error-boundary__status {\n display: inline-flex;\n align-items: center;\n border: 1px solid var(--eb-error, #c53d3d);\n border-radius: 999px;\n padding: 5px 10px;\n text-transform: uppercase;\n letter-spacing: 0.13em;\n font-size: 11px;\n font-weight: 700;\n color: var(--eb-error, #c53d3d);\n background: var(--eb-error-bg, #fff4f4);\n}\n\n.error-boundary__reference {\n font-family: var(--eb-mono-font, 'Menlo', 'Consolas', 'Liberation Mono', monospace);\n font-size: 11px;\n letter-spacing: 0.08em;\n color: var(--eb-text-muted, #5f6f84);\n text-transform: uppercase;\n}\n\n.error-boundary__title {\n margin: 0;\n font-size: clamp(22px, 3vw, 30px);\n line-height: 1.15;\n font-weight: 700;\n text-wrap: balance;\n}\n\n.error-boundary__subtitle {\n margin: 0;\n max-width: 80ch;\n line-height: 1.45;\n}\n\n.error-boundary__details {\n box-sizing: border-box;\n min-height: 190px;\n max-height: 360px;\n padding: 12px;\n border: 1px solid var(--eb-border, #d3dae6);\n border-radius: 10px;\n background: var(--eb-surface, #ffffff);\n color: inherit;\n font-family: var(--eb-mono-font, 'Menlo', 'Consolas', 'Liberation Mono', monospace);\n font-size: 12px;\n line-height: 1.5;\n resize: vertical;\n}\n\n.error-boundary__actions {\n display: flex;\n gap: 10px;\n flex-wrap: wrap;\n}\n\n.error-boundary__button {\n border: 1px solid var(--eb-accent, #2f6fed);\n border-radius: 999px;\n background: var(--eb-accent, #2f6fed);\n color: var(--eb-accent-foreground, #ffffff);\n cursor: pointer;\n padding: 9px 16px;\n font: inherit;\n font-size: 12px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n}\n\n.error-boundary__button:hover {\n background: var(--eb-accent-hover, #255dcc);\n}\n\n.error-boundary__button--secondary {\n border-color: var(--eb-border, #d3dae6);\n background: var(--eb-surface, #ffffff);\n color: inherit;\n}\n\n.error-boundary__button--secondary:hover {\n background: var(--eb-surface-hover, #eef2f8);\n}\n\n.error-boundary__button:focus-visible {\n outline: 2px solid var(--eb-focus, #2f6fed);\n outline-offset: 2px;\n}\n\n.error-boundary__manual-copy-help {\n margin: 2px 0 0;\n font-size: 13px;\n color: var(--eb-text-muted, #5f6f84);\n line-height: 1.4;\n}\n`",
|
|
283
|
-
"description": "Fallback UI styles. Colours and fonts read `--eb-*` custom properties, so an app can theme the\nfallback by setting them on any ancestor."
|
|
284
|
-
}
|
|
285
|
-
],
|
|
286
|
-
"exports": [
|
|
287
|
-
{
|
|
288
|
-
"kind": "js",
|
|
289
|
-
"name": "errorBoundaryStyles",
|
|
290
|
-
"declaration": {
|
|
291
|
-
"name": "errorBoundaryStyles",
|
|
292
|
-
"module": "src/error-boundary/error-boundary-styles.ts"
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
]
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
"kind": "javascript-module",
|
|
299
|
-
"path": "src/error-boundary/index.ts",
|
|
269
|
+
"path": "src/flexlayout/index.ts",
|
|
300
270
|
"declarations": [],
|
|
301
271
|
"exports": [
|
|
302
272
|
{
|
|
303
273
|
"kind": "js",
|
|
304
|
-
"name": "
|
|
305
|
-
"declaration": {
|
|
306
|
-
"name": "AppErrorBoundary",
|
|
307
|
-
"module": "./error-boundary"
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"kind": "js",
|
|
312
|
-
"name": "ERROR_BOUNDARY_LOGGER_NAME",
|
|
313
|
-
"declaration": {
|
|
314
|
-
"name": "ERROR_BOUNDARY_LOGGER_NAME",
|
|
315
|
-
"module": "./error-boundary"
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
"kind": "js",
|
|
320
|
-
"name": "onCaughtError",
|
|
321
|
-
"declaration": {
|
|
322
|
-
"name": "onCaughtError",
|
|
323
|
-
"module": "./error-boundary"
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
"kind": "js",
|
|
328
|
-
"name": "TileErrorBoundary",
|
|
329
|
-
"declaration": {
|
|
330
|
-
"name": "TileErrorBoundary",
|
|
331
|
-
"module": "./error-boundary"
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
"kind": "js",
|
|
336
|
-
"name": "withTileErrorBoundary",
|
|
337
|
-
"declaration": {
|
|
338
|
-
"name": "withTileErrorBoundary",
|
|
339
|
-
"module": "./error-boundary"
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
"kind": "js",
|
|
344
|
-
"name": "AppErrorBoundaryProps",
|
|
345
|
-
"declaration": {
|
|
346
|
-
"name": "AppErrorBoundaryProps",
|
|
347
|
-
"module": "./error-boundary"
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
"kind": "js",
|
|
352
|
-
"name": "ErrorBoundaryErrorHandler",
|
|
353
|
-
"declaration": {
|
|
354
|
-
"name": "ErrorBoundaryErrorHandler",
|
|
355
|
-
"module": "./error-boundary"
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
"kind": "js",
|
|
360
|
-
"name": "ErrorBoundaryReport",
|
|
361
|
-
"declaration": {
|
|
362
|
-
"name": "ErrorBoundaryReport",
|
|
363
|
-
"module": "./error-boundary"
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
"kind": "js",
|
|
368
|
-
"name": "ErrorBoundaryScope",
|
|
274
|
+
"name": "*",
|
|
369
275
|
"declaration": {
|
|
370
|
-
"name": "
|
|
371
|
-
"
|
|
276
|
+
"name": "*",
|
|
277
|
+
"package": "flexlayout-react"
|
|
372
278
|
}
|
|
373
279
|
},
|
|
374
280
|
{
|
|
375
281
|
"kind": "js",
|
|
376
|
-
"name": "
|
|
282
|
+
"name": "installRapidFlexLayoutReactStyles",
|
|
377
283
|
"declaration": {
|
|
378
|
-
"name": "
|
|
379
|
-
"module": "
|
|
284
|
+
"name": "installRapidFlexLayoutReactStyles",
|
|
285
|
+
"module": "src/flexlayout/index.ts"
|
|
380
286
|
}
|
|
381
287
|
}
|
|
382
288
|
]
|
|
@@ -625,29 +531,6 @@
|
|
|
625
531
|
}
|
|
626
532
|
}
|
|
627
533
|
]
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
"kind": "javascript-module",
|
|
631
|
-
"path": "src/flexlayout/index.ts",
|
|
632
|
-
"declarations": [],
|
|
633
|
-
"exports": [
|
|
634
|
-
{
|
|
635
|
-
"kind": "js",
|
|
636
|
-
"name": "*",
|
|
637
|
-
"declaration": {
|
|
638
|
-
"name": "*",
|
|
639
|
-
"package": "flexlayout-react"
|
|
640
|
-
}
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
"kind": "js",
|
|
644
|
-
"name": "installRapidFlexLayoutReactStyles",
|
|
645
|
-
"declaration": {
|
|
646
|
-
"name": "installRapidFlexLayoutReactStyles",
|
|
647
|
-
"module": "src/flexlayout/index.ts"
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
]
|
|
651
534
|
}
|
|
652
535
|
]
|
|
653
536
|
}
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
* grid's `gridComponents` property).
|
|
13
13
|
* - `reactFactory` / `reactFactoryWithProvider` — mount React component trees into
|
|
14
14
|
* Genesis Foundation layout regions.
|
|
15
|
-
* - `AppErrorBoundary` / `TileErrorBoundary` / `withTileErrorBoundary` — error boundaries with a
|
|
16
|
-
* fallback UI and an `onError` reporting hook; pair with `onCaughtError` on the React root.
|
|
17
15
|
*
|
|
18
16
|
* Subpath entry points:
|
|
19
17
|
* - `./flexlayout` — `flexlayout-react` at the version this package pins, re-exported with the
|
|
@@ -27,6 +25,5 @@ export { createGridProCellRenderer } from './create-grid-pro-cell-renderer';
|
|
|
27
25
|
export { createGridProCellPortals } from './create-grid-pro-cell-portals';
|
|
28
26
|
export type { GridProCellPortals } from './create-grid-pro-cell-portals';
|
|
29
27
|
export type { GridProCellRendererOptions, GridProCellRendererProps, GridProReactCellRenderer, } from './create-grid-pro-cell-renderer';
|
|
30
|
-
export * from './error-boundary';
|
|
31
28
|
export type { RendererControlProps } from '@genesislcap/foundation-forms';
|
|
32
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,YAAY,EACV,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
* grid's `gridComponents` property).
|
|
13
13
|
* - `reactFactory` / `reactFactoryWithProvider` — mount React component trees into
|
|
14
14
|
* Genesis Foundation layout regions.
|
|
15
|
-
* - `AppErrorBoundary` / `TileErrorBoundary` / `withTileErrorBoundary` — error boundaries with a
|
|
16
|
-
* fallback UI and an `onError` reporting hook; pair with `onCaughtError` on the React root.
|
|
17
15
|
*
|
|
18
16
|
* Subpath entry points:
|
|
19
17
|
* - `./flexlayout` — `flexlayout-react` at the version this package pins, re-exported with the
|
|
@@ -25,4 +23,3 @@ export { reactFactory, reactFactoryWithProvider } from './react-layout-factory';
|
|
|
25
23
|
export { createReactRenderer } from './create-react-renderer';
|
|
26
24
|
export { createGridProCellRenderer } from './create-grid-pro-cell-renderer';
|
|
27
25
|
export { createGridProCellPortals } from './create-grid-pro-cell-portals';
|
|
28
|
-
export * from './error-boundary';
|