Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/v2/telegram #56

Open
wants to merge 79 commits into
base: feature/v2/groq
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
8370be0
update quick action links
madjin Mar 19, 2025
a613ac6
Merge branch 'v2-develop' of github.com:elizaOS/eliza into jin-docs-v2
madjin Mar 19, 2025
93bc999
add thumbnails, update frontpage links
madjin Mar 20, 2025
f252328
cleanup core docs
madjin Mar 20, 2025
da094d8
update sidebars and intro
madjin Mar 20, 2025
0bddf26
fetch latest news
madjin Mar 20, 2025
cb0b576
fix syntax highlighting
madjin Mar 20, 2025
11c697f
add redpill plugin
HashWarlock Mar 21, 2025
3599bf3
update readme
HashWarlock Mar 21, 2025
ba88aa5
update package json
HashWarlock Mar 21, 2025
647d3f3
Merge branch 'v2-develop' into jin-docs-v2
madjin Mar 21, 2025
558d41a
update llms.txt files
madjin Mar 22, 2025
1dec6bc
update analysis files
madjin Mar 22, 2025
4fc5b75
update repomix configs
madjin Mar 22, 2025
fea5f3a
update blog
madjin Mar 22, 2025
3de4c9a
update blog post
madjin Mar 22, 2025
a2da8a5
update post
madjin Mar 22, 2025
5f45553
remove extra
madjin Mar 22, 2025
bc50b39
update config
madjin Mar 22, 2025
e2e91b0
update news
madjin Mar 22, 2025
ad87dc1
Merge branch 'v2-develop' into jin-docs-v2
madjin Mar 22, 2025
f20951f
fixed add plugin command quickstart.md
antman1p Mar 22, 2025
4074cb5
Merge pull request #4047 from antman1p/patch-5
madjin Mar 22, 2025
7733821
Merge branch 'v2-develop' into jin-docs-v2
madjin Mar 22, 2025
f68c7fb
add new blog post
madjin Mar 22, 2025
28e1e3b
Merge pull request #4045 from elizaOS/hash/add-redpill
lalalune Mar 23, 2025
e002e38
Merge pull request #4044 from meta-introspector/feature/v2/groq
lalalune Mar 23, 2025
40f2fa1
Merge branch 'v2-develop' into jin-docs-v2
madjin Mar 23, 2025
16cd5c9
add llms.txt generator workflow
madjin Mar 23, 2025
ce75ea2
Merge branch 'jin-docs-v2' of github.com:elizaOS/eliza into jin-docs-v2
madjin Mar 23, 2025
5a18419
fix: tg negative id
Mar 23, 2025
0954a7e
feat: add partial agent update
Mar 20, 2025
2df73bd
feat: make partial updates by navbars in char settings
Mar 20, 2025
b927f2d
feat: restructure update by panels
Mar 20, 2025
f7ffc36
chore: remove debug logs
Mar 20, 2025
91fb23d
chore: remove logs & fix avatar size
Mar 20, 2025
a7bdd72
chore: optimize logic for update
Mar 20, 2025
8f3b643
fix: remove unused vars
Mar 20, 2025
45d3763
chore: ensure min req for agent start
Mar 20, 2025
86d2ece
chore: remove unused function
Mar 20, 2025
6ed42d3
chore: enahnce settings update on agent
Mar 21, 2025
eade2a5
chore: clean the code
Mar 22, 2025
bb9c3be
chore: temp disable usePlugins
Mar 22, 2025
d70c3e0
fix: send only text response
Mar 23, 2025
495577b
add mermaid / bun notes
madjin Mar 23, 2025
dc2ce5c
fix: env drag and drop
Mar 23, 2025
ef8982b
add new links at footer, add copy page button
madjin Mar 24, 2025
bab0c6d
remove artifacts
madjin Mar 24, 2025
dceef56
fix chatgpt link, and sidebars order
madjin Mar 24, 2025
d849b44
add some svgs of worlds / rooms / entities
madjin Mar 24, 2025
861a25b
Merge pull request #4032 from elizaOS/jin-docs-v2
madjin Mar 24, 2025
e688afa
test existing salting
wtfsayo Mar 24, 2025
769acf2
handle salt without agentId
wtfsayo Mar 24, 2025
28b2542
clean up
wtfsayo Mar 24, 2025
6756d41
Merge branch 'v2-develop' into ELI2-130/change-agent-update-to-send-o…
wtfsayo Mar 24, 2025
00e5102
Merge pull request #4026 from 0xbbjoker/ELI2-130/change-agent-update-…
wtfsayo Mar 24, 2025
ca8fc5f
Merge branch 'v2-develop' into test-secret-encryption
wtfsayo Mar 24, 2025
c9bd2b7
Merge branch 'v2-develop' into fix/telegram-negative-chatid-uuid
wtfsayo Mar 24, 2025
feaa91d
Merge pull request #4052 from 0xbbjoker/fix/telegram-negative-chatid-…
wtfsayo Mar 24, 2025
337e066
Merge branch 'v2-develop' into test-secret-encryption
wtfsayo Mar 24, 2025
41ee10d
show client on received messages memory
wtfsayo Mar 24, 2025
aedfcdb
Merge pull request #4058 from elizaOS/minor-memory-viewer
wtfsayo Mar 24, 2025
fbea9f2
chore: encrypt character secrets from GUI
Mar 24, 2025
b6314ce
Merge pull request #4059 from 0xbbjoker/chore/gui-secret-encryption
wtfsayo Mar 24, 2025
c135a27
Merge branch 'v2-develop' into test-secret-encryption
wtfsayo Mar 24, 2025
b556504
Merge pull request #4056 from elizaOS/test-secret-encryption
wtfsayo Mar 24, 2025
cbd1b76
fix agent details display on cli
wtfsayo Mar 25, 2025
42d8fd9
better error for connection
wtfsayo Mar 25, 2025
0f2ebb2
fix display banner
wtfsayo Mar 25, 2025
69f7873
fix remaining cli issues
wtfsayo Mar 25, 2025
905545a
Merge pull request #4061 from elizaOS/cli-fixes
wtfsayo Mar 25, 2025
734eed2
change default director for models and cache for localai
wtfsayo Mar 25, 2025
e20bd81
Merge pull request #4062 from elizaOS/v2-local-ai-default-dir
wtfsayo Mar 25, 2025
3b7cd02
adding in branch name
Mar 25, 2025
9efd7c8
try again
Mar 25, 2025
37158ce
revert changes
Mar 25, 2025
1f42919
only show text animation once
tcm390 Mar 25, 2025
2e6faa0
JMD: rebase again and again
Mar 26, 2025
5e8a26e
builds
Mar 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add new links at footer, add copy page button
madjin committed Mar 24, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ef8982b570e95aed044b125db34d7d17da88e792
4 changes: 3 additions & 1 deletion packages/docs/docs/core/database.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ graph TB
DbConnection[("Database (PGLite/PostgreSQL)")]
%% Data Models in compact form
DataModels["Data Models:\n Entities, Components\n Memories, Relationships\n Rooms, Worlds, Tasks\n Cache"]
DataModels["Data Models: Entities, Components, Memories, Relationships, Rooms, Worlds, Tasks Cache"]
%% Vector Search
VectorStore[(Vector Store)]
@@ -39,11 +39,13 @@ graph TB
classDef adapter fill:#9b59b6,stroke:#2c3e50,stroke-width:1px,color:#fff;
classDef db fill:#27ae60,stroke:#2c3e50,stroke-width:1px,color:#fff;
classDef datamodels fill:#52be80,stroke:#2c3e50,stroke-width:1px,color:#fff;
classDef memories fill:#2c5e1a,stroke:#2c3333,stroke-width:1px,color:#fff;
class Runtime runtime;
class DbAdapter adapter;
class DbConnection,VectorStore db;
class DataModels datamodels;
class MemoriesKnowledge memories;
```

ElizaOS uses a unified database architecture based on Drizzle ORM with adapters that implement the [`IDatabaseAdapter`](/api/interfaces/IDatabaseAdapter) interface. The current release includes support for:
22 changes: 19 additions & 3 deletions packages/docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -185,7 +185,7 @@ const config = {
{
showReadingTime: true,
onUntruncatedBlogPosts: 'ignore',
editUrl: 'https://github.com/elizaos/eliza/tree/main/docs/blog/',
editUrl: 'https://github.com/elizaos/eliza/tree/v2-develop/docs/blog/',
blogSidebarTitle: 'Recent posts',
blogSidebarCount: 'ALL',
showLastUpdateAuthor: true,
@@ -210,7 +210,7 @@ const config = {
blogTitle: 'AI News',
blogDescription: 'Automated aggregating and summarization of elizaOS ecosystem updates',
showReadingTime: true,
editUrl: 'https://github.com/elizaos/eliza/tree/main/docs/news',
editUrl: 'https://github.com/elizaos/eliza/tree/v2-develop/packages/docs/news',
blogSidebarTitle: 'All posts',
blogSidebarCount: 'ALL',
showLastUpdateAuthor: true,
@@ -225,7 +225,7 @@ const config = {
docs: {
docItemComponent: '@theme/ApiItem',
sidebarPath: require.resolve('./sidebars.ts'),
editUrl: 'https://github.com/elizaos/eliza/tree/main/docs/',
editUrl: 'https://github.com/elizaos/eliza/tree/v2-develop/packages/docs/',
exclude: ['**/_media/**'],
showLastUpdateAuthor: true,
showLastUpdateTime: true,
@@ -363,11 +363,23 @@ const config = {
label: 'General',
href: './',
},
{
label: 'llms.txt',
href: 'llms.txt',
},
{
label: 'llms-full.txt',
href: 'llms-full.txt',
},
],
},
{
title: 'Community',
items: [
{
label: 'Website',
href: 'https://www.elizaos.ai/',
},
{
label: 'Discord',
href: 'https://discord.gg/elizaos',
@@ -381,6 +393,10 @@ const config = {
{
title: 'More',
items: [
{
label: 'Blog',
href: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/elizaos/eliza',
Binary file not shown.
365 changes: 365 additions & 0 deletions packages/docs/src/components/CopyPageButton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,365 @@
import React, { useState, useRef, useEffect } from 'react';
import { useLocation } from '@docusaurus/router';
import { useColorMode } from '@docusaurus/theme-common';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import styles from './styles.module.css';

// Define paths to exclude
const EXCLUDED_PATHS = [
// Exclude API pages
/^\/api\//,
/^\/api\/?$/,
// Exclude packages index
/^\/packages\/?$/,
// Add more excluded paths as needed
// /^\/other-path\//,
];

export default function CopyPageButton(): JSX.Element {
const [isOpen, setIsOpen] = useState(false);
const [copySuccess, setCopySuccess] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const dropdownRef = useRef<HTMLDivElement>(null);
const { colorMode } = useColorMode();
const location = useLocation();
const { siteConfig } = useDocusaurusContext();

// Check if current path should be excluded
const isExcludedPath = EXCLUDED_PATHS.some((regex) => regex.test(location.pathname));

// Early return if path is excluded
if (isExcludedPath) {
return null;
}

// Close dropdown when clicking outside
useEffect(() => {
function handleClickOutside(event: MouseEvent) {
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
setIsOpen(false);
}
}

document.addEventListener('mousedown', handleClickOutside);
return () => {
document.removeEventListener('mousedown', handleClickOutside);
};
}, []);

// Reset copy success message after 2 seconds
useEffect(() => {
if (copySuccess) {
const timer = setTimeout(() => {
setCopySuccess(false);
}, 2000);
return () => clearTimeout(timer);
}
}, [copySuccess]);

// Toggle dropdown
const toggleDropdown = () => {
setIsOpen(!isOpen);
};

// Extract the edit URL from the DOM
const getEditUrl = () => {
// Find the "Edit this page" link in the DOM
const editLinkElement = document.querySelector('a.theme-edit-this-page');
if (editLinkElement && editLinkElement.getAttribute('href')) {
return editLinkElement.getAttribute('href');
}

// Fallback for local development
// If we're in local development and we have editUrl configured in docusaurus.config.js
if (process.env.NODE_ENV === 'development') {
// Get the edit URL from config
let editUrl = siteConfig.presets?.[0]?.[1]?.docs?.editUrl || siteConfig.themeConfig?.editUrl;

if (editUrl) {
// Convert from tree URL to edit URL if needed
if (editUrl.includes('/tree/')) {
editUrl = editUrl.replace('/tree/', '/edit/');
}

// Remove trailing slash if present
const baseEditUrl = editUrl.endsWith('/') ? editUrl.slice(0, -1) : editUrl;

// Get the current path and remove leading and trailing slashes
let currentPath = location.pathname;
currentPath = currentPath.replace(/^\//, '').replace(/\/$/, '');

// Remove 'docs/' from the beginning if present
if (currentPath.startsWith('docs/')) {
currentPath = currentPath.substring(5);
}

// Append .md to get the markdown file
return `${baseEditUrl}/${currentPath}.md`;
}
}

return null;
};

// Convert GitHub edit URL to raw content URL
const getRawUrl = (url: string): string | null => {
if (!url) return null;

// Handle GitHub URLs - support both edit and tree formats
const githubEditRegex = /github\.com\/([^/]+)\/([^/]+)\/(edit|tree)\/([^/]+)\/(.+)/;
const match = url.match(githubEditRegex);

if (match) {
const [, owner, repo, urlType, branch, path] = match;
return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}`;
}

