@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.
- package/CHANGELOG.md +790 -1
- package/README.md +41 -0
- package/dist/SchemaRenderer.js +12 -2
- package/dist/context/AppShellContext.js +51 -23
- package/dist/context/InlineEditContext.d.ts +64 -0
- package/dist/context/InlineEditContext.js +8 -2
- package/dist/context/NotificationContext.d.ts +245 -17
- package/dist/context/NotificationContext.js +222 -20
- package/dist/context/ThemeContext.js +4 -8
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/useAnimation.d.ts +40 -4
- package/dist/hooks/useAnimation.js +41 -10
- package/dist/hooks/useCapabilityGate.d.ts +16 -0
- package/dist/hooks/useCapabilityGate.js +60 -0
- package/dist/hooks/useClientNotifications.d.ts +0 -6
- package/dist/hooks/useClientNotifications.js +7 -53
- package/dist/hooks/useFilterScope.d.ts +30 -0
- package/dist/hooks/useFilterScope.js +55 -0
- package/dist/hooks/useNavigationOverlay.d.ts +34 -10
- package/dist/hooks/useNavigationOverlay.js +35 -1
- package/dist/hooks/useOffline.d.ts +51 -33
- package/dist/hooks/useOffline.js +3 -3
- package/dist/hooks/usePageVariables.js +23 -11
- package/dist/hooks/usePerformance.d.ts +3 -3
- package/dist/hooks/usePerformance.js +2 -2
- package/dist/hooks/useRecordSearch.js +98 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/spec-bridge/SpecBridge.d.ts +0 -4
- package/dist/spec-bridge/SpecBridge.js +0 -12
- package/dist/spec-bridge/bridges/list-view.js +5 -11
- package/dist/spec-bridge/index.d.ts +0 -2
- package/dist/spec-bridge/index.js +0 -2
- package/dist/spec-input.d.ts +37 -0
- package/dist/spec-input.js +8 -0
- package/dist/utils/error-message.d.ts +31 -0
- package/dist/utils/error-message.js +49 -0
- package/package.json +8 -8
- package/dist/hooks/useColumnSummary.d.ts +0 -38
- package/dist/hooks/useColumnSummary.js +0 -54
- package/dist/spec-bridge/bridges/dashboard.d.ts +0 -81
- package/dist/spec-bridge/bridges/dashboard.js +0 -121
- package/dist/spec-bridge/bridges/page.d.ts +0 -58
- 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
|
-
};
|