@object-ui/components 11.2.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 CHANGED
@@ -1,5 +1,58 @@
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
+
3
56
  ## 11.2.0
4
57
 
5
58
  ### Minor 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);
@@ -1653,6 +1654,12 @@
1653
1654
  .border-amber-300 {
1654
1655
  border-color: var(--color-amber-300);
1655
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
+ }
1656
1663
  .border-blue-300 {
1657
1664
  border-color: var(--color-blue-300);
1658
1665
  }
@@ -2282,6 +2289,9 @@
2282
2289
  .text-amber-800 {
2283
2290
  color: var(--color-amber-800);
2284
2291
  }
2292
+ .text-amber-900 {
2293
+ color: var(--color-amber-900);
2294
+ }
2285
2295
  .text-card-foreground {
2286
2296
  color: var(--color-card-foreground);
2287
2297
  }
@@ -2495,6 +2505,12 @@
2495
2505
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
2496
2506
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2497
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
+ }
2498
2514
  .ring-primary {
2499
2515
  --tw-ring-color: var(--color-primary);
2500
2516
  }
@@ -2668,6 +2684,9 @@
2668
2684
  .fade-in-80 {
2669
2685
  --tw-enter-opacity: 0.8;
2670
2686
  }
2687
+ .ring-inset {
2688
+ --tw-ring-inset: inset;
2689
+ }
2671
2690
  .running {
2672
2691
  animation-play-state: running;
2673
2692
  }
@@ -5600,6 +5619,14 @@
5600
5619
  }
5601
5620
  }
5602
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
+ }
5603
5630
  .dark\:bg-emerald-950\/50 {
5604
5631
  &:where(.dark, .dark *) {
5605
5632
  background-color: color-mix(in srgb, oklch(26.2% 0.051 172.552) 50%, transparent);
@@ -5608,6 +5635,11 @@
5608
5635
  }
5609
5636
  }
5610
5637
  }
5638
+ .dark\:text-amber-200 {
5639
+ &:where(.dark, .dark *) {
5640
+ color: var(--color-amber-200);
5641
+ }
5642
+ }
5611
5643
  .dark\:text-amber-300 {
5612
5644
  &:where(.dark, .dark *) {
5613
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';