// Handle GitLab URLs
const gitlabEditRegex = /gitlab\.com\/([^/]+)\/([^/]+)\/-\/edit\/([^/]+)\/(.+)/;
const gitlabMatch = url.match(gitlabEditRegex);

if (gitlabMatch) {
const [, owner, repo, branch, path] = gitlabMatch;
return `https://gitlab.com/${owner}/${repo}/-/raw/${branch}/${path}`;
}

return url; // Return original URL if we can't convert it (for local development)
};

// Get content using the appropriate method
const getContent = async (url: string): Promise<string> => {
// For local development, try to fetch the content directly
if (process.env.NODE_ENV === 'development' && !url.startsWith('http')) {
try {
// Try to fetch from location relative to the current page
const localUrl = url.startsWith('/') ? url : `/${url}`;
const response = await fetch(localUrl);
if (response.ok) {
return await response.text();
}
} catch (error) {
console.error('Error fetching local content:', error);
}

// If local fetch fails, return placeholder message
return '# Content not available locally\n\nThis feature works best when deployed to GitHub Pages.';
}

// For production or if local fetch fails, use the raw URL
const rawUrl = getRawUrl(url);
if (!rawUrl) {
return '# Content not available\n\nCould not determine the source URL for this page.';
}

const response = await fetch(rawUrl);
if (!response.ok) {
throw new Error(`Failed to fetch: ${response.status} ${response.statusText}`);
}

return await response.text();
};

