nudge-ui 0.2.2 → 0.2.4
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 +164 -46
- package/dist/client.mjs +260 -61
- package/dist/css/value-semantics/colorSemantics.d.ts +4 -0
- package/dist/css/value-semantics/colorSemantics.js +17 -0
- package/dist/hosts/astro/astroRuntimeConfig.js +1 -0
- package/dist/hosts/astro/clientTransport.js +38 -32
- package/dist/hosts/astro/integration.js +5 -1
- package/dist/hosts/astro/markdownIdentity.d.ts +28 -0
- package/dist/hosts/astro/markdownIdentity.js +81 -0
- package/dist/hosts/next/manifest.js +1 -1
- package/dist/hosts/next/sidecar.js +5 -1
- package/dist/hosts/static/manifest.js +1 -1
- package/dist/hosts/static/server.js +3 -0
- package/dist/hosts/vite/vite.d.ts +3 -0
- package/dist/hosts/vite/vite.js +24 -4
- package/dist/inspector/agent/McpConnectionDialog.js +13 -19
- package/dist/inspector/agent/activity.d.ts +18 -0
- package/dist/inspector/agent/activity.js +70 -0
- package/dist/inspector/agent/client.d.ts +2 -0
- package/dist/inspector/agent/client.js +29 -1
- package/dist/inspector/agent/connectionStatus.js +1 -1
- package/dist/inspector/agent/httpTransport.js +9 -2
- package/dist/inspector/agent/protocol.d.ts +6 -3
- package/dist/inspector/agent/protocol.js +1 -1
- package/dist/inspector/agent/verification.d.ts +15 -7
- package/dist/inspector/agent/verification.js +113 -41
- package/dist/inspector/canvas/AgentActivityOverlay.d.ts +13 -0
- package/dist/inspector/canvas/AgentActivityOverlay.js +111 -0
- package/dist/inspector/canvas/CanvasCard.d.ts +9 -2
- package/dist/inspector/canvas/CanvasCard.js +135 -38
- package/dist/inspector/canvas/CanvasElementOverlay.js +166 -16
- package/dist/inspector/canvas/CanvasToolIcons.d.ts +10 -0
- package/dist/inspector/canvas/CanvasToolIcons.js +20 -0
- package/dist/inspector/canvas/CanvasToolbar.js +8 -4
- package/dist/inspector/canvas/CanvasWorkspace.js +270 -122
- package/dist/inspector/canvas/StaleChangeIndicator.js +3 -13
- package/dist/inspector/canvas/agentPresentation.d.ts +8 -8
- package/dist/inspector/canvas/agentPresentation.js +64 -52
- package/dist/inspector/canvas/canvasGestures.d.ts +1 -1
- package/dist/inspector/canvas/canvasGestures.js +1 -1
- package/dist/inspector/canvas/canvasStore.d.ts +46 -82
- package/dist/inspector/canvas/canvasStore.js +251 -284
- package/dist/inspector/canvas/frameContent.d.ts +21 -0
- package/dist/inspector/canvas/frameContent.js +44 -0
- package/dist/inspector/canvas/frameProtocol.d.ts +21 -4
- package/dist/inspector/canvas/frameProtocol.js +3 -3
- package/dist/inspector/canvas/frameScrollbarStyles.d.ts +3 -0
- package/dist/inspector/canvas/frameScrollbarStyles.js +21 -0
- package/dist/inspector/canvas/keyboardShortcuts.d.ts +3 -1
- package/dist/inspector/canvas/keyboardShortcuts.js +4 -4
- package/dist/inspector/canvas/layout.d.ts +52 -0
- package/dist/inspector/canvas/layout.js +106 -0
- package/dist/inspector/canvas/projection.d.ts +15 -5
- package/dist/inspector/canvas/projection.js +69 -13
- package/dist/inspector/canvas/rendererBootstrap.js +32 -4
- package/dist/inspector/canvas/rendererElementSelector.js +47 -6
- package/dist/inspector/canvas/rendererStylesheet.js +2 -2
- package/dist/inspector/canvas/resizeHandleScale.js +1 -1
- package/dist/inspector/canvas/sessionStore.d.ts +11 -26
- package/dist/inspector/canvas/sessionStore.js +43 -183
- package/dist/inspector/canvas/staleChangeDetector.js +9 -3
- package/dist/inspector/canvas/useCanvasLayoutAnimation.d.ts +5 -0
- package/dist/inspector/canvas/useCanvasLayoutAnimation.js +107 -0
- package/dist/inspector/canvas/viewStore.d.ts +38 -0
- package/dist/inspector/canvas/viewStore.js +104 -0
- package/dist/inspector/canvas/wheelPan.d.ts +8 -0
- package/dist/inspector/canvas/wheelPan.js +8 -0
- package/dist/inspector/changes/changesLog.d.ts +9 -6
- package/dist/inspector/changes/changesLog.js +48 -32
- package/dist/inspector/changes/codecs.d.ts +1 -0
- package/dist/inspector/changes/codecs.js +10 -1
- package/dist/inspector/changes/draftChanges.d.ts +58 -0
- package/dist/inspector/changes/draftChanges.js +304 -0
- package/dist/inspector/changes/editModel.d.ts +10 -0
- package/dist/inspector/changes/editModel.js +9 -2
- package/dist/inspector/changes/previewDiagnostics.d.ts +4 -2
- package/dist/inspector/changes/previewDiagnostics.js +11 -25
- package/dist/inspector/changes/types.d.ts +7 -0
- package/dist/inspector/clientManifest.d.ts +1 -1
- package/dist/inspector/comments/CommentsOverlay.d.ts +2 -0
- package/dist/inspector/comments/CommentsOverlay.js +250 -0
- package/dist/inspector/comments/element.d.ts +6 -0
- package/dist/inspector/comments/element.js +54 -0
- package/dist/inspector/comments/store.d.ts +29 -0
- package/dist/inspector/comments/store.js +121 -0
- package/dist/inspector/comments/verification.d.ts +5 -0
- package/dist/inspector/comments/verification.js +52 -0
- package/dist/inspector/componentSemantics/adapterRegistry.d.ts +6 -1
- package/dist/inspector/componentSemantics/adapterRegistry.js +23 -1
- package/dist/inspector/componentSemantics/reactRuntime.d.ts +2 -1
- package/dist/inspector/componentSemantics/reactRuntime.js +38 -0
- package/dist/inspector/componentSemantics/runtimeBridge.d.ts +4 -2
- package/dist/inspector/componentSemantics/runtimeBridge.js +17 -0
- package/dist/inspector/componentSemantics/types.d.ts +11 -0
- package/dist/inspector/drafts/model.d.ts +35 -0
- package/dist/inspector/drafts/model.js +45 -0
- package/dist/inspector/drafts/store.d.ts +28 -0
- package/dist/inspector/drafts/store.js +231 -0
- package/dist/inspector/index.js +20 -27
- package/dist/inspector/inline-text/inlineTextEditor.js +7 -0
- package/dist/inspector/inspection/useBrowserCssInspection.js +15 -1
- package/dist/inspector/iterations/capture.d.ts +2 -0
- package/dist/inspector/iterations/capture.js +174 -0
- package/dist/inspector/iterations/client.d.ts +7 -0
- package/dist/inspector/iterations/client.js +52 -0
- package/dist/inspector/iterations/coordinator.d.ts +15 -0
- package/dist/inspector/iterations/coordinator.js +130 -0
- package/dist/inspector/iterations/prompt.d.ts +3 -0
- package/dist/inspector/iterations/prompt.js +26 -0
- package/dist/inspector/overlay/DomNavigator.js +21 -15
- package/dist/inspector/overlay/interactionStyles.js +3 -1
- package/dist/inspector/overlay/spacingGestures.d.ts +13 -1
- package/dist/inspector/overlay/spacingGestures.js +82 -5
- package/dist/inspector/projection/{workspaceProjection.d.ts → draftProjection.d.ts} +6 -6
- package/dist/inspector/projection/{workspaceProjection.js → draftProjection.js} +4 -4
- package/dist/inspector/projection/renderedInstance.d.ts +17 -3
- package/dist/inspector/projection/renderedInstance.js +62 -11
- package/dist/inspector/projection/structuralProjection.d.ts +2 -1
- package/dist/inspector/projection/structuralProjection.js +21 -17
- package/dist/inspector/projection/textProjection.d.ts +2 -1
- package/dist/inspector/projection/textProjection.js +64 -15
- package/dist/inspector/prompt/PromptSettingsDialog.js +1 -5
- package/dist/inspector/prompt/clipboardHandoff.d.ts +15 -18
- package/dist/inspector/prompt/clipboardHandoff.js +97 -143
- package/dist/inspector/prompt/generatePrompt.d.ts +4 -1
- package/dist/inspector/prompt/generatePrompt.js +22 -17
- package/dist/inspector/runtime/runtimeConfig.d.ts +9 -0
- package/dist/inspector/runtime/runtimeConfig.js +24 -0
- package/dist/inspector/selection/sourceSite.d.ts +12 -0
- package/dist/inspector/selection/sourceSite.js +28 -0
- package/dist/inspector/settings/SettingsDialog.js +21 -8
- package/dist/inspector/shell/AgentStatusButton.d.ts +11 -0
- package/dist/inspector/shell/AgentStatusButton.js +36 -0
- package/dist/inspector/shell/AppShell.js +4 -2
- package/dist/inspector/shell/ChangesLog.js +46 -26
- package/dist/inspector/shell/CopyPromptButton.js +184 -93
- package/dist/inspector/shell/EmptyState.js +9 -8
- package/dist/inspector/shell/InspectorShell.js +13 -21
- package/dist/inspector/shell/PeekOriginalButton.js +24 -23
- package/dist/inspector/shell/originalPreview.js +5 -5
- package/dist/inspector/shell/shortcuts.d.ts +3 -0
- package/dist/inspector/shell/shortcuts.js +11 -0
- package/dist/inspector/sketch/SketchEditor.js +14 -14
- package/dist/inspector/sketch/SketchEntryButton.js +1 -1
- package/dist/inspector/sketch/SketchFrameOverlay.d.ts +3 -1
- package/dist/inspector/sketch/SketchFrameOverlay.js +11 -8
- package/dist/inspector/sketch/SketchLayersPanel.js +13 -5
- package/dist/inspector/sketch/SketchOverlay.js +7 -7
- package/dist/inspector/sketch/SketchWorkspace.js +18 -12
- package/dist/inspector/sketch/interaction.d.ts +1 -0
- package/dist/inspector/sketch/interaction.js +8 -4
- package/dist/inspector/sketch/model.d.ts +5 -0
- package/dist/inspector/sketch/model.js +6 -2
- package/dist/inspector/sketch/raster.d.ts +1 -2
- package/dist/inspector/sketch/raster.js +68 -4
- package/dist/inspector/styleEditors/BackgroundEditor.d.ts +4 -0
- package/dist/inspector/styleEditors/BackgroundEditor.js +195 -0
- package/dist/inspector/styleEditors/BorderEditor.js +49 -78
- package/dist/inspector/styleEditors/BorderRadiusEditor.js +6 -1
- package/dist/inspector/styleEditors/BoxShadowEditor.d.ts +1 -2
- package/dist/inspector/styleEditors/BoxShadowEditor.js +132 -4
- package/dist/inspector/styleEditors/ColorPicker.d.ts +5 -1
- package/dist/inspector/styleEditors/ColorPicker.js +10 -4
- package/dist/inspector/styleEditors/GapField.js +3 -5
- package/dist/inspector/styleEditors/GridChildSection.d.ts +1 -1
- package/dist/inspector/styleEditors/GridChildSection.js +18 -9
- package/dist/inspector/styleEditors/GridPicker.d.ts +1 -1
- package/dist/inspector/styleEditors/GridPicker.js +8 -2
- package/dist/inspector/styleEditors/GridSection.js +1 -1
- package/dist/inspector/styleEditors/GridValueField.js +19 -14
- package/dist/inspector/styleEditors/ImageBackgroundEditor.d.ts +18 -0
- package/dist/inspector/styleEditors/ImageBackgroundEditor.js +118 -0
- package/dist/inspector/styleEditors/LayoutBlockedIndicator.d.ts +2 -2
- package/dist/inspector/styleEditors/LayoutBlockedIndicator.js +3 -3
- package/dist/inspector/styleEditors/LayoutComboField.js +6 -4
- package/dist/inspector/styleEditors/LayoutDropdown.js +6 -3
- package/dist/inspector/styleEditors/LayoutSection.js +32 -11
- package/dist/inspector/styleEditors/SpacingBox.js +7 -5
- package/dist/inspector/styleEditors/Typography.js +11 -3
- package/dist/inspector/styleEditors/backgroundLayers.d.ts +24 -0
- package/dist/inspector/styleEditors/backgroundLayers.js +51 -0
- package/dist/inspector/styleEditors/gradientValue.d.ts +17 -0
- package/dist/inspector/styleEditors/gradientValue.js +114 -0
- package/dist/inspector/styleEditors/inlineAuthored.d.ts +10 -0
- package/dist/inspector/styleEditors/inlineAuthored.js +114 -0
- package/dist/inspector/styleEditors/layoutValue.d.ts +0 -8
- package/dist/inspector/styleEditors/layoutValue.js +0 -42
- package/dist/inspector/styleEditors/nudgeValue.d.ts +2 -2
- package/dist/inspector/styleEditors/nudgeValue.js +36 -8
- package/dist/inspector/tokens/TokenField.d.ts +7 -0
- package/dist/inspector/tokens/TokenField.js +35 -25
- package/dist/inspector/tokens/TokenLabel.js +5 -14
- package/dist/inspector/tokens/editActions.d.ts +1 -1
- package/dist/inspector/tokens/editActions.js +7 -1
- package/dist/inspector/ui/AtRuleContext.js +4 -6
- package/dist/inspector/ui/Button.d.ts +6 -2
- package/dist/inspector/ui/Button.js +4 -3
- package/dist/inspector/ui/ControlSurface.d.ts +2 -2
- package/dist/inspector/ui/ControlSurface.js +4 -3
- package/dist/inspector/ui/InlineStyleWarning.d.ts +11 -0
- package/dist/inspector/ui/InlineStyleWarning.js +13 -0
- package/dist/inspector/ui/InspectorPopover.d.ts +2 -1
- package/dist/inspector/ui/InspectorPopover.js +4 -5
- package/dist/inspector/ui/PopoverListbox.d.ts +2 -1
- package/dist/inspector/ui/PopoverListbox.js +8 -7
- package/dist/inspector/ui/SegmentedControl.d.ts +2 -1
- package/dist/inspector/ui/SegmentedControl.js +2 -2
- package/dist/inspector/ui/Select.d.ts +6 -1
- package/dist/inspector/ui/Select.js +7 -11
- package/dist/inspector/ui/SideValuesField.js +1 -1
- package/dist/inspector/ui/Tooltip.d.ts +26 -0
- package/dist/inspector/ui/Tooltip.js +32 -0
- package/dist/inspector/ui/classNames.d.ts +2 -0
- package/dist/inspector/ui/classNames.js +4 -0
- package/dist/inspector/ui/customCursors.d.ts +23 -0
- package/dist/inspector/ui/customCursors.js +122 -0
- package/dist/inspector/ui/dragCursor.d.ts +0 -2
- package/dist/inspector/ui/dragCursor.js +2 -10
- package/dist/inspector/ui/portalContainer.d.ts +2 -0
- package/dist/inspector/ui/portalContainer.js +6 -0
- package/dist/inspector/ui/styles.js +29 -21
- package/dist/inspector/workspace/commands.d.ts +9 -0
- package/dist/inspector/workspace/commands.js +82 -0
- package/dist/inspector/workspace/controller.d.ts +4 -0
- package/dist/inspector/workspace/controller.js +66 -0
- package/dist/inspector/workspace/handoff.d.ts +42 -0
- package/dist/inspector/workspace/handoff.js +115 -0
- package/dist/inspector/workspace/sentItems.d.ts +19 -0
- package/dist/inspector/workspace/sentItems.js +51 -0
- package/dist/inspector/workspace/timeline.d.ts +30 -0
- package/dist/inspector/workspace/timeline.js +108 -0
- package/dist/internal/agent-protocol.d.ts +19 -2
- package/dist/internal/agent-protocol.js +13 -0
- package/dist/nudge-ui.mjs +558 -311
- package/dist/project/artifacts.d.ts +13 -0
- package/dist/project/artifacts.js +253 -0
- package/dist/transport/artifacts.d.ts +8 -0
- package/dist/transport/artifacts.js +9 -0
- package/dist/transport/editor.js +3 -1
- package/dist/transport/routes.d.ts +2 -0
- package/dist/transport/routes.js +2 -0
- package/package.json +7 -3
- package/dist/inspector/changes/workspaceChanges.d.ts +0 -47
- package/dist/inspector/changes/workspaceChanges.js +0 -265
package/README.md
CHANGED
|
@@ -1,66 +1,184 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Nudge UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Edit the look of your running app in the browser, then hand the changes to your
|
|
4
|
+
coding agent. Nudge UI is a development-only visual inspector for Next.js,
|
|
5
|
+
Astro, Vite with React, and static HTML.
|
|
6
|
+
|
|
7
|
+
Select an element, adjust its design, and see the result immediately. Copy a
|
|
8
|
+
structured prompt or send it to a connected agent to apply the changes to your
|
|
9
|
+
source code. Nudge previews app edits; your coding agent implements them.
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
## Get started
|
|
14
|
+
|
|
15
|
+
Run this from your application's root directory:
|
|
4
16
|
|
|
5
17
|
```sh
|
|
6
|
-
|
|
18
|
+
npm create nudge-ui@latest
|
|
7
19
|
```
|
|
8
20
|
|
|
9
|
-
|
|
21
|
+
The initializer installs `nudge-ui`, configures your framework, and offers to
|
|
22
|
+
connect a coding agent. Start your app with its usual development command and
|
|
23
|
+
open the local URL to use the editor.
|
|
24
|
+
|
|
25
|
+
Requires Node.js 20 or later. Your framework or build tool may require a newer
|
|
26
|
+
version. Supported host versions are Vite 5+, Next.js 15.3–16.x, and Astro 5+;
|
|
27
|
+
React integrations support React 18 and 19. Framework peer dependencies are
|
|
28
|
+
optional, so you only need the tools your app uses.
|
|
29
|
+
|
|
30
|
+
## What you can do
|
|
10
31
|
|
|
11
|
-
|
|
32
|
+
- **Inspect and edit:** Preview layout, spacing, typography, colors, backgrounds,
|
|
33
|
+
borders, shadows, text, design tokens, and supported component props.
|
|
34
|
+
- **Compare pages:** Open routes in Canvas frames, resize them, and create linked
|
|
35
|
+
duplicates to compare the same design at different viewport sizes.
|
|
36
|
+
- **Explore alternatives:** Create independent HTML iterations from a frame,
|
|
37
|
+
refine them, and ask an agent to implement your chosen design in the live app.
|
|
38
|
+
- **Explain changes:** Add comments and sketches alongside visual edits.
|
|
39
|
+
- **Hand off to an agent:** Copy a prompt with source context, or send it through
|
|
40
|
+
the optional MCP integration and see the agent's status in the editor.
|
|
41
|
+
|
|
42
|
+
## Use the editor
|
|
43
|
+
|
|
44
|
+
| Tool | Shortcut | Action |
|
|
12
45
|
| --- | --- | --- |
|
|
13
|
-
| `
|
|
14
|
-
| `
|
|
15
|
-
| `
|
|
16
|
-
| `
|
|
46
|
+
| Select | `V` | Select elements to inspect and edit. |
|
|
47
|
+
| Comment | `C` | Attach a note to an element. |
|
|
48
|
+
| Pencil | `P` | Draw on the page and add sketch notes. |
|
|
49
|
+
| Use app normally | Hold `A` in Canvas | Interact with the app. You can also select this tool in the toolbar. |
|
|
50
|
+
|
|
51
|
+
Hold `Space` to pan the canvas. Use undo and redo to revisit edits and frame
|
|
52
|
+
changes. Comments and pending edits are saved locally.
|
|
53
|
+
|
|
54
|
+
Use **Duplicate** for a linked live frame or **Iteration** for an independent
|
|
55
|
+
HTML design. Iterations save HTML and CSS under `.nudge/artifacts/` in your
|
|
56
|
+
project. They capture the rendered design without the app's scripts. Iteration
|
|
57
|
+
prompts ask the agent to edit that HTML; **Copy prompt for live app** asks it to
|
|
58
|
+
implement the design in application source.
|
|
59
|
+
|
|
60
|
+
After handoff, comments clear when Nudge detects that the target's content or
|
|
61
|
+
appearance changed at the same viewport size, with previews removed. This
|
|
62
|
+
detects a change; it does not verify that the note was satisfied. Missing or
|
|
63
|
+
ambiguous targets keep their comments.
|
|
64
|
+
|
|
65
|
+
## Connect a coding agent
|
|
66
|
+
|
|
67
|
+
To add or repair agent integration in an installed project, run:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
npx nudge-ui agent setup
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Setup installs [`@nudge-ui/mcp`](https://www.npmjs.com/package/@nudge-ui/mcp)
|
|
74
|
+
and configures your selected agent. Fully restart the agent host, ask it to
|
|
75
|
+
**listen to Nudge in this workspace**, and keep it listening while you send
|
|
76
|
+
changes. You can use copied prompts without MCP.
|
|
77
|
+
|
|
78
|
+
The MCP integration is early alpha. For diagnostics, run
|
|
79
|
+
`npx nudge-ui agent doctor` from the app directory. See the
|
|
80
|
+
[coding-agent guide](https://github.com/charlessmart/nudge-ui/blob/main/docs/agent-integration.md)
|
|
81
|
+
for host limitations and session selection.
|
|
82
|
+
|
|
83
|
+
## Manual installation
|
|
84
|
+
|
|
85
|
+
Install the package as a development dependency:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
npm install --save-dev nudge-ui
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Choose the integration for your host. There is no root `nudge-ui` import.
|
|
92
|
+
|
|
93
|
+
### Vite with React
|
|
94
|
+
|
|
95
|
+
Wrap your existing `vite.config.ts` configuration:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
import { defineConfig } from "vite";
|
|
99
|
+
import react from "@vitejs/plugin-react";
|
|
100
|
+
import { withNudgeUi } from "nudge-ui/vite";
|
|
101
|
+
|
|
102
|
+
export default withNudgeUi(defineConfig({
|
|
103
|
+
plugins: [react()],
|
|
104
|
+
}));
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
For authored workspace packages outside the app root, pass their directories
|
|
108
|
+
with `sourceRoots`, for example `withNudgeUi(config, { sourceRoots: ["../../packages/ui"] })`.
|
|
109
|
+
Dependency and generated-output directories remain excluded. Vite and Astro
|
|
110
|
+
also accept `debug: true` for experimental DOM parent and child navigation.
|
|
111
|
+
|
|
112
|
+
### Next.js
|
|
113
|
+
|
|
114
|
+
Wrap your `next.config.ts` configuration:
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
import { withNudgeUi } from "nudge-ui/next";
|
|
17
118
|
|
|
18
|
-
|
|
19
|
-
optional. Installing this package never asks for a toolchain the project does
|
|
20
|
-
not use.
|
|
119
|
+
const nextConfig = {};
|
|
21
120
|
|
|
22
|
-
|
|
121
|
+
export default withNudgeUi(nextConfig);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The integration supports Webpack and Turbopack. Use `sourceRoots` for authored
|
|
125
|
+
workspace directories outside the application root.
|
|
126
|
+
|
|
127
|
+
### Astro
|
|
23
128
|
|
|
129
|
+
Add the integration to `astro.config.ts`:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
import { defineConfig } from "astro/config";
|
|
133
|
+
import { nudgeUiAstro } from "nudge-ui/astro";
|
|
134
|
+
|
|
135
|
+
export default defineConfig({
|
|
136
|
+
integrations: [nudgeUiAstro()],
|
|
137
|
+
});
|
|
24
138
|
```
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
html/ parse5 identity instrumentation
|
|
139
|
+
|
|
140
|
+
`withNudgeUi(defineConfig(...))` from `nudge-ui/astro` is also supported and is
|
|
141
|
+
the form used by the initializer.
|
|
142
|
+
|
|
143
|
+
### Static HTML
|
|
144
|
+
|
|
145
|
+
Serve a directory of HTML, CSS, and assets:
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
npx nudge-ui serve ./prototype
|
|
36
149
|
```
|
|
37
150
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
151
|
+
The server binds to loopback, instruments HTML in memory, and reloads after file
|
|
152
|
+
changes. Dot-prefixed files and directories, including `.env`, are not served.
|
|
153
|
+
|
|
154
|
+
## Development and automated tests
|
|
41
155
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
belongs under `project/`. A test in the package enforces this.
|
|
156
|
+
Nudge is enabled by default in development. Standard production builds exclude
|
|
157
|
+
the inspector bootstrap, identity attributes, and token data.
|
|
45
158
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
159
|
+
- **Disable for one tab:** Add `?nudge-ui=off`. The setting persists as you
|
|
160
|
+
navigate in that tab. Add `?nudge-ui=on` to enable it again.
|
|
161
|
+
- **Disable for one server run:** Start the server with `NUDGE_UI=0`, for example
|
|
162
|
+
`NUDGE_UI=0 npm run dev`.
|
|
163
|
+
- **Disable in framework configuration:** Pass `enabled: false`, for example
|
|
164
|
+
`withNudgeUi(config, { enabled: false })` or `nudgeUiAstro({ enabled: false })`.
|
|
49
165
|
|
|
50
|
-
|
|
166
|
+
Automated browsers with `navigator.webdriver` enabled get the plain app by
|
|
167
|
+
default. To test the editor, add `?nudge-ui=on` to the first URL or start the
|
|
168
|
+
development server with `NUDGE_UI=1`.
|
|
51
169
|
|
|
52
|
-
|
|
53
|
-
versioning:
|
|
170
|
+
## Package entry points
|
|
54
171
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
172
|
+
Use `nudge-ui/vite`, `nudge-ui/next`, `nudge-ui/astro`, or `nudge-ui/static` for
|
|
173
|
+
host integration. `nudge-ui/testing` provides consumer test fixtures, and
|
|
174
|
+
`nudge-ui/virtual-design-tokens` provides ambient types for the token transport
|
|
175
|
+
module. Imports under `nudge-ui/internal/*` are implementation details and may
|
|
176
|
+
change without notice.
|
|
59
177
|
|
|
60
|
-
|
|
61
|
-
The host adapters inject or resolve these imports; application code must not
|
|
62
|
-
import them directly. They may change without notice.
|
|
178
|
+
## Links
|
|
63
179
|
|
|
64
|
-
|
|
65
|
-
[
|
|
66
|
-
[
|
|
180
|
+
[Initializer](https://www.npmjs.com/package/create-nudge-ui) ·
|
|
181
|
+
[MCP integration](https://www.npmjs.com/package/@nudge-ui/mcp) ·
|
|
182
|
+
[Repository](https://github.com/charlessmart/nudge-ui) ·
|
|
183
|
+
[Issues](https://github.com/charlessmart/nudge-ui/issues) ·
|
|
184
|
+
[MIT license](https://github.com/charlessmart/nudge-ui/blob/main/LICENSE)
|