nudge-ui 0.2.5 → 0.2.6
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/dist/cli/agentCommand.d.ts +0 -1
- package/dist/cli/agentCommand.js +0 -1
- package/dist/client.mjs +238 -122
- package/dist/compiler/ast.d.ts +0 -6
- package/dist/compiler/ast.js +0 -5
- package/dist/compiler/componentContractTypes.d.ts +11 -5
- package/dist/compiler/componentContracts.js +3 -9
- package/dist/compiler/componentInstrumentation.d.ts +2 -13
- package/dist/compiler/componentInstrumentation.js +3 -12
- package/dist/compiler/componentPolicyResolution.d.ts +3 -22
- package/dist/compiler/componentPolicyResolution.js +6 -38
- package/dist/compiler/identityAttributes.d.ts +2 -0
- package/dist/compiler/identityAttributes.js +2 -0
- package/dist/compiler/index.d.ts +0 -1
- package/dist/compiler/index.js +0 -1
- package/dist/compiler/packageComponentContracts.d.ts +10 -19
- package/dist/compiler/packageComponentContracts.js +60 -43
- package/dist/compiler/reactComponentProtocols.d.ts +0 -7
- package/dist/compiler/reactComponentProtocols.js +0 -7
- package/dist/compiler/reactIdentity.d.ts +2 -2
- package/dist/compiler/reactIdentity.js +41 -43
- package/dist/compiler/sourcePaths.d.ts +4 -8
- package/dist/compiler/sourcePaths.js +6 -8
- package/dist/css/dialects/index.d.ts +2 -21
- package/dist/css/dialects/index.js +2 -9
- package/dist/css/dialects/tailwind.d.ts +2 -16
- package/dist/css/dialects/tailwind.js +2 -25
- package/dist/css/dialects/vanillaExtract.d.ts +1 -9
- package/dist/css/dialects/vanillaExtract.js +0 -1
- package/dist/css/index.d.ts +0 -8
- package/dist/css/index.js +0 -8
- package/dist/css/model/index.d.ts +6 -38
- package/dist/css/model/index.js +0 -9
- package/dist/css/token-inventory/index.d.ts +0 -23
- package/dist/css/token-inventory/index.js +0 -23
- package/dist/css/token-inventory/inventory.js +4 -16
- package/dist/css/token-inventory/parseStylesheet.d.ts +1 -9
- package/dist/css/token-inventory/parseStylesheet.js +5 -42
- package/dist/css/token-inventory/policy.d.ts +2 -39
- package/dist/css/token-inventory/policy.js +2 -39
- package/dist/css/token-inventory/types.d.ts +2 -15
- package/dist/css/value-semantics/borderSemantics.d.ts +1 -8
- package/dist/css/value-semantics/borderSemantics.js +5 -23
- package/dist/css/value-semantics/boxSemantics.d.ts +2 -25
- package/dist/css/value-semantics/boxSemantics.js +1 -7
- package/dist/css/value-semantics/colorSemantics.d.ts +6 -60
- package/dist/css/value-semantics/colorSemantics.js +9 -40
- package/dist/css/value-semantics/cssSyntax.d.ts +10 -10
- package/dist/css/value-semantics/cssSyntax.js +39 -11
- package/dist/css/value-semantics/fontSemantics.d.ts +3 -19
- package/dist/css/value-semantics/fontSemantics.js +7 -25
- package/dist/css/value-semantics/index.d.ts +1 -12
- package/dist/css/value-semantics/index.js +1 -12
- package/dist/css/value-semantics/propertyPolicy.d.ts +6 -53
- package/dist/css/value-semantics/propertyPolicy.js +47 -59
- package/dist/css/value-semantics/stringMaps.d.ts +0 -1
- package/dist/css/value-semantics/structuredValues.d.ts +3 -37
- package/dist/css/value-semantics/structuredValues.js +6 -17
- package/dist/css/value-semantics/tokenInterpretation.d.ts +8 -50
- package/dist/css/value-semantics/tokenInterpretation.js +7 -21
- package/dist/hosts/astro/astroRuntimeConfig.d.ts +0 -1
- package/dist/hosts/astro/astroRuntimeConfig.js +0 -1
- package/dist/hosts/astro/clientAsset.d.ts +1 -5
- package/dist/hosts/astro/clientAsset.js +1 -5
- package/dist/hosts/astro/clientTransport.d.ts +0 -1
- package/dist/hosts/astro/clientTransport.js +4 -9
- package/dist/hosts/astro/integration.d.ts +2 -28
- package/dist/hosts/astro/integration.js +7 -36
- package/dist/hosts/astro/markdownIdentity.d.ts +0 -3
- package/dist/hosts/astro/markdownIdentity.js +0 -3
- package/dist/hosts/astro/middleware.d.ts +1 -12
- package/dist/hosts/astro/middleware.js +1 -12
- package/dist/hosts/astro/projectContext.d.ts +1 -9
- package/dist/hosts/astro/projectContext.js +2 -11
- package/dist/hosts/astro/responseInstrumentation.d.ts +4 -33
- package/dist/hosts/astro/responseInstrumentation.js +5 -34
- package/dist/hosts/environment.d.ts +0 -8
- package/dist/hosts/environment.js +0 -1
- package/dist/hosts/next/index.js +1 -3
- package/dist/hosts/next/loader.d.ts +5 -44
- package/dist/hosts/next/loader.js +22 -103
- package/dist/hosts/next/loaders/identity-loader.cjs +111 -65
- package/dist/hosts/next/loaders/loader-plugin.cjs +111 -65
- package/dist/hosts/next/manifest.d.ts +2 -16
- package/dist/hosts/next/manifest.js +18 -20
- package/dist/hosts/next/mount.d.ts +1 -11
- package/dist/hosts/next/mount.js +1 -11
- package/dist/hosts/next/repositoryScope.d.ts +2 -17
- package/dist/hosts/next/repositoryScope.js +2 -17
- package/dist/hosts/next/sidecar.d.ts +0 -13
- package/dist/hosts/next/sidecar.js +25 -110
- package/dist/hosts/next/wrapper.d.ts +0 -31
- package/dist/hosts/next/wrapper.js +13 -64
- package/dist/hosts/projectBridge.d.ts +0 -2
- package/dist/hosts/projectBridge.js +0 -2
- package/dist/hosts/reactRendererCapture.d.ts +2 -0
- package/dist/hosts/reactRendererCapture.js +12 -0
- package/dist/hosts/static/cli.d.ts +0 -4
- package/dist/hosts/static/cli.js +0 -3
- package/dist/hosts/static/html/bootstrap.d.ts +1 -18
- package/dist/hosts/static/html/bootstrap.js +2 -14
- package/dist/hosts/static/manifest.d.ts +2 -15
- package/dist/hosts/static/manifest.js +5 -18
- package/dist/hosts/static/server.d.ts +4 -38
- package/dist/hosts/static/server.js +17 -67
- package/dist/hosts/vite/index.d.ts +0 -10
- package/dist/hosts/vite/index.js +0 -10
- package/dist/hosts/vite/react.d.ts +4 -17
- package/dist/hosts/vite/react.js +18 -35
- package/dist/hosts/vite/tokens/activeStylesheets.d.ts +1 -10
- package/dist/hosts/vite/tokens/activeStylesheets.js +3 -8
- package/dist/hosts/vite/tokens/fileMap.d.ts +0 -1
- package/dist/hosts/vite/tokens/viteStylesheetArtifacts.d.ts +2 -15
- package/dist/hosts/vite/tokens/viteStylesheetArtifacts.js +3 -10
- package/dist/hosts/vite/vite.d.ts +5 -26
- package/dist/hosts/vite/vite.js +44 -80
- package/dist/html/dom.d.ts +0 -1
- package/dist/html/dom.js +0 -1
- package/dist/html/identity.d.ts +1 -15
- package/dist/html/identity.js +1 -8
- package/dist/html/insertions.d.ts +2 -8
- package/dist/html/insertions.js +1 -1
- package/dist/inspector/agent/McpConnectionDialog.d.ts +1 -6
- package/dist/inspector/agent/McpConnectionDialog.js +1 -6
- package/dist/inspector/agent/activity.d.ts +1 -1
- package/dist/inspector/agent/activity.js +1 -1
- package/dist/inspector/agent/client.d.ts +2 -26
- package/dist/inspector/agent/client.js +17 -64
- package/dist/inspector/agent/connectionStatus.d.ts +0 -1
- package/dist/inspector/agent/connectionStatus.js +0 -1
- package/dist/inspector/agent/httpTransport.d.ts +0 -8
- package/dist/inspector/agent/httpTransport.js +21 -39
- package/dist/inspector/agent/protocol.d.ts +1 -10
- package/dist/inspector/agent/protocol.js +1 -9
- package/dist/inspector/agent/verification.d.ts +2 -19
- package/dist/inspector/agent/verification.js +7 -43
- package/dist/inspector/boot.d.ts +3 -1
- package/dist/inspector/boot.js +12 -20
- package/dist/inspector/canvas/AgentActivityOverlay.d.ts +1 -1
- package/dist/inspector/canvas/AgentActivityOverlay.js +1 -1
- package/dist/inspector/canvas/CanvasCard.js +7 -14
- package/dist/inspector/canvas/CanvasElementOverlay.js +117 -50
- package/dist/inspector/canvas/CanvasWorkspace.js +15 -29
- package/dist/inspector/canvas/PageCard.d.ts +0 -1
- package/dist/inspector/canvas/PageCard.js +0 -1
- package/dist/inspector/canvas/SketchToolOptions.d.ts +0 -1
- package/dist/inspector/canvas/SketchToolOptions.js +0 -6
- package/dist/inspector/canvas/ToolOptionsDrawer.d.ts +1 -6
- package/dist/inspector/canvas/ToolOptionsDrawer.js +2 -8
- package/dist/inspector/canvas/activeCanvasDocument.d.ts +0 -2
- package/dist/inspector/canvas/activeCanvasDocument.js +0 -2
- package/dist/inspector/canvas/agentPresentation.d.ts +2 -13
- package/dist/inspector/canvas/agentPresentation.js +3 -14
- package/dist/inspector/canvas/canvasFrame.d.ts +2 -6
- package/dist/inspector/canvas/canvasFrame.js +1 -2
- package/dist/inspector/canvas/canvasResize.d.ts +1 -6
- package/dist/inspector/canvas/canvasResize.js +1 -6
- package/dist/inspector/canvas/canvasStore.d.ts +4 -12
- package/dist/inspector/canvas/canvasStore.js +12 -26
- package/dist/inspector/canvas/frameConnection.d.ts +1 -7
- package/dist/inspector/canvas/frameContent.d.ts +0 -1
- package/dist/inspector/canvas/frameLifecycle.d.ts +12 -0
- package/dist/inspector/canvas/frameLifecycle.js +11 -0
- package/dist/inspector/canvas/frameProtocol.d.ts +5 -40
- package/dist/inspector/canvas/frameProtocol.js +1 -24
- package/dist/inspector/canvas/frameScrollbarStyles.d.ts +0 -1
- package/dist/inspector/canvas/frameScrollbarStyles.js +0 -1
- package/dist/inspector/canvas/layout.d.ts +10 -22
- package/dist/inspector/canvas/layout.js +0 -3
- package/dist/inspector/canvas/normalizeUrl.js +1 -8
- package/dist/inspector/canvas/pageSurface.d.ts +1 -6
- package/dist/inspector/canvas/pageSurface.js +1 -6
- package/dist/inspector/canvas/projection.d.ts +4 -25
- package/dist/inspector/canvas/projection.js +22 -72
- package/dist/inspector/canvas/rendererBootstrap.d.ts +8 -1
- package/dist/inspector/canvas/rendererBootstrap.js +6 -14
- package/dist/inspector/canvas/rendererCidIndex.d.ts +0 -5
- package/dist/inspector/canvas/rendererCidIndex.js +0 -5
- package/dist/inspector/canvas/rendererElementSelector.js +29 -27
- package/dist/inspector/canvas/rendererMessageRouter.d.ts +0 -1
- package/dist/inspector/canvas/rendererMessageRouter.js +0 -1
- package/dist/inspector/canvas/rendererSelectionProxy.d.ts +1 -5
- package/dist/inspector/canvas/rendererSelectionProxy.js +2 -7
- package/dist/inspector/canvas/rendererStylesheet.d.ts +0 -1
- package/dist/inspector/canvas/rendererStylesheet.js +9 -2
- package/dist/inspector/canvas/resizeHandleScale.d.ts +1 -10
- package/dist/inspector/canvas/resizeHandleScale.js +1 -10
- package/dist/inspector/canvas/sessionStore.d.ts +1 -7
- package/dist/inspector/canvas/sessionStore.js +21 -34
- package/dist/inspector/canvas/staleChangeDetector.js +1 -4
- package/dist/inspector/canvas/toolbarScale.d.ts +1 -4
- package/dist/inspector/canvas/toolbarScale.js +1 -4
- package/dist/inspector/canvas/useCanvasLayoutAnimation.d.ts +0 -1
- package/dist/inspector/canvas/useCanvasLayoutAnimation.js +0 -1
- package/dist/inspector/canvas/viewStore.js +1 -1
- package/dist/inspector/canvas/wheelPan.d.ts +1 -1
- package/dist/inspector/canvas/wheelPan.js +1 -1
- package/dist/inspector/canvas/workspaceLease.d.ts +1 -5
- package/dist/inspector/canvas/workspaceLease.js +1 -7
- package/dist/inspector/changes/codecs.js +2 -1
- package/dist/inspector/changes/draftPreview.d.ts +1 -6
- package/dist/inspector/changes/draftPreview.js +15 -30
- package/dist/inspector/changes/editModel.d.ts +3 -13
- package/dist/inspector/changes/editModel.js +1 -2
- package/dist/inspector/changes/managedStyleProjection.js +4 -14
- package/dist/inspector/changes/model.d.ts +0 -5
- package/dist/inspector/changes/model.js +1 -8
- package/dist/inspector/changes/previewDiagnostics.d.ts +2 -12
- package/dist/inspector/changes/previewDiagnostics.js +4 -20
- package/dist/inspector/changes/previewVerification.d.ts +25 -0
- package/dist/inspector/changes/previewVerification.js +34 -0
- package/dist/inspector/changes/structuralTypes.d.ts +2 -4
- package/dist/inspector/changes/types.d.ts +3 -10
- package/dist/inspector/clientManifest.d.ts +17 -6
- package/dist/inspector/clientManifest.js +16 -3
- package/dist/inspector/comments/CommentsOverlay.js +48 -7
- package/dist/inspector/comments/element.d.ts +1 -2
- package/dist/inspector/comments/element.js +1 -2
- package/dist/inspector/comments/store.d.ts +1 -1
- package/dist/inspector/comments/store.js +1 -1
- package/dist/inspector/comments/verification.d.ts +8 -2
- package/dist/inspector/comments/verification.js +18 -10
- package/dist/inspector/componentSemantics/ComponentPropsSection.d.ts +8 -0
- package/dist/inspector/componentSemantics/ComponentPropsSection.js +10 -7
- package/dist/inspector/componentSemantics/adapterRegistry.d.ts +2 -9
- package/dist/inspector/componentSemantics/adapterRegistry.js +2 -9
- package/dist/inspector/componentSemantics/changeModel.js +2 -4
- package/dist/inspector/componentSemantics/react/callsites.d.ts +28 -0
- package/dist/inspector/componentSemantics/react/callsites.js +261 -0
- package/dist/inspector/componentSemantics/react/devtoolsHook.d.ts +23 -0
- package/dist/inspector/componentSemantics/react/devtoolsHook.js +71 -0
- package/dist/inspector/componentSemantics/react/fibers.d.ts +17 -0
- package/dist/inspector/componentSemantics/react/fibers.js +30 -0
- package/dist/inspector/componentSemantics/{reactRuntime.d.ts → react/runtime.d.ts} +3 -2
- package/dist/inspector/componentSemantics/{reactRuntime.js → react/runtime.js} +70 -53
- package/dist/inspector/componentSemantics/runtimeBridge.d.ts +2 -18
- package/dist/inspector/componentSemantics/runtimeBridge.js +5 -19
- package/dist/inspector/componentSemantics/textBinding.d.ts +1 -9
- package/dist/inspector/componentSemantics/textBinding.js +16 -42
- package/dist/inspector/componentSemantics/types.d.ts +8 -27
- package/dist/inspector/componentSemantics/types.js +0 -1
- package/dist/inspector/conformance/borderCases.d.ts +0 -5
- package/dist/inspector/conformance/borderCases.js +0 -5
- package/dist/inspector/conformance/colorCases.d.ts +0 -6
- package/dist/inspector/conformance/colorCases.js +0 -6
- package/dist/inspector/conformance/fixture.d.ts +1 -5
- package/dist/inspector/conformance/fixture.js +1 -5
- package/dist/inspector/conformance/spacingCases.d.ts +0 -4
- package/dist/inspector/conformance/spacingCases.js +0 -4
- package/dist/inspector/conformance/typographyCases.d.ts +0 -5
- package/dist/inspector/conformance/typographyCases.js +0 -5
- package/dist/inspector/drafts/draftStore.d.ts +7 -21
- package/dist/inspector/drafts/draftStore.js +15 -5
- package/dist/inspector/drafts/model.d.ts +7 -15
- package/dist/inspector/drafts/model.js +0 -2
- package/dist/inspector/drafts/store.d.ts +1 -8
- package/dist/inspector/drafts/store.js +3 -10
- package/dist/inspector/editScope.d.ts +0 -1
- package/dist/inspector/editScope.js +0 -1
- package/dist/inspector/inline-text/inlineTextDiagnostics.d.ts +0 -2
- package/dist/inspector/inline-text/inlineTextDiagnostics.js +0 -2
- package/dist/inspector/inline-text/inlineTextEditor.d.ts +2 -8
- package/dist/inspector/inline-text/inlineTextEditor.js +26 -79
- package/dist/inspector/inline-text/inlineTextLifecycle.js +1 -6
- package/dist/inspector/inline-text/textEditChange.d.ts +0 -1
- package/dist/inspector/inspection/bridge.d.ts +2 -6
- package/dist/inspector/inspection/bridge.js +4 -12
- package/dist/inspector/inspection/browserCssInspection.d.ts +4 -11
- package/dist/inspector/inspection/browserCssInspection.js +4 -8
- package/dist/inspector/inspection/browserCssInspectionRegistry.d.ts +0 -7
- package/dist/inspector/inspection/browserCssInspectionRegistry.js +1 -16
- package/dist/inspector/inspection/selectionProperty.d.ts +1 -6
- package/dist/inspector/inspection/selectionProperty.js +1 -5
- package/dist/inspector/inspection/useBrowserCssInspection.d.ts +1 -5
- package/dist/inspector/inspection/useBrowserCssInspection.js +5 -21
- package/dist/inspector/iterations/capture.d.ts +0 -1
- package/dist/inspector/iterations/capture.js +4 -9
- package/dist/inspector/iterations/client.d.ts +0 -1
- package/dist/inspector/iterations/client.js +0 -1
- package/dist/inspector/iterations/coordinator.d.ts +0 -1
- package/dist/inspector/iterations/coordinator.js +0 -1
- package/dist/inspector/iterations/prompt.d.ts +0 -1
- package/dist/inspector/iterations/prompt.js +0 -1
- package/dist/inspector/overlay/DomNavigator.d.ts +3 -1
- package/dist/inspector/overlay/DomNavigator.js +39 -15
- package/dist/inspector/overlay/DropGuideOverlay.d.ts +0 -1
- package/dist/inspector/overlay/DropGuideOverlay.js +0 -1
- package/dist/inspector/overlay/MeasurementGuideOverlay.d.ts +1 -8
- package/dist/inspector/overlay/MeasurementGuideOverlay.js +1 -5
- package/dist/inspector/overlay/clickPolicy.d.ts +3 -14
- package/dist/inspector/overlay/clickPolicy.js +3 -14
- package/dist/inspector/overlay/dropGuide.d.ts +0 -3
- package/dist/inspector/overlay/dropGuide.js +0 -3
- package/dist/inspector/overlay/frameThrottle.d.ts +0 -1
- package/dist/inspector/overlay/frameThrottle.js +0 -1
- package/dist/inspector/overlay/interactionStyles.d.ts +1 -1
- package/dist/inspector/overlay/interactionStyles.js +2 -8
- package/dist/inspector/overlay/measurementGeometry.js +4 -12
- package/dist/inspector/overlay/selectedGeometry.d.ts +1 -6
- package/dist/inspector/overlay/selectedGeometry.js +1 -8
- package/dist/inspector/overlay/spacingGestures.d.ts +14 -21
- package/dist/inspector/overlay/spacingGestures.js +151 -31
- package/dist/inspector/overlay/structuralGestures.d.ts +2 -9
- package/dist/inspector/overlay/structuralGestures.js +1 -4
- package/dist/inspector/pageInspector.d.ts +4 -13
- package/dist/inspector/pageInspector.js +25 -32
- package/dist/inspector/projection/cssEscapes.d.ts +0 -1
- package/dist/inspector/projection/cssEscapes.js +2 -4
- package/dist/inspector/projection/draftProjection.d.ts +2 -14
- package/dist/inspector/projection/draftProjection.js +1 -8
- package/dist/inspector/projection/managedStylesheet.d.ts +1 -7
- package/dist/inspector/projection/managedStylesheet.js +4 -22
- package/dist/inspector/projection/renderedInstance.d.ts +5 -28
- package/dist/inspector/projection/renderedInstance.js +6 -32
- package/dist/inspector/projection/structuralProjection.d.ts +7 -39
- package/dist/inspector/projection/structuralProjection.js +17 -52
- package/dist/inspector/projection/textProjection.d.ts +2 -14
- package/dist/inspector/projection/textProjection.js +17 -70
- package/dist/inspector/prompt/PromptSettingsDialog.d.ts +0 -1
- package/dist/inspector/prompt/PromptSettingsDialog.js +0 -1
- package/dist/inspector/prompt/clipboardHandoff.d.ts +1 -9
- package/dist/inspector/prompt/clipboardHandoff.js +1 -9
- package/dist/inspector/prompt/generatePrompt.d.ts +1 -1
- package/dist/inspector/prompt/generatePrompt.js +10 -25
- package/dist/inspector/prompt/promptSettings.d.ts +0 -3
- package/dist/inspector/prompt/promptSettings.js +0 -3
- package/dist/inspector/runtime/devFlag.d.ts +2 -25
- package/dist/inspector/runtime/devFlag.js +4 -31
- package/dist/inspector/runtime/documentStylesheetOrder.d.ts +0 -2
- package/dist/inspector/runtime/editorShell.d.ts +0 -1
- package/dist/inspector/runtime/editorShell.js +0 -1
- package/dist/inspector/runtime/inspectorStorage.d.ts +1 -7
- package/dist/inspector/runtime/inspectorStorage.js +1 -6
- package/dist/inspector/runtime/ownedStylesheets.d.ts +2 -8
- package/dist/inspector/runtime/ownedStylesheets.js +2 -8
- package/dist/inspector/runtime/runtimeConfig.d.ts +12 -86
- package/dist/inspector/runtime/runtimeConfig.js +9 -50
- package/dist/inspector/runtime/runtimeIdentityClaims.d.ts +3 -13
- package/dist/inspector/runtime/runtimeIdentityClaims.js +9 -19
- package/dist/inspector/runtime/staticHtmlRuntimeIdentity.d.ts +4 -36
- package/dist/inspector/runtime/staticHtmlRuntimeIdentity.js +7 -40
- package/dist/inspector/runtime/useRuntimeConfig.d.ts +1 -8
- package/dist/inspector/runtime/useRuntimeConfig.js +1 -8
- package/dist/inspector/selection/editScope.d.ts +1 -7
- package/dist/inspector/selection/editScope.js +2 -12
- package/dist/inspector/selection/editTarget.d.ts +1 -5
- package/dist/inspector/selection/hierarchy.d.ts +11 -11
- package/dist/inspector/selection/hierarchy.js +42 -24
- package/dist/inspector/selection/selectionStore.d.ts +0 -3
- package/dist/inspector/selection/selectionStore.js +5 -16
- package/dist/inspector/selection/sourceSite.d.ts +1 -5
- package/dist/inspector/selection/sourceSite.js +2 -8
- package/dist/inspector/selection/styleSelection.d.ts +1 -5
- package/dist/inspector/selection/styleSelection.js +1 -5
- package/dist/inspector/session/lifecycle.d.ts +1 -9
- package/dist/inspector/session/lifecycle.js +0 -1
- package/dist/inspector/session/sessionContext.d.ts +0 -4
- package/dist/inspector/session/sessionContext.js +0 -4
- package/dist/inspector/session/sessionFactory.d.ts +0 -9
- package/dist/inspector/session/sessionFactory.js +0 -6
- package/dist/inspector/settings/SettingsDialog.d.ts +0 -1
- package/dist/inspector/settings/SettingsDialog.js +5 -3
- package/dist/inspector/shell/AgentStatusButton.d.ts +3 -2
- package/dist/inspector/shell/AgentStatusButton.js +5 -5
- package/dist/inspector/shell/ChangesLog.js +3 -4
- package/dist/inspector/shell/CopyPromptButton.d.ts +2 -1
- package/dist/inspector/shell/CopyPromptButton.js +12 -11
- package/dist/inspector/shell/InspectorEditors.d.ts +16 -0
- package/dist/inspector/shell/InspectorEditors.js +14 -0
- package/dist/inspector/shell/InspectorPanel.d.ts +12 -0
- package/dist/inspector/shell/InspectorPanel.js +8 -0
- package/dist/inspector/shell/InspectorSelection.d.ts +24 -0
- package/dist/inspector/shell/InspectorSelection.js +20 -0
- package/dist/inspector/shell/InspectorShell.js +26 -48
- package/dist/inspector/shell/NudgeLogoIcon.d.ts +5 -0
- package/dist/inspector/shell/NudgeLogoIcon.js +5 -0
- package/dist/inspector/shell/PeekOriginalButton.d.ts +0 -5
- package/dist/inspector/shell/PeekOriginalButton.js +0 -5
- package/dist/inspector/shell/PeekOriginalIcon.d.ts +0 -5
- package/dist/inspector/shell/PeekOriginalIcon.js +0 -5
- package/dist/inspector/shell/PromptActionButton.d.ts +21 -0
- package/dist/inspector/shell/PromptActionButton.js +14 -0
- package/dist/inspector/shell/elementName.d.ts +5 -0
- package/dist/inspector/shell/elementName.js +29 -0
- package/dist/inspector/shell/interactionStatePreview.d.ts +1 -4
- package/dist/inspector/shell/interactionStatePreview.js +3 -8
- package/dist/inspector/shell/originalPreview.d.ts +1 -6
- package/dist/inspector/shell/originalPreview.js +1 -6
- package/dist/inspector/shell/stateValue.d.ts +1 -2
- package/dist/inspector/shell/stateValue.js +2 -5
- package/dist/inspector/shell/styleState.d.ts +1 -2
- package/dist/inspector/shell/styleState.js +1 -2
- package/dist/inspector/sketch/SketchEditor.js +0 -1
- package/dist/inspector/sketch/SketchFrameOverlay.js +8 -12
- package/dist/inspector/sketch/SketchOverlay.js +5 -6
- package/dist/inspector/sketch/SketchPromptPanel.d.ts +0 -1
- package/dist/inspector/sketch/SketchPromptPanel.js +0 -1
- package/dist/inspector/sketch/SketchWorkspace.js +2 -4
- package/dist/inspector/sketch/capture.d.ts +12 -3
- package/dist/inspector/sketch/capture.js +12 -11
- package/dist/inspector/sketch/copySketch.d.ts +1 -7
- package/dist/inspector/sketch/copySketch.js +2 -11
- package/dist/inspector/sketch/drawingTools.d.ts +1 -3
- package/dist/inspector/sketch/drawingTools.js +1 -2
- package/dist/inspector/sketch/frameHeading.d.ts +1 -7
- package/dist/inspector/sketch/frameHeading.js +1 -8
- package/dist/inspector/sketch/freehand.d.ts +0 -1
- package/dist/inspector/sketch/freehand.js +0 -1
- package/dist/inspector/sketch/geometry.d.ts +1 -6
- package/dist/inspector/sketch/geometry.js +1 -6
- package/dist/inspector/sketch/handoff.js +0 -1
- package/dist/inspector/sketch/history.d.ts +1 -5
- package/dist/inspector/sketch/history.js +1 -4
- package/dist/inspector/sketch/interaction.d.ts +2 -2
- package/dist/inspector/sketch/interaction.js +2 -2
- package/dist/inspector/sketch/model.d.ts +2 -9
- package/dist/inspector/sketch/model.js +2 -19
- package/dist/inspector/sketch/persistence.d.ts +0 -1
- package/dist/inspector/sketch/persistence.js +2 -2
- package/dist/inspector/sketch/raster.d.ts +1 -4
- package/dist/inspector/sketch/raster.js +2 -8
- package/dist/inspector/sketch/store.js +2 -3
- package/dist/inspector/sketch/videoFrames.js +2 -3
- package/dist/inspector/spacing/projection.d.ts +0 -8
- package/dist/inspector/spacing/projection.js +38 -20
- package/dist/inspector/styleEditors/BackgroundEditor.js +1 -1
- package/dist/inspector/styleEditors/BorderEditor.js +1 -6
- package/dist/inspector/styleEditors/ChildPlacement.d.ts +12 -0
- package/dist/inspector/styleEditors/ChildPlacement.js +9 -0
- package/dist/inspector/styleEditors/FlexControls.d.ts +35 -0
- package/dist/inspector/styleEditors/FlexControls.js +158 -0
- package/dist/inspector/styleEditors/GapField.d.ts +5 -2
- package/dist/inspector/styleEditors/GapField.js +3 -4
- package/dist/inspector/styleEditors/GridChildSection.d.ts +0 -5
- package/dist/inspector/styleEditors/GridChildSection.js +0 -5
- package/dist/inspector/styleEditors/GridPicker.d.ts +1 -1
- package/dist/inspector/styleEditors/GridPicker.js +2 -4
- package/dist/inspector/styleEditors/GridSection.d.ts +10 -8
- package/dist/inspector/styleEditors/GridSection.js +22 -9
- package/dist/inspector/styleEditors/GridValueField.d.ts +1 -5
- package/dist/inspector/styleEditors/GridValueField.js +2 -8
- package/dist/inspector/styleEditors/ImageBackgroundEditor.d.ts +0 -1
- package/dist/inspector/styleEditors/ImageBackgroundEditor.js +0 -1
- package/dist/inspector/styleEditors/LayoutBlockedIndicator.d.ts +0 -1
- package/dist/inspector/styleEditors/LayoutBlockedIndicator.js +0 -1
- package/dist/inspector/styleEditors/LayoutComboField.js +0 -5
- package/dist/inspector/styleEditors/LayoutModeRow.d.ts +14 -0
- package/dist/inspector/styleEditors/LayoutModeRow.js +60 -0
- package/dist/inspector/styleEditors/LayoutSection.d.ts +2 -2
- package/dist/inspector/styleEditors/LayoutSection.js +30 -356
- package/dist/inspector/styleEditors/OpacityEditor.js +7 -5
- package/dist/inspector/styleEditors/PositionControls.d.ts +18 -0
- package/dist/inspector/styleEditors/PositionControls.js +16 -0
- package/dist/inspector/styleEditors/SizeSection.d.ts +18 -0
- package/dist/inspector/styleEditors/SizeSection.js +71 -0
- package/dist/inspector/styleEditors/{SpacingBox.d.ts → SpacingField.d.ts} +3 -10
- package/dist/inspector/styleEditors/{SpacingBox.js → SpacingField.js} +15 -29
- package/dist/inspector/styleEditors/Typography.js +2 -4
- package/dist/inspector/styleEditors/borderModel.d.ts +1 -7
- package/dist/inspector/styleEditors/borderModel.js +2 -11
- package/dist/inspector/styleEditors/completeCssValue.d.ts +1 -5
- package/dist/inspector/styleEditors/completeCssValue.js +3 -13
- package/dist/inspector/styleEditors/fieldValue.d.ts +20 -0
- package/dist/inspector/styleEditors/fieldValue.js +26 -0
- package/dist/inspector/styleEditors/gradientValue.d.ts +1 -1
- package/dist/inspector/styleEditors/gradientValue.js +3 -2
- package/dist/inspector/styleEditors/gridChildModel.d.ts +7 -47
- package/dist/inspector/styleEditors/gridChildModel.js +6 -37
- package/dist/inspector/styleEditors/hiddenSizeOverrides.d.ts +5 -0
- package/dist/inspector/styleEditors/hiddenSizeOverrides.js +42 -0
- package/dist/inspector/styleEditors/inlineAuthored.d.ts +1 -8
- package/dist/inspector/styleEditors/inlineAuthored.js +3 -17
- package/dist/inspector/styleEditors/layoutMode.d.ts +15 -0
- package/dist/inspector/styleEditors/layoutMode.js +33 -0
- package/dist/inspector/styleEditors/layoutPreviewState.d.ts +0 -1
- package/dist/inspector/styleEditors/layoutPreviewState.js +0 -1
- package/dist/inspector/styleEditors/layoutValue.d.ts +2 -8
- package/dist/inspector/styleEditors/layoutValue.js +4 -12
- package/dist/inspector/styleEditors/nudgeValue.d.ts +1 -13
- package/dist/inspector/styleEditors/nudgeValue.js +1 -13
- package/dist/inspector/styleEditors/rowLookup.d.ts +1 -5
- package/dist/inspector/styleEditors/rowLookup.js +1 -5
- package/dist/inspector/styleEditors/stringRecord.d.ts +1 -2
- package/dist/inspector/styleEditors/stylePresence.d.ts +0 -2
- package/dist/inspector/styleEditors/stylePresence.js +1 -4
- package/dist/inspector/styleEditors/textRelevance.d.ts +1 -1
- package/dist/inspector/styleEditors/textRelevance.js +1 -1
- package/dist/inspector/styleEditors/useFieldVisibility.js +1 -2
- package/dist/inspector/styleEditors/useLayoutContext.d.ts +13 -0
- package/dist/inspector/styleEditors/useLayoutContext.js +53 -0
- package/dist/inspector/styleEditors/valuePolicy.d.ts +1 -5
- package/dist/inspector/styleEditors/valuePolicy.js +0 -1
- package/dist/inspector/testing.d.ts +1 -4
- package/dist/inspector/testing.js +1 -4
- package/dist/inspector/tokens/TokenChip.d.ts +1 -4
- package/dist/inspector/tokens/TokenChip.js +1 -4
- package/dist/inspector/tokens/TokenField.d.ts +4 -3
- package/dist/inspector/tokens/TokenField.js +19 -29
- package/dist/inspector/tokens/catalog.d.ts +2 -10
- package/dist/inspector/tokens/catalog.js +5 -12
- package/dist/inspector/tokens/dragPointerLock.d.ts +0 -1
- package/dist/inspector/tokens/dragPointerLock.js +2 -3
- package/dist/inspector/tokens/editActions.d.ts +1 -1
- package/dist/inspector/tokens/editActions.js +2 -4
- package/dist/inspector/tokens/resolution/cascade.d.ts +1 -5
- package/dist/inspector/tokens/resolution/cascade.js +1 -5
- package/dist/inspector/tokens/resolution/containerQueryEvaluator.d.ts +1 -5
- package/dist/inspector/tokens/resolution/containerQueryEvaluator.js +1 -5
- package/dist/inspector/tokens/resolution/cssomCollector.d.ts +4 -19
- package/dist/inspector/tokens/resolution/cssomCollector.js +151 -122
- package/dist/inspector/tokens/resolution/nestedSelectors.d.ts +1 -5
- package/dist/inspector/tokens/resolution/nestedSelectors.js +1 -5
- package/dist/inspector/tokens/resolution/ruleMatching.d.ts +4 -14
- package/dist/inspector/tokens/resolution/ruleMatching.js +121 -67
- package/dist/inspector/tokens/resolution/selectorSemantics.d.ts +3 -14
- package/dist/inspector/tokens/resolution/selectorSemantics.js +12 -27
- package/dist/inspector/tokens/resolution.d.ts +5 -24
- package/dist/inspector/tokens/resolution.js +16 -71
- package/dist/inspector/tokens/tokenAvailability.d.ts +2 -14
- package/dist/inspector/tokens/tokenAvailability.js +6 -38
- package/dist/inspector/tokens/valueSemanticsAdapter.d.ts +0 -1
- package/dist/inspector/tokens/valueSemanticsAdapter.js +18 -2
- package/dist/inspector/ui/AtRuleContext.d.ts +5 -5
- package/dist/inspector/ui/AtRuleContext.js +8 -6
- package/dist/inspector/ui/ControlSurface.d.ts +0 -4
- package/dist/inspector/ui/Disclosure.d.ts +0 -5
- package/dist/inspector/ui/Disclosure.js +0 -4
- package/dist/inspector/ui/InlineStyleWarning.d.ts +0 -1
- package/dist/inspector/ui/InspectorPopover.d.ts +1 -5
- package/dist/inspector/ui/InspectorPopover.js +1 -5
- package/dist/inspector/ui/SegmentedControl.d.ts +4 -4
- package/dist/inspector/ui/SegmentedControl.js +6 -4
- package/dist/inspector/ui/SideValuesField.d.ts +1 -6
- package/dist/inspector/ui/SideValuesField.js +2 -8
- package/dist/inspector/ui/Toast.d.ts +0 -4
- package/dist/inspector/ui/Toast.js +0 -4
- package/dist/inspector/ui/atRuleSegments.d.ts +13 -0
- package/dist/inspector/ui/atRuleSegments.js +34 -0
- package/dist/inspector/ui/classNames.d.ts +0 -1
- package/dist/inspector/ui/classNames.js +0 -1
- package/dist/inspector/ui/customCursors.d.ts +7 -1
- package/dist/inspector/ui/customCursors.js +2 -6
- package/dist/inspector/ui/styles.js +18 -20
- package/dist/inspector/workspace/controller.js +20 -1
- package/dist/inspector/workspace/handoff.d.ts +1 -5
- package/dist/inspector/workspace/handoff.js +1 -5
- package/dist/inspector/workspace/timeline.d.ts +5 -2
- package/dist/inspector/workspace/timeline.js +0 -1
- package/dist/internal/agent-protocol.d.ts +20 -42
- package/dist/internal/agent-protocol.js +18 -35
- package/dist/nudge-ui.mjs +75 -28
- package/dist/project/artifacts.js +24 -21
- package/dist/project/files.d.ts +0 -1
- package/dist/project/files.js +2 -9
- package/dist/project/identity.d.ts +1 -5
- package/dist/project/identity.js +1 -5
- package/dist/project/mcpPackage.d.ts +1 -6
- package/dist/project/mcpPackage.js +2 -7
- package/dist/project/pathPolicy.d.ts +1 -6
- package/dist/project/pathPolicy.js +1 -6
- package/dist/project/tokens.d.ts +2 -12
- package/dist/project/tokens.js +4 -15
- package/dist/transport/editor.d.ts +1 -12
- package/dist/transport/editor.js +2 -13
- package/dist/transport/index.d.ts +0 -5
- package/dist/transport/index.js +0 -5
- package/dist/transport/routes.d.ts +0 -5
- package/dist/transport/routes.js +0 -5
- package/package.json +5 -4
- package/dist/inspector/styleEditors/InsetSection.d.ts +0 -15
- package/dist/inspector/styleEditors/InsetSection.js +0 -15
- package/dist/inspector/styleEditors/PositionInsets.d.ts +0 -15
- package/dist/inspector/styleEditors/PositionInsets.js +0 -12
- package/dist/inspector/tokens/TokenDropdown.d.ts +0 -13
- package/dist/inspector/tokens/TokenDropdown.js +0 -59
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type CanvasCommand, type CanvasCommandResult, type CanvasGroup, type CanvasState } from "../../internal/agent-protocol.js";
|
|
2
2
|
import { type CanvasCard } from "./canvasStore.js";
|
|
3
|
-
/**
|
|
4
|
-
* Renderer acknowledgements are deliberately shorter than the companion's
|
|
5
|
-
* request timeout. A controller can therefore receive a useful partial-failure
|
|
6
|
-
* acknowledgement instead of waiting for the browser bridge to expire first.
|
|
7
|
-
*/
|
|
3
|
+
/** Deliberately shorter than the companion's request timeout, so partial failures surface as acknowledgements. */
|
|
8
4
|
export declare const DEFAULT_RENDERER_READY_TIMEOUT_MS = 4000;
|
|
9
5
|
export declare const MAX_RENDERER_READY_TIMEOUT_MS = 5000;
|
|
10
6
|
export declare const MAX_PRESENTATION_ROUTES: 64;
|
|
@@ -17,7 +13,6 @@ export interface AgentRendererReadiness {
|
|
|
17
13
|
failedCardIds: string[];
|
|
18
14
|
timedOutCardIds: string[];
|
|
19
15
|
}
|
|
20
|
-
/** Direct callers may use URL strings; the shared command uses AgentRoute. */
|
|
21
16
|
export interface AgentPresentationRoute {
|
|
22
17
|
url: string;
|
|
23
18
|
title?: string | null;
|
|
@@ -46,13 +41,11 @@ export declare class AgentPresentationError extends Error {
|
|
|
46
41
|
readonly code: AgentPresentationErrorCode;
|
|
47
42
|
constructor(code: AgentPresentationErrorCode, message: string);
|
|
48
43
|
}
|
|
49
|
-
/** Records the renderer acknowledgement for one newly presented card. */
|
|
50
44
|
export declare function acknowledgeAgentRendererReady(cardId: string): void;
|
|
51
45
|
/** Records a bounded, non-throwing renderer failure for one presented card. */
|
|
52
46
|
export declare function acknowledgeAgentRendererError(cardId: string, message?: string): void;
|
|
53
47
|
export declare function forgetAgentRendererReadiness(cardIds: readonly string[]): void;
|
|
54
48
|
export declare function waitForAgentRendererReadiness(cardIds: readonly string[], timeoutMs?: number): Promise<AgentRendererReadiness>;
|
|
55
|
-
/** Returns the compact state shape shared with the companion bridge. */
|
|
56
49
|
export declare function readCanvasState(): CanvasState;
|
|
57
50
|
export declare function presentAgentRoutes(input: PresentAgentRoutesInput): Promise<AgentRoutesPresentation>;
|
|
58
51
|
export declare function focusAgentGroup(groupId: string, viewport?: {
|
|
@@ -77,11 +70,7 @@ export interface AgentPresentationCommandPort {
|
|
|
77
70
|
execute(command: unknown): Promise<CanvasCommandResult>;
|
|
78
71
|
dispose(): void;
|
|
79
72
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Creates the browser-controller adapter consumed by the inspector's
|
|
82
|
-
* CopyPromptButton. It does not install window events or define a second
|
|
83
|
-
* message protocol; callers pass the plain shared CanvasCommand they received.
|
|
84
|
-
*/
|
|
73
|
+
/** Does not install window events or define a second message protocol; callers pass the shared CanvasCommand. */
|
|
85
74
|
export declare function createAgentPresentationAdapter(options?: AgentPresentationAdapterOptions): AgentPresentationCommandPort;
|
|
86
75
|
/** Clears presentation-only state between browser sessions and unit tests. */
|
|
87
76
|
export declare function resetAgentPresentationState(): void;
|
|
@@ -6,11 +6,7 @@ import { canWriteWorkspace } from "./workspaceLease.js";
|
|
|
6
6
|
import { removeFrame } from "../workspace/commands.js";
|
|
7
7
|
import { appendAgentRouteCards, getFrameGroup, getFrameGroups, setFrameGroup, removeFrameGroup, batchCanvasChanges, fitAllCards, focusCard, focusCanvasCards, getCanvasCards, getFocusedCardId, } from "./canvasStore.js";
|
|
8
8
|
import { getCanvasMode, setCanvasMode } from "./viewStore.js";
|
|
9
|
-
/**
|
|
10
|
-
* Renderer acknowledgements are deliberately shorter than the companion's
|
|
11
|
-
* request timeout. A controller can therefore receive a useful partial-failure
|
|
12
|
-
* acknowledgement instead of waiting for the browser bridge to expire first.
|
|
13
|
-
*/
|
|
9
|
+
/** Deliberately shorter than the companion's request timeout, so partial failures surface as acknowledgements. */
|
|
14
10
|
export const DEFAULT_RENDERER_READY_TIMEOUT_MS = 4_000;
|
|
15
11
|
export const MAX_RENDERER_READY_TIMEOUT_MS = 5_000;
|
|
16
12
|
export const MAX_PRESENTATION_ROUTES = AGENT_PROTOCOL_LIMITS.routeCount;
|
|
@@ -147,7 +143,6 @@ function beginRendererReadiness(cardIds) {
|
|
|
147
143
|
rendererReadiness.set(cardId, { status: "pending" });
|
|
148
144
|
settleReadinessWaiters();
|
|
149
145
|
}
|
|
150
|
-
/** Records the renderer acknowledgement for one newly presented card. */
|
|
151
146
|
export function acknowledgeAgentRendererReady(cardId) {
|
|
152
147
|
if (!isNonEmptyString(cardId))
|
|
153
148
|
return;
|
|
@@ -208,7 +203,6 @@ function groupCardIds(groupId) {
|
|
|
208
203
|
.filter((card) => card.groupId === groupId)
|
|
209
204
|
.map((card) => card.id);
|
|
210
205
|
}
|
|
211
|
-
/** Returns the compact state shape shared with the companion bridge. */
|
|
212
206
|
export function readCanvasState() {
|
|
213
207
|
const focusedCardId = getFocusedCardId();
|
|
214
208
|
const focusedCard = focusedCardId
|
|
@@ -249,8 +243,7 @@ export async function presentAgentRoutes(input) {
|
|
|
249
243
|
throw new AgentPresentationError("group-id-conflict", `Route group ${groupId} already exists.`);
|
|
250
244
|
}
|
|
251
245
|
const readyTimeoutMs = clampReadyTimeout(input.readyTimeoutMs);
|
|
252
|
-
//
|
|
253
|
-
// never creates or repositions the current Inspect route.
|
|
246
|
+
// Appends only the requested routes; the current Inspect route is never created or repositioned.
|
|
254
247
|
setCanvasMode("canvas");
|
|
255
248
|
const cards = batchCanvasChanges(() => {
|
|
256
249
|
setFrameGroup({ id: groupId, kind: "agent", label, agentId, routes: routes.map((route) => ({ ...route })) });
|
|
@@ -396,11 +389,7 @@ function credentialsFrom(options) {
|
|
|
396
389
|
agentId: options.agentId ?? DEFAULT_AGENT_ID,
|
|
397
390
|
};
|
|
398
391
|
}
|
|
399
|
-
/**
|
|
400
|
-
* Creates the browser-controller adapter consumed by the inspector's
|
|
401
|
-
* CopyPromptButton. It does not install window events or define a second
|
|
402
|
-
* message protocol; callers pass the plain shared CanvasCommand they received.
|
|
403
|
-
*/
|
|
392
|
+
/** Does not install window events or define a second message protocol; callers pass the shared CanvasCommand. */
|
|
404
393
|
export function createAgentPresentationAdapter(options = {}) {
|
|
405
394
|
const credentials = credentialsFrom(options);
|
|
406
395
|
let disposed = false;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The renderer behind a Canvas card, as controller code sees it. Cards on the
|
|
3
|
-
* Canvas pass their iframe; the page surface passes the inspected window.
|
|
4
|
-
*/
|
|
1
|
+
/** The renderer behind a Canvas card (its iframe) or the page surface (the inspected window). */
|
|
5
2
|
export interface CanvasFrame {
|
|
6
3
|
readonly contentWindow: Window | null;
|
|
7
4
|
readonly contentDocument: Document | null;
|
|
@@ -10,7 +7,6 @@ export interface CanvasFrame {
|
|
|
10
7
|
readonly clientHeight: number;
|
|
11
8
|
getBoundingClientRect(): DOMRect;
|
|
12
9
|
}
|
|
13
|
-
/** The card's iframe element, or null for the page surface. */
|
|
14
10
|
export declare function canvasFrameElement(frame: CanvasFrame): HTMLIFrameElement | null;
|
|
15
|
-
/**
|
|
11
|
+
/** What sketch capture measures: the iframe, or the page's root element. */
|
|
16
12
|
export declare function canvasFrameHost(frame: CanvasFrame | null): HTMLElement | null;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/** The card's iframe element, or null for the page surface. */
|
|
2
1
|
export function canvasFrameElement(frame) {
|
|
3
2
|
return typeof HTMLIFrameElement !== "undefined" && frame instanceof HTMLIFrameElement ? frame : null;
|
|
4
3
|
}
|
|
5
|
-
/**
|
|
4
|
+
/** What sketch capture measures: the iframe, or the page's root element. */
|
|
6
5
|
export function canvasFrameHost(frame) {
|
|
7
6
|
if (!frame)
|
|
8
7
|
return null;
|
|
@@ -19,12 +19,7 @@ interface ResizeEdges {
|
|
|
19
19
|
readonly horizontal: "left" | "right" | null;
|
|
20
20
|
readonly vertical: "top" | "bottom" | null;
|
|
21
21
|
}
|
|
22
|
-
/** Returns the anchored edges affected by a resize handle. */
|
|
23
22
|
export declare function getCanvasResizeEdges(direction: CanvasResizeDirection): ResizeEdges;
|
|
24
|
-
/**
|
|
25
|
-
* Applies a pointer delta to a Canvas card while keeping the opposite edges
|
|
26
|
-
* fixed. Minimum dimensions are clamped at the moving edge, so dragging past
|
|
27
|
-
* the minimum does not move the anchored side.
|
|
28
|
-
*/
|
|
23
|
+
/** Minimum dimensions clamp at the moving edge, so dragging past it never moves the anchored side. */
|
|
29
24
|
export declare function resizeCanvasRect(rect: CanvasResizeRect, direction: CanvasResizeDirection, delta: CanvasResizeDelta, minimum?: CanvasResizeMinimum): CanvasResizeRect;
|
|
30
25
|
export {};
|
|
@@ -10,15 +10,10 @@ const RESIZE_EDGES = {
|
|
|
10
10
|
"bottom-left": { horizontal: "left", vertical: "bottom" },
|
|
11
11
|
left: { horizontal: "left", vertical: null },
|
|
12
12
|
};
|
|
13
|
-
/** Returns the anchored edges affected by a resize handle. */
|
|
14
13
|
export function getCanvasResizeEdges(direction) {
|
|
15
14
|
return RESIZE_EDGES[direction];
|
|
16
15
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Applies a pointer delta to a Canvas card while keeping the opposite edges
|
|
19
|
-
* fixed. Minimum dimensions are clamped at the moving edge, so dragging past
|
|
20
|
-
* the minimum does not move the anchored side.
|
|
21
|
-
*/
|
|
16
|
+
/** Minimum dimensions clamp at the moving edge, so dragging past it never moves the anchored side. */
|
|
22
17
|
export function resizeCanvasRect(rect, direction, delta, minimum = { width: MIN_CARD_WIDTH, height: MIN_CARD_HEIGHT }) {
|
|
23
18
|
const edges = getCanvasResizeEdges(direction);
|
|
24
19
|
const minWidth = Math.max(0, minimum.width);
|
|
@@ -38,7 +38,7 @@ export declare const PRIMARY_CARD_INSET = 40;
|
|
|
38
38
|
declare function subscribe(cb: () => void): () => void;
|
|
39
39
|
declare function getCards(): CanvasCard[];
|
|
40
40
|
export declare function batchCanvasChanges<T>(operation: () => T): T;
|
|
41
|
-
/** Adds one card
|
|
41
|
+
/** Adds one card to the end of the row. */
|
|
42
42
|
export declare function addCanvasCard(url: string, title?: string): CanvasCard;
|
|
43
43
|
export declare function appendAgentRouteCards(groupId: string, routes: readonly {
|
|
44
44
|
url: string;
|
|
@@ -49,10 +49,7 @@ export declare function setCanvasHistoryActivator(activate: (cardId: string) =>
|
|
|
49
49
|
export declare function removeCanvasCard(id: string, { undoable }?: {
|
|
50
50
|
undoable?: boolean;
|
|
51
51
|
}): void;
|
|
52
|
-
/**
|
|
53
|
-
* Opens one editor target in the iframe workspace without replacing restored
|
|
54
|
-
* cards or their dimensions.
|
|
55
|
-
*/
|
|
52
|
+
/** Opens one editor target without replacing restored cards or their dimensions. */
|
|
56
53
|
export declare function activateIframeWorkspace(url: string, viewport: {
|
|
57
54
|
width: number;
|
|
58
55
|
height: number;
|
|
@@ -75,7 +72,7 @@ export declare function fitAllCards(viewport?: {
|
|
|
75
72
|
width: number;
|
|
76
73
|
height: number;
|
|
77
74
|
}): void;
|
|
78
|
-
/** Centers
|
|
75
|
+
/** Centers the cards without changing the current zoom. */
|
|
79
76
|
export declare function focusCanvasCards(cardIds: readonly string[], viewport?: {
|
|
80
77
|
width: number;
|
|
81
78
|
height: number;
|
|
@@ -89,14 +86,9 @@ export declare function getSelectedCardId(): string | null;
|
|
|
89
86
|
export declare function useSelectedCardId(): string | null;
|
|
90
87
|
export declare function useFocusedCardId(): string | null;
|
|
91
88
|
export declare function setCardPosition(id: string, x: number, y: number): void;
|
|
92
|
-
/**
|
|
93
|
-
* Starts a user move or resize. The returned commit records the whole gesture
|
|
94
|
-
* as one undo step; programmatic placement through `setCardPosition` and
|
|
95
|
-
* `resizeCard` stays out of history.
|
|
96
|
-
*/
|
|
89
|
+
/** The returned commit records the whole gesture as one undo step; programmatic placement stays out of history. */
|
|
97
90
|
export declare function beginCardGeometryChange(id: string): () => void;
|
|
98
91
|
export declare function hydrateCanvasStore(newMode: CanvasMode, newCards: CanvasCard[], newCamera: CanvasCamera, restoredFocusedCardId?: string | null, restoredPresentation?: CanvasPresentation, restoredGroups?: readonly FrameGroup[]): void;
|
|
99
92
|
export { subscribe, getCards, getCards as getCanvasCards, };
|
|
100
93
|
export declare function useCanvasCards(): CanvasCard[];
|
|
101
|
-
/** Returns a route-based label that distinguishes copies and HTML iterations. */
|
|
102
94
|
export declare function getCanvasCardLabel(card: CanvasCard, frameCards?: readonly CanvasCard[]): string;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { iterationId, contentSourceUrl
|
|
2
|
-
import {
|
|
1
|
+
import { iterationId, contentSourceUrl } from "./frameContent.js";
|
|
2
|
+
import { frameLifecycle } from "./frameLifecycle.js";
|
|
3
3
|
import { recordCanvasChange, discardCanvasHistory } from "../workspace/timeline.js";
|
|
4
|
-
import { targetKey } from "../drafts/model.js";
|
|
5
4
|
import { useSyncExternalStore } from "react";
|
|
6
5
|
import { DEFAULT_CAMERA, getBoardCamera, placeBoardCamera, restoreCanvasView, setCanvasMode, } from "./viewStore.js";
|
|
7
6
|
import { normalizeUrl, normalizedUrlKey } from "./normalizeUrl.js";
|
|
8
|
-
import { removeHtmlArtifact } from "../iterations/client.js";
|
|
9
7
|
import { applyLayoutShifts, boundsOf, centerCamera, fitCamera, layoutShifts, nextCardPosition, pushOverlappingCards, reinsertInRecordedOrder, iterationPosition, } from "./layout.js";
|
|
10
8
|
const frameGroups = new Map();
|
|
11
9
|
export function setFrameGroup(group) { frameGroups.set(group.id, group); }
|
|
@@ -76,7 +74,7 @@ function notify() {
|
|
|
76
74
|
}
|
|
77
75
|
listeners.forEach((l) => l());
|
|
78
76
|
}
|
|
79
|
-
/** Adds one card
|
|
77
|
+
/** Adds one card to the end of the row. */
|
|
80
78
|
export function addCanvasCard(url, title) {
|
|
81
79
|
const before = cards;
|
|
82
80
|
const size = lastUsedCardSize ?? defaultViewportSize();
|
|
@@ -140,8 +138,7 @@ function recordCreation(before, created) {
|
|
|
140
138
|
const shifts = layoutShifts(before, cards);
|
|
141
139
|
const restore = (redo) => {
|
|
142
140
|
if (!redo) {
|
|
143
|
-
// Direct creation drags finish placement after the
|
|
144
|
-
// Redo must recover the dropped position, dimensions, and loaded title.
|
|
141
|
+
// Direct creation drags finish placement after recording, so redo must recover the dropped geometry and title.
|
|
145
142
|
for (const [index, recorded] of after.entries()) {
|
|
146
143
|
const current = createdIds.has(recorded.id) && cards.find((card) => card.id === recorded.id);
|
|
147
144
|
if (current)
|
|
@@ -184,14 +181,11 @@ function selectFallbackAfterRemoval(removedIds) {
|
|
|
184
181
|
if (removedIds.has(focusedCardId ?? ""))
|
|
185
182
|
focusedCardId = fallbackId;
|
|
186
183
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (!
|
|
184
|
+
/** Reports removed iteration content; the drafts/artifacts owner decides what to release. */
|
|
185
|
+
function releaseUnusedIteration(card, remaining = cards) {
|
|
186
|
+
if (!iterationId(card.content))
|
|
190
187
|
return;
|
|
191
|
-
|
|
192
|
-
void removeHtmlArtifact(artifactId).catch((error) => {
|
|
193
|
-
console.warn("Nudge UI could not remove an unused HTML iteration:", error);
|
|
194
|
-
});
|
|
188
|
+
frameLifecycle().release(card.content, remaining.map((candidate) => candidate.content));
|
|
195
189
|
}
|
|
196
190
|
function recordRemoval(before, removed) {
|
|
197
191
|
let snapshot = removed;
|
|
@@ -216,7 +210,7 @@ function recordRemoval(before, removed) {
|
|
|
216
210
|
});
|
|
217
211
|
}
|
|
218
212
|
export function removeCanvasCard(id, { undoable = false } = {}) {
|
|
219
|
-
if (
|
|
213
|
+
if (!frameLifecycle().canEdit())
|
|
220
214
|
return;
|
|
221
215
|
const removed = cards.find((card) => card.id === id);
|
|
222
216
|
if (!removed)
|
|
@@ -232,10 +226,7 @@ export function removeCanvasCard(id, { undoable = false } = {}) {
|
|
|
232
226
|
if (!undoable)
|
|
233
227
|
releaseUnusedIteration(removed);
|
|
234
228
|
}
|
|
235
|
-
/**
|
|
236
|
-
* Opens one editor target in the iframe workspace without replacing restored
|
|
237
|
-
* cards or their dimensions.
|
|
238
|
-
*/
|
|
229
|
+
/** Opens one editor target without replacing restored cards or their dimensions. */
|
|
239
230
|
export function activateIframeWorkspace(url, viewport, options = {}) {
|
|
240
231
|
const normalized = normalizeUrl(url);
|
|
241
232
|
if (!normalized || normalized.origin !== window.location.origin)
|
|
@@ -369,7 +360,7 @@ export function fitAllCards(viewport) {
|
|
|
369
360
|
return;
|
|
370
361
|
placeBoardCamera(fitCamera(bounds, viewport ?? windowViewport(), FIT_ALL_PADDING) ?? DEFAULT_CAMERA);
|
|
371
362
|
}
|
|
372
|
-
/** Centers
|
|
363
|
+
/** Centers the cards without changing the current zoom. */
|
|
373
364
|
export function focusCanvasCards(cardIds, viewport) {
|
|
374
365
|
const bounds = selectedBounds(cardIds);
|
|
375
366
|
if (!bounds)
|
|
@@ -429,11 +420,7 @@ function cardGeometry(id) {
|
|
|
429
420
|
const card = cards.find((candidate) => candidate.id === id);
|
|
430
421
|
return card ? { x: card.x, y: card.y, width: card.width, height: card.height } : null;
|
|
431
422
|
}
|
|
432
|
-
/**
|
|
433
|
-
* Starts a user move or resize. The returned commit records the whole gesture
|
|
434
|
-
* as one undo step; programmatic placement through `setCardPosition` and
|
|
435
|
-
* `resizeCard` stays out of history.
|
|
436
|
-
*/
|
|
423
|
+
/** The returned commit records the whole gesture as one undo step; programmatic placement stays out of history. */
|
|
437
424
|
export function beginCardGeometryChange(id) {
|
|
438
425
|
const before = cardGeometry(id);
|
|
439
426
|
let committed = false;
|
|
@@ -504,7 +491,6 @@ function frameRoute(card) {
|
|
|
504
491
|
label: normalized.pathname,
|
|
505
492
|
};
|
|
506
493
|
}
|
|
507
|
-
/** Returns a route-based label that distinguishes copies and HTML iterations. */
|
|
508
494
|
export function getCanvasCardLabel(card, frameCards = cards) {
|
|
509
495
|
const route = frameRoute(card);
|
|
510
496
|
const candidates = frameCards.some((candidate) => candidate.id === card.id) ? frameCards : [...frameCards, card];
|
|
@@ -7,15 +7,10 @@ export interface FramePoint {
|
|
|
7
7
|
readonly x: number;
|
|
8
8
|
readonly y: number;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Where a frame sits in the controller viewport, measured at one instant.
|
|
12
|
-
* `scale` is measured rather than read from the camera, so it is the board
|
|
13
|
-
* zoom on the Canvas, 1 in focus view, and correct mid-transition.
|
|
14
|
-
*/
|
|
10
|
+
/** Measured, not read from the camera: correct on the board, in focus view, and mid-transition. */
|
|
15
11
|
export interface FrameViewport extends Readonly<Rect> {
|
|
16
12
|
readonly scale: number;
|
|
17
13
|
}
|
|
18
|
-
/** A renderer-owned element named by a frame message. */
|
|
19
14
|
export interface RendererElementRef {
|
|
20
15
|
readonly elementId: string;
|
|
21
16
|
readonly cid: string;
|
|
@@ -24,7 +19,6 @@ export interface RendererElementRef {
|
|
|
24
19
|
type Envelope = "protocolVersion" | "projectId" | "workspaceId" | "cardId";
|
|
25
20
|
type WithoutEnvelope<T> = T extends unknown ? Omit<T, Envelope> : never;
|
|
26
21
|
export type ControllerMessageBody = WithoutEnvelope<ControllerToRendererMessage>;
|
|
27
|
-
/** One mounted Canvas frame as the controller sees it. */
|
|
28
22
|
export interface FrameConnection {
|
|
29
23
|
readonly cardId: string;
|
|
30
24
|
readonly iframe: CanvasFrame;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FrameContent } from "./frameContent.js";
|
|
2
|
+
/**
|
|
3
|
+
* Cross-store effects a frame removal needs: whether drafts allow editing, and
|
|
4
|
+
* who releases the frame's draft and HTML artifact. Canvas registers nothing
|
|
5
|
+
* itself, so it never imports drafts or the iteration client.
|
|
6
|
+
*/
|
|
7
|
+
export interface FrameLifecycle {
|
|
8
|
+
readonly canEdit: () => boolean;
|
|
9
|
+
readonly release: (released: FrameContent, remaining: readonly FrameContent[]) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function setFrameLifecycle(next: FrameLifecycle | null): void;
|
|
12
|
+
export declare function frameLifecycle(): FrameLifecycle;
|
|
@@ -8,12 +8,7 @@ export interface FrameMessage {
|
|
|
8
8
|
type: string;
|
|
9
9
|
protocolVersion: number;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Pre-identity solicitation from a renderer whose bootstrap finished after
|
|
13
|
-
* the controller's load-time parent-ready (or whose document never received
|
|
14
|
-
* one). Carries no FrameIdentity: the whole point is that the renderer does
|
|
15
|
-
* not have one yet. The controller answers with ParentReadyMessage.
|
|
16
|
-
*/
|
|
11
|
+
/** Pre-identity solicitation from a renderer that missed parent-ready; carries no FrameIdentity. */
|
|
17
12
|
export interface RendererHelloMessage extends FrameMessage {
|
|
18
13
|
type: "renderer-hello";
|
|
19
14
|
}
|
|
@@ -60,34 +55,26 @@ export interface ReplaceStylesMessage extends FrameMessage {
|
|
|
60
55
|
instanceOverrides: RenderedInstanceOverride[];
|
|
61
56
|
/** Controller-owned structural intent; renderers never own this change log. */
|
|
62
57
|
structuralChanges: import("../projection/structuralProjection.js").StructuralChange[];
|
|
63
|
-
/** Controller-owned durable rendered text intent. */
|
|
64
58
|
textContentChanges: import("../changes/types.js").TextContentChangeRecord[];
|
|
65
|
-
/** Controller-owned semantic component overrides for Canvas runtimes. */
|
|
66
59
|
componentOverrides: ComponentOverride[];
|
|
67
60
|
/** Generated identities the edits refer to; omitted while edits are hidden. */
|
|
68
61
|
runtimeIdentities?: import("../runtime/runtimeIdentityClaims.js").RuntimeIdentityClaim[];
|
|
69
62
|
}
|
|
70
|
-
/** Renderer acknowledgement that one complete controller snapshot is applied. */
|
|
71
63
|
export interface ProjectionAppliedMessage extends RendererMessage {
|
|
72
64
|
type: "projection-applied";
|
|
73
65
|
revision: number;
|
|
74
66
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Renderer-local outcomes for one controller snapshot. This is diagnostic
|
|
77
|
-
* data only: accepting it never changes controller-owned structural intent.
|
|
78
|
-
*/
|
|
67
|
+
/** Diagnostics only: accepting these never changes controller-owned structural intent. */
|
|
79
68
|
export interface StructuralProjectionReportMessage extends RendererMessage {
|
|
80
69
|
type: "structural-projection-report";
|
|
81
70
|
revision: number;
|
|
82
71
|
reports: import("../projection/structuralProjection.js").StructuralProjectionReport[];
|
|
83
72
|
}
|
|
84
|
-
/** Renderer-local CSS-instance outcomes for one controller snapshot. */
|
|
85
73
|
export interface RenderedInstanceProjectionReportMessage extends RendererMessage {
|
|
86
74
|
type: "rendered-instance-projection-report";
|
|
87
75
|
revision: number;
|
|
88
76
|
reports: import("../projection/renderedInstance.js").DocumentProjectionReport[];
|
|
89
77
|
}
|
|
90
|
-
/** Renderer-local outcomes for one controller-owned text snapshot. */
|
|
91
78
|
export interface TextProjectionReportMessage extends RendererMessage {
|
|
92
79
|
type: "text-projection-report";
|
|
93
80
|
revision: number;
|
|
@@ -99,7 +86,6 @@ export interface NavigationIntentMessage extends RendererMessage {
|
|
|
99
86
|
/** The renderer kept its own route and asks the controller for a card instead. */
|
|
100
87
|
openInCard?: boolean;
|
|
101
88
|
}
|
|
102
|
-
/** Tells a renderer whether ordinary link clicks open a new canvas card. */
|
|
103
89
|
export interface LinkTargetStateMessage extends RendererMessage {
|
|
104
90
|
type: "link-target-state";
|
|
105
91
|
openInCard: boolean;
|
|
@@ -133,15 +119,12 @@ export interface ElementHoverMessage extends RendererMessage {
|
|
|
133
119
|
x: number;
|
|
134
120
|
y: number;
|
|
135
121
|
} | null;
|
|
136
|
-
/** The spacing handle under the pointer
|
|
137
|
-
* start; only present when the pointer is inside the handle hit area. */
|
|
122
|
+
/** The spacing handle under the pointer; only present inside the handle hit area. */
|
|
138
123
|
spacing?: SpacingDescriptor | null;
|
|
139
|
-
/** The padding bar or layout gap area under the pointer, regardless of the
|
|
140
|
-
* handle. Drives the hover fill overlay across the whole area. */
|
|
124
|
+
/** The padding bar or layout gap area under the pointer, regardless of the handle. */
|
|
141
125
|
hoverSpacing?: SpacingDescriptor | null;
|
|
142
126
|
}
|
|
143
|
-
/**
|
|
144
|
-
* from its own keyboard events because focus lives in the iframe. */
|
|
127
|
+
/** The parent never infers modifier state: focus lives in the iframe. */
|
|
145
128
|
export interface ElementMeasureStateMessage extends RendererMessage {
|
|
146
129
|
type: "element-measure-state";
|
|
147
130
|
altKey: boolean;
|
|
@@ -159,7 +142,6 @@ export interface ElementClickMessage extends RendererMessage {
|
|
|
159
142
|
/** True for a Shift-click that toggles this target in the selection group. */
|
|
160
143
|
additive?: boolean;
|
|
161
144
|
}
|
|
162
|
-
/** Requests controller-owned inline text editing for an element in this frame. */
|
|
163
145
|
export interface InlineTextIntentMessage extends RendererMessage {
|
|
164
146
|
type: "inline-text-intent";
|
|
165
147
|
intent: "pointer-down" | "double-click";
|
|
@@ -173,7 +155,6 @@ export interface InlineTextIntentMessage extends RendererMessage {
|
|
|
173
155
|
clickCount?: number;
|
|
174
156
|
emptyProjectionId?: string;
|
|
175
157
|
}
|
|
176
|
-
/** Renderer request to clear the controller-owned element selection. */
|
|
177
158
|
export interface ElementDeselectMessage extends RendererMessage {
|
|
178
159
|
type: "element-deselect";
|
|
179
160
|
}
|
|
@@ -202,7 +183,6 @@ export interface ElementDragMoveMessage extends RendererMessage {
|
|
|
202
183
|
x: number;
|
|
203
184
|
y: number;
|
|
204
185
|
};
|
|
205
|
-
/** True while Shift is held; spacing drags use this to snap by 8px steps. */
|
|
206
186
|
shiftKey?: boolean;
|
|
207
187
|
}
|
|
208
188
|
export interface ElementDragEndMessage extends RendererMessage {
|
|
@@ -211,7 +191,6 @@ export interface ElementDragEndMessage extends RendererMessage {
|
|
|
211
191
|
x: number;
|
|
212
192
|
y: number;
|
|
213
193
|
};
|
|
214
|
-
/** True while Shift is held; spacing drags use this to snap by 8px steps. */
|
|
215
194
|
shiftKey?: boolean;
|
|
216
195
|
/** True when the renderer lost the gesture before the pointer was released. */
|
|
217
196
|
cancelled?: boolean;
|
|
@@ -234,7 +213,6 @@ export interface HistoryRequestMessage extends RendererMessage {
|
|
|
234
213
|
type: "history-request";
|
|
235
214
|
action: "undo" | "redo";
|
|
236
215
|
}
|
|
237
|
-
/** Requests the parent-owned inspector visibility toggle from frame focus. */
|
|
238
216
|
export interface InspectorToggleRequestMessage extends RendererMessage {
|
|
239
217
|
type: "inspector-toggle-request";
|
|
240
218
|
}
|
|
@@ -244,7 +222,6 @@ export interface InspectorOpenRequestMessage extends RendererMessage {
|
|
|
244
222
|
}
|
|
245
223
|
export type KeyboardShortcutCode = "Backslash" | "KeyI" | "KeyV" | "KeyC" | "KeyP" | "KeyS";
|
|
246
224
|
export type KeyboardShortcutPhase = "keydown" | "keyup";
|
|
247
|
-
/** Forwards controller-owned keyboard shortcuts from an iframe document. */
|
|
248
225
|
export interface KeyboardShortcutMessage extends RendererMessage {
|
|
249
226
|
type: "keyboard-shortcut";
|
|
250
227
|
phase: KeyboardShortcutPhase;
|
|
@@ -284,7 +261,6 @@ export interface BoardGestureStateMessage extends RendererMessage {
|
|
|
284
261
|
/** Ordinary wheel gestures pan the board instead of scrolling the app. */
|
|
285
262
|
panScroll?: boolean;
|
|
286
263
|
}
|
|
287
|
-
/** Proxies modified wheel gestures that originate inside an iframe card. */
|
|
288
264
|
export interface ZoomMessage extends RendererMessage {
|
|
289
265
|
type: "zoom";
|
|
290
266
|
deltaY: number;
|
|
@@ -293,7 +269,6 @@ export interface ZoomMessage extends RendererMessage {
|
|
|
293
269
|
y: number;
|
|
294
270
|
};
|
|
295
271
|
}
|
|
296
|
-
/** Proxies ordinary wheel gestures as normalized pixel distances. */
|
|
297
272
|
export interface WheelPanMessage extends RendererMessage {
|
|
298
273
|
type: "wheel-pan";
|
|
299
274
|
deltaX: number;
|
|
@@ -304,7 +279,6 @@ export interface AppInteractionModifierMessage extends RendererMessage {
|
|
|
304
279
|
type: "app-interaction-modifier";
|
|
305
280
|
held: boolean;
|
|
306
281
|
}
|
|
307
|
-
/** Tells a renderer whether the inspector is open and which cursor its gestures show. */
|
|
308
282
|
export interface InspectorInteractionStateMessage extends RendererMessage {
|
|
309
283
|
type: "inspector-interaction-state";
|
|
310
284
|
open: boolean;
|
|
@@ -313,9 +287,7 @@ export interface InspectorInteractionStateMessage extends RendererMessage {
|
|
|
313
287
|
/** CSS cursor for the Comment tool; the controller renders it. */
|
|
314
288
|
commentCursor?: string;
|
|
315
289
|
}
|
|
316
|
-
/** Messages a renderer sends to the controller. */
|
|
317
290
|
export type RendererToControllerMessage = RendererHelloMessage | FrameReadyMessage | FrameRuntimeMessage | FrameMetadataMessage | FrameLoadError | ProjectionAppliedMessage | StructuralProjectionReportMessage | RenderedInstanceProjectionReportMessage | TextProjectionReportMessage | NavigationIntentMessage | ElementHoverMessage | ElementMeasureStateMessage | ElementClickMessage | InlineTextIntentMessage | ElementDeselectMessage | ElementDragStartMessage | ElementDragMoveMessage | ElementDragEndMessage | ElementDeleteMessage | ElementNudgeMessage | HistoryRequestMessage | InspectorToggleRequestMessage | InspectorOpenRequestMessage | KeyboardShortcutMessage | PanStartMessage | PanMoveMessage | PanEndMessage | PanModifierMessage | ZoomMessage | WheelPanMessage | AppInteractionModifierMessage;
|
|
318
|
-
/** Messages the controller sends to a renderer. */
|
|
319
291
|
export type ControllerToRendererMessage = ParentReadyMessage | ReplaceStylesMessage | LinkTargetStateMessage | PanModifierMessage | MeasureModifierMessage | BoardGestureStateMessage | InspectorInteractionStateMessage;
|
|
320
292
|
export declare function isRendererMessageType(type: unknown): type is RendererToControllerMessage["type"];
|
|
321
293
|
export type FrameProtocolMessage = ParentReadyMessage | RendererHelloMessage | FrameReadyMessage | FrameRuntimeMessage | FrameMetadataMessage | FrameLoadError | ReplaceStylesMessage | ProjectionAppliedMessage | StructuralProjectionReportMessage | RenderedInstanceProjectionReportMessage | TextProjectionReportMessage | NavigationIntentMessage | LinkTargetStateMessage | ElementHoverMessage | ElementMeasureStateMessage | ElementClickMessage | InlineTextIntentMessage | ElementDeselectMessage | ElementDragStartMessage | ElementDragMoveMessage | ElementDragEndMessage | ElementDeleteMessage | ElementNudgeMessage | HistoryRequestMessage | InspectorToggleRequestMessage | InspectorOpenRequestMessage | KeyboardShortcutMessage | PanStartMessage | PanMoveMessage | PanEndMessage | PanModifierMessage | MeasureModifierMessage | BoardGestureStateMessage | ZoomMessage | WheelPanMessage | AppInteractionModifierMessage | InspectorInteractionStateMessage;
|
|
@@ -324,19 +296,12 @@ export declare function clearRendererIdentity(expected?: FrameIdentity): void;
|
|
|
324
296
|
export declare function getRendererIdentity(): FrameIdentity | null;
|
|
325
297
|
export declare function isRendererMessageFor(value: unknown, identity: FrameIdentity): value is RendererMessage;
|
|
326
298
|
export declare function isKeyboardShortcutCode(value: unknown): value is KeyboardShortcutCode;
|
|
327
|
-
/** Strict JSON-only schema for renderer-originated global keyboard shortcuts. */
|
|
328
299
|
export declare function isKeyboardShortcutMessage(value: unknown, identity: FrameIdentity): value is KeyboardShortcutMessage;
|
|
329
|
-
/** Strict JSON-only schema for selecting an element from a renderer frame. */
|
|
330
300
|
export declare function isElementClickMessage(value: unknown, identity: FrameIdentity): value is ElementClickMessage;
|
|
331
|
-
/** Strict JSON-only schema for starting controller-owned inline text editing. */
|
|
332
301
|
export declare function isInlineTextIntentMessage(value: unknown, identity: FrameIdentity): value is InlineTextIntentMessage;
|
|
333
|
-
/** Strict JSON-only schema for renderer diagnostics before the parent records them. */
|
|
334
302
|
export declare function isStructuralProjectionReportMessage(value: unknown, identity: FrameIdentity): value is StructuralProjectionReportMessage;
|
|
335
|
-
/** Strict JSON-only schema for renderer CSS-instance diagnostics. */
|
|
336
303
|
export declare function isRenderedInstanceProjectionReportMessage(value: unknown, identity: FrameIdentity): value is RenderedInstanceProjectionReportMessage;
|
|
337
|
-
/** Strict JSON-only schema for renderer rendered-text diagnostics. */
|
|
338
304
|
export declare function isTextProjectionReportMessage(value: unknown, identity: FrameIdentity): value is TextProjectionReportMessage;
|
|
339
|
-
/** Strict JSON-only acknowledgement for a fully applied Canvas snapshot. */
|
|
340
305
|
export declare function isProjectionAppliedMessage(value: unknown, identity: FrameIdentity): value is ProjectionAppliedMessage;
|
|
341
306
|
export declare function isComponentOverrideList(value: unknown): value is ComponentOverride[];
|
|
342
307
|
export declare function sendToParent(msg: FrameProtocolMessage): void;
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { isDocumentProjectionReport } from "../projection/renderedInstance.js";
|
|
2
2
|
import { isTextProjectionReport } from "../projection/textProjection.js";
|
|
3
3
|
import { isStructuralProjectionReport } from "../projection/structuralProjectionBoundary.js";
|
|
4
|
-
//
|
|
5
|
-
// v20 adds Shift state to element drag messages so spacing handles can snap
|
|
6
|
-
// changes to 8px increments.
|
|
7
|
-
// v19 adds spacing drag gestures (hover point, spacing descriptor, start
|
|
8
|
-
// point, and cancelled drag-end) plus renderer-to-controller keyboard shortcut
|
|
9
|
-
// forwarding for Canvas frames.
|
|
10
|
-
// v18 adds parent-to-renderer Alt modifier forwarding for Canvas measurements.
|
|
11
|
-
// v17 adds an idempotent renderer request to open the parent inspector. v16
|
|
12
|
-
// adds controller-owned inline-text intents for Canvas frames. v15 adds
|
|
13
|
-
// renderer-to-controller element deselection for Canvas frames. v14
|
|
14
|
-
// adds border widths to hover geometry so containment measurements can exclude
|
|
15
|
-
// the container border. v13 adds source-parent-aware structural moves and
|
|
16
|
-
// bounded structural failure reasons to the full projection snapshot. v12
|
|
17
|
-
// added the projection-applied acknowledgement: the controller can avoid
|
|
18
|
-
// rereading a Canvas iframe until the renderer has applied its revision. v11
|
|
19
|
-
// added the renderer-hello handshake solicitation for runtimes whose boot
|
|
20
|
-
// completes after the controller's load-time parent-ready.
|
|
4
|
+
// Bumped on every message-shape change; the controller and renderer must agree exactly.
|
|
21
5
|
export const PROTOCOL_VERSION = 21;
|
|
22
6
|
const RENDERER_MESSAGE_TYPES = {
|
|
23
7
|
"renderer-hello": true,
|
|
@@ -82,7 +66,6 @@ export function isKeyboardShortcutCode(value) {
|
|
|
82
66
|
|| value === "KeyP"
|
|
83
67
|
|| value === "KeyS";
|
|
84
68
|
}
|
|
85
|
-
/** Strict JSON-only schema for renderer-originated global keyboard shortcuts. */
|
|
86
69
|
export function isKeyboardShortcutMessage(value, identity) {
|
|
87
70
|
if (!isRendererMessageFor(value, identity) || !isProtocolObject(value))
|
|
88
71
|
return false;
|
|
@@ -94,7 +77,6 @@ export function isKeyboardShortcutMessage(value, identity) {
|
|
|
94
77
|
&& (ownValue(value, "phase") === "keydown" || ownValue(value, "phase") === "keyup")
|
|
95
78
|
&& isKeyboardShortcutCode(ownValue(value, "code"));
|
|
96
79
|
}
|
|
97
|
-
/** Strict JSON-only schema for selecting an element from a renderer frame. */
|
|
98
80
|
export function isElementClickMessage(value, identity) {
|
|
99
81
|
if (!isRendererMessageFor(value, identity) || !isProtocolObject(value))
|
|
100
82
|
return false;
|
|
@@ -115,7 +97,6 @@ export function isElementClickMessage(value, identity) {
|
|
|
115
97
|
&& typeof ownValue(value, "component") === "string"
|
|
116
98
|
&& (additive === undefined || typeof additive === "boolean");
|
|
117
99
|
}
|
|
118
|
-
/** Strict JSON-only schema for starting controller-owned inline text editing. */
|
|
119
100
|
export function isInlineTextIntentMessage(value, identity) {
|
|
120
101
|
if (!isRendererMessageFor(value, identity) || !isProtocolObject(value))
|
|
121
102
|
return false;
|
|
@@ -140,7 +121,6 @@ export function isInlineTextIntentMessage(value, identity) {
|
|
|
140
121
|
&& (clickCount === undefined || (typeof clickCount === "number" && Number.isSafeInteger(clickCount) && clickCount >= 0))
|
|
141
122
|
&& (emptyProjectionId === undefined || typeof emptyProjectionId === "string");
|
|
142
123
|
}
|
|
143
|
-
/** Strict JSON-only schema for renderer diagnostics before the parent records them. */
|
|
144
124
|
export function isStructuralProjectionReportMessage(value, identity) {
|
|
145
125
|
if (!isRendererMessageFor(value, identity) || !value || typeof value !== "object")
|
|
146
126
|
return false;
|
|
@@ -155,7 +135,6 @@ export function isStructuralProjectionReportMessage(value, identity) {
|
|
|
155
135
|
&& Array.isArray(message.reports)
|
|
156
136
|
&& message.reports.every(isStructuralProjectionReport);
|
|
157
137
|
}
|
|
158
|
-
/** Strict JSON-only schema for renderer CSS-instance diagnostics. */
|
|
159
138
|
export function isRenderedInstanceProjectionReportMessage(value, identity) {
|
|
160
139
|
if (!isRendererMessageFor(value, identity) || !value || typeof value !== "object")
|
|
161
140
|
return false;
|
|
@@ -170,7 +149,6 @@ export function isRenderedInstanceProjectionReportMessage(value, identity) {
|
|
|
170
149
|
&& Array.isArray(message.reports)
|
|
171
150
|
&& message.reports.every(isDocumentProjectionReport);
|
|
172
151
|
}
|
|
173
|
-
/** Strict JSON-only schema for renderer rendered-text diagnostics. */
|
|
174
152
|
export function isTextProjectionReportMessage(value, identity) {
|
|
175
153
|
if (!isRendererMessageFor(value, identity) || !isProtocolObject(value))
|
|
176
154
|
return false;
|
|
@@ -186,7 +164,6 @@ export function isTextProjectionReportMessage(value, identity) {
|
|
|
186
164
|
&& Array.isArray(reports)
|
|
187
165
|
&& reports.every(isTextProjectionReport);
|
|
188
166
|
}
|
|
189
|
-
/** Strict JSON-only acknowledgement for a fully applied Canvas snapshot. */
|
|
190
167
|
export function isProjectionAppliedMessage(value, identity) {
|
|
191
168
|
if (!isRendererMessageFor(value, identity) || !isProtocolObject(value))
|
|
192
169
|
return false;
|
|
@@ -9,7 +9,6 @@ const FRAME_SCROLLBAR_CSS = `
|
|
|
9
9
|
scrollbar-width: thin;
|
|
10
10
|
}
|
|
11
11
|
`;
|
|
12
|
-
/** Gives frame documents thin scrollbars over a transparent track by default. */
|
|
13
12
|
export function installFrameScrollbarStyles(doc) {
|
|
14
13
|
if (!doc.head || doc.getElementById(FRAME_SCROLLBAR_STYLE_ID))
|
|
15
14
|
return () => undefined;
|