@zaflun/lumio-sdk 0.10.0 → 0.11.1
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 +38 -0
- package/dist/host.d.ts +2 -1
- package/dist/host.js +51 -23
- package/dist/index.d.ts +2 -1
- package/dist/lumio-runtime.global.js +13784 -5004
- package/dist/server.d.ts +2 -1
- package/package.json +17 -16
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@zaflun/lumio-sdk` are documented here.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## 0.11.1
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- The package is built with tsup 9 (esbuild 0.28). The bundled Worker runtime
|
|
13
|
+
(`lumio-runtime.global.js`) differs only in generated helper code, and the
|
|
14
|
+
type declarations are unchanged for consumers.
|
|
15
|
+
|
|
16
|
+
## 0.11.0
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- The `IconPicker` Lucide tab offers 2,296 icons (Lucide 1.67, before: 2,022).
|
|
21
|
+
No icon name was removed or renamed, so stored icon names keep working.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Breaking: React 19.3 or newer is required.** The peer dependencies are now
|
|
26
|
+
`react ^19.3.0` and `react-dom ^19.3.0` (before: `^18.0.0 || ^19.0.0`). The
|
|
27
|
+
renderer runs on `react-reconciler` 0.34, which requires React 19.3. To
|
|
28
|
+
upgrade, raise `react` (and `@types/react`) in your extension's
|
|
29
|
+
`package.json` to `^19.3.0` and reinstall. Code written against React 18 or
|
|
30
|
+
19 needs no other change. The Worker runtime (`@zaflun/lumio-sdk/runtime`)
|
|
31
|
+
bundles its own React, so deployed extensions are not affected.
|
|
32
|
+
- The renderer reports itself to React DevTools as `@zaflun/lumio-sdk`.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- State updates wrapped in `startTransition` (or `useTransition`) commit
|
|
37
|
+
instead of failing in the renderer.
|
|
38
|
+
- Updates scheduled outside React run at React's default priority.
|
package/dist/host.d.ts
CHANGED
|
@@ -69,4 +69,5 @@ interface MountedRoot {
|
|
|
69
69
|
*/
|
|
70
70
|
declare function mountRoot(element: ReactElement, options?: MountRootOptions): MountedRoot;
|
|
71
71
|
|
|
72
|
-
export {
|
|
72
|
+
export { destroyBridgeContext, getBridge, getRegistry, mountRoot, setBridgeFactory, setInitParams };
|
|
73
|
+
export type { InitParams, LumioBridge, MountRootOptions, MountedRoot };
|
package/dist/host.js
CHANGED
|
@@ -11,6 +11,9 @@ import { createElement } from "react";
|
|
|
11
11
|
import Reconciler from "react-reconciler";
|
|
12
12
|
import { HOST_METHODS } from "@zaflun/lumio-protocol";
|
|
13
13
|
|
|
14
|
+
// src/renderer/host-config.ts
|
|
15
|
+
import { createContext } from "react";
|
|
16
|
+
|
|
14
17
|
// src/renderer/reconciler.ts
|
|
15
18
|
var instanceCounter = 0;
|
|
16
19
|
var STRIP_PROPS = /* @__PURE__ */ new Set(["children", "key", "ref", "__self", "__source"]);
|
|
@@ -69,13 +72,25 @@ function treeFingerprint(nodes) {
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
// src/renderer/host-config.ts
|
|
72
|
-
var
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
+
var NoEventPriority = 0;
|
|
76
|
+
var DiscreteEventPriority = 2;
|
|
77
|
+
var DefaultEventPriority = 32;
|
|
78
|
+
var LegacyRoot = 0;
|
|
79
|
+
var RENDERER_PACKAGE_NAME = "@zaflun/lumio-sdk";
|
|
80
|
+
var RENDERER_VERSION = "0.11.1";
|
|
81
|
+
var HostTransitionContext = createContext(null);
|
|
75
82
|
function createHostConfig(registry, options = {}) {
|
|
76
83
|
const syncUpdates = options.syncUpdates === true;
|
|
77
|
-
let currentUpdatePriority =
|
|
84
|
+
let currentUpdatePriority = NoEventPriority;
|
|
78
85
|
return {
|
|
86
|
+
rendererVersion: RENDERER_VERSION,
|
|
87
|
+
rendererPackageName: RENDERER_PACKAGE_NAME,
|
|
88
|
+
extraDevToolsConfig: null,
|
|
89
|
+
// Replays Server Component console logs; Lumio has no Server Components.
|
|
90
|
+
bindToConsole() {
|
|
91
|
+
return () => {
|
|
92
|
+
};
|
|
93
|
+
},
|
|
79
94
|
supportsMutation: true,
|
|
80
95
|
supportsPersistence: false,
|
|
81
96
|
supportsHydration: false,
|
|
@@ -195,21 +210,22 @@ function createHostConfig(registry, options = {}) {
|
|
|
195
210
|
getInstanceFromScope() {
|
|
196
211
|
return null;
|
|
197
212
|
},
|
|
198
|
-
//
|
|
213
|
+
// Update priorities. The Worker runtime resolves every update to the
|
|
214
|
+
// default priority; `syncUpdates` tracks React's priority and resolves
|
|
215
|
+
// updates from outside React to the discrete (sync) one.
|
|
199
216
|
setCurrentUpdatePriority(priority) {
|
|
200
217
|
if (syncUpdates) currentUpdatePriority = priority;
|
|
201
218
|
},
|
|
202
219
|
getCurrentUpdatePriority() {
|
|
203
|
-
return syncUpdates ? currentUpdatePriority :
|
|
220
|
+
return syncUpdates ? currentUpdatePriority : DefaultEventPriority;
|
|
204
221
|
},
|
|
205
222
|
resolveUpdatePriority() {
|
|
206
|
-
if (!syncUpdates) return
|
|
207
|
-
return currentUpdatePriority !==
|
|
223
|
+
if (!syncUpdates) return DefaultEventPriority;
|
|
224
|
+
return currentUpdatePriority !== NoEventPriority ? currentUpdatePriority : DiscreteEventPriority;
|
|
208
225
|
},
|
|
209
|
-
//
|
|
226
|
+
// Form actions (not supported — the context only ever holds `null`)
|
|
210
227
|
NotPendingTransition: null,
|
|
211
|
-
|
|
212
|
-
HostTransitionContext: { $$typeof: /* @__PURE__ */ Symbol.for("react.context") },
|
|
228
|
+
HostTransitionContext,
|
|
213
229
|
// Form instance
|
|
214
230
|
resetFormInstance() {
|
|
215
231
|
},
|
|
@@ -220,20 +236,34 @@ function createHostConfig(registry, options = {}) {
|
|
|
220
236
|
shouldAttemptEagerTransition() {
|
|
221
237
|
return false;
|
|
222
238
|
},
|
|
223
|
-
//
|
|
239
|
+
// Suspensey commits. Lumio instances never suspend a commit, but React
|
|
240
|
+
// still calls `startSuspendingCommit` → `suspendOnActiveViewTransition` →
|
|
241
|
+
// `waitForCommitToBeReady` for every transition-lane commit.
|
|
224
242
|
maySuspendCommit() {
|
|
225
243
|
return false;
|
|
226
244
|
},
|
|
245
|
+
maySuspendCommitOnUpdate() {
|
|
246
|
+
return false;
|
|
247
|
+
},
|
|
248
|
+
maySuspendCommitInSyncRender() {
|
|
249
|
+
return false;
|
|
250
|
+
},
|
|
227
251
|
preloadInstance() {
|
|
228
252
|
return true;
|
|
229
253
|
},
|
|
230
254
|
startSuspendingCommit() {
|
|
255
|
+
return null;
|
|
231
256
|
},
|
|
232
257
|
suspendInstance() {
|
|
233
258
|
},
|
|
259
|
+
suspendOnActiveViewTransition() {
|
|
260
|
+
},
|
|
234
261
|
waitForCommitToBeReady() {
|
|
235
262
|
return null;
|
|
236
263
|
},
|
|
264
|
+
getSuspendedCommitReason() {
|
|
265
|
+
return null;
|
|
266
|
+
},
|
|
237
267
|
// Scheduler event tracking
|
|
238
268
|
trackSchedulerEvent() {
|
|
239
269
|
},
|
|
@@ -261,7 +291,6 @@ function mountRoot(element, options = {}) {
|
|
|
261
291
|
const bridge = getBridge();
|
|
262
292
|
const hostConfig = createHostConfig(registry, { syncUpdates: options.syncUpdates });
|
|
263
293
|
const reconciler = Reconciler(hostConfig);
|
|
264
|
-
const { flushSyncFromReconciler } = reconciler;
|
|
265
294
|
let lastFingerprint = "";
|
|
266
295
|
const container = {
|
|
267
296
|
children: [],
|
|
@@ -275,8 +304,7 @@ function mountRoot(element, options = {}) {
|
|
|
275
304
|
};
|
|
276
305
|
const root = reconciler.createContainer(
|
|
277
306
|
container,
|
|
278
|
-
|
|
279
|
-
// LegacyRoot tag
|
|
307
|
+
LegacyRoot,
|
|
280
308
|
null,
|
|
281
309
|
// hydration callbacks
|
|
282
310
|
false,
|
|
@@ -285,20 +313,20 @@ function mountRoot(element, options = {}) {
|
|
|
285
313
|
// concurrentUpdatesByDefaultOverride
|
|
286
314
|
"",
|
|
287
315
|
// identifierPrefix
|
|
288
|
-
(
|
|
289
|
-
console.error("[Lumio SDK] Uncaught error:",
|
|
316
|
+
(error) => {
|
|
317
|
+
console.error("[Lumio SDK] Uncaught error:", error);
|
|
290
318
|
},
|
|
291
|
-
(
|
|
292
|
-
console.error("[Lumio SDK] Caught error:",
|
|
319
|
+
(error) => {
|
|
320
|
+
console.error("[Lumio SDK] Caught error:", error);
|
|
293
321
|
},
|
|
294
|
-
(
|
|
295
|
-
console.error("[Lumio SDK] Recoverable error:",
|
|
322
|
+
(error) => {
|
|
323
|
+
console.error("[Lumio SDK] Recoverable error:", error);
|
|
296
324
|
},
|
|
297
325
|
() => {
|
|
298
326
|
},
|
|
299
327
|
// onDefaultTransitionIndicator
|
|
300
328
|
null
|
|
301
|
-
// transitionCallbacks
|
|
329
|
+
// transitionCallbacks (typed, but no longer read by 0.34)
|
|
302
330
|
);
|
|
303
331
|
const stopCallbacks = bridge.onNotification(HOST_METHODS.EVENT_CALLBACK, (params) => {
|
|
304
332
|
const { handlerId, args } = params;
|
|
@@ -309,7 +337,7 @@ function mountRoot(element, options = {}) {
|
|
|
309
337
|
});
|
|
310
338
|
const flushSync = (fn) => {
|
|
311
339
|
if (options.syncUpdates) {
|
|
312
|
-
flushSyncFromReconciler(fn);
|
|
340
|
+
reconciler.flushSyncFromReconciler(fn);
|
|
313
341
|
reconciler.flushPassiveEffects();
|
|
314
342
|
} else {
|
|
315
343
|
fn();
|
package/dist/index.d.ts
CHANGED
|
@@ -719,4 +719,5 @@ interface LocalFontDefinition {
|
|
|
719
719
|
}
|
|
720
720
|
declare function localFont(options: LocalFontOptions): LocalFontDefinition;
|
|
721
721
|
|
|
722
|
-
export { ANIMATION_PRESETS, Animated,
|
|
722
|
+
export { ANIMATION_PRESETS, Animated, Box, Button, CompactView, Dropdown, EditorButton, EditorChannelRow, EditorCheckbox, EditorColorPicker, EditorDivider, EditorFontPicker, EditorFontRow, EditorGroup, EditorInfo, EditorInput, EditorLabel, EditorSelect, EditorSlider, EditorTextarea, HStack, IconDisplay, IconPicker, Image, List, Lumio, NumberField, Slider, Text, TextArea, TextField, Toggle, VStack, WorkerBridge, defineKeyframes, flushKeyframes, getPreset, localFont, useAnimation, useEditorAction, useExtensionContext, useExtensionStorage, useIconPicker, useLumioAction, useLumioConfig, useLumioEvent, useLumioIdentity, useLumioSound, useLumioTheme, useMutation, useQuery, useRealtime, useVisionState };
|
|
723
|
+
export type { AnimatedProps, AnimationPresetName, BoxProps, ButtonProps, CompactViewProps, DropdownOption, DropdownProps, EditorButtonProps, EditorChannelRowProps, EditorCheckboxProps, EditorColorPickerProps, EditorFontPickerProps, EditorFontRowProps, EditorGroupProps, EditorInfoProps, EditorInputProps, EditorLabelProps, EditorSelectOption, EditorSelectProps, EditorSliderProps, EditorTextareaProps, ExtensionContext, FontDisplay, FontSource, HStackProps, IconDisplayProps, IconPickerProps, IconPickerSize, IconSource, IconValue, ImageProps, KeyframeBlock, KeyframeDefinition, ListProps, LocalFontDefinition, LocalFontOptions, LumioConfig, LumioIdentity, NumberFieldProps, OverlayTheme, RenderOptions, SliderProps, TextAreaProps, TextFieldProps, TextProps, ToggleProps, UseAnimationResult, UseIconPickerOptions, UseIconPickerResult, UseLumioActionResult, UseLumioSoundResult, UseMutationResult, UseQueryResult, VStackProps, VisionStyle };
|