Skip to content

feat(prose): configurable heading anchors and copy button (f419731)#287

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-f419731
Jul 20, 2026
Merged

feat(prose): configurable heading anchors and copy button (f419731)#287
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-f419731

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Syncs upstream nuxt/ui commit f419731feat(prose): configurable heading anchors and copy button (#6735).

b24ui port

  • prose/H1.vueH4.vue — add anchor?: boolean and rewrite generate to props.id && (props.anchor ?? (typeof anchorLinks === 'boolean' ? anchorLinks : anchorLinks?.hN) ?? false), giving the prop precedence over the now-deprecated mdc.headings.anchorLinks fallback.
  • prose/Pre.vue — add copy?: boolean | Omit<ButtonProps, LinkPropsKeys> (default true); gate the copy B24Button behind v-if="props.copy" with v-bind customization. Renamed the useClipboard copy binding to copyToClipboard to avoid a vue/no-dupe-keys collision with the new prop.
  • types/theme.ts — add a prose namespace to ThemeDefaults so <Theme :props> can set per-element prose defaults. Dropped upstream's codeTree entry (b24ui has no CodeTree).
  • useComponentProps.spec.ts — remove prose from NonProxyComponents, keeping the type-level drift catcher balanced (prose now lives in both Expected and ThemeDefaults).
  • Docsheaders-and-text.md documents the anchor prop with a B24Theme :props example; code.md documents the copy prop.
  • Chat.vue — N/A (b24ui has no Chat component, so the upstream Theme-based anchor-disable hunk is skipped).

Tests

Prop additions with backward-compatible defaults (anchor resolves to the same off-state in the test env; copy defaults true → button still renders) → no snapshot churn. The useComponentProps drift catcher stays green. Suite 5557 passed / 6 skipped.

Verify (CI=true)

dev:prepare · lint · typecheck · test · build — all green.

Ledger: cursor advanced to f419731; previous entry f546b2c reconciled to PR #286.

🤖 Generated with Claude Code


Generated by Claude Code

Syncs upstream nuxt/ui commit f419731 (#6735).

- prose/H1-H4.vue: add `anchor?: boolean` prop taking precedence over the
  deprecated `mdc.headings.anchorLinks` config fallback.
- prose/Pre.vue: add `copy?: boolean | Omit<ButtonProps, LinkPropsKeys>` prop
  (default true); gate the copy button behind v-if and allow customization via
  v-bind. Renamed the useClipboard `copy` binding to `copyToClipboard` to avoid
  a dupe-key collision with the new prop.
- types/theme.ts: add a `prose` namespace to ThemeDefaults so <Theme :props>
  can set per-element prose defaults (dropped upstream's codeTree — absent).
- useComponentProps.spec.ts: drop `prose` from NonProxyComponents to keep the
  drift catcher balanced.
- docs: document the anchor prop (headers-and-text.md, with a B24Theme example)
  and the copy prop (code.md).
- Chat.vue N/A (b24ui has no Chat component).

Backward-compatible defaults → no snapshot churn. Suite: 5557 passed / 6 skipped.

Ledger: cursor -> f419731; previous entry f546b2c reconciled to PR #286.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik
IgorShevchik merged commit b12036d into main Jul 20, 2026
1 check passed
@IgorShevchik
IgorShevchik deleted the sync/nuxt-f419731 branch July 20, 2026 05:20
IgorShevchik added a commit that referenced this pull request Jul 20, 2026
Syncs upstream nuxt/ui commit ada1580 (chore(release): v4.10.0). Pure release
commit — bumps package.json 4.9.0->4.10.0 and regenerates CHANGELOG.md, with no
source/component/theme changes.

NOT APPLICABLE: b24ui is an independently-versioned fork (currently 2.9.0) with
its own CHANGELOG. No-op — cursor advanced only.

Ledger: cursor -> ada1580; previous entry f419731 reconciled to PR #287.


Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb

Co-authored-by: Shevchik Igor <noreply@anthropic.com>
IgorShevchik added a commit that referenced this pull request Jul 20, 2026
Syncs upstream nuxt/ui commit e931bdf. Docs-content refinement of
headers-and-text.md (on top of b24ui's post-#287 state):

- hash-icon copy "H2 and H3" -> "H2, H3 and H4"
- consolidate the two ::note blocks (anchor-links + toc config) into one merged
  note whose nuxt.config.ts example combines renderer.anchorLinks and
  build.markdown.toc, linking both generation docs.

Docs-content only. Suite: 5565 passed / 6 skipped.

Ledger: cursor -> e931bdf; previous entry 2a172ef reconciled to PR #291.


Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb

Co-authored-by: Shevchik Igor <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants