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
|
@@ -13,35 +13,18 @@ export interface HandoffSnapshot {
|
|
|
13
13
|
readonly changes: readonly ChangeRecord[];
|
|
14
14
|
readonly structuralChanges: readonly StructuralChange[];
|
|
15
15
|
}
|
|
16
|
-
/** Stable, preview-metadata-free identity for one prompt handoff record. */
|
|
17
16
|
export declare function handoffChangeFingerprint(change: ChangeRecord): string;
|
|
18
|
-
/** Stable identity for one structural record included in a prompt handoff. */
|
|
19
17
|
export declare function handoffStructuralFingerprint(change: StructuralChange): string;
|
|
20
|
-
/**
|
|
21
|
-
* Positively verifies browser-observable source results after the inspector's
|
|
22
|
-
* own projections have been removed. Component props and interaction states
|
|
23
|
-
* intentionally remain unresolved because rendered output alone cannot prove
|
|
24
|
-
* that their source was updated.
|
|
25
|
-
*/
|
|
18
|
+
/** Component props and interaction states stay unresolved: rendered output alone cannot prove their source changed. */
|
|
26
19
|
export declare function verifiedChangeKeys(sentChanges: readonly ChangeRecord[], doc?: Document): Set<string>;
|
|
27
|
-
/** Captures the exact canonical edits associated with one dispatched prompt. */
|
|
28
20
|
export declare function recordAgentDispatch(revision: number, changes: readonly ChangeRecord[], structuralChanges?: readonly StructuralChange[], owner?: HandoffOwner): void;
|
|
29
|
-
/** Drops a captured revision when the bridge rejects its dispatch. */
|
|
30
21
|
export declare function discardAgentDispatch(revision: number): void;
|
|
31
|
-
/** Returns how many canonical edits were in flight for one dispatch. */
|
|
32
22
|
export declare function getAgentDispatchSize(revision: number): number;
|
|
33
|
-
/**
|
|
34
|
-
* Reconciles only records that still equal the sent snapshot and that remain
|
|
35
|
-
* observable after removing Nudge's own preview. Newer edits and ambiguous
|
|
36
|
-
* records are preserved.
|
|
37
|
-
*/
|
|
23
|
+
/** Newer edits and ambiguous records are preserved. */
|
|
38
24
|
export declare function verifyAndReconcileHandoff(snapshot: HandoffSnapshot, doc?: Document | null): Promise<number>;
|
|
39
25
|
export declare function documentBelongsToHandoff(doc: Document, owner: HandoffOwner): boolean;
|
|
40
|
-
/** Returns the records captured for one dispatch until it is reconciled. */
|
|
41
26
|
export declare function getAgentDispatch(revision: number): HandoffSnapshot | null;
|
|
42
|
-
/** Records in the owner draft that still equal what a handoff sent. */
|
|
43
27
|
export declare function unchangedHandoffRecords(snapshot: HandoffSnapshot): Pick<HandoffSnapshot, "changes" | "structuralChanges">;
|
|
44
|
-
/** Reconciles the captured records for one completed connected-agent request. */
|
|
45
28
|
export declare function verifyAndReconcileAgentDispatch(revision: number): Promise<number>;
|
|
46
29
|
/** Test/session reset for in-memory dispatch snapshots. */
|
|
47
30
|
export declare function resetAgentVerification(): void;
|
|
@@ -34,11 +34,9 @@ function stableJsonValue(value) {
|
|
|
34
34
|
function stableSerialized(value) {
|
|
35
35
|
return JSON.stringify(stableJsonValue(value));
|
|
36
36
|
}
|
|
37
|
-
/** Stable, preview-metadata-free identity for one prompt handoff record. */
|
|
38
37
|
export function handoffChangeFingerprint(change) {
|
|
39
38
|
return stableSerialized(change);
|
|
40
39
|
}
|
|
41
|
-
/** Stable identity for one structural record included in a prompt handoff. */
|
|
42
40
|
export function handoffStructuralFingerprint(change) {
|
|
43
41
|
return stableSerialized(change);
|
|
44
42
|
}
|
|
@@ -59,7 +57,7 @@ function queryTargets(doc, selector) {
|
|
|
59
57
|
return [];
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
|
-
/**
|
|
60
|
+
/** Falls back to relocating a shifted source site. */
|
|
63
61
|
function styleTargets(change, doc) {
|
|
64
62
|
if (isTokenChange(change))
|
|
65
63
|
return queryTargets(doc, change.selector);
|
|
@@ -106,12 +104,7 @@ function verifyText(change, doc) {
|
|
|
106
104
|
&& change.after.length === 0
|
|
107
105
|
&& (resolved.element.textContent ?? "") === "";
|
|
108
106
|
}
|
|
109
|
-
/**
|
|
110
|
-
* A delete verifies when its target no longer resolves in the document once
|
|
111
|
-
* the preview is lifted: the source really removed it. Ambiguous evidence
|
|
112
|
-
* still means identical elements are present, so only a definitive miss
|
|
113
|
-
* verifies.
|
|
114
|
-
*/
|
|
107
|
+
/** Only a definitive miss verifies; ambiguous evidence still means identical elements are present. */
|
|
115
108
|
function verifyStructuralDelete(change, doc) {
|
|
116
109
|
if (!change.route || !change.state || !doc.location)
|
|
117
110
|
return false;
|
|
@@ -128,12 +121,7 @@ function verifyStructuralDelete(change, doc) {
|
|
|
128
121
|
&& documentStateKey(doc) === change.state
|
|
129
122
|
&& resolveMovedRenderedInstance(doc, change.target).status === "missing";
|
|
130
123
|
}
|
|
131
|
-
/**
|
|
132
|
-
* A move verifies when the element sits at its recorded destination without
|
|
133
|
-
* the preview holding it there. The projection rebuild returns a cleanly
|
|
134
|
-
* applied move preview to its captured origin, so such records conservatively
|
|
135
|
-
* stay unverified instead of trusting rendered placement alone.
|
|
136
|
-
*/
|
|
124
|
+
/** A cleanly applied preview returns to its captured origin, so only a move that stays at its recorded destination verifies. */
|
|
137
125
|
function verifyStructuralMove(change, doc) {
|
|
138
126
|
const target = resolveMovedRenderedInstance(doc, change.target);
|
|
139
127
|
if (target.status !== "resolved")
|
|
@@ -159,12 +147,7 @@ function verifiedStructuralChangeIds(eligible, doc) {
|
|
|
159
147
|
}
|
|
160
148
|
return verified;
|
|
161
149
|
}
|
|
162
|
-
/**
|
|
163
|
-
* Positively verifies browser-observable source results after the inspector's
|
|
164
|
-
* own projections have been removed. Component props and interaction states
|
|
165
|
-
* intentionally remain unresolved because rendered output alone cannot prove
|
|
166
|
-
* that their source was updated.
|
|
167
|
-
*/
|
|
150
|
+
/** Component props and interaction states stay unresolved: rendered output alone cannot prove their source changed. */
|
|
168
151
|
export function verifiedChangeKeys(sentChanges, doc = document) {
|
|
169
152
|
const verified = new Set();
|
|
170
153
|
for (const change of sentChanges) {
|
|
@@ -178,7 +161,6 @@ export function verifiedChangeKeys(sentChanges, doc = document) {
|
|
|
178
161
|
}
|
|
179
162
|
return verified;
|
|
180
163
|
}
|
|
181
|
-
/** Captures the exact canonical edits associated with one dispatched prompt. */
|
|
182
164
|
export function recordAgentDispatch(revision, changes, structuralChanges = [], owner = captureHandoffOwner()) {
|
|
183
165
|
dispatches.set(revision, {
|
|
184
166
|
owner: structuredClone(owner),
|
|
@@ -186,11 +168,9 @@ export function recordAgentDispatch(revision, changes, structuralChanges = [], o
|
|
|
186
168
|
structuralChanges: structuralChanges.map((change) => structuredClone(change)),
|
|
187
169
|
});
|
|
188
170
|
}
|
|
189
|
-
/** Drops a captured revision when the bridge rejects its dispatch. */
|
|
190
171
|
export function discardAgentDispatch(revision) {
|
|
191
172
|
dispatches.delete(revision);
|
|
192
173
|
}
|
|
193
|
-
/** Returns how many canonical edits were in flight for one dispatch. */
|
|
194
174
|
export function getAgentDispatchSize(revision) {
|
|
195
175
|
const snapshot = dispatches.get(revision);
|
|
196
176
|
if (!snapshot)
|
|
@@ -219,11 +199,7 @@ function afterBrowserPaint(doc) {
|
|
|
219
199
|
});
|
|
220
200
|
});
|
|
221
201
|
}
|
|
222
|
-
/**
|
|
223
|
-
* Reconciles only records that still equal the sent snapshot and that remain
|
|
224
|
-
* observable after removing Nudge's own preview. Newer edits and ambiguous
|
|
225
|
-
* records are preserved.
|
|
226
|
-
*/
|
|
202
|
+
/** Newer edits and ambiguous records are preserved. */
|
|
227
203
|
export async function verifyAndReconcileHandoff(snapshot, doc = handoffDocument(snapshot.owner)) {
|
|
228
204
|
if (!doc || !documentBelongsToHandoff(doc, snapshot.owner))
|
|
229
205
|
return 0;
|
|
@@ -241,8 +217,6 @@ export async function verifyAndReconcileHandoff(snapshot, doc = handoffDocument(
|
|
|
241
217
|
const eligible = current.filter((change) => sentByKey.get(changeKey(change)) === handoffChangeFingerprint(change));
|
|
242
218
|
const eligibleKeys = new Set(eligible.map(changeKey));
|
|
243
219
|
const remaining = current.filter((change) => !eligibleKeys.has(changeKey(change)));
|
|
244
|
-
// The same "still unchanged" rule for structural intent: only canonical
|
|
245
|
-
// records byte-identical to the dispatched snapshot may be reconciled.
|
|
246
220
|
const sentStructural = new Map(snapshot.structuralChanges.map((change) => [change.id, handoffStructuralFingerprint(change)]));
|
|
247
221
|
const currentStructural = getDraftChanges(snapshot.owner.draftId).structuralChanges;
|
|
248
222
|
const eligibleStructural = currentStructural.filter((change) => sentStructural.get(change.id) === handoffStructuralFingerprint(change));
|
|
@@ -265,9 +239,7 @@ export async function verifyAndReconcileHandoff(snapshot, doc = handoffDocument(
|
|
|
265
239
|
return 0;
|
|
266
240
|
const verified = verifiedChangeKeys(eligible, doc);
|
|
267
241
|
const verifiedStructural = verifiedStructuralChangeIds(eligibleStructural, doc);
|
|
268
|
-
//
|
|
269
|
-
// window is open. Recheck byte identity immediately before reconciliation
|
|
270
|
-
// so a newer value at the same key can never be removed.
|
|
242
|
+
// Recheck byte identity before reconciling; a user edit can land while the two-frame window is open.
|
|
271
243
|
const currentByKey = new Map(getDraftChanges(snapshot.owner.draftId).changes.map((change) => [changeKey(change), handoffChangeFingerprint(change)]));
|
|
272
244
|
const stillVerified = new Set([...verified].filter((key) => currentByKey.get(key) === sentByKey.get(key)));
|
|
273
245
|
const currentStructuralById = new Map(getDraftChanges(snapshot.owner.draftId).structuralChanges.map((change) => [change.id, handoffStructuralFingerprint(change)]));
|
|
@@ -280,12 +252,7 @@ export async function verifyAndReconcileHandoff(snapshot, doc = handoffDocument(
|
|
|
280
252
|
return reconcileDraftChanges(snapshot.owner.draftId, stillVerified, stillVerifiedStructural);
|
|
281
253
|
}
|
|
282
254
|
finally {
|
|
283
|
-
//
|
|
284
|
-
// (for example, a read-only Canvas lease), restore the untouched set here.
|
|
285
|
-
// A Canvas restore settles on the renderer's acknowledgement: that
|
|
286
|
-
// acknowledgement invalidates the frame's stylesheet revision, and a
|
|
287
|
-
// caller still inside this verification must not mistake it for a source
|
|
288
|
-
// change and schedule another verification.
|
|
255
|
+
// If reconciliation could not write (read-only Canvas lease), restore the untouched set; a Canvas restore settles on the renderer's acknowledgement.
|
|
289
256
|
if (doc === document)
|
|
290
257
|
await applyProjection(getActiveDraftChanges());
|
|
291
258
|
else
|
|
@@ -311,11 +278,9 @@ function handoffDocument(owner) {
|
|
|
311
278
|
}
|
|
312
279
|
return owner.target.kind === "application" && !isEditorShellDocument() ? document : null;
|
|
313
280
|
}
|
|
314
|
-
/** Returns the records captured for one dispatch until it is reconciled. */
|
|
315
281
|
export function getAgentDispatch(revision) {
|
|
316
282
|
return dispatches.get(revision) ?? null;
|
|
317
283
|
}
|
|
318
|
-
/** Records in the owner draft that still equal what a handoff sent. */
|
|
319
284
|
export function unchangedHandoffRecords(snapshot) {
|
|
320
285
|
const sent = new Set(snapshot.changes.map(handoffChangeFingerprint));
|
|
321
286
|
const sentStructural = new Set(snapshot.structuralChanges.map(handoffStructuralFingerprint));
|
|
@@ -325,7 +290,6 @@ export function unchangedHandoffRecords(snapshot) {
|
|
|
325
290
|
structuralChanges: current.structuralChanges.filter((change) => sentStructural.has(handoffStructuralFingerprint(change))),
|
|
326
291
|
};
|
|
327
292
|
}
|
|
328
|
-
/** Reconciles the captured records for one completed connected-agent request. */
|
|
329
293
|
export async function verifyAndReconcileAgentDispatch(revision) {
|
|
330
294
|
const snapshot = dispatches.get(revision);
|
|
331
295
|
if (!snapshot)
|
package/dist/inspector/boot.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
export type InspectorShell = () => ReactElement;
|
|
3
|
+
export declare function bootstrapNudgeUi(inspectorHost: HTMLElement, shell?: InspectorShell): void;
|
|
2
4
|
export declare function mountInspector(host: HTMLElement): void;
|
|
3
5
|
export declare function unmountInspector(): void;
|
package/dist/inspector/boot.js
CHANGED
|
@@ -33,6 +33,8 @@ import { disposeRuntimeIdentityClaims } from "./runtime/runtimeIdentityClaims.js
|
|
|
33
33
|
let hostElement = null;
|
|
34
34
|
let reactRoot = null;
|
|
35
35
|
let lockedRoot = null;
|
|
36
|
+
/** Rendered by every mount until the next bootstrap; replaced so tests and embedders can supply a lighter shell. */
|
|
37
|
+
let inspectorShell = AppShell;
|
|
36
38
|
const workspace = createWorkspace();
|
|
37
39
|
let inspectorSession = null;
|
|
38
40
|
let rendererBootstrapHandle = null;
|
|
@@ -56,10 +58,7 @@ function onKeydown(e) {
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
function onKeyup(e) {
|
|
59
|
-
// Release only a keyboard-started peek so a button-held preview survives
|
|
60
|
-
// unrelated Backslash keyups (e.g. the panel-toggle shortcuts pressed
|
|
61
|
-
// mid-hold). A guarded keydown never sets the flag, so this stays a no-op
|
|
62
|
-
// for keyups without a matching hold.
|
|
61
|
+
// Release only a keyboard-started peek so a button-held preview survives unrelated Backslash keyups.
|
|
63
62
|
if (e.code === "Backslash" && keyboardPeekHeld) {
|
|
64
63
|
keyboardPeekHeld = false;
|
|
65
64
|
setOriginalPreviewActive(false);
|
|
@@ -88,7 +87,8 @@ function disposeInspectorSession() {
|
|
|
88
87
|
inspectorSession = null;
|
|
89
88
|
session?.dispose();
|
|
90
89
|
}
|
|
91
|
-
export function bootstrapNudgeUi(inspectorHost) {
|
|
90
|
+
export function bootstrapNudgeUi(inspectorHost, shell = AppShell) {
|
|
91
|
+
inspectorShell = shell;
|
|
92
92
|
controllerStartId += 1;
|
|
93
93
|
const runtimeConfig = getNudgeUiRuntimeConfig();
|
|
94
94
|
const explicitDemo = isDemoRuntime();
|
|
@@ -97,16 +97,13 @@ export function bootstrapNudgeUi(inspectorHost) {
|
|
|
97
97
|
if (explicitDemo) {
|
|
98
98
|
rendererBootstrapHandle?.teardown();
|
|
99
99
|
rendererBootstrapHandle = null;
|
|
100
|
-
//
|
|
101
|
-
// for its own document. The bundle mode name alone must never flip it,
|
|
102
|
-
// so every build without both opt-ins stays governed by ADR-0002.
|
|
100
|
+
// Only the configured demo runtime may open the shared dev gate; the bundle mode name alone must not.
|
|
103
101
|
setNudgeUiHostDevFlag(true);
|
|
104
102
|
if (runtimeConfig.capabilities.canvas && isCanvasRenderer()) {
|
|
105
103
|
rendererBootstrapHandle = bootstrapRenderer() ?? null;
|
|
106
104
|
return;
|
|
107
105
|
}
|
|
108
|
-
// The public demo shares the iframe editor
|
|
109
|
-
// persistence, and agent bridge disabled.
|
|
106
|
+
// The public demo shares the iframe editor without the write lease, persistence, or agent bridge.
|
|
110
107
|
setCanvasMode("canvas");
|
|
111
108
|
workspaceController?.dispose();
|
|
112
109
|
workspaceController = startWorkspaceController();
|
|
@@ -115,8 +112,7 @@ export function bootstrapNudgeUi(inspectorHost) {
|
|
|
115
112
|
return;
|
|
116
113
|
}
|
|
117
114
|
if (!runtimeConfig.capabilities.canvas) {
|
|
118
|
-
//
|
|
119
|
-
// Clear any stale in-memory mode before mounting the static inspector.
|
|
115
|
+
// Clear a stale in-memory Canvas mode when the runtime does not expose Canvas.
|
|
120
116
|
setCanvasMode("inspect");
|
|
121
117
|
}
|
|
122
118
|
rendererBootstrapHandle?.teardown();
|
|
@@ -141,8 +137,7 @@ async function startController(inspectorHost) {
|
|
|
141
137
|
mountLockedNotice(inspectorHost);
|
|
142
138
|
return;
|
|
143
139
|
}
|
|
144
|
-
//
|
|
145
|
-
// Refresh on remount as well as explicit takeover, before hydration writes.
|
|
140
|
+
// Refresh ownership before hydration writes so the previous tab cannot save after this snapshot.
|
|
146
141
|
try {
|
|
147
142
|
const storage = inspectorStorage();
|
|
148
143
|
if (storage?.refresh)
|
|
@@ -185,8 +180,7 @@ async function startController(inspectorHost) {
|
|
|
185
180
|
}
|
|
186
181
|
}
|
|
187
182
|
if (getNudgeUiRuntimeConfig().capabilities.canvas) {
|
|
188
|
-
//
|
|
189
|
-
// first so this mode change cannot discard cards, camera, or edits.
|
|
183
|
+
// Hydration runs first so switching to Canvas mode cannot discard cards, camera, or edits.
|
|
190
184
|
setCanvasMode("canvas");
|
|
191
185
|
}
|
|
192
186
|
mountInspector(inspectorHost);
|
|
@@ -252,7 +246,7 @@ export function mountInspector(host) {
|
|
|
252
246
|
inspectorSession.registerCleanup(subscribeCanvasRendererMessages(({ frame, message }) => {
|
|
253
247
|
onRendererKeyboardShortcut(message, frame.identity);
|
|
254
248
|
}));
|
|
255
|
-
reactRoot.render(createElement(InspectorSessionProvider, { inspector: inspectorSession, documentSession: null }, createElement(
|
|
249
|
+
reactRoot.render(createElement(InspectorSessionProvider, { inspector: inspectorSession, documentSession: null }, createElement(inspectorShell)));
|
|
256
250
|
window.addEventListener("keydown", onKeydown);
|
|
257
251
|
window.addEventListener("keyup", onKeyup);
|
|
258
252
|
}
|
|
@@ -282,9 +276,7 @@ export function unmountInspector() {
|
|
|
282
276
|
disposeInspectorSession();
|
|
283
277
|
}
|
|
284
278
|
finally {
|
|
285
|
-
//
|
|
286
|
-
// session exists; release directly as well so projection applied outside
|
|
287
|
-
// a session (gestures, workspace projection) cannot leak across unmount.
|
|
279
|
+
// Release directly too, so projection applied outside a session cannot leak across unmount.
|
|
288
280
|
disposeRuntimeIdentityClaims(document);
|
|
289
281
|
releaseDocumentProjection(document);
|
|
290
282
|
clearClipboardHandoff();
|
|
@@ -5,7 +5,7 @@ export interface ActivityAttribution {
|
|
|
5
5
|
files: readonly ActivityFile[];
|
|
6
6
|
elements: readonly Element[];
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
8
|
+
/** Matches rendered source identities; iteration provenance cannot target application source. */
|
|
9
9
|
export declare function attributeActivity(content: FrameContent, document: Document, files: readonly ActivityFile[]): ActivityAttribution;
|
|
10
10
|
export declare function AgentActivityOverlay({ cardId, content, iframe }: {
|
|
11
11
|
cardId: string;
|
|
@@ -9,7 +9,7 @@ import { parseDataSrc } from "../selection/resolveSelection.js";
|
|
|
9
9
|
import { targetKey } from "../drafts/model.js";
|
|
10
10
|
import { contentEditTarget } from "./frameContent.js";
|
|
11
11
|
import { InspectorStyle } from "../ui/InspectorStyle.js";
|
|
12
|
-
/**
|
|
12
|
+
/** Matches rendered source identities; iteration provenance cannot target application source. */
|
|
13
13
|
export function attributeActivity(content, document, files) {
|
|
14
14
|
const target = contentEditTarget(content);
|
|
15
15
|
if (target.kind === "html")
|
|
@@ -94,8 +94,7 @@ export function CanvasCard({ card, presentation = "canvas", presentationCard = t
|
|
|
94
94
|
const frameDocument = iframeRef.current?.contentDocument;
|
|
95
95
|
if (!documentOwner || !frameDocument)
|
|
96
96
|
return;
|
|
97
|
-
// The initial blank document is discarded by navigation
|
|
98
|
-
// can make its Window inaccessible before cleanup runs.
|
|
97
|
+
// The initial about:blank document is discarded by navigation; a blocked frame's Window may be inaccessible.
|
|
99
98
|
if (frameDocument.URL === "about:blank")
|
|
100
99
|
return;
|
|
101
100
|
if (documentSessionRef.current?.document === frameDocument)
|
|
@@ -130,8 +129,7 @@ export function CanvasCard({ card, presentation = "canvas", presentationCard = t
|
|
|
130
129
|
let reloadPending = false;
|
|
131
130
|
const timer = window.setInterval(() => {
|
|
132
131
|
const workspace = getDraftContentsForCard(card.id);
|
|
133
|
-
// Pending inspector edits still project over preview.html
|
|
134
|
-
// that base until they have been saved and handed off.
|
|
132
|
+
// Pending inspector edits still project over preview.html; do not replace that base until they are saved.
|
|
135
133
|
if (checking || isInlineTextEditingActive() || workspace?.changes.length || workspace?.structuralChanges.length)
|
|
136
134
|
return;
|
|
137
135
|
checking = true;
|
|
@@ -206,8 +204,7 @@ export function CanvasCard({ card, presentation = "canvas", presentationCard = t
|
|
|
206
204
|
return subscribeCanvasRendererMessages(({ frame, message: data }) => {
|
|
207
205
|
if (frame.cardId !== card.id)
|
|
208
206
|
return;
|
|
209
|
-
// A renderer
|
|
210
|
-
// asks for the identity announcement it may have missed.
|
|
207
|
+
// A renderer that booted after the iframe load event asks for the identity announcement it missed.
|
|
211
208
|
if (data.type === "renderer-hello") {
|
|
212
209
|
sendParentReady();
|
|
213
210
|
return;
|
|
@@ -254,9 +251,7 @@ export function CanvasCard({ card, presentation = "canvas", presentationCard = t
|
|
|
254
251
|
}, 15000);
|
|
255
252
|
return () => clearTimeout(timeout);
|
|
256
253
|
}, [loadState]);
|
|
257
|
-
// A late handshake still recovers: the message listener stays installed in
|
|
258
|
-
// the error state, so a slow renderer's eventual frame-ready flips the card
|
|
259
|
-
// back to "ready" without user action.
|
|
254
|
+
// A late handshake still recovers: the message listener stays installed in the error state.
|
|
260
255
|
useEffect(() => {
|
|
261
256
|
const iframe = iframeRef.current;
|
|
262
257
|
if (!iframe)
|
|
@@ -265,8 +260,7 @@ export function CanvasCard({ card, presentation = "canvas", presentationCard = t
|
|
|
265
260
|
if (getSelectedCardId() === card.id)
|
|
266
261
|
setSelectedElement(null);
|
|
267
262
|
disposeDocumentSession();
|
|
268
|
-
// A reload creates a new renderer document;
|
|
269
|
-
// produced by the old frame while its replacement is handshaking.
|
|
263
|
+
// A reload creates a new renderer document; drop the old frame's diagnostics while it handshakes.
|
|
270
264
|
invalidateCanvasPreviewDocument(card.id);
|
|
271
265
|
clearCanvasStructuralProjectionReports(card.id);
|
|
272
266
|
clearCanvasRenderedInstanceProjectionReports(card.id);
|
|
@@ -461,9 +455,8 @@ export function CanvasCard({ card, presentation = "canvas", presentationCard = t
|
|
|
461
455
|
top: isFocusPresentationCard ? 0 : card.y,
|
|
462
456
|
width: isFocusPresentationCard ? "100%" : card.width,
|
|
463
457
|
height: isFocusPresentationCard ? "100%" : card.height,
|
|
464
|
-
}, onPointerDown: presentation === "canvas" ? handleCardPointerDown : undefined, children: [presentation === "canvas" ? _jsx(_Fragment, { children: _jsxs("div", { className: "canvas-card__header", style: { bottom: "100%", minHeight: `calc(var(--control-height-large) * ${toolbarScale})` }, children: [_jsxs("div", { className: "canvas-card__drag-surface", style: { minHeight: `calc(var(--control-height-large) * ${toolbarScale})` }, "data-test": `canvas-card-drag-${card.id}`, onPointerDown: handleToolbarPointerDown, children: [_jsx("div", { className: "canvas-card__identity", style: { zoom: toolbarScale }, children: _jsxs("span", { className: "canvas-card__dimensions", "data-test": `canvas-card-dimensions-${card.id}`, children: [!iterationId(card.content) ? (_jsx(Tooltip, { content: "Live view", children: _jsx("span", { className: "canvas-card__live-badge", "aria-label": "Live view", "data-test": `canvas-card-live-${card.id}`, children: _jsx(IconBoltFilled, { size: 12, "aria-hidden": "true" }) }) })) : (_jsx(Tooltip, { content: "HTML only", children: _jsx("span", { className: "canvas-card__iteration-badge", "aria-label": "HTML only", "data-test": `canvas-card-iteration-badge-${card.id}`, children: _jsx(IconArtboard, { size: 14, "aria-hidden": "true" }) }) })), _jsx("span", { className: "canvas-card__title", children: frameLabel })] }) }), iterationError ? _jsx("span", { className: "canvas-card__iteration-error", role: "status", children: iterationError }) : null] }), _jsx("div", { className: "canvas-card__floating-toolbar", "data-busy": creatingIteration ? "true" : undefined, onPointerDown: (event) => event.stopPropagation(), children: _jsxs("div", { className: "canvas-toolbar canvas-card__actions", style: { zoom: toolbarScale }, role: "toolbar", "aria-label": "Frame actions", "aria-busy": creatingIteration, "data-test": `canvas-card-actions-${card.id}`, children: [onShowFocus ? (_jsx(Tooltip, { content: "Open this frame in focus view", children: _jsxs(Button, { variant: "quiet", size: "default", "data-test": `canvas-card-focus-${card.id}`, onClick: () => onShowFocus(card.id), children: [_jsx(IconCornerLeftDown, { size: "var(--icon-size-small)", stroke: "var(--icon-stroke-width)", "aria-hidden": "true" }), "Focus"] }) })) : null, onDuplicate && !iterationId(card.content) ? (_jsx(Tooltip, { content: "Create a linked copy of this frame", children: _jsxs(Button, { variant: "quiet", size: "default", "data-test": `canvas-card-duplicate-${card.id}`, onClick: () => onDuplicate(card.id), children: [_jsx(IconCopy, { size: "var(--icon-size-small)", stroke: "var(--icon-stroke-width)", "aria-hidden": "true" }), "Duplicate"] }) })) : null, onCreateIteration ? (_jsx(Tooltip, { content: "Unlinked HTML version", stableTrigger: true, children: _jsxs(Button, { variant: "quiet", size: "default", "data-test": `canvas-card-create-iteration-${card.id}`, disabled: creatingIteration || loadState !== "ready", onClick: () => void handleIteration(), children: [_jsx(IconArtboard, { size: "var(--icon-size-small)", stroke: "var(--icon-stroke-width)", "aria-hidden": "true" }), creatingIteration ? "Creating…" : "Iteration"] }) })) : null, _jsx("div", { className: "canvas-toolbar__divider", "aria-hidden": "true" }), _jsx(Tooltip, { content: canRemove ? "Delete frame" : "Keep at least one frame on the canvas", children: _jsx(IconButton, { variant: "quiet", size: "default", label: "Delete frame", "data-test": `canvas-card-delete-${card.id}`, disabled: !canRemove, onClick: handleRemove, children: _jsx(IconTrash, { size: "var(--icon-size-small)", stroke: "var(--icon-stroke-width)", "aria-hidden": "true" }) }) })] }) })] }) }) : null, _jsxs("div", { className: "canvas-card__frame", children: [loadState === "loading" ? (_jsx("div", { className: "canvas-card__loading", "data-test": `canvas-card-loading-${card.id}`, children: "Loading preview..." })) : loadState === "error" ? (_jsxs("div", { className: "canvas-card__error", "data-test": `canvas-card-error-${card.id}`, children: [_jsx("p", { children: errorMessage || "Frame could not be loaded" }), _jsxs("div", { className: "canvas-card__error-actions", children: [_jsx(Button, { size: "compact", variant: "secondary", onClick: handleReload, children: "Retry" }), _jsx(Button, { size: "compact", variant: "danger", onClick: handleRemove, children: "Remove" })] })] })) : null, _jsx("iframe", { ref: iframeRef, className: "canvas-card__iframe", src: card.content.kind === "iteration" ? contentDocumentUrl(card.content) : initialUrlRef.current, title: frameLabel, [CANVAS_RENDERER_ATTR]: "", sandbox: "allow-scripts allow-same-origin allow-forms allow-popups", "data-test": `canvas-card-iframe-${card.id}` }, iterationId(card.content) ?? "live"), _jsx(AgentActivityOverlay, { cardId: card.id, content: card.content, iframe: loadState === "ready" ? iframeRef.current : null }), _jsx(SketchFrameOverlay, { cardId: card.id, iframe: iframeRef.current, cardUrl: contentSourceUrl(card.content), artifactId: iterationId(card.content), ready: loadState === "ready" })] }), presentation === "canvas" ? RESIZE_HANDLES.map((handle) => (_jsx("div", { className: `canvas-card__resize-handle canvas-card__resize-handle--${handle.direction}`, "data-test": `canvas-card-resize-${card.id}${handle.direction === "bottom-right" ? "" : `-${handle.direction}`}`, "data-resize-direction": handle.direction, style: {
|
|
465
|
-
//
|
|
466
|
-
// the thickness needs inverse scaling to remain screen-sized.
|
|
458
|
+
}, onPointerDown: presentation === "canvas" ? handleCardPointerDown : undefined, children: [presentation === "canvas" ? _jsx(_Fragment, { children: _jsxs("div", { className: "canvas-card__header", style: { bottom: "100%", minHeight: `calc(var(--control-height-large) * ${toolbarScale})` }, children: [_jsxs("div", { className: "canvas-card__drag-surface", style: { minHeight: `calc(var(--control-height-large) * ${toolbarScale})` }, "data-test": `canvas-card-drag-${card.id}`, onPointerDown: handleToolbarPointerDown, children: [_jsx("div", { className: "canvas-card__identity", style: { zoom: toolbarScale }, children: _jsxs("span", { className: "canvas-card__dimensions", "data-test": `canvas-card-dimensions-${card.id}`, children: [!iterationId(card.content) ? (_jsx(Tooltip, { content: "Live view", children: _jsx("span", { className: "canvas-card__live-badge", "aria-label": "Live view", "data-test": `canvas-card-live-${card.id}`, children: _jsx(IconBoltFilled, { size: 12, "aria-hidden": "true" }) }) })) : (_jsx(Tooltip, { content: "HTML only", children: _jsx("span", { className: "canvas-card__iteration-badge", "aria-label": "HTML only", "data-test": `canvas-card-iteration-badge-${card.id}`, children: _jsx(IconArtboard, { size: 14, "aria-hidden": "true" }) }) })), _jsx("span", { className: "canvas-card__title", children: frameLabel })] }) }), iterationError ? _jsx("span", { className: "canvas-card__iteration-error", role: "status", children: iterationError }) : null] }), _jsx("div", { className: "canvas-card__floating-toolbar", "data-busy": creatingIteration ? "true" : undefined, onPointerDown: (event) => event.stopPropagation(), children: _jsxs("div", { className: "canvas-toolbar canvas-card__actions", style: { zoom: toolbarScale }, role: "toolbar", "aria-label": "Frame actions", "aria-busy": creatingIteration, "data-test": `canvas-card-actions-${card.id}`, children: [onShowFocus ? (_jsx(Tooltip, { content: "Open this frame in focus view", children: _jsxs(Button, { variant: "quiet", size: "default", "data-test": `canvas-card-focus-${card.id}`, onClick: () => onShowFocus(card.id), children: [_jsx(IconCornerLeftDown, { size: "var(--icon-size-small)", stroke: "var(--icon-stroke-width)", "aria-hidden": "true" }), "Focus"] }) })) : null, onDuplicate && !iterationId(card.content) ? (_jsx(Tooltip, { content: "Create a linked copy of this frame", children: _jsxs(Button, { variant: "quiet", size: "default", "data-test": `canvas-card-duplicate-${card.id}`, onClick: () => onDuplicate(card.id), children: [_jsx(IconCopy, { size: "var(--icon-size-small)", stroke: "var(--icon-stroke-width)", "aria-hidden": "true" }), "Duplicate"] }) })) : null, onCreateIteration ? (_jsx(Tooltip, { content: "Unlinked HTML version", stableTrigger: true, children: _jsxs(Button, { variant: "quiet", size: "default", "data-test": `canvas-card-create-iteration-${card.id}`, disabled: creatingIteration || loadState !== "ready", onClick: () => void handleIteration(), children: [_jsx(IconArtboard, { size: "var(--icon-size-small)", stroke: "var(--icon-stroke-width)", "aria-hidden": "true" }), creatingIteration ? "Creating…" : "Iteration"] }) })) : null, _jsx("div", { className: "canvas-toolbar__divider", "aria-hidden": "true" }), _jsx(Tooltip, { content: canRemove ? "Delete frame" : "Keep at least one frame on the canvas", children: _jsx(IconButton, { variant: "quiet", size: "default", label: "Delete frame", "data-test": `canvas-card-delete-${card.id}`, disabled: !canRemove, onClick: handleRemove, children: _jsx(IconTrash, { size: "var(--icon-size-small)", stroke: "var(--icon-stroke-width)", "aria-hidden": "true" }) }) })] }) })] }) }) : null, _jsxs("div", { className: "canvas-card__frame", children: [loadState === "loading" ? (_jsx("div", { className: "canvas-card__loading", "data-test": `canvas-card-loading-${card.id}`, children: "Loading preview..." })) : loadState === "error" ? (_jsxs("div", { className: "canvas-card__error", "data-test": `canvas-card-error-${card.id}`, children: [_jsx("p", { children: errorMessage || "Frame could not be loaded" }), _jsxs("div", { className: "canvas-card__error-actions", children: [_jsx(Button, { size: "compact", variant: "secondary", onClick: handleReload, children: "Retry" }), _jsx(Button, { size: "compact", variant: "danger", onClick: handleRemove, children: "Remove" })] })] })) : null, _jsx("iframe", { ref: iframeRef, className: "canvas-card__iframe", src: card.content.kind === "iteration" ? contentDocumentUrl(card.content) : initialUrlRef.current, title: frameLabel, [CANVAS_RENDERER_ATTR]: "", sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox", "data-test": `canvas-card-iframe-${card.id}` }, iterationId(card.content) ?? "live"), _jsx(AgentActivityOverlay, { cardId: card.id, content: card.content, iframe: loadState === "ready" ? iframeRef.current : null }), _jsx(SketchFrameOverlay, { cardId: card.id, iframe: iframeRef.current, cardUrl: contentSourceUrl(card.content), artifactId: iterationId(card.content), ready: loadState === "ready" })] }), presentation === "canvas" ? RESIZE_HANDLES.map((handle) => (_jsx("div", { className: `canvas-card__resize-handle canvas-card__resize-handle--${handle.direction}`, "data-test": `canvas-card-resize-${card.id}${handle.direction === "bottom-right" ? "" : `-${handle.direction}`}`, "data-resize-direction": handle.direction, style: {
|
|
459
|
+
// The edge's long axis follows the zoomed card; only its thickness is inverse-scaled.
|
|
467
460
|
transform: resizeHandleTransform(handle.direction, resizeHandleScale),
|
|
468
461
|
transformOrigin: handle.transformOrigin,
|
|
469
462
|
cursor: handle.cursor,
|