@ciderpress/ui 1.0.0-rc.1 → 1.0.0-rc.3
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/dist/node.mjs
CHANGED
|
@@ -17435,7 +17435,7 @@ function createRspressConfig(options) {
|
|
|
17435
17435
|
llms: true,
|
|
17436
17436
|
title: config.title ?? 'ciderpress',
|
|
17437
17437
|
description: config.description ?? 'Documentation',
|
|
17438
|
-
icon: config.
|
|
17438
|
+
icon: config.favicon ?? '/icon.svg',
|
|
17439
17439
|
logo: resolvedLogo,
|
|
17440
17440
|
logoText: '',
|
|
17441
17441
|
themeDir: node_path.resolve(import.meta.dirname, 'theme'),
|
|
@@ -6,8 +6,6 @@ import { BRAND_COLORS, DEFAULT_THEME_NAME } from '@ciderpress/theme'
|
|
|
6
6
|
import React, { useEffect, useState } from 'react'
|
|
7
7
|
import { createPortal } from 'react-dom'
|
|
8
8
|
|
|
9
|
-
import { CiderpressLogo } from '../shared/ciderpress-logo'
|
|
10
|
-
|
|
11
9
|
import './nav-logo.css'
|
|
12
10
|
|
|
13
11
|
/**
|
|
@@ -37,7 +35,7 @@ const FALLBACK_COLORS = Object.freeze({
|
|
|
37
35
|
})
|
|
38
36
|
|
|
39
37
|
/**
|
|
40
|
-
* `NavLogo` — Rspress-aware logo slot
|
|
38
|
+
* `NavLogo` — Rspress-aware logo slot for function-form `logo` configs.
|
|
41
39
|
*
|
|
42
40
|
* - Reads `userConfig.logo` from the bundled user config via the
|
|
43
41
|
* `@ciderpress/internal/user-config` alias.
|
|
@@ -52,7 +50,10 @@ const FALLBACK_COLORS = Object.freeze({
|
|
|
52
50
|
* - `logo` is a function → call with the live `LogoContext`. If the return
|
|
53
51
|
* value is a `LogoImage`-shaped object, spread onto `<img>`. Otherwise
|
|
54
52
|
* render as a React node.
|
|
55
|
-
* - `logo` is missing → render
|
|
53
|
+
* - `logo` is missing → render `null`; Rspress paints the auto-generated
|
|
54
|
+
* `/logo.svg` (written to the public dir by the banner module, derived
|
|
55
|
+
* from the project title). Users who want the framework's themed wordmark
|
|
56
|
+
* opt in via `logo: ({ theme }) => <CiderpressLogo />`.
|
|
56
57
|
*
|
|
57
58
|
* @returns Portaled logo element or null
|
|
58
59
|
*/
|
|
@@ -116,13 +117,11 @@ export function NavLogo(): React.ReactElement | null {
|
|
|
116
117
|
|
|
117
118
|
const logoConfig = readLogoConfig(userConfigModule)
|
|
118
119
|
|
|
119
|
-
// String-form user logos
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
// shows. Theme color flips via `currentColor` reading from `--rp-c-brand`.
|
|
125
|
-
if (typeof logoConfig === 'string') {
|
|
120
|
+
// String-form user logos and the missing-logo default both ride Rspress's
|
|
121
|
+
// native <img>. resolveLogo() in @ciderpress/ui/config maps the missing
|
|
122
|
+
// case to the auto-generated /logo.svg path. Only function-form logos
|
|
123
|
+
// need this portal — they re-render when the theme/variant changes.
|
|
124
|
+
if (typeof logoConfig !== 'function') {
|
|
126
125
|
return null
|
|
127
126
|
}
|
|
128
127
|
|
|
@@ -130,13 +129,7 @@ export function NavLogo(): React.ReactElement | null {
|
|
|
130
129
|
return null
|
|
131
130
|
}
|
|
132
131
|
|
|
133
|
-
|
|
134
|
-
const rendered =
|
|
135
|
-
typeof logoConfig === 'function' ? (
|
|
136
|
-
renderLogoFn({ fn: logoConfig, theme: themeContext })
|
|
137
|
-
) : (
|
|
138
|
-
<CiderpressLogo />
|
|
139
|
-
)
|
|
132
|
+
const rendered = renderLogoFn({ fn: logoConfig, theme: themeContext })
|
|
140
133
|
|
|
141
134
|
return createPortal(<span className="cp-nav-logo">{rendered}</span>, target)
|
|
142
135
|
}
|
package/dist/theme/index.tsx
CHANGED
|
@@ -19,7 +19,6 @@ import '@rspress/core/dist/theme/components/Sidebar/SidebarDivider.css'
|
|
|
19
19
|
import '@rspress/core/dist/theme/components/Sidebar/SidebarGroup.css'
|
|
20
20
|
import '@rspress/core/dist/theme/components/Sidebar/SidebarItem.css'
|
|
21
21
|
import '@rspress/core/dist/theme/components/Sidebar/SidebarSectionHeader.css'
|
|
22
|
-
|
|
23
22
|
import './styles/layers.css'
|
|
24
23
|
import './styles/overrides/fonts.css'
|
|
25
24
|
import './styles/overrides/tokens.css'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ciderpress/ui",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"description": "Rspress plugin, theme components, and styles for ciderpress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ciderpress",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public",
|
|
45
|
-
"provenance":
|
|
45
|
+
"provenance": true
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@iconify-json/catppuccin": "^1.2.17",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"react-aria-components": "^1.18.0",
|
|
64
64
|
"ts-morph": "^28.0.0",
|
|
65
65
|
"unist-util-visit": "^5.1.0",
|
|
66
|
-
"@ciderpress/
|
|
67
|
-
"@ciderpress/
|
|
66
|
+
"@ciderpress/config": "1.0.0-rc.3",
|
|
67
|
+
"@ciderpress/theme": "1.0.0-rc.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@ladle/react": "^5.1.1",
|
|
@@ -6,8 +6,6 @@ import { BRAND_COLORS, DEFAULT_THEME_NAME } from '@ciderpress/theme'
|
|
|
6
6
|
import React, { useEffect, useState } from 'react'
|
|
7
7
|
import { createPortal } from 'react-dom'
|
|
8
8
|
|
|
9
|
-
import { CiderpressLogo } from '../shared/ciderpress-logo'
|
|
10
|
-
|
|
11
9
|
import './nav-logo.css'
|
|
12
10
|
|
|
13
11
|
/**
|
|
@@ -37,7 +35,7 @@ const FALLBACK_COLORS = Object.freeze({
|
|
|
37
35
|
})
|
|
38
36
|
|
|
39
37
|
/**
|
|
40
|
-
* `NavLogo` — Rspress-aware logo slot
|
|
38
|
+
* `NavLogo` — Rspress-aware logo slot for function-form `logo` configs.
|
|
41
39
|
*
|
|
42
40
|
* - Reads `userConfig.logo` from the bundled user config via the
|
|
43
41
|
* `@ciderpress/internal/user-config` alias.
|
|
@@ -52,7 +50,10 @@ const FALLBACK_COLORS = Object.freeze({
|
|
|
52
50
|
* - `logo` is a function → call with the live `LogoContext`. If the return
|
|
53
51
|
* value is a `LogoImage`-shaped object, spread onto `<img>`. Otherwise
|
|
54
52
|
* render as a React node.
|
|
55
|
-
* - `logo` is missing → render
|
|
53
|
+
* - `logo` is missing → render `null`; Rspress paints the auto-generated
|
|
54
|
+
* `/logo.svg` (written to the public dir by the banner module, derived
|
|
55
|
+
* from the project title). Users who want the framework's themed wordmark
|
|
56
|
+
* opt in via `logo: ({ theme }) => <CiderpressLogo />`.
|
|
56
57
|
*
|
|
57
58
|
* @returns Portaled logo element or null
|
|
58
59
|
*/
|
|
@@ -116,13 +117,11 @@ export function NavLogo(): React.ReactElement | null {
|
|
|
116
117
|
|
|
117
118
|
const logoConfig = readLogoConfig(userConfigModule)
|
|
118
119
|
|
|
119
|
-
// String-form user logos
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
// shows. Theme color flips via `currentColor` reading from `--rp-c-brand`.
|
|
125
|
-
if (typeof logoConfig === 'string') {
|
|
120
|
+
// String-form user logos and the missing-logo default both ride Rspress's
|
|
121
|
+
// native <img>. resolveLogo() in @ciderpress/ui/config maps the missing
|
|
122
|
+
// case to the auto-generated /logo.svg path. Only function-form logos
|
|
123
|
+
// need this portal — they re-render when the theme/variant changes.
|
|
124
|
+
if (typeof logoConfig !== 'function') {
|
|
126
125
|
return null
|
|
127
126
|
}
|
|
128
127
|
|
|
@@ -130,13 +129,7 @@ export function NavLogo(): React.ReactElement | null {
|
|
|
130
129
|
return null
|
|
131
130
|
}
|
|
132
131
|
|
|
133
|
-
|
|
134
|
-
const rendered =
|
|
135
|
-
typeof logoConfig === 'function' ? (
|
|
136
|
-
renderLogoFn({ fn: logoConfig, theme: themeContext })
|
|
137
|
-
) : (
|
|
138
|
-
<CiderpressLogo />
|
|
139
|
-
)
|
|
132
|
+
const rendered = renderLogoFn({ fn: logoConfig, theme: themeContext })
|
|
140
133
|
|
|
141
134
|
return createPortal(<span className="cp-nav-logo">{rendered}</span>, target)
|
|
142
135
|
}
|
package/src/theme/index.tsx
CHANGED
|
@@ -19,7 +19,6 @@ import '@rspress/core/dist/theme/components/Sidebar/SidebarDivider.css'
|
|
|
19
19
|
import '@rspress/core/dist/theme/components/Sidebar/SidebarGroup.css'
|
|
20
20
|
import '@rspress/core/dist/theme/components/Sidebar/SidebarItem.css'
|
|
21
21
|
import '@rspress/core/dist/theme/components/Sidebar/SidebarSectionHeader.css'
|
|
22
|
-
|
|
23
22
|
import './styles/layers.css'
|
|
24
23
|
import './styles/overrides/fonts.css'
|
|
25
24
|
import './styles/overrides/tokens.css'
|