@agent-native/core 0.84.53 → 0.84.55
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/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +13 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/skills.ts +34 -16
- package/corpus/core/src/client/AssistantChat.tsx +198 -146
- package/corpus/core/src/client/agent-chat-adapter.ts +14 -4
- package/corpus/core/src/client/blocks/library/diagram.config.ts +13 -2
- package/corpus/core/src/client/blocks/library/diagram.tsx +27 -3
- package/corpus/core/src/client/blocks/library/server-specs.ts +2 -2
- package/corpus/core/src/client/blocks/library/wireframe.config.ts +7 -1
- package/corpus/core/src/client/blocks/library/wireframe.tsx +42 -3
- package/corpus/core/src/client/blocks/types.ts +9 -0
- package/corpus/core/src/client/chat/message-components.tsx +6 -2
- package/corpus/core/src/client/sse-event-processor.ts +11 -4
- package/corpus/core/src/client/use-agent-engine-configured.ts +54 -12
- package/corpus/core/src/server/agent-chat-plugin.ts +9 -5
- package/corpus/core/src/styles/agent-native.css +44 -0
- package/corpus/core/src/styles/blocks.css +18 -0
- package/corpus/templates/plan/.agents/skills/visual-plan/references/document-quality.md +10 -6
- package/corpus/templates/plan/.agents/skills/visual-plan/references/wireframe.md +20 -9
- package/corpus/templates/plan/.agents/skills/visual-recap/SKILL.md +4 -1
- package/corpus/templates/plan/.agents/skills/visual-recap/references/wireframe.md +20 -9
- package/corpus/templates/plan/actions/create-ui-plan.ts +1 -1
- package/corpus/templates/plan/actions/create-visual-plan.ts +1 -1
- package/corpus/templates/plan/actions/create-visual-recap.ts +1 -1
- package/corpus/templates/plan/actions/get-plan-blocks.ts +2 -0
- package/corpus/templates/plan/app/components/plan/planBlocks.tsx +2 -0
- package/corpus/templates/plan/app/components/plan/wireframe/Wireframe.tsx +38 -4
- package/corpus/templates/plan/app/components/plan/wireframe/html-artboard.css +18 -0
- package/corpus/templates/plan/app/global.css +1 -2
- package/corpus/templates/plan/changelog/2026-07-02-plan-chat-keeps-the-composer-anchored-when-connect-ai-appears.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-02-wireframe-and-diagram-blocks-can-now-show-or-hide-their-outer-frame.md +6 -0
- package/corpus/templates/plan/server/plan-mdx.ts +3 -0
- package/corpus/templates/plan/shared/plan-content.ts +8 -0
- package/dist/cli/skills.d.ts +3 -3
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +34 -16
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +65 -45
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +12 -2
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/blocks/library/diagram.config.d.ts +3 -1
- package/dist/client/blocks/library/diagram.config.d.ts.map +1 -1
- package/dist/client/blocks/library/diagram.config.js +10 -1
- package/dist/client/blocks/library/diagram.config.js.map +1 -1
- package/dist/client/blocks/library/diagram.d.ts.map +1 -1
- package/dist/client/blocks/library/diagram.js +13 -7
- package/dist/client/blocks/library/diagram.js.map +1 -1
- package/dist/client/blocks/library/server-specs.js +2 -2
- package/dist/client/blocks/library/server-specs.js.map +1 -1
- package/dist/client/blocks/library/wireframe.config.d.ts +3 -1
- package/dist/client/blocks/library/wireframe.config.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe.config.js +4 -0
- package/dist/client/blocks/library/wireframe.config.js.map +1 -1
- package/dist/client/blocks/library/wireframe.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe.js +20 -9
- package/dist/client/blocks/library/wireframe.js.map +1 -1
- package/dist/client/blocks/types.d.ts +8 -0
- package/dist/client/blocks/types.d.ts.map +1 -1
- package/dist/client/blocks/types.js.map +1 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +6 -2
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +9 -4
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts +10 -1
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +35 -10
- package/dist/client/use-agent-engine-configured.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +4 -4
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +9 -2
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/styles/agent-native.css +44 -0
- package/dist/styles/blocks.css +18 -0
- package/package.json +1 -1
|
@@ -171,15 +171,26 @@ occurrence. The result is re-sanitized. In local-files privacy mode, do not call
|
|
|
171
171
|
hosted Plan tools; edit the local MDX source directly and rerun the local
|
|
172
172
|
check/serve or verify command for `<plan-dir>`.
|
|
173
173
|
|
|
174
|
-
**
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
`
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
174
|
+
**Choose the outer frame deliberately.** Wireframe and diagram data accept
|
|
175
|
+
`frame: "auto" | "show" | "hide"` in block data (`<Screen frame="hide">` in
|
|
176
|
+
MDX wireframes, `<Diagram frame="hide">` for MDX diagrams). Leave it unset or
|
|
177
|
+
`auto` when the host context should decide: Plan and recap surfaces default to a
|
|
178
|
+
drawn outer frame; docs surfaces default to no outer frame. Use `show` for
|
|
179
|
+
standalone product screens, before/after recap comparisons, screenshot-like
|
|
180
|
+
artifacts, and visuals that need containment from surrounding prose. Use `hide`
|
|
181
|
+
when a docs page, tab, column, card, canvas artboard, or the visual's own
|
|
182
|
+
internal chrome already supplies the boundary. Do not use `hide` to compensate
|
|
183
|
+
for cramped content; fix the layout instead.
|
|
184
|
+
|
|
185
|
+
**Inner padding and borders still matter.** Always wrap HTML wireframe content
|
|
186
|
+
in a root container with real inner padding before drawing cards, fields, pills,
|
|
187
|
+
labels, or controls. Use at least 14-16px of padding, `box-sizing: border-box`,
|
|
188
|
+
`height: 100%`, and `gap` between child rows on the root node itself so the
|
|
189
|
+
first row never sits flush against the screen edge. Do not rely on padding on a
|
|
190
|
+
nested page section as the first visible inset; the outermost element must
|
|
191
|
+
create the breathing room. Keep text away from borders: every container, field,
|
|
192
|
+
button, menu item, and annotation needs enough padding and line-height to read
|
|
193
|
+
cleanly in the rendered Plan view.
|
|
183
194
|
|
|
184
195
|
**For feature-cloud or abundance visuals, optimize the composition over line-by-line
|
|
185
196
|
reading.** Some marketing/product sections need to feel like a large surface area
|
|
@@ -377,7 +377,10 @@ tags — resolve every conceptual name to its exact tag + prop schema with the
|
|
|
377
377
|
Author diagram HTML/CSS with the renderer-owned `.diagram-*` primitives
|
|
378
378
|
(`.diagram-panel`, `.diagram-node`, `.diagram-pill`, `[data-rough]`, …) and
|
|
379
379
|
the same `--wf-*` theme tokens `references/wireframe.md` defines — never
|
|
380
|
-
`font-family`, hex, rgb/hsl literals, or one-off dark/light palettes.
|
|
380
|
+
`font-family`, hex, rgb/hsl literals, or one-off dark/light palettes. Choose
|
|
381
|
+
the outer `frame` intentionally: recap diagrams usually benefit from
|
|
382
|
+
`frame: "show"` when they stand alone, but use `frame: "hide"` when columns,
|
|
383
|
+
tabs, a card, or the diagram's own panels already provide the boundary.
|
|
381
384
|
- **Outcome-first narrative** → `rich-text` for the "what changed and why" prose:
|
|
382
385
|
the objective the diff served, the key decisions visible in it, and the risks a
|
|
383
386
|
reviewer should weigh. This is the only place the model writes freely.
|
|
@@ -171,15 +171,26 @@ occurrence. The result is re-sanitized. In local-files privacy mode, do not call
|
|
|
171
171
|
hosted Plan tools; edit the local MDX source directly and rerun the local
|
|
172
172
|
check/serve or verify command for `<plan-dir>`.
|
|
173
173
|
|
|
174
|
-
**
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
`
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
174
|
+
**Choose the outer frame deliberately.** Wireframe and diagram data accept
|
|
175
|
+
`frame: "auto" | "show" | "hide"` in block data (`<Screen frame="hide">` in
|
|
176
|
+
MDX wireframes, `<Diagram frame="hide">` for MDX diagrams). Leave it unset or
|
|
177
|
+
`auto` when the host context should decide: Plan and recap surfaces default to a
|
|
178
|
+
drawn outer frame; docs surfaces default to no outer frame. Use `show` for
|
|
179
|
+
standalone product screens, before/after recap comparisons, screenshot-like
|
|
180
|
+
artifacts, and visuals that need containment from surrounding prose. Use `hide`
|
|
181
|
+
when a docs page, tab, column, card, canvas artboard, or the visual's own
|
|
182
|
+
internal chrome already supplies the boundary. Do not use `hide` to compensate
|
|
183
|
+
for cramped content; fix the layout instead.
|
|
184
|
+
|
|
185
|
+
**Inner padding and borders still matter.** Always wrap HTML wireframe content
|
|
186
|
+
in a root container with real inner padding before drawing cards, fields, pills,
|
|
187
|
+
labels, or controls. Use at least 14-16px of padding, `box-sizing: border-box`,
|
|
188
|
+
`height: 100%`, and `gap` between child rows on the root node itself so the
|
|
189
|
+
first row never sits flush against the screen edge. Do not rely on padding on a
|
|
190
|
+
nested page section as the first visible inset; the outermost element must
|
|
191
|
+
create the breathing room. Keep text away from borders: every container, field,
|
|
192
|
+
button, menu item, and annotation needs enough padding and line-height to read
|
|
193
|
+
cleanly in the rendered Plan view.
|
|
183
194
|
|
|
184
195
|
**For feature-cloud or abundance visuals, optimize the composition over line-by-line
|
|
185
196
|
reading.** Some marketing/product sections need to feel like a large surface area
|
|
@@ -72,7 +72,7 @@ export default defineAction({
|
|
|
72
72
|
content: planContentSchema
|
|
73
73
|
.optional()
|
|
74
74
|
.describe(
|
|
75
|
-
|
|
75
|
+
'Structured editable UI plan content. Prefer this for app-owned top canvas wireframes (HTML mockups: set the wireframe\'s data.html to a semantic HTML fragment of the screen and pick a surface — the renderer owns the theme, footprint/aspect, hand-drawn font, and sketch overlay; use --wf-* CSS tokens for any custom color, never hex). Call get-plan-blocks first for visual frame guidance before choosing frame: "show" or frame: "hide". Do not use legacy kit-tree screen arrays or nested FrameScreen/Card/Row/Btn-style children for new canvas artboards. Use sketch diagrams, rich text, code blocks (grouped in a vertical tabs block for a file map), annotated code for key files, validation checklists, and bounded custom HTML fragments. Diagram data.html/data.css should use renderer-owned .diagram-* primitives plus --wf-* tokens, not custom fonts or hard-coded hex/rgb/hsl colors, so light/dark and sketchy Excalifont/rough.js modes remain correct. The canvas should carry Claude-style flex/grid wireframe artboards and designer annotations; the document should add implementation substance instead of duplicating the same wireframes. The renderer owns all visual styling; emit lean content, not pixels.',
|
|
76
76
|
),
|
|
77
77
|
markdown: z
|
|
78
78
|
.string()
|
|
@@ -84,7 +84,7 @@ export default defineAction({
|
|
|
84
84
|
content: planContentSchema
|
|
85
85
|
.optional()
|
|
86
86
|
.describe(
|
|
87
|
-
"Structured editable plan content. Prefer this for rich text, inline diagrams, annotated code, question-form open questions, and optional canvas/prototype UI surfaces. Call the get-plan-blocks tool FIRST for the authoritative block catalog, authoring rules, and style tokens — do not author from memory. Key rules: canvas frames use wireframe data.html/html semantic HTML, not legacy kit-tree screen arrays; use diagram blocks with .diagram-* primitives and --wf-* tokens (no hex/rgb/hsl, no custom fonts); for file maps use annotated-code blocks in a vertical tabs block; put unresolved decisions in a bottom question-form block.",
|
|
87
|
+
"Structured editable plan content. Prefer this for rich text, inline diagrams, annotated code, question-form open questions, and optional canvas/prototype UI surfaces. Call the get-plan-blocks tool FIRST for the authoritative block catalog, visual frame guidance, authoring rules, and style tokens — do not author from memory. Key rules: canvas frames use wireframe data.html/html semantic HTML, not legacy kit-tree screen arrays; use diagram blocks with .diagram-* primitives and --wf-* tokens (no hex/rgb/hsl, no custom fonts); for file maps use annotated-code blocks in a vertical tabs block; put unresolved decisions in a bottom question-form block.",
|
|
88
88
|
),
|
|
89
89
|
markdown: z
|
|
90
90
|
.string()
|
|
@@ -245,7 +245,7 @@ export default defineAction({
|
|
|
245
245
|
.describe("Current focus for the review surface."),
|
|
246
246
|
status: planStatusSchema.optional().default("review"),
|
|
247
247
|
mdx: planMdxFileSchema.describe(
|
|
248
|
-
"Recap source files. Call the get-plan-blocks tool FIRST for the authoritative block catalog, authoring rules, and style tokens — do not author from memory. Key rules: derive all blocks from the real diff only; use diff blocks with line-anchored annotations on key hunks; for UI changes include realistic, non-empty WireframeBlock before/after in a Columns block (labels: Before / After) with visible product text/controls; if canvas.mdx is present, DesignBoard artboards must use Screen html/data.html wireframes, never fresh nested kit-tree children such as FrameScreen/Card/Row/Btn; use .diagram-* primitives and --wf-* tokens in diagrams (no hex/rgb/hsl, no custom fonts); keep API endpoint blocks in single-column flow unless it is an explicit before/after contract comparison.",
|
|
248
|
+
"Recap source files. Call the get-plan-blocks tool FIRST for the authoritative block catalog, visual frame guidance, authoring rules, and style tokens — do not author from memory. Key rules: derive all blocks from the real diff only; use diff blocks with line-anchored annotations on key hunks; for UI changes include realistic, non-empty WireframeBlock before/after in a Columns block (labels: Before / After) with visible product text/controls; if canvas.mdx is present, DesignBoard artboards must use Screen html/data.html wireframes, never fresh nested kit-tree children such as FrameScreen/Card/Row/Btn; use .diagram-* primitives and --wf-* tokens in diagrams (no hex/rgb/hsl, no custom fonts); keep API endpoint blocks in single-column flow unless it is an explicit before/after contract comparison.",
|
|
249
249
|
),
|
|
250
250
|
}),
|
|
251
251
|
publicAgent: {
|
|
@@ -33,6 +33,8 @@ const AUTHORING_RULES_NOTE = `
|
|
|
33
33
|
|
|
34
34
|
**Wireframes**: set \`data.html\` to a semantic HTML fragment; pick a surface (desktop/mobile/popover/panel/browser). The renderer owns theme, footprint/aspect, Excalifont, and rough.js sketch overlay. Use \`--wf-*\` CSS tokens for any custom color (never hex). Prototype screens use semantic HTML with \`data-goto\` attributes for navigation.
|
|
35
35
|
|
|
36
|
+
**Visual frames**: \`wireframe\` and \`diagram\` data accept \`frame: "auto" | "show" | "hide"\`. Leave it unset/\`auto\` when the host context should decide: Plan and recap surfaces default to framed; docs default to unframed. Use \`frame: "show"\` for standalone product screens, before/after recap comparisons, screenshot-like artifacts, and visuals that need containment from surrounding prose. Use \`frame: "hide"\` when a docs page, tab, column, card, canvas artboard, or the visual's own internal chrome already supplies the boundary. Hiding the outer frame must not remove inner padding, meaningful card/field/button borders, or the visual's readable structure.
|
|
37
|
+
|
|
36
38
|
**Canvas storyboards**: if the user asks for a canvas, storyboard, wireframe, light storyboard, UI flow, screen flow, product flow, mockup, or visual comparison, the primary artifact must be \`content.canvas\` / \`canvas.mdx\` with \`DesignBoard\` artboards containing \`Screen\` HTML wireframes. Each canvas \`Screen\` must carry \`html\` / \`data.html\`; never author fresh nested kit-tree children such as \`<FrameScreen>\`, \`<Card>\`, \`<Row>\`, or \`<Btn>\` inside canvas \`<Screen>\` tags. Kit trees are old-plan compatibility only and often render worse on the pan/zoom canvas than HTML wireframes. Do not use document-body \`diagram\` blocks for the primary UI story. Use \`diagram\` only for architecture, data flow, or implementation mechanics below the canvas, and only after the UI storyboard exists.
|
|
37
39
|
|
|
38
40
|
**Before/After columns**: compose a \`columns\` block from \`<Column>\` CHILDREN — never a \`columns=\` attribute or inline JSON array. Author it as \`<Columns><Column label="Before">…child block(s)…</Column><Column label="After">…child block(s)…</Column></Columns>\`. Each \`<Column>\` wraps real nested blocks (e.g. a \`Wireframe\`); the parser fills in column ids and child-block \`data\` from that markup, whereas a \`columns=\` attribute array leaves them missing and FAILS schema validation. For UI state comparisons put one \`wireframe\` block in each side and label the columns \`Before\` and \`After\`; the renderer draws labels as headings and lays narrow surfaces side by side. Never bake Before/After labels inside the wireframe HTML or hand-stack the pair.
|
|
@@ -165,10 +165,12 @@ export function createPlanBlockRenderContext(options: {
|
|
|
165
165
|
editingDisabled?: boolean;
|
|
166
166
|
showCodeAnnotationOverlays?: boolean;
|
|
167
167
|
codeAnnotationLayout?: BlockRenderContext["codeAnnotationLayout"];
|
|
168
|
+
visualFrame?: BlockRenderContext["visualFrame"];
|
|
168
169
|
}): BlockRenderContext {
|
|
169
170
|
const ctx: BlockRenderContext & PlanBlockRenderContextExtras = {
|
|
170
171
|
dialect: "gfm",
|
|
171
172
|
textDirection: options.textDirection,
|
|
173
|
+
visualFrame: options.visualFrame ?? "show",
|
|
172
174
|
showCodeAnnotationOverlays: options.showCodeAnnotationOverlays,
|
|
173
175
|
codeAnnotationLayout: options.codeAnnotationLayout,
|
|
174
176
|
onQuestionFormSubmit: options.onVisualQuestionsSubmit,
|
|
@@ -121,10 +121,12 @@ export function Wireframe({
|
|
|
121
121
|
selectedDesignElementKey?: string | null;
|
|
122
122
|
onDesignElementSelect?: (selection: DesignElementSelection) => void;
|
|
123
123
|
}) {
|
|
124
|
+
const showFrame = "frame" in data && data.frame === "hide" ? false : true;
|
|
124
125
|
if (isHtmlData(data)) {
|
|
125
126
|
return (
|
|
126
127
|
<HtmlArtboard
|
|
127
128
|
data={data}
|
|
129
|
+
showFrame={showFrame}
|
|
128
130
|
compact={compact}
|
|
129
131
|
canvasSize={canvasSize}
|
|
130
132
|
canvasWidth={canvasWidth}
|
|
@@ -140,6 +142,7 @@ export function Wireframe({
|
|
|
140
142
|
return (
|
|
141
143
|
<KitWireframe
|
|
142
144
|
data={data}
|
|
145
|
+
showFrame={showFrame}
|
|
143
146
|
compact={compact}
|
|
144
147
|
canvasSize={canvasSize}
|
|
145
148
|
canvasWidth={canvasWidth}
|
|
@@ -167,6 +170,7 @@ function ArtboardFrame({
|
|
|
167
170
|
skeleton,
|
|
168
171
|
renderMode,
|
|
169
172
|
roughOverlay = true,
|
|
173
|
+
showFrame = true,
|
|
170
174
|
selector,
|
|
171
175
|
caption,
|
|
172
176
|
render,
|
|
@@ -178,6 +182,7 @@ function ArtboardFrame({
|
|
|
178
182
|
skeleton?: boolean;
|
|
179
183
|
renderMode?: "wireframe" | "design";
|
|
180
184
|
roughOverlay?: boolean;
|
|
185
|
+
showFrame?: boolean;
|
|
181
186
|
selector: string;
|
|
182
187
|
caption?: string;
|
|
183
188
|
render: (ctx: {
|
|
@@ -250,6 +255,7 @@ function ArtboardFrame({
|
|
|
250
255
|
ref={ref}
|
|
251
256
|
className="plan-kit-artboard relative"
|
|
252
257
|
data-rough-scope="wireframe"
|
|
258
|
+
data-frame={showFrame ? "show" : "hide"}
|
|
253
259
|
style={{
|
|
254
260
|
width,
|
|
255
261
|
height,
|
|
@@ -273,7 +279,7 @@ function ArtboardFrame({
|
|
|
273
279
|
are never cut, and a skeleton frame still reads as a frame). Sketchy
|
|
274
280
|
mode gets its frame from the rough overlay unless the caller needs
|
|
275
281
|
all borders to stay in the normal scrolling DOM. */}
|
|
276
|
-
{!roughEnabled && (
|
|
282
|
+
{!roughEnabled && showFrame && (
|
|
277
283
|
<div
|
|
278
284
|
className="pointer-events-none absolute inset-0"
|
|
279
285
|
style={{
|
|
@@ -285,6 +291,7 @@ function ArtboardFrame({
|
|
|
285
291
|
<RoughOverlay
|
|
286
292
|
scopeRef={ref}
|
|
287
293
|
enabled={roughEnabled}
|
|
294
|
+
drawFrame={showFrame}
|
|
288
295
|
frameRadius={preset.radius}
|
|
289
296
|
selector={selector}
|
|
290
297
|
/>
|
|
@@ -330,6 +337,7 @@ function WireframeStyleToggleButton() {
|
|
|
330
337
|
|
|
331
338
|
function HtmlArtboard({
|
|
332
339
|
data,
|
|
340
|
+
showFrame,
|
|
333
341
|
compact,
|
|
334
342
|
canvasSize,
|
|
335
343
|
canvasWidth,
|
|
@@ -340,6 +348,7 @@ function HtmlArtboard({
|
|
|
340
348
|
onDesignElementSelect,
|
|
341
349
|
}: {
|
|
342
350
|
data: PlanWireframeBlock["data"];
|
|
351
|
+
showFrame: boolean;
|
|
343
352
|
compact?: boolean;
|
|
344
353
|
canvasSize?: number;
|
|
345
354
|
canvasWidth?: number;
|
|
@@ -478,6 +487,7 @@ function HtmlArtboard({
|
|
|
478
487
|
skeleton={data.skeleton}
|
|
479
488
|
renderMode={renderMode}
|
|
480
489
|
roughOverlay={!interactive}
|
|
490
|
+
showFrame={showFrame}
|
|
481
491
|
selector={HTML_ROUGH_SELECTOR}
|
|
482
492
|
caption={data.caption}
|
|
483
493
|
render={({ theme, style }) => (
|
|
@@ -486,6 +496,7 @@ function HtmlArtboard({
|
|
|
486
496
|
className="plan-html-frame"
|
|
487
497
|
data-theme={theme}
|
|
488
498
|
data-style={style}
|
|
499
|
+
data-frame={showFrame ? "show" : "hide"}
|
|
489
500
|
data-render-mode={renderMode}
|
|
490
501
|
data-plan-design-scope={scopeId}
|
|
491
502
|
data-skeleton={data.skeleton ? "true" : undefined}
|
|
@@ -531,11 +542,13 @@ export function KitWireframePreview({
|
|
|
531
542
|
|
|
532
543
|
function KitWireframe({
|
|
533
544
|
data,
|
|
545
|
+
showFrame = data.frame !== "hide",
|
|
534
546
|
compact,
|
|
535
547
|
canvasSize,
|
|
536
548
|
canvasWidth,
|
|
537
549
|
}: {
|
|
538
550
|
data: PlanWireframeBlock["data"];
|
|
551
|
+
showFrame?: boolean;
|
|
539
552
|
compact?: boolean;
|
|
540
553
|
canvasSize?: number;
|
|
541
554
|
canvasWidth?: number;
|
|
@@ -547,6 +560,7 @@ function KitWireframe({
|
|
|
547
560
|
canvasSize={canvasSize}
|
|
548
561
|
canvasWidth={canvasWidth}
|
|
549
562
|
skeleton={data.skeleton}
|
|
563
|
+
showFrame={showFrame}
|
|
550
564
|
selector="[data-rough]"
|
|
551
565
|
caption={data.caption}
|
|
552
566
|
render={({ theme, style }) => (
|
|
@@ -588,6 +602,7 @@ export function SketchDiagram({
|
|
|
588
602
|
compact?: boolean;
|
|
589
603
|
}) {
|
|
590
604
|
const t = useT();
|
|
605
|
+
const showFrame = data.frame !== "hide";
|
|
591
606
|
if (data.html?.trim()) {
|
|
592
607
|
return <HtmlDiagram data={data} compact={compact} />;
|
|
593
608
|
}
|
|
@@ -599,6 +614,7 @@ export function SketchDiagram({
|
|
|
599
614
|
data={data}
|
|
600
615
|
compact={compact}
|
|
601
616
|
markerId={markerId}
|
|
617
|
+
showFrame={showFrame}
|
|
602
618
|
/>
|
|
603
619
|
);
|
|
604
620
|
}
|
|
@@ -613,7 +629,14 @@ export function SketchDiagram({
|
|
|
613
629
|
);
|
|
614
630
|
}
|
|
615
631
|
return (
|
|
616
|
-
<div
|
|
632
|
+
<div
|
|
633
|
+
className={cn(
|
|
634
|
+
"plan-sketch",
|
|
635
|
+
showFrame
|
|
636
|
+
? "rounded-[16px] border border-plan-line bg-plan-wireframe p-5"
|
|
637
|
+
: "p-0",
|
|
638
|
+
)}
|
|
639
|
+
>
|
|
617
640
|
<div
|
|
618
641
|
className={cn(
|
|
619
642
|
"flex gap-3 overflow-x-auto pb-2",
|
|
@@ -684,6 +707,7 @@ function HtmlDiagram({
|
|
|
684
707
|
const { resolvedTheme } = useTheme();
|
|
685
708
|
const theme: "light" | "dark" = resolvedTheme === "dark" ? "dark" : "light";
|
|
686
709
|
const style = useWireframeStyle();
|
|
710
|
+
const showFrame = data.frame !== "hide";
|
|
687
711
|
const scopeId = useId().replace(/[^a-zA-Z0-9_-]/g, "");
|
|
688
712
|
const scopeSelector = `[data-plan-diagram-scope="${scopeId}"]`;
|
|
689
713
|
const safeHtml = useMemo(() => sanitizeDiagramHtml(data.html), [data.html]);
|
|
@@ -701,6 +725,7 @@ function HtmlDiagram({
|
|
|
701
725
|
className="plan-diagram-frame"
|
|
702
726
|
data-theme={theme}
|
|
703
727
|
data-style={style}
|
|
728
|
+
data-frame={showFrame ? "show" : "hide"}
|
|
704
729
|
data-plan-diagram-scope={scopeId}
|
|
705
730
|
>
|
|
706
731
|
{scopedCss && <style>{scopedCss}</style>}
|
|
@@ -712,7 +737,7 @@ function HtmlDiagram({
|
|
|
712
737
|
<RoughOverlay
|
|
713
738
|
scopeRef={ref}
|
|
714
739
|
enabled={style === "sketchy"}
|
|
715
|
-
drawFrame={
|
|
740
|
+
drawFrame={showFrame}
|
|
716
741
|
selector={DIAGRAM_ROUGH_SELECTOR}
|
|
717
742
|
/>
|
|
718
743
|
{data.caption && !compact && (
|
|
@@ -726,10 +751,12 @@ function PositionedSketchDiagram({
|
|
|
726
751
|
data,
|
|
727
752
|
compact,
|
|
728
753
|
markerId,
|
|
754
|
+
showFrame,
|
|
729
755
|
}: {
|
|
730
756
|
data: PlanDiagramBlock["data"];
|
|
731
757
|
compact?: boolean;
|
|
732
758
|
markerId: string;
|
|
759
|
+
showFrame: boolean;
|
|
733
760
|
}) {
|
|
734
761
|
const nodes = (data.nodes ?? []).map((node) => ({
|
|
735
762
|
...node,
|
|
@@ -743,7 +770,14 @@ function PositionedSketchDiagram({
|
|
|
743
770
|
const canvasHeight = compact ? 280 : 430;
|
|
744
771
|
|
|
745
772
|
return (
|
|
746
|
-
<div
|
|
773
|
+
<div
|
|
774
|
+
className={cn(
|
|
775
|
+
"plan-sketch",
|
|
776
|
+
showFrame
|
|
777
|
+
? "rounded-[16px] border border-plan-line bg-plan-wireframe p-5"
|
|
778
|
+
: "p-0",
|
|
779
|
+
)}
|
|
780
|
+
>
|
|
747
781
|
<div
|
|
748
782
|
className="relative overflow-hidden rounded-xl border border-plan-line bg-plan-document"
|
|
749
783
|
style={{ minHeight: canvasHeight }}
|
|
@@ -319,6 +319,20 @@
|
|
|
319
319
|
line-height: 1.4;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
+
.plan-diagram-frame[data-frame="show"] {
|
|
323
|
+
border: 1px solid var(--wf-diagram-line);
|
|
324
|
+
padding: 10px;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.plan-diagram-frame[data-frame="show"][data-rough-ready] {
|
|
328
|
+
border-color: transparent;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.plan-diagram-frame[data-frame="hide"] {
|
|
332
|
+
border: 0;
|
|
333
|
+
background: transparent;
|
|
334
|
+
}
|
|
335
|
+
|
|
322
336
|
.plan-diagram-frame[data-theme="dark"] {
|
|
323
337
|
--wf-diagram-line: color-mix(in srgb, var(--wf-sketch) 72%, var(--wf-line));
|
|
324
338
|
}
|
|
@@ -341,6 +355,10 @@
|
|
|
341
355
|
direction: inherit;
|
|
342
356
|
}
|
|
343
357
|
|
|
358
|
+
.plan-diagram-frame[data-frame="show"] .plan-diagram-frame-content {
|
|
359
|
+
padding: 0;
|
|
360
|
+
}
|
|
361
|
+
|
|
344
362
|
.plan-diagram-frame-content
|
|
345
363
|
> .diagram-panel:not([data-rough]):not([data-diagram-frame]) {
|
|
346
364
|
--rough-skip: 1;
|
|
@@ -435,6 +435,7 @@ function serializeScreen(
|
|
|
435
435
|
surface: string;
|
|
436
436
|
renderMode?: string;
|
|
437
437
|
caption?: string;
|
|
438
|
+
frame?: string;
|
|
438
439
|
html?: string;
|
|
439
440
|
css?: string;
|
|
440
441
|
skeleton?: boolean;
|
|
@@ -446,6 +447,7 @@ function serializeScreen(
|
|
|
446
447
|
prop("surface", data.surface),
|
|
447
448
|
prop("renderMode", data.renderMode),
|
|
448
449
|
prop("caption", data.caption),
|
|
450
|
+
prop("frame", data.frame),
|
|
449
451
|
prop("html", data.html),
|
|
450
452
|
prop("css", data.css),
|
|
451
453
|
prop("skeleton", data.skeleton),
|
|
@@ -1662,6 +1664,7 @@ function parseScreen(
|
|
|
1662
1664
|
"renderMode",
|
|
1663
1665
|
) as PlanWireframeBlock["data"]["renderMode"],
|
|
1664
1666
|
caption: stringAttr(node, "caption"),
|
|
1667
|
+
frame: stringAttr(node, "frame") as PlanWireframeBlock["data"]["frame"],
|
|
1665
1668
|
html: requiredStringAttr(node, "html"),
|
|
1666
1669
|
css: requiredStringAttr(node, "css"),
|
|
1667
1670
|
skeleton: boolAttr(node, "skeleton"),
|
|
@@ -148,6 +148,7 @@ export type PlanWireframeSurface =
|
|
|
148
148
|
| "browser";
|
|
149
149
|
|
|
150
150
|
export type PlanVisualCanvasMode = "wireframe" | "design";
|
|
151
|
+
export type PlanVisualFrame = "auto" | "show" | "hide";
|
|
151
152
|
|
|
152
153
|
/** Tone keyword reused across screen primitives. The renderer maps to color. */
|
|
153
154
|
export type PlanWireframeTone = "default" | "accent" | "warn" | "ok" | "muted";
|
|
@@ -259,6 +260,8 @@ export type PlanWireframeBlock = PlanBlockBase & {
|
|
|
259
260
|
/** `design` renders full-fidelity branded HTML/CSS instead of a sketch. */
|
|
260
261
|
renderMode?: PlanVisualCanvasMode;
|
|
261
262
|
caption?: string;
|
|
263
|
+
/** Outer surface frame. `auto` lets the host choose the right default. */
|
|
264
|
+
frame?: PlanVisualFrame;
|
|
262
265
|
/**
|
|
263
266
|
* Neutral, textless loading register. The renderer drops borders, the sketch
|
|
264
267
|
* outline, and color, rendering soft placeholder geometry only — a real
|
|
@@ -365,6 +368,8 @@ export type PlanDiagramBlock = PlanBlockBase & {
|
|
|
365
368
|
html?: string;
|
|
366
369
|
css?: string;
|
|
367
370
|
caption?: string;
|
|
371
|
+
/** Outer surface frame. `auto` lets the host choose the right default. */
|
|
372
|
+
frame?: PlanVisualFrame;
|
|
368
373
|
nodes?: PlanDiagramNode[];
|
|
369
374
|
edges?: PlanDiagramEdge[];
|
|
370
375
|
notes?: Array<{
|
|
@@ -1215,12 +1220,14 @@ const wireframeSurfaceSchema = z.enum([
|
|
|
1215
1220
|
]);
|
|
1216
1221
|
|
|
1217
1222
|
const visualCanvasModeSchema = z.enum(["wireframe", "design"]);
|
|
1223
|
+
const visualFrameSchema = z.enum(["auto", "show", "hide"]);
|
|
1218
1224
|
|
|
1219
1225
|
export const wireframeDataSchema: z.ZodType<PlanWireframeBlock["data"]> = z
|
|
1220
1226
|
.object({
|
|
1221
1227
|
surface: wireframeSurfaceSchema,
|
|
1222
1228
|
renderMode: visualCanvasModeSchema.optional(),
|
|
1223
1229
|
caption: z.string().trim().max(400).optional(),
|
|
1230
|
+
frame: visualFrameSchema.optional(),
|
|
1224
1231
|
skeleton: z.boolean().optional(),
|
|
1225
1232
|
html: z
|
|
1226
1233
|
.string()
|
|
@@ -1357,6 +1364,7 @@ const diagramDataSchema: z.ZodType<PlanDiagramBlock["data"]> = z
|
|
|
1357
1364
|
})
|
|
1358
1365
|
.optional(),
|
|
1359
1366
|
caption: z.string().trim().max(600).optional(),
|
|
1367
|
+
frame: visualFrameSchema.optional(),
|
|
1360
1368
|
nodes: z.array(diagramNodeSchema).max(80).optional(),
|
|
1361
1369
|
edges: z.array(diagramEdgeSchema).max(120).optional(),
|
|
1362
1370
|
notes: z
|