nudge-ui 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -0
- package/bin/nudge-ui.mjs +7 -0
- package/dist/LICENSE +21 -0
- package/dist/client.mjs +261 -0
- package/dist/compiler/ast.d.ts +18 -0
- package/dist/compiler/ast.js +75 -0
- package/dist/compiler/componentContractTypes.d.ts +19 -0
- package/dist/compiler/componentContractTypes.js +1 -0
- package/dist/compiler/componentContracts.d.ts +2 -0
- package/dist/compiler/componentContracts.js +260 -0
- package/dist/compiler/componentInstrumentation.d.ts +32 -0
- package/dist/compiler/componentInstrumentation.js +140 -0
- package/dist/compiler/componentPolicyResolution.d.ts +71 -0
- package/dist/compiler/componentPolicyResolution.js +388 -0
- package/dist/compiler/index.d.ts +9 -0
- package/dist/compiler/index.js +9 -0
- package/dist/compiler/packageComponentContracts.d.ts +32 -0
- package/dist/compiler/packageComponentContracts.js +308 -0
- package/dist/compiler/reactComponentProtocols.d.ts +145 -0
- package/dist/compiler/reactComponentProtocols.js +47 -0
- package/dist/compiler/reactIdentity.d.ts +15 -0
- package/dist/compiler/reactIdentity.js +339 -0
- package/dist/compiler/sourcePaths.d.ts +12 -0
- package/dist/compiler/sourcePaths.js +27 -0
- package/dist/css/dialects/index.d.ts +62 -0
- package/dist/css/dialects/index.js +103 -0
- package/dist/css/dialects/tailwind.d.ts +46 -0
- package/dist/css/dialects/tailwind.js +119 -0
- package/dist/css/dialects/vanillaExtract.d.ts +20 -0
- package/dist/css/dialects/vanillaExtract.js +32 -0
- package/dist/css/index.d.ts +10 -0
- package/dist/css/index.js +10 -0
- package/dist/css/model/index.d.ts +190 -0
- package/dist/css/model/index.js +10 -0
- package/dist/css/token-inventory/index.d.ts +26 -0
- package/dist/css/token-inventory/index.js +24 -0
- package/dist/css/token-inventory/inventory.d.ts +8 -0
- package/dist/css/token-inventory/inventory.js +421 -0
- package/dist/css/token-inventory/parseStylesheet.d.ts +16 -0
- package/dist/css/token-inventory/parseStylesheet.js +155 -0
- package/dist/css/token-inventory/policy.d.ts +47 -0
- package/dist/css/token-inventory/policy.js +50 -0
- package/dist/css/token-inventory/types.d.ts +97 -0
- package/dist/css/token-inventory/types.js +1 -0
- package/dist/css/value-semantics/borderSemantics.d.ts +28 -0
- package/dist/css/value-semantics/borderSemantics.js +91 -0
- package/dist/css/value-semantics/boxSemantics.d.ts +37 -0
- package/dist/css/value-semantics/boxSemantics.js +71 -0
- package/dist/css/value-semantics/colorSemantics.d.ts +99 -0
- package/dist/css/value-semantics/colorSemantics.js +526 -0
- package/dist/css/value-semantics/cssSyntax.d.ts +19 -0
- package/dist/css/value-semantics/cssSyntax.js +111 -0
- package/dist/css/value-semantics/fontSemantics.d.ts +35 -0
- package/dist/css/value-semantics/fontSemantics.js +131 -0
- package/dist/css/value-semantics/index.d.ts +20 -0
- package/dist/css/value-semantics/index.js +15 -0
- package/dist/css/value-semantics/propertyPolicy.d.ts +118 -0
- package/dist/css/value-semantics/propertyPolicy.js +356 -0
- package/dist/css/value-semantics/stringMaps.d.ts +2 -0
- package/dist/css/value-semantics/stringMaps.js +1 -0
- package/dist/css/value-semantics/structuredValues.d.ts +64 -0
- package/dist/css/value-semantics/structuredValues.js +250 -0
- package/dist/css/value-semantics/tokenInterpretation.d.ts +90 -0
- package/dist/css/value-semantics/tokenInterpretation.js +193 -0
- package/dist/css/virtual-design-tokens.d.ts +17 -0
- package/dist/hosts/astro/astroRuntimeConfig.d.ts +12 -0
- package/dist/hosts/astro/astroRuntimeConfig.js +26 -0
- package/dist/hosts/astro/clientAsset.d.ts +12 -0
- package/dist/hosts/astro/clientAsset.js +51 -0
- package/dist/hosts/astro/clientTransport.d.ts +3 -0
- package/dist/hosts/astro/clientTransport.js +57 -0
- package/dist/hosts/astro/index.d.ts +3 -0
- package/dist/hosts/astro/index.js +2 -0
- package/dist/hosts/astro/integration.d.ts +35 -0
- package/dist/hosts/astro/integration.js +96 -0
- package/dist/hosts/astro/middleware.d.ts +13 -0
- package/dist/hosts/astro/middleware.js +22 -0
- package/dist/hosts/astro/projectContext.d.ts +11 -0
- package/dist/hosts/astro/projectContext.js +34 -0
- package/dist/hosts/astro/responseInstrumentation.d.ts +41 -0
- package/dist/hosts/astro/responseInstrumentation.js +80 -0
- package/dist/hosts/next/index.d.ts +4 -0
- package/dist/hosts/next/index.js +7 -0
- package/dist/hosts/next/loader.d.ts +66 -0
- package/dist/hosts/next/loader.js +346 -0
- package/dist/hosts/next/loaders/identity-loader.cjs +228257 -0
- package/dist/hosts/next/loaders/loader-plugin.cjs +228257 -0
- package/dist/hosts/next/manifest.d.ts +38 -0
- package/dist/hosts/next/manifest.js +30 -0
- package/dist/hosts/next/mount.d.ts +12 -0
- package/dist/hosts/next/mount.js +23 -0
- package/dist/hosts/next/repositoryScope.d.ts +20 -0
- package/dist/hosts/next/repositoryScope.js +33 -0
- package/dist/hosts/next/sidecar.d.ts +27 -0
- package/dist/hosts/next/sidecar.js +526 -0
- package/dist/hosts/next/wrapper.d.ts +67 -0
- package/dist/hosts/next/wrapper.js +310 -0
- package/dist/hosts/static/cli.d.ts +12 -0
- package/dist/hosts/static/cli.js +77 -0
- package/dist/hosts/static/html/bootstrap.d.ts +27 -0
- package/dist/hosts/static/html/bootstrap.js +93 -0
- package/dist/hosts/static/index.d.ts +4 -0
- package/dist/hosts/static/index.js +4 -0
- package/dist/hosts/static/manifest.d.ts +18 -0
- package/dist/hosts/static/manifest.js +51 -0
- package/dist/hosts/static/server.d.ts +72 -0
- package/dist/hosts/static/server.js +554 -0
- package/dist/hosts/vite/index.d.ts +20 -0
- package/dist/hosts/vite/index.js +48 -0
- package/dist/hosts/vite/react.d.ts +67 -0
- package/dist/hosts/vite/react.js +231 -0
- package/dist/hosts/vite/tokens/activeStylesheets.d.ts +28 -0
- package/dist/hosts/vite/tokens/activeStylesheets.js +70 -0
- package/dist/hosts/vite/tokens/fileMap.d.ts +2 -0
- package/dist/hosts/vite/tokens/fileMap.js +1 -0
- package/dist/hosts/vite/tokens/viteStylesheetArtifacts.d.ts +46 -0
- package/dist/hosts/vite/tokens/viteStylesheetArtifacts.js +104 -0
- package/dist/hosts/vite/virtual/design-tokens.d.ts +9 -0
- package/dist/hosts/vite/virtual/design-tokens.js +7 -0
- package/dist/hosts/vite/virtual-design-tokens.d.ts +1 -0
- package/dist/hosts/vite/vite.d.ts +62 -0
- package/dist/hosts/vite/vite.js +854 -0
- package/dist/html/dom.d.ts +13 -0
- package/dist/html/dom.js +46 -0
- package/dist/html/identity.d.ts +40 -0
- package/dist/html/identity.js +196 -0
- package/dist/html/insertions.d.ts +26 -0
- package/dist/html/insertions.js +59 -0
- package/dist/inspector/agent/McpConnectionDialog.d.ts +26 -0
- package/dist/inspector/agent/McpConnectionDialog.js +135 -0
- package/dist/inspector/agent/client.d.ts +98 -0
- package/dist/inspector/agent/client.js +728 -0
- package/dist/inspector/agent/connectionStatus.d.ts +13 -0
- package/dist/inspector/agent/connectionStatus.js +35 -0
- package/dist/inspector/agent/httpTransport.d.ts +21 -0
- package/dist/inspector/agent/httpTransport.js +347 -0
- package/dist/inspector/agent/protocol.d.ts +95 -0
- package/dist/inspector/agent/protocol.js +9 -0
- package/dist/inspector/agent/verification.d.ts +39 -0
- package/dist/inspector/agent/verification.js +207 -0
- package/dist/inspector/canvas/CanvasCard.d.ts +10 -0
- package/dist/inspector/canvas/CanvasCard.js +275 -0
- package/dist/inspector/canvas/CanvasElementOverlay.d.ts +2 -0
- package/dist/inspector/canvas/CanvasElementOverlay.js +301 -0
- package/dist/inspector/canvas/CanvasWorkspace.d.ts +2 -0
- package/dist/inspector/canvas/CanvasWorkspace.js +301 -0
- package/dist/inspector/canvas/LockedWorkspaceNotice.d.ts +6 -0
- package/dist/inspector/canvas/LockedWorkspaceNotice.js +17 -0
- package/dist/inspector/canvas/StaleChangeIndicator.d.ts +7 -0
- package/dist/inspector/canvas/StaleChangeIndicator.js +43 -0
- package/dist/inspector/canvas/agentPresentation.d.ts +87 -0
- package/dist/inspector/canvas/agentPresentation.js +421 -0
- package/dist/inspector/canvas/canvasGestures.d.ts +12 -0
- package/dist/inspector/canvas/canvasGestures.js +21 -0
- package/dist/inspector/canvas/canvasStore.d.ts +108 -0
- package/dist/inspector/canvas/canvasStore.js +448 -0
- package/dist/inspector/canvas/frameProtocol.d.ts +231 -0
- package/dist/inspector/canvas/frameProtocol.js +165 -0
- package/dist/inspector/canvas/linkEligibility.d.ts +8 -0
- package/dist/inspector/canvas/linkEligibility.js +68 -0
- package/dist/inspector/canvas/measurementProjection.d.ts +8 -0
- package/dist/inspector/canvas/measurementProjection.js +16 -0
- package/dist/inspector/canvas/normalizeUrl.d.ts +7 -0
- package/dist/inspector/canvas/normalizeUrl.js +27 -0
- package/dist/inspector/canvas/projection.d.ts +41 -0
- package/dist/inspector/canvas/projection.js +232 -0
- package/dist/inspector/canvas/rendererBootstrap.d.ts +4 -0
- package/dist/inspector/canvas/rendererBootstrap.js +410 -0
- package/dist/inspector/canvas/rendererCidIndex.d.ts +11 -0
- package/dist/inspector/canvas/rendererCidIndex.js +21 -0
- package/dist/inspector/canvas/rendererElementSelector.d.ts +2 -0
- package/dist/inspector/canvas/rendererElementSelector.js +378 -0
- package/dist/inspector/canvas/rendererSelectionProxy.d.ts +2 -0
- package/dist/inspector/canvas/rendererSelectionProxy.js +61 -0
- package/dist/inspector/canvas/rendererStylesheet.d.ts +16 -0
- package/dist/inspector/canvas/rendererStylesheet.js +221 -0
- package/dist/inspector/canvas/resizeHandleScale.d.ts +13 -0
- package/dist/inspector/canvas/resizeHandleScale.js +20 -0
- package/dist/inspector/canvas/roleDetection.d.ts +5 -0
- package/dist/inspector/canvas/roleDetection.js +21 -0
- package/dist/inspector/canvas/sessionStore.d.ts +71 -0
- package/dist/inspector/canvas/sessionStore.js +453 -0
- package/dist/inspector/canvas/staleChangeDetector.d.ts +11 -0
- package/dist/inspector/canvas/staleChangeDetector.js +217 -0
- package/dist/inspector/canvas/toolbarScale.d.ts +7 -0
- package/dist/inspector/canvas/toolbarScale.js +11 -0
- package/dist/inspector/canvas/workspaceLease.d.ts +26 -0
- package/dist/inspector/canvas/workspaceLease.js +214 -0
- package/dist/inspector/changes/changesLog.d.ts +46 -0
- package/dist/inspector/changes/changesLog.js +209 -0
- package/dist/inspector/changes/codecs.d.ts +98 -0
- package/dist/inspector/changes/codecs.js +389 -0
- package/dist/inspector/changes/editModel.d.ts +74 -0
- package/dist/inspector/changes/editModel.js +120 -0
- package/dist/inspector/changes/managedStyleProjection.d.ts +6 -0
- package/dist/inspector/changes/managedStyleProjection.js +109 -0
- package/dist/inspector/changes/model.d.ts +13 -0
- package/dist/inspector/changes/model.js +163 -0
- package/dist/inspector/changes/presentation.d.ts +14 -0
- package/dist/inspector/changes/presentation.js +81 -0
- package/dist/inspector/changes/previewDiagnostics.d.ts +39 -0
- package/dist/inspector/changes/previewDiagnostics.js +172 -0
- package/dist/inspector/changes/structuralTypes.d.ts +35 -0
- package/dist/inspector/changes/structuralTypes.js +1 -0
- package/dist/inspector/changes/types.d.ts +76 -0
- package/dist/inspector/changes/types.js +16 -0
- package/dist/inspector/changes/workspaceChanges.d.ts +43 -0
- package/dist/inspector/changes/workspaceChanges.js +239 -0
- package/dist/inspector/clientManifest.d.ts +24 -0
- package/dist/inspector/clientManifest.js +69 -0
- package/dist/inspector/componentSemantics/ComponentPropsSection.d.ts +5 -0
- package/dist/inspector/componentSemantics/ComponentPropsSection.js +44 -0
- package/dist/inspector/componentSemantics/adapterRegistry.d.ts +11 -0
- package/dist/inspector/componentSemantics/adapterRegistry.js +75 -0
- package/dist/inspector/componentSemantics/boundaries.d.ts +2 -0
- package/dist/inspector/componentSemantics/boundaries.js +10 -0
- package/dist/inspector/componentSemantics/changeAction.d.ts +3 -0
- package/dist/inspector/componentSemantics/changeAction.js +6 -0
- package/dist/inspector/componentSemantics/changeModel.d.ts +8 -0
- package/dist/inspector/componentSemantics/changeModel.js +60 -0
- package/dist/inspector/componentSemantics/index.d.ts +4 -0
- package/dist/inspector/componentSemantics/index.js +2 -0
- package/dist/inspector/componentSemantics/reactRuntime.d.ts +10 -0
- package/dist/inspector/componentSemantics/reactRuntime.js +186 -0
- package/dist/inspector/componentSemantics/runtimeBridge.d.ts +25 -0
- package/dist/inspector/componentSemantics/runtimeBridge.js +161 -0
- package/dist/inspector/componentSemantics/runtimeTypes.d.ts +2 -0
- package/dist/inspector/componentSemantics/runtimeTypes.js +1 -0
- package/dist/inspector/componentSemantics/textBinding.d.ts +69 -0
- package/dist/inspector/componentSemantics/textBinding.js +514 -0
- package/dist/inspector/componentSemantics/types.d.ts +96 -0
- package/dist/inspector/componentSemantics/types.js +5 -0
- package/dist/inspector/conformance/borderCases.d.ts +7 -0
- package/dist/inspector/conformance/borderCases.js +428 -0
- package/dist/inspector/conformance/colorCases.d.ts +8 -0
- package/dist/inspector/conformance/colorCases.js +470 -0
- package/dist/inspector/conformance/fixture.d.ts +68 -0
- package/dist/inspector/conformance/fixture.js +153 -0
- package/dist/inspector/conformance/projection.d.ts +2 -0
- package/dist/inspector/conformance/projection.js +3 -0
- package/dist/inspector/conformance/spacingCases.d.ts +6 -0
- package/dist/inspector/conformance/spacingCases.js +417 -0
- package/dist/inspector/conformance/typographyCases.d.ts +7 -0
- package/dist/inspector/conformance/typographyCases.js +174 -0
- package/dist/inspector/editScope.d.ts +4 -0
- package/dist/inspector/editScope.js +5 -0
- package/dist/inspector/index.d.ts +20 -0
- package/dist/inspector/index.js +236 -0
- package/dist/inspector/inline-text/inlineTextEditor.d.ts +74 -0
- package/dist/inspector/inline-text/inlineTextEditor.js +1207 -0
- package/dist/inspector/inline-text/inlineTextLifecycle.d.ts +2 -0
- package/dist/inspector/inline-text/inlineTextLifecycle.js +17 -0
- package/dist/inspector/inline-text/textChangeBoundary.d.ts +6 -0
- package/dist/inspector/inline-text/textChangeBoundary.js +1 -0
- package/dist/inspector/inspection/bridge.d.ts +72 -0
- package/dist/inspector/inspection/bridge.js +134 -0
- package/dist/inspector/inspection/browserCssInspection.d.ts +74 -0
- package/dist/inspector/inspection/browserCssInspection.js +317 -0
- package/dist/inspector/inspection/browserCssInspectionRegistry.d.ts +12 -0
- package/dist/inspector/inspection/browserCssInspectionRegistry.js +66 -0
- package/dist/inspector/inspection/selectionProperty.d.ts +32 -0
- package/dist/inspector/inspection/selectionProperty.js +33 -0
- package/dist/inspector/inspection/useBrowserCssInspection.d.ts +20 -0
- package/dist/inspector/inspection/useBrowserCssInspection.js +159 -0
- package/dist/inspector/overlay/DropGuideOverlay.d.ts +17 -0
- package/dist/inspector/overlay/DropGuideOverlay.js +17 -0
- package/dist/inspector/overlay/InspectorOverlay.d.ts +5 -0
- package/dist/inspector/overlay/InspectorOverlay.js +328 -0
- package/dist/inspector/overlay/MeasurementGuideOverlay.d.ts +19 -0
- package/dist/inspector/overlay/MeasurementGuideOverlay.js +40 -0
- package/dist/inspector/overlay/clickPolicy.d.ts +7 -0
- package/dist/inspector/overlay/clickPolicy.js +13 -0
- package/dist/inspector/overlay/dropGuide.d.ts +22 -0
- package/dist/inspector/overlay/dropGuide.js +48 -0
- package/dist/inspector/overlay/elementSelector.d.ts +1 -0
- package/dist/inspector/overlay/elementSelector.js +100 -0
- package/dist/inspector/overlay/frameThrottle.d.ts +10 -0
- package/dist/inspector/overlay/frameThrottle.js +38 -0
- package/dist/inspector/overlay/interactionStyles.d.ts +3 -0
- package/dist/inspector/overlay/interactionStyles.js +70 -0
- package/dist/inspector/overlay/measurementGeometry.d.ts +25 -0
- package/dist/inspector/overlay/measurementGeometry.js +104 -0
- package/dist/inspector/overlay/overlayGeometry.d.ts +40 -0
- package/dist/inspector/overlay/overlayGeometry.js +59 -0
- package/dist/inspector/overlay/selectedGeometry.d.ts +7 -0
- package/dist/inspector/overlay/selectedGeometry.js +51 -0
- package/dist/inspector/overlay/structuralGestures.d.ts +28 -0
- package/dist/inspector/overlay/structuralGestures.js +180 -0
- package/dist/inspector/projection/cssEscapes.d.ts +3 -0
- package/dist/inspector/projection/cssEscapes.js +20 -0
- package/dist/inspector/projection/managedStylesheet.d.ts +33 -0
- package/dist/inspector/projection/managedStylesheet.js +240 -0
- package/dist/inspector/projection/renderedInstance.d.ts +56 -0
- package/dist/inspector/projection/renderedInstance.js +306 -0
- package/dist/inspector/projection/structuralProjection.d.ts +93 -0
- package/dist/inspector/projection/structuralProjection.js +560 -0
- package/dist/inspector/projection/structuralProjectionBoundary.d.ts +5 -0
- package/dist/inspector/projection/structuralProjectionBoundary.js +65 -0
- package/dist/inspector/projection/textProjection.d.ts +53 -0
- package/dist/inspector/projection/textProjection.js +705 -0
- package/dist/inspector/projection/workspaceProjection.d.ts +43 -0
- package/dist/inspector/projection/workspaceProjection.js +58 -0
- package/dist/inspector/prompt/PromptSettingsDialog.d.ts +15 -0
- package/dist/inspector/prompt/PromptSettingsDialog.js +17 -0
- package/dist/inspector/prompt/clipboardHandoff.d.ts +34 -0
- package/dist/inspector/prompt/clipboardHandoff.js +212 -0
- package/dist/inspector/prompt/copyToClipboard.d.ts +1 -0
- package/dist/inspector/prompt/copyToClipboard.js +34 -0
- package/dist/inspector/prompt/detectFramework.d.ts +6 -0
- package/dist/inspector/prompt/detectFramework.js +4 -0
- package/dist/inspector/prompt/generatePrompt.d.ts +7 -0
- package/dist/inspector/prompt/generatePrompt.js +391 -0
- package/dist/inspector/prompt/promptSettings.d.ts +8 -0
- package/dist/inspector/prompt/promptSettings.js +28 -0
- package/dist/inspector/runtime/devFlag.d.ts +28 -0
- package/dist/inspector/runtime/devFlag.js +50 -0
- package/dist/inspector/runtime/documentStylesheetOrder.d.ts +19 -0
- package/dist/inspector/runtime/documentStylesheetOrder.js +89 -0
- package/dist/inspector/runtime/domRealm.d.ts +4 -0
- package/dist/inspector/runtime/domRealm.js +11 -0
- package/dist/inspector/runtime/runtimeConfig.d.ts +119 -0
- package/dist/inspector/runtime/runtimeConfig.js +276 -0
- package/dist/inspector/runtime/staticHtmlRuntimeIdentity.d.ts +32 -0
- package/dist/inspector/runtime/staticHtmlRuntimeIdentity.js +149 -0
- package/dist/inspector/runtime/useRuntimeConfig.d.ts +10 -0
- package/dist/inspector/runtime/useRuntimeConfig.js +13 -0
- package/dist/inspector/selection/editScope.d.ts +32 -0
- package/dist/inspector/selection/editScope.js +140 -0
- package/dist/inspector/selection/editTarget.d.ts +8 -0
- package/dist/inspector/selection/editTarget.js +11 -0
- package/dist/inspector/selection/hierarchy.d.ts +7 -0
- package/dist/inspector/selection/hierarchy.js +42 -0
- package/dist/inspector/selection/resolveSelection.d.ts +10 -0
- package/dist/inspector/selection/resolveSelection.js +60 -0
- package/dist/inspector/selection/selectionStore.d.ts +41 -0
- package/dist/inspector/selection/selectionStore.js +262 -0
- package/dist/inspector/selection/selectionTarget.d.ts +5 -0
- package/dist/inspector/selection/selectionTarget.js +50 -0
- package/dist/inspector/selection/sourceSite.d.ts +2 -0
- package/dist/inspector/selection/sourceSite.js +12 -0
- package/dist/inspector/selection/styleSelection.d.ts +22 -0
- package/dist/inspector/selection/styleSelection.js +104 -0
- package/dist/inspector/session/index.d.ts +3 -0
- package/dist/inspector/session/index.js +2 -0
- package/dist/inspector/session/lifecycle.d.ts +22 -0
- package/dist/inspector/session/lifecycle.js +63 -0
- package/dist/inspector/session/sessionContext.d.ts +21 -0
- package/dist/inspector/session/sessionContext.js +28 -0
- package/dist/inspector/session/sessionFactory.d.ts +29 -0
- package/dist/inspector/session/sessionFactory.js +73 -0
- package/dist/inspector/settings/SettingsDialog.d.ts +12 -0
- package/dist/inspector/settings/SettingsDialog.js +46 -0
- package/dist/inspector/shell/AppShell.d.ts +2 -0
- package/dist/inspector/shell/AppShell.js +9 -0
- package/dist/inspector/shell/ChangesLog.d.ts +6 -0
- package/dist/inspector/shell/ChangesLog.js +92 -0
- package/dist/inspector/shell/CopyPromptButton.d.ts +9 -0
- package/dist/inspector/shell/CopyPromptButton.js +159 -0
- package/dist/inspector/shell/DomNavigation.d.ts +8 -0
- package/dist/inspector/shell/DomNavigation.js +30 -0
- package/dist/inspector/shell/EmptyState.d.ts +2 -0
- package/dist/inspector/shell/EmptyState.js +15 -0
- package/dist/inspector/shell/InspectorShell.d.ts +11 -0
- package/dist/inspector/shell/InspectorShell.js +268 -0
- package/dist/inspector/shell/openStore.d.ts +6 -0
- package/dist/inspector/shell/openStore.js +29 -0
- package/dist/inspector/shell/panelLayout.d.ts +2 -0
- package/dist/inspector/shell/panelLayout.js +29 -0
- package/dist/inspector/shell/shortcuts.d.ts +3 -0
- package/dist/inspector/shell/shortcuts.js +25 -0
- package/dist/inspector/shell/stateValue.d.ts +3 -0
- package/dist/inspector/shell/stateValue.js +34 -0
- package/dist/inspector/shell/styleState.d.ts +7 -0
- package/dist/inspector/shell/styleState.js +13 -0
- package/dist/inspector/spacing/projection.d.ts +43 -0
- package/dist/inspector/spacing/projection.js +136 -0
- package/dist/inspector/styleEditors/AppearanceSection.d.ts +13 -0
- package/dist/inspector/styleEditors/AppearanceSection.js +6 -0
- package/dist/inspector/styleEditors/AspectRatioField.d.ts +17 -0
- package/dist/inspector/styleEditors/AspectRatioField.js +10 -0
- package/dist/inspector/styleEditors/BorderEditor.d.ts +13 -0
- package/dist/inspector/styleEditors/BorderEditor.js +295 -0
- package/dist/inspector/styleEditors/BorderRadiusEditor.d.ts +14 -0
- package/dist/inspector/styleEditors/BorderRadiusEditor.js +108 -0
- package/dist/inspector/styleEditors/BoxShadowEditor.d.ts +13 -0
- package/dist/inspector/styleEditors/BoxShadowEditor.js +13 -0
- package/dist/inspector/styleEditors/ColorPicker.d.ts +15 -0
- package/dist/inspector/styleEditors/ColorPicker.js +73 -0
- package/dist/inspector/styleEditors/GapField.d.ts +17 -0
- package/dist/inspector/styleEditors/GapField.js +12 -0
- package/dist/inspector/styleEditors/GridChildSection.d.ts +14 -0
- package/dist/inspector/styleEditors/GridChildSection.js +91 -0
- package/dist/inspector/styleEditors/GridPicker.d.ts +13 -0
- package/dist/inspector/styleEditors/GridPicker.js +179 -0
- package/dist/inspector/styleEditors/GridSection.d.ts +17 -0
- package/dist/inspector/styleEditors/GridSection.js +27 -0
- package/dist/inspector/styleEditors/GridValueField.d.ts +17 -0
- package/dist/inspector/styleEditors/GridValueField.js +70 -0
- package/dist/inspector/styleEditors/InsetSection.d.ts +15 -0
- package/dist/inspector/styleEditors/InsetSection.js +15 -0
- package/dist/inspector/styleEditors/LayoutBlockedIndicator.d.ts +6 -0
- package/dist/inspector/styleEditors/LayoutBlockedIndicator.js +6 -0
- package/dist/inspector/styleEditors/LayoutComboField.d.ts +18 -0
- package/dist/inspector/styleEditors/LayoutComboField.js +138 -0
- package/dist/inspector/styleEditors/LayoutDropdown.d.ts +14 -0
- package/dist/inspector/styleEditors/LayoutDropdown.js +34 -0
- package/dist/inspector/styleEditors/LayoutSection.d.ts +13 -0
- package/dist/inspector/styleEditors/LayoutSection.js +342 -0
- package/dist/inspector/styleEditors/OpacityEditor.d.ts +13 -0
- package/dist/inspector/styleEditors/OpacityEditor.js +34 -0
- package/dist/inspector/styleEditors/PositionInsets.d.ts +15 -0
- package/dist/inspector/styleEditors/PositionInsets.js +12 -0
- package/dist/inspector/styleEditors/SpacingBox.d.ts +29 -0
- package/dist/inspector/styleEditors/SpacingBox.js +189 -0
- package/dist/inspector/styleEditors/Typography.d.ts +13 -0
- package/dist/inspector/styleEditors/Typography.js +137 -0
- package/dist/inspector/styleEditors/completeCssValue.d.ts +8 -0
- package/dist/inspector/styleEditors/completeCssValue.js +34 -0
- package/dist/inspector/styleEditors/gridChildModel.d.ts +74 -0
- package/dist/inspector/styleEditors/gridChildModel.js +138 -0
- package/dist/inspector/styleEditors/layoutValue.d.ts +24 -0
- package/dist/inspector/styleEditors/layoutValue.js +103 -0
- package/dist/inspector/styleEditors/nudgeValue.d.ts +8 -0
- package/dist/inspector/styleEditors/nudgeValue.js +71 -0
- package/dist/inspector/styleEditors/rowLookup.d.ts +11 -0
- package/dist/inspector/styleEditors/rowLookup.js +13 -0
- package/dist/inspector/styleEditors/stringRecord.d.ts +4 -0
- package/dist/inspector/styleEditors/stringRecord.js +1 -0
- package/dist/inspector/styleEditors/valuePolicy.d.ts +20 -0
- package/dist/inspector/styleEditors/valuePolicy.js +82 -0
- package/dist/inspector/testing.d.ts +10 -0
- package/dist/inspector/testing.js +9 -0
- package/dist/inspector/tokens/TokenChip.d.ts +24 -0
- package/dist/inspector/tokens/TokenChip.js +23 -0
- package/dist/inspector/tokens/TokenDropdown.d.ts +13 -0
- package/dist/inspector/tokens/TokenDropdown.js +59 -0
- package/dist/inspector/tokens/TokenField.d.ts +68 -0
- package/dist/inspector/tokens/TokenField.js +485 -0
- package/dist/inspector/tokens/TokenLabel.d.ts +7 -0
- package/dist/inspector/tokens/TokenLabel.js +23 -0
- package/dist/inspector/tokens/TokensPanel.d.ts +5 -0
- package/dist/inspector/tokens/TokensPanel.js +47 -0
- package/dist/inspector/tokens/catalog.d.ts +51 -0
- package/dist/inspector/tokens/catalog.js +184 -0
- package/dist/inspector/tokens/editActions.d.ts +35 -0
- package/dist/inspector/tokens/editActions.js +164 -0
- package/dist/inspector/tokens/resolution/cascade.d.ts +14 -0
- package/dist/inspector/tokens/resolution/cascade.js +31 -0
- package/dist/inspector/tokens/resolution/cssomCollector.d.ts +43 -0
- package/dist/inspector/tokens/resolution/cssomCollector.js +528 -0
- package/dist/inspector/tokens/resolution/selectorSemantics.d.ts +12 -0
- package/dist/inspector/tokens/resolution/selectorSemantics.js +106 -0
- package/dist/inspector/tokens/resolution.d.ts +56 -0
- package/dist/inspector/tokens/resolution.js +1401 -0
- package/dist/inspector/tokens/tokenEdits.d.ts +3 -0
- package/dist/inspector/tokens/tokenEdits.js +22 -0
- package/dist/inspector/tokens/valueSemanticsAdapter.d.ts +6 -0
- package/dist/inspector/tokens/valueSemanticsAdapter.js +68 -0
- package/dist/inspector/ui/AtRuleContext.d.ts +18 -0
- package/dist/inspector/ui/AtRuleContext.js +54 -0
- package/dist/inspector/ui/Button.d.ts +9 -0
- package/dist/inspector/ui/Button.js +4 -0
- package/dist/inspector/ui/ColorSwatch.d.ts +7 -0
- package/dist/inspector/ui/ColorSwatch.js +6 -0
- package/dist/inspector/ui/ControlSurface.d.ts +14 -0
- package/dist/inspector/ui/ControlSurface.js +10 -0
- package/dist/inspector/ui/FieldRow.d.ts +14 -0
- package/dist/inspector/ui/FieldRow.js +15 -0
- package/dist/inspector/ui/IconButton.d.ts +14 -0
- package/dist/inspector/ui/IconButton.js +5 -0
- package/dist/inspector/ui/InspectorPopover.d.ts +17 -0
- package/dist/inspector/ui/InspectorPopover.js +13 -0
- package/dist/inspector/ui/PopoverListbox.d.ts +37 -0
- package/dist/inspector/ui/PopoverListbox.js +21 -0
- package/dist/inspector/ui/SegmentedControl.d.ts +24 -0
- package/dist/inspector/ui/SegmentedControl.js +16 -0
- package/dist/inspector/ui/Select.d.ts +25 -0
- package/dist/inspector/ui/Select.js +56 -0
- package/dist/inspector/ui/SideValuesField.d.ts +44 -0
- package/dist/inspector/ui/SideValuesField.js +76 -0
- package/dist/inspector/ui/StatusCallout.d.ts +9 -0
- package/dist/inspector/ui/StatusCallout.js +4 -0
- package/dist/inspector/ui/TextInput.d.ts +12 -0
- package/dist/inspector/ui/TextInput.js +5 -0
- package/dist/inspector/ui/ToggleButton.d.ts +11 -0
- package/dist/inspector/ui/ToggleButton.js +6 -0
- package/dist/inspector/ui/assets/grid.svg +14 -0
- package/dist/inspector/ui/css.d.ts +9 -0
- package/dist/inspector/ui/labels.d.ts +1 -0
- package/dist/inspector/ui/labels.js +7 -0
- package/dist/inspector/ui/styles.d.ts +1 -0
- package/dist/inspector/ui/styles.js +68 -0
- package/dist/inspector/virtual-modules.d.ts +7 -0
- package/dist/inspector/vite-env.d.ts +10 -0
- package/dist/internal/agent-protocol.d.ts +232 -0
- package/dist/internal/agent-protocol.js +237 -0
- package/dist/nudge-ui.mjs +15722 -0
- package/dist/project/files.d.ts +19 -0
- package/dist/project/files.js +226 -0
- package/dist/project/identity.d.ts +6 -0
- package/dist/project/identity.js +19 -0
- package/dist/project/pathPolicy.d.ts +8 -0
- package/dist/project/pathPolicy.js +12 -0
- package/dist/project/tokens.d.ts +36 -0
- package/dist/project/tokens.js +223 -0
- package/dist/transport/index.d.ts +8 -0
- package/dist/transport/index.js +8 -0
- package/dist/transport/routes.d.ts +13 -0
- package/dist/transport/routes.js +16 -0
- package/package.json +137 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import type { ComponentOverride } from "../componentSemantics/types.js";
|
|
2
|
+
import type { RenderedInstanceOverride } from "../changes/editModel.js";
|
|
3
|
+
export declare const PROTOCOL_VERSION = 15;
|
|
4
|
+
export interface FrameMessage {
|
|
5
|
+
type: string;
|
|
6
|
+
protocolVersion: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Pre-identity solicitation from a renderer whose bootstrap finished after
|
|
10
|
+
* the controller's load-time parent-ready (or whose document never received
|
|
11
|
+
* one). Carries no FrameIdentity: the whole point is that the renderer does
|
|
12
|
+
* not have one yet. The controller answers with ParentReadyMessage.
|
|
13
|
+
*/
|
|
14
|
+
export interface RendererHelloMessage extends FrameMessage {
|
|
15
|
+
type: "renderer-hello";
|
|
16
|
+
}
|
|
17
|
+
export interface FrameIdentity {
|
|
18
|
+
projectId: string;
|
|
19
|
+
workspaceId: string;
|
|
20
|
+
cardId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ParentReadyMessage extends FrameMessage {
|
|
23
|
+
type: "parent-ready";
|
|
24
|
+
projectId: string;
|
|
25
|
+
workspaceId: string;
|
|
26
|
+
cardId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RendererMessage extends FrameMessage, FrameIdentity {
|
|
29
|
+
}
|
|
30
|
+
export interface FrameReadyMessage extends RendererMessage {
|
|
31
|
+
type: "frame-ready";
|
|
32
|
+
url: string;
|
|
33
|
+
title: string;
|
|
34
|
+
}
|
|
35
|
+
export interface FrameMetadataMessage extends RendererMessage {
|
|
36
|
+
type: "frame-metadata";
|
|
37
|
+
url?: string;
|
|
38
|
+
title?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface FrameLoadError extends RendererMessage {
|
|
41
|
+
type: "frame-error";
|
|
42
|
+
message: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ReplaceStylesMessage extends FrameMessage {
|
|
45
|
+
type: "replace-styles";
|
|
46
|
+
projectId: string;
|
|
47
|
+
workspaceId: string;
|
|
48
|
+
cardId: string;
|
|
49
|
+
css: string;
|
|
50
|
+
revision: number;
|
|
51
|
+
/** Controller-owned durable targets; the renderer derives local markers. */
|
|
52
|
+
instanceOverrides: RenderedInstanceOverride[];
|
|
53
|
+
/** Controller-owned structural intent; renderers never own this change log. */
|
|
54
|
+
structuralChanges: import("../projection/structuralProjection.js").StructuralChange[];
|
|
55
|
+
/** Controller-owned durable rendered text intent. */
|
|
56
|
+
textContentChanges: import("../changes/types.js").TextContentChangeRecord[];
|
|
57
|
+
/** Controller-owned semantic component overrides for Canvas runtimes. */
|
|
58
|
+
componentOverrides: ComponentOverride[];
|
|
59
|
+
}
|
|
60
|
+
/** Renderer acknowledgement that one complete controller snapshot is applied. */
|
|
61
|
+
export interface ProjectionAppliedMessage extends RendererMessage {
|
|
62
|
+
type: "projection-applied";
|
|
63
|
+
revision: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Renderer-local outcomes for one controller snapshot. This is diagnostic
|
|
67
|
+
* data only: accepting it never changes controller-owned structural intent.
|
|
68
|
+
*/
|
|
69
|
+
export interface StructuralProjectionReportMessage extends RendererMessage {
|
|
70
|
+
type: "structural-projection-report";
|
|
71
|
+
revision: number;
|
|
72
|
+
reports: import("../projection/structuralProjection.js").StructuralProjectionReport[];
|
|
73
|
+
}
|
|
74
|
+
/** Renderer-local CSS-instance outcomes for one controller snapshot. */
|
|
75
|
+
export interface RenderedInstanceProjectionReportMessage extends RendererMessage {
|
|
76
|
+
type: "rendered-instance-projection-report";
|
|
77
|
+
revision: number;
|
|
78
|
+
reports: import("../projection/renderedInstance.js").DocumentProjectionReport[];
|
|
79
|
+
}
|
|
80
|
+
/** Renderer-local outcomes for one controller-owned text snapshot. */
|
|
81
|
+
export interface TextProjectionReportMessage extends RendererMessage {
|
|
82
|
+
type: "text-projection-report";
|
|
83
|
+
revision: number;
|
|
84
|
+
reports: import("../projection/textProjection.js").TextProjectionReport[];
|
|
85
|
+
}
|
|
86
|
+
export interface NavigationIntentMessage extends RendererMessage {
|
|
87
|
+
type: "navigation-intent";
|
|
88
|
+
url: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ElementHoverMessage extends RendererMessage {
|
|
91
|
+
type: "element-hover";
|
|
92
|
+
cid: string;
|
|
93
|
+
selector: string;
|
|
94
|
+
src: string;
|
|
95
|
+
elementId: string;
|
|
96
|
+
rect: {
|
|
97
|
+
left: number;
|
|
98
|
+
top: number;
|
|
99
|
+
width: number;
|
|
100
|
+
height: number;
|
|
101
|
+
} | null;
|
|
102
|
+
margins: {
|
|
103
|
+
top: number;
|
|
104
|
+
right: number;
|
|
105
|
+
bottom: number;
|
|
106
|
+
left: number;
|
|
107
|
+
} | null;
|
|
108
|
+
borders: {
|
|
109
|
+
top: number;
|
|
110
|
+
right: number;
|
|
111
|
+
bottom: number;
|
|
112
|
+
left: number;
|
|
113
|
+
} | null;
|
|
114
|
+
}
|
|
115
|
+
/** Modifier state stays inside one renderer frame; the parent never infers it
|
|
116
|
+
* from its own keyboard events because focus lives in the iframe. */
|
|
117
|
+
export interface ElementMeasureStateMessage extends RendererMessage {
|
|
118
|
+
type: "element-measure-state";
|
|
119
|
+
altKey: boolean;
|
|
120
|
+
pointerOverPage: boolean;
|
|
121
|
+
}
|
|
122
|
+
export interface ElementClickMessage extends RendererMessage {
|
|
123
|
+
type: "element-click";
|
|
124
|
+
cid: string;
|
|
125
|
+
selector: string;
|
|
126
|
+
src: string;
|
|
127
|
+
elementId: string;
|
|
128
|
+
file: string;
|
|
129
|
+
line: number;
|
|
130
|
+
component: string;
|
|
131
|
+
/** True for a Shift-click that toggles this target in the selection group. */
|
|
132
|
+
additive?: boolean;
|
|
133
|
+
}
|
|
134
|
+
/** Renderer request to clear the controller-owned element selection. */
|
|
135
|
+
export interface ElementDeselectMessage extends RendererMessage {
|
|
136
|
+
type: "element-deselect";
|
|
137
|
+
}
|
|
138
|
+
export interface ElementDragStartMessage extends RendererMessage {
|
|
139
|
+
type: "element-drag-start";
|
|
140
|
+
cid: string;
|
|
141
|
+
src: string;
|
|
142
|
+
elementId: string;
|
|
143
|
+
point: {
|
|
144
|
+
x: number;
|
|
145
|
+
y: number;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export interface ElementDragMoveMessage extends RendererMessage {
|
|
149
|
+
type: "element-drag-move";
|
|
150
|
+
point: {
|
|
151
|
+
x: number;
|
|
152
|
+
y: number;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
export interface ElementDragEndMessage extends RendererMessage {
|
|
156
|
+
type: "element-drag-end";
|
|
157
|
+
point: {
|
|
158
|
+
x: number;
|
|
159
|
+
y: number;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export interface ElementDeleteMessage extends RendererMessage {
|
|
163
|
+
type: "element-delete";
|
|
164
|
+
cid: string;
|
|
165
|
+
src: string;
|
|
166
|
+
elementId: string;
|
|
167
|
+
}
|
|
168
|
+
export interface ElementNudgeMessage extends RendererMessage {
|
|
169
|
+
type: "element-nudge";
|
|
170
|
+
cid: string;
|
|
171
|
+
src: string;
|
|
172
|
+
elementId: string;
|
|
173
|
+
key: "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight";
|
|
174
|
+
}
|
|
175
|
+
/** A renderer may request history navigation; only the parent changes history. */
|
|
176
|
+
export interface HistoryRequestMessage extends RendererMessage {
|
|
177
|
+
type: "history-request";
|
|
178
|
+
action: "undo" | "redo";
|
|
179
|
+
}
|
|
180
|
+
export interface ExternalNavigationMessage extends RendererMessage {
|
|
181
|
+
type: "external-navigation";
|
|
182
|
+
url: string;
|
|
183
|
+
}
|
|
184
|
+
export interface PanStartMessage extends RendererMessage {
|
|
185
|
+
type: "pan-start";
|
|
186
|
+
point: {
|
|
187
|
+
x: number;
|
|
188
|
+
y: number;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
export interface PanMoveMessage extends RendererMessage {
|
|
192
|
+
type: "pan-move";
|
|
193
|
+
point: {
|
|
194
|
+
x: number;
|
|
195
|
+
y: number;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
export interface PanEndMessage extends RendererMessage {
|
|
199
|
+
type: "pan-end";
|
|
200
|
+
}
|
|
201
|
+
/** Keeps iframe pointer handling in sync when Space is held in the controller. */
|
|
202
|
+
export interface PanModifierMessage extends RendererMessage {
|
|
203
|
+
type: "pan-modifier";
|
|
204
|
+
spaceHeld: boolean;
|
|
205
|
+
}
|
|
206
|
+
/** Proxies modified wheel gestures that originate inside an iframe card. */
|
|
207
|
+
export interface ZoomMessage extends RendererMessage {
|
|
208
|
+
type: "zoom";
|
|
209
|
+
deltaY: number;
|
|
210
|
+
point: {
|
|
211
|
+
x: number;
|
|
212
|
+
y: number;
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
export type FrameProtocolMessage = ParentReadyMessage | RendererHelloMessage | FrameReadyMessage | FrameMetadataMessage | FrameLoadError | ReplaceStylesMessage | ProjectionAppliedMessage | StructuralProjectionReportMessage | RenderedInstanceProjectionReportMessage | TextProjectionReportMessage | NavigationIntentMessage | ElementHoverMessage | ElementMeasureStateMessage | ElementClickMessage | ElementDeselectMessage | ElementDragStartMessage | ElementDragMoveMessage | ElementDragEndMessage | ElementDeleteMessage | ElementNudgeMessage | HistoryRequestMessage | ExternalNavigationMessage | PanStartMessage | PanMoveMessage | PanEndMessage | PanModifierMessage | ZoomMessage;
|
|
216
|
+
export declare function setRendererIdentity(identity: FrameIdentity): void;
|
|
217
|
+
export declare function clearRendererIdentity(expected?: FrameIdentity): void;
|
|
218
|
+
export declare function getRendererIdentity(): FrameIdentity | null;
|
|
219
|
+
export declare function isRendererMessageFor(value: unknown, identity: FrameIdentity): value is RendererMessage;
|
|
220
|
+
/** Strict JSON-only schema for selecting an element from a renderer frame. */
|
|
221
|
+
export declare function isElementClickMessage(value: unknown, identity: FrameIdentity): value is ElementClickMessage;
|
|
222
|
+
/** Strict JSON-only schema for renderer diagnostics before the parent records them. */
|
|
223
|
+
export declare function isStructuralProjectionReportMessage(value: unknown, identity: FrameIdentity): value is StructuralProjectionReportMessage;
|
|
224
|
+
/** Strict JSON-only schema for renderer CSS-instance diagnostics. */
|
|
225
|
+
export declare function isRenderedInstanceProjectionReportMessage(value: unknown, identity: FrameIdentity): value is RenderedInstanceProjectionReportMessage;
|
|
226
|
+
/** Strict JSON-only schema for renderer rendered-text diagnostics. */
|
|
227
|
+
export declare function isTextProjectionReportMessage(value: unknown, identity: FrameIdentity): value is TextProjectionReportMessage;
|
|
228
|
+
/** Strict JSON-only acknowledgement for a fully applied Canvas snapshot. */
|
|
229
|
+
export declare function isProjectionAppliedMessage(value: unknown, identity: FrameIdentity): value is ProjectionAppliedMessage;
|
|
230
|
+
export declare function isComponentOverrideList(value: unknown): value is ComponentOverride[];
|
|
231
|
+
export declare function sendToParent(msg: FrameProtocolMessage): void;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { isDocumentProjectionReport } from "../projection/renderedInstance.js";
|
|
2
|
+
import { isTextProjectionReport } from "../projection/textProjection.js";
|
|
3
|
+
import { isStructuralProjectionReport } from "../projection/structuralProjectionBoundary.js";
|
|
4
|
+
// v15 adds renderer-to-controller element deselection for Canvas frames. v14
|
|
5
|
+
// adds border widths to hover geometry so containment measurements can exclude
|
|
6
|
+
// the container border. v13 adds source-parent-aware structural moves and
|
|
7
|
+
// bounded structural failure reasons to the full projection snapshot. v12
|
|
8
|
+
// added the projection-applied acknowledgement: the controller can avoid
|
|
9
|
+
// rereading a Canvas iframe until the renderer has applied its revision. v11
|
|
10
|
+
// added the renderer-hello handshake solicitation for runtimes whose boot
|
|
11
|
+
// completes after the controller's load-time parent-ready.
|
|
12
|
+
export const PROTOCOL_VERSION = 15;
|
|
13
|
+
let rendererIdentity = null;
|
|
14
|
+
export function setRendererIdentity(identity) {
|
|
15
|
+
rendererIdentity = identity;
|
|
16
|
+
}
|
|
17
|
+
export function clearRendererIdentity(expected) {
|
|
18
|
+
if (expected === undefined || rendererIdentity === expected)
|
|
19
|
+
rendererIdentity = null;
|
|
20
|
+
}
|
|
21
|
+
export function getRendererIdentity() {
|
|
22
|
+
return rendererIdentity;
|
|
23
|
+
}
|
|
24
|
+
export function isRendererMessageFor(value, identity) {
|
|
25
|
+
if (!value || typeof value !== "object")
|
|
26
|
+
return false;
|
|
27
|
+
const message = value;
|
|
28
|
+
return message.protocolVersion === PROTOCOL_VERSION
|
|
29
|
+
&& message.projectId === identity.projectId
|
|
30
|
+
&& message.workspaceId === identity.workspaceId
|
|
31
|
+
&& message.cardId === identity.cardId;
|
|
32
|
+
}
|
|
33
|
+
/** Strict JSON-only schema for selecting an element from a renderer frame. */
|
|
34
|
+
export function isElementClickMessage(value, identity) {
|
|
35
|
+
if (!isRendererMessageFor(value, identity) || !isProtocolObject(value))
|
|
36
|
+
return false;
|
|
37
|
+
if (!hasOnlyKeys(value, [
|
|
38
|
+
"type", "protocolVersion", "projectId", "workspaceId", "cardId",
|
|
39
|
+
"cid", "selector", "src", "elementId", "file", "line", "component", "additive",
|
|
40
|
+
]))
|
|
41
|
+
return false;
|
|
42
|
+
const line = ownValue(value, "line");
|
|
43
|
+
const additive = ownValue(value, "additive");
|
|
44
|
+
return ownValue(value, "type") === "element-click"
|
|
45
|
+
&& typeof ownValue(value, "cid") === "string"
|
|
46
|
+
&& typeof ownValue(value, "selector") === "string"
|
|
47
|
+
&& typeof ownValue(value, "src") === "string"
|
|
48
|
+
&& typeof ownValue(value, "elementId") === "string"
|
|
49
|
+
&& typeof ownValue(value, "file") === "string"
|
|
50
|
+
&& typeof line === "number" && Number.isSafeInteger(line) && line >= 0
|
|
51
|
+
&& typeof ownValue(value, "component") === "string"
|
|
52
|
+
&& (additive === undefined || typeof additive === "boolean");
|
|
53
|
+
}
|
|
54
|
+
/** Strict JSON-only schema for renderer diagnostics before the parent records them. */
|
|
55
|
+
export function isStructuralProjectionReportMessage(value, identity) {
|
|
56
|
+
if (!isRendererMessageFor(value, identity) || !value || typeof value !== "object")
|
|
57
|
+
return false;
|
|
58
|
+
const message = value;
|
|
59
|
+
if (!hasOnlyKeys(message, [
|
|
60
|
+
"type", "protocolVersion", "projectId", "workspaceId", "cardId", "revision", "reports",
|
|
61
|
+
]))
|
|
62
|
+
return false;
|
|
63
|
+
return message.type === "structural-projection-report"
|
|
64
|
+
&& Number.isSafeInteger(message.revision)
|
|
65
|
+
&& message.revision >= 0
|
|
66
|
+
&& Array.isArray(message.reports)
|
|
67
|
+
&& message.reports.every(isStructuralProjectionReport);
|
|
68
|
+
}
|
|
69
|
+
/** Strict JSON-only schema for renderer CSS-instance diagnostics. */
|
|
70
|
+
export function isRenderedInstanceProjectionReportMessage(value, identity) {
|
|
71
|
+
if (!isRendererMessageFor(value, identity) || !value || typeof value !== "object")
|
|
72
|
+
return false;
|
|
73
|
+
const message = value;
|
|
74
|
+
if (!hasOnlyKeys(message, [
|
|
75
|
+
"type", "protocolVersion", "projectId", "workspaceId", "cardId", "revision", "reports",
|
|
76
|
+
]))
|
|
77
|
+
return false;
|
|
78
|
+
return message.type === "rendered-instance-projection-report"
|
|
79
|
+
&& Number.isSafeInteger(message.revision)
|
|
80
|
+
&& message.revision >= 0
|
|
81
|
+
&& Array.isArray(message.reports)
|
|
82
|
+
&& message.reports.every(isDocumentProjectionReport);
|
|
83
|
+
}
|
|
84
|
+
/** Strict JSON-only schema for renderer rendered-text diagnostics. */
|
|
85
|
+
export function isTextProjectionReportMessage(value, identity) {
|
|
86
|
+
if (!isRendererMessageFor(value, identity) || !isProtocolObject(value))
|
|
87
|
+
return false;
|
|
88
|
+
if (!hasOnlyKeys(value, [
|
|
89
|
+
"type", "protocolVersion", "projectId", "workspaceId", "cardId", "revision", "reports",
|
|
90
|
+
]))
|
|
91
|
+
return false;
|
|
92
|
+
const type = ownValue(value, "type");
|
|
93
|
+
const revision = ownValue(value, "revision");
|
|
94
|
+
const reports = ownValue(value, "reports");
|
|
95
|
+
return type === "text-projection-report"
|
|
96
|
+
&& typeof revision === "number" && Number.isSafeInteger(revision) && revision >= 0
|
|
97
|
+
&& Array.isArray(reports)
|
|
98
|
+
&& reports.every(isTextProjectionReport);
|
|
99
|
+
}
|
|
100
|
+
/** Strict JSON-only acknowledgement for a fully applied Canvas snapshot. */
|
|
101
|
+
export function isProjectionAppliedMessage(value, identity) {
|
|
102
|
+
if (!isRendererMessageFor(value, identity) || !isProtocolObject(value))
|
|
103
|
+
return false;
|
|
104
|
+
if (!hasOnlyKeys(value, [
|
|
105
|
+
"type", "protocolVersion", "projectId", "workspaceId", "cardId", "revision",
|
|
106
|
+
]))
|
|
107
|
+
return false;
|
|
108
|
+
const type = ownValue(value, "type");
|
|
109
|
+
const revision = ownValue(value, "revision");
|
|
110
|
+
return type === "projection-applied"
|
|
111
|
+
&& typeof revision === "number"
|
|
112
|
+
&& Number.isSafeInteger(revision)
|
|
113
|
+
&& revision >= 0;
|
|
114
|
+
}
|
|
115
|
+
export function isComponentOverrideList(value) {
|
|
116
|
+
if (!Array.isArray(value))
|
|
117
|
+
return false;
|
|
118
|
+
return value.every((candidate) => {
|
|
119
|
+
if (!isProtocolObject(candidate)
|
|
120
|
+
|| !hasOnlyKeys(candidate, ["framework", "callsiteId", "prop", "value"]))
|
|
121
|
+
return false;
|
|
122
|
+
const framework = ownValue(candidate, "framework");
|
|
123
|
+
const callsiteId = ownValue(candidate, "callsiteId");
|
|
124
|
+
const prop = ownValue(candidate, "prop");
|
|
125
|
+
const overrideValue = ownValue(candidate, "value");
|
|
126
|
+
return framework === "react"
|
|
127
|
+
&& typeof callsiteId === "string" && callsiteId.length > 0
|
|
128
|
+
&& typeof prop === "string" && prop.length > 0
|
|
129
|
+
&& (typeof overrideValue === "string"
|
|
130
|
+
|| typeof overrideValue === "number" && Number.isFinite(overrideValue)
|
|
131
|
+
|| typeof overrideValue === "boolean");
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function isProtocolObject(value) {
|
|
135
|
+
return typeof value === "object" && value !== null;
|
|
136
|
+
}
|
|
137
|
+
function ownValue(value, key) {
|
|
138
|
+
switch (key) {
|
|
139
|
+
case "additive": return value.additive;
|
|
140
|
+
case "cardId": return value.cardId;
|
|
141
|
+
case "cid": return value.cid;
|
|
142
|
+
case "callsiteId": return value.callsiteId;
|
|
143
|
+
case "framework": return value.framework;
|
|
144
|
+
case "elementId": return value.elementId;
|
|
145
|
+
case "file": return value.file;
|
|
146
|
+
case "line": return value.line;
|
|
147
|
+
case "prop": return value.prop;
|
|
148
|
+
case "projectId": return value.projectId;
|
|
149
|
+
case "protocolVersion": return value.protocolVersion;
|
|
150
|
+
case "reports": return value.reports;
|
|
151
|
+
case "revision": return value.revision;
|
|
152
|
+
case "type": return value.type;
|
|
153
|
+
case "selector": return value.selector;
|
|
154
|
+
case "src": return value.src;
|
|
155
|
+
case "component": return value.component;
|
|
156
|
+
case "value": return value.value;
|
|
157
|
+
case "workspaceId": return value.workspaceId;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function hasOnlyKeys(value, keys) {
|
|
161
|
+
return Object.keys(value).every((key) => keys.includes(key));
|
|
162
|
+
}
|
|
163
|
+
export function sendToParent(msg) {
|
|
164
|
+
window.parent.postMessage(msg, window.location.origin);
|
|
165
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function findClosestAnchor(target: EventTarget | null): HTMLAnchorElement | null;
|
|
2
|
+
export declare function isEligibleNavigation(anchor: HTMLAnchorElement, event: MouseEvent): boolean;
|
|
3
|
+
export declare function hasDifferentRoute(anchor: HTMLAnchorElement): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Returns whether the renderer should leave an anchor's browser behavior
|
|
6
|
+
* intact instead of consuming it as an editing click.
|
|
7
|
+
*/
|
|
8
|
+
export declare function shouldPreserveNativeLinkActivation(anchor: HTMLAnchorElement, event: MouseEvent): boolean;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export function findClosestAnchor(target) {
|
|
2
|
+
if (!(target instanceof Element))
|
|
3
|
+
return null;
|
|
4
|
+
if (target instanceof HTMLAnchorElement)
|
|
5
|
+
return target;
|
|
6
|
+
return target.closest("a");
|
|
7
|
+
}
|
|
8
|
+
export function isEligibleNavigation(anchor, event) {
|
|
9
|
+
if (event.ctrlKey || event.metaKey || event.shiftKey)
|
|
10
|
+
return false;
|
|
11
|
+
if (anchor.hasAttribute("download"))
|
|
12
|
+
return false;
|
|
13
|
+
if (anchor.target && anchor.target !== "" && anchor.target !== "_self")
|
|
14
|
+
return false;
|
|
15
|
+
if (anchor.protocol !== "http:" && anchor.protocol !== "https:")
|
|
16
|
+
return false;
|
|
17
|
+
try {
|
|
18
|
+
const url = new URL(anchor.href);
|
|
19
|
+
if (url.origin !== window.location.origin)
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
export function hasDifferentRoute(anchor) {
|
|
28
|
+
try {
|
|
29
|
+
const url = new URL(anchor.href);
|
|
30
|
+
if (url.pathname !== window.location.pathname)
|
|
31
|
+
return true;
|
|
32
|
+
if (url.search !== window.location.search)
|
|
33
|
+
return true;
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Returns whether the renderer should leave an anchor's browser behavior
|
|
42
|
+
* intact instead of consuming it as an editing click.
|
|
43
|
+
*/
|
|
44
|
+
export function shouldPreserveNativeLinkActivation(anchor, event) {
|
|
45
|
+
// Command/Ctrl-click is the deep-selection gesture. Shift makes it the
|
|
46
|
+
// explicit application-activation gesture instead.
|
|
47
|
+
if (event.metaKey || event.ctrlKey)
|
|
48
|
+
return event.shiftKey;
|
|
49
|
+
// Shift-click is the additive inspector-selection gesture. Do not let a
|
|
50
|
+
// link navigate or preserve its native activation in that mode.
|
|
51
|
+
if (event.shiftKey)
|
|
52
|
+
return false;
|
|
53
|
+
if (anchor.hasAttribute("download"))
|
|
54
|
+
return true;
|
|
55
|
+
if (anchor.target && anchor.target !== "" && anchor.target !== "_self")
|
|
56
|
+
return true;
|
|
57
|
+
if (anchor.protocol !== "http:" && anchor.protocol !== "https:")
|
|
58
|
+
return true;
|
|
59
|
+
try {
|
|
60
|
+
const url = new URL(anchor.href);
|
|
61
|
+
if (url.origin !== window.location.origin)
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return !hasDifferentRoute(anchor);
|
|
68
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MeasurementSegment } from "../overlay/measurementGeometry.js";
|
|
2
|
+
import type { Rect } from "../overlay/overlayGeometry.js";
|
|
3
|
+
/**
|
|
4
|
+
* Maps iframe-local measurement geometry into the Canvas board's screen
|
|
5
|
+
* coordinate system. Distances deliberately remain in local CSS pixels so
|
|
6
|
+
* their labels stay meaningful regardless of the board zoom.
|
|
7
|
+
*/
|
|
8
|
+
export declare function projectMeasurementSegments(iframeRect: Rect, segments: MeasurementSegment[], zoom: number): MeasurementSegment[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps iframe-local measurement geometry into the Canvas board's screen
|
|
3
|
+
* coordinate system. Distances deliberately remain in local CSS pixels so
|
|
4
|
+
* their labels stay meaningful regardless of the board zoom.
|
|
5
|
+
*/
|
|
6
|
+
export function projectMeasurementSegments(iframeRect, segments, zoom) {
|
|
7
|
+
const projectPoint = (point) => ({
|
|
8
|
+
x: iframeRect.left + point.x * zoom,
|
|
9
|
+
y: iframeRect.top + point.y * zoom,
|
|
10
|
+
});
|
|
11
|
+
return segments.map((segment) => ({
|
|
12
|
+
...segment,
|
|
13
|
+
from: projectPoint(segment.from),
|
|
14
|
+
to: projectPoint(segment.to),
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function normalizeUrl(url) {
|
|
2
|
+
try {
|
|
3
|
+
const parsed = new URL(url);
|
|
4
|
+
return {
|
|
5
|
+
origin: parsed.origin,
|
|
6
|
+
pathname: parsed.pathname,
|
|
7
|
+
search: parsed.search,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function normalizedUrlKey(normalized) {
|
|
15
|
+
return `${normalized.origin}${canonicalRoutePath(normalized.pathname)}${normalized.search}`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Directory-index pages resolve to the directory URL: `/` and `/index.html`
|
|
19
|
+
* are one route served from one file on every supported dev server, so card
|
|
20
|
+
* deduplication must treat them as the same key or link discovery spawns a
|
|
21
|
+
* duplicate card for the page already on the board.
|
|
22
|
+
*/
|
|
23
|
+
function canonicalRoutePath(pathname) {
|
|
24
|
+
// "/docs/index.html" becomes the directory form "/docs/"; a bare
|
|
25
|
+
// "/index.html" becomes "/".
|
|
26
|
+
return pathname.replace(/\/index\.html?$/i, "/");
|
|
27
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CanvasCard } from "./canvasStore.js";
|
|
2
|
+
import { type PreviewDocument } from "../changes/previewDiagnostics.js";
|
|
3
|
+
import { type CompiledManagedStyles } from "../projection/workspaceProjection.js";
|
|
4
|
+
export declare const PROJECT_ID: string;
|
|
5
|
+
export declare const WORKSPACE_ID: `${string}-${string}-${string}-${string}-${string}`;
|
|
6
|
+
export interface CanvasProjectionStatus {
|
|
7
|
+
sentRevision: number;
|
|
8
|
+
appliedRevision: number;
|
|
9
|
+
}
|
|
10
|
+
/** Returns the current value-based identity for one Canvas card document. */
|
|
11
|
+
export declare function getCanvasPreviewDocument(cardId: string): PreviewDocument;
|
|
12
|
+
/** Invalidates a card's current document before its iframe is replaced. */
|
|
13
|
+
export declare function invalidateCanvasPreviewDocument(cardId: string): void;
|
|
14
|
+
export declare function computeProjection(): {
|
|
15
|
+
css: string;
|
|
16
|
+
revision: number;
|
|
17
|
+
sourceRevision: number;
|
|
18
|
+
managedStyles: CompiledManagedStyles;
|
|
19
|
+
instanceOverrides: readonly import("../changes/editModel.js").RenderedInstanceOverride[];
|
|
20
|
+
structuralChanges: readonly import("../changes/structuralTypes.js").StructuralChange[];
|
|
21
|
+
textContentChanges: readonly import("../changes/editModel.js").TextContentChangeRecord[];
|
|
22
|
+
componentOverrides: readonly import("../componentSemantics/types.js").ComponentOverride[];
|
|
23
|
+
};
|
|
24
|
+
export declare function resetProjectionRevision(): void;
|
|
25
|
+
export declare function sendProjectionToCard(card: CanvasCard, iframe: HTMLIFrameElement): void;
|
|
26
|
+
export declare function registerCardFrameSource(cardId: string, iframe: HTMLIFrameElement): void;
|
|
27
|
+
export declare function registerCardFrame(cardId: string, iframe: HTMLIFrameElement): void;
|
|
28
|
+
export declare function unregisterCardFrame(cardId: string): void;
|
|
29
|
+
export declare function getRegisteredFrames(): ReadonlyMap<string, HTMLIFrameElement>;
|
|
30
|
+
export declare function findCanvasFrameBySource(source: MessageEventSource | null): {
|
|
31
|
+
cardId: string;
|
|
32
|
+
iframe: HTMLIFrameElement;
|
|
33
|
+
} | null;
|
|
34
|
+
export declare function subscribeFrameRegistry(listener: () => void): () => void;
|
|
35
|
+
/** Records the highest complete projection revision accepted by one frame. */
|
|
36
|
+
export declare function recordCanvasProjectionApplied(cardId: string, appliedRevision: number): void;
|
|
37
|
+
/** Returns projection progress for the document containing a selected element. */
|
|
38
|
+
export declare function getCanvasProjectionStatus(doc: Document): CanvasProjectionStatus | null;
|
|
39
|
+
export declare function subscribeCanvasProjectionAcknowledgements(listener: () => void): () => void;
|
|
40
|
+
export declare function getCanvasProjectionAcknowledgementVersion(): number;
|
|
41
|
+
export declare function projectToAllReadyCards(): void;
|