@object-ui/providers 17.6.0 → 18.0.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,694 @@
1
1
  # @object-ui/providers — Changelog
2
2
 
3
+ ## 18.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 6f3299f: objectui moves to major 18, following `@objectstack/*` from 17 to 18 (objectui#12334). objectui's major is not a count of its own breaking changes: it tracks the major of the `@objectstack/spec` its packages depend on, so that the same major means compatible across the two projects. These packages already declare `@objectstack/*` on the 18 line (objectui#12030), so every package in the fixed release group crosses to 18 together. It is the one `major` that rule admits: objectui's own breaking changes ship as `minor`, described in their entries.
8
+
9
+ The 18 line is released from Changesets pre mode on the `next` tag (`.changeset/pre.json`), as `@objectstack/*` 18 is: these releases are `18.0.0-next.N` on the npm `next` dist-tag, and they do not move `latest`. The first `18.0.0` on `latest` comes when `@objectstack` 18 is generally available and this repository leaves pre mode.
10
+
11
+ What a consumer must do to take it is in the `@objectstack/*` 18 entry of this release (objectui#12030): move its own `@objectstack/*` packages to the 18 line at the same time.
12
+
13
+ ### Minor Changes
14
+
15
+ - 7282c6a: `createObjectStackUploadAdapter` no longer sends an upload's `path` as the storage scope (objectui#12055).
16
+
17
+ The adapter used to send `scope: opts.scope ?? options.path` in its presigned upload request, so an adapter built without a `scope` turned the `path` a caller passed to `upload(file, { path })` into the scope. A path is a key prefix for the S3 and Azure presign callbacks, not a scope: the ObjectStack storage service accepts only the values of the `scope` select on its `sys_file` object and refuses any other, so such an upload failed at the presign step. The adapter now sends only the `scope` it was built with, or none, and the server applies its default. `UploadResult.meta.scope` reports the same value.
18
+
19
+ The `scope` option's documentation no longer teaches free key prefixes ("avatars", "logos", "attachments/case"). It names the server's `sys_file` scope select as the vocabulary.
20
+
21
+ BREAKING (`@object-ui/providers`), for a caller that relied on `path` to choose the scope of an adapter built without one: the upload is now filed under the server's default scope. Remedy: pass one of the server's scopes as the adapter's `scope`, or none to take the server's default. (The bump is `minor` by this repo's release model: objectui's major follows the `@objectstack` family major, and its own breaking changes ship as `minor` with the breaking semantics stated here.)
22
+
23
+ **Clause-②: no (narrowing)**: no export, type member or option is added, and no type changes. The request the adapter sends narrows: a `path` no longer reaches it.
24
+ - 24804dc: `createObjectStackUploadAdapter`'s `scope` option is typed from the spec's upload-scope vocabulary (objectui#12055).
25
+
26
+ `ObjectStackUploadAdapterOptions.scope` was an open `string`, so a caller could build an adapter with a scope the ObjectStack storage service refuses with `400`. It is now `UploadScope` from `@objectstack/spec/api`, the one list the spec's upload request, the `scope` select on `sys_file` and the upload doors share. `@object-ui/providers` reaches it through the `API` namespace `@object-ui/types` already re-exports, so no dependency and no export is added. Omitting `scope` still sends none, and the server applies the default the spec's upload request declares.
27
+
28
+ BREAKING (`@object-ui/providers`), TypeScript only, for a caller that builds the adapter with a scope outside the vocabulary (for example `'avatars'` or `'attachments/case'`): it no longer compiles. The server already refused such a request at runtime. Remedy: pass one of the vocabulary's values, or omit `scope` to take the server's default. (The bump is `minor` by this repo's release model: objectui's major follows the `@objectstack` family major, and its own breaking changes ship as `minor` with the breaking semantics stated here.)
29
+
30
+ **Clause-②: no (narrowing)**: the option's accepted values narrow from any string to the spec's upload scopes. No export, option or type member is added; the declaration file gains a type-only import of `API` from `@object-ui/types`, a package `@object-ui/providers` already depends on.
31
+ - 12ff256: The props of this package's `ThemeProvider` are declared and exported as `ThemePreferenceProviderProps` instead of `ThemeProviderProps` (objectui#6349, batch 10). `@object-ui/react` publishes a different `ThemeProviderProps`: the props of its theme-system `ThemeProvider`, which registers whole `Theme` documents, takes a theme name as `defaultTheme` and the mode as `defaultMode`, and writes the active theme as CSS variables. This package's provider stores one `ThemePreference` (`auto | light | dark | system`) and takes that mode as `defaultTheme`. One exported name stood for two props types across the two packages, and react keeps it.
32
+
33
+ **Type change, breaking for some consumers.** `ThemeProviderProps` is no longer exported from `@object-ui/providers`. Replace `import type { ThemeProviderProps } from '@object-ui/providers'` with `ThemePreferenceProviderProps`; the members (`defaultTheme`, `storageKey`, `children`) are unchanged. The old import fails to compile with TS2724 ("has no exported member named 'ThemeProviderProps'"). That error's "Did you mean" names the `ThemeProvider` component, not the replacement; using the component's name as a type fails too (TS2749), so write `ThemePreferenceProviderProps`. The `ThemeProvider` component and `useTheme` keep their names.
34
+
35
+ No runtime behaviour changes.
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [18d7b48]
40
+ - Updated dependencies [172acc3]
41
+ - Updated dependencies [f0496bd]
42
+ - Updated dependencies [c4c506b]
43
+ - Updated dependencies [9db9ff3]
44
+ - Updated dependencies [b10c68e]
45
+ - Updated dependencies [bdc9049]
46
+ - Updated dependencies [2e818d0]
47
+ - Updated dependencies [8b14aec]
48
+ - Updated dependencies [2abec3a]
49
+ - Updated dependencies [9dfaca6]
50
+ - Updated dependencies [96fcf30]
51
+ - Updated dependencies [89cc738]
52
+ - Updated dependencies [c0862c1]
53
+ - Updated dependencies [c0862c1]
54
+ - Updated dependencies [c0862c1]
55
+ - Updated dependencies [4c0de52]
56
+ - Updated dependencies [a80fef7]
57
+ - Updated dependencies [f34e877]
58
+ - Updated dependencies [aaba865]
59
+ - Updated dependencies [45d5853]
60
+ - Updated dependencies [2312bd9]
61
+ - Updated dependencies [c5406c2]
62
+ - Updated dependencies [2a48bd4]
63
+ - Updated dependencies [c7b30bd]
64
+ - Updated dependencies [69bca0a]
65
+ - Updated dependencies [c0c2f79]
66
+ - Updated dependencies [0665c3b]
67
+ - Updated dependencies [d2500d8]
68
+ - Updated dependencies [b231607]
69
+ - Updated dependencies [466a219]
70
+ - Updated dependencies [6fb281d]
71
+ - Updated dependencies [c08c933]
72
+ - Updated dependencies [c4dd707]
73
+ - Updated dependencies [923504f]
74
+ - Updated dependencies [10aba37]
75
+ - Updated dependencies [5d3f437]
76
+ - Updated dependencies [7af0ab3]
77
+ - Updated dependencies [fd4872f]
78
+ - Updated dependencies [f0532d8]
79
+ - Updated dependencies [3092aca]
80
+ - Updated dependencies [82e5f53]
81
+ - Updated dependencies [d81e460]
82
+ - Updated dependencies [8106db1]
83
+ - Updated dependencies [093d55b]
84
+ - Updated dependencies [a8051d6]
85
+ - Updated dependencies [524136e]
86
+ - Updated dependencies [6f3299f]
87
+ - Updated dependencies [f2b17c6]
88
+ - Updated dependencies [52d6194]
89
+ - Updated dependencies [23bf859]
90
+ - Updated dependencies [1c72d77]
91
+ - Updated dependencies [2b4d3f1]
92
+ - Updated dependencies [d75f212]
93
+ - Updated dependencies [ff9df88]
94
+ - Updated dependencies [a2225f9]
95
+ - Updated dependencies [21f9577]
96
+ - Updated dependencies [3eb3ec1]
97
+ - Updated dependencies [619e3f7]
98
+ - Updated dependencies [f62b6ff]
99
+ - Updated dependencies [d66d7e8]
100
+ - Updated dependencies [15d8ca6]
101
+ - Updated dependencies [378896d]
102
+ - Updated dependencies [4839f5c]
103
+ - Updated dependencies [c999d4c]
104
+ - Updated dependencies [26323c4]
105
+ - Updated dependencies [c219165]
106
+ - Updated dependencies [30083da]
107
+ - Updated dependencies [8aa8e3e]
108
+ - Updated dependencies [a928aaa]
109
+ - Updated dependencies [1b94d50]
110
+ - Updated dependencies [fb85637]
111
+ - Updated dependencies [df71568]
112
+ - Updated dependencies [cbac9d7]
113
+ - Updated dependencies [daeb77f]
114
+ - Updated dependencies [eb4552e]
115
+ - Updated dependencies [55e90fd]
116
+ - Updated dependencies [9b75509]
117
+ - Updated dependencies [b13ea3c]
118
+ - Updated dependencies [d7e9e9a]
119
+ - Updated dependencies [cf62edf]
120
+ - Updated dependencies [0253416]
121
+ - Updated dependencies [5d77c09]
122
+ - Updated dependencies [3fd8625]
123
+ - Updated dependencies [1473757]
124
+ - Updated dependencies [d73d987]
125
+ - Updated dependencies [12ff256]
126
+ - Updated dependencies [26b0bd2]
127
+ - Updated dependencies [d328698]
128
+ - Updated dependencies [b4e0787]
129
+ - Updated dependencies [088e0f7]
130
+ - Updated dependencies [b403bb3]
131
+ - @object-ui/types@18.0.0
132
+
133
+ ## 17.7.0
134
+
135
+ ### Minor Changes
136
+
137
+ - c9327c9: Localize the theme document types: `@object-ui/types` now owns `Theme`, `ThemeMode` and `ColorPalette` (objectui#5716 ruling, 2026-08-23). The spec retired its theme module (objectstack `35ad101bc`) while ObjectUI retained the theme system, so the types are hand-written from the last-published `@objectstack/spec` 17.1.0 shapes instead of re-exported — a spec dependency refresh past the retirement no longer breaks these packages.
138
+
139
+ Published-name REMOVALS from `@object-ui/types` (zero in-repo readers, deleted under the same ruling's rider):
140
+
141
+ - `Typography` — the shape lives on as the inline `Theme['typography']` member.
142
+ - `BorderRadius` — lives on as inline `Theme['borderRadius']`.
143
+ - `Shadow` — lives on as inline `Theme['shadows']`.
144
+ - `ThemeDefinition` — the deprecated alias of `Theme`; use `Theme`.
145
+
146
+ Also added: `THEME_MODES`, a runtime tuple witness of the theme mode vocabulary (`['auto', 'light', 'dark']`).
147
+
148
+ The `UI` protocol namespace (`import { UI } from '@object-ui/types'`) now resolves `UI.Theme` / `UI.ThemeMode` / `UI.ColorPalette` to the local owners, so they survive the upcoming spec refresh; the rest of the namespace continues to track `@objectstack/spec/ui`. After that refresh, retired spec/ui members (`UI.ThemeSchema`, `UI.ThemeModeSchema`, `UI.ThemeParsed`, `UI.Typography`, `UI.BorderRadius`, `UI.Shadow`, `UI.defineTheme`) drop out of the namespace.
149
+
150
+ `@object-ui/providers`: `ThemePreference` is now derived from `@object-ui/types`' `ThemeMode` instead of the retired spec `ThemeModeSchema` (same union: `'auto' | 'light' | 'dark' | 'system'`).
151
+
152
+ ### Patch Changes
153
+
154
+ - a1c41c5: `@object-ui/providers` no longer declares `@objectstack/spec` as a dependency. Nothing
155
+ in the package imports it, so consumers stop installing it on this package's account
156
+ (objectui#5753).
157
+
158
+ The edge was live for exactly one release cycle. It was promoted from `devDependencies`
159
+ to `dependencies` when `ThemePreference` was derived from the spec's `ThemeMode` union,
160
+ because the package's public `.d.ts` then referenced the spec. objectui#5716 re-pointed
161
+ that derivation at `@object-ui/types` (`ThemeMode` / `THEME_MODES`), which removed the
162
+ last three import sites — `src/types.ts` and the two retirement-era test files — and
163
+ left the declaration behind with no reader.
164
+
165
+ Re-measured on `origin/main` at `ad0f5f11f` before removal, with a positive control so
166
+ the empty result is a real absence rather than a broken command: the import-shaped grep
167
+ (`from` / `require(` / `import(` / `vi.mock(` against `@objectstack/spec`, bare name and
168
+ every subpath) returns **0** hits under `packages/providers/` and **434** across
169
+ `packages/` + `apps/` — same command, same invocation. The only surviving mentions in
170
+ the package are the declaration itself, immutable `CHANGELOG.md` history, and a prose
171
+ comment in `tsconfig.test.json` that this change corrects.
172
+
173
+ No API change and no behaviour change: `dist/types.d.ts` imports only `react` and
174
+ `@object-ui/types`, and no emitted file references a spec symbol. Consumers on an
175
+ isolated `node_modules` (pnpm) never had supported access to the spec through this
176
+ package, so nothing they could legitimately import goes away — the change is to the
177
+ install graph only, which is why it is scored `patch` rather than `minor`.
178
+ - c907a9c: fix(fields): a file or image upload that surfaces no `sys_file` id is refused by name, never submitted as an inline blob
179
+
180
+ **BREAKING (`@object-ui/fields`), graded `minor` by this repo's release model** (AGENTS.md: objectui's major follows the `@objectstack` family major, so its own breaking changes ship as `minor` with the breaking semantics stated here, never `major`):
181
+
182
+ - **Who breaks.** Two kinds of host. The first calls `fileValueForSubmit` itself. The second mounts an upload adapter whose result carries no id-shaped `meta.fileId`. That includes the object-URL default: `useUpload()` falls back to it when no `UploadProvider` is mounted, and `UploadProvider` uses it when given no `adapter`. It also includes any S3- or Azure-style adapter, `createS3Adapter` and `createAzureBlobAdapter` among them, because neither mints a `sys_file` row. This includes every host on a non-ObjectStack backend (the README's any-backend `DataSource` path) that stored the inline `UploadedFileMetadata` object: no adapter there mints a `sys_file` id.
183
+ - **What they see now.** `fileValueForSubmit` throws `UploadIncompleteError` (`code` `UPLOAD_INCOMPLETE`, `fileName` naming the pick) where it used to return the inline object, and its return type is `string`. In `FileField`, `FileCell` and `ImageField` the pick is refused with the translated "did not complete" row, and the field is not changed.
184
+ - **What to do.** Mount an `UploadProvider` whose adapter returns the `sys_file` id in `meta.fileId`. `createObjectStackUploadAdapter`, the ObjectStack presigned flow, does. A custom adapter has to register the file with the platform and return that id. A host that calls `fileValueForSubmit` directly catches `UploadIncompleteError` (or checks `code === 'UPLOAD_INCOMPLETE'`) where it used to accept an object. Such a host returns its own file id in `meta.fileId` (word characters and `-`, 1 to 64 long, as `isFileIdToken` requires) and has its read path return `{ id, name, url }`, because a bare id otherwise renders from ObjectStack's `/api/v1/storage/files/:id`.
185
+
186
+ `Clause-②: yes (narrowing)` — `fileValueForSubmit`, a public export of `@object-ui/fields`, narrows its return type to `string` and throws where it used to return an object; `UploadIncompleteError` is a new public export. No field-value accept set widens.
187
+
188
+ `fileValueForSubmit` used to fall back to the legacy inline `{ name, original_name, size, mime_type, url }` object when the upload adapter surfaced no `meta.fileId`. That was the file and image widgets' one path to the pre-D3 inline file object: the backend's stored contract has been the bare `sys_file` id since spec `17.0.0`, so the fallback turned a successful-looking upload into a save the engine refused (`invalid_type`) on every deployment that has verified its file-as-reference migration, and into a warned-about legacy value on the rest. ADR-0104's 2026-09-05 addendum fixes the physical column to the bare id as well.
189
+
190
+ The fallback is retired. `FileField`, `FileCell` and both upload paths of `ImageField` now submit the id the adapter minted, or refuse the pick with the translated `fields.file.uploadIncomplete` message ("did not complete") in the same error row a transport failure lands in — the field is not changed and no new blob reaches `onChange`. This includes the object-URL default `useUpload()` falls open to when no `UploadProvider` is mounted, and any S3/Azure-style adapter that mints no `sys_file` row. Reading is unchanged: a legacy blob already on a record still renders, and on a `multiple` field it is passed through untouched beside a new id.
191
+
192
+ `@object-ui/i18n` gains the `fields.file.uploadIncomplete` key in every locale pack.
193
+
194
+ `@object-ui/providers`'s `UploadProvider.tsx` JSDoc for the object-URL default now states it persists nothing and returns no id.
195
+ - Updated dependencies [b46c58f]
196
+ - Updated dependencies [6f96fca]
197
+ - Updated dependencies [5f00ff4]
198
+ - Updated dependencies [c9e073a]
199
+ - Updated dependencies [7b395d8]
200
+ - Updated dependencies [0879812]
201
+ - Updated dependencies [2dd4d3f]
202
+ - Updated dependencies [e3ea4f9]
203
+ - Updated dependencies [8b1f066]
204
+ - Updated dependencies [af243c1]
205
+ - Updated dependencies [f3f4e4c]
206
+ - Updated dependencies [a05c350]
207
+ - Updated dependencies [8c10f4f]
208
+ - Updated dependencies [90dac98]
209
+ - Updated dependencies [6096f20]
210
+ - Updated dependencies [ea02938]
211
+ - Updated dependencies [a14fb23]
212
+ - Updated dependencies [ae98f1d]
213
+ - Updated dependencies [f98eddf]
214
+ - Updated dependencies [ce6bd99]
215
+ - Updated dependencies [a5b08c9]
216
+ - Updated dependencies [9b28151]
217
+ - Updated dependencies [1a5003f]
218
+ - Updated dependencies [d22b37b]
219
+ - Updated dependencies [1daf477]
220
+ - Updated dependencies [fb13e85]
221
+ - Updated dependencies [c2d8659]
222
+ - Updated dependencies [e0f8202]
223
+ - Updated dependencies [c3a26cc]
224
+ - Updated dependencies [a66e58e]
225
+ - Updated dependencies [d89492c]
226
+ - Updated dependencies [9327397]
227
+ - Updated dependencies [17cc3a3]
228
+ - Updated dependencies [9c78ebe]
229
+ - Updated dependencies [12809a5]
230
+ - Updated dependencies [f9c06ef]
231
+ - Updated dependencies [5ad3b88]
232
+ - Updated dependencies [f9d772b]
233
+ - Updated dependencies [97b6c21]
234
+ - Updated dependencies [29b45f6]
235
+ - Updated dependencies [b956e69]
236
+ - Updated dependencies [fec3b1a]
237
+ - Updated dependencies [b8e0941]
238
+ - Updated dependencies [0c50f18]
239
+ - Updated dependencies [1dae95a]
240
+ - Updated dependencies [e32dae1]
241
+ - Updated dependencies [4aebea0]
242
+ - Updated dependencies [f976774]
243
+ - Updated dependencies [25cb364]
244
+ - Updated dependencies [c6678b1]
245
+ - Updated dependencies [0638322]
246
+ - Updated dependencies [e3782d2]
247
+ - Updated dependencies [db0beb2]
248
+ - Updated dependencies [997ce38]
249
+ - Updated dependencies [ae0b9d3]
250
+ - Updated dependencies [3b469c8]
251
+ - Updated dependencies [6650259]
252
+ - Updated dependencies [4f8b7f8]
253
+ - Updated dependencies [f6ae5e2]
254
+ - Updated dependencies [7343376]
255
+ - Updated dependencies [b2683a2]
256
+ - Updated dependencies [dded788]
257
+ - Updated dependencies [b45d463]
258
+ - Updated dependencies [54a7830]
259
+ - Updated dependencies [f3135a4]
260
+ - Updated dependencies [b5696d3]
261
+ - Updated dependencies [3f9d926]
262
+ - Updated dependencies [e978ed5]
263
+ - Updated dependencies [6a7f24e]
264
+ - Updated dependencies [b3c96d6]
265
+ - Updated dependencies [8d0ca91]
266
+ - Updated dependencies [c30c8dd]
267
+ - Updated dependencies [24d3e65]
268
+ - Updated dependencies [95a7c8d]
269
+ - Updated dependencies [cc4e476]
270
+ - Updated dependencies [92970c4]
271
+ - Updated dependencies [d570eaa]
272
+ - Updated dependencies [42687ba]
273
+ - Updated dependencies [24a0f14]
274
+ - Updated dependencies [797a30f]
275
+ - Updated dependencies [b4075c0]
276
+ - Updated dependencies [9b85600]
277
+ - Updated dependencies [99878d8]
278
+ - Updated dependencies [3c13675]
279
+ - Updated dependencies [0eb9f36]
280
+ - Updated dependencies [ae582b7]
281
+ - Updated dependencies [db11afd]
282
+ - Updated dependencies [154075a]
283
+ - Updated dependencies [582edef]
284
+ - Updated dependencies [19f484f]
285
+ - Updated dependencies [0a78a20]
286
+ - Updated dependencies [615346d]
287
+ - Updated dependencies [75dcc81]
288
+ - Updated dependencies [55a12a8]
289
+ - Updated dependencies [edfcf5a]
290
+ - Updated dependencies [0a3e540]
291
+ - Updated dependencies [f61dab1]
292
+ - Updated dependencies [b0a05dd]
293
+ - Updated dependencies [dd5ff19]
294
+ - Updated dependencies [81f8498]
295
+ - Updated dependencies [c27b575]
296
+ - Updated dependencies [0e6e76b]
297
+ - Updated dependencies [cd5b19a]
298
+ - Updated dependencies [17dc167]
299
+ - Updated dependencies [20d23be]
300
+ - Updated dependencies [20d23be]
301
+ - Updated dependencies [e6bc087]
302
+ - Updated dependencies [a7557a7]
303
+ - Updated dependencies [7d074ba]
304
+ - Updated dependencies [6158e4c]
305
+ - Updated dependencies [6158e4c]
306
+ - Updated dependencies [52aad5c]
307
+ - Updated dependencies [58da8ae]
308
+ - Updated dependencies [138ad45]
309
+ - Updated dependencies [5262f7d]
310
+ - Updated dependencies [6aa029b]
311
+ - Updated dependencies [770cc5b]
312
+ - Updated dependencies [1a88ce2]
313
+ - Updated dependencies [a1a44d6]
314
+ - Updated dependencies [e0a9c67]
315
+ - Updated dependencies [5638529]
316
+ - Updated dependencies [c476be0]
317
+ - Updated dependencies [c82ff39]
318
+ - Updated dependencies [6c3da53]
319
+ - Updated dependencies [31987bd]
320
+ - Updated dependencies [3c3ce15]
321
+ - Updated dependencies [e100589]
322
+ - Updated dependencies [304f611]
323
+ - Updated dependencies [e46ee77]
324
+ - Updated dependencies [6e9c8d2]
325
+ - Updated dependencies [9547063]
326
+ - Updated dependencies [3f6efd6]
327
+ - Updated dependencies [c4ab6d0]
328
+ - Updated dependencies [0e9058b]
329
+ - Updated dependencies [5988b6b]
330
+ - Updated dependencies [00ccdf7]
331
+ - Updated dependencies [9d9ed54]
332
+ - Updated dependencies [ca3de72]
333
+ - Updated dependencies [83e3f83]
334
+ - Updated dependencies [401611b]
335
+ - Updated dependencies [2c0ddf2]
336
+ - Updated dependencies [4abc0aa]
337
+ - Updated dependencies [2b188fa]
338
+ - Updated dependencies [f68e0a0]
339
+ - Updated dependencies [aea682a]
340
+ - Updated dependencies [fcdc8ec]
341
+ - Updated dependencies [2d576e4]
342
+ - Updated dependencies [8366acc]
343
+ - Updated dependencies [95e58a3]
344
+ - Updated dependencies [9d7419b]
345
+ - Updated dependencies [fc7db05]
346
+ - Updated dependencies [9ed8d0f]
347
+ - Updated dependencies [c73cdb5]
348
+ - Updated dependencies [6f5719e]
349
+ - Updated dependencies [06a8af5]
350
+ - Updated dependencies [6a91586]
351
+ - Updated dependencies [a04d7c6]
352
+ - Updated dependencies [f3c2bb0]
353
+ - Updated dependencies [460575f]
354
+ - Updated dependencies [d88e20f]
355
+ - Updated dependencies [2d7304d]
356
+ - Updated dependencies [636b236]
357
+ - Updated dependencies [d6d8fb9]
358
+ - Updated dependencies [64d624d]
359
+ - Updated dependencies [95bad12]
360
+ - Updated dependencies [d2fb6ef]
361
+ - Updated dependencies [fda49e5]
362
+ - Updated dependencies [fc62bb4]
363
+ - Updated dependencies [41df893]
364
+ - Updated dependencies [0cba1b7]
365
+ - Updated dependencies [00f3eb5]
366
+ - Updated dependencies [1ec291c]
367
+ - Updated dependencies [453dbaa]
368
+ - Updated dependencies [69a2163]
369
+ - Updated dependencies [24e027e]
370
+ - Updated dependencies [2c3cd1b]
371
+ - Updated dependencies [90665e0]
372
+ - Updated dependencies [7e19d03]
373
+ - Updated dependencies [1e946c9]
374
+ - Updated dependencies [864154e]
375
+ - Updated dependencies [b023625]
376
+ - Updated dependencies [75bd83d]
377
+ - Updated dependencies [40c479a]
378
+ - Updated dependencies [971d387]
379
+ - Updated dependencies [ee851c3]
380
+ - Updated dependencies [6414dfd]
381
+ - Updated dependencies [a8d5c71]
382
+ - Updated dependencies [905b21f]
383
+ - Updated dependencies [88e9109]
384
+ - Updated dependencies [2c45966]
385
+ - Updated dependencies [db3a600]
386
+ - Updated dependencies [3a3db76]
387
+ - Updated dependencies [0d723a3]
388
+ - Updated dependencies [0c95d3d]
389
+ - Updated dependencies [3e4fa2c]
390
+ - Updated dependencies [b5b928a]
391
+ - Updated dependencies [52a43de]
392
+ - Updated dependencies [195052f]
393
+ - Updated dependencies [e4559d1]
394
+ - Updated dependencies [2c71482]
395
+ - Updated dependencies [5ef9c4f]
396
+ - Updated dependencies [46f0bb4]
397
+ - Updated dependencies [6f81384]
398
+ - Updated dependencies [8f1d995]
399
+ - Updated dependencies [dddb942]
400
+ - Updated dependencies [29754cf]
401
+ - Updated dependencies [b84dc18]
402
+ - Updated dependencies [ac8abb0]
403
+ - Updated dependencies [9d86e1d]
404
+ - Updated dependencies [3a5817f]
405
+ - Updated dependencies [99a3c2d]
406
+ - Updated dependencies [c8ea8af]
407
+ - Updated dependencies [3190414]
408
+ - Updated dependencies [4e480f5]
409
+ - Updated dependencies [38a123c]
410
+ - Updated dependencies [d7acad6]
411
+ - Updated dependencies [45a9aeb]
412
+ - Updated dependencies [713db46]
413
+ - Updated dependencies [bf3a03c]
414
+ - Updated dependencies [cb55718]
415
+ - Updated dependencies [29cb85b]
416
+ - Updated dependencies [3e028c8]
417
+ - Updated dependencies [ce503e5]
418
+ - Updated dependencies [f20dcf0]
419
+ - Updated dependencies [4ca30d0]
420
+ - Updated dependencies [7a5da14]
421
+ - Updated dependencies [2c1c967]
422
+ - Updated dependencies [d6ceb8d]
423
+ - Updated dependencies [2acd8e1]
424
+ - Updated dependencies [adb2a86]
425
+ - Updated dependencies [3561bd2]
426
+ - Updated dependencies [bf97b98]
427
+ - Updated dependencies [b0d308d]
428
+ - Updated dependencies [40f34b4]
429
+ - Updated dependencies [8063bcb]
430
+ - Updated dependencies [b74a859]
431
+ - Updated dependencies [d4493fd]
432
+ - Updated dependencies [240b80f]
433
+ - Updated dependencies [77cb489]
434
+ - Updated dependencies [bfaa158]
435
+ - Updated dependencies [777e5c6]
436
+ - Updated dependencies [0c386dd]
437
+ - Updated dependencies [9e37d9b]
438
+ - Updated dependencies [5ad86dd]
439
+ - Updated dependencies [16a725f]
440
+ - Updated dependencies [4dfdcc3]
441
+ - Updated dependencies [446d93d]
442
+ - Updated dependencies [ecd9cb2]
443
+ - Updated dependencies [98d4108]
444
+ - Updated dependencies [0e3b3be]
445
+ - Updated dependencies [a29ae2d]
446
+ - Updated dependencies [4388f71]
447
+ - Updated dependencies [0b1ac58]
448
+ - Updated dependencies [c93b4d5]
449
+ - Updated dependencies [c1fe272]
450
+ - Updated dependencies [8ad218d]
451
+ - Updated dependencies [3e41187]
452
+ - Updated dependencies [5f78953]
453
+ - Updated dependencies [639114c]
454
+ - Updated dependencies [1f31d3a]
455
+ - Updated dependencies [351eb31]
456
+ - Updated dependencies [20c04b2]
457
+ - Updated dependencies [b652514]
458
+ - Updated dependencies [adbda1b]
459
+ - Updated dependencies [e2b3826]
460
+ - Updated dependencies [2e32ed4]
461
+ - Updated dependencies [1bee5d0]
462
+ - Updated dependencies [858cd72]
463
+ - Updated dependencies [554f2b6]
464
+ - Updated dependencies [669d71b]
465
+ - Updated dependencies [ed27d7c]
466
+ - Updated dependencies [52c8cf7]
467
+ - Updated dependencies [2ceb43a]
468
+ - Updated dependencies [7cdd2b9]
469
+ - Updated dependencies [52c8cf7]
470
+ - Updated dependencies [caa0cd3]
471
+ - Updated dependencies [25c7d58]
472
+ - Updated dependencies [c6198c2]
473
+ - Updated dependencies [51eb515]
474
+ - Updated dependencies [c354ce5]
475
+ - Updated dependencies [8fe8e5c]
476
+ - Updated dependencies [feac439]
477
+ - Updated dependencies [efbd566]
478
+ - Updated dependencies [9587fc9]
479
+ - Updated dependencies [e62c44e]
480
+ - Updated dependencies [5d0876c]
481
+ - Updated dependencies [544ecba]
482
+ - Updated dependencies [bc640ec]
483
+ - Updated dependencies [3e377c9]
484
+ - Updated dependencies [a3eb5d0]
485
+ - Updated dependencies [4ce14f1]
486
+ - Updated dependencies [2af1fa7]
487
+ - Updated dependencies [a137d0c]
488
+ - Updated dependencies [caf477f]
489
+ - Updated dependencies [f6375da]
490
+ - Updated dependencies [967e5d8]
491
+ - Updated dependencies [a4611b3]
492
+ - Updated dependencies [20316ba]
493
+ - Updated dependencies [d3499b3]
494
+ - Updated dependencies [309c75e]
495
+ - Updated dependencies [c9f9bae]
496
+ - Updated dependencies [18897a4]
497
+ - Updated dependencies [8b7ea39]
498
+ - Updated dependencies [dcbf0b2]
499
+ - Updated dependencies [1422a92]
500
+ - Updated dependencies [d05fe17]
501
+ - Updated dependencies [a480f79]
502
+ - Updated dependencies [f08d1a8]
503
+ - Updated dependencies [64a252d]
504
+ - Updated dependencies [786bc91]
505
+ - Updated dependencies [75fca96]
506
+ - Updated dependencies [7ca6ddd]
507
+ - Updated dependencies [f1cd290]
508
+ - Updated dependencies [5a41ce7]
509
+ - Updated dependencies [8d50bc2]
510
+ - Updated dependencies [604476d]
511
+ - Updated dependencies [335abea]
512
+ - Updated dependencies [0f5cadf]
513
+ - Updated dependencies [4f9f1ee]
514
+ - Updated dependencies [66e8b2a]
515
+ - Updated dependencies [aa083cd]
516
+ - Updated dependencies [12b5992]
517
+ - Updated dependencies [b93e245]
518
+ - Updated dependencies [c842594]
519
+ - Updated dependencies [290de37]
520
+ - Updated dependencies [8c8da45]
521
+ - Updated dependencies [8cd8eb5]
522
+ - Updated dependencies [cf1d29e]
523
+ - Updated dependencies [af9e957]
524
+ - Updated dependencies [c974edf]
525
+ - Updated dependencies [ad852b6]
526
+ - Updated dependencies [ee4d19f]
527
+ - Updated dependencies [496d31d]
528
+ - Updated dependencies [9a853f2]
529
+ - Updated dependencies [cb847fd]
530
+ - Updated dependencies [ee70287]
531
+ - Updated dependencies [3e98e13]
532
+ - Updated dependencies [4eaa835]
533
+ - Updated dependencies [b1777ae]
534
+ - Updated dependencies [24845c4]
535
+ - Updated dependencies [6f864cf]
536
+ - Updated dependencies [24d1edd]
537
+ - Updated dependencies [645087c]
538
+ - Updated dependencies [33f4a19]
539
+ - Updated dependencies [5323168]
540
+ - Updated dependencies [841dd2b]
541
+ - Updated dependencies [3014fc0]
542
+ - Updated dependencies [dacb402]
543
+ - Updated dependencies [474797d]
544
+ - Updated dependencies [704e695]
545
+ - Updated dependencies [a407bd6]
546
+ - Updated dependencies [3a43a15]
547
+ - Updated dependencies [421544b]
548
+ - Updated dependencies [fb01022]
549
+ - Updated dependencies [e9d9212]
550
+ - Updated dependencies [ecfb693]
551
+ - Updated dependencies [81a51db]
552
+ - Updated dependencies [67749c7]
553
+ - Updated dependencies [507b61b]
554
+ - Updated dependencies [512c84b]
555
+ - Updated dependencies [d4733f2]
556
+ - Updated dependencies [8b532cb]
557
+ - Updated dependencies [c42554e]
558
+ - Updated dependencies [555b4ec]
559
+ - Updated dependencies [1ccfc23]
560
+ - Updated dependencies [542718f]
561
+ - Updated dependencies [7f27bc5]
562
+ - Updated dependencies [f95b140]
563
+ - Updated dependencies [541ce4e]
564
+ - Updated dependencies [6479086]
565
+ - Updated dependencies [d79f525]
566
+ - Updated dependencies [f1190b0]
567
+ - Updated dependencies [6a4680b]
568
+ - Updated dependencies [c3a4273]
569
+ - Updated dependencies [093af32]
570
+ - Updated dependencies [1bd1be7]
571
+ - Updated dependencies [d234fa9]
572
+ - Updated dependencies [adf5812]
573
+ - Updated dependencies [5058336]
574
+ - Updated dependencies [2f6b2bf]
575
+ - Updated dependencies [2028b31]
576
+ - Updated dependencies [63601ab]
577
+ - Updated dependencies [8693b85]
578
+ - Updated dependencies [58b7b3d]
579
+ - Updated dependencies [681d3f1]
580
+ - Updated dependencies [f3bc481]
581
+ - Updated dependencies [93fc0e7]
582
+ - Updated dependencies [a4b723f]
583
+ - Updated dependencies [2b10ca0]
584
+ - Updated dependencies [7db4a81]
585
+ - Updated dependencies [526fc11]
586
+ - Updated dependencies [6732df4]
587
+ - Updated dependencies [fe9e0d0]
588
+ - Updated dependencies [63fb72c]
589
+ - Updated dependencies [279e48e]
590
+ - Updated dependencies [8700d6d]
591
+ - Updated dependencies [8db2a0f]
592
+ - Updated dependencies [30443fb]
593
+ - Updated dependencies [96919a4]
594
+ - Updated dependencies [2e471dc]
595
+ - Updated dependencies [be50942]
596
+ - Updated dependencies [775e079]
597
+ - Updated dependencies [7e8b3c0]
598
+ - Updated dependencies [53374dc]
599
+ - Updated dependencies [f6fb83f]
600
+ - Updated dependencies [2049b03]
601
+ - Updated dependencies [7cbc724]
602
+ - Updated dependencies [fb91ac9]
603
+ - Updated dependencies [8524372]
604
+ - Updated dependencies [7cbefa5]
605
+ - Updated dependencies [72d6587]
606
+ - Updated dependencies [a272a4f]
607
+ - Updated dependencies [55f39ee]
608
+ - Updated dependencies [0970a0e]
609
+ - Updated dependencies [e427e9c]
610
+ - Updated dependencies [bbc9dc3]
611
+ - Updated dependencies [02f1813]
612
+ - Updated dependencies [ac716ff]
613
+ - Updated dependencies [f0f3cd5]
614
+ - Updated dependencies [20f3e65]
615
+ - Updated dependencies [bbba098]
616
+ - Updated dependencies [87af769]
617
+ - Updated dependencies [3be720e]
618
+ - Updated dependencies [c3df43a]
619
+ - Updated dependencies [d16d0e9]
620
+ - Updated dependencies [bbe57fd]
621
+ - Updated dependencies [272a530]
622
+ - Updated dependencies [1779e8d]
623
+ - Updated dependencies [4128188]
624
+ - Updated dependencies [b253c4e]
625
+ - Updated dependencies [78a9c67]
626
+ - Updated dependencies [4a7ef0d]
627
+ - Updated dependencies [dea17b4]
628
+ - Updated dependencies [89bb77a]
629
+ - Updated dependencies [06611e4]
630
+ - Updated dependencies [dc3893d]
631
+ - Updated dependencies [1bbaa16]
632
+ - Updated dependencies [6ee259a]
633
+ - Updated dependencies [e708426]
634
+ - Updated dependencies [3b6d53b]
635
+ - Updated dependencies [a8198de]
636
+ - Updated dependencies [a78cd37]
637
+ - Updated dependencies [5ea623e]
638
+ - Updated dependencies [ca5d671]
639
+ - Updated dependencies [32bf2d6]
640
+ - Updated dependencies [af4fb29]
641
+ - Updated dependencies [9a97800]
642
+ - Updated dependencies [6bca0e4]
643
+ - Updated dependencies [2fcefb9]
644
+ - Updated dependencies [b55a346]
645
+ - Updated dependencies [065bba7]
646
+ - Updated dependencies [100547e]
647
+ - Updated dependencies [6d1c155]
648
+ - Updated dependencies [d7573b3]
649
+ - Updated dependencies [0e05aac]
650
+ - Updated dependencies [18a8e7d]
651
+ - Updated dependencies [e7957ab]
652
+ - Updated dependencies [f7e34ca]
653
+ - Updated dependencies [f9e4f91]
654
+ - Updated dependencies [6ef48b1]
655
+ - Updated dependencies [fa429cf]
656
+ - Updated dependencies [ed8df3e]
657
+ - Updated dependencies [8b446f5]
658
+ - Updated dependencies [7357447]
659
+ - Updated dependencies [199d31b]
660
+ - Updated dependencies [3e01cb5]
661
+ - Updated dependencies [4e8622b]
662
+ - Updated dependencies [dffd752]
663
+ - Updated dependencies [105f3c5]
664
+ - Updated dependencies [3ccd9e8]
665
+ - Updated dependencies [689b979]
666
+ - Updated dependencies [e546222]
667
+ - Updated dependencies [fd13f52]
668
+ - Updated dependencies [fb336df]
669
+ - Updated dependencies [0fce2ef]
670
+ - Updated dependencies [0e2ddd4]
671
+ - Updated dependencies [b7479ab]
672
+ - Updated dependencies [b2ea297]
673
+ - Updated dependencies [5b5a5c3]
674
+ - Updated dependencies [14582b8]
675
+ - Updated dependencies [51e144e]
676
+ - Updated dependencies [a691c0b]
677
+ - Updated dependencies [515f171]
678
+ - Updated dependencies [258d264]
679
+ - Updated dependencies [93127bd]
680
+ - Updated dependencies [51f3d8d]
681
+ - Updated dependencies [78cbdb5]
682
+ - Updated dependencies [b7543a9]
683
+ - Updated dependencies [ca39427]
684
+ - Updated dependencies [c9327c9]
685
+ - Updated dependencies [920165d]
686
+ - Updated dependencies [968dc1e]
687
+ - Updated dependencies [3c73d99]
688
+ - Updated dependencies [1170ed1]
689
+ - Updated dependencies [4d73b07]
690
+ - @object-ui/types@17.7.0
691
+
3
692
  ## 17.6.0
4
693
 
5
694
  ### Patch Changes
package/README.md CHANGED
@@ -12,12 +12,24 @@ pnpm add @object-ui/providers
12
12
 
13
13
  ## Providers
14
14
 
15
+ Every example below compiles against this package's built types. The values your
16
+ own app supplies are written as `declare const` stand-ins so each block stands
17
+ alone, and each stand-in is typed from the prop it is passed to — so the bound
18
+ the example teaches is the bound the package actually declares.
19
+
15
20
  ### DataSourceProvider
16
21
 
17
22
  Generic data source context that decouples ObjectUI from ObjectStack.
18
23
 
19
24
  ```tsx
20
- import { DataSourceProvider } from '@object-ui/providers';
25
+ import type { ReactNode } from 'react';
26
+ import { DataSourceProvider, type DataSourceProviderProps } from '@object-ui/providers';
27
+
28
+ // `DataSourceProviderProps['dataSource']` is declared `any` today, so this
29
+ // stand-in inherits `any`: the compiler checks nothing about the adapter's
30
+ // shape here (objectui#8160, objectui#7912 track that laundering).
31
+ declare const myCustomDataSource: DataSourceProviderProps['dataSource'];
32
+ declare const App: () => ReactNode;
21
33
 
22
34
  <DataSourceProvider dataSource={myCustomDataSource}>
23
35
  <App />
@@ -29,7 +41,13 @@ import { DataSourceProvider } from '@object-ui/providers';
29
41
  Schema/metadata management for objects, fields, and views.
30
42
 
31
43
  ```tsx
32
- import { MetadataProvider } from '@object-ui/providers';
44
+ import type { ReactNode } from 'react';
45
+ import { MetadataProvider, type MetadataProviderProps } from '@object-ui/providers';
46
+
47
+ // `MetadataProviderProps['metadata']` is declared `any` today — same bound as
48
+ // `dataSource` above, so nothing about this object's shape is checked here.
49
+ declare const myMetadata: MetadataProviderProps['metadata'];
50
+ declare const App: () => ReactNode;
33
51
 
34
52
  <MetadataProvider metadata={myMetadata}>
35
53
  <App />
@@ -40,9 +58,15 @@ import { MetadataProvider } from '@object-ui/providers';
40
58
 
41
59
  Theme management with system theme detection.
42
60
 
61
+ `defaultTheme` takes a `ThemePreference` (`auto | light | dark | system`); both
62
+ props are optional.
63
+
43
64
  ```tsx
65
+ import type { ReactNode } from 'react';
44
66
  import { ThemeProvider } from '@object-ui/providers';
45
67
 
68
+ declare const App: () => ReactNode;
69
+
46
70
  <ThemeProvider defaultTheme="system" storageKey="my-app-theme">
47
71
  <App />
48
72
  </ThemeProvider>
@@ -50,15 +74,31 @@ import { ThemeProvider } from '@object-ui/providers';
50
74
 
51
75
  ## Usage Example
52
76
 
77
+ `DataSourceProvider` and `MetadataProvider` both declare `children` as required,
78
+ so each one needs a real element inside it — a placeholder comment is not a
79
+ child.
80
+
53
81
  ```tsx
54
- import { DataSourceProvider, MetadataProvider, ThemeProvider } from '@object-ui/providers';
82
+ import type { ReactNode } from 'react';
83
+ import {
84
+ DataSourceProvider,
85
+ MetadataProvider,
86
+ ThemeProvider,
87
+ type DataSourceProviderProps,
88
+ type MetadataProviderProps,
89
+ } from '@object-ui/providers';
90
+
91
+ declare const myDataSource: DataSourceProviderProps['dataSource'];
92
+ declare const myMetadata: MetadataProviderProps['metadata'];
93
+ // Your own component tree goes here.
94
+ declare const AppContent: () => ReactNode;
55
95
 
56
96
  function App() {
57
97
  return (
58
98
  <ThemeProvider>
59
99
  <DataSourceProvider dataSource={myDataSource}>
60
100
  <MetadataProvider metadata={myMetadata}>
61
- {/* Your app components */}
101
+ <AppContent />
62
102
  </MetadataProvider>
63
103
  </DataSourceProvider>
64
104
  </ThemeProvider>
@@ -1,4 +1,4 @@
1
- import type { ThemePreference, ThemeProviderProps } from './types.js';
1
+ import type { ThemePreference, ThemePreferenceProviderProps } from './types.js';
2
2
  interface ThemeContextValue {
3
3
  theme: ThemePreference;
4
4
  setTheme: (theme: ThemePreference) => void;
@@ -9,7 +9,7 @@ interface ThemeContextValue {
9
9
  * Provides theme context and handles system theme detection.
10
10
  * Extracted from console for reuse in third-party applications.
11
11
  */
12
- export declare function ThemeProvider({ defaultTheme, storageKey, children, }: ThemeProviderProps): import("react").JSX.Element;
12
+ export declare function ThemeProvider({ defaultTheme, storageKey, children, }: ThemePreferenceProviderProps): import("react").JSX.Element;
13
13
  /**
14
14
  * Hook to access theme from context
15
15
  */
@@ -11,14 +11,15 @@
11
11
  * - `UploadProvider` exposes an `upload(file, opts)` function via context.
12
12
  * - Apps inject an adapter (`createS3Adapter`, `createAzureBlobAdapter`, or any
13
13
  * custom one implementing `UploadAdapter`).
14
- * - The default adapter (`createObjectUrlAdapter`) preserves the legacy
15
- * "blob: URL" behaviour so the field widgets keep working when no provider
16
- * is mounted.
14
+ * - The default adapter (`createObjectUrlAdapter`) mints a tab-local `blob:`
15
+ * URL and no `sys_file` id; it keeps the field widgets from crashing when no
16
+ * provider is mounted, and they refuse every pick through it (objectui#7699).
17
17
  * - Upload progress and resumable retries are first-class concerns: each
18
18
  * adapter implementation can chunk + resume; the public API surfaces
19
19
  * `onProgress` and an `abortSignal`.
20
20
  */
21
21
  import React, { type ReactNode } from 'react';
22
+ import type { API } from '@object-ui/types';
22
23
  export interface UploadResult {
23
24
  /** Canonical, shareable URL (e.g. https://my-bucket.s3.amazonaws.com/avatars/abc.png). */
24
25
  url: string;
@@ -30,7 +31,12 @@ export interface UploadResult {
30
31
  meta?: Record<string, unknown>;
31
32
  }
32
33
  export interface UploadOptions {
33
- /** Logical folder / key prefix (e.g. "avatars/"). */
34
+ /**
35
+ * Logical folder / key prefix (e.g. "avatars/"), handed to the presign
36
+ * callback of `createS3Adapter` and `createAzureBlobAdapter`.
37
+ * `createObjectStackUploadAdapter` never sends it: that server derives the
38
+ * object key itself, and a path is not a storage scope (objectui#12055).
39
+ */
34
40
  path?: string;
35
41
  /** Progress callback in 0–1. */
36
42
  onProgress?: (ratio: number) => void;
@@ -50,9 +56,10 @@ interface UploadContextValue {
50
56
  adapter: UploadAdapter;
51
57
  }
52
58
  /**
53
- * Default adapter — wraps the file in an object URL. Identical to the legacy
54
- * field-widget behaviour; safe fallback when the app hasn't configured a real
55
- * upload destination yet.
59
+ * Default adapter — wraps the file in an object URL. It persists nothing and
60
+ * returns no `meta.fileId`, so the `@object-ui/fields` file and image widgets
61
+ * refuse its result (`UploadIncompleteError`); it is a no-crash default, not
62
+ * an upload destination.
56
63
  */
57
64
  export declare function createObjectUrlAdapter(): UploadAdapter;
58
65
  export interface S3AdapterOptions {
@@ -117,10 +124,19 @@ export interface ObjectStackUploadAdapterOptions {
117
124
  */
118
125
  basePath?: string;
119
126
  /**
120
- * Logical key prefix forwarded to the server as `scope`. Useful for
121
- * partitioning uploads (e.g. "avatars", "logos", "attachments/case").
127
+ * The storage scope the server files every upload from this adapter
128
+ * under, sent as the presigned upload request's `scope`. It is not a key
129
+ * prefix or folder. Its values are the spec's upload-scope vocabulary,
130
+ * `UploadScope` from `@objectstack/spec/api` (reached here as
131
+ * `API.UploadScope` from `@object-ui/types`): the one list the upload
132
+ * request, the `scope` select on `sys_file` and the upload doors share.
133
+ * A value outside it does not compile, and the server refuses it with
134
+ * `400`. `attachments`, for example, is the scope of files joined to
135
+ * records through `sys_attachment`. Omit it and the request carries no
136
+ * scope, so the server applies the default the spec's upload request
137
+ * declares (objectui#12055).
122
138
  */
123
- scope?: string;
139
+ scope?: API.UploadScope;
124
140
  /** Override `fetch` (tests, ServiceWorker queues). */
125
141
  fetchImpl?: typeof fetch;
126
142
  /**
@@ -12,9 +12,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
12
12
  * - `UploadProvider` exposes an `upload(file, opts)` function via context.
13
13
  * - Apps inject an adapter (`createS3Adapter`, `createAzureBlobAdapter`, or any
14
14
  * custom one implementing `UploadAdapter`).
15
- * - The default adapter (`createObjectUrlAdapter`) preserves the legacy
16
- * "blob: URL" behaviour so the field widgets keep working when no provider
17
- * is mounted.
15
+ * - The default adapter (`createObjectUrlAdapter`) mints a tab-local `blob:`
16
+ * URL and no `sys_file` id; it keeps the field widgets from crashing when no
17
+ * provider is mounted, and they refuse every pick through it (objectui#7699).
18
18
  * - Upload progress and resumable retries are first-class concerns: each
19
19
  * adapter implementation can chunk + resume; the public API surfaces
20
20
  * `onProgress` and an `abortSignal`.
@@ -22,9 +22,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
22
22
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, } from 'react';
23
23
  const UploadContext = createContext(null);
24
24
  /**
25
- * Default adapter — wraps the file in an object URL. Identical to the legacy
26
- * field-widget behaviour; safe fallback when the app hasn't configured a real
27
- * upload destination yet.
25
+ * Default adapter — wraps the file in an object URL. It persists nothing and
26
+ * returns no `meta.fileId`, so the `@object-ui/fields` file and image widgets
27
+ * refuse its result (`UploadIncompleteError`); it is a no-crash default, not
28
+ * an upload destination.
28
29
  */
29
30
  export function createObjectUrlAdapter() {
30
31
  return {
@@ -145,7 +146,11 @@ export function createObjectStackUploadAdapter(opts = {}) {
145
146
  filename: name,
146
147
  mimeType,
147
148
  size: file.size,
148
- scope: opts.scope ?? options.path,
149
+ // The adapter's own scope, or none. `options.path` is never sent
150
+ // as the scope: it is a key prefix for the S3/Azure presign
151
+ // callbacks, and this server refuses any scope outside its
152
+ // vocabulary (objectui#12055).
153
+ scope: opts.scope,
149
154
  }),
150
155
  });
151
156
  if (!presignRes.ok) {
@@ -186,7 +191,7 @@ export function createObjectStackUploadAdapter(opts = {}) {
186
191
  name,
187
192
  size: file.size,
188
193
  mimeType,
189
- meta: { fileId, scope: opts.scope ?? options.path },
194
+ meta: { fileId, scope: opts.scope },
190
195
  };
191
196
  },
192
197
  };
package/dist/index.d.ts CHANGED
@@ -7,5 +7,5 @@ export { DataSourceProvider, useDataSource } from './DataSourceProvider.js';
7
7
  export { MetadataProvider, useMetadata } from './MetadataProvider.js';
8
8
  export { ThemeProvider, useTheme } from './ThemeProvider.js';
9
9
  export { UploadProvider, useUpload, createObjectUrlAdapter, createS3Adapter, createAzureBlobAdapter, createObjectStackUploadAdapter, } from './UploadProvider.js';
10
- export type { DataSourceProviderProps, MetadataProviderProps, ThemeProviderProps, ThemePreference, } from './types.js';
10
+ export type { DataSourceProviderProps, MetadataProviderProps, ThemePreferenceProviderProps, ThemePreference, } from './types.js';
11
11
  export type { UploadAdapter, UploadOptions, UploadResult, UploadProviderProps, S3AdapterOptions, AzureBlobAdapterOptions, ObjectStackUploadAdapterOptions, } from './UploadProvider.js';
package/dist/types.d.ts CHANGED
@@ -26,7 +26,7 @@ export interface MetadataProviderProps {
26
26
  *
27
27
  * Derivation history (objectui#5716): this union was born reading the spec's
28
28
  * `ThemeModeSchema` through its `_zod` input carrier. The spec then retired
29
- * its whole theme module (objectstack#10485), objectui assumed ownership of
29
+ * its whole theme module (objectstack `35ad101bc`), objectui assumed ownership of
30
30
  * the theme document types, and the mode vocabulary's owner is now
31
31
  * `@object-ui/types` (`ThemeMode`, with the `THEME_MODES` runtime witness) —
32
32
  * so the derivation reads from there. A mode the owner adds still arrives
@@ -36,7 +36,20 @@ export interface MetadataProviderProps {
36
36
  * identically (#2942, pinned in `theme-mode-spec-parity`).
37
37
  */
38
38
  export type ThemePreference = ThemeMode | 'system';
39
- export interface ThemeProviderProps {
39
+ /**
40
+ * Props of this package's `ThemeProvider`, which stores one
41
+ * {@link ThemePreference} and applies it as the `light` / `dark` class.
42
+ *
43
+ * Named `ThemePreferenceProviderProps`, not `ThemeProviderProps`
44
+ * (objectui#6349, batch 10). `@object-ui/react` publishes a
45
+ * `ThemeProviderProps` with a different meaning: the props of its theme-system
46
+ * `ThemeProvider`, which registers whole `Theme` documents and turns the
47
+ * active one into CSS variables. There `defaultTheme` is a theme NAME and the
48
+ * mode is `defaultMode`; here `defaultTheme` is the mode itself. One exported
49
+ * name stood for both, so this, the narrower of the two, takes the specific
50
+ * name and react keeps the general one.
51
+ */
52
+ export interface ThemePreferenceProviderProps {
40
53
  defaultTheme?: ThemePreference;
41
54
  storageKey?: string;
42
55
  children: ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/providers",
3
- "version": "17.6.0",
3
+ "version": "18.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Reusable context providers for ObjectUI applications",
@@ -24,8 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@objectstack/spec": "^17.0.0",
28
- "@object-ui/types": "17.6.0"
27
+ "@object-ui/types": "18.0.0"
29
28
  },
30
29
  "peerDependencies": {
31
30
  "react": "^18.0.0 || ^19.0.0",
@@ -60,8 +59,8 @@
60
59
  "LICENSE"
61
60
  ],
62
61
  "scripts": {
63
- "build": "tsc",
64
- "test": "vitest run",
62
+ "build": "tsc && node ../../scripts/check-dist-completeness.mjs",
63
+ "test": "vitest run --root ../.. packages/providers/",
65
64
  "type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
66
65
  "lint": "eslint ."
67
66
  }