// Fetch markdown and copy to clipboard
const copyPageAsMarkdown = async () => {
const currentEditUrl = getEditUrl();
if (!currentEditUrl) {
console.error('Edit URL not available');
return;
}

setIsLoading(true);

try {
const markdown = await getContent(currentEditUrl);
await navigator.clipboard.writeText(markdown);
setCopySuccess(true);
setIsOpen(false);
} catch (error) {
console.error('Error fetching markdown:', error);
} finally {
setIsLoading(false);
}
};

// Open the raw markdown in a new tab
const viewAsMarkdown = async () => {
const currentEditUrl = getEditUrl();
if (!currentEditUrl) {
return;
}

const rawUrl = getRawUrl(currentEditUrl);
if (rawUrl) {
// For local development, create a blob URL
if (process.env.NODE_ENV === 'development' && !currentEditUrl.startsWith('http')) {
try {
const content = await getContent(currentEditUrl);
const blob = new Blob([content], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
window.open(url, '_blank');
} catch (error) {
console.error('Error creating blob:', error);
}
} else {
// For production
window.open(rawUrl, '_blank');
}
setIsOpen(false);
}
};

// Open the current page in ChatGPT
const openInChatGPT = () => {
const currentUrl = window.location.href;
// Use the correct ChatGPT URL format
const chatGptUrl = `https://chat.openai.com/?model=gpt-4&q=${encodeURIComponent(`Tell me about this page: ${currentUrl}`)}`;
window.open(chatGptUrl, '_blank');
setIsOpen(false);
};

// Check if we should show the button on this page
const [showButton, setShowButton] = useState(false);

useEffect(() => {
if (isExcludedPath) {
setShowButton(false);
return;
}

// Need a small delay to ensure the DOM is updated after page navigation
const timer = setTimeout(() => {
// In development, check if we have editUrl configured
if (process.env.NODE_ENV === 'development') {
const hasEditUrl = !!getEditUrl();
setShowButton(hasEditUrl);
} else {
// In production, check for the edit link in the DOM
const hasEditLink = !!document.querySelector('a.theme-edit-this-page');
setShowButton(hasEditLink);
}
}, 100);

return () => clearTimeout(timer);
}, [location.pathname, isExcludedPath]);

// Don't render the button if it shouldn't be shown
if (!showButton) {
return null;
}

return (
<div className={styles.copyPageButtonContainer} ref={dropdownRef}>
<button
className={styles.copyPageButton}
onClick={toggleDropdown}
aria-label="Copy page"
title="Copy page"
disabled={isLoading}
>
<svg
className={styles.copyIcon}
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
</svg>
<span className={styles.copyPageButtonText}>Copy page</span>
<svg
className={styles.dropdownIcon}
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>

{isOpen && (
<div className={`${styles.dropdown} ${colorMode === 'dark' ? styles.dark : ''}`}>
<div className={styles.dropdownHeader}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
</svg>
<div>
<div className={styles.dropdownTitle}>Copy page</div>
<div className={styles.dropdownSubtitle}>Copy this page as Markdown for LLMs</div>
</div>
</div>

<button className={styles.dropdownItem} onClick={copyPageAsMarkdown} disabled={isLoading}>
<svg
className={styles.itemIcon}
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
</svg>
<div>
<div className={styles.dropdownItemTitle}>Copy as Markdown</div>
<div className={styles.dropdownItemSubtitle}>Copy to clipboard</div>
</div>
</button>

<button className={styles.dropdownItem} onClick={viewAsMarkdown} disabled={isLoading}>
<span className={styles.codeIcon}>{'</>'}</span>
<div>
<div className={styles.dropdownItemTitle}>
View as Markdown <span className={styles.externalIcon}></span>
</div>
<div className={styles.dropdownItemSubtitle}>View this page as plain text</div>
</div>
</button>

<button className={styles.dropdownItem} onClick={openInChatGPT}>
<svg className={styles.chatGptIcon} viewBox="0 0 24 24" width="20" height="20">
<circle cx="12" cy="12" r="10" fill="currentColor" opacity="0.2" />
<path d="M12 4v16M4 12h16" stroke="currentColor" strokeWidth="2" />
</svg>
<div>
<div className={styles.dropdownItemTitle}>
Open in ChatGPT <span className={styles.externalIcon}></span>
</div>
<div className={styles.dropdownItemSubtitle}>Ask questions about this page</div>
</div>
</button>
</div>
)}

{copySuccess && <div className={styles.copySuccessTooltip}>Copied to clipboard!</div>}

{isLoading && <div className={styles.loadingTooltip}>Loading...</div>}
</div>
);
}
204 changes: 204 additions & 0 deletions packages/docs/src/components/CopyPageButton/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
.copyPageButtonContainer {
position: relative;
margin-left: 0.5rem;
display: inline-flex;
align-items: center;
}

