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
|
@@ -2,30 +2,20 @@ import { readTailwindV4AlphaUtility, tailwindV4AlphaExpression } from "../../css
|
|
|
2
2
|
import { getElementComputedStyle } from "../runtime/domRealm.js";
|
|
3
3
|
import { createContainerQueryEvaluator } from "./resolution/containerQueryEvaluator.js";
|
|
4
4
|
import { collectRules as collectCssomRules, documentRevisions as getDocumentRevisions, registerResolutionLineage, } from "./resolution/cssomCollector.js";
|
|
5
|
-
import { createRuleMatcher, matchRuleForElement } from "./resolution/ruleMatching.js";
|
|
5
|
+
import { createRuleMatcher, matchRuleForElement, prewarmRuleMatching } from "./resolution/ruleMatching.js";
|
|
6
6
|
import { compareAuthorCascade } from "./resolution/cascade.js";
|
|
7
7
|
import { interpretValue, normalizeOpacityPercent, } from "../../css/value-semantics/index.js";
|
|
8
8
|
import { createInspectorValueContext, inspectorTokenOrigin } from "./valueSemanticsAdapter.js";
|
|
9
9
|
export { getAvailableInteractionStates, resetSourceSiteMatchCache, sourceSiteMatchCacheSize } from "./resolution/ruleMatching.js";
|
|
10
|
-
export { buildTokenTable,
|
|
10
|
+
export { buildTokenTable, getAvailableTokenEntriesForElement, getAvailableTokenCatalog } from "./tokenAvailability.js";
|
|
11
11
|
export { invalidateStyleResolutionCache } from "./resolution/cssomCollector.js";
|
|
12
|
-
/**
|
|
13
|
-
* Builds (or reuses) the document's CSSOM rule snapshot ahead of a resolution
|
|
14
|
-
* sweep. Idempotent: the walk runs once per stylesheet revision and is a cache
|
|
15
|
-
* hit afterwards, so a scheduler can warm it in its own frame to keep the
|
|
16
|
-
* subsequent resolution sweep's blocking time small.
|
|
17
|
-
*/
|
|
12
|
+
/** Idempotent per stylesheet revision; warms the snapshot ahead of a sweep so its blocking time stays small. */
|
|
18
13
|
export function prewarmCssomRuleSnapshot(doc) {
|
|
19
|
-
collectCssomRules(doc);
|
|
14
|
+
prewarmRuleMatching(collectCssomRules(doc).rules);
|
|
20
15
|
}
|
|
21
16
|
const MAX_PROPERTIES = 100;
|
|
22
17
|
const EMPTY_LOCAL_ALIASES = new Map();
|
|
23
|
-
/**
|
|
24
|
-
* Returns true when a `calc()` expression is safe to treat as a simple
|
|
25
|
-
* numeric value. We exclude percentages, viewport units, and font-relative
|
|
26
|
-
* units because those depend on context the browser cannot freeze into a
|
|
27
|
-
* single pixel value safely.
|
|
28
|
-
*/
|
|
18
|
+
/** Excludes context-dependent units (%, vw, em, ...) that cannot be frozen into one safe pixel value. */
|
|
29
19
|
function canBecomeNumeric(value) {
|
|
30
20
|
const v = value.trim();
|
|
31
21
|
if (/\b(?:min|max|clamp|env|anchor-size)\s*\(/i.test(v))
|
|
@@ -56,11 +46,6 @@ function candidateMatchesPainted(el, row, painted) {
|
|
|
56
46
|
return false;
|
|
57
47
|
return normalizeInElementContext(el, row.property, row.declaredValue) === painted.trim();
|
|
58
48
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Resolves one authored value through the value-semantics Module using the
|
|
61
|
-
* inspector's integration context. Value semantics remains the sole
|
|
62
|
-
* interpretation authority.
|
|
63
|
-
*/
|
|
64
49
|
function resolveTokenValue(value, tokenTable, localAliases = EMPTY_LOCAL_ALIASES) {
|
|
65
50
|
return interpretValue("--nudge-ui-token", value, createInspectorValueContext(tokenTable, localAliases))[0];
|
|
66
51
|
}
|
|
@@ -76,13 +61,7 @@ function elementDirectionality(el) {
|
|
|
76
61
|
function isLogicalBoxProperty(property) {
|
|
77
62
|
return /^(?:margin|padding|inset)-(?:inline|block)(?:-(?:start|end))?$/i.test(property);
|
|
78
63
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Coordinates cascade facts with the value-semantics Module. All property-family
|
|
81
|
-
* decomposition (logical sides, border, font, radius corners, physical spacing)
|
|
82
|
-
* lives in `interpretValue`; this function only supplies the token
|
|
83
|
-
* context and directionality facts, then projects the Module's fields onto the
|
|
84
|
-
* `ResolvedDeclaration` shape.
|
|
85
|
-
*/
|
|
64
|
+
/** Decomposition lives in `interpretValue`; this supplies the token context and projects its fields. */
|
|
86
65
|
function resolveDeclaration(declaration, tokenTable, localAliases = EMPTY_LOCAL_ALIASES, directionality) {
|
|
87
66
|
const fields = interpretValue(declaration.property, declaration.value, createInspectorValueContext(tokenTable, localAliases, directionality));
|
|
88
67
|
return fields.map((field) => ({
|
|
@@ -135,11 +114,7 @@ function atRulesApplyToElement(el, atRules, evaluator) {
|
|
|
135
114
|
return conditions.length === 0 || evaluator.matches(el, conditions);
|
|
136
115
|
}
|
|
137
116
|
function collectLocalAliases(el, rules) {
|
|
138
|
-
// Custom properties inherit independently
|
|
139
|
-
// Resolve the winning declaration separately for each element in the
|
|
140
|
-
// ancestor chain, then let the nearest declaration override inherited ones.
|
|
141
|
-
// This covers local aliases such as --color-error and inherited page tokens
|
|
142
|
-
// such as --color-ink without widening the build-time global catalog.
|
|
117
|
+
// Custom properties inherit independently, so each ancestor resolves its own winner and the nearest declaration wins.
|
|
143
118
|
const lineage = [];
|
|
144
119
|
let current = el;
|
|
145
120
|
while (current) {
|
|
@@ -179,9 +154,7 @@ function collectLocalAliases(el, rules) {
|
|
|
179
154
|
}
|
|
180
155
|
}
|
|
181
156
|
});
|
|
182
|
-
// Inline custom properties are
|
|
183
|
-
// explicit cascade winners for their element, so include them at inline
|
|
184
|
-
// specificity without changing the managed-style rule contract.
|
|
157
|
+
// Inline custom properties are inherited too; at inline specificity they are explicit cascade winners.
|
|
185
158
|
for (const property of Array.from(element.style)) {
|
|
186
159
|
if (!property.startsWith("--"))
|
|
187
160
|
continue;
|
|
@@ -217,12 +190,6 @@ function makeRuleApplies(el, evaluator = createContainerQueryEvaluator(el.ownerD
|
|
|
217
190
|
return result;
|
|
218
191
|
};
|
|
219
192
|
}
|
|
220
|
-
/**
|
|
221
|
-
* One matching pass over the rules for the element and its ancestors, with the
|
|
222
|
-
* selector-match results shared between the element's own resolution and the
|
|
223
|
-
* inherited phase. Local aliases are collected per element so no ancestor
|
|
224
|
-
* re-walks the lineage × rules.
|
|
225
|
-
*/
|
|
226
193
|
function relevantAncestorRule(rule) {
|
|
227
194
|
return rule.declarations.some(({ property }) => property.startsWith("--") || INHERITED_PROPERTIES.has(property));
|
|
228
195
|
}
|
|
@@ -271,8 +238,7 @@ function resolveLineage(el, matcher, evaluator) {
|
|
|
271
238
|
const matched = selectorMatches.filter(({ rule }) => (element === el || relevantAncestorRule(rule)) && rule.declarations.length > 0 && ruleApplies(rule));
|
|
272
239
|
const candidates = new Map();
|
|
273
240
|
for (const match of matched) {
|
|
274
|
-
// Conditions
|
|
275
|
-
// element. Descendants inherit its resulting alias, not its condition.
|
|
241
|
+
// Conditions are evaluated against the declaration's own element; descendants inherit the alias, not the condition.
|
|
276
242
|
for (const declaration of match.rule.declarations) {
|
|
277
243
|
if (!declaration.property.startsWith("--"))
|
|
278
244
|
continue;
|
|
@@ -307,9 +273,7 @@ function resolveLineage(el, matcher, evaluator) {
|
|
|
307
273
|
function rowsFromMatches(el, matched, aliases, tokenTable, allMatched = matched) {
|
|
308
274
|
const map = new Map();
|
|
309
275
|
const mediaCandidatesByProperty = new Map();
|
|
310
|
-
//
|
|
311
|
-
// Map.set() naturally overwrites: higher specificity rules processed later win,
|
|
312
|
-
// and equal-specificity rules get "last in stylesheet order wins" (stable sort).
|
|
276
|
+
// Ascending source order with Map.set overwrite gives later-wins for equal specificity; relies on a stable sort.
|
|
313
277
|
const sorted = [...matched].sort((a, b) => (a.rule.sourceOrder ?? 0) - (b.rule.sourceOrder ?? 0));
|
|
314
278
|
const needsDirectionality = sorted.some(({ rule }) => rule.declarations.some(({ property }) => isLogicalBoxProperty(property)));
|
|
315
279
|
const directionality = needsDirectionality ? elementDirectionality(el) : undefined;
|
|
@@ -409,12 +373,7 @@ function rowsFromMatches(el, matched, aliases, tokenTable, allMatched = matched)
|
|
|
409
373
|
}
|
|
410
374
|
return rows;
|
|
411
375
|
}
|
|
412
|
-
/**
|
|
413
|
-
* Package-private cascade fixture seam. This exercises selector, layer,
|
|
414
|
-
* importance, and interaction-state coordination while still crossing the
|
|
415
|
-
* public value-semantics Interface through `resolveDeclaration`.
|
|
416
|
-
* It is intentionally absent from the package exports.
|
|
417
|
-
*/
|
|
376
|
+
/** Test-only cascade fixture seam, intentionally absent from the package exports. */
|
|
418
377
|
export function resolveRuleFixture(el, rules, tokenTable) {
|
|
419
378
|
const ruleApplies = makeRuleApplies(el);
|
|
420
379
|
const matched = [];
|
|
@@ -530,8 +489,7 @@ function annotatePaintedValues(el, result, computed, inaccessible, mode) {
|
|
|
530
489
|
for (const prop of result) {
|
|
531
490
|
const cv = computed.getPropertyValue(prop.property);
|
|
532
491
|
if (cv && !/\b(?:var|calc)\s*\(/.test(cv)) {
|
|
533
|
-
//
|
|
534
|
-
// records what the browser is painting. Live and base use painted values.
|
|
492
|
+
// Hypothetical states keep the authored value; live/base take the painted value.
|
|
535
493
|
if (mode === "live" || mode === "base" || !prop.resolvedValue)
|
|
536
494
|
prop.resolvedValue = cv;
|
|
537
495
|
prop.computed = cv;
|
|
@@ -553,8 +511,7 @@ export function getResolvedProperties(el, tokenTable, evaluator = createContaine
|
|
|
553
511
|
return resolveMatchedProperties(el, tokenTable, lineage, inaccessible, "live");
|
|
554
512
|
}
|
|
555
513
|
function applyInlineDeclarations(el, result, tokenTable, computed, inaccessible) {
|
|
556
|
-
// Inline declarations
|
|
557
|
-
// but token attribution is only exact when the authored inline value uses a known token.
|
|
514
|
+
// Inline declarations are explicit evidence, but attribution is exact only for a known token.
|
|
558
515
|
const inlineProperties = Array.from(el.style);
|
|
559
516
|
const directionality = inlineProperties.some(isLogicalBoxProperty)
|
|
560
517
|
? directionalityFromComputed(el, computed)
|
|
@@ -601,10 +558,7 @@ function applyInlineDeclarations(el, result, tokenTable, computed, inaccessible)
|
|
|
601
558
|
}
|
|
602
559
|
}
|
|
603
560
|
function promoteNumericCalcRows(result, tokenTable) {
|
|
604
|
-
//
|
|
605
|
-
// already resolved it to a pixel value. Reclassify the row so the UI
|
|
606
|
-
// shows the pixel value instead of the raw calc() string and allows
|
|
607
|
-
// numeric editing (nudge / token swap).
|
|
561
|
+
// A static-token calc() is already resolved to a pixel value; reclassify so the UI allows numeric editing.
|
|
608
562
|
for (const prop of result) {
|
|
609
563
|
if (prop.capability !== "raw" || prop.diagnostic)
|
|
610
564
|
continue;
|
|
@@ -617,12 +571,7 @@ function promoteNumericCalcRows(result, tokenTable) {
|
|
|
617
571
|
prop.capability = capabilityFor(prop.property, numeric, tokenTable);
|
|
618
572
|
}
|
|
619
573
|
}
|
|
620
|
-
/**
|
|
621
|
-
* Resolve the authored cascade for a chosen interaction state without relying
|
|
622
|
-
* on the pointer's current location. This is intentionally attribution-first:
|
|
623
|
-
* values with no authored declaration still fall back to the browser's live
|
|
624
|
-
* computed value in the field layer.
|
|
625
|
-
*/
|
|
574
|
+
/** Authored cascade for a chosen interaction state, independent of the pointer's live paint. */
|
|
626
575
|
export function getResolvedPropertiesForState(el, tokenTable, state, evaluator = createContainerQueryEvaluator(el.ownerDocument)) {
|
|
627
576
|
const doc = el.ownerDocument ?? document;
|
|
628
577
|
const revisions = getDocumentRevisions(doc);
|
|
@@ -656,11 +605,7 @@ export function getResolvedPropertiesForState(el, tokenTable, state, evaluator =
|
|
|
656
605
|
return rows;
|
|
657
606
|
}
|
|
658
607
|
const stableTokenCache = new WeakMap();
|
|
659
|
-
/**
|
|
660
|
-
* Resolves the cascade with transient interaction selectors removed. Used when
|
|
661
|
-
* an editor must stay linked to the stable token beneath a live :hover/:focus
|
|
662
|
-
* paint. Memoized per (element, revisions, tokenTable).
|
|
663
|
-
*/
|
|
608
|
+
/** Cascade with transient interaction selectors removed, so an editor stays linked to the token beneath a live :hover/:focus paint. */
|
|
664
609
|
export function getResolvedPropertiesStable(el, tokenTable, evaluator = createContainerQueryEvaluator(el.ownerDocument)) {
|
|
665
610
|
const doc = el.ownerDocument ?? document;
|
|
666
611
|
const revisions = getDocumentRevisions(doc);
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import type { TokenDefinition, TokenEntry, TokenTable } from "../../css/model/index.js";
|
|
2
2
|
export declare function buildTokenTable(entries: readonly TokenEntry[]): TokenTable;
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The build-time catalog is intentionally an inventory of every project token.
|
|
6
|
-
* Element edits must instead use only custom properties resolved in that
|
|
7
|
-
* element's cascade; a token defined by a lazy stylesheet is not usable until
|
|
8
|
-
* that stylesheet is attached to the document. Entries are cached per element
|
|
9
|
-
* until the element or stylesheet revision changes; the derived table reuses
|
|
10
|
-
* `buildTokenTable`'s input-identity memo.
|
|
11
|
-
*/
|
|
3
|
+
/** Element edits may use only custom properties resolved in this element's cascade; cached until the element or stylesheet revision changes. */
|
|
12
4
|
export declare function getAvailableTokenEntriesForElement(el: HTMLElement, definitions?: readonly TokenDefinition[]): TokenEntry[];
|
|
13
|
-
/**
|
|
14
|
-
* Produces the page catalog used by the global Tokens settings section. When
|
|
15
|
-
* the document exposes mappable source identities, declarations from unloaded
|
|
16
|
-
* CSS files are removed. Opaque compiled URLs leave the adapter catalog intact.
|
|
17
|
-
*/
|
|
5
|
+
/** Page catalog for the global Tokens section; declarations from unloaded CSS files are dropped when source identities are mappable. */
|
|
18
6
|
export declare function getAvailableTokenCatalog(root?: HTMLElement, definitions?: readonly TokenDefinition[]): TokenDefinition[];
|
|
@@ -17,16 +17,6 @@ export function buildTokenTable(entries) {
|
|
|
17
17
|
tokenTableMemo.set(entries, table);
|
|
18
18
|
return table;
|
|
19
19
|
}
|
|
20
|
-
let tableCache = null;
|
|
21
|
-
let tableSource = null;
|
|
22
|
-
export function getTokenTable() {
|
|
23
|
-
const { tokens } = getNudgeUiRuntimeConfig();
|
|
24
|
-
if (tableCache !== null && tableSource === tokens)
|
|
25
|
-
return tableCache;
|
|
26
|
-
tableCache = buildTokenTable(tokens);
|
|
27
|
-
tableSource = tokens;
|
|
28
|
-
return tableCache;
|
|
29
|
-
}
|
|
30
20
|
function isCustomPropertyToken(definition) {
|
|
31
21
|
return definition.cssName.startsWith("--");
|
|
32
22
|
}
|
|
@@ -43,14 +33,7 @@ function entryFromDefinition(definition, value) {
|
|
|
43
33
|
};
|
|
44
34
|
}
|
|
45
35
|
const tokenEntriesCache = new WeakMap();
|
|
46
|
-
/**
|
|
47
|
-
* The build-time catalog is intentionally an inventory of every project token.
|
|
48
|
-
* Element edits must instead use only custom properties resolved in that
|
|
49
|
-
* element's cascade; a token defined by a lazy stylesheet is not usable until
|
|
50
|
-
* that stylesheet is attached to the document. Entries are cached per element
|
|
51
|
-
* until the element or stylesheet revision changes; the derived table reuses
|
|
52
|
-
* `buildTokenTable`'s input-identity memo.
|
|
53
|
-
*/
|
|
36
|
+
/** Element edits may use only custom properties resolved in this element's cascade; cached until the element or stylesheet revision changes. */
|
|
54
37
|
export function getAvailableTokenEntriesForElement(el, definitions = getNudgeUiRuntimeConfig().tokenCatalog) {
|
|
55
38
|
const revisions = getDocumentRevisions(el.ownerDocument ?? document);
|
|
56
39
|
const cached = tokenEntriesCache.get(el);
|
|
@@ -63,8 +46,7 @@ export function getAvailableTokenEntriesForElement(el, definitions = getNudgeUiR
|
|
|
63
46
|
const computed = getElementComputedStyle(el);
|
|
64
47
|
const available = definitions.flatMap((definition) => {
|
|
65
48
|
if (!isCustomPropertyToken(definition)) {
|
|
66
|
-
// Literal adapters (
|
|
67
|
-
// custom property to probe. Their adapter owns their availability.
|
|
49
|
+
// Literal adapters (e.g. Tailwind v3) have no custom property to probe; the adapter owns their availability.
|
|
68
50
|
return [entryFromDefinition(definition, definition.declarations[0]?.value ?? "")];
|
|
69
51
|
}
|
|
70
52
|
const value = computed.getPropertyValue(definition.cssName).trim();
|
|
@@ -83,10 +65,7 @@ export function getAvailableTokenEntriesForElement(el, definitions = getNudgeUiR
|
|
|
83
65
|
});
|
|
84
66
|
return entries;
|
|
85
67
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Replaces build-time token declaration hints with declarations serialized by
|
|
88
|
-
* the browser from the stylesheets currently attached to this document.
|
|
89
|
-
*/
|
|
68
|
+
/** Replaces build-time declaration hints with declarations serialized from the attached stylesheets. */
|
|
90
69
|
function hydrateTokenCatalogFromCssom(definitions, doc = document) {
|
|
91
70
|
const needsHydration = (definition) => definition.declarations.length === 0
|
|
92
71
|
|| (definition.adapter === "vanilla-extract" && definition.declarations.every((declaration) => declaration.value.trim() === `var(${definition.cssName})`
|
|
@@ -160,13 +139,7 @@ function isLoadedCssSource(source, loadedSources) {
|
|
|
160
139
|
|| loaded.endsWith(`/${normalizedFile}`)
|
|
161
140
|
|| normalizedFile.endsWith(`/${loaded}`));
|
|
162
141
|
}
|
|
163
|
-
/**
|
|
164
|
-
* Returns stylesheet identities only when the browser gave us a complete,
|
|
165
|
-
* authored-source mapping. A compiled host can expose a mixture of source-like
|
|
166
|
-
* and opaque CSS URLs; treating the mapped subset as complete would make
|
|
167
|
-
* declarations behind the opaque URLs look lazy even while their variables are
|
|
168
|
-
* live in the document.
|
|
169
|
-
*/
|
|
142
|
+
/** Identities only for a complete authored-source mapping; a mapped subset cannot stand in for opaque compiled URLs. */
|
|
170
143
|
function confidentlyLoadedStylesheetSources(definitions, loadedSources) {
|
|
171
144
|
const cssSources = definitions.flatMap((definition) => definition.declarations
|
|
172
145
|
.map((declaration) => declaration.source)
|
|
@@ -178,17 +151,12 @@ function confidentlyLoadedStylesheetSources(definitions, loadedSources) {
|
|
|
178
151
|
known.add(loaded.path);
|
|
179
152
|
continue;
|
|
180
153
|
}
|
|
181
|
-
// One opaque compiled URL can contain any authored declaration, so
|
|
182
|
-
// document does not provide enough evidence to remove unloaded sources.
|
|
154
|
+
// One opaque compiled URL can contain any authored declaration, so unloaded sources cannot be ruled out.
|
|
183
155
|
return [];
|
|
184
156
|
}
|
|
185
157
|
return [...known];
|
|
186
158
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Produces the page catalog used by the global Tokens settings section. When
|
|
189
|
-
* the document exposes mappable source identities, declarations from unloaded
|
|
190
|
-
* CSS files are removed. Opaque compiled URLs leave the adapter catalog intact.
|
|
191
|
-
*/
|
|
159
|
+
/** Page catalog for the global Tokens section; declarations from unloaded CSS files are dropped when source identities are mappable. */
|
|
192
160
|
export function getAvailableTokenCatalog(root = document.documentElement, definitions = getNudgeUiRuntimeConfig().tokenCatalog) {
|
|
193
161
|
const computed = getElementComputedStyle(root);
|
|
194
162
|
const hydrated = hydrateTokenCatalogFromCssom(definitions, root.ownerDocument ?? document);
|
|
@@ -2,5 +2,4 @@ import type { TokenEntry } from "../../css/model/index.js";
|
|
|
2
2
|
import type { TokenOrigin, TokenTable } from "../../css/model/index.js";
|
|
3
3
|
import type { Directionality, ValueSemanticsContext } from "../../css/value-semantics/index.js";
|
|
4
4
|
export declare function inspectorTokenOrigin(entry: TokenEntry | undefined): TokenOrigin;
|
|
5
|
-
/** Inspector Adapter for framework-specific token attribution facts. */
|
|
6
5
|
export declare function createInspectorValueContext(tokenTable: TokenTable, localAliases?: ReadonlyMap<string, string>, directionality?: Directionality): ValueSemanticsContext;
|
|
@@ -21,11 +21,28 @@ function colorTuple(value) {
|
|
|
21
21
|
const rgb = /^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/.exec(trimmed);
|
|
22
22
|
return rgb ? [rgb[1], rgb[2], rgb[3]].map((part) => String(Math.round(Number(part)))).join(",") : null;
|
|
23
23
|
}
|
|
24
|
+
const frameworkColorIndexes = new WeakMap();
|
|
25
|
+
/** First Tailwind v3 token per color tuple. */
|
|
26
|
+
function frameworkColorIndex(tokenTable) {
|
|
27
|
+
let index = frameworkColorIndexes.get(tokenTable);
|
|
28
|
+
if (index)
|
|
29
|
+
return index;
|
|
30
|
+
index = new Map();
|
|
31
|
+
for (const entry of Object.values(tokenTable)) {
|
|
32
|
+
if (entry.adapter !== "tailwind-v3")
|
|
33
|
+
continue;
|
|
34
|
+
const tuple = colorTuple(entry.value);
|
|
35
|
+
if (tuple && !index.has(tuple))
|
|
36
|
+
index.set(tuple, entry);
|
|
37
|
+
}
|
|
38
|
+
frameworkColorIndexes.set(tokenTable, index);
|
|
39
|
+
return index;
|
|
40
|
+
}
|
|
24
41
|
function directFrameworkColor(value, tokenTable) {
|
|
25
42
|
const tuple = colorTuple(value);
|
|
26
43
|
if (!tuple)
|
|
27
44
|
return undefined;
|
|
28
|
-
return
|
|
45
|
+
return frameworkColorIndex(tokenTable).get(tuple);
|
|
29
46
|
}
|
|
30
47
|
function twLocalAliasPolicy(ref, inner) {
|
|
31
48
|
if (!ref.startsWith("--tw-")) {
|
|
@@ -53,7 +70,6 @@ function twLocalAliasPolicy(ref, inner) {
|
|
|
53
70
|
cycle: inner.cycle,
|
|
54
71
|
};
|
|
55
72
|
}
|
|
56
|
-
/** Inspector Adapter for framework-specific token attribution facts. */
|
|
57
73
|
export function createInspectorValueContext(tokenTable, localAliases = EMPTY_LOCAL_ALIASES, directionality) {
|
|
58
74
|
return {
|
|
59
75
|
tokenContext: {
|
|
@@ -4,15 +4,15 @@ export interface AtRuleContextProviderProps {
|
|
|
4
4
|
rows: readonly ResolvedProperty[];
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Makes the active conditional source context available to fields that only
|
|
9
|
-
* receive a property name (not their resolved property row) as props.
|
|
10
|
-
*/
|
|
7
|
+
/** Fields that only receive a property name read their conditional context here. */
|
|
11
8
|
export declare function AtRuleContextProvider({ rows, children }: AtRuleContextProviderProps): ReactElement;
|
|
12
9
|
export declare function useFieldAtRules(property: string): readonly AtRuleCandidate[];
|
|
13
10
|
export interface AtRuleIndicatorProps {
|
|
14
11
|
atRules?: readonly (AtRuleContext | AtRuleCandidate)[];
|
|
15
12
|
className?: string;
|
|
16
13
|
}
|
|
17
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* A ruler along the field's left edge: one segment per conditional rule plus the base, with the
|
|
16
|
+
* declaration currently winning the cascade highlighted. Hovering it lists the rules.
|
|
17
|
+
*/
|
|
18
18
|
export declare function AtRuleIndicator({ atRules, className }: AtRuleIndicatorProps): ReactElement | null;
|
|
@@ -2,12 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext, useContext, useMemo } from "react";
|
|
3
3
|
import { Tooltip } from "./Tooltip.js";
|
|
4
4
|
import { cx } from "./classNames.js";
|
|
5
|
+
import { atRuleSegments } from "./atRuleSegments.js";
|
|
5
6
|
const EMPTY_AT_RULES = [];
|
|
6
7
|
const FieldAtRuleContext = createContext(new Map());
|
|
7
|
-
/**
|
|
8
|
-
* Makes the active conditional source context available to fields that only
|
|
9
|
-
* receive a property name (not their resolved property row) as props.
|
|
10
|
-
*/
|
|
8
|
+
/** Fields that only receive a property name read their conditional context here. */
|
|
11
9
|
export function AtRuleContextProvider({ rows, children }) {
|
|
12
10
|
const atRulesByProperty = useMemo(() => {
|
|
13
11
|
const next = new Map();
|
|
@@ -41,12 +39,16 @@ function countLabel(label, count) {
|
|
|
41
39
|
const noun = label.toLowerCase().replace(/query$/, count === 1 ? "query" : "queries");
|
|
42
40
|
return `${count} ${noun}`;
|
|
43
41
|
}
|
|
44
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* A ruler along the field's left edge: one segment per conditional rule plus the base, with the
|
|
44
|
+
* declaration currently winning the cascade highlighted. Hovering it lists the rules.
|
|
45
|
+
*/
|
|
45
46
|
export function AtRuleIndicator({ atRules = EMPTY_AT_RULES, className }) {
|
|
46
47
|
if (atRules.length === 0)
|
|
47
48
|
return null;
|
|
48
49
|
const label = labelFor(atRules);
|
|
49
50
|
const activeCount = atRules.filter((atRule) => !("active" in atRule) || atRule.active).length;
|
|
50
51
|
const count = countLabel(label, atRules.length);
|
|
51
|
-
|
|
52
|
+
const segments = atRuleSegments(atRules);
|
|
53
|
+
return (_jsx(Tooltip, { content: (_jsx("div", { className: "at-rule-tooltip__rules", children: segments.map((segment) => segment.kind === "base" ? (_jsx("div", { className: cx("at-rule-tooltip__default", segment.active && "at-rule-tooltip__rule--active"), "data-active": segment.active ? "true" : "false", children: "Default" }, segment.key)) : (_jsx("div", { className: cx("at-rule-tooltip__rule", segment.active && "at-rule-tooltip__rule--active"), "data-active": segment.active ? "true" : "false", children: _jsx("code", { children: segment.params }) }, segment.key))) })), delay: 0, positionerClassName: "at-rule-tooltip-positioner", popupClassName: "at-rule-tooltip", "data-test": "at-rule-tooltip", children: _jsx("button", { type: "button", className: cx("at-rule-indicator", className), "data-test": "at-rule-indicator", "aria-label": activeCount > 0 ? `Active ${count}` : count, children: _jsx("span", { className: "at-rule-indicator__track", "aria-hidden": "true", children: segments.map((segment) => (_jsx("span", { className: "at-rule-indicator__segment", "data-active": segment.active ? "true" : "false" }, segment.key))) }) }) }));
|
|
52
54
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Visual boundary for an inspector control. It owns the shared control chrome
|
|
4
|
-
* while the child owns its particular input or selection behaviour.
|
|
5
|
-
*/
|
|
6
2
|
export type ControlAppearance = "default" | "embedded";
|
|
7
3
|
export type ControlDensity = "default" | "compact";
|
|
8
4
|
export interface ControlSurfaceProps extends HTMLAttributes<HTMLSpanElement> {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
export interface DisclosureProps {
|
|
3
3
|
readonly title: ReactNode;
|
|
4
|
-
/** Optional accessory rendered between the label and the chevron (e.g. a count badge). */
|
|
5
4
|
readonly badge?: ReactNode;
|
|
6
5
|
readonly children: ReactNode;
|
|
7
6
|
readonly className?: string;
|
|
@@ -15,8 +14,4 @@ export interface DisclosureProps {
|
|
|
15
14
|
readonly "data-test"?: string;
|
|
16
15
|
readonly triggerDataTest?: string;
|
|
17
16
|
}
|
|
18
|
-
/**
|
|
19
|
-
* A single collapsible disclosure built on Base UI Collapsible.
|
|
20
|
-
* Replaces native details/summary for consistent 12px label styling and chevron.
|
|
21
|
-
*/
|
|
22
17
|
export declare function Disclosure({ title, badge, children, className, triggerClassName, panelClassName, defaultOpen, open, onOpenChange, keepMounted, "data-test": dataTest, triggerDataTest, }: DisclosureProps): ReactElement;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Collapsible } from "@base-ui/react/collapsible";
|
|
3
3
|
import { IconChevronDown } from "@tabler/icons-react";
|
|
4
|
-
/**
|
|
5
|
-
* A single collapsible disclosure built on Base UI Collapsible.
|
|
6
|
-
* Replaces native details/summary for consistent 12px label styling and chevron.
|
|
7
|
-
*/
|
|
8
4
|
export function Disclosure({ title, badge, children, className, triggerClassName, panelClassName, defaultOpen, open, onOpenChange, keepMounted = true, "data-test": dataTest, triggerDataTest, }) {
|
|
9
5
|
function handleOpenChange(next) {
|
|
10
6
|
onOpenChange?.(next);
|
|
@@ -10,9 +10,5 @@ export interface InspectorPopoverProps {
|
|
|
10
10
|
triggerTooltip?: ReactNode;
|
|
11
11
|
"data-test"?: string;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Base UI popover anchored inside the inspector shadow root. Unlike the
|
|
15
|
-
* listbox popover, this leaves the popup content to the caller for compound
|
|
16
|
-
* settings panels and field controls.
|
|
17
|
-
*/
|
|
13
|
+
/** Leaves the popup content to the caller, unlike PopoverListbox. */
|
|
18
14
|
export declare function InspectorPopover({ triggerElement, children, open, onOpenChange, side, align, sideOffset, triggerTooltip, "data-test": dataTest, }: InspectorPopoverProps): ReactElement;
|
|
@@ -2,11 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Popover as BasePopover } from "@base-ui/react/popover";
|
|
3
3
|
import { Tooltip } from "./Tooltip.js";
|
|
4
4
|
import { portalContainer } from "./portalContainer.js";
|
|
5
|
-
/**
|
|
6
|
-
* Base UI popover anchored inside the inspector shadow root. Unlike the
|
|
7
|
-
* listbox popover, this leaves the popup content to the caller for compound
|
|
8
|
-
* settings panels and field controls.
|
|
9
|
-
*/
|
|
5
|
+
/** Leaves the popup content to the caller, unlike PopoverListbox. */
|
|
10
6
|
export function InspectorPopover({ triggerElement, children, open, onOpenChange, side = "bottom", align = "center", sideOffset = 6, triggerTooltip, "data-test": dataTest, }) {
|
|
11
7
|
return (_jsxs(BasePopover.Root, { open: open, onOpenChange: onOpenChange, children: [_jsx(Tooltip, { content: triggerTooltip, disabled: triggerTooltip === undefined, children: _jsx(BasePopover.Trigger, { render: triggerElement, "data-test": dataTest }) }), _jsx(BasePopover.Portal, { container: portalContainer(), children: _jsx(BasePopover.Positioner, { className: "inspector-popover__positioner", side: side, align: align, sideOffset: sideOffset, children: _jsx(BasePopover.Popup, { className: "inspector-popover__popup", "data-test": dataTest ? `${dataTest}-popover` : undefined, children: children }) }) })] }));
|
|
12
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
export interface SegmentedControlOption<T extends string> {
|
|
3
3
|
value: T;
|
|
4
4
|
/** Accessible name; also the visible label when `icon` is omitted. */
|
|
@@ -15,11 +15,11 @@ interface SegmentedControlProps<T extends string> {
|
|
|
15
15
|
"data-property"?: string;
|
|
16
16
|
className?: string;
|
|
17
17
|
disabled?: boolean;
|
|
18
|
-
/**
|
|
18
|
+
/** Shows each option's label in a tooltip; for icon-only segments. */
|
|
19
|
+
tooltips?: boolean;
|
|
19
20
|
allowDeselect?: boolean;
|
|
20
21
|
/** Restores the value represented by an unselected control. */
|
|
21
22
|
onDeselect?: () => void;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
export declare function SegmentedControl<T extends string>({ value, options, onChange, "aria-label": ariaLabel, "data-test": dataTest, "data-property": dataProperty, className, disabled, allowDeselect, onDeselect, }: SegmentedControlProps<T>): ReactElement;
|
|
24
|
+
export declare function SegmentedControl<T extends string>({ value, options, onChange, "aria-label": ariaLabel, "data-test": dataTest, "data-property": dataProperty, className, disabled, tooltips, allowDeselect, onDeselect, }: SegmentedControlProps<T>): ReactElement;
|
|
25
25
|
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
2
3
|
import { Toggle } from "@base-ui/react/toggle";
|
|
3
|
-
|
|
4
|
-
export function SegmentedControl({ value, options, onChange, "aria-label": ariaLabel, "data-test": dataTest, "data-property": dataProperty, className, disabled = false, allowDeselect = false, onDeselect, }) {
|
|
4
|
+
import { Tooltip } from "./Tooltip.js";
|
|
5
|
+
export function SegmentedControl({ value, options, onChange, "aria-label": ariaLabel, "data-test": dataTest, "data-property": dataProperty, className, disabled = false, tooltips = false, allowDeselect = false, onDeselect, }) {
|
|
5
6
|
return (_jsx("div", { className: `segmented-control${className ? ` ${className}` : ""}`, role: "group", "aria-label": ariaLabel, "data-test": dataTest, "data-property": dataProperty, children: options.map((option) => {
|
|
6
7
|
const selected = option.value === value;
|
|
7
|
-
|
|
8
|
+
const toggle = (_jsx(Toggle, { type: "button", className: `button segmented-control__button${selected ? " segmented-control__button--selected" : ""}`, pressed: selected, disabled: disabled, "aria-label": option.label, "data-test": option.testId, "data-active": selected ? "true" : "false", onPressedChange: (pressed) => {
|
|
8
9
|
if (pressed) {
|
|
9
10
|
onChange(option.value);
|
|
10
11
|
}
|
|
11
12
|
else if (allowDeselect) {
|
|
12
13
|
onDeselect?.();
|
|
13
14
|
}
|
|
14
|
-
}, children: option.icon ?? _jsx("span", { className: "segmented-control__label", children: option.label }) }
|
|
15
|
+
}, children: option.icon ?? _jsx("span", { className: "segmented-control__label", children: option.label }) }));
|
|
16
|
+
return _jsx(Fragment, { children: tooltips ? _jsx(Tooltip, { children: toggle }) : toggle }, option.value);
|
|
15
17
|
}) }));
|
|
16
18
|
}
|
|
@@ -27,12 +27,7 @@ export interface SideValuesFieldProps {
|
|
|
27
27
|
"data-test"?: string;
|
|
28
28
|
"data-property"?: string;
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
* A compact side editor. Callers provide grouped horizontal/vertical controls
|
|
32
|
-
* that expand into the four physical sides (or omit `pairedControls` to show
|
|
33
|
-
* the four sides directly). The field owns presentation and expand state
|
|
34
|
-
* while callers own the actual CSS/token controls rendered in each slot.
|
|
35
|
-
*/
|
|
30
|
+
/** Owns presentation and expand state; callers own the controls rendered in each slot. */
|
|
36
31
|
export declare function SideValuesField({ label, sides, pairedControls, defaultExpanded, showLabel, empty, onAdd, emptyAction, resetKey, "data-test": dataTest, "data-property": dataProperty, }: SideValuesFieldProps): ReactElement;
|
|
37
32
|
export declare function SideControls({ label, sides, layout, }: {
|
|
38
33
|
label: ReactNode;
|
|
@@ -8,12 +8,7 @@ import { ControlSurface } from "./ControlSurface.js";
|
|
|
8
8
|
export const SIDE_NAMES = ["top", "right", "bottom", "left"];
|
|
9
9
|
const SIDE_DISPLAY_ORDER = ["left", "top", "right", "bottom"];
|
|
10
10
|
const SIDE_AXIS_DISPLAY_ORDER = ["horizontal", "vertical"];
|
|
11
|
-
/**
|
|
12
|
-
* A compact side editor. Callers provide grouped horizontal/vertical controls
|
|
13
|
-
* that expand into the four physical sides (or omit `pairedControls` to show
|
|
14
|
-
* the four sides directly). The field owns presentation and expand state
|
|
15
|
-
* while callers own the actual CSS/token controls rendered in each slot.
|
|
16
|
-
*/
|
|
11
|
+
/** Owns presentation and expand state; callers own the controls rendered in each slot. */
|
|
17
12
|
export function SideValuesField({ label, sides, pairedControls, defaultExpanded = false, showLabel = true, empty = false, onAdd, emptyAction, resetKey, "data-test": dataTest, "data-property": dataProperty, }) {
|
|
18
13
|
const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded);
|
|
19
14
|
const previousResetKey = useRef(resetKey);
|
|
@@ -26,8 +21,7 @@ export function SideValuesField({ label, sides, pairedControls, defaultExpanded
|
|
|
26
21
|
const labelText = typeof label === "string" ? formatInspectorLabel(label) : String(label);
|
|
27
22
|
const displayLabel = showLabel ? (typeof label === "string" ? labelText : label) : null;
|
|
28
23
|
useEffect(() => {
|
|
29
|
-
//
|
|
30
|
-
// edit; reseed when the selection (resetKey) changes.
|
|
24
|
+
// defaultExpanded describes the newly selected element, so reseed when resetKey changes.
|
|
31
25
|
setUncontrolledExpanded(defaultExpanded);
|
|
32
26
|
previousResetKey.current = resetKey;
|
|
33
27
|
}, [resetKey]);
|
|
@@ -7,8 +7,4 @@ export interface ShowToastOptions {
|
|
|
7
7
|
readonly timeout?: number;
|
|
8
8
|
}
|
|
9
9
|
export declare function showToast({ title, description, tone, timeout }: ShowToastOptions): string;
|
|
10
|
-
/**
|
|
11
|
-
* Renders inspector toasts inside the inspector's shadow root, centered above
|
|
12
|
-
* the canvas toolbar in the space the inspector panel leaves free.
|
|
13
|
-
*/
|
|
14
10
|
export declare function ToastRegion(): ReactElement;
|
|
@@ -20,10 +20,6 @@ function ToastList() {
|
|
|
20
20
|
? _jsx(IconAlertTriangleFilled, { className: "toast__icon", size: "var(--icon-size-small)", "aria-hidden": "true" })
|
|
21
21
|
: _jsx(IconCircleCheckFilled, { className: "toast__icon", size: "var(--icon-size-small)", "aria-hidden": "true" }), _jsxs(BaseToast.Content, { className: "toast__content", children: [_jsx(BaseToast.Title, { className: "toast__title" }), toast.description ? _jsx(BaseToast.Description, { className: "toast__description" }) : null] })] }, toast.id))) }));
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Renders inspector toasts inside the inspector's shadow root, centered above
|
|
25
|
-
* the canvas toolbar in the space the inspector panel leaves free.
|
|
26
|
-
*/
|
|
27
23
|
export function ToastRegion() {
|
|
28
24
|
const inspectorOpen = useInspectorOpen();
|
|
29
25
|
return (_jsx(BaseToast.Provider, { toastManager: toastManager, limit: 3, children: _jsx(BaseToast.Portal, { container: portalContainer(), children: _jsx(BaseToast.Viewport, { className: "toast__viewport", "data-inspector-open": inspectorOpen ? "true" : "false", "data-test": "toast-viewport", children: _jsx(ToastList, {}) }) }) }));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AtRuleCandidate, AtRuleContext, AtRuleKind } from "../../css/model/index.js";
|
|
2
|
+
export interface AtRuleSegment {
|
|
3
|
+
key: string;
|
|
4
|
+
/** The unconditional declaration is the base segment; every conditional rule adds one more. */
|
|
5
|
+
kind: AtRuleKind | "base";
|
|
6
|
+
params: string | null;
|
|
7
|
+
active: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Segments ordered like a ruler from the largest viewport down. A base declaration sits at the
|
|
11
|
+
* large end when the conditions are max-width (desktop first) and at the small end for min-width.
|
|
12
|
+
*/
|
|
13
|
+
export declare function atRuleSegments(atRules: readonly (AtRuleContext | AtRuleCandidate)[]): AtRuleSegment[];
|