@object-ui/components 11.0.0 → 11.3.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 +79 -0
- package/dist/context/gridFieldAuthoring.d.ts +33 -0
- package/dist/custom/mobile-dialog-content.d.ts +7 -0
- package/dist/index.css +42 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3573 -3193
- package/dist/index.umd.cjs +6 -6
- package/dist/renderers/basic/html-elements.d.ts +23 -0
- package/dist/renderers/layout/react-page.d.ts +33 -0
- package/package.json +17 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,84 @@
|
|
|
1
1
|
# @object-ui/components
|
|
2
2
|
|
|
3
|
+
## 11.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d23d6eb: Three-tier AI page authoring: `kind:'html'` and a trusted `kind:'react'` tier.
|
|
8
|
+
|
|
9
|
+
- **`@object-ui/react-runtime`** (new) — the trusted runtime-React tier for
|
|
10
|
+
`kind:'react'` pages (vendored react-runner: Sucrase transpile + scope-eval,
|
|
11
|
+
no sandbox). Renders real JSX/TSX (any HTML + JS + hooks/useState/map/onClick)
|
|
12
|
+
in the main React tree with an injected scope (React, the public data blocks,
|
|
13
|
+
page data) and a built-in error boundary.
|
|
14
|
+
- **`@object-ui/core`** — new runtime capability gate (`enableCapability` /
|
|
15
|
+
`disableCapability` / `isCapabilityEnabled`, `CAP_REACT_PAGES`). `react-pages`
|
|
16
|
+
defaults **ON** (the platform trusts reviewed, draft-gated authors); a
|
|
17
|
+
deployment turns it OFF server-side (the runtime injects the disable global
|
|
18
|
+
when `OS_DISABLE_REACT_PAGES` is set). Never controlled from authored metadata.
|
|
19
|
+
- **`@object-ui/components`** — PageRenderer now routes `kind:'react'`
|
|
20
|
+
(capability-gated, lazy-loads the runtime) and renders `kind:'html'` (the
|
|
21
|
+
former `kind:'jsx'`, still accepted as a deprecated alias). The `html` tier
|
|
22
|
+
now resolves the full safe native HTML tag set (h1–h6, p, a, ul/ol/li, img,
|
|
23
|
+
blockquote, pre, strong/em, …) so authored HTML lives up to its name.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- d88c8ec: fix(data-table): surface inline-edit save failures instead of swallowing them
|
|
28
|
+
|
|
29
|
+
A rejected inline-edit save (e.g. a 400 validation failure like an invalid
|
|
30
|
+
status transition) was caught with only `console.error` — the toolbar stayed
|
|
31
|
+
stuck, the cell kept the unsaved value, and the author got no feedback. Now the
|
|
32
|
+
data-table shows the server's reason in the toolbar (with an alert icon) and
|
|
33
|
+
tints the affected row(s) destructive so it's clear which rows didn't persist.
|
|
34
|
+
The pending edit is kept for retry; the error clears on a successful save or on
|
|
35
|
+
cancel. Adds the `table.saveFailed` string across all locales.
|
|
36
|
+
|
|
37
|
+
- b7237bb: fix(components): keep MobileDialogContent open when interacting with a portalled dropdown
|
|
38
|
+
|
|
39
|
+
Radix Select / Popover / DropdownMenu render their flyout into a portal at
|
|
40
|
+
`document.body`, outside the dialog's DOM. Clicking an empty part of an open
|
|
41
|
+
dropdown registered as an "interact outside" and closed the entire dialog
|
|
42
|
+
(create/edit forms). `MobileDialogContent` now guards `onInteractOutside`:
|
|
43
|
+
interactions whose real target is inside a Radix popper layer are ignored
|
|
44
|
+
(the popper dismisses itself), while a genuine backdrop click still closes the
|
|
45
|
+
dialog as before.
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [d88c8ec]
|
|
48
|
+
- Updated dependencies [d23d6eb]
|
|
49
|
+
- @object-ui/i18n@11.3.0
|
|
50
|
+
- @object-ui/react-runtime@11.3.0
|
|
51
|
+
- @object-ui/core@11.3.0
|
|
52
|
+
- @object-ui/react@11.3.0
|
|
53
|
+
- @object-ui/types@11.3.0
|
|
54
|
+
- @object-ui/sdui-parser@11.3.0
|
|
55
|
+
|
|
56
|
+
## 11.2.0
|
|
57
|
+
|
|
58
|
+
### Minor Changes
|
|
59
|
+
|
|
60
|
+
- 9e7a986: ADR-0080: AI-authored UI pages. New `@object-ui/sdui-parser` compiles a constrained JSX/HTML+Tailwind source into the SchemaNode tree (parse, never execute) with whitelist sanitization, manifest validation, and `.d.ts` codegen for the JSX type surface. `PageRenderer` renders `kind:'jsx'` pages; `ComponentRegistry` gains `tier` + `getPublicConfigs()` (capability vs contract).
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- Updated dependencies [9e7a986]
|
|
65
|
+
- Updated dependencies [1311749]
|
|
66
|
+
- @object-ui/sdui-parser@11.2.0
|
|
67
|
+
- @object-ui/core@11.2.0
|
|
68
|
+
- @object-ui/react@11.2.0
|
|
69
|
+
- @object-ui/types@11.2.0
|
|
70
|
+
- @object-ui/i18n@11.2.0
|
|
71
|
+
|
|
72
|
+
## 11.1.0
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- Updated dependencies [6726a2b]
|
|
77
|
+
- @object-ui/i18n@11.1.0
|
|
78
|
+
- @object-ui/react@11.1.0
|
|
79
|
+
- @object-ui/types@11.1.0
|
|
80
|
+
- @object-ui/core@11.1.0
|
|
81
|
+
|
|
3
82
|
## 7.3.0
|
|
4
83
|
|
|
5
84
|
### Patch Changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface GridFieldAuthoring {
|
|
3
|
+
/** Invoked when the user clicks the trailing "+" add-column header affordance. */
|
|
4
|
+
onAddColumn?: () => void;
|
|
5
|
+
/** Optional tooltip/aria-label for the add-column button (defaults to "Add field"). */
|
|
6
|
+
addColumnLabel?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Invoked when the user clicks the per-column "edit field" affordance in a
|
|
9
|
+
* column header (Airtable-style). Receives the column's accessorKey (= field
|
|
10
|
+
* name). Omit to hide the edit affordance.
|
|
11
|
+
*/
|
|
12
|
+
onEditColumn?: (fieldName: string) => void;
|
|
13
|
+
/** Optional tooltip/aria-label for the edit-field button (defaults to "Edit field"). */
|
|
14
|
+
editColumnLabel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Invoked when the user drag-reorders columns. Receives the new column order
|
|
17
|
+
* as accessorKeys (= field names, including any non-field columns). Providing
|
|
18
|
+
* this also ENABLES the table's built-in column drag-reorder (design mode), so
|
|
19
|
+
* the host can persist the order to the object's field metadata. Omit to leave
|
|
20
|
+
* reordering to the table's own `reorderableColumns`/`onColumnsReorder`.
|
|
21
|
+
*/
|
|
22
|
+
onReorderFields?: (orderedFieldNames: string[]) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function GridFieldAuthoringProvider({ value, children, }: {
|
|
25
|
+
value: GridFieldAuthoring | null;
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
}): React.ReactElement;
|
|
28
|
+
/**
|
|
29
|
+
* Read the ambient grid field-authoring affordances. Returns `null` outside a
|
|
30
|
+
* provider — design surfaces opt in by wrapping the table tree in
|
|
31
|
+
* {@link GridFieldAuthoringProvider}.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useGridFieldAuthoring(): GridFieldAuthoring | null;
|
|
@@ -17,4 +17,11 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import * as React from 'react';
|
|
19
19
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
20
|
+
/**
|
|
21
|
+
* True when `target` sits inside a Radix popper flyout (Select / Popover /
|
|
22
|
+
* DropdownMenu). Such elements are portalled to `document.body`, so an
|
|
23
|
+
* "interact outside" the dialog whose target is one of them is really an
|
|
24
|
+
* interaction with the dialog's own dropdown — it must not close the dialog.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isInsidePopperLayer(target: Element | null | undefined): boolean;
|
|
20
27
|
export declare const MobileDialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/dist/index.css
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
--color-red-600: oklch(57.7% 0.245 27.325);
|
|
16
16
|
--color-red-700: oklch(50.5% 0.213 27.518);
|
|
17
17
|
--color-amber-50: oklch(98.7% 0.022 95.277);
|
|
18
|
+
--color-amber-200: oklch(92.4% 0.12 95.746);
|
|
18
19
|
--color-amber-300: oklch(87.9% 0.169 91.605);
|
|
19
20
|
--color-amber-400: oklch(82.8% 0.189 84.429);
|
|
20
21
|
--color-amber-700: oklch(55.5% 0.163 48.998);
|
|
@@ -484,6 +485,9 @@
|
|
|
484
485
|
.\!m-0 {
|
|
485
486
|
margin: 0 !important;
|
|
486
487
|
}
|
|
488
|
+
.m-4 {
|
|
489
|
+
margin: calc(var(--spacing) * 4);
|
|
490
|
+
}
|
|
487
491
|
.-mx-1 {
|
|
488
492
|
margin-inline: calc(var(--spacing) * -1);
|
|
489
493
|
}
|
|
@@ -1650,6 +1654,12 @@
|
|
|
1650
1654
|
.border-amber-300 {
|
|
1651
1655
|
border-color: var(--color-amber-300);
|
|
1652
1656
|
}
|
|
1657
|
+
.border-amber-400\/40 {
|
|
1658
|
+
border-color: color-mix(in srgb, oklch(82.8% 0.189 84.429) 40%, transparent);
|
|
1659
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1660
|
+
border-color: color-mix(in oklab, var(--color-amber-400) 40%, transparent);
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1653
1663
|
.border-blue-300 {
|
|
1654
1664
|
border-color: var(--color-blue-300);
|
|
1655
1665
|
}
|
|
@@ -2123,6 +2133,9 @@
|
|
|
2123
2133
|
.pl-4 {
|
|
2124
2134
|
padding-left: calc(var(--spacing) * 4);
|
|
2125
2135
|
}
|
|
2136
|
+
.pl-5 {
|
|
2137
|
+
padding-left: calc(var(--spacing) * 5);
|
|
2138
|
+
}
|
|
2126
2139
|
.pl-6 {
|
|
2127
2140
|
padding-left: calc(var(--spacing) * 6);
|
|
2128
2141
|
}
|
|
@@ -2276,6 +2289,9 @@
|
|
|
2276
2289
|
.text-amber-800 {
|
|
2277
2290
|
color: var(--color-amber-800);
|
|
2278
2291
|
}
|
|
2292
|
+
.text-amber-900 {
|
|
2293
|
+
color: var(--color-amber-900);
|
|
2294
|
+
}
|
|
2279
2295
|
.text-card-foreground {
|
|
2280
2296
|
color: var(--color-card-foreground);
|
|
2281
2297
|
}
|
|
@@ -2489,6 +2505,12 @@
|
|
|
2489
2505
|
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
2490
2506
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2491
2507
|
}
|
|
2508
|
+
.ring-destructive\/40 {
|
|
2509
|
+
--tw-ring-color: color-mix(in srgb, hsl(var(--destructive)) 40%, transparent);
|
|
2510
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2511
|
+
--tw-ring-color: color-mix(in oklab, var(--color-destructive) 40%, transparent);
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2492
2514
|
.ring-primary {
|
|
2493
2515
|
--tw-ring-color: var(--color-primary);
|
|
2494
2516
|
}
|
|
@@ -2505,6 +2527,10 @@
|
|
|
2505
2527
|
outline-style: var(--tw-outline-style);
|
|
2506
2528
|
outline-width: 1px;
|
|
2507
2529
|
}
|
|
2530
|
+
.blur {
|
|
2531
|
+
--tw-blur: blur(8px);
|
|
2532
|
+
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
2533
|
+
}
|
|
2508
2534
|
.filter {
|
|
2509
2535
|
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
2510
2536
|
}
|
|
@@ -2658,6 +2684,9 @@
|
|
|
2658
2684
|
.fade-in-80 {
|
|
2659
2685
|
--tw-enter-opacity: 0.8;
|
|
2660
2686
|
}
|
|
2687
|
+
.ring-inset {
|
|
2688
|
+
--tw-ring-inset: inset;
|
|
2689
|
+
}
|
|
2661
2690
|
.running {
|
|
2662
2691
|
animation-play-state: running;
|
|
2663
2692
|
}
|
|
@@ -5590,6 +5619,14 @@
|
|
|
5590
5619
|
}
|
|
5591
5620
|
}
|
|
5592
5621
|
}
|
|
5622
|
+
.dark\:bg-destructive\/15 {
|
|
5623
|
+
&:where(.dark, .dark *) {
|
|
5624
|
+
background-color: color-mix(in srgb, hsl(var(--destructive)) 15%, transparent);
|
|
5625
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
5626
|
+
background-color: color-mix(in oklab, var(--color-destructive) 15%, transparent);
|
|
5627
|
+
}
|
|
5628
|
+
}
|
|
5629
|
+
}
|
|
5593
5630
|
.dark\:bg-emerald-950\/50 {
|
|
5594
5631
|
&:where(.dark, .dark *) {
|
|
5595
5632
|
background-color: color-mix(in srgb, oklch(26.2% 0.051 172.552) 50%, transparent);
|
|
@@ -5598,6 +5635,11 @@
|
|
|
5598
5635
|
}
|
|
5599
5636
|
}
|
|
5600
5637
|
}
|
|
5638
|
+
.dark\:text-amber-200 {
|
|
5639
|
+
&:where(.dark, .dark *) {
|
|
5640
|
+
color: var(--color-amber-200);
|
|
5641
|
+
}
|
|
5642
|
+
}
|
|
5601
5643
|
.dark\:text-amber-300 {
|
|
5602
5644
|
&:where(.dark, .dark *) {
|
|
5603
5645
|
color: var(--color-amber-300);
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { renderChildren } from './lib/utils';
|
|
|
3
3
|
export { cva } from 'class-variance-authority';
|
|
4
4
|
export { getLazyIcon, LazyIcon, toKebabIconName } from './lib/lazy-icon';
|
|
5
5
|
export { registerPlaceholders } from './renderers/placeholders';
|
|
6
|
+
export { GridFieldAuthoringProvider, useGridFieldAuthoring, type GridFieldAuthoring, } from './context/gridFieldAuthoring';
|
|
6
7
|
export * from './ui';
|
|
7
8
|
export * from './custom';
|
|
8
9
|
export { useConfigDraft } from './hooks/use-config-draft';
|