.copyPageButton {
display: flex;
align-items: center;
gap: 0.5rem;
background-color: var(--ifm-color-emphasis-200);
border: 1px solid var(--ifm-color-emphasis-300);
color: var(--ifm-color-emphasis-800);
border-radius: 6px;
padding: 0.5rem 0.75rem;
font-size: 0.875rem;
cursor: pointer;
transition: all 0.2s ease;
font-weight: 500;
}

.copyPageButton:hover {
background-color: var(--ifm-color-emphasis-300);
}

.copyPageButton:disabled {
opacity: 0.6;
cursor: not-allowed;
}

.copyIcon {
flex-shrink: 0;
}

.dropdownIcon {
width: 16px;
height: 16px;
margin-left: 2px;
}

.dropdown {
position: absolute;
top: calc(100% + 8px);
right: 0;
background-color: white;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
width: 320px;
z-index: 100;
overflow: hidden;
border: 1px solid var(--ifm-color-emphasis-200);
}

.dropdown.dark {
background-color: var(--ifm-background-surface-color);
border-color: var(--ifm-color-emphasis-300);
}

.dropdownHeader {
padding: 1rem;
display: flex;
align-items: flex-start;
gap: 0.75rem;
border-bottom: 1px solid var(--ifm-color-emphasis-200);
}

