@object-ui/react 16.1.0 → 17.2.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +790 -1
  2. package/README.md +41 -0
  3. package/dist/SchemaRenderer.js +12 -2
  4. package/dist/context/AppShellContext.js +51 -23
  5. package/dist/context/InlineEditContext.d.ts +64 -0
  6. package/dist/context/InlineEditContext.js +8 -2
  7. package/dist/context/NotificationContext.d.ts +245 -17
  8. package/dist/context/NotificationContext.js +222 -20
  9. package/dist/context/ThemeContext.js +4 -8
  10. package/dist/hooks/index.d.ts +2 -1
  11. package/dist/hooks/index.js +3 -1
  12. package/dist/hooks/useAnimation.d.ts +40 -4
  13. package/dist/hooks/useAnimation.js +41 -10
  14. package/dist/hooks/useCapabilityGate.d.ts +16 -0
  15. package/dist/hooks/useCapabilityGate.js +60 -0
  16. package/dist/hooks/useClientNotifications.d.ts +0 -6
  17. package/dist/hooks/useClientNotifications.js +7 -53
  18. package/dist/hooks/useFilterScope.d.ts +30 -0
  19. package/dist/hooks/useFilterScope.js +55 -0
  20. package/dist/hooks/useNavigationOverlay.d.ts +34 -10
  21. package/dist/hooks/useNavigationOverlay.js +35 -1
  22. package/dist/hooks/useOffline.d.ts +51 -33
  23. package/dist/hooks/useOffline.js +3 -3
  24. package/dist/hooks/usePageVariables.js +23 -11
  25. package/dist/hooks/usePerformance.d.ts +3 -3
  26. package/dist/hooks/usePerformance.js +2 -2
  27. package/dist/hooks/useRecordSearch.js +98 -4
  28. package/dist/index.d.ts +2 -1
  29. package/dist/index.js +1 -1
  30. package/dist/spec-bridge/SpecBridge.d.ts +0 -4
  31. package/dist/spec-bridge/SpecBridge.js +0 -12
  32. package/dist/spec-bridge/bridges/list-view.js +5 -11
  33. package/dist/spec-bridge/index.d.ts +0 -2
  34. package/dist/spec-bridge/index.js +0 -2
  35. package/dist/spec-input.d.ts +37 -0
  36. package/dist/spec-input.js +8 -0
  37. package/dist/utils/error-message.d.ts +31 -0
  38. package/dist/utils/error-message.js +49 -0
  39. package/package.json +8 -8
  40. package/dist/hooks/useColumnSummary.d.ts +0 -38
  41. package/dist/hooks/useColumnSummary.js +0 -54
  42. package/dist/spec-bridge/bridges/dashboard.d.ts +0 -81
  43. package/dist/spec-bridge/bridges/dashboard.js +0 -121
  44. package/dist/spec-bridge/bridges/page.d.ts +0 -58
  45. package/dist/spec-bridge/bridges/page.js +0 -101
@@ -1,101 +0,0 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- function mapComponent(component) {
9
- const node = {
10
- type: component.type,
11
- id: component.id,
12
- };
13
- if (component.label)
14
- node.label = component.label;
15
- if (component.className)
16
- node.className = component.className;
17
- if (component.style)
18
- node.style = component.style;
19
- // ADR-0065 scoped per-breakpoint styles — declared on the page-spec
20
- // component (sibling of className/style) but previously dropped here
21
- // before reaching SchemaRenderer, so a layout override like
22
- // `{ large: { display: 'grid', gridTemplateColumns: '...' } }` never
23
- // compiled to CSS and the node fell back to its default layout.
24
- if (component.responsiveStyles)
25
- node.responsiveStyles = component.responsiveStyles;
26
- if (component.properties) {
27
- // Avoid overwriting the component dispatch keys (`type`/`id`) with inner
28
- // renderer-specific props. E.g. PageTabsProps.properties.type is the tab
29
- // visual style ('line'|'card'|'pill'), NOT the component type.
30
- for (const [k, v] of Object.entries(component.properties)) {
31
- if (k === 'type' || k === 'id')
32
- continue;
33
- node[k] = v;
34
- }
35
- // Preserve the original `properties` bag so renderers can still read
36
- // collision-prone keys via `schema.properties.<key>`.
37
- node.properties = component.properties;
38
- }
39
- if (component.events)
40
- node.events = component.events;
41
- // ADR-0089: `visibleWhen` is the canonical conditional-visibility predicate;
42
- // the spec folds the deprecated `visibility` alias into it at parse, so prefer
43
- // it and fall back to `visibility` for raw / un-normalized metadata. SchemaRenderer
44
- // reads `visibleWhen` first (show-when-truthy).
45
- const visiblePredicate = component.visibleWhen ?? component.visibility;
46
- if (visiblePredicate)
47
- node.visibleWhen = visiblePredicate;
48
- if (component.dataSource)
49
- node.dataSource = component.dataSource;
50
- if (component.responsive)
51
- node.responsive = component.responsive;
52
- if (component.aria)
53
- node.aria = component.aria;
54
- return node;
55
- }
56
- function mapRegion(region) {
57
- const children = (region.components ?? []).map(mapComponent);
58
- const node = {
59
- type: 'page-region',
60
- id: region.name,
61
- body: children,
62
- };
63
- if (region.width)
64
- node.width = region.width;
65
- return node;
66
- }
67
- /** Transforms a Page spec into a page layout SchemaNode */
68
- export const bridgePage = (spec, _context) => {
69
- const regions = (spec.regions ?? []).map(mapRegion);
70
- const node = {
71
- type: 'page',
72
- id: spec.name,
73
- body: regions,
74
- };
75
- if (spec.label)
76
- node.label = spec.label;
77
- if (spec.description)
78
- node.description = spec.description;
79
- if (spec.icon)
80
- node.icon = spec.icon;
81
- if (spec.type)
82
- node.pageType = spec.type;
83
- if (spec.variables)
84
- node.variables = spec.variables;
85
- if (spec.template)
86
- node.template = spec.template;
87
- if (spec.object)
88
- node.object = spec.object;
89
- // Additional page properties (blankLayout/recordReview dropped — their page
90
- // types have no renderer and were removed from @objectstack/spec, framework#2265)
91
- if (spec.isDefault != null)
92
- node.isDefault = spec.isDefault;
93
- if (spec.assignedProfiles)
94
- node.assignedProfiles = spec.assignedProfiles;
95
- if (spec.interfaceConfig)
96
- node.interfaceConfig = spec.interfaceConfig;
97
- // P1.6 — i18n & ARIA
98
- if (spec.aria)
99
- node.aria = spec.aria;
100
- return node;
101
- };