@slowclap/rezi-core 0.1.0-fork.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/README.md +13 -0
- package/dist/abi.d.ts +72 -0
- package/dist/abi.d.ts.map +1 -0
- package/dist/abi.js +86 -0
- package/dist/abi.js.map +1 -0
- package/dist/animation/easing.d.ts +7 -0
- package/dist/animation/easing.d.ts.map +1 -0
- package/dist/animation/easing.js +68 -0
- package/dist/animation/easing.js.map +1 -0
- package/dist/animation/interpolate.d.ts +15 -0
- package/dist/animation/interpolate.d.ts.map +1 -0
- package/dist/animation/interpolate.js +53 -0
- package/dist/animation/interpolate.js.map +1 -0
- package/dist/animation/spring.d.ts +18 -0
- package/dist/animation/spring.d.ts.map +1 -0
- package/dist/animation/spring.js +84 -0
- package/dist/animation/spring.js.map +1 -0
- package/dist/animation/timeline.d.ts +27 -0
- package/dist/animation/timeline.d.ts.map +1 -0
- package/dist/animation/timeline.js +88 -0
- package/dist/animation/timeline.js.map +1 -0
- package/dist/animation/types.d.ts +96 -0
- package/dist/animation/types.d.ts.map +1 -0
- package/dist/animation/types.js +8 -0
- package/dist/animation/types.js.map +1 -0
- package/dist/app/createApp/breadcrumbs.d.ts +38 -0
- package/dist/app/createApp/breadcrumbs.d.ts.map +1 -0
- package/dist/app/createApp/breadcrumbs.js +65 -0
- package/dist/app/createApp/breadcrumbs.js.map +1 -0
- package/dist/app/createApp/config.d.ts +25 -0
- package/dist/app/createApp/config.d.ts.map +1 -0
- package/dist/app/createApp/config.js +130 -0
- package/dist/app/createApp/config.js.map +1 -0
- package/dist/app/createApp/dirtyPlan.d.ts +21 -0
- package/dist/app/createApp/dirtyPlan.d.ts.map +1 -0
- package/dist/app/createApp/dirtyPlan.js +54 -0
- package/dist/app/createApp/dirtyPlan.js.map +1 -0
- package/dist/app/createApp/eventLoop.d.ts +95 -0
- package/dist/app/createApp/eventLoop.d.ts.map +1 -0
- package/dist/app/createApp/eventLoop.js +357 -0
- package/dist/app/createApp/eventLoop.js.map +1 -0
- package/dist/app/createApp/focusDispatcher.d.ts +14 -0
- package/dist/app/createApp/focusDispatcher.d.ts.map +1 -0
- package/dist/app/createApp/focusDispatcher.js +39 -0
- package/dist/app/createApp/focusDispatcher.js.map +1 -0
- package/dist/app/createApp/guards.d.ts +21 -0
- package/dist/app/createApp/guards.d.ts.map +1 -0
- package/dist/app/createApp/guards.js +54 -0
- package/dist/app/createApp/guards.js.map +1 -0
- package/dist/app/createApp/keybindings.d.ts +27 -0
- package/dist/app/createApp/keybindings.d.ts.map +1 -0
- package/dist/app/createApp/keybindings.js +106 -0
- package/dist/app/createApp/keybindings.js.map +1 -0
- package/dist/app/createApp/renderLoop.d.ts +64 -0
- package/dist/app/createApp/renderLoop.d.ts.map +1 -0
- package/dist/app/createApp/renderLoop.js +305 -0
- package/dist/app/createApp/renderLoop.js.map +1 -0
- package/dist/app/createApp/runSignals.d.ts +23 -0
- package/dist/app/createApp/runSignals.d.ts.map +1 -0
- package/dist/app/createApp/runSignals.js +71 -0
- package/dist/app/createApp/runSignals.js.map +1 -0
- package/dist/app/createApp/topLevelViewError.d.ts +15 -0
- package/dist/app/createApp/topLevelViewError.d.ts.map +1 -0
- package/dist/app/createApp/topLevelViewError.js +87 -0
- package/dist/app/createApp/topLevelViewError.js.map +1 -0
- package/dist/app/createApp.d.ts +52 -0
- package/dist/app/createApp.d.ts.map +1 -0
- package/dist/app/createApp.js +931 -0
- package/dist/app/createApp.js.map +1 -0
- package/dist/app/inspectorOverlayHelper.d.ts +65 -0
- package/dist/app/inspectorOverlayHelper.d.ts.map +1 -0
- package/dist/app/inspectorOverlayHelper.js +200 -0
- package/dist/app/inspectorOverlayHelper.js.map +1 -0
- package/dist/app/rawRenderer.d.ts +59 -0
- package/dist/app/rawRenderer.d.ts.map +1 -0
- package/dist/app/rawRenderer.js +125 -0
- package/dist/app/rawRenderer.js.map +1 -0
- package/dist/app/runtimeBreadcrumbs.d.ts +114 -0
- package/dist/app/runtimeBreadcrumbs.d.ts.map +1 -0
- package/dist/app/runtimeBreadcrumbs.js +69 -0
- package/dist/app/runtimeBreadcrumbs.js.map +1 -0
- package/dist/app/stateMachine.d.ts +44 -0
- package/dist/app/stateMachine.d.ts.map +1 -0
- package/dist/app/stateMachine.js +76 -0
- package/dist/app/stateMachine.js.map +1 -0
- package/dist/app/turnScheduler.d.ts +43 -0
- package/dist/app/turnScheduler.d.ts.map +1 -0
- package/dist/app/turnScheduler.js +72 -0
- package/dist/app/turnScheduler.js.map +1 -0
- package/dist/app/types.d.ts +64 -0
- package/dist/app/types.d.ts.map +1 -0
- package/dist/app/types.js +2 -0
- package/dist/app/types.js.map +1 -0
- package/dist/app/updateQueue.d.ts +32 -0
- package/dist/app/updateQueue.d.ts.map +1 -0
- package/dist/app/updateQueue.js +37 -0
- package/dist/app/updateQueue.js.map +1 -0
- package/dist/app/widgetRenderer/animationTracks.d.ts +96 -0
- package/dist/app/widgetRenderer/animationTracks.d.ts.map +1 -0
- package/dist/app/widgetRenderer/animationTracks.js +346 -0
- package/dist/app/widgetRenderer/animationTracks.js.map +1 -0
- package/dist/app/widgetRenderer/codeEditorRouting.d.ts +8 -0
- package/dist/app/widgetRenderer/codeEditorRouting.d.ts.map +1 -0
- package/dist/app/widgetRenderer/codeEditorRouting.js +184 -0
- package/dist/app/widgetRenderer/codeEditorRouting.js.map +1 -0
- package/dist/app/widgetRenderer/commandPaletteRouting.d.ts +5 -0
- package/dist/app/widgetRenderer/commandPaletteRouting.d.ts.map +1 -0
- package/dist/app/widgetRenderer/commandPaletteRouting.js +143 -0
- package/dist/app/widgetRenderer/commandPaletteRouting.js.map +1 -0
- package/dist/app/widgetRenderer/constraintState.d.ts +98 -0
- package/dist/app/widgetRenderer/constraintState.d.ts.map +1 -0
- package/dist/app/widgetRenderer/constraintState.js +563 -0
- package/dist/app/widgetRenderer/constraintState.js.map +1 -0
- package/dist/app/widgetRenderer/cursorBreadcrumbs.d.ts +74 -0
- package/dist/app/widgetRenderer/cursorBreadcrumbs.d.ts.map +1 -0
- package/dist/app/widgetRenderer/cursorBreadcrumbs.js +273 -0
- package/dist/app/widgetRenderer/cursorBreadcrumbs.js.map +1 -0
- package/dist/app/widgetRenderer/damageTracking.d.ts +92 -0
- package/dist/app/widgetRenderer/damageTracking.d.ts.map +1 -0
- package/dist/app/widgetRenderer/damageTracking.js +513 -0
- package/dist/app/widgetRenderer/damageTracking.js.map +1 -0
- package/dist/app/widgetRenderer/devWarnings.d.ts +24 -0
- package/dist/app/widgetRenderer/devWarnings.d.ts.map +1 -0
- package/dist/app/widgetRenderer/devWarnings.js +86 -0
- package/dist/app/widgetRenderer/devWarnings.js.map +1 -0
- package/dist/app/widgetRenderer/fileNodeCache.d.ts +11 -0
- package/dist/app/widgetRenderer/fileNodeCache.d.ts.map +1 -0
- package/dist/app/widgetRenderer/fileNodeCache.js +65 -0
- package/dist/app/widgetRenderer/fileNodeCache.js.map +1 -0
- package/dist/app/widgetRenderer/filePickerRouting.d.ts +17 -0
- package/dist/app/widgetRenderer/filePickerRouting.d.ts.map +1 -0
- package/dist/app/widgetRenderer/filePickerRouting.js +202 -0
- package/dist/app/widgetRenderer/filePickerRouting.js.map +1 -0
- package/dist/app/widgetRenderer/focusState.d.ts +46 -0
- package/dist/app/widgetRenderer/focusState.d.ts.map +1 -0
- package/dist/app/widgetRenderer/focusState.js +122 -0
- package/dist/app/widgetRenderer/focusState.js.map +1 -0
- package/dist/app/widgetRenderer/inputEditing.d.ts +27 -0
- package/dist/app/widgetRenderer/inputEditing.d.ts.map +1 -0
- package/dist/app/widgetRenderer/inputEditing.js +146 -0
- package/dist/app/widgetRenderer/inputEditing.js.map +1 -0
- package/dist/app/widgetRenderer/keyboardRouting.d.ts +76 -0
- package/dist/app/widgetRenderer/keyboardRouting.d.ts.map +1 -0
- package/dist/app/widgetRenderer/keyboardRouting.js +595 -0
- package/dist/app/widgetRenderer/keyboardRouting.js.map +1 -0
- package/dist/app/widgetRenderer/mouseRouting.d.ts +256 -0
- package/dist/app/widgetRenderer/mouseRouting.d.ts.map +1 -0
- package/dist/app/widgetRenderer/mouseRouting.js +1283 -0
- package/dist/app/widgetRenderer/mouseRouting.js.map +1 -0
- package/dist/app/widgetRenderer/overlayShortcuts.d.ts +68 -0
- package/dist/app/widgetRenderer/overlayShortcuts.d.ts.map +1 -0
- package/dist/app/widgetRenderer/overlayShortcuts.js +167 -0
- package/dist/app/widgetRenderer/overlayShortcuts.js.map +1 -0
- package/dist/app/widgetRenderer/overlayState.d.ts +198 -0
- package/dist/app/widgetRenderer/overlayState.d.ts.map +1 -0
- package/dist/app/widgetRenderer/overlayState.js +590 -0
- package/dist/app/widgetRenderer/overlayState.js.map +1 -0
- package/dist/app/widgetRenderer/renderCaches.d.ts +55 -0
- package/dist/app/widgetRenderer/renderCaches.d.ts.map +1 -0
- package/dist/app/widgetRenderer/renderCaches.js +219 -0
- package/dist/app/widgetRenderer/renderCaches.js.map +1 -0
- package/dist/app/widgetRenderer/routeEngineEvent.d.ts +189 -0
- package/dist/app/widgetRenderer/routeEngineEvent.d.ts.map +1 -0
- package/dist/app/widgetRenderer/routeEngineEvent.js +527 -0
- package/dist/app/widgetRenderer/routeEngineEvent.js.map +1 -0
- package/dist/app/widgetRenderer/submitFramePipeline.d.ts +18 -0
- package/dist/app/widgetRenderer/submitFramePipeline.d.ts.map +1 -0
- package/dist/app/widgetRenderer/submitFramePipeline.js +759 -0
- package/dist/app/widgetRenderer/submitFramePipeline.js.map +1 -0
- package/dist/app/widgetRenderer/toolApprovalRouting.d.ts +5 -0
- package/dist/app/widgetRenderer/toolApprovalRouting.d.ts.map +1 -0
- package/dist/app/widgetRenderer/toolApprovalRouting.js +56 -0
- package/dist/app/widgetRenderer/toolApprovalRouting.js.map +1 -0
- package/dist/app/widgetRenderer.d.ts +471 -0
- package/dist/app/widgetRenderer.d.ts.map +1 -0
- package/dist/app/widgetRenderer.js +2706 -0
- package/dist/app/widgetRenderer.js.map +1 -0
- package/dist/backend.d.ts +145 -0
- package/dist/backend.d.ts.map +1 -0
- package/dist/backend.js +41 -0
- package/dist/backend.js.map +1 -0
- package/dist/binary/parseError.d.ts +37 -0
- package/dist/binary/parseError.d.ts.map +1 -0
- package/dist/binary/parseError.js +33 -0
- package/dist/binary/parseError.js.map +1 -0
- package/dist/binary/reader.d.ts +52 -0
- package/dist/binary/reader.d.ts.map +1 -0
- package/dist/binary/reader.js +107 -0
- package/dist/binary/reader.js.map +1 -0
- package/dist/binary/writer.d.ts +59 -0
- package/dist/binary/writer.d.ts.map +1 -0
- package/dist/binary/writer.js +114 -0
- package/dist/binary/writer.js.map +1 -0
- package/dist/constraints/expr.d.ts +9 -0
- package/dist/constraints/expr.d.ts.map +1 -0
- package/dist/constraints/expr.js +134 -0
- package/dist/constraints/expr.js.map +1 -0
- package/dist/constraints/graph.d.ts +62 -0
- package/dist/constraints/graph.d.ts.map +1 -0
- package/dist/constraints/graph.js +359 -0
- package/dist/constraints/graph.js.map +1 -0
- package/dist/constraints/helpers.d.ts +191 -0
- package/dist/constraints/helpers.d.ts.map +1 -0
- package/dist/constraints/helpers.js +483 -0
- package/dist/constraints/helpers.js.map +1 -0
- package/dist/constraints/parser.d.ts +19 -0
- package/dist/constraints/parser.d.ts.map +1 -0
- package/dist/constraints/parser.js +522 -0
- package/dist/constraints/parser.js.map +1 -0
- package/dist/constraints/resolver.d.ts +70 -0
- package/dist/constraints/resolver.d.ts.map +1 -0
- package/dist/constraints/resolver.js +444 -0
- package/dist/constraints/resolver.js.map +1 -0
- package/dist/constraints/types.d.ts +65 -0
- package/dist/constraints/types.d.ts.map +1 -0
- package/dist/constraints/types.js +7 -0
- package/dist/constraints/types.js.map +1 -0
- package/dist/cursor/cursorState.d.ts +89 -0
- package/dist/cursor/cursorState.d.ts.map +1 -0
- package/dist/cursor/cursorState.js +82 -0
- package/dist/cursor/cursorState.js.map +1 -0
- package/dist/cursor/index.d.ts +9 -0
- package/dist/cursor/index.d.ts.map +1 -0
- package/dist/cursor/index.js +9 -0
- package/dist/cursor/index.js.map +1 -0
- package/dist/debug/constants.d.ts +100 -0
- package/dist/debug/constants.d.ts.map +1 -0
- package/dist/debug/constants.js +183 -0
- package/dist/debug/constants.js.map +1 -0
- package/dist/debug/debug.d.ts +14 -0
- package/dist/debug/debug.d.ts.map +1 -0
- package/dist/debug/debug.js +54 -0
- package/dist/debug/debug.js.map +1 -0
- package/dist/debug/debugController.d.ts +164 -0
- package/dist/debug/debugController.d.ts.map +1 -0
- package/dist/debug/debugController.js +474 -0
- package/dist/debug/debugController.js.map +1 -0
- package/dist/debug/describeThrown.d.ts +2 -0
- package/dist/debug/describeThrown.d.ts.map +1 -0
- package/dist/debug/describeThrown.js +11 -0
- package/dist/debug/describeThrown.js.map +1 -0
- package/dist/debug/errorAggregator.d.ts +89 -0
- package/dist/debug/errorAggregator.d.ts.map +1 -0
- package/dist/debug/errorAggregator.js +150 -0
- package/dist/debug/errorAggregator.js.map +1 -0
- package/dist/debug/eventTrace.d.ts +90 -0
- package/dist/debug/eventTrace.d.ts.map +1 -0
- package/dist/debug/eventTrace.js +153 -0
- package/dist/debug/eventTrace.js.map +1 -0
- package/dist/debug/frameInspector.d.ts +88 -0
- package/dist/debug/frameInspector.d.ts.map +1 -0
- package/dist/debug/frameInspector.js +140 -0
- package/dist/debug/frameInspector.js.map +1 -0
- package/dist/debug/index.d.ts +25 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +58 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/parsers.d.ts +138 -0
- package/dist/debug/parsers.d.ts.map +1 -0
- package/dist/debug/parsers.js +397 -0
- package/dist/debug/parsers.js.map +1 -0
- package/dist/debug/stateTimeline.d.ts +73 -0
- package/dist/debug/stateTimeline.d.ts.map +1 -0
- package/dist/debug/stateTimeline.js +109 -0
- package/dist/debug/stateTimeline.js.map +1 -0
- package/dist/debug/types.d.ts +386 -0
- package/dist/debug/types.d.ts.map +1 -0
- package/dist/debug/types.js +13 -0
- package/dist/debug/types.js.map +1 -0
- package/dist/drawApi.d.ts +74 -0
- package/dist/drawApi.d.ts.map +1 -0
- package/dist/drawApi.js +6 -0
- package/dist/drawApi.js.map +1 -0
- package/dist/drawlist/builder.d.ts +5 -0
- package/dist/drawlist/builder.d.ts.map +1 -0
- package/dist/drawlist/builder.js +745 -0
- package/dist/drawlist/builder.js.map +1 -0
- package/dist/drawlist/builderBase.d.ts +132 -0
- package/dist/drawlist/builderBase.d.ts.map +1 -0
- package/dist/drawlist/builderBase.js +879 -0
- package/dist/drawlist/builderBase.js.map +1 -0
- package/dist/drawlist/index.d.ts +12 -0
- package/dist/drawlist/index.d.ts.map +1 -0
- package/dist/drawlist/index.js +11 -0
- package/dist/drawlist/index.js.map +1 -0
- package/dist/drawlist/textArena.d.ts +38 -0
- package/dist/drawlist/textArena.d.ts.map +1 -0
- package/dist/drawlist/textArena.js +101 -0
- package/dist/drawlist/textArena.js.map +1 -0
- package/dist/drawlist/types.d.ts +75 -0
- package/dist/drawlist/types.d.ts.map +1 -0
- package/dist/drawlist/types.js +5 -0
- package/dist/drawlist/types.js.map +1 -0
- package/dist/drawlist/writers.gen.d.ts +30 -0
- package/dist/drawlist/writers.gen.d.ts.map +1 -0
- package/dist/drawlist/writers.gen.js +240 -0
- package/dist/drawlist/writers.gen.js.map +1 -0
- package/dist/events.d.ts +58 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +7 -0
- package/dist/events.js.map +1 -0
- package/dist/focus/styles.d.ts +213 -0
- package/dist/focus/styles.d.ts.map +1 -0
- package/dist/focus/styles.js +267 -0
- package/dist/focus/styles.js.map +1 -0
- package/dist/forms/bind.d.ts +15 -0
- package/dist/forms/bind.d.ts.map +1 -0
- package/dist/forms/bind.js +96 -0
- package/dist/forms/bind.js.map +1 -0
- package/dist/forms/index.d.ts +10 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +9 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/forms/internal/arrayState.d.ts +35 -0
- package/dist/forms/internal/arrayState.d.ts.map +1 -0
- package/dist/forms/internal/arrayState.js +238 -0
- package/dist/forms/internal/arrayState.js.map +1 -0
- package/dist/forms/internal/bindings.d.ts +46 -0
- package/dist/forms/internal/bindings.d.ts.map +1 -0
- package/dist/forms/internal/bindings.js +161 -0
- package/dist/forms/internal/bindings.js.map +1 -0
- package/dist/forms/internal/dev.d.ts +4 -0
- package/dist/forms/internal/dev.d.ts.map +1 -0
- package/dist/forms/internal/dev.js +21 -0
- package/dist/forms/internal/dev.js.map +1 -0
- package/dist/forms/internal/state.d.ts +52 -0
- package/dist/forms/internal/state.d.ts.map +1 -0
- package/dist/forms/internal/state.js +240 -0
- package/dist/forms/internal/state.js.map +1 -0
- package/dist/forms/internal/submit.d.ts +43 -0
- package/dist/forms/internal/submit.d.ts.map +1 -0
- package/dist/forms/internal/submit.js +165 -0
- package/dist/forms/internal/submit.js.map +1 -0
- package/dist/forms/internal/wizard.d.ts +53 -0
- package/dist/forms/internal/wizard.d.ts.map +1 -0
- package/dist/forms/internal/wizard.js +311 -0
- package/dist/forms/internal/wizard.js.map +1 -0
- package/dist/forms/types.d.ts +256 -0
- package/dist/forms/types.d.ts.map +1 -0
- package/dist/forms/types.js +10 -0
- package/dist/forms/types.js.map +1 -0
- package/dist/forms/useForm.d.ts +16 -0
- package/dist/forms/useForm.d.ts.map +1 -0
- package/dist/forms/useForm.js +185 -0
- package/dist/forms/useForm.js.map +1 -0
- package/dist/forms/validation.d.ts +68 -0
- package/dist/forms/validation.d.ts.map +1 -0
- package/dist/forms/validation.js +151 -0
- package/dist/forms/validation.js.map +1 -0
- package/dist/icons/index.d.ts +6 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +10 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/registry.d.ts +1452 -0
- package/dist/icons/registry.d.ts.map +1 -0
- package/dist/icons/registry.js +192 -0
- package/dist/icons/registry.js.map +1 -0
- package/dist/icons/resolveGlyph.d.ts +23 -0
- package/dist/icons/resolveGlyph.d.ts.map +1 -0
- package/dist/icons/resolveGlyph.js +92 -0
- package/dist/icons/resolveGlyph.js.map +1 -0
- package/dist/index.d.ts +141 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +260 -0
- package/dist/index.js.map +1 -0
- package/dist/keybindings/chordMatcher.d.ts +75 -0
- package/dist/keybindings/chordMatcher.d.ts.map +1 -0
- package/dist/keybindings/chordMatcher.js +224 -0
- package/dist/keybindings/chordMatcher.js.map +1 -0
- package/dist/keybindings/index.d.ts +16 -0
- package/dist/keybindings/index.d.ts.map +1 -0
- package/dist/keybindings/index.js +31 -0
- package/dist/keybindings/index.js.map +1 -0
- package/dist/keybindings/keyCodes.d.ts +84 -0
- package/dist/keybindings/keyCodes.d.ts.map +1 -0
- package/dist/keybindings/keyCodes.js +182 -0
- package/dist/keybindings/keyCodes.js.map +1 -0
- package/dist/keybindings/manager.d.ts +197 -0
- package/dist/keybindings/manager.d.ts.map +1 -0
- package/dist/keybindings/manager.js +448 -0
- package/dist/keybindings/manager.js.map +1 -0
- package/dist/keybindings/parser.d.ts +71 -0
- package/dist/keybindings/parser.d.ts.map +1 -0
- package/dist/keybindings/parser.js +296 -0
- package/dist/keybindings/parser.js.map +1 -0
- package/dist/keybindings/types.d.ts +133 -0
- package/dist/keybindings/types.d.ts.map +1 -0
- package/dist/keybindings/types.js +11 -0
- package/dist/keybindings/types.js.map +1 -0
- package/dist/layout/constraints.d.ts +76 -0
- package/dist/layout/constraints.d.ts.map +1 -0
- package/dist/layout/constraints.js +236 -0
- package/dist/layout/constraints.js.map +1 -0
- package/dist/layout/dropdownGeometry.d.ts +15 -0
- package/dist/layout/dropdownGeometry.d.ts.map +1 -0
- package/dist/layout/dropdownGeometry.js +79 -0
- package/dist/layout/dropdownGeometry.js.map +1 -0
- package/dist/layout/engine/bounds.d.ts +7 -0
- package/dist/layout/engine/bounds.d.ts.map +1 -0
- package/dist/layout/engine/bounds.js +25 -0
- package/dist/layout/engine/bounds.js.map +1 -0
- package/dist/layout/engine/dirtySet.d.ts +9 -0
- package/dist/layout/engine/dirtySet.d.ts.map +1 -0
- package/dist/layout/engine/dirtySet.js +67 -0
- package/dist/layout/engine/dirtySet.js.map +1 -0
- package/dist/layout/engine/distributeInteger.d.ts +9 -0
- package/dist/layout/engine/distributeInteger.d.ts.map +1 -0
- package/dist/layout/engine/distributeInteger.js +62 -0
- package/dist/layout/engine/distributeInteger.js.map +1 -0
- package/dist/layout/engine/flex.d.ts +25 -0
- package/dist/layout/engine/flex.d.ts.map +1 -0
- package/dist/layout/engine/flex.js +305 -0
- package/dist/layout/engine/flex.js.map +1 -0
- package/dist/layout/engine/guards.d.ts +20 -0
- package/dist/layout/engine/guards.d.ts.map +1 -0
- package/dist/layout/engine/guards.js +51 -0
- package/dist/layout/engine/guards.js.map +1 -0
- package/dist/layout/engine/intrinsic.d.ts +8 -0
- package/dist/layout/engine/intrinsic.d.ts.map +1 -0
- package/dist/layout/engine/intrinsic.js +391 -0
- package/dist/layout/engine/intrinsic.js.map +1 -0
- package/dist/layout/engine/layoutEngine.d.ts +52 -0
- package/dist/layout/engine/layoutEngine.d.ts.map +1 -0
- package/dist/layout/engine/layoutEngine.js +969 -0
- package/dist/layout/engine/layoutEngine.js.map +1 -0
- package/dist/layout/engine/layoutTree.d.ts +6 -0
- package/dist/layout/engine/layoutTree.d.ts.map +1 -0
- package/dist/layout/engine/layoutTree.js +16 -0
- package/dist/layout/engine/layoutTree.js.map +1 -0
- package/dist/layout/engine/pool.d.ts +10 -0
- package/dist/layout/engine/pool.d.ts.map +1 -0
- package/dist/layout/engine/pool.js +39 -0
- package/dist/layout/engine/pool.js.map +1 -0
- package/dist/layout/engine/result.d.ts +3 -0
- package/dist/layout/engine/result.d.ts.map +1 -0
- package/dist/layout/engine/result.js +4 -0
- package/dist/layout/engine/result.js.map +1 -0
- package/dist/layout/engine/types.d.ts +15 -0
- package/dist/layout/engine/types.d.ts.map +1 -0
- package/dist/layout/engine/types.js +2 -0
- package/dist/layout/engine/types.js.map +1 -0
- package/dist/layout/hitTest.d.ts +35 -0
- package/dist/layout/hitTest.d.ts.map +1 -0
- package/dist/layout/hitTest.js +255 -0
- package/dist/layout/hitTest.js.map +1 -0
- package/dist/layout/kinds/box.d.ts +10 -0
- package/dist/layout/kinds/box.d.ts.map +1 -0
- package/dist/layout/kinds/box.js +237 -0
- package/dist/layout/kinds/box.js.map +1 -0
- package/dist/layout/kinds/collections.d.ts +7 -0
- package/dist/layout/kinds/collections.d.ts.map +1 -0
- package/dist/layout/kinds/collections.js +137 -0
- package/dist/layout/kinds/collections.js.map +1 -0
- package/dist/layout/kinds/grid.d.ts +10 -0
- package/dist/layout/kinds/grid.d.ts.map +1 -0
- package/dist/layout/kinds/grid.js +564 -0
- package/dist/layout/kinds/grid.js.map +1 -0
- package/dist/layout/kinds/leaf.d.ts +7 -0
- package/dist/layout/kinds/leaf.d.ts.map +1 -0
- package/dist/layout/kinds/leaf.js +536 -0
- package/dist/layout/kinds/leaf.js.map +1 -0
- package/dist/layout/kinds/navigation.d.ts +10 -0
- package/dist/layout/kinds/navigation.d.ts.map +1 -0
- package/dist/layout/kinds/navigation.js +59 -0
- package/dist/layout/kinds/navigation.js.map +1 -0
- package/dist/layout/kinds/overlays.d.ts +10 -0
- package/dist/layout/kinds/overlays.d.ts.map +1 -0
- package/dist/layout/kinds/overlays.js +423 -0
- package/dist/layout/kinds/overlays.js.map +1 -0
- package/dist/layout/kinds/splitPane.d.ts +9 -0
- package/dist/layout/kinds/splitPane.d.ts.map +1 -0
- package/dist/layout/kinds/splitPane.js +251 -0
- package/dist/layout/kinds/splitPane.js.map +1 -0
- package/dist/layout/kinds/stack.d.ts +8 -0
- package/dist/layout/kinds/stack.d.ts.map +1 -0
- package/dist/layout/kinds/stack.js +33 -0
- package/dist/layout/kinds/stack.js.map +1 -0
- package/dist/layout/kinds/stackParts/axis.d.ts +32 -0
- package/dist/layout/kinds/stackParts/axis.d.ts.map +1 -0
- package/dist/layout/kinds/stackParts/axis.js +61 -0
- package/dist/layout/kinds/stackParts/axis.js.map +1 -0
- package/dist/layout/kinds/stackParts/constraintPlan.d.ts +18 -0
- package/dist/layout/kinds/stackParts/constraintPlan.d.ts.map +1 -0
- package/dist/layout/kinds/stackParts/constraintPlan.js +434 -0
- package/dist/layout/kinds/stackParts/constraintPlan.js.map +1 -0
- package/dist/layout/kinds/stackParts/layout.d.ts +6 -0
- package/dist/layout/kinds/stackParts/layout.d.ts.map +1 -0
- package/dist/layout/kinds/stackParts/layout.js +376 -0
- package/dist/layout/kinds/stackParts/layout.js.map +1 -0
- package/dist/layout/kinds/stackParts/measure.d.ts +6 -0
- package/dist/layout/kinds/stackParts/measure.d.ts.map +1 -0
- package/dist/layout/kinds/stackParts/measure.js +212 -0
- package/dist/layout/kinds/stackParts/measure.js.map +1 -0
- package/dist/layout/kinds/stackParts/shared.d.ts +31 -0
- package/dist/layout/kinds/stackParts/shared.d.ts.map +1 -0
- package/dist/layout/kinds/stackParts/shared.js +94 -0
- package/dist/layout/kinds/stackParts/shared.js.map +1 -0
- package/dist/layout/kinds/stackParts/wrap.d.ts +26 -0
- package/dist/layout/kinds/stackParts/wrap.d.ts.map +1 -0
- package/dist/layout/kinds/stackParts/wrap.js +374 -0
- package/dist/layout/kinds/stackParts/wrap.js.map +1 -0
- package/dist/layout/layout.d.ts +11 -0
- package/dist/layout/layout.d.ts.map +1 -0
- package/dist/layout/layout.js +10 -0
- package/dist/layout/layout.js.map +1 -0
- package/dist/layout/positioning.d.ts +124 -0
- package/dist/layout/positioning.d.ts.map +1 -0
- package/dist/layout/positioning.js +234 -0
- package/dist/layout/positioning.js.map +1 -0
- package/dist/layout/responsive.d.ts +33 -0
- package/dist/layout/responsive.d.ts.map +1 -0
- package/dist/layout/responsive.js +145 -0
- package/dist/layout/responsive.js.map +1 -0
- package/dist/layout/spacing-scale.d.ts +62 -0
- package/dist/layout/spacing-scale.d.ts.map +1 -0
- package/dist/layout/spacing-scale.js +86 -0
- package/dist/layout/spacing-scale.js.map +1 -0
- package/dist/layout/spacing.d.ts +46 -0
- package/dist/layout/spacing.d.ts.map +1 -0
- package/dist/layout/spacing.js +57 -0
- package/dist/layout/spacing.js.map +1 -0
- package/dist/layout/textMeasure.d.ts +118 -0
- package/dist/layout/textMeasure.d.ts.map +1 -0
- package/dist/layout/textMeasure.js +603 -0
- package/dist/layout/textMeasure.js.map +1 -0
- package/dist/layout/types.d.ts +78 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/layout/types.js +2 -0
- package/dist/layout/types.js.map +1 -0
- package/dist/layout/unicode/props.d.ts +23 -0
- package/dist/layout/unicode/props.d.ts.map +1 -0
- package/dist/layout/unicode/props.js +80 -0
- package/dist/layout/unicode/props.js.map +1 -0
- package/dist/layout/unicode/tables_15_1_0.d.ts +11 -0
- package/dist/layout/unicode/tables_15_1_0.d.ts.map +1 -0
- package/dist/layout/unicode/tables_15_1_0.js +416 -0
- package/dist/layout/unicode/tables_15_1_0.js.map +1 -0
- package/dist/layout/validate/interactive.d.ts +106 -0
- package/dist/layout/validate/interactive.d.ts.map +1 -0
- package/dist/layout/validate/interactive.js +430 -0
- package/dist/layout/validate/interactive.js.map +1 -0
- package/dist/layout/validate/layoutConstraints.d.ts +51 -0
- package/dist/layout/validate/layoutConstraints.d.ts.map +1 -0
- package/dist/layout/validate/layoutConstraints.js +100 -0
- package/dist/layout/validate/layoutConstraints.js.map +1 -0
- package/dist/layout/validate/primitives.d.ts +31 -0
- package/dist/layout/validate/primitives.d.ts.map +1 -0
- package/dist/layout/validate/primitives.js +299 -0
- package/dist/layout/validate/primitives.js.map +1 -0
- package/dist/layout/validate/shared.d.ts +23 -0
- package/dist/layout/validate/shared.d.ts.map +1 -0
- package/dist/layout/validate/shared.js +32 -0
- package/dist/layout/validate/shared.js.map +1 -0
- package/dist/layout/validate/spacing.d.ts +21 -0
- package/dist/layout/validate/spacing.d.ts.map +1 -0
- package/dist/layout/validate/spacing.js +33 -0
- package/dist/layout/validate/spacing.js.map +1 -0
- package/dist/layout/validateProps.d.ts +23 -0
- package/dist/layout/validateProps.d.ts.map +1 -0
- package/dist/layout/validateProps.js +19 -0
- package/dist/layout/validateProps.js.map +1 -0
- package/dist/perf/frameAudit.d.ts +27 -0
- package/dist/perf/frameAudit.d.ts.map +1 -0
- package/dist/perf/frameAudit.js +152 -0
- package/dist/perf/frameAudit.js.map +1 -0
- package/dist/perf/index.d.ts +5 -0
- package/dist/perf/index.d.ts.map +1 -0
- package/dist/perf/index.js +5 -0
- package/dist/perf/index.js.map +1 -0
- package/dist/perf/perf.d.ts +74 -0
- package/dist/perf/perf.d.ts.map +1 -0
- package/dist/perf/perf.js +250 -0
- package/dist/perf/perf.js.map +1 -0
- package/dist/pipeline.d.ts +21 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +25 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/protocol/mouseKinds.d.ts +6 -0
- package/dist/protocol/mouseKinds.d.ts.map +1 -0
- package/dist/protocol/mouseKinds.js +6 -0
- package/dist/protocol/mouseKinds.js.map +1 -0
- package/dist/protocol/types.d.ts +119 -0
- package/dist/protocol/types.d.ts.map +1 -0
- package/dist/protocol/types.js +14 -0
- package/dist/protocol/types.js.map +1 -0
- package/dist/protocol/zrev_v1.d.ts +52 -0
- package/dist/protocol/zrev_v1.d.ts.map +1 -0
- package/dist/protocol/zrev_v1.js +288 -0
- package/dist/protocol/zrev_v1.js.map +1 -0
- package/dist/renderer/boxGlyphs.d.ts +87 -0
- package/dist/renderer/boxGlyphs.d.ts.map +1 -0
- package/dist/renderer/boxGlyphs.js +143 -0
- package/dist/renderer/boxGlyphs.js.map +1 -0
- package/dist/renderer/renderToDrawlist/boxBorder.d.ts +49 -0
- package/dist/renderer/renderToDrawlist/boxBorder.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/boxBorder.js +201 -0
- package/dist/renderer/renderToDrawlist/boxBorder.js.map +1 -0
- package/dist/renderer/renderToDrawlist/damageBounds.d.ts +4 -0
- package/dist/renderer/renderToDrawlist/damageBounds.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/damageBounds.js +28 -0
- package/dist/renderer/renderToDrawlist/damageBounds.js.map +1 -0
- package/dist/renderer/renderToDrawlist/indices.d.ts +11 -0
- package/dist/renderer/renderToDrawlist/indices.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/indices.js +50 -0
- package/dist/renderer/renderToDrawlist/indices.js.map +1 -0
- package/dist/renderer/renderToDrawlist/renderPackets.d.ts +43 -0
- package/dist/renderer/renderToDrawlist/renderPackets.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/renderPackets.js +574 -0
- package/dist/renderer/renderToDrawlist/renderPackets.js.map +1 -0
- package/dist/renderer/renderToDrawlist/renderTree.d.ts +28 -0
- package/dist/renderer/renderToDrawlist/renderTree.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/renderTree.js +263 -0
- package/dist/renderer/renderToDrawlist/renderTree.js.map +1 -0
- package/dist/renderer/renderToDrawlist/simpleVNode.d.ts +14 -0
- package/dist/renderer/renderToDrawlist/simpleVNode.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/simpleVNode.js +770 -0
- package/dist/renderer/renderToDrawlist/simpleVNode.js.map +1 -0
- package/dist/renderer/renderToDrawlist/spacing.d.ts +34 -0
- package/dist/renderer/renderToDrawlist/spacing.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/spacing.js +71 -0
- package/dist/renderer/renderToDrawlist/spacing.js.map +1 -0
- package/dist/renderer/renderToDrawlist/textStyle.d.ts +14 -0
- package/dist/renderer/renderToDrawlist/textStyle.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/textStyle.js +205 -0
- package/dist/renderer/renderToDrawlist/textStyle.js.map +1 -0
- package/dist/renderer/renderToDrawlist/themeTokens.d.ts +14 -0
- package/dist/renderer/renderToDrawlist/themeTokens.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/themeTokens.js +34 -0
- package/dist/renderer/renderToDrawlist/themeTokens.js.map +1 -0
- package/dist/renderer/renderToDrawlist/types.d.ts +114 -0
- package/dist/renderer/renderToDrawlist/types.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/types.js +2 -0
- package/dist/renderer/renderToDrawlist/types.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/basic.d.ts +17 -0
- package/dist/renderer/renderToDrawlist/widgets/basic.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/basic.js +95 -0
- package/dist/renderer/renderToDrawlist/widgets/basic.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/collections.d.ts +11 -0
- package/dist/renderer/renderToDrawlist/widgets/collections.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/collections.js +667 -0
- package/dist/renderer/renderToDrawlist/widgets/collections.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/containers.d.ts +13 -0
- package/dist/renderer/renderToDrawlist/widgets/containers.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/containers.js +695 -0
- package/dist/renderer/renderToDrawlist/widgets/containers.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/editors.d.ts +17 -0
- package/dist/renderer/renderToDrawlist/widgets/editors.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/editors.js +790 -0
- package/dist/renderer/renderToDrawlist/widgets/editors.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/files.d.ts +14 -0
- package/dist/renderer/renderToDrawlist/widgets/files.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/files.js +346 -0
- package/dist/renderer/renderToDrawlist/widgets/files.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/focusConfig.d.ts +15 -0
- package/dist/renderer/renderToDrawlist/widgets/focusConfig.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/focusConfig.js +78 -0
- package/dist/renderer/renderToDrawlist/widgets/focusConfig.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/navigation.d.ts +10 -0
- package/dist/renderer/renderToDrawlist/widgets/navigation.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/navigation.js +185 -0
- package/dist/renderer/renderToDrawlist/widgets/navigation.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/overlays.d.ts +21 -0
- package/dist/renderer/renderToDrawlist/widgets/overlays.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/overlays.js +545 -0
- package/dist/renderer/renderToDrawlist/widgets/overlays.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderCanvasWidgets.d.ts +14 -0
- package/dist/renderer/renderToDrawlist/widgets/renderCanvasWidgets.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderCanvasWidgets.js +318 -0
- package/dist/renderer/renderToDrawlist/widgets/renderCanvasWidgets.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderChartWidgets.d.ts +9 -0
- package/dist/renderer/renderToDrawlist/widgets/renderChartWidgets.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderChartWidgets.js +519 -0
- package/dist/renderer/renderToDrawlist/widgets/renderChartWidgets.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderFormWidgets.d.ts +18 -0
- package/dist/renderer/renderToDrawlist/widgets/renderFormWidgets.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderFormWidgets.js +939 -0
- package/dist/renderer/renderToDrawlist/widgets/renderFormWidgets.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderIndicatorWidgets.d.ts +9 -0
- package/dist/renderer/renderToDrawlist/widgets/renderIndicatorWidgets.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderIndicatorWidgets.js +565 -0
- package/dist/renderer/renderToDrawlist/widgets/renderIndicatorWidgets.js.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderTextWidgets.d.ts +32 -0
- package/dist/renderer/renderToDrawlist/widgets/renderTextWidgets.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist/widgets/renderTextWidgets.js +893 -0
- package/dist/renderer/renderToDrawlist/widgets/renderTextWidgets.js.map +1 -0
- package/dist/renderer/renderToDrawlist.d.ts +13 -0
- package/dist/renderer/renderToDrawlist.d.ts.map +1 -0
- package/dist/renderer/renderToDrawlist.js +42 -0
- package/dist/renderer/renderToDrawlist.js.map +1 -0
- package/dist/renderer/scrollbar.d.ts +129 -0
- package/dist/renderer/scrollbar.d.ts.map +1 -0
- package/dist/renderer/scrollbar.js +219 -0
- package/dist/renderer/scrollbar.js.map +1 -0
- package/dist/renderer/shadow.d.ts +88 -0
- package/dist/renderer/shadow.d.ts.map +1 -0
- package/dist/renderer/shadow.js +167 -0
- package/dist/renderer/shadow.js.map +1 -0
- package/dist/renderer/styles.d.ts +19 -0
- package/dist/renderer/styles.d.ts.map +1 -0
- package/dist/renderer/styles.js +51 -0
- package/dist/renderer/styles.js.map +1 -0
- package/dist/repro/constants.d.ts +23 -0
- package/dist/repro/constants.d.ts.map +1 -0
- package/dist/repro/constants.js +23 -0
- package/dist/repro/constants.js.map +1 -0
- package/dist/repro/index.d.ts +10 -0
- package/dist/repro/index.d.ts.map +1 -0
- package/dist/repro/index.js +8 -0
- package/dist/repro/index.js.map +1 -0
- package/dist/repro/replay.d.ts +126 -0
- package/dist/repro/replay.d.ts.map +1 -0
- package/dist/repro/replay.js +612 -0
- package/dist/repro/replay.js.map +1 -0
- package/dist/repro/schema.d.ts +21 -0
- package/dist/repro/schema.d.ts.map +1 -0
- package/dist/repro/schema.js +750 -0
- package/dist/repro/schema.js.map +1 -0
- package/dist/repro/stable.d.ts +19 -0
- package/dist/repro/stable.d.ts.map +1 -0
- package/dist/repro/stable.js +53 -0
- package/dist/repro/stable.js.map +1 -0
- package/dist/repro/types.d.ts +141 -0
- package/dist/repro/types.d.ts.map +1 -0
- package/dist/repro/types.js +8 -0
- package/dist/repro/types.js.map +1 -0
- package/dist/router/helpers.d.ts +47 -0
- package/dist/router/helpers.d.ts.map +1 -0
- package/dist/router/helpers.js +108 -0
- package/dist/router/helpers.js.map +1 -0
- package/dist/router/index.d.ts +6 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/index.js +5 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/integration.d.ts +31 -0
- package/dist/router/integration.d.ts.map +1 -0
- package/dist/router/integration.js +256 -0
- package/dist/router/integration.js.map +1 -0
- package/dist/router/keybindings.d.ts +25 -0
- package/dist/router/keybindings.d.ts.map +1 -0
- package/dist/router/keybindings.js +53 -0
- package/dist/router/keybindings.js.map +1 -0
- package/dist/router/router.d.ts +66 -0
- package/dist/router/router.d.ts.map +1 -0
- package/dist/router/router.js +249 -0
- package/dist/router/router.js.map +1 -0
- package/dist/router/types.d.ts +114 -0
- package/dist/router/types.d.ts.map +1 -0
- package/dist/router/types.js +2 -0
- package/dist/router/types.js.map +1 -0
- package/dist/runtime/commit/composite.d.ts +11 -0
- package/dist/runtime/commit/composite.d.ts.map +1 -0
- package/dist/runtime/commit/composite.js +238 -0
- package/dist/runtime/commit/composite.js.map +1 -0
- package/dist/runtime/commit/container.d.ts +7 -0
- package/dist/runtime/commit/container.d.ts.map +1 -0
- package/dist/runtime/commit/container.js +350 -0
- package/dist/runtime/commit/container.js.map +1 -0
- package/dist/runtime/commit/equality.d.ts +20 -0
- package/dist/runtime/commit/equality.d.ts.map +1 -0
- package/dist/runtime/commit/equality.js +436 -0
- package/dist/runtime/commit/equality.js.map +1 -0
- package/dist/runtime/commit/errorBoundary.d.ts +7 -0
- package/dist/runtime/commit/errorBoundary.d.ts.map +1 -0
- package/dist/runtime/commit/errorBoundary.js +53 -0
- package/dist/runtime/commit/errorBoundary.js.map +1 -0
- package/dist/runtime/commit/shared.d.ts +138 -0
- package/dist/runtime/commit/shared.d.ts.map +1 -0
- package/dist/runtime/commit/shared.js +11 -0
- package/dist/runtime/commit/shared.js.map +1 -0
- package/dist/runtime/commit/transitions.d.ts +9 -0
- package/dist/runtime/commit/transitions.d.ts.map +1 -0
- package/dist/runtime/commit/transitions.js +93 -0
- package/dist/runtime/commit/transitions.js.map +1 -0
- package/dist/runtime/commit/validation.d.ts +16 -0
- package/dist/runtime/commit/validation.d.ts.map +1 -0
- package/dist/runtime/commit/validation.js +157 -0
- package/dist/runtime/commit/validation.js.map +1 -0
- package/dist/runtime/commit.d.ts +32 -0
- package/dist/runtime/commit.d.ts.map +1 -0
- package/dist/runtime/commit.js +236 -0
- package/dist/runtime/commit.js.map +1 -0
- package/dist/runtime/focus.d.ts +165 -0
- package/dist/runtime/focus.d.ts.map +1 -0
- package/dist/runtime/focus.js +535 -0
- package/dist/runtime/focus.js.map +1 -0
- package/dist/runtime/idCodec.d.ts +26 -0
- package/dist/runtime/idCodec.d.ts.map +1 -0
- package/dist/runtime/idCodec.js +56 -0
- package/dist/runtime/idCodec.js.map +1 -0
- package/dist/runtime/inputEditor.d.ts +83 -0
- package/dist/runtime/inputEditor.d.ts.map +1 -0
- package/dist/runtime/inputEditor.js +736 -0
- package/dist/runtime/inputEditor.js.map +1 -0
- package/dist/runtime/instance.d.ts +21 -0
- package/dist/runtime/instance.d.ts.map +1 -0
- package/dist/runtime/instance.js +27 -0
- package/dist/runtime/instance.js.map +1 -0
- package/dist/runtime/instances.d.ts +156 -0
- package/dist/runtime/instances.d.ts.map +1 -0
- package/dist/runtime/instances.js +414 -0
- package/dist/runtime/instances.js.map +1 -0
- package/dist/runtime/layers.d.ts +146 -0
- package/dist/runtime/layers.d.ts.map +1 -0
- package/dist/runtime/layers.js +289 -0
- package/dist/runtime/layers.js.map +1 -0
- package/dist/runtime/localState.d.ts +194 -0
- package/dist/runtime/localState.d.ts.map +1 -0
- package/dist/runtime/localState.js +288 -0
- package/dist/runtime/localState.js.map +1 -0
- package/dist/runtime/reconcile.d.ts +68 -0
- package/dist/runtime/reconcile.d.ts.map +1 -0
- package/dist/runtime/reconcile.js +220 -0
- package/dist/runtime/reconcile.js.map +1 -0
- package/dist/runtime/renderPacket.d.ts +65 -0
- package/dist/runtime/renderPacket.d.ts.map +1 -0
- package/dist/runtime/renderPacket.js +2 -0
- package/dist/runtime/renderPacket.js.map +1 -0
- package/dist/runtime/router/dropdown.d.ts +16 -0
- package/dist/runtime/router/dropdown.d.ts.map +1 -0
- package/dist/runtime/router/dropdown.js +131 -0
- package/dist/runtime/router/dropdown.js.map +1 -0
- package/dist/runtime/router/key.d.ts +10 -0
- package/dist/runtime/router/key.d.ts.map +1 -0
- package/dist/runtime/router/key.js +39 -0
- package/dist/runtime/router/key.js.map +1 -0
- package/dist/runtime/router/layer.d.ts +11 -0
- package/dist/runtime/router/layer.d.ts.map +1 -0
- package/dist/runtime/router/layer.js +53 -0
- package/dist/runtime/router/layer.js.map +1 -0
- package/dist/runtime/router/mouse.d.ts +9 -0
- package/dist/runtime/router/mouse.d.ts.map +1 -0
- package/dist/runtime/router/mouse.js +36 -0
- package/dist/runtime/router/mouse.js.map +1 -0
- package/dist/runtime/router/pagination.d.ts +19 -0
- package/dist/runtime/router/pagination.d.ts.map +1 -0
- package/dist/runtime/router/pagination.js +115 -0
- package/dist/runtime/router/pagination.js.map +1 -0
- package/dist/runtime/router/table.d.ts +15 -0
- package/dist/runtime/router/table.d.ts.map +1 -0
- package/dist/runtime/router/table.js +201 -0
- package/dist/runtime/router/table.js.map +1 -0
- package/dist/runtime/router/tabs.d.ts +20 -0
- package/dist/runtime/router/tabs.d.ts.map +1 -0
- package/dist/runtime/router/tabs.js +92 -0
- package/dist/runtime/router/tabs.js.map +1 -0
- package/dist/runtime/router/tree.d.ts +16 -0
- package/dist/runtime/router/tree.d.ts.map +1 -0
- package/dist/runtime/router/tree.js +211 -0
- package/dist/runtime/router/tree.js.map +1 -0
- package/dist/runtime/router/types.d.ts +230 -0
- package/dist/runtime/router/types.d.ts.map +1 -0
- package/dist/runtime/router/types.js +2 -0
- package/dist/runtime/router/types.js.map +1 -0
- package/dist/runtime/router/virtualList.d.ts +21 -0
- package/dist/runtime/router/virtualList.d.ts.map +1 -0
- package/dist/runtime/router/virtualList.js +180 -0
- package/dist/runtime/router/virtualList.js.map +1 -0
- package/dist/runtime/router/wheel.d.ts +15 -0
- package/dist/runtime/router/wheel.d.ts.map +1 -0
- package/dist/runtime/router/wheel.js +16 -0
- package/dist/runtime/router/wheel.js.map +1 -0
- package/dist/runtime/router/zones.d.ts +16 -0
- package/dist/runtime/router/zones.d.ts.map +1 -0
- package/dist/runtime/router/zones.js +158 -0
- package/dist/runtime/router/zones.js.map +1 -0
- package/dist/runtime/router.d.ts +21 -0
- package/dist/runtime/router.d.ts.map +1 -0
- package/dist/runtime/router.js +20 -0
- package/dist/runtime/router.js.map +1 -0
- package/dist/runtime/widgetMeta/collector.d.ts +77 -0
- package/dist/runtime/widgetMeta/collector.d.ts.map +1 -0
- package/dist/runtime/widgetMeta/collector.js +293 -0
- package/dist/runtime/widgetMeta/collector.js.map +1 -0
- package/dist/runtime/widgetMeta/focusContainers.d.ts +44 -0
- package/dist/runtime/widgetMeta/focusContainers.d.ts.map +1 -0
- package/dist/runtime/widgetMeta/focusContainers.js +190 -0
- package/dist/runtime/widgetMeta/focusContainers.js.map +1 -0
- package/dist/runtime/widgetMeta/focusInfo.d.ts +19 -0
- package/dist/runtime/widgetMeta/focusInfo.d.ts.map +1 -0
- package/dist/runtime/widgetMeta/focusInfo.js +172 -0
- package/dist/runtime/widgetMeta/focusInfo.js.map +1 -0
- package/dist/runtime/widgetMeta/helpers.d.ts +47 -0
- package/dist/runtime/widgetMeta/helpers.d.ts.map +1 -0
- package/dist/runtime/widgetMeta/helpers.js +182 -0
- package/dist/runtime/widgetMeta/helpers.js.map +1 -0
- package/dist/runtime/widgetMeta.d.ts +14 -0
- package/dist/runtime/widgetMeta.d.ts.map +1 -0
- package/dist/runtime/widgetMeta.js +10 -0
- package/dist/runtime/widgetMeta.js.map +1 -0
- package/dist/terminalCaps.d.ts +80 -0
- package/dist/terminalCaps.d.ts.map +1 -0
- package/dist/terminalCaps.js +63 -0
- package/dist/terminalCaps.js.map +1 -0
- package/dist/terminalProfile.d.ts +16 -0
- package/dist/terminalProfile.d.ts.map +1 -0
- package/dist/terminalProfile.js +36 -0
- package/dist/terminalProfile.js.map +1 -0
- package/dist/testing/events.d.ts +168 -0
- package/dist/testing/events.d.ts.map +1 -0
- package/dist/testing/events.js +446 -0
- package/dist/testing/events.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/renderer.d.ts +128 -0
- package/dist/testing/renderer.d.ts.map +1 -0
- package/dist/testing/renderer.js +455 -0
- package/dist/testing/renderer.js.map +1 -0
- package/dist/testing/snapshot.d.ts +73 -0
- package/dist/testing/snapshot.d.ts.map +1 -0
- package/dist/testing/snapshot.js +138 -0
- package/dist/testing/snapshot.js.map +1 -0
- package/dist/theme/blend.d.ts +6 -0
- package/dist/theme/blend.d.ts.map +1 -0
- package/dist/theme/blend.js +12 -0
- package/dist/theme/blend.js.map +1 -0
- package/dist/theme/contrast.d.ts +13 -0
- package/dist/theme/contrast.d.ts.map +1 -0
- package/dist/theme/contrast.js +31 -0
- package/dist/theme/contrast.js.map +1 -0
- package/dist/theme/defaultTheme.d.ts +10 -0
- package/dist/theme/defaultTheme.d.ts.map +1 -0
- package/dist/theme/defaultTheme.js +7 -0
- package/dist/theme/defaultTheme.js.map +1 -0
- package/dist/theme/extend.d.ts +15 -0
- package/dist/theme/extend.d.ts.map +1 -0
- package/dist/theme/extend.js +81 -0
- package/dist/theme/extend.js.map +1 -0
- package/dist/theme/extract.d.ts +4 -0
- package/dist/theme/extract.d.ts.map +1 -0
- package/dist/theme/extract.js +4 -0
- package/dist/theme/extract.js.map +1 -0
- package/dist/theme/heatmapPalettes.d.ts +9 -0
- package/dist/theme/heatmapPalettes.d.ts.map +1 -0
- package/dist/theme/heatmapPalettes.js +43 -0
- package/dist/theme/heatmapPalettes.js.map +1 -0
- package/dist/theme/index.d.ts +10 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +10 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/interop.d.ts +6 -0
- package/dist/theme/interop.d.ts.map +1 -0
- package/dist/theme/interop.js +29 -0
- package/dist/theme/interop.js.map +1 -0
- package/dist/theme/presets.d.ts +99 -0
- package/dist/theme/presets.d.ts.map +1 -0
- package/dist/theme/presets.js +329 -0
- package/dist/theme/presets.js.map +1 -0
- package/dist/theme/resolve.d.ts +21 -0
- package/dist/theme/resolve.d.ts.map +1 -0
- package/dist/theme/resolve.js +216 -0
- package/dist/theme/resolve.js.map +1 -0
- package/dist/theme/theme.d.ts +14 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/theme.js +237 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/theme/tokens.d.ts +253 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/theme/tokens.js +129 -0
- package/dist/theme/tokens.js.map +1 -0
- package/dist/theme/types.d.ts +24 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +2 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/theme/validate.d.ts +15 -0
- package/dist/theme/validate.d.ts.map +1 -0
- package/dist/theme/validate.js +165 -0
- package/dist/theme/validate.js.map +1 -0
- package/dist/ui/capabilities.d.ts +70 -0
- package/dist/ui/capabilities.d.ts.map +1 -0
- package/dist/ui/capabilities.js +94 -0
- package/dist/ui/capabilities.js.map +1 -0
- package/dist/ui/designTokens.d.ts +114 -0
- package/dist/ui/designTokens.d.ts.map +1 -0
- package/dist/ui/designTokens.js +144 -0
- package/dist/ui/designTokens.js.map +1 -0
- package/dist/ui/index.d.ts +11 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +14 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/recipes.d.ts +403 -0
- package/dist/ui/recipes.d.ts.map +1 -0
- package/dist/ui/recipes.js +960 -0
- package/dist/ui/recipes.js.map +1 -0
- package/dist/ui.d.ts +4 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +3 -0
- package/dist/ui.js.map +1 -0
- package/dist/widgets/accordion.d.ts +23 -0
- package/dist/widgets/accordion.d.ts.map +1 -0
- package/dist/widgets/accordion.js +134 -0
- package/dist/widgets/accordion.js.map +1 -0
- package/dist/widgets/breadcrumb.d.ts +27 -0
- package/dist/widgets/breadcrumb.d.ts.map +1 -0
- package/dist/widgets/breadcrumb.js +121 -0
- package/dist/widgets/breadcrumb.js.map +1 -0
- package/dist/widgets/canvas.d.ts +26 -0
- package/dist/widgets/canvas.d.ts.map +1 -0
- package/dist/widgets/canvas.js +391 -0
- package/dist/widgets/canvas.js.map +1 -0
- package/dist/widgets/checkbox.d.ts +49 -0
- package/dist/widgets/checkbox.d.ts.map +1 -0
- package/dist/widgets/checkbox.js +66 -0
- package/dist/widgets/checkbox.js.map +1 -0
- package/dist/widgets/codeEditor.d.ts +150 -0
- package/dist/widgets/codeEditor.d.ts.map +1 -0
- package/dist/widgets/codeEditor.js +445 -0
- package/dist/widgets/codeEditor.js.map +1 -0
- package/dist/widgets/codeEditorSyntax.d.ts +11 -0
- package/dist/widgets/codeEditorSyntax.d.ts.map +1 -0
- package/dist/widgets/codeEditorSyntax.js +960 -0
- package/dist/widgets/codeEditorSyntax.js.map +1 -0
- package/dist/widgets/collections.d.ts +16 -0
- package/dist/widgets/collections.d.ts.map +1 -0
- package/dist/widgets/collections.js +52 -0
- package/dist/widgets/collections.js.map +1 -0
- package/dist/widgets/commandPalette.d.ts +97 -0
- package/dist/widgets/commandPalette.d.ts.map +1 -0
- package/dist/widgets/commandPalette.js +244 -0
- package/dist/widgets/commandPalette.js.map +1 -0
- package/dist/widgets/composition.d.ts +241 -0
- package/dist/widgets/composition.d.ts.map +1 -0
- package/dist/widgets/composition.js +146 -0
- package/dist/widgets/composition.js.map +1 -0
- package/dist/widgets/conditionals.d.ts +9 -0
- package/dist/widgets/conditionals.d.ts.map +1 -0
- package/dist/widgets/conditionals.js +27 -0
- package/dist/widgets/conditionals.js.map +1 -0
- package/dist/widgets/debugPanel.d.ts +96 -0
- package/dist/widgets/debugPanel.d.ts.map +1 -0
- package/dist/widgets/debugPanel.js +172 -0
- package/dist/widgets/debugPanel.js.map +1 -0
- package/dist/widgets/dialogs/alert.d.ts +7 -0
- package/dist/widgets/dialogs/alert.d.ts.map +1 -0
- package/dist/widgets/dialogs/alert.js +21 -0
- package/dist/widgets/dialogs/alert.js.map +1 -0
- package/dist/widgets/dialogs/confirm.d.ts +7 -0
- package/dist/widgets/dialogs/confirm.d.ts.map +1 -0
- package/dist/widgets/dialogs/confirm.js +28 -0
- package/dist/widgets/dialogs/confirm.js.map +1 -0
- package/dist/widgets/dialogs/dialog.d.ts +7 -0
- package/dist/widgets/dialogs/dialog.d.ts.map +1 -0
- package/dist/widgets/dialogs/dialog.js +8 -0
- package/dist/widgets/dialogs/dialog.js.map +1 -0
- package/dist/widgets/dialogs/index.d.ts +9 -0
- package/dist/widgets/dialogs/index.d.ts.map +1 -0
- package/dist/widgets/dialogs/index.js +8 -0
- package/dist/widgets/dialogs/index.js.map +1 -0
- package/dist/widgets/dialogs/prompt.d.ts +9 -0
- package/dist/widgets/dialogs/prompt.d.ts.map +1 -0
- package/dist/widgets/dialogs/prompt.js +40 -0
- package/dist/widgets/dialogs/prompt.js.map +1 -0
- package/dist/widgets/dialogs/types.d.ts +30 -0
- package/dist/widgets/dialogs/types.d.ts.map +1 -0
- package/dist/widgets/dialogs/types.js +5 -0
- package/dist/widgets/dialogs/types.js.map +1 -0
- package/dist/widgets/diffViewer.d.ts +72 -0
- package/dist/widgets/diffViewer.d.ts.map +1 -0
- package/dist/widgets/diffViewer.js +196 -0
- package/dist/widgets/diffViewer.js.map +1 -0
- package/dist/widgets/factories/advanced.d.ts +20 -0
- package/dist/widgets/factories/advanced.d.ts.map +1 -0
- package/dist/widgets/factories/advanced.js +75 -0
- package/dist/widgets/factories/advanced.js.map +1 -0
- package/dist/widgets/factories/basic.d.ts +14 -0
- package/dist/widgets/factories/basic.d.ts.map +1 -0
- package/dist/widgets/factories/basic.js +44 -0
- package/dist/widgets/factories/basic.js.map +1 -0
- package/dist/widgets/factories/feedback.d.ts +20 -0
- package/dist/widgets/factories/feedback.d.ts.map +1 -0
- package/dist/widgets/factories/feedback.js +102 -0
- package/dist/widgets/factories/feedback.js.map +1 -0
- package/dist/widgets/factories/helpers.d.ts +41 -0
- package/dist/widgets/factories/helpers.d.ts.map +1 -0
- package/dist/widgets/factories/helpers.js +72 -0
- package/dist/widgets/factories/helpers.js.map +1 -0
- package/dist/widgets/factories/interactive.d.ts +15 -0
- package/dist/widgets/factories/interactive.d.ts.map +1 -0
- package/dist/widgets/factories/interactive.js +46 -0
- package/dist/widgets/factories/interactive.js.map +1 -0
- package/dist/widgets/factories/layoutShell.d.ts +22 -0
- package/dist/widgets/factories/layoutShell.d.ts.map +1 -0
- package/dist/widgets/factories/layoutShell.js +190 -0
- package/dist/widgets/factories/layoutShell.js.map +1 -0
- package/dist/widgets/factories/media.d.ts +14 -0
- package/dist/widgets/factories/media.d.ts.map +1 -0
- package/dist/widgets/factories/media.js +25 -0
- package/dist/widgets/factories/media.js.map +1 -0
- package/dist/widgets/factories/navigation.d.ts +10 -0
- package/dist/widgets/factories/navigation.d.ts.map +1 -0
- package/dist/widgets/factories/navigation.js +24 -0
- package/dist/widgets/factories/navigation.js.map +1 -0
- package/dist/widgets/field.d.ts +53 -0
- package/dist/widgets/field.d.ts.map +1 -0
- package/dist/widgets/field.js +69 -0
- package/dist/widgets/field.js.map +1 -0
- package/dist/widgets/filePicker.d.ts +5 -0
- package/dist/widgets/filePicker.d.ts.map +1 -0
- package/dist/widgets/filePicker.js +136 -0
- package/dist/widgets/filePicker.js.map +1 -0
- package/dist/widgets/heatmap.d.ts +13 -0
- package/dist/widgets/heatmap.d.ts.map +1 -0
- package/dist/widgets/heatmap.js +105 -0
- package/dist/widgets/heatmap.js.map +1 -0
- package/dist/widgets/hooks/animation.d.ts +113 -0
- package/dist/widgets/hooks/animation.d.ts.map +1 -0
- package/dist/widgets/hooks/animation.js +1108 -0
- package/dist/widgets/hooks/animation.js.map +1 -0
- package/dist/widgets/hooks/data.d.ts +218 -0
- package/dist/widgets/hooks/data.d.ts.map +1 -0
- package/dist/widgets/hooks/data.js +679 -0
- package/dist/widgets/hooks/data.js.map +1 -0
- package/dist/widgets/hooks/utility.d.ts +34 -0
- package/dist/widgets/hooks/utility.d.ts.map +1 -0
- package/dist/widgets/hooks/utility.js +36 -0
- package/dist/widgets/hooks/utility.js.map +1 -0
- package/dist/widgets/image.d.ts +25 -0
- package/dist/widgets/image.d.ts.map +1 -0
- package/dist/widgets/image.js +112 -0
- package/dist/widgets/image.js.map +1 -0
- package/dist/widgets/inspectorOverlay.d.ts +33 -0
- package/dist/widgets/inspectorOverlay.d.ts.map +1 -0
- package/dist/widgets/inspectorOverlay.js +147 -0
- package/dist/widgets/inspectorOverlay.js.map +1 -0
- package/dist/widgets/lineChart.d.ts +13 -0
- package/dist/widgets/lineChart.d.ts.map +1 -0
- package/dist/widgets/lineChart.js +73 -0
- package/dist/widgets/lineChart.js.map +1 -0
- package/dist/widgets/link.d.ts +4 -0
- package/dist/widgets/link.d.ts.map +1 -0
- package/dist/widgets/link.js +7 -0
- package/dist/widgets/link.js.map +1 -0
- package/dist/widgets/logsConsole.d.ts +97 -0
- package/dist/widgets/logsConsole.d.ts.map +1 -0
- package/dist/widgets/logsConsole.js +191 -0
- package/dist/widgets/logsConsole.js.map +1 -0
- package/dist/widgets/pagination.d.ts +35 -0
- package/dist/widgets/pagination.d.ts.map +1 -0
- package/dist/widgets/pagination.js +250 -0
- package/dist/widgets/pagination.js.map +1 -0
- package/dist/widgets/protocol.d.ts +39 -0
- package/dist/widgets/protocol.d.ts.map +1 -0
- package/dist/widgets/protocol.js +160 -0
- package/dist/widgets/protocol.js.map +1 -0
- package/dist/widgets/radioGroup.d.ts +79 -0
- package/dist/widgets/radioGroup.d.ts.map +1 -0
- package/dist/widgets/radioGroup.js +145 -0
- package/dist/widgets/radioGroup.js.map +1 -0
- package/dist/widgets/scatter.d.ts +18 -0
- package/dist/widgets/scatter.d.ts.map +1 -0
- package/dist/widgets/scatter.js +75 -0
- package/dist/widgets/scatter.js.map +1 -0
- package/dist/widgets/select.d.ts +61 -0
- package/dist/widgets/select.d.ts.map +1 -0
- package/dist/widgets/select.js +123 -0
- package/dist/widgets/select.js.map +1 -0
- package/dist/widgets/slider.d.ts +40 -0
- package/dist/widgets/slider.d.ts.map +1 -0
- package/dist/widgets/slider.js +111 -0
- package/dist/widgets/slider.js.map +1 -0
- package/dist/widgets/splitPane.d.ts +88 -0
- package/dist/widgets/splitPane.d.ts.map +1 -0
- package/dist/widgets/splitPane.js +289 -0
- package/dist/widgets/splitPane.js.map +1 -0
- package/dist/widgets/style.d.ts +31 -0
- package/dist/widgets/style.d.ts.map +1 -0
- package/dist/widgets/style.js +40 -0
- package/dist/widgets/style.js.map +1 -0
- package/dist/widgets/styleUtils.d.ts +45 -0
- package/dist/widgets/styleUtils.d.ts.map +1 -0
- package/dist/widgets/styleUtils.js +130 -0
- package/dist/widgets/styleUtils.js.map +1 -0
- package/dist/widgets/styled.d.ts +21 -0
- package/dist/widgets/styled.d.ts.map +1 -0
- package/dist/widgets/styled.js +30 -0
- package/dist/widgets/styled.js.map +1 -0
- package/dist/widgets/table.d.ts +157 -0
- package/dist/widgets/table.d.ts.map +1 -0
- package/dist/widgets/table.js +380 -0
- package/dist/widgets/table.js.map +1 -0
- package/dist/widgets/tabs.d.ts +28 -0
- package/dist/widgets/tabs.d.ts.map +1 -0
- package/dist/widgets/tabs.js +146 -0
- package/dist/widgets/tabs.js.map +1 -0
- package/dist/widgets/toast.d.ts +85 -0
- package/dist/widgets/toast.d.ts.map +1 -0
- package/dist/widgets/toast.js +147 -0
- package/dist/widgets/toast.js.map +1 -0
- package/dist/widgets/tree.d.ts +207 -0
- package/dist/widgets/tree.d.ts.map +1 -0
- package/dist/widgets/tree.js +393 -0
- package/dist/widgets/tree.js.map +1 -0
- package/dist/widgets/types/advanced.d.ts +611 -0
- package/dist/widgets/types/advanced.d.ts.map +1 -0
- package/dist/widgets/types/advanced.js +2 -0
- package/dist/widgets/types/advanced.js.map +1 -0
- package/dist/widgets/types/base.d.ts +933 -0
- package/dist/widgets/types/base.d.ts.map +1 -0
- package/dist/widgets/types/base.js +2 -0
- package/dist/widgets/types/base.js.map +1 -0
- package/dist/widgets/types/forms.d.ts +136 -0
- package/dist/widgets/types/forms.d.ts.map +1 -0
- package/dist/widgets/types/forms.js +2 -0
- package/dist/widgets/types/forms.js.map +1 -0
- package/dist/widgets/types/navigation.d.ts +83 -0
- package/dist/widgets/types/navigation.d.ts.map +1 -0
- package/dist/widgets/types/navigation.js +2 -0
- package/dist/widgets/types/navigation.js.map +1 -0
- package/dist/widgets/types/overlaysShell.d.ts +223 -0
- package/dist/widgets/types/overlaysShell.d.ts.map +1 -0
- package/dist/widgets/types/overlaysShell.js +2 -0
- package/dist/widgets/types/overlaysShell.js.map +1 -0
- package/dist/widgets/types/table.d.ts +104 -0
- package/dist/widgets/types/table.d.ts.map +1 -0
- package/dist/widgets/types/table.js +2 -0
- package/dist/widgets/types/table.js.map +1 -0
- package/dist/widgets/types/tree.d.ts +64 -0
- package/dist/widgets/types/tree.d.ts.map +1 -0
- package/dist/widgets/types/tree.js +2 -0
- package/dist/widgets/types/tree.js.map +1 -0
- package/dist/widgets/types.d.ts +250 -0
- package/dist/widgets/types.d.ts.map +1 -0
- package/dist/widgets/types.js +20 -0
- package/dist/widgets/types.js.map +1 -0
- package/dist/widgets/ui.d.ts +93 -0
- package/dist/widgets/ui.d.ts.map +1 -0
- package/dist/widgets/ui.js +93 -0
- package/dist/widgets/ui.js.map +1 -0
- package/dist/widgets/useModalStack.d.ts +21 -0
- package/dist/widgets/useModalStack.d.ts.map +1 -0
- package/dist/widgets/useModalStack.js +107 -0
- package/dist/widgets/useModalStack.js.map +1 -0
- package/dist/widgets/useTable.d.ts +30 -0
- package/dist/widgets/useTable.d.ts.map +1 -0
- package/dist/widgets/useTable.js +184 -0
- package/dist/widgets/useTable.js.map +1 -0
- package/dist/widgets/virtualList.d.ts +100 -0
- package/dist/widgets/virtualList.d.ts.map +1 -0
- package/dist/widgets/virtualList.js +280 -0
- package/dist/widgets/virtualList.js.map +1 -0
- package/package.json +125 -0
|
@@ -0,0 +1,2706 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* packages/core/src/app/widgetRenderer.ts — Widget tree renderer with focus and event routing.
|
|
3
|
+
*
|
|
4
|
+
* Why: Handles the "view mode" rendering path where users return VNode trees
|
|
5
|
+
* from a view function. Orchestrates the full widget pipeline: tree commit,
|
|
6
|
+
* layout computation, focus management, event routing, input editing, and
|
|
7
|
+
* drawlist rendering.
|
|
8
|
+
*
|
|
9
|
+
* Responsibilities:
|
|
10
|
+
* - Commit VNode tree (reconciliation, instance ID allocation)
|
|
11
|
+
* - Compute layout for viewport
|
|
12
|
+
* - Manage focus state (traversal, pending changes)
|
|
13
|
+
* - Route engine events to widgets (keyboard/mouse -> actions)
|
|
14
|
+
* - Handle input widget editing (text/key/paste events)
|
|
15
|
+
* - Render committed tree to drawlist
|
|
16
|
+
*
|
|
17
|
+
* Cursor Protocol:
|
|
18
|
+
* - Emits SET_CURSOR for focused Input widgets with proper position
|
|
19
|
+
*
|
|
20
|
+
* @see docs/guide/runtime-and-layout.md
|
|
21
|
+
* @see docs/guide/lifecycle-and-updates.md
|
|
22
|
+
*/
|
|
23
|
+
import { BACKEND_BEGIN_FRAME_MARKER, BACKEND_RAW_WRITE_MARKER, FRAME_ACCEPTED_ACK_MARKER, } from "../backend.js";
|
|
24
|
+
import { isConstraintExpr } from "../constraints/expr.js";
|
|
25
|
+
import { buildConstraintGraph, } from "../constraints/graph.js";
|
|
26
|
+
import { ConstraintResolutionCache, resolveConstraints, } from "../constraints/resolver.js";
|
|
27
|
+
import { CURSOR_DEFAULTS } from "../cursor/index.js";
|
|
28
|
+
import { createDrawlistBuilder } from "../drawlist/index.js";
|
|
29
|
+
import { buildTrie, resetChordState } from "../keybindings/index.js";
|
|
30
|
+
import { computeDropdownGeometry } from "../layout/dropdownGeometry.js";
|
|
31
|
+
import { layout, measure } from "../layout/layout.js";
|
|
32
|
+
import { getResponsiveViewport, normalizeBreakpointThresholds, setResponsiveViewport, } from "../layout/responsive.js";
|
|
33
|
+
import { FRAME_AUDIT_ENABLED, drawlistFingerprint, emitFrameAudit } from "../perf/frameAudit.js";
|
|
34
|
+
import { PERF_DETAIL_ENABLED, PERF_ENABLED, perfCount, perfMarkEnd, perfMarkStart, perfNow, } from "../perf/perf.js";
|
|
35
|
+
import { renderToDrawlist } from "../renderer/renderToDrawlist.js";
|
|
36
|
+
import { renderTree } from "../renderer/renderToDrawlist/renderTree.js";
|
|
37
|
+
import { DEFAULT_BASE_STYLE } from "../renderer/renderToDrawlist/textStyle.js";
|
|
38
|
+
import { commitVNodeTree, } from "../runtime/commit.js";
|
|
39
|
+
import { createFocusManagerState, finalizeFocusWithPreCollectedMetadata, } from "../runtime/focus.js";
|
|
40
|
+
import { normalizeInputCursor, normalizeInputSelection, } from "../runtime/inputEditor.js";
|
|
41
|
+
import { createInstanceIdAllocator } from "../runtime/instance.js";
|
|
42
|
+
import { createCompositeInstanceRegistry, runPendingCleanups, runPendingEffects, } from "../runtime/instances.js";
|
|
43
|
+
import { createLayerRegistry } from "../runtime/layers.js";
|
|
44
|
+
import { createTableStateStore, createTreeStateStore, createVirtualListStateStore, } from "../runtime/localState.js";
|
|
45
|
+
import { createWidgetMetadataCollector, } from "../runtime/widgetMeta.js";
|
|
46
|
+
import { DEFAULT_TERMINAL_PROFILE } from "../terminalProfile.js";
|
|
47
|
+
import { getColorTokens } from "../theme/extract.js";
|
|
48
|
+
import { parseToastActionFocusId } from "../widgets/toast.js";
|
|
49
|
+
import { EMPTY_WIDGET_RUNTIME_BREADCRUMBS, } from "./runtimeBreadcrumbs.js";
|
|
50
|
+
import { readContainerOpacity as readContainerOpacityImpl, rebuildAnimatedRectOverrides as rebuildAnimatedRectOverridesImpl, recomputeAnimatedWidgetPresence as recomputeAnimatedWidgetPresenceImpl, refreshPositionTransitionTracks as refreshPositionTransitionTracksImpl, sampleExitAnimations as sampleExitAnimationsImpl, scheduleExitAnimations as scheduleExitAnimationsImpl, } from "./widgetRenderer/animationTracks.js";
|
|
51
|
+
import { kickoffCommandPaletteItemFetches } from "./widgetRenderer/commandPaletteRouting.js";
|
|
52
|
+
import { CONSTRAINT_NODE_PROPS, applyConstraintOverridesToVNode as applyConstraintOverridesToVNodeImpl, buildConstraintResolutionInputs as buildConstraintResolutionInputsImpl, computeConstraintBreadcrumbs as computeConstraintBreadcrumbsImpl, computeConstraintInputKey as computeConstraintInputKeyImpl, describeConstraintGraphFatal as describeConstraintGraphFatalImpl, hasConstraintInputSignatureChange as hasConstraintInputSignatureChangeImpl, rebuildConstraintAffectedPathSet as rebuildConstraintAffectedPathSetImpl, rebuildConstraintExprIndex as rebuildConstraintExprIndexImpl, rebuildConstraintHiddenState as rebuildConstraintHiddenStateImpl, shouldRebuildConstraintGraph as shouldRebuildConstraintGraphImpl, } from "./widgetRenderer/constraintState.js";
|
|
53
|
+
import { emitIncrementalCursor as emitIncrementalCursorImpl, resolveRuntimeCursorSummary as resolveRuntimeCursorSummaryImpl, snapshotRenderedFrameState as snapshotRenderedFrameStateImpl, updateRuntimeBreadcrumbSnapshot as updateRuntimeBreadcrumbSnapshotImpl, } from "./widgetRenderer/cursorBreadcrumbs.js";
|
|
54
|
+
import { appendDamageRectForId as appendDamageRectForIdImpl, appendDamageRectForInstanceId as appendDamageRectForInstanceIdImpl, appendDamageRectsForFocusAnnouncers as appendDamageRectsForFocusAnnouncersImpl, clearRuntimeDirtyNodes as clearRuntimeDirtyNodesImpl, collectSelfDirtyInstanceIds as collectSelfDirtyInstanceIdsImpl, collectSpinnerDamageRects as collectSpinnerDamageRectsImpl, collectSubtreeDamageAndRouting as collectSubtreeDamageAndRoutingImpl, computeIdentityDiffDamage as computeIdentityDiffDamageImpl, isDamageAreaTooLarge as isDamageAreaTooLargeImpl, markLayoutDirtyNodes as markLayoutDirtyNodesImpl, markTransientDirtyNodes as markTransientDirtyNodesImpl, normalizeDamageRects as normalizeDamageRectsImpl, propagateDirtyFromPredicate as propagateDirtyFromPredicateImpl, refreshDamageRectIndexesForLayoutSkippedCommit as refreshDamageRectIndexesForLayoutSkippedCommitImpl, shouldAttemptIncrementalRender as shouldAttemptIncrementalRenderImpl, } from "./widgetRenderer/damageTracking.js";
|
|
55
|
+
import { describeLayoutNode as describeLayoutNodeImpl, emitDevLayoutWarnings as emitDevLayoutWarningsImpl, warnLayoutIssue as warnLayoutIssueImpl, warnShortcutIssue as warnShortcutIssueImpl, } from "./widgetRenderer/devWarnings.js";
|
|
56
|
+
import { buildFallbackFocusInfo as buildFallbackFocusInfoImpl, captureFocusSnapshotState, findScrollableAncestors as findScrollableAncestorsImpl, invokeFocusZoneCallbacks as invokeFocusZoneCallbacksImpl, restoreFocusSnapshotState, } from "./widgetRenderer/focusState.js";
|
|
57
|
+
import { applyInputSnapshot as applyInputSnapshotImpl, getInputUndoStack as getInputUndoStackImpl, readInputSnapshot as readInputSnapshotImpl, } from "./widgetRenderer/inputEditing.js";
|
|
58
|
+
import { invokeOverlayShortcutTarget as invokeOverlayShortcutTargetImpl, rebuildOverlayShortcutBindings as rebuildOverlayShortcutBindingsImpl, registerOverlayShortcut as registerOverlayShortcutImpl, routeOverlayShortcut as routeOverlayShortcutImpl, selectCommandPaletteShortcutItem as selectCommandPaletteShortcutItemImpl, selectDropdownShortcutItem as selectDropdownShortcutItemImpl, } from "./widgetRenderer/overlayShortcuts.js";
|
|
59
|
+
import { cleanupRoutingStateAfterRebuild, finalizeLayoutOnlyOverlayState, finalizeRebuiltOverlayState, rebuildOverlayStateForLayout, rebuildRoutingWidgetMapsAndOverlayState, } from "./widgetRenderer/overlayState.js";
|
|
60
|
+
import { routeEngineEventImpl, } from "./widgetRenderer/routeEngineEvent.js";
|
|
61
|
+
import { buildLayoutRectIndexes, updateLayoutStabilitySignatures, } from "./widgetRenderer/submitFramePipeline.js";
|
|
62
|
+
const UTF8_ENCODER = new TextEncoder();
|
|
63
|
+
const BASE64_TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
64
|
+
function encodeBase64(bytes) {
|
|
65
|
+
if (bytes.length === 0)
|
|
66
|
+
return "";
|
|
67
|
+
let out = "";
|
|
68
|
+
for (let i = 0; i < bytes.length; i += 3) {
|
|
69
|
+
const a = bytes[i] ?? 0;
|
|
70
|
+
const b = bytes[i + 1] ?? 0;
|
|
71
|
+
const c = bytes[i + 2] ?? 0;
|
|
72
|
+
const triple = (a << 16) | (b << 8) | c;
|
|
73
|
+
out += BASE64_TABLE[(triple >> 18) & 0x3f] ?? "";
|
|
74
|
+
out += BASE64_TABLE[(triple >> 12) & 0x3f] ?? "";
|
|
75
|
+
out += i + 1 < bytes.length ? (BASE64_TABLE[(triple >> 6) & 0x3f] ?? "") : "=";
|
|
76
|
+
out += i + 2 < bytes.length ? (BASE64_TABLE[triple & 0x3f] ?? "") : "=";
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
function buildOsc52ClipboardSequence(text) {
|
|
81
|
+
if (text.length === 0)
|
|
82
|
+
return "";
|
|
83
|
+
const encoded = encodeBase64(UTF8_ENCODER.encode(text));
|
|
84
|
+
if (encoded.length === 0)
|
|
85
|
+
return "";
|
|
86
|
+
return `\u001b]52;c;${encoded}\u0007`;
|
|
87
|
+
}
|
|
88
|
+
function getBackendRawWriter(backend) {
|
|
89
|
+
const marker = backend[BACKEND_RAW_WRITE_MARKER];
|
|
90
|
+
return typeof marker === "function" ? marker : null;
|
|
91
|
+
}
|
|
92
|
+
/** Format thrown value for error message. */
|
|
93
|
+
function describeThrown(v) {
|
|
94
|
+
if (v instanceof Error)
|
|
95
|
+
return `${v.name}: ${v.message}`;
|
|
96
|
+
try {
|
|
97
|
+
return String(v);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return "[unstringifiable thrown value]";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function isI32NonNegative(n) {
|
|
104
|
+
return Number.isInteger(n) && n >= 0 && n <= 2147483647;
|
|
105
|
+
}
|
|
106
|
+
const EMPTY_STRING_ARRAY = Object.freeze([]);
|
|
107
|
+
const EMPTY_INSTANCE_ID_ARRAY = Object.freeze([]);
|
|
108
|
+
const CONSTRAINT_RESOLUTION_NONE = Object.freeze({ kind: "none" });
|
|
109
|
+
const CONSTRAINT_RESOLUTION_REUSED = Object.freeze({ kind: "reused" });
|
|
110
|
+
const CONSTRAINT_RESOLUTION_CACHE_HIT = Object.freeze({ kind: "cacheHit" });
|
|
111
|
+
const CONSTRAINT_RESOLUTION_COMPUTED = Object.freeze({ kind: "computed" });
|
|
112
|
+
const MAX_CONSTRAINT_SETTLE_PASSES = 128;
|
|
113
|
+
const EMPTY_CONSTRAINT_BREADCRUMBS = Object.freeze({
|
|
114
|
+
enabled: false,
|
|
115
|
+
graphFingerprint: 0,
|
|
116
|
+
nodeCount: 0,
|
|
117
|
+
cacheKey: null,
|
|
118
|
+
resolution: CONSTRAINT_RESOLUTION_NONE,
|
|
119
|
+
hiddenInstanceCount: 0,
|
|
120
|
+
focused: null,
|
|
121
|
+
});
|
|
122
|
+
const ZERO_RECT = Object.freeze({ x: 0, y: 0, w: 0, h: 0 });
|
|
123
|
+
const EMPTY_FOCUS_ERRORS = Object.freeze([]);
|
|
124
|
+
const EMPTY_FOCUS_INFO = Object.freeze({
|
|
125
|
+
id: null,
|
|
126
|
+
kind: null,
|
|
127
|
+
accessibleLabel: null,
|
|
128
|
+
visibleLabel: null,
|
|
129
|
+
required: false,
|
|
130
|
+
errors: EMPTY_FOCUS_ERRORS,
|
|
131
|
+
announcement: null,
|
|
132
|
+
});
|
|
133
|
+
const NODE_ENV = globalThis.process?.env?.NODE_ENV ??
|
|
134
|
+
"development";
|
|
135
|
+
const DEV_MODE = NODE_ENV !== "production";
|
|
136
|
+
const LAYOUT_WARNINGS_ENV_RAW = globalThis.process?.env?.REZI_LAYOUT_WARNINGS ??
|
|
137
|
+
globalThis.process?.env?.ZRUI_LAYOUT_WARNINGS ??
|
|
138
|
+
"";
|
|
139
|
+
const LAYOUT_WARNINGS_ENV = LAYOUT_WARNINGS_ENV_RAW.toLowerCase();
|
|
140
|
+
const DEV_LAYOUT_WARNINGS = DEV_MODE && (LAYOUT_WARNINGS_ENV === "1" || LAYOUT_WARNINGS_ENV === "true");
|
|
141
|
+
const FRAME_AUDIT_TREE_ENABLED = FRAME_AUDIT_ENABLED &&
|
|
142
|
+
globalThis.process?.env?.REZI_FRAME_AUDIT_TREE === "1";
|
|
143
|
+
function warnDev(message) {
|
|
144
|
+
const c = globalThis.console;
|
|
145
|
+
c?.warn?.(message);
|
|
146
|
+
}
|
|
147
|
+
function isVNodeLike(v) {
|
|
148
|
+
return typeof v === "object" && v !== null && "kind" in v;
|
|
149
|
+
}
|
|
150
|
+
function readLayoutShapeIdentity(vnode) {
|
|
151
|
+
const props = vnode.props;
|
|
152
|
+
const id = props?.id;
|
|
153
|
+
if (typeof id === "string" && id.length > 0)
|
|
154
|
+
return `id:${id}`;
|
|
155
|
+
const key = props?.key;
|
|
156
|
+
if (typeof key === "string" && key.length > 0)
|
|
157
|
+
return `key:${key}`;
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
function monotonicNowMs() {
|
|
161
|
+
const perf = globalThis.performance;
|
|
162
|
+
const perfNow = perf?.now;
|
|
163
|
+
if (typeof perfNow === "function")
|
|
164
|
+
return perfNow.call(perf);
|
|
165
|
+
return Date.now();
|
|
166
|
+
}
|
|
167
|
+
function pushLimited(list, value, max) {
|
|
168
|
+
if (list.length >= max)
|
|
169
|
+
return;
|
|
170
|
+
list.push(value);
|
|
171
|
+
}
|
|
172
|
+
function normalizeAuditText(value, maxChars = 96) {
|
|
173
|
+
if (value.length <= maxChars)
|
|
174
|
+
return value;
|
|
175
|
+
return `${value.slice(0, Math.max(0, maxChars - 1))}…`;
|
|
176
|
+
}
|
|
177
|
+
function describeAuditVNode(vnode) {
|
|
178
|
+
const kind = vnode.kind;
|
|
179
|
+
const props = vnode.props;
|
|
180
|
+
const id = typeof props?.id === "string" && props.id.length > 0 ? props.id : null;
|
|
181
|
+
const title = typeof props?.title === "string" && props.title.length > 0
|
|
182
|
+
? normalizeAuditText(props.title, 24)
|
|
183
|
+
: null;
|
|
184
|
+
if (id !== null)
|
|
185
|
+
return `${kind}#${id}`;
|
|
186
|
+
if (title !== null)
|
|
187
|
+
return `${kind}[${title}]`;
|
|
188
|
+
return kind;
|
|
189
|
+
}
|
|
190
|
+
function summarizeRuntimeTreeForAudit(root, layoutRoot) {
|
|
191
|
+
const kindCounts = new Map();
|
|
192
|
+
const zeroAreaKindCounts = new Map();
|
|
193
|
+
const textSamples = [];
|
|
194
|
+
const titleSamples = [];
|
|
195
|
+
const titleRectSamples = [];
|
|
196
|
+
const zeroAreaTitleSamples = [];
|
|
197
|
+
const mismatchSamples = [];
|
|
198
|
+
const needleHits = new Set();
|
|
199
|
+
const needles = [
|
|
200
|
+
"Engineering Controls",
|
|
201
|
+
"Subsystem Tree",
|
|
202
|
+
"Crew Manifest",
|
|
203
|
+
"Search Crew",
|
|
204
|
+
"Channel Controls",
|
|
205
|
+
"Ship Settings",
|
|
206
|
+
];
|
|
207
|
+
let nodeCount = 0;
|
|
208
|
+
let textNodeCount = 0;
|
|
209
|
+
let boxTitleCount = 0;
|
|
210
|
+
let compositeNodeCount = 0;
|
|
211
|
+
let zeroAreaNodes = 0;
|
|
212
|
+
let maxDepth = 0;
|
|
213
|
+
let maxChildrenDelta = 0;
|
|
214
|
+
const stack = [Object.freeze({ node: root, layout: layoutRoot, depth: 0, path: "root" })];
|
|
215
|
+
const rootRect = layoutRoot.rect;
|
|
216
|
+
while (stack.length > 0) {
|
|
217
|
+
const current = stack.pop();
|
|
218
|
+
if (!current)
|
|
219
|
+
continue;
|
|
220
|
+
const { node, layout, depth, path } = current;
|
|
221
|
+
nodeCount += 1;
|
|
222
|
+
if (depth > maxDepth)
|
|
223
|
+
maxDepth = depth;
|
|
224
|
+
const kind = node.vnode.kind;
|
|
225
|
+
const layoutKind = layout.vnode.kind;
|
|
226
|
+
kindCounts.set(kind, (kindCounts.get(kind) ?? 0) + 1);
|
|
227
|
+
if ("__composite" in node.vnode) {
|
|
228
|
+
compositeNodeCount += 1;
|
|
229
|
+
}
|
|
230
|
+
if (kind !== layoutKind) {
|
|
231
|
+
const runtimeLabel = describeAuditVNode(node.vnode);
|
|
232
|
+
const layoutLabel = describeAuditVNode(layout.vnode);
|
|
233
|
+
pushLimited(mismatchSamples, `${path}:${runtimeLabel}!${layoutLabel}`, 24);
|
|
234
|
+
}
|
|
235
|
+
const rect = layout.rect;
|
|
236
|
+
if (rect.w <= 0 || rect.h <= 0) {
|
|
237
|
+
zeroAreaNodes += 1;
|
|
238
|
+
zeroAreaKindCounts.set(kind, (zeroAreaKindCounts.get(kind) ?? 0) + 1);
|
|
239
|
+
}
|
|
240
|
+
if (kind === "text") {
|
|
241
|
+
textNodeCount += 1;
|
|
242
|
+
const text = node.vnode.text;
|
|
243
|
+
pushLimited(textSamples, normalizeAuditText(text), 24);
|
|
244
|
+
for (const needle of needles) {
|
|
245
|
+
if (text.includes(needle))
|
|
246
|
+
needleHits.add(needle);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
const props = node.vnode.props;
|
|
251
|
+
if (typeof props?.title === "string" && props.title.length > 0) {
|
|
252
|
+
boxTitleCount += 1;
|
|
253
|
+
pushLimited(titleSamples, normalizeAuditText(props.title), 24);
|
|
254
|
+
const offRoot = rect.x + rect.w <= rootRect.x ||
|
|
255
|
+
rect.y + rect.h <= rootRect.y ||
|
|
256
|
+
rect.x >= rootRect.x + rootRect.w ||
|
|
257
|
+
rect.y >= rootRect.y + rootRect.h;
|
|
258
|
+
const titleRectSummary = `${normalizeAuditText(props.title, 48)}@${String(rect.x)},${String(rect.y)},${String(rect.w)},${String(rect.h)}${offRoot ? ":off-root" : ""}`;
|
|
259
|
+
pushLimited(titleRectSamples, titleRectSummary, 24);
|
|
260
|
+
if (rect.w <= 0 || rect.h <= 0) {
|
|
261
|
+
pushLimited(zeroAreaTitleSamples, titleRectSummary, 24);
|
|
262
|
+
}
|
|
263
|
+
for (const needle of needles) {
|
|
264
|
+
if (props.title.includes(needle))
|
|
265
|
+
needleHits.add(needle);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const childCount = Math.min(node.children.length, layout.children.length);
|
|
270
|
+
const delta = Math.abs(node.children.length - layout.children.length);
|
|
271
|
+
if (delta > 0) {
|
|
272
|
+
const id = node.vnode.props?.id;
|
|
273
|
+
const props = node.vnode.props;
|
|
274
|
+
const label = typeof id === "string" && id.length > 0
|
|
275
|
+
? `${kind}#${id}`
|
|
276
|
+
: typeof props?.title === "string" && props.title.length > 0
|
|
277
|
+
? `${kind}[${normalizeAuditText(props.title, 32)}]`
|
|
278
|
+
: kind;
|
|
279
|
+
pushLimited(mismatchSamples, `${path}/${label}:runtimeChildren=${String(node.children.length)} layoutChildren=${String(layout.children.length)} layoutNode=${describeAuditVNode(layout.vnode)}`, 24);
|
|
280
|
+
}
|
|
281
|
+
if (delta > maxChildrenDelta)
|
|
282
|
+
maxChildrenDelta = delta;
|
|
283
|
+
for (let i = childCount - 1; i >= 0; i--) {
|
|
284
|
+
const child = node.children[i];
|
|
285
|
+
const childLayout = layout.children[i];
|
|
286
|
+
if (!child || !childLayout)
|
|
287
|
+
continue;
|
|
288
|
+
stack.push(Object.freeze({
|
|
289
|
+
node: child,
|
|
290
|
+
layout: childLayout,
|
|
291
|
+
depth: depth + 1,
|
|
292
|
+
path: `${path}/${child.vnode.kind}[${String(i)}]`,
|
|
293
|
+
}));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
const topKinds = Object.fromEntries([...kindCounts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 12));
|
|
297
|
+
const topZeroAreaKinds = Object.fromEntries([...zeroAreaKindCounts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 12));
|
|
298
|
+
return Object.freeze({
|
|
299
|
+
nodeCount,
|
|
300
|
+
textNodeCount,
|
|
301
|
+
boxTitleCount,
|
|
302
|
+
compositeNodeCount,
|
|
303
|
+
zeroAreaNodes,
|
|
304
|
+
maxDepth,
|
|
305
|
+
maxChildrenDelta,
|
|
306
|
+
topKinds,
|
|
307
|
+
topZeroAreaKinds,
|
|
308
|
+
textSamples,
|
|
309
|
+
titleSamples,
|
|
310
|
+
titleRectSamples,
|
|
311
|
+
zeroAreaTitleSamples,
|
|
312
|
+
mismatchSamples,
|
|
313
|
+
needleHits: [...needleHits].sort(),
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function findRuntimeLayoutShapeMismatch(root, layoutRoot) {
|
|
317
|
+
const queue = [
|
|
318
|
+
Object.freeze({
|
|
319
|
+
runtimeNode: root,
|
|
320
|
+
layoutNode: layoutRoot,
|
|
321
|
+
path: "root",
|
|
322
|
+
depth: 0,
|
|
323
|
+
runtimeTrail: Object.freeze([describeAuditVNode(root.vnode)]),
|
|
324
|
+
layoutTrail: Object.freeze([describeAuditVNode(layoutRoot.vnode)]),
|
|
325
|
+
}),
|
|
326
|
+
];
|
|
327
|
+
while (queue.length > 0) {
|
|
328
|
+
const current = queue.shift();
|
|
329
|
+
if (!current)
|
|
330
|
+
continue;
|
|
331
|
+
const { runtimeNode, layoutNode, path, depth, runtimeTrail, layoutTrail } = current;
|
|
332
|
+
const runtimeKind = runtimeNode.vnode.kind;
|
|
333
|
+
const layoutKind = layoutNode.vnode.kind;
|
|
334
|
+
const runtimeChildCount = runtimeNode.children.length;
|
|
335
|
+
const layoutChildCount = layoutNode.children.length;
|
|
336
|
+
if (runtimeKind !== layoutKind) {
|
|
337
|
+
return Object.freeze({
|
|
338
|
+
path,
|
|
339
|
+
depth,
|
|
340
|
+
reason: "kind",
|
|
341
|
+
runtimeKind,
|
|
342
|
+
layoutKind,
|
|
343
|
+
runtimeChildCount,
|
|
344
|
+
layoutChildCount,
|
|
345
|
+
runtimeTrail,
|
|
346
|
+
layoutTrail,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
const runtimeIdentity = readLayoutShapeIdentity(runtimeNode.vnode);
|
|
350
|
+
const layoutIdentity = readLayoutShapeIdentity(layoutNode.vnode);
|
|
351
|
+
if ((runtimeIdentity !== null || layoutIdentity !== null) &&
|
|
352
|
+
runtimeIdentity !== layoutIdentity) {
|
|
353
|
+
return Object.freeze({
|
|
354
|
+
path,
|
|
355
|
+
depth,
|
|
356
|
+
reason: "identity",
|
|
357
|
+
runtimeKind,
|
|
358
|
+
layoutKind,
|
|
359
|
+
runtimeChildCount,
|
|
360
|
+
layoutChildCount,
|
|
361
|
+
runtimeTrail,
|
|
362
|
+
layoutTrail,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
if (runtimeChildCount !== layoutChildCount) {
|
|
366
|
+
return Object.freeze({
|
|
367
|
+
path,
|
|
368
|
+
depth,
|
|
369
|
+
reason: "children",
|
|
370
|
+
runtimeKind,
|
|
371
|
+
layoutKind,
|
|
372
|
+
runtimeChildCount,
|
|
373
|
+
layoutChildCount,
|
|
374
|
+
runtimeTrail,
|
|
375
|
+
layoutTrail,
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
for (let i = 0; i < runtimeChildCount; i++) {
|
|
379
|
+
const runtimeChild = runtimeNode.children[i];
|
|
380
|
+
const layoutChild = layoutNode.children[i];
|
|
381
|
+
if (!runtimeChild || !layoutChild) {
|
|
382
|
+
return Object.freeze({
|
|
383
|
+
path: `${path}/${runtimeChild ? runtimeChild.vnode.kind : "missing"}[${String(i)}]`,
|
|
384
|
+
depth: depth + 1,
|
|
385
|
+
reason: "children",
|
|
386
|
+
runtimeKind: runtimeChild?.vnode.kind ?? "<missing>",
|
|
387
|
+
layoutKind: layoutChild?.vnode.kind ?? "<missing>",
|
|
388
|
+
runtimeChildCount: runtimeChild?.children.length ?? -1,
|
|
389
|
+
layoutChildCount: layoutChild?.children.length ?? -1,
|
|
390
|
+
runtimeTrail,
|
|
391
|
+
layoutTrail,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
const nextRuntimeTrail = Object.freeze([
|
|
395
|
+
...runtimeTrail.slice(-11),
|
|
396
|
+
describeAuditVNode(runtimeChild.vnode),
|
|
397
|
+
]);
|
|
398
|
+
const nextLayoutTrail = Object.freeze([
|
|
399
|
+
...layoutTrail.slice(-11),
|
|
400
|
+
describeAuditVNode(layoutChild.vnode),
|
|
401
|
+
]);
|
|
402
|
+
queue.push(Object.freeze({
|
|
403
|
+
runtimeNode: runtimeChild,
|
|
404
|
+
layoutNode: layoutChild,
|
|
405
|
+
path: `${path}/${runtimeChild.vnode.kind}[${String(i)}]`,
|
|
406
|
+
depth: depth + 1,
|
|
407
|
+
runtimeTrail: nextRuntimeTrail,
|
|
408
|
+
layoutTrail: nextLayoutTrail,
|
|
409
|
+
}));
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
function hasRuntimeLayoutShapeMismatch(root, layoutRoot) {
|
|
415
|
+
const runtimeStack = [root];
|
|
416
|
+
const layoutStack = [layoutRoot];
|
|
417
|
+
while (runtimeStack.length > 0 && layoutStack.length > 0) {
|
|
418
|
+
const runtimeNode = runtimeStack.pop();
|
|
419
|
+
const layoutNode = layoutStack.pop();
|
|
420
|
+
if (!runtimeNode || !layoutNode)
|
|
421
|
+
continue;
|
|
422
|
+
if (runtimeNode.vnode.kind !== layoutNode.vnode.kind)
|
|
423
|
+
return true;
|
|
424
|
+
const runtimeIdentity = readLayoutShapeIdentity(runtimeNode.vnode);
|
|
425
|
+
const layoutIdentity = readLayoutShapeIdentity(layoutNode.vnode);
|
|
426
|
+
if ((runtimeIdentity !== null || layoutIdentity !== null) &&
|
|
427
|
+
runtimeIdentity !== layoutIdentity) {
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
if (runtimeNode.children.length !== layoutNode.children.length)
|
|
431
|
+
return true;
|
|
432
|
+
for (let i = runtimeNode.children.length - 1; i >= 0; i--) {
|
|
433
|
+
const runtimeChild = runtimeNode.children[i];
|
|
434
|
+
const layoutChild = layoutNode.children[i];
|
|
435
|
+
if (!runtimeChild || !layoutChild)
|
|
436
|
+
return true;
|
|
437
|
+
runtimeStack.push(runtimeChild);
|
|
438
|
+
layoutStack.push(layoutChild);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return runtimeStack.length !== layoutStack.length;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Renderer for widget view mode.
|
|
445
|
+
*
|
|
446
|
+
* Maintains committed tree, layout, focus state, and input widget state
|
|
447
|
+
* across frames. Routes engine events to produce UI actions.
|
|
448
|
+
*
|
|
449
|
+
* @typeParam S - Application state type
|
|
450
|
+
*/
|
|
451
|
+
export class WidgetRenderer {
|
|
452
|
+
backend;
|
|
453
|
+
builder;
|
|
454
|
+
cursorShape;
|
|
455
|
+
cursorBlink;
|
|
456
|
+
collectRuntimeBreadcrumbs;
|
|
457
|
+
requestRender;
|
|
458
|
+
requestView;
|
|
459
|
+
reportUserCodeError;
|
|
460
|
+
rootPadding;
|
|
461
|
+
breakpointThresholds;
|
|
462
|
+
devMode = DEV_LAYOUT_WARNINGS;
|
|
463
|
+
warnedLayoutIssues = new Set();
|
|
464
|
+
warnedShortcutIssues = new Set();
|
|
465
|
+
/* --- Committed Tree State --- */
|
|
466
|
+
committedRoot = null;
|
|
467
|
+
layoutTree = null;
|
|
468
|
+
renderTick = 0;
|
|
469
|
+
lastViewport = Object.freeze({ cols: 0, rows: 0 });
|
|
470
|
+
terminalProfile = DEFAULT_TERMINAL_PROFILE;
|
|
471
|
+
/* --- Focus/Interaction State --- */
|
|
472
|
+
focusState = createFocusManagerState();
|
|
473
|
+
focusList = Object.freeze([]);
|
|
474
|
+
baseFocusList = Object.freeze([]);
|
|
475
|
+
enabledById = new Map();
|
|
476
|
+
baseEnabledById = new Map();
|
|
477
|
+
pressableIds = new Set();
|
|
478
|
+
pressedId = null;
|
|
479
|
+
pressedDropdown = null;
|
|
480
|
+
pressedVirtualList = null;
|
|
481
|
+
pressedTable = null;
|
|
482
|
+
pressedTableHeader = null;
|
|
483
|
+
lastTableClick = null;
|
|
484
|
+
pressedFileTree = null;
|
|
485
|
+
lastFileTreeClick = null;
|
|
486
|
+
pressedFilePicker = null;
|
|
487
|
+
lastFilePickerClick = null;
|
|
488
|
+
pressedTree = null;
|
|
489
|
+
lastTreeClick = null;
|
|
490
|
+
traps = new Map();
|
|
491
|
+
zoneMetaById = new Map();
|
|
492
|
+
focusInfoById = new Map();
|
|
493
|
+
/* --- Instance ID Allocation --- */
|
|
494
|
+
allocator = createInstanceIdAllocator(1);
|
|
495
|
+
/* --- Composite Widget State --- */
|
|
496
|
+
compositeRegistry = createCompositeInstanceRegistry();
|
|
497
|
+
errorBoundaryStatesByPath = new Map();
|
|
498
|
+
retryErrorBoundaryPaths = new Set();
|
|
499
|
+
committedErrorBoundaryPathsScratch = new Set();
|
|
500
|
+
/* --- Input Widget State --- */
|
|
501
|
+
inputById = new Map();
|
|
502
|
+
inputCursorByInstanceId = new Map();
|
|
503
|
+
inputSelectionByInstanceId = new Map();
|
|
504
|
+
inputWorkingValueByInstanceId = new Map();
|
|
505
|
+
inputUndoByInstanceId = new Map();
|
|
506
|
+
/* --- Complex Widget Local State --- */
|
|
507
|
+
virtualListStore = createVirtualListStateStore();
|
|
508
|
+
tableStore = createTableStateStore();
|
|
509
|
+
treeStore = createTreeStateStore();
|
|
510
|
+
scrollOverrides = new Map();
|
|
511
|
+
/* --- Tree Lazy-Loading Cache (per tree id, per node key) --- */
|
|
512
|
+
loadedTreeChildrenByTreeId = new Map();
|
|
513
|
+
treeLoadTokenByTreeAndKey = new Map();
|
|
514
|
+
nextTreeLoadToken = 1;
|
|
515
|
+
/* --- Complex Widget Metadata (rebuilt each commit) --- */
|
|
516
|
+
virtualListById = new Map();
|
|
517
|
+
buttonById = new Map();
|
|
518
|
+
linkById = new Map();
|
|
519
|
+
tableById = new Map();
|
|
520
|
+
treeById = new Map();
|
|
521
|
+
dropdownById = new Map();
|
|
522
|
+
sliderById = new Map();
|
|
523
|
+
selectById = new Map();
|
|
524
|
+
checkboxById = new Map();
|
|
525
|
+
radioGroupById = new Map();
|
|
526
|
+
// Advanced widgets (GitHub issue #136)
|
|
527
|
+
commandPaletteById = new Map();
|
|
528
|
+
filePickerById = new Map();
|
|
529
|
+
fileTreeExplorerById = new Map();
|
|
530
|
+
splitPaneById = new Map();
|
|
531
|
+
codeEditorById = new Map();
|
|
532
|
+
diffViewerById = new Map();
|
|
533
|
+
toolApprovalDialogById = new Map();
|
|
534
|
+
logsConsoleById = new Map();
|
|
535
|
+
/* --- Advanced Widget Runtime State --- */
|
|
536
|
+
rectById = new Map();
|
|
537
|
+
splitPaneChildRectsById = new Map();
|
|
538
|
+
toastContainers = Object.freeze([]);
|
|
539
|
+
toastActionByFocusId = new Map();
|
|
540
|
+
toastActionLabelByFocusId = new Map();
|
|
541
|
+
toastFocusableActionIds = Object.freeze([]);
|
|
542
|
+
commandPaletteItemsById = new Map();
|
|
543
|
+
commandPaletteLoadingById = new Map();
|
|
544
|
+
commandPaletteFetchTokenById = new Map();
|
|
545
|
+
commandPaletteLastQueryById = new Map();
|
|
546
|
+
commandPaletteLastSourcesRefById = new Map();
|
|
547
|
+
toolApprovalFocusedActionById = new Map();
|
|
548
|
+
diffViewerFocusedHunkById = new Map();
|
|
549
|
+
diffViewerExpandedHunksById = new Map();
|
|
550
|
+
logsConsoleLastGTimeById = new Map();
|
|
551
|
+
// Tracks whether the currently committed tree needs routing rebuild traversals.
|
|
552
|
+
hadRoutingWidgets = false;
|
|
553
|
+
hasAnimatedWidgetsInCommittedTree = false;
|
|
554
|
+
hasActivePositionTransitions = false;
|
|
555
|
+
hasActiveExitTransitions = false;
|
|
556
|
+
hasViewportAwareCompositesInCommittedTree = false;
|
|
557
|
+
positionTransitionTrackByInstanceId = new Map();
|
|
558
|
+
exitTransitionTrackByInstanceId = new Map();
|
|
559
|
+
exitRenderNodeByInstanceId = new Map();
|
|
560
|
+
animatedRectByInstanceId = new Map();
|
|
561
|
+
animatedOpacityByInstanceId = new Map();
|
|
562
|
+
exitAnimatedRectByInstanceId = new Map();
|
|
563
|
+
exitAnimatedOpacityByInstanceId = new Map();
|
|
564
|
+
/* --- Render Caches (avoid per-frame recompute) --- */
|
|
565
|
+
tableRenderCacheById = new Map();
|
|
566
|
+
logsConsoleRenderCacheById = new Map();
|
|
567
|
+
diffRenderCacheById = new Map();
|
|
568
|
+
codeEditorRenderCacheById = new Map();
|
|
569
|
+
splitPaneDrag = null;
|
|
570
|
+
splitPaneLastDividerDown = null;
|
|
571
|
+
/* --- Overlay Routing State (rebuilt each commit) --- */
|
|
572
|
+
layerRegistry = createLayerRegistry();
|
|
573
|
+
layerStack = Object.freeze([]);
|
|
574
|
+
closeOnEscapeByLayerId = new Map();
|
|
575
|
+
closeOnBackdropByLayerId = new Map();
|
|
576
|
+
onCloseByLayerId = new Map();
|
|
577
|
+
dropdownStack = Object.freeze([]);
|
|
578
|
+
dropdownSelectedIndexById = new Map();
|
|
579
|
+
dropdownWindowStartById = new Map();
|
|
580
|
+
overlayShortcutOwners = Object.freeze([]);
|
|
581
|
+
overlayShortcutBySequence = new Map();
|
|
582
|
+
overlayShortcutTrie = buildTrie(Object.freeze([]));
|
|
583
|
+
overlayShortcutChordState = resetChordState();
|
|
584
|
+
/* --- Pooled Collections (reused per-frame to reduce GC pressure) --- */
|
|
585
|
+
_metadataCollector = createWidgetMetadataCollector();
|
|
586
|
+
_pooledRectByInstanceId = new Map();
|
|
587
|
+
_pooledInteractiveIdIndex = new Map();
|
|
588
|
+
_pooledLayoutSigByInstanceId = new Map();
|
|
589
|
+
_pooledNextLayoutSigByInstanceId = new Map();
|
|
590
|
+
_pooledChangedRenderInstanceIds = [];
|
|
591
|
+
_pooledRemovedRenderInstanceIds = [];
|
|
592
|
+
_pooledRectById = new Map();
|
|
593
|
+
_pooledSplitPaneChildRectsById = new Map();
|
|
594
|
+
_prevFrameRectByInstanceId = new Map();
|
|
595
|
+
_prevFrameOpacityByInstanceId = new Map();
|
|
596
|
+
_prevFrameRectById = new Map();
|
|
597
|
+
_pooledDamageRectByInstanceId = new Map();
|
|
598
|
+
_pooledDamageRectById = new Map();
|
|
599
|
+
_prevFrameDamageRectByInstanceId = new Map();
|
|
600
|
+
_prevFrameDamageRectById = new Map();
|
|
601
|
+
_pooledDamageRects = [];
|
|
602
|
+
_pooledMergedDamageRects = [];
|
|
603
|
+
_hasRenderedFrame = false;
|
|
604
|
+
_lastRenderedViewport = Object.freeze({ cols: 0, rows: 0 });
|
|
605
|
+
_lastRenderedThemeRef = null;
|
|
606
|
+
_lastRenderedFocusedId = null;
|
|
607
|
+
_lastRenderedFocusAnnouncement = null;
|
|
608
|
+
_layoutMeasureCache = new WeakMap();
|
|
609
|
+
_layoutTreeCache = new WeakMap();
|
|
610
|
+
_constraintGraph = null;
|
|
611
|
+
_constraintInputKey = null;
|
|
612
|
+
_constraintValuesByInstanceId = null;
|
|
613
|
+
_constraintInputSignatureValid = false;
|
|
614
|
+
_constraintInputSignature = [];
|
|
615
|
+
_constraintResolutionCache = new ConstraintResolutionCache(8);
|
|
616
|
+
_constraintHasStaticHiddenDisplay = false;
|
|
617
|
+
_constraintAffectedPathInstanceIds = new Set();
|
|
618
|
+
_constraintNodesWithAffectedDescendants = new Set();
|
|
619
|
+
_hiddenConstraintInstanceIds = new Set();
|
|
620
|
+
_hiddenConstraintWidgetIds = new Set();
|
|
621
|
+
_pooledConstraintBaseValues = new Map();
|
|
622
|
+
_pooledConstraintParentValues = new Map();
|
|
623
|
+
_pooledConstraintIntrinsicValues = new Map();
|
|
624
|
+
_pooledConstraintParentByInstanceId = new Map();
|
|
625
|
+
_pooledConstraintAffectedPathInstanceIds = new Set();
|
|
626
|
+
_pooledConstraintNodesWithAffectedDescendants = new Set();
|
|
627
|
+
_pooledConstraintRuntimeStack = [];
|
|
628
|
+
_pooledConstraintParentStack = [];
|
|
629
|
+
_pooledConstraintAxisStack = [];
|
|
630
|
+
_pooledConstraintVisibilityStack = [];
|
|
631
|
+
_pooledHiddenConstraintInstanceIds = new Set();
|
|
632
|
+
_pooledHiddenConstraintWidgetIds = new Set();
|
|
633
|
+
_pooledCloseOnEscape = new Map();
|
|
634
|
+
_pooledCloseOnBackdrop = new Map();
|
|
635
|
+
_pooledOnClose = new Map();
|
|
636
|
+
_pooledToastActionByFocusId = new Map();
|
|
637
|
+
_pooledToastActionLabelByFocusId = new Map();
|
|
638
|
+
_pooledLayoutStack = [];
|
|
639
|
+
_pooledRuntimeStack = [];
|
|
640
|
+
_pooledRuntimeParentKindStack = [];
|
|
641
|
+
_pooledParentInstanceIdStack = [];
|
|
642
|
+
_pooledOffsetXStack = [];
|
|
643
|
+
_pooledOffsetYStack = [];
|
|
644
|
+
_pooledDirtyLayoutInstanceIds = [];
|
|
645
|
+
_pooledPrevRuntimeStack = [];
|
|
646
|
+
_pooledPrevLayoutSubtreeByInstanceId = new Map();
|
|
647
|
+
_pooledDamageRuntimeStack = [];
|
|
648
|
+
_pooledVisitedTransitionIds = new Set();
|
|
649
|
+
_pooledDropdownStack = [];
|
|
650
|
+
_pooledOverlayShortcutOwners = [];
|
|
651
|
+
_pooledToastContainers = [];
|
|
652
|
+
_pooledToastFocusableActionIds = [];
|
|
653
|
+
_pooledActiveExitKeys = new Set();
|
|
654
|
+
_pooledPrevTreeIds = new Set();
|
|
655
|
+
_runtimeBreadcrumbs = EMPTY_WIDGET_RUNTIME_BREADCRUMBS;
|
|
656
|
+
forceFullRenderOnNextSubmit = false;
|
|
657
|
+
_constraintBreadcrumbs = null;
|
|
658
|
+
_constraintExprIndexByInstanceId = null;
|
|
659
|
+
_constraintLastResolution = CONSTRAINT_RESOLUTION_NONE;
|
|
660
|
+
_constraintLastCacheKey = null;
|
|
661
|
+
constructor(opts) {
|
|
662
|
+
this.backend = opts.backend;
|
|
663
|
+
this.cursorShape = opts.cursorShape ?? CURSOR_DEFAULTS.input.shape;
|
|
664
|
+
this.cursorBlink = opts.cursorBlink ?? CURSOR_DEFAULTS.input.blink;
|
|
665
|
+
this.collectRuntimeBreadcrumbs = opts.collectRuntimeBreadcrumbs === true;
|
|
666
|
+
this.requestRender = opts.requestRender ?? (() => { });
|
|
667
|
+
this.requestView = opts.requestView ?? (() => { });
|
|
668
|
+
this.reportUserCodeError =
|
|
669
|
+
opts.onUserCodeError ??
|
|
670
|
+
((detail) => {
|
|
671
|
+
warnDev(`[rezi][runtime] ${detail}`);
|
|
672
|
+
});
|
|
673
|
+
this.rootPadding = Math.max(0, Math.trunc(opts.rootPadding ?? 0));
|
|
674
|
+
this.breakpointThresholds = normalizeBreakpointThresholds(opts.breakpointThresholds);
|
|
675
|
+
this.terminalProfile = opts.terminalProfile ?? DEFAULT_TERMINAL_PROFILE;
|
|
676
|
+
// Widget rendering is generated from validated layout/runtime data, so we
|
|
677
|
+
// default builder param validation off here to reduce per-command overhead.
|
|
678
|
+
const validateParams = opts.drawlistValidateParams ?? false;
|
|
679
|
+
const builderOpts = {
|
|
680
|
+
...(opts.maxDrawlistBytes === undefined ? {} : { maxDrawlistBytes: opts.maxDrawlistBytes }),
|
|
681
|
+
validateParams,
|
|
682
|
+
...(opts.drawlistReuseOutputBuffer === undefined
|
|
683
|
+
? {}
|
|
684
|
+
: { reuseOutputBuffer: opts.drawlistReuseOutputBuffer }),
|
|
685
|
+
encodedStringCacheCap: opts.drawlistEncodedStringCacheCap ?? 131072,
|
|
686
|
+
};
|
|
687
|
+
if (opts.builder) {
|
|
688
|
+
this.builder = opts.builder;
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
this.builder = createDrawlistBuilder(builderOpts);
|
|
692
|
+
}
|
|
693
|
+
hasAnimatedWidgets() {
|
|
694
|
+
return (this.hasAnimatedWidgetsInCommittedTree ||
|
|
695
|
+
this.hasActivePositionTransitions ||
|
|
696
|
+
this.hasActiveExitTransitions);
|
|
697
|
+
}
|
|
698
|
+
hasViewportAwareComposites() {
|
|
699
|
+
return this.hasViewportAwareCompositesInCommittedTree;
|
|
700
|
+
}
|
|
701
|
+
invalidateCompositeWidgets() {
|
|
702
|
+
const ids = this.compositeRegistry.getAllIds();
|
|
703
|
+
for (const id of ids) {
|
|
704
|
+
this.compositeRegistry.invalidate(id);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
forceFullRenderNextFrame() {
|
|
708
|
+
this.forceFullRenderOnNextSubmit = true;
|
|
709
|
+
}
|
|
710
|
+
describeLayoutNode(node) {
|
|
711
|
+
return describeLayoutNodeImpl(node);
|
|
712
|
+
}
|
|
713
|
+
warnLayoutIssue(key, detail) {
|
|
714
|
+
warnLayoutIssueImpl({
|
|
715
|
+
devMode: this.devMode,
|
|
716
|
+
warnedLayoutIssues: this.warnedLayoutIssues,
|
|
717
|
+
warn: warnDev,
|
|
718
|
+
}, key, detail);
|
|
719
|
+
}
|
|
720
|
+
warnShortcutIssue(key, detail) {
|
|
721
|
+
warnShortcutIssueImpl({
|
|
722
|
+
devMode: DEV_MODE,
|
|
723
|
+
warnedShortcutIssues: this.warnedShortcutIssues,
|
|
724
|
+
warn: warnDev,
|
|
725
|
+
}, key, detail);
|
|
726
|
+
}
|
|
727
|
+
selectDropdownShortcutItem(dropdownId, itemId) {
|
|
728
|
+
return selectDropdownShortcutItemImpl({
|
|
729
|
+
dropdownById: this.dropdownById,
|
|
730
|
+
dropdownSelectedIndexById: this.dropdownSelectedIndexById,
|
|
731
|
+
clearPressedDropdown: () => {
|
|
732
|
+
this.pressedDropdown = null;
|
|
733
|
+
},
|
|
734
|
+
}, dropdownId, itemId);
|
|
735
|
+
}
|
|
736
|
+
selectCommandPaletteShortcutItem(paletteId, itemId) {
|
|
737
|
+
return selectCommandPaletteShortcutItemImpl({
|
|
738
|
+
commandPaletteById: this.commandPaletteById,
|
|
739
|
+
commandPaletteItemsById: this.commandPaletteItemsById,
|
|
740
|
+
}, paletteId, itemId);
|
|
741
|
+
}
|
|
742
|
+
invokeOverlayShortcutTarget(target) {
|
|
743
|
+
return invokeOverlayShortcutTargetImpl({
|
|
744
|
+
dropdownById: this.dropdownById,
|
|
745
|
+
dropdownSelectedIndexById: this.dropdownSelectedIndexById,
|
|
746
|
+
clearPressedDropdown: () => {
|
|
747
|
+
this.pressedDropdown = null;
|
|
748
|
+
},
|
|
749
|
+
commandPaletteById: this.commandPaletteById,
|
|
750
|
+
commandPaletteItemsById: this.commandPaletteItemsById,
|
|
751
|
+
}, target);
|
|
752
|
+
}
|
|
753
|
+
registerOverlayShortcut(shortcutRaw, target, ownerLabel) {
|
|
754
|
+
registerOverlayShortcutImpl({
|
|
755
|
+
overlayShortcutBySequence: this.overlayShortcutBySequence,
|
|
756
|
+
warnShortcutIssue: (key, detail) => this.warnShortcutIssue(key, detail),
|
|
757
|
+
}, shortcutRaw, target, ownerLabel);
|
|
758
|
+
}
|
|
759
|
+
rebuildOverlayShortcutBindings() {
|
|
760
|
+
const rebuilt = rebuildOverlayShortcutBindingsImpl({
|
|
761
|
+
overlayShortcutBySequence: this.overlayShortcutBySequence,
|
|
762
|
+
overlayShortcutOwners: this.overlayShortcutOwners,
|
|
763
|
+
dropdownById: this.dropdownById,
|
|
764
|
+
commandPaletteById: this.commandPaletteById,
|
|
765
|
+
commandPaletteItemsById: this.commandPaletteItemsById,
|
|
766
|
+
warnShortcutIssue: (key, detail) => this.warnShortcutIssue(key, detail),
|
|
767
|
+
});
|
|
768
|
+
this.overlayShortcutChordState = rebuilt.overlayShortcutChordState;
|
|
769
|
+
this.overlayShortcutTrie = rebuilt.overlayShortcutTrie;
|
|
770
|
+
}
|
|
771
|
+
routeOverlayShortcut(event) {
|
|
772
|
+
const routed = routeOverlayShortcutImpl(event, {
|
|
773
|
+
overlayShortcutBySequence: this.overlayShortcutBySequence,
|
|
774
|
+
overlayShortcutTrie: this.overlayShortcutTrie,
|
|
775
|
+
overlayShortcutChordState: this.overlayShortcutChordState,
|
|
776
|
+
invokeTarget: (target) => this.invokeOverlayShortcutTarget(target),
|
|
777
|
+
});
|
|
778
|
+
this.overlayShortcutChordState = routed.nextChordState;
|
|
779
|
+
return routed.result;
|
|
780
|
+
}
|
|
781
|
+
emitDevLayoutWarnings(root, viewport) {
|
|
782
|
+
emitDevLayoutWarningsImpl({
|
|
783
|
+
devMode: this.devMode,
|
|
784
|
+
warnedLayoutIssues: this.warnedLayoutIssues,
|
|
785
|
+
warn: warnDev,
|
|
786
|
+
pooledLayoutStack: this._pooledLayoutStack,
|
|
787
|
+
}, root, viewport);
|
|
788
|
+
}
|
|
789
|
+
recomputeAnimatedWidgetPresence(runtimeRoot) {
|
|
790
|
+
this.hasAnimatedWidgetsInCommittedTree = recomputeAnimatedWidgetPresenceImpl(runtimeRoot, this._pooledRuntimeStack);
|
|
791
|
+
}
|
|
792
|
+
readContainerOpacity(node) {
|
|
793
|
+
return readContainerOpacityImpl(node);
|
|
794
|
+
}
|
|
795
|
+
refreshPositionTransitionTracks(runtimeRoot, layoutRoot, frameNowMs) {
|
|
796
|
+
refreshPositionTransitionTracksImpl({
|
|
797
|
+
runtimeRoot,
|
|
798
|
+
layoutRoot,
|
|
799
|
+
frameNowMs,
|
|
800
|
+
pooledVisitedTransitionIds: this._pooledVisitedTransitionIds,
|
|
801
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
802
|
+
pooledLayoutStack: this._pooledLayoutStack,
|
|
803
|
+
positionTransitionTrackByInstanceId: this.positionTransitionTrackByInstanceId,
|
|
804
|
+
animatedRectByInstanceId: this.animatedRectByInstanceId,
|
|
805
|
+
animatedOpacityByInstanceId: this.animatedOpacityByInstanceId,
|
|
806
|
+
prevFrameRectByInstanceId: this._prevFrameRectByInstanceId,
|
|
807
|
+
prevFrameOpacityByInstanceId: this._prevFrameOpacityByInstanceId,
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
rebuildAnimatedRectOverrides(runtimeRoot, layoutRoot, frameNowMs) {
|
|
811
|
+
this.hasActivePositionTransitions = rebuildAnimatedRectOverridesImpl({
|
|
812
|
+
runtimeRoot,
|
|
813
|
+
layoutRoot,
|
|
814
|
+
frameNowMs,
|
|
815
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
816
|
+
pooledLayoutStack: this._pooledLayoutStack,
|
|
817
|
+
pooledOffsetXStack: this._pooledOffsetXStack,
|
|
818
|
+
pooledOffsetYStack: this._pooledOffsetYStack,
|
|
819
|
+
positionTransitionTrackByInstanceId: this.positionTransitionTrackByInstanceId,
|
|
820
|
+
animatedRectByInstanceId: this.animatedRectByInstanceId,
|
|
821
|
+
animatedOpacityByInstanceId: this.animatedOpacityByInstanceId,
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
collectLayoutSubtreeByInstanceId(runtimeRoot, layoutRoot, out) {
|
|
825
|
+
out.clear();
|
|
826
|
+
this._pooledRuntimeStack.length = 0;
|
|
827
|
+
this._pooledLayoutStack.length = 0;
|
|
828
|
+
this._pooledRuntimeStack.push(runtimeRoot);
|
|
829
|
+
this._pooledLayoutStack.push(layoutRoot);
|
|
830
|
+
while (this._pooledRuntimeStack.length > 0 && this._pooledLayoutStack.length > 0) {
|
|
831
|
+
const runtimeNode = this._pooledRuntimeStack.pop();
|
|
832
|
+
const layoutNode = this._pooledLayoutStack.pop();
|
|
833
|
+
if (!runtimeNode || !layoutNode)
|
|
834
|
+
continue;
|
|
835
|
+
out.set(runtimeNode.instanceId, layoutNode);
|
|
836
|
+
const childCount = Math.min(runtimeNode.children.length, layoutNode.children.length);
|
|
837
|
+
for (let i = childCount - 1; i >= 0; i--) {
|
|
838
|
+
const runtimeChild = runtimeNode.children[i];
|
|
839
|
+
const layoutChild = layoutNode.children[i];
|
|
840
|
+
if (runtimeChild && layoutChild) {
|
|
841
|
+
this._pooledRuntimeStack.push(runtimeChild);
|
|
842
|
+
this._pooledLayoutStack.push(layoutChild);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
cleanupUnmountedInstanceIds(unmountedInstanceIds, opts = {}) {
|
|
848
|
+
const skipIds = opts.skipIds;
|
|
849
|
+
for (const unmountedId of unmountedInstanceIds) {
|
|
850
|
+
if (skipIds?.has(unmountedId))
|
|
851
|
+
continue;
|
|
852
|
+
this.inputCursorByInstanceId.delete(unmountedId);
|
|
853
|
+
this.inputSelectionByInstanceId.delete(unmountedId);
|
|
854
|
+
this.inputWorkingValueByInstanceId.delete(unmountedId);
|
|
855
|
+
this.inputUndoByInstanceId.delete(unmountedId);
|
|
856
|
+
this.positionTransitionTrackByInstanceId.delete(unmountedId);
|
|
857
|
+
this.exitTransitionTrackByInstanceId.delete(unmountedId);
|
|
858
|
+
this.exitRenderNodeByInstanceId.delete(unmountedId);
|
|
859
|
+
this.animatedRectByInstanceId.delete(unmountedId);
|
|
860
|
+
this.animatedOpacityByInstanceId.delete(unmountedId);
|
|
861
|
+
this.exitAnimatedRectByInstanceId.delete(unmountedId);
|
|
862
|
+
this.exitAnimatedOpacityByInstanceId.delete(unmountedId);
|
|
863
|
+
this._prevFrameOpacityByInstanceId.delete(unmountedId);
|
|
864
|
+
this.compositeRegistry.incrementGeneration(unmountedId);
|
|
865
|
+
this.compositeRegistry.delete(unmountedId);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
scheduleExitAnimations(pendingExitAnimations, frameNowMs, prevLayoutSubtreeByInstanceId) {
|
|
869
|
+
if (pendingExitAnimations.length === 0)
|
|
870
|
+
return;
|
|
871
|
+
if (!prevLayoutSubtreeByInstanceId) {
|
|
872
|
+
for (const pending of pendingExitAnimations) {
|
|
873
|
+
pending.runDeferredLocalStateCleanup();
|
|
874
|
+
this.cleanupUnmountedInstanceIds(pending.subtreeInstanceIds);
|
|
875
|
+
}
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
const missingLayout = scheduleExitAnimationsImpl({
|
|
879
|
+
pendingExitAnimations,
|
|
880
|
+
frameNowMs,
|
|
881
|
+
layoutSubtreeByInstanceId: prevLayoutSubtreeByInstanceId,
|
|
882
|
+
prevFrameOpacityByInstanceId: this._prevFrameOpacityByInstanceId,
|
|
883
|
+
exitTransitionTrackByInstanceId: this.exitTransitionTrackByInstanceId,
|
|
884
|
+
exitRenderNodeByInstanceId: this.exitRenderNodeByInstanceId,
|
|
885
|
+
});
|
|
886
|
+
for (const pending of missingLayout) {
|
|
887
|
+
pending.runDeferredLocalStateCleanup();
|
|
888
|
+
this.cleanupUnmountedInstanceIds(pending.subtreeInstanceIds);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
sampleExitAnimations(frameNowMs) {
|
|
892
|
+
const sampled = sampleExitAnimationsImpl({
|
|
893
|
+
frameNowMs,
|
|
894
|
+
exitTransitionTrackByInstanceId: this.exitTransitionTrackByInstanceId,
|
|
895
|
+
exitRenderNodeByInstanceId: this.exitRenderNodeByInstanceId,
|
|
896
|
+
exitAnimatedRectByInstanceId: this.exitAnimatedRectByInstanceId,
|
|
897
|
+
exitAnimatedOpacityByInstanceId: this.exitAnimatedOpacityByInstanceId,
|
|
898
|
+
});
|
|
899
|
+
this.hasActiveExitTransitions = sampled.hasActiveExitTransitions;
|
|
900
|
+
return sampled.completedExitNodes;
|
|
901
|
+
}
|
|
902
|
+
cancelExitTransitionsForReappearedKeys(runtimeRoot) {
|
|
903
|
+
if (this.exitRenderNodeByInstanceId.size === 0)
|
|
904
|
+
return;
|
|
905
|
+
this._pooledActiveExitKeys.clear();
|
|
906
|
+
this._pooledRuntimeStack.length = 0;
|
|
907
|
+
this._pooledParentInstanceIdStack.length = 0;
|
|
908
|
+
this._pooledRuntimeStack.push(runtimeRoot);
|
|
909
|
+
this._pooledParentInstanceIdStack.push(0);
|
|
910
|
+
while (this._pooledRuntimeStack.length > 0) {
|
|
911
|
+
const node = this._pooledRuntimeStack.pop();
|
|
912
|
+
const parentInstanceId = this._pooledParentInstanceIdStack.pop();
|
|
913
|
+
if (!node)
|
|
914
|
+
continue;
|
|
915
|
+
if (parentInstanceId === undefined)
|
|
916
|
+
continue;
|
|
917
|
+
const props = node.vnode.props;
|
|
918
|
+
const key = typeof props?.key === "string" ? props.key : undefined;
|
|
919
|
+
if (key) {
|
|
920
|
+
this._pooledActiveExitKeys.add(`${String(parentInstanceId)}:${node.vnode.kind}:${key}`);
|
|
921
|
+
}
|
|
922
|
+
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
923
|
+
const child = node.children[i];
|
|
924
|
+
if (child) {
|
|
925
|
+
this._pooledRuntimeStack.push(child);
|
|
926
|
+
this._pooledParentInstanceIdStack.push(node.instanceId);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
for (const exitNode of this.exitRenderNodeByInstanceId.values()) {
|
|
931
|
+
if (!exitNode.key)
|
|
932
|
+
continue;
|
|
933
|
+
if (!this._pooledActiveExitKeys.has(`${String(exitNode.parentInstanceId)}:${exitNode.vnodeKind}:${exitNode.key}`)) {
|
|
934
|
+
continue;
|
|
935
|
+
}
|
|
936
|
+
exitNode.runDeferredLocalStateCleanup();
|
|
937
|
+
this.cleanupUnmountedInstanceIds(exitNode.subtreeInstanceIds);
|
|
938
|
+
}
|
|
939
|
+
this._pooledActiveExitKeys.clear();
|
|
940
|
+
this._pooledParentInstanceIdStack.length = 0;
|
|
941
|
+
}
|
|
942
|
+
renderExitTransitionNodes(viewport, theme, tick, cursorInfo, focusAnnouncement) {
|
|
943
|
+
if (this.exitRenderNodeByInstanceId.size === 0)
|
|
944
|
+
return;
|
|
945
|
+
for (const exitNode of this.exitRenderNodeByInstanceId.values()) {
|
|
946
|
+
renderTree(this.builder, this.focusState, exitNode.layoutRoot, this._pooledRectById, viewport, theme, tick, DEFAULT_BASE_STYLE, exitNode.runtimeRoot, this.exitAnimatedRectByInstanceId, this.exitAnimatedOpacityByInstanceId, cursorInfo, this.virtualListStore, this.tableStore, this.treeStore, this.loadedTreeChildrenByTreeId, this.commandPaletteItemsById, this.commandPaletteLoadingById, this.toolApprovalFocusedActionById, this.dropdownSelectedIndexById, this.dropdownWindowStartById, this.diffViewerFocusedHunkById, this.diffViewerExpandedHunksById, this.tableRenderCacheById, this.logsConsoleRenderCacheById, this.diffRenderCacheById, this.codeEditorRenderCacheById, focusAnnouncement, undefined, this.terminalProfile, this.pressedId);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Get the currently focused widget ID.
|
|
951
|
+
*
|
|
952
|
+
* @returns Focused widget ID or null if nothing focused
|
|
953
|
+
*/
|
|
954
|
+
getFocusedId() {
|
|
955
|
+
return this.focusState.focusedId;
|
|
956
|
+
}
|
|
957
|
+
buildFallbackFocusInfo(id) {
|
|
958
|
+
return buildFallbackFocusInfoImpl({ toastActionLabelByFocusId: this.toastActionLabelByFocusId }, id);
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* Get structured focus semantics for the currently focused widget.
|
|
962
|
+
*/
|
|
963
|
+
getCurrentFocusInfo() {
|
|
964
|
+
const focusedId = this.focusState.focusedId;
|
|
965
|
+
if (focusedId === null)
|
|
966
|
+
return EMPTY_FOCUS_INFO;
|
|
967
|
+
return this.focusInfoById.get(focusedId) ?? this.buildFallbackFocusInfo(focusedId);
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* Get the user-facing announcement string for the current focus target.
|
|
971
|
+
*/
|
|
972
|
+
getFocusAnnouncement() {
|
|
973
|
+
return this.getCurrentFocusInfo().announcement;
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Capture the current focus/routing metadata for app-level route restoration.
|
|
977
|
+
*/
|
|
978
|
+
captureFocusSnapshot() {
|
|
979
|
+
return captureFocusSnapshotState(this.focusState, this.focusList, this.baseFocusList, this.enabledById, this.baseEnabledById, this.pressableIds, this.traps, this.zoneMetaById);
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Restore a previously captured focus snapshot.
|
|
983
|
+
*/
|
|
984
|
+
restoreFocusSnapshot(snapshot) {
|
|
985
|
+
const restored = restoreFocusSnapshotState(snapshot);
|
|
986
|
+
this.focusState = restored.focusState;
|
|
987
|
+
this.focusList = restored.focusList;
|
|
988
|
+
this.baseFocusList = restored.baseFocusList;
|
|
989
|
+
this.enabledById = restored.enabledById;
|
|
990
|
+
this.baseEnabledById = restored.baseEnabledById;
|
|
991
|
+
this.pressableIds = restored.pressableIds;
|
|
992
|
+
this.traps = restored.traps;
|
|
993
|
+
this.zoneMetaById = restored.zoneMetaById;
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Get the latest committed id->rect layout index.
|
|
997
|
+
*/
|
|
998
|
+
getRectByIdIndex() {
|
|
999
|
+
return this.rectById;
|
|
1000
|
+
}
|
|
1001
|
+
setTerminalProfile(next) {
|
|
1002
|
+
this.terminalProfile = next;
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* Get the latest runtime breadcrumb snapshot for inspector/export.
|
|
1006
|
+
*
|
|
1007
|
+
* Returns null when breadcrumb capture is disabled.
|
|
1008
|
+
*/
|
|
1009
|
+
getRuntimeBreadcrumbSnapshot() {
|
|
1010
|
+
return this.collectRuntimeBreadcrumbs ? this._runtimeBreadcrumbs : null;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Enable or disable runtime breadcrumb snapshot capture.
|
|
1014
|
+
*/
|
|
1015
|
+
setRuntimeBreadcrumbCaptureEnabled(enabled) {
|
|
1016
|
+
if (this.collectRuntimeBreadcrumbs === enabled)
|
|
1017
|
+
return;
|
|
1018
|
+
this.collectRuntimeBreadcrumbs = enabled;
|
|
1019
|
+
if (!enabled) {
|
|
1020
|
+
this._runtimeBreadcrumbs = EMPTY_WIDGET_RUNTIME_BREADCRUMBS;
|
|
1021
|
+
this._constraintBreadcrumbs = null;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
hasActiveOverlay() {
|
|
1025
|
+
return this.dropdownStack.length > 0 || this.layerRegistry.getTopmostModal() !== undefined;
|
|
1026
|
+
}
|
|
1027
|
+
reportInputCallbackError(name, error) {
|
|
1028
|
+
const detail = `${name} handler threw: ${describeThrown(error)}`;
|
|
1029
|
+
try {
|
|
1030
|
+
this.reportUserCodeError(detail);
|
|
1031
|
+
}
|
|
1032
|
+
catch (sinkError) {
|
|
1033
|
+
const c = globalThis.console;
|
|
1034
|
+
c?.error?.(`[rezi][runtime] onUserCodeError sink threw while reporting ${name}: ${describeThrown(sinkError)}; original=${detail}`);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
reportFocusZoneCallbackError(phase, error) {
|
|
1038
|
+
const detail = `focusZone ${phase} threw: ${describeThrown(error)}`;
|
|
1039
|
+
try {
|
|
1040
|
+
this.reportUserCodeError(detail);
|
|
1041
|
+
}
|
|
1042
|
+
catch (sinkError) {
|
|
1043
|
+
const c = globalThis.console;
|
|
1044
|
+
c?.error?.(`[rezi][runtime] onUserCodeError sink threw while reporting focusZone ${phase}: ${describeThrown(sinkError)}; original=${detail}`);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
invokeBlurCallbackSafely(callback) {
|
|
1048
|
+
if (typeof callback !== "function")
|
|
1049
|
+
return;
|
|
1050
|
+
try {
|
|
1051
|
+
callback();
|
|
1052
|
+
}
|
|
1053
|
+
catch (error) {
|
|
1054
|
+
this.reportInputCallbackError("onBlur", error);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* Determine whether a key event should bypass the keybinding system.
|
|
1059
|
+
*
|
|
1060
|
+
* Why: Active overlays own keyboard interaction. Global keybindings should
|
|
1061
|
+
* not preempt dropdown navigation, modal dismissal, or overlay-local
|
|
1062
|
+
* shortcuts while an overlay is present.
|
|
1063
|
+
*/
|
|
1064
|
+
shouldBypassKeybindings(event) {
|
|
1065
|
+
if (event.kind !== "key" || event.action !== "down")
|
|
1066
|
+
return false;
|
|
1067
|
+
return this.hasActiveOverlay();
|
|
1068
|
+
}
|
|
1069
|
+
writeSelectedTextToClipboard(text) {
|
|
1070
|
+
if (text.length === 0)
|
|
1071
|
+
return;
|
|
1072
|
+
const writeRaw = getBackendRawWriter(this.backend);
|
|
1073
|
+
if (!writeRaw)
|
|
1074
|
+
return;
|
|
1075
|
+
const seq = buildOsc52ClipboardSequence(text);
|
|
1076
|
+
if (seq.length === 0)
|
|
1077
|
+
return;
|
|
1078
|
+
try {
|
|
1079
|
+
writeRaw(seq);
|
|
1080
|
+
}
|
|
1081
|
+
catch {
|
|
1082
|
+
// Clipboard writes are best-effort and must not break event routing.
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
readInputSnapshot(meta) {
|
|
1086
|
+
return readInputSnapshotImpl(meta, this.inputWorkingValueByInstanceId, this.inputCursorByInstanceId, this.inputSelectionByInstanceId);
|
|
1087
|
+
}
|
|
1088
|
+
applyInputSnapshot(instanceId, snap) {
|
|
1089
|
+
applyInputSnapshotImpl(instanceId, snap, this.inputWorkingValueByInstanceId, this.inputCursorByInstanceId, this.inputSelectionByInstanceId);
|
|
1090
|
+
}
|
|
1091
|
+
getInputUndoStack(instanceId) {
|
|
1092
|
+
return getInputUndoStackImpl(instanceId, this.inputUndoByInstanceId);
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* Route an engine event through the widget tree.
|
|
1096
|
+
*
|
|
1097
|
+
* Handles focus traversal (Tab/Shift+Tab), mouse interactions,
|
|
1098
|
+
* keyboard activation (Enter/Space), and input widget editing.
|
|
1099
|
+
*
|
|
1100
|
+
* @param event - Engine event from ZREV parsing
|
|
1101
|
+
* @returns Routing outcome with render flag and optional action
|
|
1102
|
+
*/
|
|
1103
|
+
routeEngineEvent(event) {
|
|
1104
|
+
const state = {
|
|
1105
|
+
focusState: this.focusState,
|
|
1106
|
+
pressedId: this.pressedId,
|
|
1107
|
+
pressedDropdown: this.pressedDropdown,
|
|
1108
|
+
pressedVirtualList: this.pressedVirtualList,
|
|
1109
|
+
pressedTable: this.pressedTable,
|
|
1110
|
+
pressedTableHeader: this.pressedTableHeader,
|
|
1111
|
+
lastTableClick: this.lastTableClick,
|
|
1112
|
+
pressedFileTree: this.pressedFileTree,
|
|
1113
|
+
lastFileTreeClick: this.lastFileTreeClick,
|
|
1114
|
+
pressedFilePicker: this.pressedFilePicker,
|
|
1115
|
+
lastFilePickerClick: this.lastFilePickerClick,
|
|
1116
|
+
pressedTree: this.pressedTree,
|
|
1117
|
+
lastTreeClick: this.lastTreeClick,
|
|
1118
|
+
splitPaneDrag: this.splitPaneDrag,
|
|
1119
|
+
splitPaneLastDividerDown: this.splitPaneLastDividerDown,
|
|
1120
|
+
};
|
|
1121
|
+
const outcome = routeEngineEventImpl(event, {
|
|
1122
|
+
committedRoot: this.committedRoot,
|
|
1123
|
+
layoutTree: this.layoutTree,
|
|
1124
|
+
enabledById: this.enabledById,
|
|
1125
|
+
focusList: this.focusList,
|
|
1126
|
+
pressableIds: this.pressableIds,
|
|
1127
|
+
traps: this.traps,
|
|
1128
|
+
zoneMetaById: this.zoneMetaById,
|
|
1129
|
+
inputById: this.inputById,
|
|
1130
|
+
buttonById: this.buttonById,
|
|
1131
|
+
linkById: this.linkById,
|
|
1132
|
+
virtualListById: this.virtualListById,
|
|
1133
|
+
tableById: this.tableById,
|
|
1134
|
+
treeById: this.treeById,
|
|
1135
|
+
dropdownById: this.dropdownById,
|
|
1136
|
+
sliderById: this.sliderById,
|
|
1137
|
+
selectById: this.selectById,
|
|
1138
|
+
checkboxById: this.checkboxById,
|
|
1139
|
+
radioGroupById: this.radioGroupById,
|
|
1140
|
+
commandPaletteById: this.commandPaletteById,
|
|
1141
|
+
commandPaletteItemsById: this.commandPaletteItemsById,
|
|
1142
|
+
filePickerById: this.filePickerById,
|
|
1143
|
+
fileTreeExplorerById: this.fileTreeExplorerById,
|
|
1144
|
+
splitPaneById: this.splitPaneById,
|
|
1145
|
+
codeEditorById: this.codeEditorById,
|
|
1146
|
+
diffViewerById: this.diffViewerById,
|
|
1147
|
+
toolApprovalDialogById: this.toolApprovalDialogById,
|
|
1148
|
+
logsConsoleById: this.logsConsoleById,
|
|
1149
|
+
rectById: this.rectById,
|
|
1150
|
+
splitPaneChildRectsById: this.splitPaneChildRectsById,
|
|
1151
|
+
toastContainers: this.toastContainers,
|
|
1152
|
+
toastActionByFocusId: this.toastActionByFocusId,
|
|
1153
|
+
dropdownSelectedIndexById: this.dropdownSelectedIndexById,
|
|
1154
|
+
dropdownWindowStartById: this.dropdownWindowStartById,
|
|
1155
|
+
toolApprovalFocusedActionById: this.toolApprovalFocusedActionById,
|
|
1156
|
+
diffViewerFocusedHunkById: this.diffViewerFocusedHunkById,
|
|
1157
|
+
diffViewerExpandedHunksById: this.diffViewerExpandedHunksById,
|
|
1158
|
+
logsConsoleLastGTimeById: this.logsConsoleLastGTimeById,
|
|
1159
|
+
logsConsoleRenderCacheById: this.logsConsoleRenderCacheById,
|
|
1160
|
+
diffRenderCacheById: this.diffRenderCacheById,
|
|
1161
|
+
codeEditorRenderCacheById: this.codeEditorRenderCacheById,
|
|
1162
|
+
tableRenderCacheById: this.tableRenderCacheById,
|
|
1163
|
+
inputCursorByInstanceId: this.inputCursorByInstanceId,
|
|
1164
|
+
inputSelectionByInstanceId: this.inputSelectionByInstanceId,
|
|
1165
|
+
inputWorkingValueByInstanceId: this.inputWorkingValueByInstanceId,
|
|
1166
|
+
inputUndoByInstanceId: this.inputUndoByInstanceId,
|
|
1167
|
+
virtualListStore: this.virtualListStore,
|
|
1168
|
+
tableStore: this.tableStore,
|
|
1169
|
+
treeStore: this.treeStore,
|
|
1170
|
+
loadedTreeChildrenByTreeId: this.loadedTreeChildrenByTreeId,
|
|
1171
|
+
treeLoadTokenByTreeAndKey: this.treeLoadTokenByTreeAndKey,
|
|
1172
|
+
layerRegistry: this.layerRegistry,
|
|
1173
|
+
layerStack: this.layerStack,
|
|
1174
|
+
closeOnEscapeByLayerId: this.closeOnEscapeByLayerId,
|
|
1175
|
+
closeOnBackdropByLayerId: this.closeOnBackdropByLayerId,
|
|
1176
|
+
onCloseByLayerId: this.onCloseByLayerId,
|
|
1177
|
+
dropdownStack: this.dropdownStack,
|
|
1178
|
+
scrollOverrides: this.scrollOverrides,
|
|
1179
|
+
routeOverlayShortcut: (nextEvent) => this.routeOverlayShortcut(nextEvent),
|
|
1180
|
+
invokeFocusZoneCallbacks: (prevZoneId, nextZoneId, prevZones, nextZones) => this.invokeFocusZoneCallbacks(prevZoneId, nextZoneId, prevZones, nextZones),
|
|
1181
|
+
invokeBlurCallbackSafely: (callback) => this.invokeBlurCallbackSafely(callback),
|
|
1182
|
+
computeDropdownRect: (props) => this.computeDropdownRect(props),
|
|
1183
|
+
findScrollableAncestors: (targetId) => this.findScrollableAncestors(targetId),
|
|
1184
|
+
writeSelectedTextToClipboard: (text) => this.writeSelectedTextToClipboard(text),
|
|
1185
|
+
reportInputCallbackError: (name, error) => this.reportInputCallbackError(name, error),
|
|
1186
|
+
requestRender: this.requestRender,
|
|
1187
|
+
allocNextTreeLoadToken: () => this.nextTreeLoadToken++,
|
|
1188
|
+
}, state);
|
|
1189
|
+
this.focusState = state.focusState;
|
|
1190
|
+
this.pressedId = state.pressedId;
|
|
1191
|
+
this.pressedDropdown = state.pressedDropdown;
|
|
1192
|
+
this.pressedVirtualList = state.pressedVirtualList;
|
|
1193
|
+
this.pressedTable = state.pressedTable;
|
|
1194
|
+
this.pressedTableHeader = state.pressedTableHeader;
|
|
1195
|
+
this.lastTableClick = state.lastTableClick;
|
|
1196
|
+
this.pressedFileTree = state.pressedFileTree;
|
|
1197
|
+
this.lastFileTreeClick = state.lastFileTreeClick;
|
|
1198
|
+
this.pressedFilePicker = state.pressedFilePicker;
|
|
1199
|
+
this.lastFilePickerClick = state.lastFilePickerClick;
|
|
1200
|
+
this.pressedTree = state.pressedTree;
|
|
1201
|
+
this.lastTreeClick = state.lastTreeClick;
|
|
1202
|
+
this.splitPaneDrag = state.splitPaneDrag;
|
|
1203
|
+
this.splitPaneLastDividerDown = state.splitPaneLastDividerDown;
|
|
1204
|
+
return outcome;
|
|
1205
|
+
}
|
|
1206
|
+
invokeFocusZoneCallbacks(prevZoneId, nextZoneId, prevZones, nextZones) {
|
|
1207
|
+
invokeFocusZoneCallbacksImpl({
|
|
1208
|
+
prevZoneId,
|
|
1209
|
+
nextZoneId,
|
|
1210
|
+
prevZones,
|
|
1211
|
+
nextZones,
|
|
1212
|
+
reportFocusZoneCallbackError: (phase, error) => this.reportFocusZoneCallbackError(phase, error),
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
findScrollableAncestors(targetId) {
|
|
1216
|
+
return findScrollableAncestorsImpl(targetId, this.committedRoot, this.layoutTree);
|
|
1217
|
+
}
|
|
1218
|
+
applyScrollOverridesToVNode(vnode, overrides = this
|
|
1219
|
+
.scrollOverrides) {
|
|
1220
|
+
const propsRecord = (vnode.props ?? {});
|
|
1221
|
+
const propsForRead = propsRecord;
|
|
1222
|
+
const idRaw = propsForRead.id;
|
|
1223
|
+
const nodeId = typeof idRaw === "string" && idRaw.length > 0 ? idRaw : null;
|
|
1224
|
+
const override = nodeId ? overrides.get(nodeId) : undefined;
|
|
1225
|
+
let nextPropsMutable = null;
|
|
1226
|
+
const ensureMutableProps = () => {
|
|
1227
|
+
if (nextPropsMutable === null)
|
|
1228
|
+
nextPropsMutable = { ...propsRecord };
|
|
1229
|
+
return nextPropsMutable;
|
|
1230
|
+
};
|
|
1231
|
+
if (override) {
|
|
1232
|
+
if (propsForRead.scrollX !== override.scrollX || propsForRead.scrollY !== override.scrollY) {
|
|
1233
|
+
const mutable = ensureMutableProps();
|
|
1234
|
+
mutable.scrollX = override.scrollX;
|
|
1235
|
+
mutable.scrollY = override.scrollY;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
const currentChildren = vnode.children;
|
|
1239
|
+
let childrenChanged = false;
|
|
1240
|
+
let nextChildren = currentChildren;
|
|
1241
|
+
if (Array.isArray(currentChildren) && currentChildren.length > 0) {
|
|
1242
|
+
const rebuiltChildren = new Array(currentChildren.length);
|
|
1243
|
+
for (let i = 0; i < currentChildren.length; i++) {
|
|
1244
|
+
const child = currentChildren[i];
|
|
1245
|
+
const nextChild = this.applyScrollOverridesToVNode(child, overrides);
|
|
1246
|
+
rebuiltChildren[i] = nextChild;
|
|
1247
|
+
if (nextChild !== child)
|
|
1248
|
+
childrenChanged = true;
|
|
1249
|
+
}
|
|
1250
|
+
if (childrenChanged)
|
|
1251
|
+
nextChildren = Object.freeze(rebuiltChildren);
|
|
1252
|
+
}
|
|
1253
|
+
if (vnode.kind === "layer") {
|
|
1254
|
+
const content = propsRecord.content;
|
|
1255
|
+
if (isVNodeLike(content)) {
|
|
1256
|
+
const nextContent = this.applyScrollOverridesToVNode(content, overrides);
|
|
1257
|
+
if (nextContent !== content) {
|
|
1258
|
+
ensureMutableProps().content = nextContent;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
else if (vnode.kind === "modal") {
|
|
1263
|
+
const modalProps = propsRecord;
|
|
1264
|
+
const content = modalProps.content;
|
|
1265
|
+
if (isVNodeLike(content)) {
|
|
1266
|
+
const nextContent = this.applyScrollOverridesToVNode(content, overrides);
|
|
1267
|
+
if (nextContent !== content) {
|
|
1268
|
+
ensureMutableProps().content = nextContent;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
const actionsRaw = modalProps.actions;
|
|
1272
|
+
if (Array.isArray(actionsRaw) && actionsRaw.length > 0) {
|
|
1273
|
+
let nextActions = null;
|
|
1274
|
+
for (let i = 0; i < actionsRaw.length; i++) {
|
|
1275
|
+
const action = actionsRaw[i];
|
|
1276
|
+
if (!isVNodeLike(action)) {
|
|
1277
|
+
if (nextActions !== null)
|
|
1278
|
+
nextActions[i] = action;
|
|
1279
|
+
continue;
|
|
1280
|
+
}
|
|
1281
|
+
const nextAction = this.applyScrollOverridesToVNode(action, overrides);
|
|
1282
|
+
if (nextAction !== action) {
|
|
1283
|
+
if (nextActions === null)
|
|
1284
|
+
nextActions = actionsRaw.slice();
|
|
1285
|
+
nextActions[i] = nextAction;
|
|
1286
|
+
}
|
|
1287
|
+
else if (nextActions !== null) {
|
|
1288
|
+
nextActions[i] = action;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
if (nextActions !== null) {
|
|
1292
|
+
ensureMutableProps().actions = Object.freeze(nextActions);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
let nextProps = vnode.props;
|
|
1297
|
+
const propsChanged = nextPropsMutable !== null;
|
|
1298
|
+
if (nextPropsMutable !== null) {
|
|
1299
|
+
nextProps = Object.freeze(nextPropsMutable);
|
|
1300
|
+
}
|
|
1301
|
+
if (!propsChanged && !childrenChanged)
|
|
1302
|
+
return vnode;
|
|
1303
|
+
const nextVNode = {
|
|
1304
|
+
...vnode,
|
|
1305
|
+
...(propsChanged ? { props: nextProps } : {}),
|
|
1306
|
+
...(childrenChanged ? { children: nextChildren } : {}),
|
|
1307
|
+
};
|
|
1308
|
+
return Object.freeze(nextVNode);
|
|
1309
|
+
}
|
|
1310
|
+
describeConstraintGraphFatal(fatal) {
|
|
1311
|
+
return describeConstraintGraphFatalImpl(fatal);
|
|
1312
|
+
}
|
|
1313
|
+
readWidgetIdFromRuntimeNode(node) {
|
|
1314
|
+
const id = node.vnode.props?.id;
|
|
1315
|
+
return typeof id === "string" && id.length > 0 ? id : null;
|
|
1316
|
+
}
|
|
1317
|
+
hasConstraintSourceDiff(node, graph) {
|
|
1318
|
+
const props = (node.vnode.props ?? {});
|
|
1319
|
+
for (const prop of CONSTRAINT_NODE_PROPS) {
|
|
1320
|
+
const prev = graph.nodeByKey.get(`${String(node.instanceId)}:${prop}`);
|
|
1321
|
+
const prevSource = prev?.expr.source ?? null;
|
|
1322
|
+
const nextRaw = props[prop];
|
|
1323
|
+
const nextSource = isConstraintExpr(nextRaw) ? nextRaw.source : null;
|
|
1324
|
+
if (prevSource !== nextSource)
|
|
1325
|
+
return true;
|
|
1326
|
+
}
|
|
1327
|
+
return false;
|
|
1328
|
+
}
|
|
1329
|
+
hasRuntimeConstraintExpr(node) {
|
|
1330
|
+
const props = node.vnode.props;
|
|
1331
|
+
if (props === undefined || props === null)
|
|
1332
|
+
return false;
|
|
1333
|
+
for (const prop of CONSTRAINT_NODE_PROPS) {
|
|
1334
|
+
if (isConstraintExpr(props[prop]))
|
|
1335
|
+
return true;
|
|
1336
|
+
}
|
|
1337
|
+
return false;
|
|
1338
|
+
}
|
|
1339
|
+
resolveConstraintChildAxis(node, parentAxis) {
|
|
1340
|
+
switch (node.vnode.kind) {
|
|
1341
|
+
case "row":
|
|
1342
|
+
return "row";
|
|
1343
|
+
case "column":
|
|
1344
|
+
case "box":
|
|
1345
|
+
return "column";
|
|
1346
|
+
default:
|
|
1347
|
+
return parentAxis;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
measureConstraintIntrinsicValues(node, parentW, parentH, axis) {
|
|
1351
|
+
const measured = measure(node.vnode, parentW, parentH, axis);
|
|
1352
|
+
if (!measured.ok)
|
|
1353
|
+
return null;
|
|
1354
|
+
const w = Math.max(0, Math.floor(measured.value.w));
|
|
1355
|
+
const h = Math.max(0, Math.floor(measured.value.h));
|
|
1356
|
+
return {
|
|
1357
|
+
w,
|
|
1358
|
+
h,
|
|
1359
|
+
min_w: w,
|
|
1360
|
+
min_h: h,
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
shouldRebuildConstraintGraph(root, prevGraph, removedInstanceIds) {
|
|
1364
|
+
return shouldRebuildConstraintGraphImpl(root, prevGraph, removedInstanceIds, this._pooledConstraintRuntimeStack);
|
|
1365
|
+
}
|
|
1366
|
+
buildConstraintResolutionInputs(root, graph, rootW, rootH) {
|
|
1367
|
+
const result = buildConstraintResolutionInputsImpl({
|
|
1368
|
+
root,
|
|
1369
|
+
graph,
|
|
1370
|
+
rootW,
|
|
1371
|
+
rootH,
|
|
1372
|
+
pooledConstraintBaseValues: this._pooledConstraintBaseValues,
|
|
1373
|
+
pooledConstraintParentValues: this._pooledConstraintParentValues,
|
|
1374
|
+
pooledConstraintIntrinsicValues: this._pooledConstraintIntrinsicValues,
|
|
1375
|
+
pooledConstraintParentByInstanceId: this._pooledConstraintParentByInstanceId,
|
|
1376
|
+
pooledRectByInstanceId: this._pooledRectByInstanceId,
|
|
1377
|
+
pooledConstraintRuntimeStack: this._pooledConstraintRuntimeStack,
|
|
1378
|
+
pooledConstraintParentStack: this._pooledConstraintParentStack,
|
|
1379
|
+
pooledConstraintAxisStack: this._pooledConstraintAxisStack,
|
|
1380
|
+
});
|
|
1381
|
+
this._constraintHasStaticHiddenDisplay = result.hasStaticHiddenDisplay;
|
|
1382
|
+
}
|
|
1383
|
+
rebuildConstraintHiddenState(root, valuesByInstanceId) {
|
|
1384
|
+
const result = rebuildConstraintHiddenStateImpl(root, valuesByInstanceId, this._pooledConstraintRuntimeStack, this._pooledConstraintVisibilityStack, this._pooledHiddenConstraintInstanceIds, this._pooledHiddenConstraintWidgetIds);
|
|
1385
|
+
this._hiddenConstraintInstanceIds = result.hiddenConstraintInstanceIds;
|
|
1386
|
+
this._hiddenConstraintWidgetIds = result.hiddenConstraintWidgetIds;
|
|
1387
|
+
}
|
|
1388
|
+
rebuildConstraintAffectedPathSet(graph, hiddenInstanceIds) {
|
|
1389
|
+
const result = rebuildConstraintAffectedPathSetImpl(graph, hiddenInstanceIds, this._pooledConstraintAffectedPathInstanceIds, this._pooledConstraintNodesWithAffectedDescendants, this._pooledConstraintParentByInstanceId);
|
|
1390
|
+
this._constraintAffectedPathInstanceIds = result.constraintAffectedPathInstanceIds;
|
|
1391
|
+
this._constraintNodesWithAffectedDescendants = result.constraintNodesWithAffectedDescendants;
|
|
1392
|
+
}
|
|
1393
|
+
hasConstraintInputSignatureChange(graph, viewport, rootW, rootH) {
|
|
1394
|
+
const result = hasConstraintInputSignatureChangeImpl({
|
|
1395
|
+
graph,
|
|
1396
|
+
viewport,
|
|
1397
|
+
rootW,
|
|
1398
|
+
rootH,
|
|
1399
|
+
pooledConstraintBaseValues: this._pooledConstraintBaseValues,
|
|
1400
|
+
pooledConstraintParentValues: this._pooledConstraintParentValues,
|
|
1401
|
+
pooledConstraintIntrinsicValues: this._pooledConstraintIntrinsicValues,
|
|
1402
|
+
signature: this._constraintInputSignature,
|
|
1403
|
+
valid: this._constraintInputSignatureValid,
|
|
1404
|
+
});
|
|
1405
|
+
this._constraintInputSignatureValid = result.valid;
|
|
1406
|
+
return result.changed;
|
|
1407
|
+
}
|
|
1408
|
+
invalidateConstraintInputSignature() {
|
|
1409
|
+
this._constraintInputSignatureValid = false;
|
|
1410
|
+
this._constraintInputSignature.length = 0;
|
|
1411
|
+
}
|
|
1412
|
+
computeConstraintInputKey(graph, viewport, rootW, rootH) {
|
|
1413
|
+
return computeConstraintInputKeyImpl(graph, viewport, rootW, rootH, this._pooledConstraintBaseValues, this._pooledConstraintParentValues, this._pooledConstraintIntrinsicValues);
|
|
1414
|
+
}
|
|
1415
|
+
rebuildConstraintExprIndex(graph) {
|
|
1416
|
+
this._constraintExprIndexByInstanceId = rebuildConstraintExprIndexImpl(graph);
|
|
1417
|
+
}
|
|
1418
|
+
computeConstraintBreadcrumbs() {
|
|
1419
|
+
return computeConstraintBreadcrumbsImpl({
|
|
1420
|
+
graph: this._constraintGraph,
|
|
1421
|
+
exprIndexByInstanceId: this._constraintExprIndexByInstanceId,
|
|
1422
|
+
rebuildConstraintExprIndex: (graph) => rebuildConstraintExprIndexImpl(graph),
|
|
1423
|
+
focusedId: this.focusState.focusedId,
|
|
1424
|
+
resolvedByInstanceId: this._constraintValuesByInstanceId,
|
|
1425
|
+
hiddenConstraintInstanceIds: this._hiddenConstraintInstanceIds,
|
|
1426
|
+
lastCacheKey: this._constraintLastCacheKey,
|
|
1427
|
+
lastResolution: this._constraintLastResolution,
|
|
1428
|
+
emptyConstraintBreadcrumbs: EMPTY_CONSTRAINT_BREADCRUMBS,
|
|
1429
|
+
emptyInstanceIds: EMPTY_INSTANCE_ID_ARRAY,
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
applyConstraintOverridesToVNode(runtimeNode, valuesByInstanceId, hiddenInstanceIds, affectedPathInstanceIds) {
|
|
1433
|
+
return applyConstraintOverridesToVNodeImpl({
|
|
1434
|
+
runtimeNode,
|
|
1435
|
+
valuesByInstanceId,
|
|
1436
|
+
hiddenInstanceIds,
|
|
1437
|
+
affectedPathInstanceIds,
|
|
1438
|
+
constraintNodesWithAffectedDescendants: this._constraintNodesWithAffectedDescendants,
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
computeDropdownRect(props) {
|
|
1442
|
+
const anchor = this.rectById.get(props.anchorId) ?? null;
|
|
1443
|
+
return computeDropdownGeometry(props, anchor, this.lastViewport);
|
|
1444
|
+
}
|
|
1445
|
+
shouldAttemptIncrementalRender(doLayout, viewport, theme) {
|
|
1446
|
+
if (this.forceFullRenderOnNextSubmit)
|
|
1447
|
+
return false;
|
|
1448
|
+
return shouldAttemptIncrementalRenderImpl({
|
|
1449
|
+
hasRenderedFrame: this._hasRenderedFrame,
|
|
1450
|
+
doLayout,
|
|
1451
|
+
hasActivePositionTransitions: this.hasActivePositionTransitions,
|
|
1452
|
+
hasActiveExitTransitions: this.hasActiveExitTransitions,
|
|
1453
|
+
lastRenderedViewport: this._lastRenderedViewport,
|
|
1454
|
+
viewport,
|
|
1455
|
+
lastRenderedThemeRef: this._lastRenderedThemeRef,
|
|
1456
|
+
theme,
|
|
1457
|
+
dropdownStack: this.dropdownStack,
|
|
1458
|
+
layerStack: this.layerStack,
|
|
1459
|
+
toastContainers: this.toastContainers,
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
propagateDirtyFromPredicate(runtimeRoot, isNodeDirty) {
|
|
1463
|
+
propagateDirtyFromPredicateImpl(runtimeRoot, isNodeDirty, this._pooledRuntimeStack, this._pooledPrevRuntimeStack);
|
|
1464
|
+
}
|
|
1465
|
+
markLayoutDirtyNodes(runtimeRoot) {
|
|
1466
|
+
markLayoutDirtyNodesImpl({
|
|
1467
|
+
runtimeRoot,
|
|
1468
|
+
pooledRectByInstanceId: this._pooledRectByInstanceId,
|
|
1469
|
+
prevFrameRectByInstanceId: this._prevFrameRectByInstanceId,
|
|
1470
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
1471
|
+
pooledPrevRuntimeStack: this._pooledPrevRuntimeStack,
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
collectSelfDirtyInstanceIds(runtimeRoot, out) {
|
|
1475
|
+
collectSelfDirtyInstanceIdsImpl(runtimeRoot, out, this._pooledRuntimeStack);
|
|
1476
|
+
}
|
|
1477
|
+
markTransientDirtyNodes(runtimeRoot, prevFocusedId, nextFocusedId, includeSpinners) {
|
|
1478
|
+
markTransientDirtyNodesImpl({
|
|
1479
|
+
runtimeRoot,
|
|
1480
|
+
prevFocusedId,
|
|
1481
|
+
nextFocusedId,
|
|
1482
|
+
includeSpinners,
|
|
1483
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
1484
|
+
pooledPrevRuntimeStack: this._pooledPrevRuntimeStack,
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
clearRuntimeDirtyNodes(runtimeRoot) {
|
|
1488
|
+
clearRuntimeDirtyNodesImpl(runtimeRoot, this._pooledRuntimeStack);
|
|
1489
|
+
}
|
|
1490
|
+
collectSubtreeDamageAndRouting(root, outInstanceIds) {
|
|
1491
|
+
return collectSubtreeDamageAndRoutingImpl(root, outInstanceIds, this._pooledDamageRuntimeStack);
|
|
1492
|
+
}
|
|
1493
|
+
computeIdentityDiffDamage(prevRoot, nextRoot) {
|
|
1494
|
+
return computeIdentityDiffDamageImpl({
|
|
1495
|
+
prevRoot,
|
|
1496
|
+
nextRoot,
|
|
1497
|
+
pooledChangedRenderInstanceIds: this._pooledChangedRenderInstanceIds,
|
|
1498
|
+
pooledRemovedRenderInstanceIds: this._pooledRemovedRenderInstanceIds,
|
|
1499
|
+
pooledPrevRuntimeStack: this._pooledPrevRuntimeStack,
|
|
1500
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
1501
|
+
pooledDamageRuntimeStack: this._pooledDamageRuntimeStack,
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
resolveRuntimeCursorSummary(cursorInfo) {
|
|
1505
|
+
return resolveRuntimeCursorSummaryImpl({
|
|
1506
|
+
focusedId: this.focusState.focusedId,
|
|
1507
|
+
inputById: this.inputById,
|
|
1508
|
+
pooledRectByInstanceId: this._pooledRectByInstanceId,
|
|
1509
|
+
inputCursorByInstanceId: this.inputCursorByInstanceId,
|
|
1510
|
+
codeEditorById: this.codeEditorById,
|
|
1511
|
+
rectById: this.rectById,
|
|
1512
|
+
codeEditorRenderCacheById: this.codeEditorRenderCacheById,
|
|
1513
|
+
commandPaletteById: this.commandPaletteById,
|
|
1514
|
+
}, cursorInfo);
|
|
1515
|
+
}
|
|
1516
|
+
emitIncrementalCursor(cursorInfo) {
|
|
1517
|
+
return emitIncrementalCursorImpl({
|
|
1518
|
+
collectRuntimeBreadcrumbs: this.collectRuntimeBreadcrumbs,
|
|
1519
|
+
builder: this.builder,
|
|
1520
|
+
focusedId: this.focusState.focusedId,
|
|
1521
|
+
inputById: this.inputById,
|
|
1522
|
+
pooledRectByInstanceId: this._pooledRectByInstanceId,
|
|
1523
|
+
inputCursorByInstanceId: this.inputCursorByInstanceId,
|
|
1524
|
+
codeEditorById: this.codeEditorById,
|
|
1525
|
+
rectById: this.rectById,
|
|
1526
|
+
codeEditorRenderCacheById: this.codeEditorRenderCacheById,
|
|
1527
|
+
commandPaletteById: this.commandPaletteById,
|
|
1528
|
+
}, cursorInfo);
|
|
1529
|
+
}
|
|
1530
|
+
updateRuntimeBreadcrumbSnapshot(params) {
|
|
1531
|
+
this._runtimeBreadcrumbs = updateRuntimeBreadcrumbSnapshotImpl(this._runtimeBreadcrumbs, {
|
|
1532
|
+
collectRuntimeBreadcrumbs: this.collectRuntimeBreadcrumbs,
|
|
1533
|
+
focusState: this.focusState,
|
|
1534
|
+
focusAnnouncement: this.getFocusAnnouncement(),
|
|
1535
|
+
constraintBreadcrumbs: this._constraintBreadcrumbs,
|
|
1536
|
+
}, params);
|
|
1537
|
+
}
|
|
1538
|
+
appendDamageRectForInstanceId(instanceId) {
|
|
1539
|
+
return appendDamageRectForInstanceIdImpl(instanceId, this._pooledDamageRectByInstanceId, this._prevFrameDamageRectByInstanceId, this._pooledDamageRects);
|
|
1540
|
+
}
|
|
1541
|
+
appendDamageRectForId(id) {
|
|
1542
|
+
return appendDamageRectForIdImpl(id, this._pooledDamageRectById, this._prevFrameDamageRectById, this._pooledDamageRects);
|
|
1543
|
+
}
|
|
1544
|
+
refreshDamageRectIndexesForLayoutSkippedCommit(runtimeRoot) {
|
|
1545
|
+
refreshDamageRectIndexesForLayoutSkippedCommitImpl({
|
|
1546
|
+
runtimeRoot,
|
|
1547
|
+
pooledDamageRectByInstanceId: this._pooledDamageRectByInstanceId,
|
|
1548
|
+
pooledDamageRectById: this._pooledDamageRectById,
|
|
1549
|
+
pooledRectByInstanceId: this._pooledRectByInstanceId,
|
|
1550
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
collectSpinnerDamageRects(runtimeRoot, layoutRoot) {
|
|
1554
|
+
collectSpinnerDamageRectsImpl({
|
|
1555
|
+
runtimeRoot,
|
|
1556
|
+
layoutRoot,
|
|
1557
|
+
pooledDamageRects: this._pooledDamageRects,
|
|
1558
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
1559
|
+
pooledLayoutStack: this._pooledLayoutStack,
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
appendDamageRectsForFocusAnnouncers(runtimeRoot) {
|
|
1563
|
+
return appendDamageRectsForFocusAnnouncersImpl({
|
|
1564
|
+
runtimeRoot,
|
|
1565
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
1566
|
+
pooledDamageRectByInstanceId: this._pooledDamageRectByInstanceId,
|
|
1567
|
+
prevFrameDamageRectByInstanceId: this._prevFrameDamageRectByInstanceId,
|
|
1568
|
+
pooledDamageRects: this._pooledDamageRects,
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
normalizeDamageRects(viewport) {
|
|
1572
|
+
return normalizeDamageRectsImpl(viewport, this._pooledDamageRects, this._pooledMergedDamageRects);
|
|
1573
|
+
}
|
|
1574
|
+
isDamageAreaTooLarge(viewport) {
|
|
1575
|
+
return isDamageAreaTooLargeImpl(viewport, this._pooledMergedDamageRects);
|
|
1576
|
+
}
|
|
1577
|
+
snapshotRenderedFrameState(runtimeRoot, viewport, theme, doLayout, focusAnnouncement) {
|
|
1578
|
+
const nextFrameState = snapshotRenderedFrameStateImpl({
|
|
1579
|
+
runtimeRoot,
|
|
1580
|
+
viewport,
|
|
1581
|
+
theme,
|
|
1582
|
+
doLayout,
|
|
1583
|
+
focusAnnouncement,
|
|
1584
|
+
focusedId: this.focusState.focusedId,
|
|
1585
|
+
pooledRectByInstanceId: this._pooledRectByInstanceId,
|
|
1586
|
+
pooledRectById: this._pooledRectById,
|
|
1587
|
+
pooledDamageRectByInstanceId: this._pooledDamageRectByInstanceId,
|
|
1588
|
+
pooledDamageRectById: this._pooledDamageRectById,
|
|
1589
|
+
prevFrameRectByInstanceId: this._prevFrameRectByInstanceId,
|
|
1590
|
+
prevFrameRectById: this._prevFrameRectById,
|
|
1591
|
+
prevFrameDamageRectByInstanceId: this._prevFrameDamageRectByInstanceId,
|
|
1592
|
+
prevFrameDamageRectById: this._prevFrameDamageRectById,
|
|
1593
|
+
prevFrameOpacityByInstanceId: this._prevFrameOpacityByInstanceId,
|
|
1594
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
1595
|
+
readContainerOpacity: (node) => this.readContainerOpacity(node),
|
|
1596
|
+
});
|
|
1597
|
+
this._hasRenderedFrame = nextFrameState.hasRenderedFrame;
|
|
1598
|
+
this._lastRenderedViewport = nextFrameState.lastRenderedViewport;
|
|
1599
|
+
this._lastRenderedThemeRef = nextFrameState.lastRenderedThemeRef;
|
|
1600
|
+
this._lastRenderedFocusedId = nextFrameState.lastRenderedFocusedId;
|
|
1601
|
+
this._lastRenderedFocusAnnouncement = nextFrameState.lastRenderedFocusAnnouncement;
|
|
1602
|
+
}
|
|
1603
|
+
layoutWithShapeFallback(layoutRootVNode, constrainedLayoutRootVNode, rootPad, rootW, rootH, checkShape) {
|
|
1604
|
+
const layoutRes = layout(layoutRootVNode, rootPad, rootPad, rootW, rootH, "column", this._layoutMeasureCache, this._layoutTreeCache, null);
|
|
1605
|
+
if (!layoutRes.ok) {
|
|
1606
|
+
return layoutRes;
|
|
1607
|
+
}
|
|
1608
|
+
let nextLayoutTree = layoutRes.value;
|
|
1609
|
+
const runtimeRoot = this.committedRoot;
|
|
1610
|
+
if (!runtimeRoot) {
|
|
1611
|
+
return {
|
|
1612
|
+
ok: false,
|
|
1613
|
+
fatal: {
|
|
1614
|
+
code: "ZRUI_INVALID_PROPS",
|
|
1615
|
+
detail: "widgetRenderer: missing committed root",
|
|
1616
|
+
},
|
|
1617
|
+
};
|
|
1618
|
+
}
|
|
1619
|
+
let shapeMismatch = null;
|
|
1620
|
+
if (checkShape) {
|
|
1621
|
+
const postLayoutShapeToken = PERF_ENABLED ? perfNow() : 0;
|
|
1622
|
+
if (hasRuntimeLayoutShapeMismatch(runtimeRoot, nextLayoutTree)) {
|
|
1623
|
+
shapeMismatch = findRuntimeLayoutShapeMismatch(runtimeRoot, nextLayoutTree);
|
|
1624
|
+
}
|
|
1625
|
+
if (PERF_ENABLED)
|
|
1626
|
+
perfCount("layout_shape_post_layout_time_ms", perfNow() - postLayoutShapeToken);
|
|
1627
|
+
}
|
|
1628
|
+
if (checkShape && shapeMismatch !== null) {
|
|
1629
|
+
if (FRAME_AUDIT_ENABLED) {
|
|
1630
|
+
emitFrameAudit("widgetRenderer", "layout.shape_mismatch", {
|
|
1631
|
+
reason: "post-layout-cache-hit",
|
|
1632
|
+
path: shapeMismatch.path,
|
|
1633
|
+
depth: shapeMismatch.depth,
|
|
1634
|
+
mismatchKind: shapeMismatch.reason,
|
|
1635
|
+
runtimeKind: shapeMismatch.runtimeKind,
|
|
1636
|
+
layoutKind: shapeMismatch.layoutKind,
|
|
1637
|
+
runtimeChildCount: shapeMismatch.runtimeChildCount,
|
|
1638
|
+
layoutChildCount: shapeMismatch.layoutChildCount,
|
|
1639
|
+
runtimeTrail: shapeMismatch.runtimeTrail,
|
|
1640
|
+
layoutTrail: shapeMismatch.layoutTrail,
|
|
1641
|
+
});
|
|
1642
|
+
}
|
|
1643
|
+
// Cache can become stale under structural changes; force a cold relayout.
|
|
1644
|
+
this._layoutTreeCache = new WeakMap();
|
|
1645
|
+
const fallbackLayoutRes = layout(layoutRootVNode, rootPad, rootPad, rootW, rootH, "column", this._layoutMeasureCache, this._layoutTreeCache, null);
|
|
1646
|
+
if (!fallbackLayoutRes.ok) {
|
|
1647
|
+
return fallbackLayoutRes;
|
|
1648
|
+
}
|
|
1649
|
+
nextLayoutTree = fallbackLayoutRes.value;
|
|
1650
|
+
shapeMismatch = findRuntimeLayoutShapeMismatch(runtimeRoot, nextLayoutTree);
|
|
1651
|
+
if (shapeMismatch !== null && layoutRootVNode !== constrainedLayoutRootVNode) {
|
|
1652
|
+
const directLayoutRes = layout(constrainedLayoutRootVNode, rootPad, rootPad, rootW, rootH, "column", this._layoutMeasureCache, this._layoutTreeCache, null);
|
|
1653
|
+
if (!directLayoutRes.ok) {
|
|
1654
|
+
return directLayoutRes;
|
|
1655
|
+
}
|
|
1656
|
+
nextLayoutTree = directLayoutRes.value;
|
|
1657
|
+
shapeMismatch = findRuntimeLayoutShapeMismatch(runtimeRoot, nextLayoutTree);
|
|
1658
|
+
}
|
|
1659
|
+
if (shapeMismatch !== null && FRAME_AUDIT_ENABLED) {
|
|
1660
|
+
emitFrameAudit("widgetRenderer", "layout.shape_mismatch.persisted", {
|
|
1661
|
+
path: shapeMismatch.path,
|
|
1662
|
+
depth: shapeMismatch.depth,
|
|
1663
|
+
mismatchKind: shapeMismatch.reason,
|
|
1664
|
+
runtimeKind: shapeMismatch.runtimeKind,
|
|
1665
|
+
layoutKind: shapeMismatch.layoutKind,
|
|
1666
|
+
runtimeChildCount: shapeMismatch.runtimeChildCount,
|
|
1667
|
+
layoutChildCount: shapeMismatch.layoutChildCount,
|
|
1668
|
+
runtimeTrail: shapeMismatch.runtimeTrail,
|
|
1669
|
+
layoutTrail: shapeMismatch.layoutTrail,
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
return { ok: true, value: nextLayoutTree };
|
|
1674
|
+
}
|
|
1675
|
+
/**
|
|
1676
|
+
* Execute view function, commit tree, compute layout, and render to drawlist.
|
|
1677
|
+
*
|
|
1678
|
+
* Pipeline:
|
|
1679
|
+
* 1. Call viewFn(snapshot) to get VNode tree
|
|
1680
|
+
* 2. Commit VNode tree (reconciliation, instance allocation)
|
|
1681
|
+
* 3. Compute layout for viewport dimensions
|
|
1682
|
+
* 4. Finalize focus state for committed tree
|
|
1683
|
+
* 5. Render tree to drawlist
|
|
1684
|
+
* 6. Submit drawlist to backend
|
|
1685
|
+
*
|
|
1686
|
+
* @param viewFn - User view function returning VNode tree
|
|
1687
|
+
* @param snapshot - Current application state (read-only)
|
|
1688
|
+
* @param viewport - Terminal dimensions
|
|
1689
|
+
* @param hooks - Lifecycle hooks for render tracking
|
|
1690
|
+
* @returns Success with in-flight promise, or error with code/detail
|
|
1691
|
+
*/
|
|
1692
|
+
submitFrame(viewFn, snapshot, viewport, theme, hooks, plan = { commit: true, layout: true, checkLayoutStability: true }) {
|
|
1693
|
+
if (!isI32NonNegative(viewport.cols) || !isI32NonNegative(viewport.rows)) {
|
|
1694
|
+
return {
|
|
1695
|
+
ok: false,
|
|
1696
|
+
code: "ZRUI_INVALID_PROPS",
|
|
1697
|
+
detail: `viewport must be int32 cols/rows >= 0 (got cols=${String(viewport.cols)}, rows=${String(viewport.rows)})`,
|
|
1698
|
+
};
|
|
1699
|
+
}
|
|
1700
|
+
this.lastViewport = viewport;
|
|
1701
|
+
setResponsiveViewport(viewport.cols, viewport.rows, this.breakpointThresholds);
|
|
1702
|
+
this.builder.reset();
|
|
1703
|
+
let entered = false;
|
|
1704
|
+
try {
|
|
1705
|
+
hooks.enterRender();
|
|
1706
|
+
entered = true;
|
|
1707
|
+
const doCommit = plan.commit || this.committedRoot === null;
|
|
1708
|
+
// Layout is no longer an unconditional consequence of commit. We rerun
|
|
1709
|
+
// layout when explicitly requested (resize/layout dirty), bootstrap lacks
|
|
1710
|
+
// a tree, or committed layout signatures changed.
|
|
1711
|
+
let doLayout = plan.layout || this.layoutTree === null;
|
|
1712
|
+
if (this.scrollOverrides.size > 0)
|
|
1713
|
+
doLayout = true;
|
|
1714
|
+
const frameNowMs = typeof plan.nowMs === "number" && Number.isFinite(plan.nowMs)
|
|
1715
|
+
? plan.nowMs
|
|
1716
|
+
: monotonicNowMs();
|
|
1717
|
+
let commitRes = null;
|
|
1718
|
+
let prevFocusedIdBeforeFinalize = null;
|
|
1719
|
+
const prevActiveZoneIdBeforeSubmit = this.focusState.activeZoneId;
|
|
1720
|
+
const prevZoneMetaByIdBeforeSubmit = this.zoneMetaById;
|
|
1721
|
+
const prevCommittedRoot = this.committedRoot;
|
|
1722
|
+
const prevLayoutTree = this.layoutTree;
|
|
1723
|
+
let prevLayoutSubtreeByInstanceId = null;
|
|
1724
|
+
if (doCommit && prevCommittedRoot && prevLayoutTree) {
|
|
1725
|
+
this.collectLayoutSubtreeByInstanceId(prevCommittedRoot, prevLayoutTree, this._pooledPrevLayoutSubtreeByInstanceId);
|
|
1726
|
+
prevLayoutSubtreeByInstanceId = this._pooledPrevLayoutSubtreeByInstanceId;
|
|
1727
|
+
}
|
|
1728
|
+
const hadRoutingWidgets = this.hadRoutingWidgets;
|
|
1729
|
+
let hasRoutingWidgets = hadRoutingWidgets;
|
|
1730
|
+
let didRoutingRebuild = false;
|
|
1731
|
+
let identityDamageFromCommit = null;
|
|
1732
|
+
let layoutShapeVerifiedBySignature = false;
|
|
1733
|
+
let constraintGraph = this._constraintGraph;
|
|
1734
|
+
if (doCommit) {
|
|
1735
|
+
let commitReadViewport = false;
|
|
1736
|
+
const colorTokens = getColorTokens(theme);
|
|
1737
|
+
const viewToken = PERF_DETAIL_ENABLED ? perfMarkStart("view") : 0;
|
|
1738
|
+
const vnode = viewFn(snapshot);
|
|
1739
|
+
if (PERF_DETAIL_ENABLED)
|
|
1740
|
+
perfMarkEnd("view", viewToken);
|
|
1741
|
+
if (!isVNodeLike(vnode)) {
|
|
1742
|
+
return {
|
|
1743
|
+
ok: false,
|
|
1744
|
+
code: "ZRUI_INVALID_PROPS",
|
|
1745
|
+
detail: `view function must return a VNode, got ${vnode === null ? "null" : vnode === undefined ? "undefined" : typeof vnode}`,
|
|
1746
|
+
};
|
|
1747
|
+
}
|
|
1748
|
+
const commitToken = PERF_DETAIL_ENABLED ? perfMarkStart("vnode_commit") : 0;
|
|
1749
|
+
this.committedErrorBoundaryPathsScratch.clear();
|
|
1750
|
+
const commitRes0 = commitVNodeTree(this.committedRoot, vnode, {
|
|
1751
|
+
allocator: this.allocator,
|
|
1752
|
+
collectLifecycleInstanceIds: false,
|
|
1753
|
+
interactiveIdIndex: this._pooledInteractiveIdIndex,
|
|
1754
|
+
composite: {
|
|
1755
|
+
registry: this.compositeRegistry,
|
|
1756
|
+
appState: snapshot,
|
|
1757
|
+
colorTokens,
|
|
1758
|
+
theme,
|
|
1759
|
+
getColorTokens,
|
|
1760
|
+
viewport: getResponsiveViewport(),
|
|
1761
|
+
onInvalidate: () => this.requestView(),
|
|
1762
|
+
onUseViewport: () => {
|
|
1763
|
+
commitReadViewport = true;
|
|
1764
|
+
},
|
|
1765
|
+
},
|
|
1766
|
+
errorBoundary: {
|
|
1767
|
+
errorsByPath: this.errorBoundaryStatesByPath,
|
|
1768
|
+
retryRequestedPaths: this.retryErrorBoundaryPaths,
|
|
1769
|
+
activePaths: this.committedErrorBoundaryPathsScratch,
|
|
1770
|
+
requestRetry: (retryPath) => {
|
|
1771
|
+
this.retryErrorBoundaryPaths.add(retryPath);
|
|
1772
|
+
this.forceFullRenderNextFrame();
|
|
1773
|
+
this.requestView();
|
|
1774
|
+
},
|
|
1775
|
+
},
|
|
1776
|
+
});
|
|
1777
|
+
if (PERF_DETAIL_ENABLED)
|
|
1778
|
+
perfMarkEnd("vnode_commit", commitToken);
|
|
1779
|
+
if (!commitRes0.ok) {
|
|
1780
|
+
return { ok: false, code: commitRes0.fatal.code, detail: commitRes0.fatal.detail };
|
|
1781
|
+
}
|
|
1782
|
+
commitRes = commitRes0.value;
|
|
1783
|
+
if (commitReadViewport) {
|
|
1784
|
+
this.hasViewportAwareCompositesInCommittedTree = true;
|
|
1785
|
+
}
|
|
1786
|
+
this.committedRoot = commitRes.root;
|
|
1787
|
+
this.recomputeAnimatedWidgetPresence(this.committedRoot);
|
|
1788
|
+
const prevConstraintGraph = this._constraintGraph;
|
|
1789
|
+
if (prevConstraintGraph !== null &&
|
|
1790
|
+
!this.shouldRebuildConstraintGraph(this.committedRoot, prevConstraintGraph, commitRes.unmountedInstanceIds)) {
|
|
1791
|
+
constraintGraph = prevConstraintGraph;
|
|
1792
|
+
if (this._constraintExprIndexByInstanceId === null) {
|
|
1793
|
+
this.rebuildConstraintExprIndex(prevConstraintGraph);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
else {
|
|
1797
|
+
const graphRes = buildConstraintGraph(this.committedRoot);
|
|
1798
|
+
if (!graphRes.ok) {
|
|
1799
|
+
return {
|
|
1800
|
+
ok: false,
|
|
1801
|
+
code: graphRes.fatal.code,
|
|
1802
|
+
detail: this.describeConstraintGraphFatal(graphRes.fatal),
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1805
|
+
constraintGraph = graphRes.value;
|
|
1806
|
+
this._constraintGraph = graphRes.value;
|
|
1807
|
+
this.rebuildConstraintExprIndex(graphRes.value);
|
|
1808
|
+
this._constraintResolutionCache.clear();
|
|
1809
|
+
this.invalidateConstraintInputSignature();
|
|
1810
|
+
}
|
|
1811
|
+
if (constraintGraph.nodes.length === 0) {
|
|
1812
|
+
this._constraintInputKey = null;
|
|
1813
|
+
this._constraintValuesByInstanceId = null;
|
|
1814
|
+
this._constraintResolutionCache.clear();
|
|
1815
|
+
this.invalidateConstraintInputSignature();
|
|
1816
|
+
this._constraintExprIndexByInstanceId = null;
|
|
1817
|
+
this._constraintLastResolution = CONSTRAINT_RESOLUTION_NONE;
|
|
1818
|
+
this._constraintLastCacheKey = null;
|
|
1819
|
+
}
|
|
1820
|
+
else if (!doLayout && constraintGraph.requiresCommitRelayout) {
|
|
1821
|
+
// Some constraint graphs depend on baseline layout/intrinsic data that
|
|
1822
|
+
// can change on commit without touching explicit layout-key props.
|
|
1823
|
+
// Only those graphs force relayout here.
|
|
1824
|
+
doLayout = true;
|
|
1825
|
+
}
|
|
1826
|
+
const damageToken = PERF_DETAIL_ENABLED ? perfMarkStart("damage_identity_diff") : 0;
|
|
1827
|
+
identityDamageFromCommit = this.computeIdentityDiffDamage(prevCommittedRoot, this.committedRoot);
|
|
1828
|
+
if (PERF_DETAIL_ENABLED)
|
|
1829
|
+
perfMarkEnd("damage_identity_diff", damageToken);
|
|
1830
|
+
if (!doLayout && plan.checkLayoutStability) {
|
|
1831
|
+
// Detect layout-relevant commit changes (including child order changes)
|
|
1832
|
+
// using per-instance stability signatures.
|
|
1833
|
+
const layoutSigToken = PERF_ENABLED ? perfNow() : 0;
|
|
1834
|
+
const layoutSigChanged = updateLayoutStabilitySignatures(this.committedRoot, this._pooledLayoutSigByInstanceId, this._pooledNextLayoutSigByInstanceId, this._pooledRuntimeStack, this._pooledRuntimeParentKindStack, commitRes.unmountedInstanceIds, true);
|
|
1835
|
+
if (PERF_ENABLED)
|
|
1836
|
+
perfCount("layout_sig_update_time_ms", perfNow() - layoutSigToken);
|
|
1837
|
+
if (layoutSigChanged) {
|
|
1838
|
+
doLayout = true;
|
|
1839
|
+
}
|
|
1840
|
+
else {
|
|
1841
|
+
layoutShapeVerifiedBySignature = true;
|
|
1842
|
+
if (PERF_ENABLED)
|
|
1843
|
+
perfCount("layout_shape_guard_skipped_from_signature");
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
if (!doLayout && this.layoutTree !== null && !layoutShapeVerifiedBySignature) {
|
|
1847
|
+
// Defensive guard: never render a newly committed runtime tree against
|
|
1848
|
+
// a stale layout tree with different shape/kinds.
|
|
1849
|
+
const shapeGuardToken = PERF_ENABLED ? perfNow() : 0;
|
|
1850
|
+
if (PERF_ENABLED)
|
|
1851
|
+
perfCount("layout_shape_guard_checked");
|
|
1852
|
+
if (hasRuntimeLayoutShapeMismatch(this.committedRoot, this.layoutTree)) {
|
|
1853
|
+
if (PERF_ENABLED)
|
|
1854
|
+
perfCount("layout_shape_guard_mismatch");
|
|
1855
|
+
doLayout = true;
|
|
1856
|
+
}
|
|
1857
|
+
if (PERF_ENABLED)
|
|
1858
|
+
perfCount("layout_shape_guard_time_ms", perfNow() - shapeGuardToken);
|
|
1859
|
+
}
|
|
1860
|
+
let deferredExitCleanupIds = null;
|
|
1861
|
+
if (commitRes.pendingExitAnimations.length > 0) {
|
|
1862
|
+
deferredExitCleanupIds = new Set();
|
|
1863
|
+
for (const pending of commitRes.pendingExitAnimations) {
|
|
1864
|
+
for (const id of pending.subtreeInstanceIds) {
|
|
1865
|
+
deferredExitCleanupIds.add(id);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
this.cleanupUnmountedInstanceIds(commitRes.unmountedInstanceIds, deferredExitCleanupIds ? { skipIds: deferredExitCleanupIds } : undefined);
|
|
1870
|
+
this.scheduleExitAnimations(commitRes.pendingExitAnimations, frameNowMs, prevLayoutSubtreeByInstanceId);
|
|
1871
|
+
this.cancelExitTransitionsForReappearedKeys(this.committedRoot);
|
|
1872
|
+
for (const path of this.errorBoundaryStatesByPath.keys()) {
|
|
1873
|
+
if (!this.committedErrorBoundaryPathsScratch.has(path)) {
|
|
1874
|
+
this.errorBoundaryStatesByPath.delete(path);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
for (const path of this.retryErrorBoundaryPaths) {
|
|
1878
|
+
if (!this.committedErrorBoundaryPathsScratch.has(path)) {
|
|
1879
|
+
this.retryErrorBoundaryPaths.delete(path);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
if (constraintGraph === null && this.committedRoot !== null) {
|
|
1884
|
+
const graphRes = buildConstraintGraph(this.committedRoot);
|
|
1885
|
+
if (!graphRes.ok) {
|
|
1886
|
+
return {
|
|
1887
|
+
ok: false,
|
|
1888
|
+
code: graphRes.fatal.code,
|
|
1889
|
+
detail: this.describeConstraintGraphFatal(graphRes.fatal),
|
|
1890
|
+
};
|
|
1891
|
+
}
|
|
1892
|
+
constraintGraph = graphRes.value;
|
|
1893
|
+
this._constraintGraph = graphRes.value;
|
|
1894
|
+
this.rebuildConstraintExprIndex(graphRes.value);
|
|
1895
|
+
this._constraintResolutionCache.clear();
|
|
1896
|
+
this.invalidateConstraintInputSignature();
|
|
1897
|
+
}
|
|
1898
|
+
if (!this.committedRoot) {
|
|
1899
|
+
return {
|
|
1900
|
+
ok: false,
|
|
1901
|
+
code: "ZRUI_INVALID_PROPS",
|
|
1902
|
+
detail: "widgetRenderer: missing committed root",
|
|
1903
|
+
};
|
|
1904
|
+
}
|
|
1905
|
+
const forceFullRelayout = !this._hasRenderedFrame ||
|
|
1906
|
+
this._lastRenderedViewport.cols !== viewport.cols ||
|
|
1907
|
+
this._lastRenderedViewport.rows !== viewport.rows ||
|
|
1908
|
+
this._lastRenderedThemeRef !== theme;
|
|
1909
|
+
if (PERF_ENABLED) {
|
|
1910
|
+
if (doLayout)
|
|
1911
|
+
perfCount("layout_requested_frames");
|
|
1912
|
+
else
|
|
1913
|
+
perfCount("layout_skipped_frames");
|
|
1914
|
+
if (forceFullRelayout)
|
|
1915
|
+
perfCount("layout_force_full_relayout_frames");
|
|
1916
|
+
}
|
|
1917
|
+
if (doLayout) {
|
|
1918
|
+
const rootPad = this.rootPadding;
|
|
1919
|
+
const rootW = Math.max(0, viewport.cols - rootPad * 2);
|
|
1920
|
+
const rootH = Math.max(0, viewport.rows - rootPad * 2);
|
|
1921
|
+
const layoutToken = perfMarkStart("layout");
|
|
1922
|
+
// Cold-pass only when frame context changes fundamentally (first frame,
|
|
1923
|
+
// viewport size change, or theme ref swap). Keep warm cache otherwise and
|
|
1924
|
+
// rely on guarded fallback below if a shape mismatch is detected.
|
|
1925
|
+
if (forceFullRelayout) {
|
|
1926
|
+
this._layoutTreeCache = new WeakMap();
|
|
1927
|
+
}
|
|
1928
|
+
let constrainedLayoutRootVNode = this.committedRoot.vnode;
|
|
1929
|
+
let resolvedValuesForLayout = null;
|
|
1930
|
+
if (constraintGraph !== null && constraintGraph.nodes.length > 0) {
|
|
1931
|
+
this.buildConstraintResolutionInputs(this.committedRoot, constraintGraph, rootW, rootH);
|
|
1932
|
+
const constraintInputChanged = this.hasConstraintInputSignatureChange(constraintGraph, viewport, rootW, rootH);
|
|
1933
|
+
let resolvedValues = this._constraintValuesByInstanceId;
|
|
1934
|
+
if (constraintInputChanged || resolvedValues === null) {
|
|
1935
|
+
const constraintInputKey = this.computeConstraintInputKey(constraintGraph, viewport, rootW, rootH);
|
|
1936
|
+
const resolved = resolveConstraints(constraintGraph, {
|
|
1937
|
+
viewport: { w: viewport.cols, h: viewport.rows },
|
|
1938
|
+
parent: { w: rootW, h: rootH },
|
|
1939
|
+
baseValues: this._pooledConstraintBaseValues,
|
|
1940
|
+
parentValues: this._pooledConstraintParentValues,
|
|
1941
|
+
intrinsicValues: this._pooledConstraintIntrinsicValues,
|
|
1942
|
+
cache: this._constraintResolutionCache,
|
|
1943
|
+
cacheKey: constraintInputKey,
|
|
1944
|
+
});
|
|
1945
|
+
resolvedValues = resolved.values;
|
|
1946
|
+
this._constraintValuesByInstanceId = resolved.values;
|
|
1947
|
+
this._constraintInputKey = constraintInputKey;
|
|
1948
|
+
this._constraintLastCacheKey = constraintInputKey;
|
|
1949
|
+
this._constraintLastResolution = resolved.cacheHit
|
|
1950
|
+
? CONSTRAINT_RESOLUTION_CACHE_HIT
|
|
1951
|
+
: CONSTRAINT_RESOLUTION_COMPUTED;
|
|
1952
|
+
}
|
|
1953
|
+
else {
|
|
1954
|
+
this._constraintLastCacheKey = this._constraintInputKey;
|
|
1955
|
+
this._constraintLastResolution = CONSTRAINT_RESOLUTION_REUSED;
|
|
1956
|
+
}
|
|
1957
|
+
resolvedValuesForLayout = resolvedValues;
|
|
1958
|
+
}
|
|
1959
|
+
else {
|
|
1960
|
+
this._constraintInputKey = null;
|
|
1961
|
+
this._constraintValuesByInstanceId = null;
|
|
1962
|
+
this._constraintResolutionCache.clear();
|
|
1963
|
+
this.invalidateConstraintInputSignature();
|
|
1964
|
+
this._constraintHasStaticHiddenDisplay = false;
|
|
1965
|
+
this._constraintExprIndexByInstanceId = null;
|
|
1966
|
+
this._constraintLastResolution = CONSTRAINT_RESOLUTION_NONE;
|
|
1967
|
+
this._constraintLastCacheKey = null;
|
|
1968
|
+
this._pooledConstraintAffectedPathInstanceIds.clear();
|
|
1969
|
+
this._pooledConstraintNodesWithAffectedDescendants.clear();
|
|
1970
|
+
this._constraintAffectedPathInstanceIds = this._pooledConstraintAffectedPathInstanceIds;
|
|
1971
|
+
this._constraintNodesWithAffectedDescendants =
|
|
1972
|
+
this._pooledConstraintNodesWithAffectedDescendants;
|
|
1973
|
+
}
|
|
1974
|
+
this.rebuildConstraintHiddenState(this.committedRoot, resolvedValuesForLayout);
|
|
1975
|
+
if (constraintGraph !== null &&
|
|
1976
|
+
((resolvedValuesForLayout !== null && resolvedValuesForLayout.size > 0) ||
|
|
1977
|
+
this._hiddenConstraintInstanceIds.size > 0)) {
|
|
1978
|
+
this.rebuildConstraintAffectedPathSet(constraintGraph, this._hiddenConstraintInstanceIds);
|
|
1979
|
+
constrainedLayoutRootVNode = this.applyConstraintOverridesToVNode(this.committedRoot, resolvedValuesForLayout, this._hiddenConstraintInstanceIds, this._constraintAffectedPathInstanceIds);
|
|
1980
|
+
}
|
|
1981
|
+
const pendingScrollOverrides = this.scrollOverrides.size > 0 ? new Map(this.scrollOverrides) : null;
|
|
1982
|
+
const layoutRootVNode = pendingScrollOverrides !== null
|
|
1983
|
+
? this.applyScrollOverridesToVNode(constrainedLayoutRootVNode, pendingScrollOverrides)
|
|
1984
|
+
: constrainedLayoutRootVNode;
|
|
1985
|
+
this.scrollOverrides.clear();
|
|
1986
|
+
const initialLayoutRes = this.layoutWithShapeFallback(layoutRootVNode, constrainedLayoutRootVNode, rootPad, rootW, rootH, true);
|
|
1987
|
+
if (!initialLayoutRes.ok) {
|
|
1988
|
+
perfMarkEnd("layout", layoutToken);
|
|
1989
|
+
return {
|
|
1990
|
+
ok: false,
|
|
1991
|
+
code: initialLayoutRes.fatal.code,
|
|
1992
|
+
detail: initialLayoutRes.fatal.detail,
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1995
|
+
let nextLayoutTree = initialLayoutRes.value;
|
|
1996
|
+
// Constraint graphs that depend on parent/widget geometry may need
|
|
1997
|
+
// multiple in-frame settle passes because nested parent-dependent
|
|
1998
|
+
// constraints can converge one depth level at a time.
|
|
1999
|
+
if (constraintGraph !== null && constraintGraph.nodes.length > 0) {
|
|
2000
|
+
let settlePasses = 0;
|
|
2001
|
+
// Nested parent/intrinsic chains can converge one dependency level at a time.
|
|
2002
|
+
// Use the graph size instead of an arbitrary small cap so first-frame layout
|
|
2003
|
+
// can fully settle for deep but valid trees, but bound worst-case synchronous
|
|
2004
|
+
// frame time for pathological graphs and emit an audit signal if we hit the cap.
|
|
2005
|
+
const maxSettlePasses = Math.min(MAX_CONSTRAINT_SETTLE_PASSES, Math.max(3, constraintGraph.nodes.length + 1));
|
|
2006
|
+
while (settlePasses < maxSettlePasses) {
|
|
2007
|
+
buildLayoutRectIndexes(nextLayoutTree, this.committedRoot, this._pooledRectByInstanceId, this._pooledDamageRectByInstanceId, this._pooledRectById, this._pooledDamageRectById, this._pooledSplitPaneChildRectsById, this._pooledLayoutStack, this._pooledRuntimeStack);
|
|
2008
|
+
this.buildConstraintResolutionInputs(this.committedRoot, constraintGraph, rootW, rootH);
|
|
2009
|
+
const settleInputChanged = this.hasConstraintInputSignatureChange(constraintGraph, viewport, rootW, rootH);
|
|
2010
|
+
if (!settleInputChanged) {
|
|
2011
|
+
break;
|
|
2012
|
+
}
|
|
2013
|
+
const constraintInputKey = this.computeConstraintInputKey(constraintGraph, viewport, rootW, rootH);
|
|
2014
|
+
const settled = resolveConstraints(constraintGraph, {
|
|
2015
|
+
viewport: { w: viewport.cols, h: viewport.rows },
|
|
2016
|
+
parent: { w: rootW, h: rootH },
|
|
2017
|
+
baseValues: this._pooledConstraintBaseValues,
|
|
2018
|
+
parentValues: this._pooledConstraintParentValues,
|
|
2019
|
+
intrinsicValues: this._pooledConstraintIntrinsicValues,
|
|
2020
|
+
cache: this._constraintResolutionCache,
|
|
2021
|
+
cacheKey: constraintInputKey,
|
|
2022
|
+
});
|
|
2023
|
+
resolvedValuesForLayout = settled.values;
|
|
2024
|
+
this._constraintValuesByInstanceId = settled.values;
|
|
2025
|
+
this._constraintInputKey = constraintInputKey;
|
|
2026
|
+
this._constraintLastCacheKey = constraintInputKey;
|
|
2027
|
+
this._constraintLastResolution = settled.cacheHit
|
|
2028
|
+
? CONSTRAINT_RESOLUTION_CACHE_HIT
|
|
2029
|
+
: CONSTRAINT_RESOLUTION_COMPUTED;
|
|
2030
|
+
this.rebuildConstraintHiddenState(this.committedRoot, resolvedValuesForLayout);
|
|
2031
|
+
let settledConstrainedRootVNode = this.committedRoot.vnode;
|
|
2032
|
+
if ((resolvedValuesForLayout !== null && resolvedValuesForLayout.size > 0) ||
|
|
2033
|
+
this._hiddenConstraintInstanceIds.size > 0) {
|
|
2034
|
+
this.rebuildConstraintAffectedPathSet(constraintGraph, this._hiddenConstraintInstanceIds);
|
|
2035
|
+
settledConstrainedRootVNode = this.applyConstraintOverridesToVNode(this.committedRoot, resolvedValuesForLayout, this._hiddenConstraintInstanceIds, this._constraintAffectedPathInstanceIds);
|
|
2036
|
+
}
|
|
2037
|
+
const settledLayoutRootVNode = pendingScrollOverrides !== null
|
|
2038
|
+
? this.applyScrollOverridesToVNode(settledConstrainedRootVNode, pendingScrollOverrides)
|
|
2039
|
+
: settledConstrainedRootVNode;
|
|
2040
|
+
const settledLayoutRes = this.layoutWithShapeFallback(settledLayoutRootVNode, settledConstrainedRootVNode, rootPad, rootW, rootH, true);
|
|
2041
|
+
if (!settledLayoutRes.ok) {
|
|
2042
|
+
perfMarkEnd("layout", layoutToken);
|
|
2043
|
+
return {
|
|
2044
|
+
ok: false,
|
|
2045
|
+
code: settledLayoutRes.fatal.code,
|
|
2046
|
+
detail: settledLayoutRes.fatal.detail,
|
|
2047
|
+
};
|
|
2048
|
+
}
|
|
2049
|
+
nextLayoutTree = settledLayoutRes.value;
|
|
2050
|
+
settlePasses++;
|
|
2051
|
+
}
|
|
2052
|
+
if (settlePasses >= maxSettlePasses) {
|
|
2053
|
+
if (PERF_ENABLED) {
|
|
2054
|
+
perfCount("layout_constraint_settle_passes_cap_hit", 1);
|
|
2055
|
+
}
|
|
2056
|
+
if (FRAME_AUDIT_ENABLED) {
|
|
2057
|
+
emitFrameAudit("widgetRenderer", "layout.constraint_settle_cap_hit", {
|
|
2058
|
+
passes: settlePasses,
|
|
2059
|
+
maxPasses: maxSettlePasses,
|
|
2060
|
+
nodeCount: constraintGraph.nodes.length,
|
|
2061
|
+
});
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
if (PERF_ENABLED && settlePasses > 0) {
|
|
2065
|
+
perfCount("layout_constraint_settle_passes", settlePasses);
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
perfMarkEnd("layout", layoutToken);
|
|
2069
|
+
this.layoutTree = nextLayoutTree;
|
|
2070
|
+
if (doCommit) {
|
|
2071
|
+
// Seed/refresh per-instance layout stability signatures after a real
|
|
2072
|
+
// layout pass so subsequent commits can take the signature fast path.
|
|
2073
|
+
const sigSeedToken = PERF_ENABLED ? perfNow() : 0;
|
|
2074
|
+
updateLayoutStabilitySignatures(this.committedRoot, this._pooledLayoutSigByInstanceId, this._pooledNextLayoutSigByInstanceId, this._pooledRuntimeStack, this._pooledRuntimeParentKindStack, commitRes?.unmountedInstanceIds ?? [], false);
|
|
2075
|
+
if (PERF_ENABLED)
|
|
2076
|
+
perfCount("layout_sig_seed_time_ms", perfNow() - sigSeedToken);
|
|
2077
|
+
}
|
|
2078
|
+
this.emitDevLayoutWarnings(nextLayoutTree, viewport);
|
|
2079
|
+
// Build a fast instanceId->rect index for overlay routing (modal/layer hit testing),
|
|
2080
|
+
// plus an id->rect map for widget-local interactions (scrolling, divider drags).
|
|
2081
|
+
// Uses pooled collections to avoid per-frame allocations.
|
|
2082
|
+
const layoutIndexesToken = PERF_DETAIL_ENABLED ? perfMarkStart("layout_indexes") : 0;
|
|
2083
|
+
buildLayoutRectIndexes(nextLayoutTree, this.committedRoot, this._pooledRectByInstanceId, this._pooledDamageRectByInstanceId, this._pooledRectById, this._pooledDamageRectById, this._pooledSplitPaneChildRectsById, this._pooledLayoutStack, this._pooledRuntimeStack);
|
|
2084
|
+
if (PERF_DETAIL_ENABLED)
|
|
2085
|
+
perfMarkEnd("layout_indexes", layoutIndexesToken);
|
|
2086
|
+
this.rectById = this._pooledRectById;
|
|
2087
|
+
this.splitPaneChildRectsById = this._pooledSplitPaneChildRectsById;
|
|
2088
|
+
this.markLayoutDirtyNodes(this.committedRoot);
|
|
2089
|
+
}
|
|
2090
|
+
else {
|
|
2091
|
+
this.rebuildConstraintHiddenState(this.committedRoot, constraintGraph !== null && constraintGraph.nodes.length > 0
|
|
2092
|
+
? this._constraintValuesByInstanceId
|
|
2093
|
+
: null);
|
|
2094
|
+
}
|
|
2095
|
+
if (!this.layoutTree) {
|
|
2096
|
+
return {
|
|
2097
|
+
ok: false,
|
|
2098
|
+
code: "ZRUI_INVALID_PROPS",
|
|
2099
|
+
detail: "widgetRenderer: missing layout tree",
|
|
2100
|
+
};
|
|
2101
|
+
}
|
|
2102
|
+
if (doCommit && !doLayout) {
|
|
2103
|
+
this.refreshDamageRectIndexesForLayoutSkippedCommit(this.committedRoot);
|
|
2104
|
+
}
|
|
2105
|
+
if (doCommit) {
|
|
2106
|
+
const canSkipMetadataCollect = prevCommittedRoot !== null &&
|
|
2107
|
+
hadRoutingWidgets === false &&
|
|
2108
|
+
identityDamageFromCommit !== null &&
|
|
2109
|
+
identityDamageFromCommit.routingRelevantChanged === false &&
|
|
2110
|
+
this.baseFocusList.length === 0 &&
|
|
2111
|
+
this.focusState.focusedId === null;
|
|
2112
|
+
if (!canSkipMetadataCollect) {
|
|
2113
|
+
const metaToken = PERF_DETAIL_ENABLED ? perfMarkStart("metadata_collect") : 0;
|
|
2114
|
+
// Single-pass metadata collection using pooled collector (avoids per-frame allocations)
|
|
2115
|
+
const widgetMeta = this._metadataCollector.collect(this.committedRoot);
|
|
2116
|
+
hasRoutingWidgets = widgetMeta.hasRoutingWidgets;
|
|
2117
|
+
let focusableIds = widgetMeta.focusableIds;
|
|
2118
|
+
let enabledById = widgetMeta.enabledById;
|
|
2119
|
+
let focusInfoById = widgetMeta.focusInfoById;
|
|
2120
|
+
let pressableIds = widgetMeta.pressableIds;
|
|
2121
|
+
let inputById = widgetMeta.inputById;
|
|
2122
|
+
let zones = widgetMeta.zones;
|
|
2123
|
+
let traps = widgetMeta.traps;
|
|
2124
|
+
const hiddenWidgetIds = this._hiddenConstraintWidgetIds;
|
|
2125
|
+
if (hiddenWidgetIds.size > 0) {
|
|
2126
|
+
const filteredFocusable = focusableIds.filter((id) => !hiddenWidgetIds.has(id));
|
|
2127
|
+
focusableIds = Object.freeze(filteredFocusable);
|
|
2128
|
+
const filteredEnabled = new Map();
|
|
2129
|
+
for (const [id, enabled] of enabledById) {
|
|
2130
|
+
if (!hiddenWidgetIds.has(id))
|
|
2131
|
+
filteredEnabled.set(id, enabled);
|
|
2132
|
+
}
|
|
2133
|
+
enabledById = filteredEnabled;
|
|
2134
|
+
const filteredFocusInfo = new Map();
|
|
2135
|
+
for (const [id, info] of focusInfoById) {
|
|
2136
|
+
if (!hiddenWidgetIds.has(id))
|
|
2137
|
+
filteredFocusInfo.set(id, info);
|
|
2138
|
+
}
|
|
2139
|
+
focusInfoById = filteredFocusInfo;
|
|
2140
|
+
const filteredPressable = new Set();
|
|
2141
|
+
for (const id of pressableIds) {
|
|
2142
|
+
if (!hiddenWidgetIds.has(id))
|
|
2143
|
+
filteredPressable.add(id);
|
|
2144
|
+
}
|
|
2145
|
+
pressableIds = filteredPressable;
|
|
2146
|
+
const filteredInputById = new Map();
|
|
2147
|
+
for (const [id, info] of inputById) {
|
|
2148
|
+
if (!hiddenWidgetIds.has(id))
|
|
2149
|
+
filteredInputById.set(id, info);
|
|
2150
|
+
}
|
|
2151
|
+
inputById = filteredInputById;
|
|
2152
|
+
const filteredZones = new Map();
|
|
2153
|
+
for (const [id, zone] of zones) {
|
|
2154
|
+
const zoneFocusable = zone.focusableIds.filter((focusId) => !hiddenWidgetIds.has(focusId));
|
|
2155
|
+
filteredZones.set(id, Object.freeze({
|
|
2156
|
+
...zone,
|
|
2157
|
+
focusableIds: Object.freeze(zoneFocusable),
|
|
2158
|
+
}));
|
|
2159
|
+
}
|
|
2160
|
+
zones = filteredZones;
|
|
2161
|
+
const filteredTraps = new Map();
|
|
2162
|
+
for (const [id, trap] of traps) {
|
|
2163
|
+
const trapFocusable = trap.focusableIds.filter((focusId) => !hiddenWidgetIds.has(focusId));
|
|
2164
|
+
filteredTraps.set(id, Object.freeze({
|
|
2165
|
+
...trap,
|
|
2166
|
+
focusableIds: Object.freeze(trapFocusable),
|
|
2167
|
+
}));
|
|
2168
|
+
}
|
|
2169
|
+
traps = filteredTraps;
|
|
2170
|
+
}
|
|
2171
|
+
const nextZoneMetaById = new Map(zones);
|
|
2172
|
+
prevFocusedIdBeforeFinalize = this.focusState.focusedId;
|
|
2173
|
+
this.focusState = finalizeFocusWithPreCollectedMetadata(this.focusState, focusableIds, zones, traps);
|
|
2174
|
+
this.baseFocusList = focusableIds;
|
|
2175
|
+
this.baseEnabledById = enabledById;
|
|
2176
|
+
this.focusList = focusableIds;
|
|
2177
|
+
this.focusInfoById = focusInfoById;
|
|
2178
|
+
this.enabledById = enabledById;
|
|
2179
|
+
this.pressableIds = pressableIds;
|
|
2180
|
+
this.inputById = inputById;
|
|
2181
|
+
this.traps = traps;
|
|
2182
|
+
this.zoneMetaById = nextZoneMetaById;
|
|
2183
|
+
if (PERF_DETAIL_ENABLED)
|
|
2184
|
+
perfMarkEnd("metadata_collect", metaToken);
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
const canSkipFullRoutingRebuildOnCommit = doCommit &&
|
|
2188
|
+
hadRoutingWidgets &&
|
|
2189
|
+
hasRoutingWidgets &&
|
|
2190
|
+
identityDamageFromCommit !== null &&
|
|
2191
|
+
identityDamageFromCommit.routingRelevantChanged === false;
|
|
2192
|
+
if (doCommit &&
|
|
2193
|
+
(hasRoutingWidgets || hadRoutingWidgets) &&
|
|
2194
|
+
!canSkipFullRoutingRebuildOnCommit) {
|
|
2195
|
+
didRoutingRebuild = true;
|
|
2196
|
+
this.hadRoutingWidgets = hasRoutingWidgets;
|
|
2197
|
+
const routingToken = PERF_DETAIL_ENABLED ? perfMarkStart("routing_rebuild") : 0;
|
|
2198
|
+
const getRectForInstance = (instanceId) => this._pooledRectByInstanceId.get(instanceId) ?? ZERO_RECT;
|
|
2199
|
+
rebuildRoutingWidgetMapsAndOverlayState({
|
|
2200
|
+
committedRoot: this.committedRoot,
|
|
2201
|
+
hiddenConstraintInstanceIds: this._hiddenConstraintInstanceIds,
|
|
2202
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
2203
|
+
pooledPrevTreeIds: this._pooledPrevTreeIds,
|
|
2204
|
+
getRectForInstance,
|
|
2205
|
+
computeDropdownRect: (props) => this.computeDropdownRect(props),
|
|
2206
|
+
layerRegistry: this.layerRegistry,
|
|
2207
|
+
pooledCloseOnEscape: this._pooledCloseOnEscape,
|
|
2208
|
+
pooledCloseOnBackdrop: this._pooledCloseOnBackdrop,
|
|
2209
|
+
pooledOnClose: this._pooledOnClose,
|
|
2210
|
+
pooledDropdownStack: this._pooledDropdownStack,
|
|
2211
|
+
pooledOverlayShortcutOwners: this._pooledOverlayShortcutOwners,
|
|
2212
|
+
pooledToastContainers: this._pooledToastContainers,
|
|
2213
|
+
virtualListById: this.virtualListById,
|
|
2214
|
+
buttonById: this.buttonById,
|
|
2215
|
+
linkById: this.linkById,
|
|
2216
|
+
tableById: this.tableById,
|
|
2217
|
+
treeById: this.treeById,
|
|
2218
|
+
dropdownById: this.dropdownById,
|
|
2219
|
+
sliderById: this.sliderById,
|
|
2220
|
+
selectById: this.selectById,
|
|
2221
|
+
checkboxById: this.checkboxById,
|
|
2222
|
+
radioGroupById: this.radioGroupById,
|
|
2223
|
+
commandPaletteById: this.commandPaletteById,
|
|
2224
|
+
filePickerById: this.filePickerById,
|
|
2225
|
+
fileTreeExplorerById: this.fileTreeExplorerById,
|
|
2226
|
+
splitPaneById: this.splitPaneById,
|
|
2227
|
+
codeEditorById: this.codeEditorById,
|
|
2228
|
+
diffViewerById: this.diffViewerById,
|
|
2229
|
+
toolApprovalDialogById: this.toolApprovalDialogById,
|
|
2230
|
+
logsConsoleById: this.logsConsoleById,
|
|
2231
|
+
});
|
|
2232
|
+
const preferredToastFocus = prevFocusedIdBeforeFinalize !== null &&
|
|
2233
|
+
parseToastActionFocusId(prevFocusedIdBeforeFinalize) !== null
|
|
2234
|
+
? prevFocusedIdBeforeFinalize
|
|
2235
|
+
: null;
|
|
2236
|
+
const finalizedOverlayState = finalizeRebuiltOverlayState({
|
|
2237
|
+
layerRegistry: this.layerRegistry,
|
|
2238
|
+
pooledCloseOnEscape: this._pooledCloseOnEscape,
|
|
2239
|
+
pooledCloseOnBackdrop: this._pooledCloseOnBackdrop,
|
|
2240
|
+
pooledOnClose: this._pooledOnClose,
|
|
2241
|
+
pooledDropdownStack: this._pooledDropdownStack,
|
|
2242
|
+
pooledOverlayShortcutOwners: this._pooledOverlayShortcutOwners,
|
|
2243
|
+
pooledToastContainers: this._pooledToastContainers,
|
|
2244
|
+
pooledToastActionByFocusId: this._pooledToastActionByFocusId,
|
|
2245
|
+
pooledToastActionLabelByFocusId: this._pooledToastActionLabelByFocusId,
|
|
2246
|
+
pooledToastFocusableActionIds: this._pooledToastFocusableActionIds,
|
|
2247
|
+
baseFocusList: this.baseFocusList,
|
|
2248
|
+
baseEnabledById: this.baseEnabledById,
|
|
2249
|
+
focusState: this.focusState,
|
|
2250
|
+
preferredToastFocus,
|
|
2251
|
+
});
|
|
2252
|
+
this.layerStack = finalizedOverlayState.layerStack;
|
|
2253
|
+
this.closeOnEscapeByLayerId = finalizedOverlayState.closeOnEscapeByLayerId;
|
|
2254
|
+
this.closeOnBackdropByLayerId = finalizedOverlayState.closeOnBackdropByLayerId;
|
|
2255
|
+
this.onCloseByLayerId = finalizedOverlayState.onCloseByLayerId;
|
|
2256
|
+
this.dropdownStack = finalizedOverlayState.dropdownStack;
|
|
2257
|
+
this.overlayShortcutOwners = finalizedOverlayState.overlayShortcutOwners;
|
|
2258
|
+
this.toastContainers = finalizedOverlayState.toastContainers;
|
|
2259
|
+
this.rebuildOverlayShortcutBindings();
|
|
2260
|
+
this.toastActionByFocusId = finalizedOverlayState.toastActionByFocusId;
|
|
2261
|
+
this.toastActionLabelByFocusId = finalizedOverlayState.toastActionLabelByFocusId;
|
|
2262
|
+
this.toastFocusableActionIds = finalizedOverlayState.toastFocusableActionIds;
|
|
2263
|
+
this.focusList = finalizedOverlayState.focusList;
|
|
2264
|
+
this.enabledById = finalizedOverlayState.enabledById;
|
|
2265
|
+
this.focusState = finalizedOverlayState.focusState;
|
|
2266
|
+
if (PERF_DETAIL_ENABLED)
|
|
2267
|
+
perfMarkEnd("routing_rebuild", routingToken);
|
|
2268
|
+
}
|
|
2269
|
+
else if (doLayout && hadRoutingWidgets) {
|
|
2270
|
+
// Layout-only turns (e.g. resize) keep the committed widget maps intact.
|
|
2271
|
+
// Rebuild only rect-dependent overlay/ toast routing state.
|
|
2272
|
+
const routingToken = PERF_DETAIL_ENABLED ? perfMarkStart("routing_rebuild") : 0;
|
|
2273
|
+
const getRectForInstance = (instanceId) => this._pooledRectByInstanceId.get(instanceId) ?? ZERO_RECT;
|
|
2274
|
+
rebuildOverlayStateForLayout({
|
|
2275
|
+
committedRoot: this.committedRoot,
|
|
2276
|
+
hiddenConstraintInstanceIds: this._hiddenConstraintInstanceIds,
|
|
2277
|
+
pooledRuntimeStack: this._pooledRuntimeStack,
|
|
2278
|
+
getRectForInstance,
|
|
2279
|
+
computeDropdownRect: (props) => this.computeDropdownRect(props),
|
|
2280
|
+
layerRegistry: this.layerRegistry,
|
|
2281
|
+
pooledCloseOnEscape: this._pooledCloseOnEscape,
|
|
2282
|
+
pooledCloseOnBackdrop: this._pooledCloseOnBackdrop,
|
|
2283
|
+
pooledOnClose: this._pooledOnClose,
|
|
2284
|
+
pooledDropdownStack: this._pooledDropdownStack,
|
|
2285
|
+
pooledOverlayShortcutOwners: this._pooledOverlayShortcutOwners,
|
|
2286
|
+
pooledToastContainers: this._pooledToastContainers,
|
|
2287
|
+
});
|
|
2288
|
+
const finalizedOverlayState = finalizeLayoutOnlyOverlayState({
|
|
2289
|
+
layerRegistry: this.layerRegistry,
|
|
2290
|
+
pooledCloseOnEscape: this._pooledCloseOnEscape,
|
|
2291
|
+
pooledCloseOnBackdrop: this._pooledCloseOnBackdrop,
|
|
2292
|
+
pooledOnClose: this._pooledOnClose,
|
|
2293
|
+
pooledDropdownStack: this._pooledDropdownStack,
|
|
2294
|
+
pooledToastContainers: this._pooledToastContainers,
|
|
2295
|
+
pooledToastActionByFocusId: this._pooledToastActionByFocusId,
|
|
2296
|
+
pooledToastActionLabelByFocusId: this._pooledToastActionLabelByFocusId,
|
|
2297
|
+
pooledToastFocusableActionIds: this._pooledToastFocusableActionIds,
|
|
2298
|
+
baseFocusList: this.baseFocusList,
|
|
2299
|
+
baseEnabledById: this.baseEnabledById,
|
|
2300
|
+
focusState: this.focusState,
|
|
2301
|
+
});
|
|
2302
|
+
this.layerStack = finalizedOverlayState.layerStack;
|
|
2303
|
+
this.closeOnEscapeByLayerId = finalizedOverlayState.closeOnEscapeByLayerId;
|
|
2304
|
+
this.closeOnBackdropByLayerId = finalizedOverlayState.closeOnBackdropByLayerId;
|
|
2305
|
+
this.onCloseByLayerId = finalizedOverlayState.onCloseByLayerId;
|
|
2306
|
+
this.dropdownStack = finalizedOverlayState.dropdownStack;
|
|
2307
|
+
this.toastContainers = finalizedOverlayState.toastContainers;
|
|
2308
|
+
this.rebuildOverlayShortcutBindings();
|
|
2309
|
+
this.toastActionByFocusId = finalizedOverlayState.toastActionByFocusId;
|
|
2310
|
+
this.toastActionLabelByFocusId = finalizedOverlayState.toastActionLabelByFocusId;
|
|
2311
|
+
this.toastFocusableActionIds = finalizedOverlayState.toastFocusableActionIds;
|
|
2312
|
+
this.focusList = finalizedOverlayState.focusList;
|
|
2313
|
+
this.enabledById = finalizedOverlayState.enabledById;
|
|
2314
|
+
this.focusState = finalizedOverlayState.focusState;
|
|
2315
|
+
if (PERF_DETAIL_ENABLED)
|
|
2316
|
+
perfMarkEnd("routing_rebuild", routingToken);
|
|
2317
|
+
}
|
|
2318
|
+
if (doCommit && !didRoutingRebuild) {
|
|
2319
|
+
this.hadRoutingWidgets = hasRoutingWidgets;
|
|
2320
|
+
if (canSkipFullRoutingRebuildOnCommit && !doLayout) {
|
|
2321
|
+
// Full routing rebuild usually refreshes shortcut bindings. When this
|
|
2322
|
+
// fast path skips that rebuild on commit-only turns, keep shortcut
|
|
2323
|
+
// bindings in sync with async command palette item updates.
|
|
2324
|
+
this.rebuildOverlayShortcutBindings();
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
if (doCommit && didRoutingRebuild) {
|
|
2328
|
+
const cleanedRoutingState = cleanupRoutingStateAfterRebuild({
|
|
2329
|
+
pooledPrevTreeIds: this._pooledPrevTreeIds,
|
|
2330
|
+
treeStore: this.treeStore,
|
|
2331
|
+
virtualListStore: this.virtualListStore,
|
|
2332
|
+
tableStore: this.tableStore,
|
|
2333
|
+
loadedTreeChildrenByTreeId: this.loadedTreeChildrenByTreeId,
|
|
2334
|
+
treeLoadTokenByTreeAndKey: this.treeLoadTokenByTreeAndKey,
|
|
2335
|
+
dropdownSelectedIndexById: this.dropdownSelectedIndexById,
|
|
2336
|
+
dropdownWindowStartById: this.dropdownWindowStartById,
|
|
2337
|
+
pressedVirtualList: this.pressedVirtualList,
|
|
2338
|
+
pressedFileTree: this.pressedFileTree,
|
|
2339
|
+
lastFileTreeClick: this.lastFileTreeClick,
|
|
2340
|
+
pressedFilePicker: this.pressedFilePicker,
|
|
2341
|
+
lastFilePickerClick: this.lastFilePickerClick,
|
|
2342
|
+
pressedTree: this.pressedTree,
|
|
2343
|
+
lastTreeClick: this.lastTreeClick,
|
|
2344
|
+
commandPaletteItemsById: this.commandPaletteItemsById,
|
|
2345
|
+
commandPaletteLoadingById: this.commandPaletteLoadingById,
|
|
2346
|
+
commandPaletteFetchTokenById: this.commandPaletteFetchTokenById,
|
|
2347
|
+
commandPaletteLastQueryById: this.commandPaletteLastQueryById,
|
|
2348
|
+
commandPaletteLastSourcesRefById: this.commandPaletteLastSourcesRefById,
|
|
2349
|
+
toolApprovalFocusedActionById: this.toolApprovalFocusedActionById,
|
|
2350
|
+
diffViewerFocusedHunkById: this.diffViewerFocusedHunkById,
|
|
2351
|
+
diffViewerExpandedHunksById: this.diffViewerExpandedHunksById,
|
|
2352
|
+
logsConsoleLastGTimeById: this.logsConsoleLastGTimeById,
|
|
2353
|
+
tableRenderCacheById: this.tableRenderCacheById,
|
|
2354
|
+
logsConsoleRenderCacheById: this.logsConsoleRenderCacheById,
|
|
2355
|
+
diffRenderCacheById: this.diffRenderCacheById,
|
|
2356
|
+
codeEditorRenderCacheById: this.codeEditorRenderCacheById,
|
|
2357
|
+
emptyStringArray: EMPTY_STRING_ARRAY,
|
|
2358
|
+
virtualListById: this.virtualListById,
|
|
2359
|
+
buttonById: this.buttonById,
|
|
2360
|
+
linkById: this.linkById,
|
|
2361
|
+
tableById: this.tableById,
|
|
2362
|
+
treeById: this.treeById,
|
|
2363
|
+
dropdownById: this.dropdownById,
|
|
2364
|
+
sliderById: this.sliderById,
|
|
2365
|
+
selectById: this.selectById,
|
|
2366
|
+
checkboxById: this.checkboxById,
|
|
2367
|
+
radioGroupById: this.radioGroupById,
|
|
2368
|
+
commandPaletteById: this.commandPaletteById,
|
|
2369
|
+
filePickerById: this.filePickerById,
|
|
2370
|
+
fileTreeExplorerById: this.fileTreeExplorerById,
|
|
2371
|
+
splitPaneById: this.splitPaneById,
|
|
2372
|
+
codeEditorById: this.codeEditorById,
|
|
2373
|
+
diffViewerById: this.diffViewerById,
|
|
2374
|
+
toolApprovalDialogById: this.toolApprovalDialogById,
|
|
2375
|
+
logsConsoleById: this.logsConsoleById,
|
|
2376
|
+
});
|
|
2377
|
+
this.pressedVirtualList = cleanedRoutingState.pressedVirtualList;
|
|
2378
|
+
this.pressedFileTree = cleanedRoutingState.pressedFileTree;
|
|
2379
|
+
this.lastFileTreeClick = cleanedRoutingState.lastFileTreeClick;
|
|
2380
|
+
this.pressedFilePicker = cleanedRoutingState.pressedFilePicker;
|
|
2381
|
+
this.lastFilePickerClick = cleanedRoutingState.lastFilePickerClick;
|
|
2382
|
+
this.pressedTree = cleanedRoutingState.pressedTree;
|
|
2383
|
+
this.lastTreeClick = cleanedRoutingState.lastTreeClick;
|
|
2384
|
+
}
|
|
2385
|
+
if (doCommit) {
|
|
2386
|
+
// Reset per-commit working values to committed props.value, and normalize cursor (docs/18).
|
|
2387
|
+
// If the controlled value diverged from local working state, clear undo/redo to avoid stale history.
|
|
2388
|
+
for (const meta of this.inputById.values()) {
|
|
2389
|
+
const instanceId = meta.instanceId;
|
|
2390
|
+
const prevWorkingValue = this.inputWorkingValueByInstanceId.get(instanceId);
|
|
2391
|
+
if (prevWorkingValue !== undefined && prevWorkingValue !== meta.value) {
|
|
2392
|
+
this.inputUndoByInstanceId.get(instanceId)?.clear();
|
|
2393
|
+
}
|
|
2394
|
+
this.inputWorkingValueByInstanceId.set(instanceId, meta.value);
|
|
2395
|
+
const prev = this.inputCursorByInstanceId.get(instanceId);
|
|
2396
|
+
const init = prev === undefined ? meta.value.length : prev;
|
|
2397
|
+
const nextCursor = normalizeInputCursor(meta.value, init);
|
|
2398
|
+
this.inputCursorByInstanceId.set(instanceId, nextCursor);
|
|
2399
|
+
const prevSelection = this.inputSelectionByInstanceId.get(instanceId);
|
|
2400
|
+
if (prevSelection) {
|
|
2401
|
+
const normalizedSelection = normalizeInputSelection(meta.value, prevSelection.start, prevSelection.end);
|
|
2402
|
+
if (normalizedSelection)
|
|
2403
|
+
this.inputSelectionByInstanceId.set(instanceId, normalizedSelection);
|
|
2404
|
+
else
|
|
2405
|
+
this.inputSelectionByInstanceId.delete(instanceId);
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
if ((doCommit || doLayout) && this.pressedId !== null) {
|
|
2410
|
+
if (this.enabledById.get(this.pressedId) !== true) {
|
|
2411
|
+
this.pressedId = null;
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
if (this.focusState.activeZoneId !== prevActiveZoneIdBeforeSubmit) {
|
|
2415
|
+
this.invokeFocusZoneCallbacks(prevActiveZoneIdBeforeSubmit, this.focusState.activeZoneId, prevZoneMetaByIdBeforeSubmit, this.zoneMetaById);
|
|
2416
|
+
}
|
|
2417
|
+
// Build cursor info for native cursor protocol.
|
|
2418
|
+
const cursorInfo = {
|
|
2419
|
+
cursorByInstanceId: this.inputCursorByInstanceId,
|
|
2420
|
+
shape: this.cursorShape,
|
|
2421
|
+
blink: this.cursorBlink,
|
|
2422
|
+
};
|
|
2423
|
+
if (doCommit) {
|
|
2424
|
+
kickoffCommandPaletteItemFetches(this.commandPaletteById, this.commandPaletteItemsById, this.commandPaletteLoadingById, this.commandPaletteFetchTokenById, this.commandPaletteLastQueryById, this.commandPaletteLastSourcesRefById, this.requestView);
|
|
2425
|
+
}
|
|
2426
|
+
if (doCommit || doLayout || this.positionTransitionTrackByInstanceId.size > 0) {
|
|
2427
|
+
this.refreshPositionTransitionTracks(this.committedRoot, this.layoutTree, frameNowMs);
|
|
2428
|
+
}
|
|
2429
|
+
this.rebuildAnimatedRectOverrides(this.committedRoot, this.layoutTree, frameNowMs);
|
|
2430
|
+
const completedExitNodes = this.sampleExitAnimations(frameNowMs);
|
|
2431
|
+
for (const completed of completedExitNodes) {
|
|
2432
|
+
completed.runDeferredLocalStateCleanup();
|
|
2433
|
+
this.cleanupUnmountedInstanceIds(completed.subtreeInstanceIds);
|
|
2434
|
+
}
|
|
2435
|
+
if (this.hasActivePositionTransitions || this.hasActiveExitTransitions) {
|
|
2436
|
+
this.requestRender();
|
|
2437
|
+
}
|
|
2438
|
+
const tick = this.renderTick;
|
|
2439
|
+
this.renderTick = (this.renderTick + 1) >>> 0;
|
|
2440
|
+
const focusAnnouncement = this.getFocusAnnouncement();
|
|
2441
|
+
const renderToken = perfMarkStart("render");
|
|
2442
|
+
let usedIncrementalRender = false;
|
|
2443
|
+
const captureRuntimeBreadcrumbs = this.collectRuntimeBreadcrumbs;
|
|
2444
|
+
let runtimeCursorSummary = null;
|
|
2445
|
+
let runtimeDamageMode = "none";
|
|
2446
|
+
let runtimeDamageRectCount = 0;
|
|
2447
|
+
let runtimeDamageArea = 0;
|
|
2448
|
+
const forceFullRenderThisSubmit = this.forceFullRenderOnNextSubmit;
|
|
2449
|
+
this.forceFullRenderOnNextSubmit = false;
|
|
2450
|
+
if (!forceFullRenderThisSubmit &&
|
|
2451
|
+
this.shouldAttemptIncrementalRender(doLayout, viewport, theme)) {
|
|
2452
|
+
if (!doCommit) {
|
|
2453
|
+
this.markTransientDirtyNodes(this.committedRoot, this._lastRenderedFocusedId, this.focusState.focusedId, true);
|
|
2454
|
+
}
|
|
2455
|
+
this._pooledDamageRects.length = 0;
|
|
2456
|
+
let missingDamageRect = false;
|
|
2457
|
+
if (doCommit) {
|
|
2458
|
+
if (!identityDamageFromCommit) {
|
|
2459
|
+
missingDamageRect = true;
|
|
2460
|
+
}
|
|
2461
|
+
else {
|
|
2462
|
+
for (const instanceId of identityDamageFromCommit.changedInstanceIds) {
|
|
2463
|
+
if (!this.appendDamageRectForInstanceId(instanceId)) {
|
|
2464
|
+
missingDamageRect = true;
|
|
2465
|
+
break;
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
if (!missingDamageRect) {
|
|
2469
|
+
for (const instanceId of identityDamageFromCommit.removedInstanceIds) {
|
|
2470
|
+
if (!this.appendDamageRectForInstanceId(instanceId)) {
|
|
2471
|
+
missingDamageRect = true;
|
|
2472
|
+
break;
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
else {
|
|
2479
|
+
this.collectSpinnerDamageRects(this.committedRoot, this.layoutTree);
|
|
2480
|
+
}
|
|
2481
|
+
const prevFocusedId = this._lastRenderedFocusedId;
|
|
2482
|
+
const nextFocusedId = this.focusState.focusedId;
|
|
2483
|
+
if (!missingDamageRect && prevFocusedId !== nextFocusedId) {
|
|
2484
|
+
if (prevFocusedId !== null && !this.appendDamageRectForId(prevFocusedId)) {
|
|
2485
|
+
missingDamageRect = true;
|
|
2486
|
+
}
|
|
2487
|
+
if (!missingDamageRect &&
|
|
2488
|
+
nextFocusedId !== null &&
|
|
2489
|
+
!this.appendDamageRectForId(nextFocusedId)) {
|
|
2490
|
+
missingDamageRect = true;
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
if (!missingDamageRect &&
|
|
2494
|
+
this._lastRenderedFocusAnnouncement !== focusAnnouncement &&
|
|
2495
|
+
!this.appendDamageRectsForFocusAnnouncers(this.committedRoot)) {
|
|
2496
|
+
missingDamageRect = true;
|
|
2497
|
+
}
|
|
2498
|
+
if (!missingDamageRect) {
|
|
2499
|
+
const damageRects = this.normalizeDamageRects(viewport);
|
|
2500
|
+
if (damageRects.length > 0 && !this.isDamageAreaTooLarge(viewport)) {
|
|
2501
|
+
if (captureRuntimeBreadcrumbs) {
|
|
2502
|
+
runtimeDamageMode = "incremental";
|
|
2503
|
+
runtimeDamageRectCount = damageRects.length;
|
|
2504
|
+
runtimeDamageArea = 0;
|
|
2505
|
+
for (const damageRect of damageRects) {
|
|
2506
|
+
runtimeDamageArea += damageRect.w * damageRect.h;
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
for (const damageRect of damageRects) {
|
|
2510
|
+
this.builder.fillRect(damageRect.x, damageRect.y, damageRect.w, damageRect.h, DEFAULT_BASE_STYLE);
|
|
2511
|
+
}
|
|
2512
|
+
for (const damageRect of damageRects) {
|
|
2513
|
+
this.builder.pushClip(damageRect.x, damageRect.y, damageRect.w, damageRect.h);
|
|
2514
|
+
renderTree(this.builder, this.focusState, this.layoutTree, this._pooledRectById, viewport, theme, tick, DEFAULT_BASE_STYLE, this.committedRoot, this.animatedRectByInstanceId, this.animatedOpacityByInstanceId, cursorInfo, this.virtualListStore, this.tableStore, this.treeStore, this.loadedTreeChildrenByTreeId, this.commandPaletteItemsById, this.commandPaletteLoadingById, this.toolApprovalFocusedActionById, this.dropdownSelectedIndexById, this.dropdownWindowStartById, this.diffViewerFocusedHunkById, this.diffViewerExpandedHunksById, this.tableRenderCacheById, this.logsConsoleRenderCacheById, this.diffRenderCacheById, this.codeEditorRenderCacheById, focusAnnouncement, { damageRect }, this.terminalProfile, this.pressedId);
|
|
2515
|
+
this.builder.popClip();
|
|
2516
|
+
}
|
|
2517
|
+
runtimeCursorSummary = this.emitIncrementalCursor(cursorInfo);
|
|
2518
|
+
usedIncrementalRender = true;
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
if (!usedIncrementalRender) {
|
|
2523
|
+
renderToDrawlist({
|
|
2524
|
+
tree: this.committedRoot,
|
|
2525
|
+
layout: this.layoutTree,
|
|
2526
|
+
viewport,
|
|
2527
|
+
focusState: this.focusState,
|
|
2528
|
+
pressedId: this.pressedId,
|
|
2529
|
+
builder: this.builder,
|
|
2530
|
+
tick,
|
|
2531
|
+
theme,
|
|
2532
|
+
terminalProfile: this.terminalProfile,
|
|
2533
|
+
cursorInfo,
|
|
2534
|
+
virtualListStore: this.virtualListStore,
|
|
2535
|
+
tableStore: this.tableStore,
|
|
2536
|
+
treeStore: this.treeStore,
|
|
2537
|
+
loadedTreeChildrenById: this.loadedTreeChildrenByTreeId,
|
|
2538
|
+
commandPaletteItemsById: this.commandPaletteItemsById,
|
|
2539
|
+
commandPaletteLoadingById: this.commandPaletteLoadingById,
|
|
2540
|
+
toolApprovalFocusedActionById: this.toolApprovalFocusedActionById,
|
|
2541
|
+
dropdownSelectedIndexById: this.dropdownSelectedIndexById,
|
|
2542
|
+
dropdownWindowStartById: this.dropdownWindowStartById,
|
|
2543
|
+
diffViewerFocusedHunkById: this.diffViewerFocusedHunkById,
|
|
2544
|
+
diffViewerExpandedHunksById: this.diffViewerExpandedHunksById,
|
|
2545
|
+
focusAnnouncement,
|
|
2546
|
+
layoutIndex: this._pooledRectByInstanceId,
|
|
2547
|
+
idRectIndex: this._pooledRectById,
|
|
2548
|
+
animatedRectByInstanceId: this.animatedRectByInstanceId,
|
|
2549
|
+
animatedOpacityByInstanceId: this.animatedOpacityByInstanceId,
|
|
2550
|
+
tableRenderCacheById: this.tableRenderCacheById,
|
|
2551
|
+
logsConsoleRenderCacheById: this.logsConsoleRenderCacheById,
|
|
2552
|
+
diffRenderCacheById: this.diffRenderCacheById,
|
|
2553
|
+
codeEditorRenderCacheById: this.codeEditorRenderCacheById,
|
|
2554
|
+
});
|
|
2555
|
+
if (captureRuntimeBreadcrumbs) {
|
|
2556
|
+
runtimeDamageMode = "full";
|
|
2557
|
+
runtimeDamageRectCount = viewport.cols > 0 && viewport.rows > 0 ? 1 : 0;
|
|
2558
|
+
runtimeDamageArea = viewport.cols * viewport.rows;
|
|
2559
|
+
runtimeCursorSummary = this.resolveRuntimeCursorSummary(cursorInfo);
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
if (this.exitRenderNodeByInstanceId.size > 0) {
|
|
2563
|
+
this.renderExitTransitionNodes(viewport, theme, tick, cursorInfo, focusAnnouncement);
|
|
2564
|
+
}
|
|
2565
|
+
perfMarkEnd("render", renderToken);
|
|
2566
|
+
let submittedBytes = new Uint8Array(0);
|
|
2567
|
+
let inFlight = null;
|
|
2568
|
+
const buildToken = perfMarkStart("drawlist_build");
|
|
2569
|
+
const beginFrame = this.backend[BACKEND_BEGIN_FRAME_MARKER];
|
|
2570
|
+
if (typeof beginFrame === "function") {
|
|
2571
|
+
const frameWriter = beginFrame();
|
|
2572
|
+
if (frameWriter) {
|
|
2573
|
+
const builtInto = this.builder.buildInto(frameWriter.buf);
|
|
2574
|
+
if (!builtInto.ok) {
|
|
2575
|
+
frameWriter.abort();
|
|
2576
|
+
perfMarkEnd("drawlist_build", buildToken);
|
|
2577
|
+
return {
|
|
2578
|
+
ok: false,
|
|
2579
|
+
code: "ZRUI_DRAWLIST_BUILD_ERROR",
|
|
2580
|
+
detail: `${builtInto.error.code}: ${builtInto.error.detail}`,
|
|
2581
|
+
};
|
|
2582
|
+
}
|
|
2583
|
+
submittedBytes = builtInto.bytes;
|
|
2584
|
+
inFlight = frameWriter.commit(submittedBytes.byteLength);
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
if (!inFlight) {
|
|
2588
|
+
const built = this.builder.build();
|
|
2589
|
+
if (!built.ok) {
|
|
2590
|
+
perfMarkEnd("drawlist_build", buildToken);
|
|
2591
|
+
return {
|
|
2592
|
+
ok: false,
|
|
2593
|
+
code: "ZRUI_DRAWLIST_BUILD_ERROR",
|
|
2594
|
+
detail: `${built.error.code}: ${built.error.detail}`,
|
|
2595
|
+
};
|
|
2596
|
+
}
|
|
2597
|
+
submittedBytes = built.bytes;
|
|
2598
|
+
}
|
|
2599
|
+
perfMarkEnd("drawlist_build", buildToken);
|
|
2600
|
+
this.clearRuntimeDirtyNodes(this.committedRoot);
|
|
2601
|
+
if (captureRuntimeBreadcrumbs) {
|
|
2602
|
+
this._constraintBreadcrumbs = this.computeConstraintBreadcrumbs();
|
|
2603
|
+
this.updateRuntimeBreadcrumbSnapshot({
|
|
2604
|
+
tick,
|
|
2605
|
+
commit: doCommit,
|
|
2606
|
+
layout: doLayout,
|
|
2607
|
+
incremental: usedIncrementalRender,
|
|
2608
|
+
damageMode: runtimeDamageMode,
|
|
2609
|
+
damageRectCount: runtimeDamageRectCount,
|
|
2610
|
+
damageArea: runtimeDamageArea,
|
|
2611
|
+
cursor: runtimeCursorSummary,
|
|
2612
|
+
});
|
|
2613
|
+
}
|
|
2614
|
+
this.snapshotRenderedFrameState(this.committedRoot, viewport, theme, doLayout, focusAnnouncement);
|
|
2615
|
+
// Render hooks are for preventing re-entrant app API calls during user render.
|
|
2616
|
+
hooks.exitRender();
|
|
2617
|
+
entered = false;
|
|
2618
|
+
// Run composite effects after a successful commit+render build.
|
|
2619
|
+
if (commitRes) {
|
|
2620
|
+
const effectsToken = PERF_DETAIL_ENABLED ? perfMarkStart("effects") : 0;
|
|
2621
|
+
try {
|
|
2622
|
+
runPendingCleanups(commitRes.pendingCleanups);
|
|
2623
|
+
runPendingEffects(commitRes.pendingEffects);
|
|
2624
|
+
}
|
|
2625
|
+
catch (e) {
|
|
2626
|
+
return { ok: false, code: "ZRUI_USER_CODE_THROW", detail: describeThrown(e) };
|
|
2627
|
+
}
|
|
2628
|
+
finally {
|
|
2629
|
+
if (PERF_DETAIL_ENABLED)
|
|
2630
|
+
perfMarkEnd("effects", effectsToken);
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
try {
|
|
2634
|
+
const backendToken = PERF_ENABLED ? perfMarkStart("backend_request") : 0;
|
|
2635
|
+
try {
|
|
2636
|
+
const fingerprint = FRAME_AUDIT_ENABLED ? drawlistFingerprint(submittedBytes) : null;
|
|
2637
|
+
if (fingerprint !== null) {
|
|
2638
|
+
emitFrameAudit("widgetRenderer", "drawlist.built", {
|
|
2639
|
+
tick,
|
|
2640
|
+
commit: doCommit,
|
|
2641
|
+
layout: doLayout,
|
|
2642
|
+
incremental: usedIncrementalRender,
|
|
2643
|
+
damageMode: runtimeDamageMode,
|
|
2644
|
+
damageRectCount: runtimeDamageRectCount,
|
|
2645
|
+
damageArea: runtimeDamageArea,
|
|
2646
|
+
...fingerprint,
|
|
2647
|
+
});
|
|
2648
|
+
if (FRAME_AUDIT_TREE_ENABLED) {
|
|
2649
|
+
emitFrameAudit("widgetRenderer", "runtime.tree.summary", Object.freeze({
|
|
2650
|
+
tick,
|
|
2651
|
+
...summarizeRuntimeTreeForAudit(this.committedRoot, this.layoutTree),
|
|
2652
|
+
}));
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
if (!inFlight) {
|
|
2656
|
+
inFlight = this.backend.requestFrame(submittedBytes);
|
|
2657
|
+
}
|
|
2658
|
+
const inflightPromise = inFlight;
|
|
2659
|
+
if (fingerprint !== null) {
|
|
2660
|
+
emitFrameAudit("widgetRenderer", "backend.request", {
|
|
2661
|
+
tick,
|
|
2662
|
+
hash32: fingerprint.hash32,
|
|
2663
|
+
prefixHash32: fingerprint.prefixHash32,
|
|
2664
|
+
byteLen: fingerprint.byteLen,
|
|
2665
|
+
});
|
|
2666
|
+
const acceptedAck = inflightPromise[FRAME_ACCEPTED_ACK_MARKER];
|
|
2667
|
+
if (acceptedAck !== undefined) {
|
|
2668
|
+
void acceptedAck.then(() => emitFrameAudit("widgetRenderer", "backend.accepted", {
|
|
2669
|
+
tick,
|
|
2670
|
+
hash32: fingerprint.hash32,
|
|
2671
|
+
}), (err) => emitFrameAudit("widgetRenderer", "backend.accepted_error", {
|
|
2672
|
+
tick,
|
|
2673
|
+
hash32: fingerprint.hash32,
|
|
2674
|
+
detail: describeThrown(err),
|
|
2675
|
+
}));
|
|
2676
|
+
}
|
|
2677
|
+
void inflightPromise.then(() => emitFrameAudit("widgetRenderer", "backend.completed", {
|
|
2678
|
+
tick,
|
|
2679
|
+
hash32: fingerprint.hash32,
|
|
2680
|
+
}), (err) => emitFrameAudit("widgetRenderer", "backend.completed_error", {
|
|
2681
|
+
tick,
|
|
2682
|
+
hash32: fingerprint.hash32,
|
|
2683
|
+
detail: describeThrown(err),
|
|
2684
|
+
}));
|
|
2685
|
+
}
|
|
2686
|
+
return { ok: true, inFlight: inflightPromise };
|
|
2687
|
+
}
|
|
2688
|
+
finally {
|
|
2689
|
+
if (PERF_ENABLED)
|
|
2690
|
+
perfMarkEnd("backend_request", backendToken);
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
catch (e) {
|
|
2694
|
+
return { ok: false, code: "ZRUI_BACKEND_ERROR", detail: describeThrown(e) };
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
catch (e) {
|
|
2698
|
+
return { ok: false, code: "ZRUI_USER_CODE_THROW", detail: describeThrown(e) };
|
|
2699
|
+
}
|
|
2700
|
+
finally {
|
|
2701
|
+
if (entered)
|
|
2702
|
+
hooks.exitRender();
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
//# sourceMappingURL=widgetRenderer.js.map
|