.dropdownTitle {
font-weight: 600;
margin-bottom: 0.25rem;
color: var(--ifm-heading-color);
}

.dropdownSubtitle {
font-size: 0.875rem;
color: var(--ifm-color-emphasis-600);
}

.dropdownItem {
width: 100%;
display: flex;
align-items: flex-start;
gap: 0.75rem;
padding: 1rem;
border: none;
background: transparent;
text-align: left;
cursor: pointer;
transition: background-color 0.2s ease;
color: var(--ifm-font-color-base);
}

.dropdownItem:hover {
background-color: var(--ifm-color-emphasis-100);
}

.dropdownItem:disabled {
opacity: 0.6;
cursor: not-allowed;
}

.dropdownItem:disabled:hover {
background-color: transparent;
}

.dropdownItemTitle {
font-weight: 500;
margin-bottom: 0.25rem;
display: flex;
align-items: center;
gap: 0.25rem;
color: var(--ifm-heading-color);
}

.externalIcon {
font-size: 0.875rem;
opacity: 0.7;
}

.dropdownItemSubtitle {
font-size: 0.875rem;
color: var(--ifm-color-emphasis-600);
}

.itemIcon {
margin-top: 0.125rem;
}

.codeIcon {
display: inline-flex;
align-items: center;
justify-content: center;
font-family: monospace;
font-size: 0.75rem;
background-color: var(--ifm-color-emphasis-200);
padding: 0.375rem;
border-radius: 4px;
width: 20px;
height: 20px;
margin-top: 0.125rem;
}

