@ciderpress/ui 1.0.0-rc.5 → 1.0.0-rc.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.
@@ -1,5 +1,3 @@
1
- export { CopyMarkdownButton } from './copy-markdown-button'
2
- export type { CopyMarkdownButtonProps } from './copy-markdown-button'
3
1
  export { OpenAPIOperation } from './operation'
4
2
  export type { OpenAPIOperationProps } from './operation'
5
3
  export { OpenAPIOverview } from './overview'
@@ -5,20 +5,6 @@
5
5
  * Uses BEM naming: block__element--modifier.
6
6
  */
7
7
 
8
- /* ── Hide Rspress default LLMs copy button on OpenAPI pages ── */
9
- /* OpenAPI pages use a custom CopyMarkdownButton with build-time rendered markdown */
10
- :has(.cp-oas-operation) > .rp-llms-container,
11
- :has(.cp-oas-overview) > .rp-llms-container {
12
- display: none;
13
- }
14
-
15
- /* ── Copy markdown button ─────────────────────────────────── */
16
- .cp-oas-copy-markdown {
17
- float: right;
18
- margin-top: 8px;
19
- margin-bottom: 0;
20
- }
21
-
22
8
  /* ── Two-column operation layout ───────────────────────────── */
23
9
  .cp-oas-operation {
24
10
  display: grid;
@@ -149,8 +149,6 @@ export type { StepsProps, StepProps } from './components/shared/steps'
149
149
  export { Field, FieldGroup } from './components/shared/field'
150
150
  export type { FieldProps, FieldGroupProps } from './components/shared/field'
151
151
 
152
- export { CopyMarkdownButton } from './components/openapi'
153
- export type { CopyMarkdownButtonProps } from './components/openapi'
154
152
  export { OpenAPIOperation } from './components/openapi'
155
153
  export type { OpenAPIOperationProps } from './components/openapi'
156
154
  export { OpenAPIOverview } from './components/openapi'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciderpress/ui",
3
- "version": "1.0.0-rc.5",
3
+ "version": "1.0.0-rc.6",
4
4
  "description": "Rspress plugin, theme components, and styles for ciderpress",
5
5
  "keywords": [
6
6
  "ciderpress",
@@ -63,7 +63,7 @@
63
63
  "react-aria-components": "^1.19.0",
64
64
  "ts-morph": "^28.0.0",
65
65
  "unist-util-visit": "^5.1.0",
66
- "@ciderpress/config": "1.0.0-rc.4",
66
+ "@ciderpress/config": "1.0.0-rc.5",
67
67
  "@ciderpress/theme": "1.0.0-rc.3"
68
68
  },
69
69
  "devDependencies": {
@@ -1,5 +1,3 @@
1
- export { CopyMarkdownButton } from './copy-markdown-button'
2
- export type { CopyMarkdownButtonProps } from './copy-markdown-button'
3
1
  export { OpenAPIOperation } from './operation'
4
2
  export type { OpenAPIOperationProps } from './operation'
5
3
  export { OpenAPIOverview } from './overview'
@@ -5,20 +5,6 @@
5
5
  * Uses BEM naming: block__element--modifier.
6
6
  */
7
7
 
8
- /* ── Hide Rspress default LLMs copy button on OpenAPI pages ── */
9
- /* OpenAPI pages use a custom CopyMarkdownButton with build-time rendered markdown */
10
- :has(.cp-oas-operation) > .rp-llms-container,
11
- :has(.cp-oas-overview) > .rp-llms-container {
12
- display: none;
13
- }
14
-
15
- /* ── Copy markdown button ─────────────────────────────────── */
16
- .cp-oas-copy-markdown {
17
- float: right;
18
- margin-top: 8px;
19
- margin-bottom: 0;
20
- }
21
-
22
8
  /* ── Two-column operation layout ───────────────────────────── */
23
9
  .cp-oas-operation {
24
10
  display: grid;
@@ -149,8 +149,6 @@ export type { StepsProps, StepProps } from './components/shared/steps'
149
149
  export { Field, FieldGroup } from './components/shared/field'
150
150
  export type { FieldProps, FieldGroupProps } from './components/shared/field'
151
151
 
152
- export { CopyMarkdownButton } from './components/openapi'
153
- export type { CopyMarkdownButtonProps } from './components/openapi'
154
152
  export { OpenAPIOperation } from './components/openapi'
155
153
  export type { OpenAPIOperationProps } from './components/openapi'
156
154
  export { OpenAPIOverview } from './components/openapi'
@@ -1,41 +0,0 @@
1
- import { LlmsCopyButton } from '@rspress/core/theme'
2
- import type React from 'react'
3
- import { useCallback } from 'react'
4
-
5
- export interface CopyMarkdownButtonProps {
6
- /**
7
- * Markdown content to copy to the clipboard.
8
- */
9
- readonly markdown: string
10
- }
11
-
12
- /**
13
- * Copy Markdown button that overrides Rspress's default copy behavior.
14
- *
15
- * Uses the native Clipboard API to copy pre-generated markdown content
16
- * instead of the raw MDX source.
17
- *
18
- * @param props - Props with the markdown string to copy to the clipboard
19
- * @returns React element with the copy button
20
- */
21
- export function CopyMarkdownButton({
22
- markdown,
23
- }: CopyMarkdownButtonProps): React.ReactElement | null {
24
- if (import.meta.env.SSG_MD) {
25
- return null
26
- }
27
-
28
- const handleClick = useCallback(
29
- (event: React.MouseEvent<HTMLButtonElement>) => {
30
- event.preventDefault()
31
- return navigator.clipboard.writeText(markdown).catch(() => null)
32
- },
33
- [markdown]
34
- )
35
-
36
- return (
37
- <div className="cp-oas-copy-markdown">
38
- <LlmsCopyButton text="Copy Markdown" onClick={handleClick} />
39
- </div>
40
- )
41
- }
@@ -1,41 +0,0 @@
1
- import { LlmsCopyButton } from '@rspress/core/theme'
2
- import type React from 'react'
3
- import { useCallback } from 'react'
4
-
5
- export interface CopyMarkdownButtonProps {
6
- /**
7
- * Markdown content to copy to the clipboard.
8
- */
9
- readonly markdown: string
10
- }
11
-
12
- /**
13
- * Copy Markdown button that overrides Rspress's default copy behavior.
14
- *
15
- * Uses the native Clipboard API to copy pre-generated markdown content
16
- * instead of the raw MDX source.
17
- *
18
- * @param props - Props with the markdown string to copy to the clipboard
19
- * @returns React element with the copy button
20
- */
21
- export function CopyMarkdownButton({
22
- markdown,
23
- }: CopyMarkdownButtonProps): React.ReactElement | null {
24
- if (import.meta.env.SSG_MD) {
25
- return null
26
- }
27
-
28
- const handleClick = useCallback(
29
- (event: React.MouseEvent<HTMLButtonElement>) => {
30
- event.preventDefault()
31
- return navigator.clipboard.writeText(markdown).catch(() => null)
32
- },
33
- [markdown]
34
- )
35
-
36
- return (
37
- <div className="cp-oas-copy-markdown">
38
- <LlmsCopyButton text="Copy Markdown" onClick={handleClick} />
39
- </div>
40
- )
41
- }