@stackql/docusaurus-plugin-aeo 0.4.0 → 0.4.1
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/CHANGELOG.md +17 -0
- package/README.md +2 -2
- package/package.json +17 -9
- package/src/theme/AskAiButton/icons.js +33 -60
- package/src/theme/AskAiButton/index.jsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
Cosmetic patch. No API, option-shape, behavior, or placement changes.
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Provider icons swapped from [simple-icons](https://simpleicons.org) (monochrome) to [@lobehub/icons](https://github.com/lobehub/lobe-icons) (colored brand variants). Resolves the ChatGPT-fallback-glyph issue from v0.3.0-v0.4.0: Claude, Perplexity, and Gemini now render in their brand colors via lobehub's `.Color` variants, and ChatGPT renders the OpenAI mark tinted with ChatGPT green (lobehub does not ship a `.Color` variant for OpenAI as of 5.10.0, so the monochrome mark is tinted inline).
|
|
10
|
+
- `ListItemIcon` now uses `sx={{ minWidth: 32, color: 'inherit' }}` so MUI's default tint does not override the brand colors.
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
|
|
14
|
+
- `simple-icons` dependency.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `@lobehub/icons` (`^5.10.0`, MIT) as a runtime dependency.
|
|
19
|
+
|
|
3
20
|
## 0.4.0
|
|
4
21
|
|
|
5
22
|
Visual refresh of the Ask AI button (feature 3) to match the look-and-feel of MUI-based dropdown components used elsewhere on consumer sites. No changes to features 1, 2, or 4.
|
package/README.md
CHANGED
|
@@ -194,9 +194,9 @@ Read https://your-site.example/path/to/page.md and help me with the following qu
|
|
|
194
194
|
|
|
195
195
|
The trailing space is intentional - the cursor lands ready for the user to type.
|
|
196
196
|
|
|
197
|
-
Provider icons are real brand SVGs sourced from [
|
|
197
|
+
Provider icons are real brand SVGs in each provider's brand color, sourced from [@lobehub/icons](https://github.com/lobehub/lobe-icons). Claude, Perplexity, and Gemini render via their `.Color` variants directly; OpenAI ships only a monochrome mark, so the ChatGPT row uses that mark tinted with the ChatGPT brand green so it visually pairs with the colored icons.
|
|
198
198
|
|
|
199
|
-
**Trademark note.** Brand logos are trademarks of their respective owners; their inclusion via
|
|
199
|
+
**Trademark note.** Brand logos are trademarks of their respective owners; their inclusion via @lobehub/icons does not imply endorsement. Consumers using the Ask AI button in commercial contexts should review each provider's brand-usage policy.
|
|
200
200
|
|
|
201
201
|
Options:
|
|
202
202
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackql/docusaurus-plugin-aeo",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "AEO (Answer Engine Optimization) helpers for Docusaurus: .md companion files, llms.txt / llms-full.txt, an Ask AI dropdown, and /ai/* route conventions.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -21,22 +21,30 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@docusaurus/core": "^3.0.0",
|
|
24
|
-
"@mui/material": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
25
|
-
"@mui/icons-material": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
26
24
|
"@emotion/react": "^11.0.0",
|
|
27
25
|
"@emotion/styled": "^11.0.0",
|
|
26
|
+
"@mui/icons-material": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
27
|
+
"@mui/material": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
28
28
|
"react": "^18.0.0 || ^19.0.0",
|
|
29
29
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependenciesMeta": {
|
|
32
|
-
"@mui/material": {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"@
|
|
32
|
+
"@mui/material": {
|
|
33
|
+
"optional": false
|
|
34
|
+
},
|
|
35
|
+
"@mui/icons-material": {
|
|
36
|
+
"optional": false
|
|
37
|
+
},
|
|
38
|
+
"@emotion/react": {
|
|
39
|
+
"optional": false
|
|
40
|
+
},
|
|
41
|
+
"@emotion/styled": {
|
|
42
|
+
"optional": false
|
|
43
|
+
}
|
|
36
44
|
},
|
|
37
45
|
"dependencies": {
|
|
38
|
-
"
|
|
39
|
-
"
|
|
46
|
+
"@lobehub/icons": "^5.10.0",
|
|
47
|
+
"gray-matter": "^4.0.3"
|
|
40
48
|
},
|
|
41
49
|
"overrides": {
|
|
42
50
|
"serialize-javascript": "^7.0.5",
|
|
@@ -1,72 +1,45 @@
|
|
|
1
|
-
// Brand icons for the four supported AI providers
|
|
1
|
+
// Brand icons for the four supported AI providers, sourced from
|
|
2
|
+
// @lobehub/icons. Each provider's package exports a default Mono
|
|
3
|
+
// component with .Color, .Text, .Combine, .Avatar attached as
|
|
4
|
+
// properties. We prefer .Color (multi-color brand variant) when the
|
|
5
|
+
// provider ships one; OpenAI does not, so we fall back to Mono and
|
|
6
|
+
// tint it with the ChatGPT brand green via inline style.
|
|
2
7
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// icon that disappears from upstream.
|
|
8
|
-
//
|
|
9
|
-
// All icons render as a 24x24 viewBox SVG with `fill="currentColor"`,
|
|
10
|
-
// so the menu CSS can size them via font-size or width/height and tint
|
|
11
|
-
// them via the surrounding text color. ESM `import` is used so webpack
|
|
12
|
-
// can tree-shake unused simple-icons exports out of the bundle.
|
|
8
|
+
// Deep import paths (@lobehub/icons/es/<Provider>) are used because
|
|
9
|
+
// the package does not declare a subpath exports map; the deep path
|
|
10
|
+
// is stable across the 5.x line and tree-shakes cleanly because each
|
|
11
|
+
// per-provider module's dependency footprint is just React.
|
|
13
12
|
|
|
14
13
|
import React from 'react';
|
|
15
|
-
import
|
|
14
|
+
import ClaudeIcons from '@lobehub/icons/es/Claude';
|
|
15
|
+
import OpenAIIcons from '@lobehub/icons/es/OpenAI';
|
|
16
|
+
import PerplexityIcons from '@lobehub/icons/es/Perplexity';
|
|
17
|
+
import GeminiIcons from '@lobehub/icons/es/Gemini';
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
return React.createElement(
|
|
19
|
-
'svg',
|
|
20
|
-
{
|
|
21
|
-
xmlns: 'http://www.w3.org/2000/svg',
|
|
22
|
-
width: '1em',
|
|
23
|
-
height: '1em',
|
|
24
|
-
viewBox: '0 0 24 24',
|
|
25
|
-
fill: 'currentColor',
|
|
26
|
-
role: 'img',
|
|
27
|
-
'aria-hidden': 'true',
|
|
28
|
-
},
|
|
29
|
-
children,
|
|
30
|
-
);
|
|
31
|
-
}
|
|
19
|
+
const ICON_SIZE = 18;
|
|
32
20
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return function BrandIcon() {
|
|
38
|
-
return svg(React.createElement('path', { d: si.path }));
|
|
39
|
-
};
|
|
40
|
-
}
|
|
21
|
+
// OpenAI ships only the monochrome mark (Color variant absent from
|
|
22
|
+
// @lobehub/icons as of 5.10.0). Use the known ChatGPT brand green so
|
|
23
|
+
// the row visually matches the other three colored marks.
|
|
24
|
+
const CHATGPT_GREEN = '#10A37F';
|
|
41
25
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
26
|
+
function makeColorIcon(IconNamespace, fallbackColor) {
|
|
27
|
+
const Component = IconNamespace.Color || IconNamespace;
|
|
28
|
+
const usingFallback = !IconNamespace.Color;
|
|
29
|
+
return function Icon() {
|
|
30
|
+
const props = { size: ICON_SIZE };
|
|
31
|
+
if (usingFallback && fallbackColor) {
|
|
32
|
+
props.style = { color: fallbackColor };
|
|
33
|
+
}
|
|
34
|
+
return React.createElement(Component, props);
|
|
35
|
+
};
|
|
50
36
|
}
|
|
51
37
|
|
|
52
38
|
const icons = {
|
|
53
|
-
claude:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
chatgpt: GenericAiIcon,
|
|
58
|
-
perplexity: fromSimpleIcons(siPerplexity),
|
|
59
|
-
gemini: fromSimpleIcons(siGooglegemini),
|
|
39
|
+
claude: makeColorIcon(ClaudeIcons),
|
|
40
|
+
chatgpt: makeColorIcon(OpenAIIcons, CHATGPT_GREEN),
|
|
41
|
+
perplexity: makeColorIcon(PerplexityIcons),
|
|
42
|
+
gemini: makeColorIcon(GeminiIcons),
|
|
60
43
|
};
|
|
61
44
|
|
|
62
|
-
if (typeof console !== 'undefined') {
|
|
63
|
-
for (const [name, icon] of Object.entries(icons)) {
|
|
64
|
-
if (icon === GenericAiIcon && name !== 'chatgpt') {
|
|
65
|
-
console.warn(
|
|
66
|
-
`[plugin-aeo] AskAiButton: brand icon for "${name}" missing from simple-icons; using generic AI glyph`,
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
45
|
export default icons;
|