.chatGptIcon {
color: #10a37f;
margin-top: 0.125rem;
}

.copySuccessTooltip {
position: absolute;
bottom: calc(100% + 8px);
right: 0;
background-color: var(--ifm-color-success);
color: white;
padding: 0.375rem 0.75rem;
border-radius: 4px;
font-size: 0.875rem;
white-space: nowrap;
animation: fadeInOut 2s ease;
font-weight: 500;
}

.loadingTooltip {
position: absolute;
bottom: calc(100% + 8px);
right: 0;
background-color: var(--ifm-color-info);
color: white;
padding: 0.375rem 0.75rem;
border-radius: 4px;
font-size: 0.875rem;
white-space: nowrap;
font-weight: 500;
}

@keyframes fadeInOut {
0% {
opacity: 0;
transform: translateY(8px);
}
10% {
opacity: 1;
transform: translateY(0);
}
90% {
opacity: 1;
transform: translateY(0);
}
100% {
opacity: 0;
transform: translateY(-8px);
}
}

/* Responsive adjustments */
@media (max-width: 768px) {
.copyPageButtonText {
display: none;
}

.dropdown {
width: 280px;
right: -12px;
}
}
169 changes: 82 additions & 87 deletions packages/docs/src/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
* Optimized CSS for eliza documentation site
* Performance-focused with reduced transitions and simplified selectors
*/

/* You can override the default Infima variables here. */
/* Base variables - unchanged to maintain visual identity */
:root {
--ifm-color-primary: #ffa600;
--ifm-color-primary-dark: #e69500;
@@ -19,57 +18,46 @@
sans-serif;
}

/* Cool dark mode with modern aesthetics and warm accents */
/* Dark mode variables - simplified */
[data-theme='dark'] {
/* Warmer primary color - orange-blue balance */
--ifm-color-primary: #ff9500; /* Warm orange as primary */
--ifm-color-primary: #ff9500;
--ifm-color-primary-dark: #e68600;
--ifm-color-primary-darker: #d97e00;
--ifm-color-primary-darkest: #b36800;
--ifm-color-primary-light: #ffa01a;
--ifm-color-primary-lighter: #ffaa33;
--ifm-color-primary-lightest: #ffb84d;

/* Accent color for secondary elements - keeping some blue */
--ifm-color-secondary-dark: #00a3cc; /* Cyan for accents */

/* Enhanced backgrounds with warmer undertones */
--ifm-background-color: #111827; /* Darker blue-gray background */
--ifm-background-surface-color: #1e293b; /* Surface with slight warmth */

/* Text colors */
--ifm-color-secondary-dark: #00a3cc;
--ifm-background-color: #111827;
--ifm-background-surface-color: #1e293b;
--ifm-font-color-base: #f1f5f9;
--ifm-heading-color: #ffffff;

/* Code and doc elements */
--docusaurus-highlighted-code-line-bg: rgba(255, 149, 0, 0.1); /* Warm highlight */
--docusaurus-highlighted-code-line-bg: rgba(255, 149, 0, 0.1);
--ifm-footer-background-color: #1e293b;
--ifm-table-stripe-background: rgba(255, 255, 255, 0.03);
--ifm-table-border-color: rgba(255, 255, 255, 0.12);
--ifm-toc-border-color: rgba(255, 149, 0, 0.2); /* Warm accent for TOC */
--ifm-toc-border-color: rgba(255, 149, 0, 0.2);
--ifm-color-emphasis-300: rgba(255, 255, 255, 0.25);

/* Warm accents */
--warm-accent-light: rgba(255, 149, 0, 0.15);
--warm-accent-border: rgba(255, 149, 0, 0.3);
}

