An open source design system that's fully customizable and agent ready
TypeScript
fix(CodeBlock): the headerless Copy button never covers code (#8101)
Cindy Zhangc19b5e326a49
diff --git a/.changeset/codeblock-copy-never-covers-code.md b/.changeset/codeblock-copy-never-covers-code.mdnew file mode 100644index 0000000000..58b19d9912--- /dev/null+++ b/.changeset/codeblock-copy-never-covers-code.md@@ -0,0 +1,7 @@+---+'@astryxdesign/core': patch+---++[fix] A CodeBlock with no title or language label no longer lets its Copy button cover code. The button sits in its own column beside the code instead of over it, so a long first line ends before the button, whether the code is scrolled sideways, wrapped, or right-to-left. The button is centred on the first line, so a one-line block reads as one row with even space above and below, and a block that grows line by line keeps the button where it was. Blocks with a header are unchanged.++@cixzhangdiff --git a/.changeset/codeblock-snippet-example-headerless.md b/.changeset/codeblock-snippet-example-headerless.mdnew file mode 100644index 0000000000..6d475ffbc0--- /dev/null+++ b/.changeset/codeblock-snippet-example-headerless.md@@ -0,0 +1,7 @@+---+'@astryxdesign/cli': patch+---++[docs] The CodeBlock "Code — Snippet" example shows one-line commands with no header. Copy sits beside the code in its own column, so each command reads as a single row. A third block shows a long first line that ends before the button.++@cixzhangdiff --git a/.changeset/richtext-code-corner-column.md b/.changeset/richtext-code-corner-column.mdnew file mode 100644index 0000000000..1c27f26ff5--- /dev/null+++ b/.changeset/richtext-code-corner-column.md@@ -0,0 +1,7 @@+---+'@astryxdesign/richtext': patch+---++[fix] In `RichTextEditor` and `RichTextView`, a code block that names no language now leaves room for its corner Copy button. A long line wraps before the button instead of running under it. The block is as tall as the same fence in `Markdown`, so switching between reading and editing no longer moves the content below it.++@cixzhangdiff --git a/apps/docsite/src/components/ThemeCommandBlock.module.css b/apps/docsite/src/components/ThemeCommandBlock.module.cssdeleted file mode 100644index 3f90dcb527..0000000000--- a/apps/docsite/src/components/ThemeCommandBlock.module.css+++ /dev/null@@ -1,9 +0,0 @@-/* Copyright (c) Meta Platforms, Inc. and affiliates. */--/* Neutralize the headerless CodeBlock copy button's negative margin so it- isn't flush against the container's right edge. */-.commandBlock > button {- margin-inline-end: 0;- inset-inline-end: var(--spacing-3);- inset-block-start: var(--spacing-2);-}diff --git a/apps/docsite/src/components/ThemePackagePage.tsx b/apps/docsite/src/components/ThemePackagePage.tsxindex 92978cdc22..628fd385ec 100644--- a/apps/docsite/src/components/ThemePackagePage.tsx+++ b/apps/docsite/src/components/ThemePackagePage.tsx@@ -28,7 +28,6 @@ import {themeObjects} from '../generated/themeRegistry';import {templates} from '../generated/templateRegistry';import {trackCopy, trackOpenPlayground, trackToggle} from '../lib/analytics';import {useThemeMode} from '../app/providers';-import commandBlockStyles from './ThemeCommandBlock.module.css';import {ThemeHeading} from './ThemeHeading';import {ThemeExplorerActions,@@ -134,14 +133,12 @@ const styles = stylex.create({width: '100%',},// The command snippet in the popover — CodeBlock with container="section"- // (no border/radius of its own), so paint the muted inset here. The extra- // inline-end padding keeps wrapping text clear of the absolutely-positioned- // copy button (see ThemeCommandBlock.module.css).+ // (no border/radius of its own), so paint the muted inset here. CodeBlock+ // keeps its headerless copy button in a column beside the code.commandBlock: {width: '100%',borderRadius: 'var(--radius-element)',backgroundColor: 'var(--color-background-muted)',- paddingInlineEnd: 'var(--spacing-5)',},// Themed theme-row card. The SelectableCard wrapper itself// stays variant="transparent" + padding=0 so it doesn't paint a@@ -394,7 +391,6 @@ function ThemeActions({selectedPkgName, customizeHref}: ThemeActionsProps) {isWrappedhasLanguageLabel={false}xstyle={styles.commandBlock}- className={commandBlockStyles.commandBlock}onCopy={() => {trackCopy({page: 'themes',diff --git a/apps/storybook/stories/CodeBlock.stories.tsx b/apps/storybook/stories/CodeBlock.stories.tsxindex 8530a85127..6a4613cd00 100644--- a/apps/storybook/stories/CodeBlock.stories.tsx+++ b/apps/storybook/stories/CodeBlock.stories.tsx@@ -153,6 +153,16 @@ export const OverflowStop: Story = {},};+// No title and no language label, so there is no header and Copy floats in+// the corner. The first line is longer than the block, so it must end before+// the button rather than run under it.+export const CopyClearance: Story = {+ args: {+ code: 'pnpm --filter @astryxdesign/core exec vitest run src/CodeBlock --reporter=verbose --coverage\nexit 0',+ width: '360px',+ },+};+export const JSON: Story = {args: {code: `{diff --git a/apps/storybook/stories/RichTextEditor.markdownParityFixture.ts b/apps/storybook/stories/RichTextEditor.markdownParityFixture.tsindex 04d2448baa..dbd5a09a6d 100644--- a/apps/storybook/stories/RichTextEditor.markdownParityFixture.ts+++ b/apps/storybook/stories/RichTextEditor.markdownParityFixture.ts@@ -174,6 +174,18 @@ export const MARKDOWN_PARITY_BLOCKS: readonly MarkdownParityBlock[] = ['```',),},+ // A long line in a fence that names no language: the copy button sits in+ // its own column beside the code, so the line wraps before it.+ {+ key: 'code-plain-long',+ label: 'Fenced code, no info string, long line',+ probe: 'plainLongFence',+ markdown: lines(+ '```',+ 'plainLongFence: the quick brown fox jumps over the lazy dog, then runs back across the field to do it again',+ '```',+ ),+ },{key: 'table',label: 'Table',diff --git a/packages/cli/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.doc.mjs b/packages/cli/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.doc.mjsindex 148bad998a..bfc402c04e 100644--- a/packages/cli/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.doc.mjs@@ -7,7 +7,7 @@ export const doc = {name: 'Code — Snippet',displayName: 'Code — Snippet',description:- 'Short terminal commands with a copy button and no line numbers. Use for install instructions or one-liner commands that readers will paste directly.',+ 'Short terminal commands with no header: the copy button sits in its own column beside the code, so a one-line command reads as a single row and a long line ends before the button instead of running under it. Use for install instructions or one-liner commands that readers will paste directly.',isReady: true,aspectRatio: 16 / 9,componentsUsed: ['CodeBlock', 'Stack'],diff --git a/packages/cli/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx b/packages/cli/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsxindex e7dc068502..bec8fe798a 100644--- a/packages/cli/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx+++ b/packages/cli/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx@@ -11,13 +11,21 @@ export default function CodeBlockBashCommand() {<CodeBlockcode="npm install @astryxdesign/core"language="bash"- hasCopyButton+ hasLanguageLabel={false}style={{width: '100%'}}/><CodeBlockcode="yarn add @astryxdesign/theme-neutral"language="bash"- hasCopyButton+ hasLanguageLabel={false}+ style={{width: '100%'}}+ />+ <CodeBlock+ code={+ 'astryx upgrade --from 0.6.0 --apply --path apps/web/src --install-deps\nnpm run build'+ }+ language="bash"+ hasLanguageLabel={false}style={{width: '100%'}}/></VStack>diff --git a/packages/core/src/CodeBlock/CodeBlock.doc.mjs b/packages/core/src/CodeBlock/CodeBlock.doc.mjsindex 6c16592a89..72194bca3b 100644--- a/packages/core/src/CodeBlock/CodeBlock.doc.mjs+++ b/packages/core/src/CodeBlock/CodeBlock.doc.mjs@@ -230,7 +230,7 @@ export const docs = {name: 'Header Bar',required: false,description:- 'Shows the title, visible language label, and copy button when a header is present. A title or visible language label creates the header; the copy button alone floats at the top-end of a headerless block.',+ 'Shows the title, visible language label, and copy button when a header is present. A title or visible language label creates the header; in a headerless block the copy button sits in its own column beside the code, centred on the first line, and never covers it.',},{name: 'Header Title',diff --git a/packages/core/src/CodeBlock/CodeBlock.tsx b/packages/core/src/CodeBlock/CodeBlock.tsxindex 5a9ccfbc50..6d346b5e00 100644--- a/packages/core/src/CodeBlock/CodeBlock.tsx+++ b/packages/core/src/CodeBlock/CodeBlock.tsx@@ -31,6 +31,7 @@ import {borderVars,durationVars,easeVars,+ sizeVars,} from '../theme/tokens.stylex';import {mergeProps} from '../utils';import {useClipboard} from '../hooks/useClipboard';@@ -127,6 +128,15 @@ const styles = stylex.create({viewport: {minHeight: 0,},+ // With no header, Copy sits in its own inline-end column beside the code+ // viewport rather than over it, so no line, scrolled or wrapped, runs under+ // the button. The column is as wide as its content; the single row still+ // lets a root sized from outside bound the viewport.+ rootCorner: {+ display: 'grid',+ gridTemplateColumns: 'minmax(0, 1fr) auto',+ gridTemplateRows: 'minmax(0, 1fr)',+ },headerRow: {display: 'flex',alignItems: 'center',@@ -392,10 +402,19 @@ const styles = stylex.create({// reaches it via the `code-block-copy-button` target on the Button.color: 'var(--color-syntax-comment)',},- copyButtonAbsolute: {- position: 'absolute',- top: spacingVars['--spacing-2'],- insetInlineEnd: spacingVars['--spacing-2'],+ // Centred on the first line of code: a one-line block reads as one row with+ // even space above and below, and a block that grows keeps the button where+ // it was. The first line's centre is the code's block padding plus half its+ // line box (font size × leading for the block's size).+ copyButtonCorner: {+ alignSelf: 'start',+ marginInline: spacingVars['--spacing-2'],+ },+ copyButtonCornerMd: {+ marginBlockStart: `calc(${spacingVars['--spacing-3']} + ${typeScaleVars['--text-code-size']} * ${typeScaleVars['--text-code-leading']} / 2 - ${sizeVars['--size-element-sm']} / 2)`,+ },+ copyButtonCornerSm: {+ marginBlockStart: `calc(${spacingVars['--spacing-3']} + ${typeScaleVars['--text-supporting-size']} * ${typeScaleVars['--text-code-leading']} / 2 - ${sizeVars['--size-element-sm']} / 2)`,},});@@ -1019,7 +1038,14 @@ export function CodeBlock({e.stopPropagation();void handleCopy();}}- xstyle={[styles.copyButton, !showHeader && styles.copyButtonAbsolute]}+ xstyle={[+ styles.copyButton,+ !showHeader && styles.copyButtonCorner,+ !showHeader &&+ (size === 'sm'+ ? styles.copyButtonCornerSm+ : styles.copyButtonCornerMd),+ ]}{...themeProps('code-block-copy-button')}/>) : null;@@ -1133,6 +1159,7 @@ export function CodeBlock({themeProps('code-block', {size, language, container}),stylex.props(styles.root,+ hasCopyButton && !showHeader && styles.rootCorner,dynamicStyles.width(widthProp),containerStyles[container],xstyle,diff --git a/packages/core/src/CodeBlock/__tests__/CodeBlockCopyClearance.a11y.chromium.spec.ts b/packages/core/src/CodeBlock/__tests__/CodeBlockCopyClearance.a11y.chromium.spec.tsnew file mode 100644index 0000000000..985a2435e9--- /dev/null+++ b/packages/core/src/CodeBlock/__tests__/CodeBlockCopyClearance.a11y.chromium.spec.ts@@ -0,0 +1,214 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file CodeBlockCopyClearance.a11y.chromium.spec.ts+ * @input Built CodeBlock story and real Chromium layout+ * @output Browser evidence that the floating Copy control never covers code+ * @position CodeBlock headerless state (Copy on the root, ORD2): the code body+ * stays readable (Code Body, Copy Button design relationships)+ */++import {expect, test, type Locator, type Page} from '@playwright/test';+import {+ DEFAULT_STORYBOOK_DIR,+ serveStorybook,+ type StaticServer,+} from '@astryxdesign/a11y-spec/storybook';++let storybook: StaticServer;+test.beforeAll(async () => {+ storybook = await serveStorybook(+ process.env.ASTRYX_STORYBOOK_DIR ?? DEFAULT_STORYBOOK_DIR,+ );+});+test.afterAll(async () => {+ await storybook?.close();+});++const STORY = 'core-codeblock--copy-clearance';++async function mount(+ page: Page,+ args: Record<string, unknown> = {},+ direction: 'ltr' | 'rtl' = 'ltr',+) {+ await page.setViewportSize({width: 600, height: 400});+ await page.goto(+ `${storybook.origin}/iframe.html?id=${STORY}&viewMode=story&globals=direction:${direction}`,+ );+ await expect(copyButton(page)).toBeVisible();+ if (Object.keys(args).length > 0) {+ await page.evaluate(+ async ({storyId, updatedArgs}) =>+ new Promise<void>(resolve => {+ const channel = (+ window as unknown as {+ __STORYBOOK_ADDONS_CHANNEL__: {+ emit: (event: string, payload: unknown) => void;+ once: (event: string, handler: () => void) => void;+ };+ }+ ).__STORYBOOK_ADDONS_CHANNEL__;+ channel.once('storyRendered', () => resolve());+ channel.emit('updateStoryArgs', {storyId, updatedArgs});+ setTimeout(resolve, 1500);+ }),+ {storyId: STORY, updatedArgs: args},+ );+ }+}++async function box(locator: Locator) {+ const rect = await locator.boundingBox();+ if (!rect) {+ throw new Error('element not laid out');+ }+ return rect;+}++function copyButton(page: Page) {+ return page.getByRole('button', {name: 'Copy code'});+}++/**+ * The code viewport clips every line, so a line can reach the button only if+ * the viewport's box overlaps it. Returns the overlap width in pixels.+ */+async function overlap(page: Page, viewportName: string) {+ const button = await box(copyButton(page));+ const viewport = await box(page.getByRole('group', {name: viewportName}));+ const inline =+ Math.min(button.x + button.width, viewport.x + viewport.width) -+ Math.max(button.x, viewport.x);+ const block =+ Math.min(button.y + button.height, viewport.y + viewport.height) -+ Math.max(button.y, viewport.y);+ return inline > 0 && block > 0 ? inline : 0;+}++/** The first line's painted text must end before the button starts. */+async function firstLineReachesButton(page: Page) {+ return page.evaluate(() => {+ const find = (selector: string) => {+ const node = document.querySelector(selector);+ if (!node) {+ throw new Error(`missing ${selector}`);+ }+ return node;+ };+ const button = find('[aria-label="Copy code"]').getBoundingClientRect();+ const viewport = find('[role="group"]').getBoundingClientRect();+ const range = document.createRange();+ range.selectNodeContents(find('pre.astryx-code-block [data-line="1"]'));+ const rtl =+ getComputedStyle(find('pre.astryx-code-block')).direction === 'rtl';+ for (const rect of Array.from(range.getClientRects())) {+ if (rect.bottom <= button.top || rect.top >= button.bottom) {+ continue;+ }+ // Visible part of the text: what the viewport does not clip.+ const left = Math.max(rect.left, viewport.left);+ const right = Math.min(rect.right, viewport.right);+ if (right <= left) {+ continue;+ }+ if (rtl ? left < button.right : right > button.left) {+ return true;+ }+ }+ return false;+ });+}++test('a long first line ends before the floating Copy button', async ({+ page,+}) => {+ await mount(page);+ expect(await overlap(page, 'Code')).toBe(0);+ expect(await firstLineReachesButton(page)).toBe(false);+});++test('scrolled to the end, the line still ends before Copy', async ({page}) => {+ await mount(page);+ const viewport = page.getByRole('group', {name: 'Code'});+ await viewport.evaluate(node => {+ node.scrollLeft = node.scrollWidth;+ });+ expect(await overlap(page, 'Code')).toBe(0);+ expect(await firstLineReachesButton(page)).toBe(false);+});++test('wrapped lines wrap before Copy', async ({page}) => {+ await mount(page, {isWrapped: true});+ expect(await overlap(page, 'Code')).toBe(0);+ expect(await firstLineReachesButton(page)).toBe(false);+});++test('in RTL the clearance mirrors to the inline end', async ({page}) => {+ await mount(page, {}, 'rtl');+ const button = await box(copyButton(page));+ const root = await box(page.locator('pre.astryx-code-block'));+ // Copy sits at the left (inline-end) edge in RTL.+ expect(button.x - root.x).toBeLessThan(root.width / 2);+ expect(await overlap(page, 'Code')).toBe(0);+ expect(await firstLineReachesButton(page)).toBe(false);+});++test('with a header, Copy sits in the header and the code keeps its full width', async ({+ page,+}) => {+ await mount(page, {title: 'run.sh'});+ const viewport = await box(page.getByRole('group', {name: 'Code'}));+ const root = await box(page.locator('pre.astryx-code-block'));+ // Only the root's own border separates the viewport from the root's edges.+ expect(Math.abs(root.width - viewport.width)).toBeLessThanOrEqual(2);+ expect(await overlap(page, 'Code')).toBe(0);+});++async function centres(page: Page) {+ return page.evaluate(() => {+ const find = (selector: string) => {+ const node = document.querySelector(selector);+ if (!node) {+ throw new Error(`missing ${selector}`);+ }+ return node.getBoundingClientRect();+ };+ const button = find('[aria-label="Copy code"]');+ const line = find('pre.astryx-code-block [data-line="1"]');+ const root = find('pre.astryx-code-block');+ return {+ button: button.top + button.height / 2,+ line: line.top + line.height / 2,+ above: button.top - root.top,+ below: root.bottom - button.bottom,+ };+ });+}++test('a one-line block is one row: Copy is centred with even space', async ({+ page,+}) => {+ await mount(page, {code: 'pnpm install'});+ const one = await centres(page);+ expect(Math.abs(one.button - one.line)).toBeLessThanOrEqual(1);+ expect(Math.abs(one.above - one.below)).toBeLessThanOrEqual(1);+ expect(await overlap(page, 'Code')).toBe(0);+});++test('a block that grows (streaming) keeps Copy on its first line', async ({+ page,+}) => {+ await mount(page, {code: 'pnpm install'});+ const before = await centres(page);+ await mount(page, {code: 'pnpm install\npnpm build\npnpm test'});+ const after = await centres(page);+ expect(Math.abs(after.button - before.button)).toBeLessThanOrEqual(1);+ expect(Math.abs(after.button - after.line)).toBeLessThanOrEqual(1);+});++test('the small size centres Copy on its own first line', async ({page}) => {+ await mount(page, {code: 'pnpm install', size: 'sm'});+ const one = await centres(page);+ expect(Math.abs(one.button - one.line)).toBeLessThanOrEqual(1);+});diff --git a/packages/richtext/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts b/packages/richtext/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.tsindex 0142129c44..38a3acfcdb 100644--- a/packages/richtext/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts+++ b/packages/richtext/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts@@ -807,7 +807,7 @@ for (const viewport of [PHONE, DESKTOP, {width: 2200, height: 900}] as const) {// One header per fenced block; the first is the `ts` block's.await expect(page.locator(`${RICH_TEXT} [data-richtext-code-header]`),- ).toHaveCount(6);+ ).toHaveCount(7);const header = page.locator(`${RICH_TEXT} [data-richtext-code-header]`).first();@@ -890,6 +890,7 @@ for (const globals of ['code-plaintext': '','code-unknown': 'notalanguage','code-long': 'sh',+ 'code-plain-long': '',} as const;const markdown = await surfaceGeometry(page, MARKDOWN);const richText = await surfaceGeometry(page, RICH_TEXT);@@ -904,6 +905,43 @@ for (const globals of [`${key} height`,).toBeLessThanOrEqual(2);}+ // A fence that names no language keeps its corner copy button beside the+ // code, never over it: the text ends as far from the frame's inline end+ // on both surfaces, so a long line wraps at the same place in read and+ // edit mode.+ const textInset = (surface: string, key: string) =>+ page.evaluate(+ ({selector}) => {+ const block = document.querySelector<HTMLElement>(selector);+ const frame = block?.matches('pre, code')+ ? block+ : block?.querySelector<HTMLElement>('pre, code');+ if (frame == null) {+ return -1;+ }+ const rect = frame.getBoundingClientRect();+ const style = getComputedStyle(frame);+ const rtl = style.direction === 'rtl';+ const line = frame.querySelector('[data-line="1"]');+ if (line != null) {+ const text = line.getBoundingClientRect();+ return rtl ? text.left - rect.left : rect.right - text.right;+ }+ return rtl+ ? parseFloat(style.borderLeftWidth) + parseFloat(style.paddingLeft)+ : parseFloat(style.borderRightWidth) ++ parseFloat(style.paddingRight);+ },+ {selector: `${surface} [data-parity-block="${key}"]`},+ );+ for (const key of ['code-plain', 'code-plain-long']) {+ const markdownInset = await textInset(MARKDOWN, key);+ expect(markdownInset, `${key} markdown inset`).toBeGreaterThan(40);+ expect(+ Math.abs((await textInset(RICH_TEXT, key)) - markdownInset),+ `${key} text inset`,+ ).toBeLessThanOrEqual(2);+ }// The label core Markdown shows for each fence.const markdownLabels = await page.evaluate(({selector, names}) =>@@ -926,14 +964,14 @@ for (const globals of [// RichText draws one header per fence, in order, each with a copy button// and the same label.const headers = page.locator(`${RICH_TEXT} [data-richtext-code-header]`);- await expect(headers).toHaveCount(6);+ await expect(headers).toHaveCount(7);const richTextLabels = await headers.evaluateAll(elements =>elements.map(element =>(element.textContent ?? '').replace('Copy code', '').trim(),),);expect(richTextLabels).toEqual(Object.values(fences));- for (const index of [0, 1, 2, 3, 4, 5]) {+ for (const index of [0, 1, 2, 3, 4, 5, 6]) {await expect(headers.nth(index).getByRole('button', {name: 'Copy code'}),).toBeVisible();diff --git a/packages/richtext/src/editorTheme.ts b/packages/richtext/src/editorTheme.tsindex 02af0b95f0..e9d8ce2831 100644--- a/packages/richtext/src/editorTheme.ts+++ b/packages/richtext/src/editorTheme.ts@@ -53,6 +53,10 @@ const CODE_SPACE = `calc(${spacingVars['--spacing-3']})`;// Core CodeBlock's header (8px, a small control, 8px) overlaps the code's// 12px top padding by 8px, so its code starts 8px + control + 12px down.const CODE_HEADER_SPACE = `calc(${spacingVars['--spacing-2']} + ${sizeVars['--size-element-sm']} + ${spacingVars['--spacing-3']})`;+// A block that names no language has no header: core CodeBlock puts its copy+// button in a column of its own at the inline end (8px, a small control, 8px),+// beside the code rather than over it, so the code ends that much earlier.+const CODE_CORNER_SPACE = `calc(${spacingVars['--spacing-4']} + ${sizeVars['--size-element-sm']} + 2 * ${spacingVars['--spacing-2']})`;const editorTheme = stylex.create({// Lexical marks every top-level block `dir="auto"`, which picks each@@ -443,7 +447,14 @@ const editorTheme = stylex.create({CODE_HEADER_SPACE,},paddingBlockEnd: spacingVars['--spacing-3'],- paddingInline: spacingVars['--spacing-4'],+ paddingInlineStart: spacingVars['--spacing-4'],+ paddingInlineEnd: {+ // Room for the corner copy button CodeBlockHeaderPlugin draws over a+ // block that names no language, so no line runs under it.+ default: CODE_CORNER_SPACE,+ ':is([data-language]:not([data-language="plaintext"]))':+ spacingVars['--spacing-4'],+ },// Sized like core Markdown's code frame: as wide as its longest line, at// least the prose measure (or the whole width when that is narrower), and// never wider than the editor, where long lines wrap.