@object-ui/providers 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 +131 -0
- package/dist/ThemeProvider.d.ts +3 -3
- package/dist/ThemeProvider.js +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +28 -2
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,136 @@
|
|
|
1
1
|
# @object-ui/providers — Changelog
|
|
2
2
|
|
|
3
|
+
## 17.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4a51e77: Stop declaring 14 symbols across ten packages under names `@objectstack/spec`
|
|
8
|
+
owns (objectui#3161, objectstack#4115 batch 7 — the long tail, one or two
|
|
9
|
+
entries per package). All ten packages leave the ledger, which drops from 17
|
|
10
|
+
collisions across 11 packages to 3 across 1.
|
|
11
|
+
|
|
12
|
+
**Renamed exports** — in every case the spec exports the same name for a
|
|
13
|
+
_different_ thing, so the old name was a mis-description rather than a dialect:
|
|
14
|
+
|
|
15
|
+
| package | was | now | what the spec's same-named export is |
|
|
16
|
+
| :------------------------- | :--------------------------------- | :--------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| `@object-ui/fields` | `FieldWidgetProps` | `FieldWidgetComponentProps` | the DECLARED field-widget plugin props contract (a zod object; `field.type` is the `FieldType` enum, `readonly`/`required` carry defaults) |
|
|
18
|
+
| `@object-ui/layout` | `PageHeaderProps` | `PageHeaderComponentProps` | the authored `page:header` node — a zod schema of `title`, `subtitle`, an icon NAME, `breadcrumb`, `actions: string[]` |
|
|
19
|
+
| `@object-ui/layout` | `Page` | `PageNodeRenderer` | the authored page metadata DOCUMENT (`name`, `label`, `type`, `regions`) |
|
|
20
|
+
| `@object-ui/plugin-detail` | `ObjectFieldLike` | `ObjectDefFieldLike` | the i18n duck type `translateObject` walks (`help`/`description`, plus `[key: string]: any`) |
|
|
21
|
+
| `@object-ui/plugin-grid` | `ColumnSummaryConfig` | `ColumnSummarySetting` | the OBJECT form of `ListColumn.summary` **only** — the local one was the whole union, shorthand included |
|
|
22
|
+
| `@object-ui/plugin-grid` | `isMultiValueField` | `hasMultiValueShape` | the spec's classifier, which requires a def with a `type`; the local one is called with `undefined` |
|
|
23
|
+
| `@object-ui/collaboration` | `RealtimeConfig` | `RealtimeSubscriptionConfig` | the app's realtime DECLARATION (`enabled`, `transport`, `subscriptions[]`) |
|
|
24
|
+
| `@object-ui/plugin-charts` | `ChartConfig` | `ChartContainerConfig` | the authored chart document (`type`, `xAxis`, `series`, `showLegend`, …) |
|
|
25
|
+
| `@object-ui/plugin-form` | `FormSection` / `FormSectionProps` | `FormSectionContainer` / `FormSectionContainerProps` | the authored form-section metadata (`name`, `pane`, `visibleWhen`, `fields`) |
|
|
26
|
+
| `@object-ui/providers` | `Theme` | `ThemePreference` | a whole theme DOCUMENT (`name`, `label`, `colors`, `typography`) |
|
|
27
|
+
| `@object-ui/runner` | `App` (default export) | `RunnerApp` | the authored application metadata type **and** the `App.create()` builder |
|
|
28
|
+
| `@object-ui/sdui-parser` | `ValidationResult` | `ManifestValidationResult` | plugin-manifest validation (`{ valid, errors?, warnings? }`), exported from both `kernel` and `contracts` |
|
|
29
|
+
|
|
30
|
+
`ManifestValidationResult` follows the `<what was validated>Validation<Error|Result>`
|
|
31
|
+
convention registered on objectstack#4115 (`@object-ui/core` took
|
|
32
|
+
`SchemaNodeValidationResult` in batch 4). `PageHeaderComponentProps` deliberately
|
|
33
|
+
reuses the name `@object-ui/app-shell` already chose for its own header props in
|
|
34
|
+
batch 3, so one concept does not acquire two dialect names one package apart.
|
|
35
|
+
|
|
36
|
+
**Now derived from the spec instead of hand-written:**
|
|
37
|
+
|
|
38
|
+
- `@object-ui/fields` — `isFileIdToken` is re-exported from
|
|
39
|
+
`@objectstack/spec/data`. The local copy was character-for-character identical
|
|
40
|
+
to the spec's function while its comment said it "mirrors" it, so every
|
|
41
|
+
behaviour test passed and only reference identity could tell the two apart.
|
|
42
|
+
The regex is a wire decision: widening it server-side while a copy here kept
|
|
43
|
+
the old bound would make every new id read as "not a reference", and the
|
|
44
|
+
widget would submit the legacy inline blob to a backend expecting a reference.
|
|
45
|
+
- `@object-ui/plugin-detail` — `FeedFilterMode` is re-exported from
|
|
46
|
+
`@objectstack/spec/data`, in a file that already imported the sibling
|
|
47
|
+
`FeedItemType` from the spec.
|
|
48
|
+
- `@object-ui/plugin-grid` — the eleven-member aggregation union is now the
|
|
49
|
+
spec's `ColumnSummary` enum, so the total `Record<ColumnSummaryType, string>`
|
|
50
|
+
label map turns a member the spec adds into a compile error instead of a
|
|
51
|
+
blank footer cell. `ColumnSummarySetting` is `NonNullable<ListColumn['summary']>`,
|
|
52
|
+
i.e. whatever forms the spec itself accepts. `hasMultiValueShape` delegates to
|
|
53
|
+
the spec's `isMultiValueField` rather than re-deriving it from
|
|
54
|
+
`MULTI_OPTION_TYPES` / `MULTI_CAPABLE_TYPES`.
|
|
55
|
+
- `@object-ui/providers` — `ThemePreference` is the spec's `ThemeMode` union
|
|
56
|
+
plus the one legacy `'system'` spelling this provider still honours for stored
|
|
57
|
+
preferences, read off the schema's own `_zod` carrier so the package takes no
|
|
58
|
+
zod dependency.
|
|
59
|
+
|
|
60
|
+
`@objectstack/spec` moves from `devDependencies` to `dependencies` in
|
|
61
|
+
`@object-ui/fields` (it re-exports a runtime function) and `@object-ui/providers`
|
|
62
|
+
(its public `.d.ts` now references the spec).
|
|
63
|
+
|
|
64
|
+
Scored `minor`, not `major`, per this repo's fixed-group rule — objectui's major
|
|
65
|
+
tracks `@objectstack`, so breaking changes of our own ship as minor with the
|
|
66
|
+
semantics spelled out above (see AGENTS.md §版本号策略). A `major` here would carry
|
|
67
|
+
all 39 packages of the fixed group to `18.0.0` and off objectstack's 17.x line.
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [4ae0ac4]
|
|
72
|
+
- Updated dependencies [696e3c1]
|
|
73
|
+
- Updated dependencies [4bf612c]
|
|
74
|
+
- Updated dependencies [cb82705]
|
|
75
|
+
- Updated dependencies [f572849]
|
|
76
|
+
- Updated dependencies [444457c]
|
|
77
|
+
- Updated dependencies [022e4c3]
|
|
78
|
+
- Updated dependencies [009e25d]
|
|
79
|
+
- Updated dependencies [726b89c]
|
|
80
|
+
- @object-ui/types@17.2.0
|
|
81
|
+
|
|
82
|
+
## 17.1.0
|
|
83
|
+
|
|
84
|
+
### Patch Changes
|
|
85
|
+
|
|
86
|
+
- Updated dependencies [9e7349e]
|
|
87
|
+
- Updated dependencies [8864971]
|
|
88
|
+
- Updated dependencies [b41f401]
|
|
89
|
+
- Updated dependencies [19e9fa0]
|
|
90
|
+
- Updated dependencies [38ca8be]
|
|
91
|
+
- Updated dependencies [4952edf]
|
|
92
|
+
- Updated dependencies [7f0252e]
|
|
93
|
+
- Updated dependencies [7639a61]
|
|
94
|
+
- Updated dependencies [94e63ef]
|
|
95
|
+
- Updated dependencies [c4db402]
|
|
96
|
+
- Updated dependencies [5319bf1]
|
|
97
|
+
- Updated dependencies [49e5671]
|
|
98
|
+
- Updated dependencies [b5b97e2]
|
|
99
|
+
- Updated dependencies [f59f2c1]
|
|
100
|
+
- Updated dependencies [4874117]
|
|
101
|
+
- Updated dependencies [ce08d55]
|
|
102
|
+
- Updated dependencies [2374a49]
|
|
103
|
+
- Updated dependencies [ea7f477]
|
|
104
|
+
- Updated dependencies [7f23cd0]
|
|
105
|
+
- Updated dependencies [24e0e0a]
|
|
106
|
+
- Updated dependencies [3a6cf24]
|
|
107
|
+
- Updated dependencies [aa35561]
|
|
108
|
+
- Updated dependencies [03bd53b]
|
|
109
|
+
- Updated dependencies [3c1f321]
|
|
110
|
+
- Updated dependencies [a045a32]
|
|
111
|
+
- Updated dependencies [912496d]
|
|
112
|
+
- Updated dependencies [9867281]
|
|
113
|
+
- @object-ui/types@17.1.0
|
|
114
|
+
|
|
115
|
+
## 17.0.0
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- Updated dependencies [1767124]
|
|
120
|
+
- Updated dependencies [8ecf5a6]
|
|
121
|
+
- Updated dependencies [dfd3705]
|
|
122
|
+
- Updated dependencies [6dee2cb]
|
|
123
|
+
- Updated dependencies [c7cff19]
|
|
124
|
+
- Updated dependencies [cd09a7b]
|
|
125
|
+
- Updated dependencies [f1abf0e]
|
|
126
|
+
- Updated dependencies [f05b84e]
|
|
127
|
+
- Updated dependencies [662bdf9]
|
|
128
|
+
- Updated dependencies [059a052]
|
|
129
|
+
- Updated dependencies [53642d4]
|
|
130
|
+
- Updated dependencies [8aae006]
|
|
131
|
+
- Updated dependencies [d147a13]
|
|
132
|
+
- @object-ui/types@17.0.0
|
|
133
|
+
|
|
3
134
|
## 16.1.0
|
|
4
135
|
|
|
5
136
|
### Patch Changes
|
package/dist/ThemeProvider.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ThemePreference, ThemeProviderProps } from './types';
|
|
2
2
|
interface ThemeContextValue {
|
|
3
|
-
theme:
|
|
4
|
-
setTheme: (theme:
|
|
3
|
+
theme: ThemePreference;
|
|
4
|
+
setTheme: (theme: ThemePreference) => void;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* ThemeProvider - Theme management
|
package/dist/ThemeProvider.js
CHANGED
|
@@ -17,7 +17,11 @@ export function ThemeProvider({ defaultTheme = 'system', storageKey = 'ui-theme'
|
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
const root = window.document.documentElement;
|
|
19
19
|
root.classList.remove('light', 'dark');
|
|
20
|
-
|
|
20
|
+
// The spec's OS-following mode is `auto` (ThemeModeSchema, ui/theme.zod.ts);
|
|
21
|
+
// `system` is this provider's pre-spec spelling, kept for stored values.
|
|
22
|
+
// Branching on `system` alone sent `auto` into `classList.add('auto')` —
|
|
23
|
+
// a class no Tailwind variant matches, locking the light theme (#2942).
|
|
24
|
+
if (theme === 'auto' || theme === 'system') {
|
|
21
25
|
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)')
|
|
22
26
|
.matches
|
|
23
27
|
? 'dark'
|
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export { DataSourceProvider, useDataSource } from './DataSourceProvider';
|
|
|
7
7
|
export { MetadataProvider, useMetadata } from './MetadataProvider';
|
|
8
8
|
export { ThemeProvider, useTheme } from './ThemeProvider';
|
|
9
9
|
export { UploadProvider, useUpload, createObjectUrlAdapter, createS3Adapter, createAzureBlobAdapter, createObjectStackUploadAdapter, } from './UploadProvider';
|
|
10
|
-
export type { DataSourceProviderProps, MetadataProviderProps, ThemeProviderProps,
|
|
10
|
+
export type { DataSourceProviderProps, MetadataProviderProps, ThemeProviderProps, ThemePreference, } from './types';
|
|
11
11
|
export type { UploadAdapter, UploadOptions, UploadResult, UploadProviderProps, S3AdapterOptions, AzureBlobAdapterOptions, ObjectStackUploadAdapterOptions, } from './UploadProvider';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ThemeModeSchema } from '@objectstack/spec/ui';
|
|
2
3
|
export interface DataSourceProviderProps {
|
|
3
4
|
dataSource: any;
|
|
4
5
|
children: ReactNode;
|
|
@@ -7,9 +8,34 @@ export interface MetadataProviderProps {
|
|
|
7
8
|
metadata?: any;
|
|
8
9
|
children: ReactNode;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The theme MODE this provider stores and applies: the spec's `ThemeMode`
|
|
13
|
+
* vocabulary (`auto | light | dark`) plus the one legacy spelling this package
|
|
14
|
+
* still accepts.
|
|
15
|
+
*
|
|
16
|
+
* Named `ThemePreference`, not `Theme` (objectui#3161, objectstack#4115 ledger
|
|
17
|
+
* batch 7). `@objectstack/spec/ui` owns `Theme` for a whole theme DOCUMENT —
|
|
18
|
+
* `{ name, label, mode, colors: { primary, background, … }, typography, … }` —
|
|
19
|
+
* so the local declaration was not a drifted copy of the spec's `Theme` at all;
|
|
20
|
+
* it was the spec's `Theme['mode']` under the spec's `Theme` name, which is the
|
|
21
|
+
* more misleading of the two failures: a session reading `Theme` here would
|
|
22
|
+
* conclude an ObjectStack theme is a string. The spec's own name for this
|
|
23
|
+
* concept, `ThemeMode`, is exported too, so THAT name could not be taken either
|
|
24
|
+
* (the "run the new name past the guard first" rule from objectui#3169 — it
|
|
25
|
+
* would have traded one collision for another); and it would be wrong anyway,
|
|
26
|
+
* because of `'system'`.
|
|
27
|
+
*
|
|
28
|
+
* The three real modes are now the spec enum rather than a hand copy of it, so
|
|
29
|
+
* a mode the spec adds arrives here and `ThemeProvider`'s branch must handle
|
|
30
|
+
* it. `'system'` stays as an explicit local union member: it is the pre-spec
|
|
31
|
+
* spelling of `auto`, still sitting in users' `localStorage`, and the provider
|
|
32
|
+
* treats the two identically (#2942, pinned in `theme-mode-spec-parity`).
|
|
33
|
+
* Reached through the schema's `_zod` carrier so this package takes no zod
|
|
34
|
+
* dependency — same technique as `packages/react/src/spec-input.ts`.
|
|
35
|
+
*/
|
|
36
|
+
export type ThemePreference = (typeof ThemeModeSchema)['_zod']['input'] | 'system';
|
|
11
37
|
export interface ThemeProviderProps {
|
|
12
|
-
defaultTheme?:
|
|
38
|
+
defaultTheme?: ThemePreference;
|
|
13
39
|
storageKey?: string;
|
|
14
40
|
children: ReactNode;
|
|
15
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/providers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Reusable context providers for ObjectUI applications",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@
|
|
27
|
+
"@objectstack/spec": "^17.0.0-rc.1",
|
|
28
|
+
"@object-ui/types": "17.2.0"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
31
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"scripts": {
|
|
62
63
|
"build": "tsc",
|
|
63
64
|
"test": "vitest run",
|
|
64
|
-
"type-check": "tsc --noEmit",
|
|
65
|
+
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
|
|
65
66
|
"lint": "eslint ."
|
|
66
67
|
}
|
|
67
68
|
}
|