/* Subtle gradient background for dark mode pages with warmer undertones */
/* Performance-optimized background */
[data-theme='dark'] .main-wrapper {
background: radial-gradient(circle at 10% 10%, #1e293b 0%, #111827 90%);
background-color: #111827;
}

/* Fixed footer color */
.footer {
background-color: #161b22;
}

/* Cool gradient buttons */
/* Button styling - minimal transitions */
.button--primary {
background: linear-gradient(135deg, rgb(249, 140, 19) 0%, rgb(255, 166, 0) 100%);
background: linear-gradient(135deg, #f98c13 0%, #ffa600 100%);
border: none;
padding: 1rem 2rem;
font-size: 1.2rem;
transition: all 0.3s ease;
color: white;
position: relative;
z-index: 1;
@@ -78,25 +66,26 @@
}

.button--primary:hover {
background: linear-gradient(135deg, rgb(255, 156, 43) 0%, rgb(255, 166, 0) 100%);
background: linear-gradient(135deg, #ff9c2b 0%, #ffa600 100%);
transform: translateY(-2px);
box-shadow: 0 6px 20px 0 rgba(255, 166, 0, 0.3);
}

[data-theme='dark'] .button--primary {
background: linear-gradient(135deg, rgb(255, 149, 0) 0%, rgb(255, 102, 0) 100%);
background: linear-gradient(135deg, #ff9500 0%, #ff6600 100%);
box-shadow: 0 4px 14px 0 rgba(255, 149, 0, 0.25);
}

[data-theme='dark'] .button--primary:hover {
background: linear-gradient(135deg, rgb(255, 166, 43) 0%, rgb(255, 123, 26) 100%);
background: linear-gradient(135deg, #ffa62b 0%, #ff7b1a 100%);
box-shadow: 0 6px 20px 0 rgba(255, 149, 0, 0.3);
}

/* Responsive iframe - unchanged */
.responsive-iframe {
position: relative;
width: 100%;
padding-bottom: 56.25%; /* 16:9 aspect ratio */
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
background: #000;
@@ -114,7 +103,7 @@
border-radius: 8px;
}

/* Futuristic API Method badges */
/* API Method badges - optimized selectors */
.api-method > .menu__link {
align-items: center;
justify-content: start;
@@ -132,46 +121,40 @@
text-align: center;
flex-shrink: 0;
color: white;
transition: all 0.3s ease;
}

/* Modern REST API badges for dark mode with warm accents */
/* API method badges for dark mode - flat colors for better performance */
[data-theme='dark'] .get > .menu__link::before {
content: 'get';
background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
background-color: #3182ce;
color: white;
box-shadow: 0 2px 5px rgba(49, 130, 206, 0.3);
}

[data-theme='dark'] .post > .menu__link::before {
content: 'post';
background: linear-gradient(135deg, #38a169 0%, #276749 100%);
background-color: #38a169;
color: white;
box-shadow: 0 2px 5px rgba(56, 161, 105, 0.3);
}

[data-theme='dark'] .delete > .menu__link::before {
content: 'del';
background: linear-gradient(135deg, #e53e3e 0%, #9b2c2c 100%);
background-color: #e53e3e;
color: white;
box-shadow: 0 2px 5px rgba(229, 62, 62, 0.3);
}

[data-theme='dark'] .put > .menu__link::before {
content: 'put';
background: linear-gradient(135deg, #4299e1 0%, #2b6cb0 100%);
background-color: #4299e1;
color: white;
box-shadow: 0 2px 5px rgba(66, 153, 225, 0.3);
}

[data-theme='dark'] .patch > .menu__link::before {
content: 'patch';
background: linear-gradient(135deg, #ff9500 0%, #c05621 100%);
background-color: #ff9500;
color: white;
box-shadow: 0 2px 5px rgba(255, 149, 0, 0.3);
}

/* Light mode API badges */
/* Light mode API badges - simplified */
.get > .menu__link::before {
content: 'get';
background-color: var(--ifm-color-primary);
@@ -197,11 +180,11 @@
background-color: #f97316;
}

/* Cool tables in dark mode with subtle hover effects */
/* Optimized tables in dark mode */
[data-theme='dark'] table {
border-spacing: 0;
overflow-x: auto;
display: block; /* Make tables responsive */
display: block;
margin: 1.5em 0;
}

@@ -211,11 +194,7 @@
font-weight: 600;
border-bottom: 2px solid rgba(255, 149, 0, 0.2);
padding: 12px 16px;
white-space: nowrap; /* Prevents wrapping in headers */
}

[data-theme='dark'] table tr {
transition: background-color 0.2s ease;
white-space: nowrap;
}

[data-theme='dark'] table tr:nth-child(even) {
@@ -231,71 +210,49 @@
padding: 12px 16px;
}

/* Stylish sidebar in dark mode */
/* Performance-optimized sidebar in dark mode */
[data-theme='dark'] .menu {
background-color: #161b22;
border-right: 1px solid rgba(255, 255, 255, 0.05);
/* Use box-shadow instead of border for better performance */
box-shadow: 1px 0 0 rgba(255, 255, 255, 0.05);
/* Hardware acceleration */
transform: translateZ(0);
}

/* Optimized active links - remove transitions */
[data-theme='dark'] .menu__link--active {
background-color: var(--warm-accent-light);
background-color: rgba(255, 149, 0, 0.15);
border-left: 3px solid var(--ifm-color-primary);
font-weight: 600;
padding-left: calc(var(--ifm-menu-link-padding-horizontal) - 3px);
}

/* Simplified hover effect with minimal transition */
[data-theme='dark'] .menu__link:hover {
background-color: rgba(255, 255, 255, 0.05);
transition: background-color 0.2s ease;
}

/* Modernized navbar */
/* Optimized navbar */
[data-theme='dark'] .navbar {
background-color: rgba(22, 27, 34, 0.9);
backdrop-filter: blur(10px);
box-shadow:
0 1px 2px 0 rgba(0, 0, 0, 0.1),
0 1px 6px 0 rgba(0, 0, 0, 0.05);
background-color: rgba(22, 27, 34, 0.95);
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

/* Card styling for dark mode with warm accents */
/* Card styling for dark mode - optimized */
[data-theme='dark'] .card {
background-color: #1e293b;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
transition:
transform 0.3s ease,
box-shadow 0.3s ease,
border-color 0.3s ease;
border: 1px solid rgba(255, 255, 255, 0.05);
overflow: hidden;
}

[data-theme='dark'] .card:hover {
border-color: rgba(255, 149, 0, 0.2);
}

[data-theme='dark'] .card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Elegant transitions for dark mode */
[data-theme='dark'] * {
transition:
background 0.5s ease,
background-color 0.2s ease,
border-color 1s ease,
fill 0.2s ease,
stroke 0.5s ease;
}

/* Cool announcement bar if you have one */
[data-theme='dark'] .announcement-bar {
background: linear-gradient(90deg, #161b22 0%, #0d1117 50%, #161b22 100%);
background-size: 200% 100%;
animation: gradient-shift 15s ease infinite;
}

/* Warm accent for blockquotes */
[data-theme='dark'] blockquote {
border-left: 3px solid var(--ifm-color-primary);
@@ -304,3 +261,41 @@
padding: 1em;
border-radius: 0 8px 8px 0;
}

/* Use specific will-change properties only where needed */
.navbar--fixed-top {
will-change: transform;
}

.menu__link {
will-change: background-color;
}

/* Target performance for key interactive components */
@media (prefers-reduced-motion: no-preference) {
/* Apply transitions only for non-reduced motion users */
.button--primary {
transition:
transform 0.2s ease,
box-shadow 0.2s ease;
}

.menu__link:hover {
transition: background-color 0.15s ease;
}

.card:hover {
transition:
transform 0.2s ease,
box-shadow 0.2s ease,
border-color 0.2s ease;
}
}

/* Prefers-reduced-motion accommodations */
@media (prefers-reduced-motion: reduce) {
* {
animation: none !important;
transition: none !important;
}
}
15 changes: 15 additions & 0 deletions packages/docs/src/theme/DocItem/Content/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import Content from '@theme-original/DocItem/Content';
import CopyPageButton from '@site/src/components/CopyPageButton';
import styles from './styles.module.css';

export default function ContentWrapper(props) {
return (
<>
<div className={styles.docItemActions}>
<CopyPageButton />
</div>
<Content {...props} />
</>
);
}
5 changes: 5 additions & 0 deletions packages/docs/src/theme/DocItem/Content/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.docItemActions {
display: flex;
justify-content: flex-end;
margin-bottom: 1rem;
}