Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f41ae6b0a3 |
@@ -3,12 +3,6 @@ name: Deploy Rust Bedrock
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
paths-ignore:
|
|
||||||
- 'home/**'
|
|
||||||
- 'dashboard/**'
|
|
||||||
- 'repository/**'
|
|
||||||
- 'package.json'
|
|
||||||
- 'package-lock.json'
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: bedrock-rust-deploy
|
group: bedrock-rust-deploy
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/target
|
/target
|
||||||
/bedrock.sqlite3
|
/bedrock.sqlite3
|
||||||
/bedrock.sqlite3-*
|
/bedrock.sqlite3-*
|
||||||
|
|
||||||
/node_modules/
|
|
||||||
|
|||||||
@@ -6,6 +6,26 @@
|
|||||||
|
|
||||||
`transport.rs` 提供共享的 `Address` 和 `Tls`。SQL 通过 `tls` 字段配置 TLS,S3 从 endpoint 的协议得到 TLS 策略。省略 S3 endpoint 时使用默认 HTTPS 地址。
|
`transport.rs` 提供共享的 `Address` 和 `Tls`。SQL 通过 `tls` 字段配置 TLS,S3 从 endpoint 的协议得到 TLS 策略。省略 S3 endpoint 时使用默认 HTTPS 地址。
|
||||||
|
|
||||||
|
## 启动时如何使用配置
|
||||||
|
|
||||||
|
`backend` 启动时从 `BEDROCK_DB_CONFIG` 指定的文件加载 `DeploymentConfig`,调用 `resolve()` 校验各项资源及绑定目标,得到 `ResolvedDeployment` 快照。如果资源和绑定都为空,快照使用默认绑定 `documents → local`,对应 SQLite 文件 `bedrock.sqlite3`。
|
||||||
|
|
||||||
|
以仓库中的多存储配置为例,每个用途指向一个资源,多个用途也可以指向同一资源。[完整配置](../../deploy/kubernetes/multi-storage.yaml)
|
||||||
|
|
||||||
|
| 用途 | 资源 | 解析结果 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `documents` | `pg-main` | PostgreSQL 连接参数 |
|
||||||
|
| `legacy` | `mysql-legacy` | MySQL 连接参数 |
|
||||||
|
| `attachments` | `attachment-store` | S3 存储桶配置 |
|
||||||
|
|
||||||
|
启动文档服务时,`database::connect_resolved` 从快照取出 `documents`,检查它是 SQL 资源,再建立连接。因此,把 `documents` 指向一个存在的 S3 资源能通过绑定目标检查,但会在建立文档数据库连接时得到 `InvalidDocuments`。[后端启动入口](../backend/src/main.rs) · [数据库连接实现](../database/src/connection.rs)
|
||||||
|
|
||||||
|
## 逻辑集群的设计方向
|
||||||
|
|
||||||
|
Bedrock 计划在本 crate 内按业务能力定义逻辑集群。例如,图片存储和 PostgreSQL 备份归档都可以使用 S3,前者向调用方提供按键读写图片的操作,后者提供归档与恢复操作。反过来,同一个索引查询契约可以由单一 PostgreSQL 资源实现,也可以由组合 PostgreSQL 和 MySQL 的 Rust 代码实现。
|
||||||
|
|
||||||
|
现有的 `resources` 和 `bindings` 可以继续提供这些实现所需的连接配置。要让调用方按业务能力访问集群,还需要定义调用方与提供方共享的 Rust 契约,并描述每个集群选择哪个实现、该实现使用哪些资源,以及由哪个进程执行。当前配置只记录用途与单个资源的对应关系;业务契约、跨资源组合以及跨进程调用均属于后续设计。
|
||||||
|
|
||||||
## 模块依赖
|
## 模块依赖
|
||||||
|
|
||||||
箭头从使用方指向定义类型或提供功能的模块。图中省略 `mod` 声明和 `pub use` 导出。旧配置结构在 `format.rs` 转成统一目录。
|
箭头从使用方指向定义类型或提供功能的模块。图中省略 `mod` 声明和 `pub use` 导出。旧配置结构在 `format.rs` 转成统一目录。
|
||||||
|
|||||||
@@ -16,7 +16,4 @@ pub use organization::{Organization, OrganizationId, OrganizationMembership, Org
|
|||||||
pub use rich_text::{Inline, RichText};
|
pub use rich_text::{Inline, RichText};
|
||||||
pub use tree::{DocumentTree, TreeError};
|
pub use tree::{DocumentTree, TreeError};
|
||||||
pub use user::{User, UserId};
|
pub use user::{User, UserId};
|
||||||
pub use workspace::{
|
pub use workspace::{Workspace, WorkspaceId};
|
||||||
Workspace, WorkspaceAccess, WorkspaceAccessError, WorkspaceId, WorkspaceInvitation,
|
|
||||||
WorkspaceMembership, WorkspaceRole,
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ use super::contextualize::Contextualize;
|
|||||||
use super::{
|
use super::{
|
||||||
id::{IdError, validate_id},
|
id::{IdError, validate_id},
|
||||||
user::UserId,
|
user::UserId,
|
||||||
workspace::{Workspace, WorkspaceAccess, WorkspaceAccessError, WorkspaceId},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||||
@@ -43,20 +42,6 @@ pub struct OrganizationMembership {
|
|||||||
pub role: OrganizationRole,
|
pub role: OrganizationRole,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Organization {
|
|
||||||
pub fn create_workspace(&self, id: WorkspaceId, name: impl Into<String>) -> Workspace {
|
|
||||||
Workspace::owned_by(id, name, self.id.clone())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_workspace_access(
|
|
||||||
&self,
|
|
||||||
workspace: &mut Workspace,
|
|
||||||
access: WorkspaceAccess,
|
|
||||||
) -> Result<(), WorkspaceAccessError> {
|
|
||||||
workspace.set_organization_access(&self.id, access)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Contextualize for Organization {
|
impl Contextualize for Organization {
|
||||||
fn render_context(&self) -> String {
|
fn render_context(&self) -> String {
|
||||||
format!("Organization: {}", self.name)
|
format!("Organization: {}", self.name)
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
use super::contextualize::Contextualize;
|
use super::contextualize::Contextualize;
|
||||||
use super::{
|
use super::{
|
||||||
Document,
|
|
||||||
id::{IdError, validate_id},
|
id::{IdError, validate_id},
|
||||||
organization::{OrganizationId, OrganizationMembership},
|
organization::OrganizationId,
|
||||||
tree::{DocumentTree, TreeError},
|
|
||||||
user::UserId,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||||
@@ -26,188 +21,12 @@ impl WorkspaceId {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
/// A workspace belongs to one organization and contains documents.
|
||||||
pub enum WorkspaceRole {
|
|
||||||
Owner,
|
|
||||||
Admin,
|
|
||||||
Editor,
|
|
||||||
Viewer,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Controls which roles can be granted to people outside the owning organization.
|
|
||||||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
|
|
||||||
pub enum WorkspaceAccess {
|
|
||||||
#[default]
|
|
||||||
MembersOnly,
|
|
||||||
ExternalViewers,
|
|
||||||
ExternalEditors,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl WorkspaceAccess {
|
|
||||||
fn allows_external(self, role: WorkspaceRole) -> bool {
|
|
||||||
matches!(
|
|
||||||
(self, role),
|
|
||||||
(
|
|
||||||
Self::ExternalViewers | Self::ExternalEditors,
|
|
||||||
WorkspaceRole::Viewer
|
|
||||||
) | (Self::ExternalEditors, WorkspaceRole::Editor)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
||||||
struct OrganizationWorkspace {
|
|
||||||
id: OrganizationId,
|
|
||||||
access: WorkspaceAccess,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A workspace contains documents and may be owned by an organization.
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
pub struct Workspace {
|
pub struct Workspace {
|
||||||
pub id: WorkspaceId,
|
pub id: WorkspaceId,
|
||||||
|
pub organization_id: OrganizationId,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
organization: Option<OrganizationWorkspace>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
||||||
pub struct WorkspaceInvitation {
|
|
||||||
workspace_id: WorkspaceId,
|
|
||||||
invitee: UserId,
|
|
||||||
role: WorkspaceRole,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
||||||
pub struct WorkspaceMembership {
|
|
||||||
pub workspace_id: WorkspaceId,
|
|
||||||
pub user_id: UserId,
|
|
||||||
pub role: WorkspaceRole,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Error, Eq, PartialEq)]
|
|
||||||
pub enum WorkspaceAccessError {
|
|
||||||
#[error("the workspace does not belong to this organization")]
|
|
||||||
OrganizationMismatch,
|
|
||||||
#[error("the workspace access policy does not allow this role for the invitee")]
|
|
||||||
RoleNotAllowed,
|
|
||||||
#[error("the invitation is for a different workspace or user")]
|
|
||||||
InvitationMismatch,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Workspace {
|
|
||||||
pub fn independent(id: WorkspaceId, name: impl Into<String>) -> Self {
|
|
||||||
Self {
|
|
||||||
id,
|
|
||||||
name: name.into(),
|
|
||||||
organization: None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(super) fn owned_by(
|
|
||||||
id: WorkspaceId,
|
|
||||||
name: impl Into<String>,
|
|
||||||
organization_id: OrganizationId,
|
|
||||||
) -> Self {
|
|
||||||
Self {
|
|
||||||
id,
|
|
||||||
name: name.into(),
|
|
||||||
organization: Some(OrganizationWorkspace {
|
|
||||||
id: organization_id,
|
|
||||||
access: WorkspaceAccess::default(),
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn organization_id(&self) -> Option<&OrganizationId> {
|
|
||||||
self.organization
|
|
||||||
.as_ref()
|
|
||||||
.map(|organization| &organization.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn organization_access(&self) -> Option<WorkspaceAccess> {
|
|
||||||
self.organization
|
|
||||||
.as_ref()
|
|
||||||
.map(|organization| organization.access)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(super) fn set_organization_access(
|
|
||||||
&mut self,
|
|
||||||
organization_id: &OrganizationId,
|
|
||||||
access: WorkspaceAccess,
|
|
||||||
) -> Result<(), WorkspaceAccessError> {
|
|
||||||
let organization = self
|
|
||||||
.organization
|
|
||||||
.as_mut()
|
|
||||||
.filter(|organization| &organization.id == organization_id)
|
|
||||||
.ok_or(WorkspaceAccessError::OrganizationMismatch)?;
|
|
||||||
organization.access = access;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Evaluates the invitee against the current policy. The caller supplies the
|
|
||||||
/// invitee's current membership in the owning organization, if any.
|
|
||||||
pub fn invite(
|
|
||||||
&self,
|
|
||||||
invitee: UserId,
|
|
||||||
role: WorkspaceRole,
|
|
||||||
organization_membership: Option<&OrganizationMembership>,
|
|
||||||
) -> Result<WorkspaceInvitation, WorkspaceAccessError> {
|
|
||||||
self.check_access(&invitee, role, organization_membership)?;
|
|
||||||
Ok(WorkspaceInvitation {
|
|
||||||
workspace_id: self.id.clone(),
|
|
||||||
invitee,
|
|
||||||
role,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Rechecks policy and membership so a pending invitation cannot preserve
|
|
||||||
/// privileges after either has changed.
|
|
||||||
pub fn accept_invitation(
|
|
||||||
&self,
|
|
||||||
user: &UserId,
|
|
||||||
invitation: &WorkspaceInvitation,
|
|
||||||
organization_membership: Option<&OrganizationMembership>,
|
|
||||||
) -> Result<WorkspaceMembership, WorkspaceAccessError> {
|
|
||||||
if invitation.workspace_id != self.id || &invitation.invitee != user {
|
|
||||||
return Err(WorkspaceAccessError::InvitationMismatch);
|
|
||||||
}
|
|
||||||
self.check_access(user, invitation.role, organization_membership)?;
|
|
||||||
Ok(WorkspaceMembership {
|
|
||||||
workspace_id: self.id.clone(),
|
|
||||||
user_id: user.clone(),
|
|
||||||
role: invitation.role,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Assembles an ordered tree of document nodes in this workspace.
|
|
||||||
pub fn document_tree(
|
|
||||||
&self,
|
|
||||||
root: Document,
|
|
||||||
descendants: impl IntoIterator<Item = Document>,
|
|
||||||
) -> Result<DocumentTree, TreeError> {
|
|
||||||
if root.key.workspace != self.id {
|
|
||||||
return Err(TreeError::WorkspaceMismatch);
|
|
||||||
}
|
|
||||||
DocumentTree::new(root, descendants)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn check_access(
|
|
||||||
&self,
|
|
||||||
user: &UserId,
|
|
||||||
role: WorkspaceRole,
|
|
||||||
membership: Option<&OrganizationMembership>,
|
|
||||||
) -> Result<(), WorkspaceAccessError> {
|
|
||||||
let Some(organization) = &self.organization else {
|
|
||||||
return Ok(());
|
|
||||||
};
|
|
||||||
let internal = membership.is_some_and(|membership| {
|
|
||||||
membership.organization_id == organization.id && &membership.user_id == user
|
|
||||||
});
|
|
||||||
if internal || organization.access.allows_external(role) {
|
|
||||||
Ok(())
|
|
||||||
} else {
|
|
||||||
Err(WorkspaceAccessError::RoleNotAllowed)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Contextualize for Workspace {
|
impl Contextualize for Workspace {
|
||||||
|
|||||||
@@ -1,174 +0,0 @@
|
|||||||
use documents::{
|
|
||||||
Document, DocumentContent, DocumentId, DocumentKey, Organization, OrganizationId,
|
|
||||||
OrganizationMembership, OrganizationRole, TreeError, UserId, Workspace, WorkspaceAccess,
|
|
||||||
WorkspaceAccessError, WorkspaceId, WorkspaceRole,
|
|
||||||
};
|
|
||||||
|
|
||||||
fn organization(id: &str) -> Organization {
|
|
||||||
Organization {
|
|
||||||
id: OrganizationId::new(id).unwrap(),
|
|
||||||
name: id.into(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn member(organization: &Organization, user: &UserId) -> OrganizationMembership {
|
|
||||||
OrganizationMembership {
|
|
||||||
organization_id: organization.id.clone(),
|
|
||||||
user_id: user.clone(),
|
|
||||||
role: OrganizationRole::Member,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn workspace_id(value: &str) -> WorkspaceId {
|
|
||||||
WorkspaceId::new(value).unwrap()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn organization_controls_the_roles_available_to_external_users() {
|
|
||||||
use WorkspaceAccess::{ExternalEditors, ExternalViewers, MembersOnly};
|
|
||||||
use WorkspaceRole::{Admin, Editor, Owner, Viewer};
|
|
||||||
|
|
||||||
let organization = organization("org");
|
|
||||||
let mut workspace = organization.create_workspace(workspace_id("workspace"), "Workspace");
|
|
||||||
let outside = UserId::new("outside").unwrap();
|
|
||||||
let inside = UserId::new("inside").unwrap();
|
|
||||||
let membership = member(&organization, &inside);
|
|
||||||
assert_eq!(workspace.organization_id(), Some(&organization.id));
|
|
||||||
assert_eq!(workspace.organization_access(), Some(MembersOnly));
|
|
||||||
|
|
||||||
for (policy, allowed) in [
|
|
||||||
(MembersOnly, &[][..]),
|
|
||||||
(ExternalViewers, &[Viewer][..]),
|
|
||||||
(ExternalEditors, &[Viewer, Editor][..]),
|
|
||||||
] {
|
|
||||||
organization
|
|
||||||
.set_workspace_access(&mut workspace, policy)
|
|
||||||
.unwrap();
|
|
||||||
for role in [Owner, Admin, Editor, Viewer] {
|
|
||||||
let invitation = workspace.invite(outside.clone(), role, None);
|
|
||||||
if allowed.contains(&role) {
|
|
||||||
let membership = workspace
|
|
||||||
.accept_invitation(&outside, &invitation.unwrap(), None)
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(membership.user_id, outside);
|
|
||||||
assert_eq!(membership.workspace_id, workspace.id);
|
|
||||||
assert_eq!(membership.role, role);
|
|
||||||
} else {
|
|
||||||
assert_eq!(invitation, Err(WorkspaceAccessError::RoleNotAllowed));
|
|
||||||
}
|
|
||||||
assert!(
|
|
||||||
workspace
|
|
||||||
.invite(inside.clone(), role, Some(&membership))
|
|
||||||
.is_ok()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn acceptance_checks_the_invite_target_and_current_policy() {
|
|
||||||
let owner = organization("owner");
|
|
||||||
let other = organization("other");
|
|
||||||
let mut workspace = owner.create_workspace(workspace_id("workspace"), "Workspace");
|
|
||||||
let independent = Workspace::independent(workspace_id("personal"), "Personal");
|
|
||||||
let outsider = UserId::new("outside").unwrap();
|
|
||||||
let insider = UserId::new("inside").unwrap();
|
|
||||||
let inside_membership = member(&owner, &insider);
|
|
||||||
let other_membership = member(&other, &outsider);
|
|
||||||
|
|
||||||
for membership in [&inside_membership, &other_membership] {
|
|
||||||
assert_eq!(
|
|
||||||
workspace.invite(outsider.clone(), WorkspaceRole::Admin, Some(membership)),
|
|
||||||
Err(WorkspaceAccessError::RoleNotAllowed)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
let invitation = workspace
|
|
||||||
.invite(
|
|
||||||
insider.clone(),
|
|
||||||
WorkspaceRole::Admin,
|
|
||||||
Some(&inside_membership),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(
|
|
||||||
workspace.accept_invitation(&insider, &invitation, None),
|
|
||||||
Err(WorkspaceAccessError::RoleNotAllowed)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
independent.accept_invitation(&insider, &invitation, Some(&inside_membership)),
|
|
||||||
Err(WorkspaceAccessError::InvitationMismatch)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
workspace.accept_invitation(&outsider, &invitation, None),
|
|
||||||
Err(WorkspaceAccessError::InvitationMismatch)
|
|
||||||
);
|
|
||||||
assert_eq!(independent.organization_id(), None);
|
|
||||||
assert!(
|
|
||||||
independent
|
|
||||||
.invite(outsider.clone(), WorkspaceRole::Editor, None)
|
|
||||||
.is_ok()
|
|
||||||
);
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
other.set_workspace_access(&mut workspace, WorkspaceAccess::ExternalEditors),
|
|
||||||
Err(WorkspaceAccessError::OrganizationMismatch)
|
|
||||||
);
|
|
||||||
owner
|
|
||||||
.set_workspace_access(&mut workspace, WorkspaceAccess::ExternalEditors)
|
|
||||||
.unwrap();
|
|
||||||
let external = workspace
|
|
||||||
.invite(outsider.clone(), WorkspaceRole::Editor, None)
|
|
||||||
.unwrap();
|
|
||||||
owner
|
|
||||||
.set_workspace_access(&mut workspace, WorkspaceAccess::ExternalViewers)
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(
|
|
||||||
workspace.accept_invitation(&outsider, &external, None),
|
|
||||||
Err(WorkspaceAccessError::RoleNotAllowed)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn workspace_contains_nested_documents_of_different_kinds() {
|
|
||||||
let workspace = Workspace::independent(workspace_id("workspace"), "Workspace");
|
|
||||||
let key = |id: &str| DocumentKey {
|
|
||||||
workspace: workspace.id.clone(),
|
|
||||||
document: DocumentId::new(id).unwrap(),
|
|
||||||
};
|
|
||||||
let page = Document::new(
|
|
||||||
key("page"),
|
|
||||||
DocumentContent::Page {
|
|
||||||
title: "Page".into(),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
let mut child_page = Document::new(
|
|
||||||
key("subpage"),
|
|
||||||
DocumentContent::Page {
|
|
||||||
title: "Nested".into(),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
child_page.parent_id = Some(page.key.document.clone());
|
|
||||||
let mut code = Document::new(
|
|
||||||
key("code"),
|
|
||||||
DocumentContent::Code {
|
|
||||||
language: "rust".into(),
|
|
||||||
source: "fn main() {}".into(),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
code.parent_id = Some(child_page.key.document.clone());
|
|
||||||
|
|
||||||
let tree = workspace
|
|
||||||
.document_tree(page.clone(), [code, child_page])
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(
|
|
||||||
tree.nodes()
|
|
||||||
.map(|(depth, document)| (depth, document.key.document.as_str()))
|
|
||||||
.collect::<Vec<_>>(),
|
|
||||||
[(0, "page"), (1, "subpage"), (2, "code")]
|
|
||||||
);
|
|
||||||
|
|
||||||
let other = Workspace::independent(workspace_id("other"), "Other");
|
|
||||||
assert!(matches!(
|
|
||||||
other.document_tree(page, []),
|
|
||||||
Err(TreeError::WorkspaceMismatch)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/node_modules/
|
|
||||||
/.next/
|
|
||||||
/out/
|
|
||||||
/coverage/
|
|
||||||
*.tsbuildinfo
|
|
||||||
next-env.d.ts
|
|
||||||
.env*
|
|
||||||
.DS_Store
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import type { Metadata } from "next";
|
|
||||||
import type { ReactNode } from "react";
|
|
||||||
|
|
||||||
export const metadata: Metadata = { title: "Dashboard" };
|
|
||||||
|
|
||||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
||||||
return <html lang="zh-CN"><body>{children}</body></html>;
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export default function Page() {
|
|
||||||
return <main><h1>Dashboard</h1></main>;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import type { NextConfig } from "next";
|
|
||||||
|
|
||||||
const config: NextConfig = {
|
|
||||||
agentRules: false,
|
|
||||||
devIndicators: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@bedrock/dashboard",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"dev": "next dev --hostname 127.0.0.1 --port 3001",
|
|
||||||
"build": "next build",
|
|
||||||
"start": "next start --hostname 127.0.0.1 --port 3001"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"next": "16.4.6",
|
|
||||||
"react": "19.3.1",
|
|
||||||
"react-dom": "19.3.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "22.20.7",
|
|
||||||
"@types/react": "19.3.0",
|
|
||||||
"@types/react-dom": "19.3.0",
|
|
||||||
"typescript": "5.9.3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "ES2017",
|
|
||||||
"lib": [
|
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"esnext"
|
|
||||||
],
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"strict": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"isolatedModules": true,
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "next"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"paths": {
|
|
||||||
"@/*": [
|
|
||||||
"./*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"allowJs": true,
|
|
||||||
"incremental": true,
|
|
||||||
"resolveJsonModule": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"next-env.d.ts",
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
".next/types/**/*.ts",
|
|
||||||
".next/dev/types/**/*.ts"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
# Bedrock Kubernetes 部署路线
|
|
||||||
|
|
||||||
建集群、构建 Bedrock 镜像、编写部署清单可以并行。集群内 PostgreSQL 的清单在目标集群和命名空间就绪后提交。数据库可连接、Bedrock 镜像和运行配置就绪后,再初始化 Bedrock 存储。
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
flowchart TD
|
|
||||||
start["准备首次部署"]
|
|
||||||
|
|
||||||
subgraph infra ["准备 Kubernetes 集群"]
|
|
||||||
mode{"如何建集群"}
|
|
||||||
servers["自建:开云服务器,安装容器运行时和 Kubernetes 组件"]
|
|
||||||
controlPlane["kubeadm init 初始化控制平面"]
|
|
||||||
workers["kubeadm join 加入工作节点,安装 Pod 网络插件"]
|
|
||||||
managed["托管:创建 Kubernetes 集群和节点池"]
|
|
||||||
nodesReady["取得部署用 kubeconfig,确认节点 Ready"]
|
|
||||||
mode -->|"自建"| servers --> controlPlane --> workers --> nodesReady
|
|
||||||
mode -->|"托管"| managed --> nodesReady
|
|
||||||
end
|
|
||||||
|
|
||||||
subgraph image ["构建并发布镜像"]
|
|
||||||
compile["构建 runner 检出代码,编译 Rust 发布版"]
|
|
||||||
package["把 Bedrock 二进制打包进运行时镜像"]
|
|
||||||
push["用 Git SHA 标记镜像并推送到镜像仓库"]
|
|
||||||
compile --> package --> push
|
|
||||||
end
|
|
||||||
|
|
||||||
subgraph config ["准备部署清单和运行配置"]
|
|
||||||
database{"PostgreSQL 在哪里运行"}
|
|
||||||
inCluster["集群内:编写 PostgreSQL 部署清单,声明工作负载、持久卷和 Service"]
|
|
||||||
external["集群外:取得数据库端点并配置网络访问"]
|
|
||||||
app["编写 Bedrock Deployment、Service 和运行配置"]
|
|
||||||
secrets["准备数据库 Secret,私有镜像仓库按需配置拉取权限"]
|
|
||||||
database -->|"集群内"| inCluster --> app
|
|
||||||
database -->|"集群外"| external --> app
|
|
||||||
app --> secrets
|
|
||||||
end
|
|
||||||
|
|
||||||
start --> mode
|
|
||||||
start --> compile
|
|
||||||
start --> database
|
|
||||||
nodesReady --> target["确认目标集群和命名空间"]
|
|
||||||
target -->|"集群内 PostgreSQL"| applyDatabase["kubectl apply 提交 PostgreSQL 清单"]
|
|
||||||
inCluster -->|"清单已写好"| applyDatabase
|
|
||||||
applyDatabase --> dbReady["从目标集群确认 PostgreSQL 可连接"]
|
|
||||||
target -->|"集群外 PostgreSQL"| dbReady
|
|
||||||
external -->|"端点已配置"| dbReady
|
|
||||||
push --> appReady["确认 Bedrock 镜像版本和运行配置"]
|
|
||||||
secrets --> appReady
|
|
||||||
dbReady --> init["首次部署时运行 Bedrock 存储初始化"]
|
|
||||||
appReady --> init
|
|
||||||
init --> apply["kubectl apply 将 Bedrock 清单提交给 API Server"]
|
|
||||||
apply --> schedule["集群调度 Pod,工作节点拉取镜像并启动 Bedrock"]
|
|
||||||
schedule --> verify["检查 rollout、Pod 就绪状态和接口连通性"]
|
|
||||||
```
|
|
||||||
|
|
||||||
- **现有构建入口**。[Gitea 发布构建脚本](../../deploy/gitea/build-release.sh) 在构建容器里编译 Rust,并产出 `target/bedrock-release/bedrock`。上图的镜像打包、镜像推送和 Kubernetes 发布是迁移时要接上的步骤。
|
|
||||||
- **数据库清单**。编写 YAML 可以与建集群并行。提交清单前先拿到 kubeconfig,确认目标集群、命名空间和节点均已就绪。
|
|
||||||
- **首次初始化**。可以用同一份 Bedrock 镜像运行一次性 Kubernetes Job,等它成功完成再启动应用。集群内的数据库通过 Service 地址连接,集群外的数据库通过其端点连接。
|
|
||||||
- **日常发布**。沿用已有集群,在 runner 编译并推送新镜像,更新 Deployment 的镜像引用,提交清单并检查滚动发布结果。
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/node_modules/
|
|
||||||
/.next/
|
|
||||||
/out/
|
|
||||||
/coverage/
|
|
||||||
*.tsbuildinfo
|
|
||||||
next-env.d.ts
|
|
||||||
.env*
|
|
||||||
.DS_Store
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
/* latin-ext */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Instrument Sans';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
font-stretch: 100%;
|
|
||||||
font-display: swap;
|
|
||||||
src: url(/stitch/instrument-sans-1.woff2) format('woff2');
|
|
||||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
||||||
}
|
|
||||||
/* latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Instrument Sans';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
font-stretch: 100%;
|
|
||||||
font-display: swap;
|
|
||||||
src: url(/stitch/instrument-sans-2.woff2) format('woff2');
|
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
||||||
}
|
|
||||||
/* latin-ext */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Instrument Sans';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 500;
|
|
||||||
font-stretch: 100%;
|
|
||||||
font-display: swap;
|
|
||||||
src: url(/stitch/instrument-sans-1.woff2) format('woff2');
|
|
||||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
||||||
}
|
|
||||||
/* latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Instrument Sans';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 500;
|
|
||||||
font-stretch: 100%;
|
|
||||||
font-display: swap;
|
|
||||||
src: url(/stitch/instrument-sans-2.woff2) format('woff2');
|
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
||||||
}
|
|
||||||
/* latin-ext */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Instrument Sans';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 600;
|
|
||||||
font-stretch: 100%;
|
|
||||||
font-display: swap;
|
|
||||||
src: url(/stitch/instrument-sans-1.woff2) format('woff2');
|
|
||||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
||||||
}
|
|
||||||
/* latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Instrument Sans';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 600;
|
|
||||||
font-stretch: 100%;
|
|
||||||
font-display: swap;
|
|
||||||
src: url(/stitch/instrument-sans-2.woff2) format('woff2');
|
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
||||||
}
|
|
||||||
/* latin-ext */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Instrument Sans';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 700;
|
|
||||||
font-stretch: 100%;
|
|
||||||
font-display: swap;
|
|
||||||
src: url(/stitch/instrument-sans-1.woff2) format('woff2');
|
|
||||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
||||||
}
|
|
||||||
/* latin */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Instrument Sans';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 700;
|
|
||||||
font-stretch: 100%;
|
|
||||||
font-display: swap;
|
|
||||||
src: url(/stitch/instrument-sans-2.woff2) format('woff2');
|
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* fallback */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Material Symbols Outlined';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 100 700;
|
|
||||||
font-display: block;
|
|
||||||
src: url(/stitch/material-symbols-1.woff2) format('woff2');
|
|
||||||
}
|
|
||||||
|
|
||||||
.material-symbols-outlined {
|
|
||||||
font-family: 'Material Symbols Outlined';
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 1;
|
|
||||||
letter-spacing: normal;
|
|
||||||
text-transform: none;
|
|
||||||
display: inline-block;
|
|
||||||
white-space: nowrap;
|
|
||||||
word-wrap: normal;
|
|
||||||
direction: ltr;
|
|
||||||
-webkit-font-feature-settings: 'liga';
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
}
|
|
||||||
|
|
||||||
@tailwind base;
|
|
||||||
@tailwind components;
|
|
||||||
@tailwind utilities;
|
|
||||||
|
|
||||||
.material-symbols-outlined, .material-symbols-rounded, .material-symbols-sharp, .material-icons {
|
|
||||||
display: inline-block;
|
|
||||||
width: 1em;
|
|
||||||
height: 1em;
|
|
||||||
line-height: 1 !important;
|
|
||||||
box-sizing: content-box;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
direction: ltr;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.no-scrollbar::-webkit-scrollbar { display: none; }
|
|
||||||
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import type { Metadata } from "next";
|
|
||||||
import type { ReactNode } from "react";
|
|
||||||
import "./globals.css";
|
|
||||||
|
|
||||||
export const metadata: Metadata = { title: "X × 小红书 动态交互版" };
|
|
||||||
|
|
||||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
||||||
return (
|
|
||||||
<html lang="zh-CN" className="h-full">
|
|
||||||
<body className="min-h-full flex flex-col bg-light-surface text-light-on-surface font-body antialiased">{children}</body>
|
|
||||||
</html>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import { HomeDesign } from "@/components/home-design";
|
|
||||||
import { HomeInteractions } from "@/components/home-interactions";
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
return <><HomeDesign /><HomeInteractions /></>;
|
|
||||||
}
|
|
||||||
@@ -1,704 +0,0 @@
|
|||||||
export function HomeDesign() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div className="flex-1 min-h-screen w-full flex bg-light-surface">
|
|
||||||
|
|
||||||
{/* Left Navigation Rail (X Design: Full on xl, Icon-Only on sm..lg, Hidden on mobile) */}
|
|
||||||
<aside className="hidden sm:flex sm:flex-col sm:justify-between sm:items-center xl:items-stretch w-20 xl:w-60 shrink-0 px-gutter-sm xl:px-gutter-md py-gutter-md self-stretch bg-light-surface">
|
|
||||||
<div className="sticky top-gutter-md flex flex-col items-center xl:items-stretch gap-gutter-xs">
|
|
||||||
<button type="button" data-nav="home" aria-label="X Home" className="nav-switch inline-flex items-center justify-center w-12 h-12 rounded-full hover:bg-light-surface-container transition-colors duration-state-change">
|
|
||||||
<svg viewBox="0 0 24 24" className="w-7 h-7 fill-current text-light-on-surface" aria-hidden="true">
|
|
||||||
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<nav aria-label="Primary navigation" className="flex flex-col items-center xl:items-stretch gap-gutter-xs">
|
|
||||||
<button type="button" data-nav="home" aria-current="page" className="nav-switch nav-item inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-title text-title-lg transition-colors duration-state-change text-left">
|
|
||||||
<span className="nav-icon material-symbols-outlined text-headline-lg" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">home</span>
|
|
||||||
<span className="hidden xl:inline">Home</span>
|
|
||||||
</button>
|
|
||||||
<a href="#explore" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">search</span>
|
|
||||||
<span className="hidden xl:inline">Explore</span>
|
|
||||||
</a>
|
|
||||||
<a href="#notifications" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
|
||||||
<span className="relative inline-flex">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">notifications</span>
|
|
||||||
<span className="absolute -top-1 -right-1 inline-flex items-center justify-center w-4 h-4 rounded-full bg-light-tertiary text-light-on-tertiary font-label text-label-sm">2</span>
|
|
||||||
</span>
|
|
||||||
<span className="hidden xl:inline">Notifications</span>
|
|
||||||
</a>
|
|
||||||
<a href="#follow" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">person_add</span>
|
|
||||||
<span className="hidden xl:inline">Follow</span>
|
|
||||||
</a>
|
|
||||||
<a href="#chat" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">mail</span>
|
|
||||||
<span className="hidden xl:inline">Chat</span>
|
|
||||||
</a>
|
|
||||||
<a href="#grok" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">blur_on</span>
|
|
||||||
<span className="hidden xl:inline">Grok</span>
|
|
||||||
</a>
|
|
||||||
<a href="#bookmarks" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">bookmark_border</span>
|
|
||||||
<span className="hidden xl:inline">Bookmarks</span>
|
|
||||||
</a>
|
|
||||||
<a href="#creator-studio" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">science</span>
|
|
||||||
<span className="hidden xl:inline">Creator Studio</span>
|
|
||||||
</a>
|
|
||||||
<a href="#premium" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">verified</span>
|
|
||||||
<span className="hidden xl:inline">Premium</span>
|
|
||||||
</a>
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch nav-item inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change text-left">
|
|
||||||
<span className="nav-icon material-symbols-outlined text-headline-lg" aria-hidden="true">person_outline</span>
|
|
||||||
<span className="hidden xl:inline">Profile</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change text-left">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">pending</span>
|
|
||||||
<span className="hidden xl:inline">More</span>
|
|
||||||
</button>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div className="pt-gutter-md xl:pr-gutter-md">
|
|
||||||
<button type="button" aria-label="Post" className="w-11 h-11 xl:w-full xl:h-auto xl:py-3 xl:px-gutter-xl rounded-full bg-light-primary text-light-on-primary font-label text-label-lg hover:opacity-90 transition-opacity duration-state-change inline-flex items-center justify-center">
|
|
||||||
<span className="material-symbols-outlined text-headline-md xl:hidden" aria-hidden="true">edit</span>
|
|
||||||
<span className="hidden xl:inline">Post</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center justify-center xl:justify-between gap-gutter-sm p-2 xl:p-gutter-md rounded-full hover:bg-light-surface-container bg-light-surface transition-colors duration-state-change text-left">
|
|
||||||
<div className="flex items-center gap-gutter-md min-w-0">
|
|
||||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-10 h-10 rounded-full object-cover shrink-0" />
|
|
||||||
<div className="hidden xl:flex flex-col min-w-0">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface truncate">有点AI思</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">@you_dian_ai</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<span className="hidden xl:inline material-symbols-outlined text-title-lg text-light-on-surface-variant shrink-0" aria-hidden="true">more_horiz</span>
|
|
||||||
</button>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
{/* Center Column: Dynamic Switchable Views (Home Feed <-> User Profile) */}
|
|
||||||
<main className="flex-1 min-w-0 border-x border-light-outline-variant min-h-screen flex flex-col">
|
|
||||||
|
|
||||||
{/* VIEW 1: HOME FEED */}
|
|
||||||
<div id="view-home" className="flex flex-col">
|
|
||||||
{/* Sticky Top Feed Tabs & Channel Strip + Column Switcher */}
|
|
||||||
<header className="sticky top-0 z-20 bg-light-surface/95 border-b border-light-outline-variant">
|
|
||||||
<div role="tablist" aria-label="Timeline feed" className="grid grid-cols-2 border-b border-light-outline-variant">
|
|
||||||
<button role="tab" data-feed="for-you" aria-selected="true" className="feed-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface hover:bg-light-surface-container-low transition-colors duration-state-change">
|
|
||||||
<span>For you</span>
|
|
||||||
<span className="tab-indicator absolute bottom-0 w-16 h-1 rounded-full bg-x-blue"></span>
|
|
||||||
</button>
|
|
||||||
<button role="tab" data-feed="following" aria-selected="false" className="feed-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface-variant hover:bg-light-surface-container-low transition-colors duration-state-change">
|
|
||||||
<span>Following</span>
|
|
||||||
<span className="tab-indicator hidden absolute bottom-0 w-20 h-1 rounded-full bg-x-blue"></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Xiaohongshu Channel Filter Pills */}
|
|
||||||
<div role="tablist" aria-label="内容频道" className="flex items-center gap-gutter-sm px-gutter-lg py-gutter-sm overflow-x-auto no-scrollbar">
|
|
||||||
<button role="tab" data-category="all" aria-selected="true" className="channel-pill px-gutter-md py-1 rounded-full bg-light-primary text-light-on-primary font-label text-label-md whitespace-nowrap">
|
|
||||||
<span>推荐</span>
|
|
||||||
</button>
|
|
||||||
<button role="tab" data-category="旅行" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
|
||||||
<span>旅行</span>
|
|
||||||
</button>
|
|
||||||
<button role="tab" data-category="游戏" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
|
||||||
<span>游戏</span>
|
|
||||||
</button>
|
|
||||||
<button role="tab" data-category="视频" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
|
||||||
<span>视频</span>
|
|
||||||
</button>
|
|
||||||
<button role="tab" data-category="职场" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
|
||||||
<span>职场</span>
|
|
||||||
</button>
|
|
||||||
<button role="tab" data-category="情感" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
|
||||||
<span>情感</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
{/* Responsive Waterfall Grid (2-col on mobile/tablet, 3-col on lg+) */}
|
|
||||||
<div id="home-note-feed" className="p-gutter-sm sm:p-gutter-md columns-2 lg:columns-3 gap-gutter-md space-y-gutter-md">
|
|
||||||
|
|
||||||
|
|
||||||
<article data-category="游戏" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/fish-game.jpg" alt="彩色手绘小鱼游戏封面" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-body text-body-md text-light-on-surface truncate">这游戏能卖80万美元</h3>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
|
||||||
<img src="/stitch/bbg-avatar.jpg" alt="BBGame" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">BBGame</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="483" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">483</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
|
|
||||||
<article data-category="视频" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/rainy-harbor.jpg" alt="雨夜海港小镇体素场景" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
<span className="absolute top-gutter-sm right-gutter-sm inline-flex items-center justify-center w-6 h-6 rounded-full bg-light-primary/70 text-light-on-primary">
|
|
||||||
<span className="material-symbols-outlined text-body-md" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">play_arrow</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-body text-body-md text-light-on-surface truncate">雨夜海港太治愈</h3>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
|
||||||
<img src="/stitch/rainy-harbor.jpg" alt="像素造梦师" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">像素造梦师</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="1284" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">1284</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
|
|
||||||
<article data-category="情感" data-following="false" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/golden-retriever.jpg" alt="家里新来的小金毛" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-body text-body-md text-light-on-surface truncate">小金毛太粘人啦</h3>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
|
||||||
<img src="/stitch/golden-retriever.jpg" alt="单棱镜" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">单棱镜</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="1520" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">1520</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
|
|
||||||
<article data-category="旅行" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/chengdu.jpg" alt="成都环形城市航拍图" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
<div className="absolute inset-0 bg-light-primary/65 flex flex-col items-center justify-center p-gutter-sm">
|
|
||||||
<span className="font-headline text-title-lg text-light-on-primary">成都</span>
|
|
||||||
<span className="font-title text-title-md text-light-on-primary">巨大的“圈”</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-body text-body-md text-light-on-surface truncate">成都到底有几个圈?</h3>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
|
||||||
<img src="/stitch/chengdu.jpg" alt="西游兔" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">西游兔</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="3936" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">3936</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
|
|
||||||
<article data-category="游戏" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/dungeon.jpg" alt="街机厅的玩家和游戏屏幕" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-body text-body-md text-light-on-surface truncate">独立游戏一周目实录</h3>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
|
||||||
<img src="/stitch/chengdu.jpg" alt="阿宅玩游戏" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">阿宅玩游戏</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="742" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">742</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
|
|
||||||
<article data-category="职场" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant p-gutter-sm flex flex-col gap-gutter-xs">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface">AI编程助手</span>
|
|
||||||
<img src="/stitch/ai-tools.jpg" alt="桌面上的笔记本电脑" className="w-full h-auto rounded-sm object-cover" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-body text-body-md text-light-on-surface truncate">AI助手实测对比</h3>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
|
||||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="612" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">612</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
|
|
||||||
<article data-category="旅行" data-following="false" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/skyline.jpg" alt="夜色雾气中的城市天际线" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-body text-body-md text-light-on-surface truncate">夜幕降临的城市天际线</h3>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
|
||||||
<img src="/stitch/rainy-harbor.jpg" alt="Wingman" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">Wingman</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="528" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">528</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
|
|
||||||
<article data-category="职场" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/workspace.jpg" alt="光线照进写字台" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-body text-body-md text-light-on-surface truncate">午后光影工作台灵感</h3>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
|
||||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="true" data-count="842" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-body-md like-icon text-light-error" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">favorite</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">842</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
|
|
||||||
<article data-category="旅行" data-following="false" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/film-walk.jpg" alt="街头漫步摄影" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-body text-body-md text-light-on-surface truncate">城市街头胶片漫步</h3>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
|
||||||
<img src="/stitch/chengdu.jpg" alt="胶片日志" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">胶片日志</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="946" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">946</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* VIEW 2: USER PROFILE */}
|
|
||||||
<div id="view-profile" className="hidden flex-col">
|
|
||||||
{/* Sticky Top Profile Bar (Back Arrow returns to Home) */}
|
|
||||||
<header className="sticky top-0 z-20 bg-light-surface/95 border-b border-light-outline-variant px-gutter-lg py-gutter-sm flex items-center justify-between gap-gutter-md">
|
|
||||||
<div className="flex items-center gap-gutter-lg min-w-0">
|
|
||||||
<button type="button" data-nav="home" aria-label="返回首页" className="nav-switch inline-flex items-center justify-center w-9 h-9 rounded-full hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change shrink-0">
|
|
||||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">arrow_back</span>
|
|
||||||
</button>
|
|
||||||
<div className="flex flex-col min-w-0">
|
|
||||||
<div className="flex items-center gap-gutter-xs">
|
|
||||||
<h1 className="font-headline text-headline-md text-light-on-surface truncate">有点AI思</h1>
|
|
||||||
<span className="material-symbols-outlined text-title-lg text-x-blue shrink-0" style={{ fontVariationSettings: "'FILL' 1" }} aria-label="已认证">verified</span>
|
|
||||||
</div>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant tabular-nums">128 篇笔记</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-gutter-xs shrink-0">
|
|
||||||
<button type="button" aria-label="搜索TA的笔记" className="inline-flex items-center justify-center w-9 h-9 rounded-full hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">search</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" aria-label="Grok 总结主页" className="inline-flex items-center justify-center w-9 h-9 rounded-full hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">blur_on</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
{/* Cover Banner & Overlapping Avatar + Actions */}
|
|
||||||
<section aria-label="个人资料头部">
|
|
||||||
<div className="h-48 w-full overflow-hidden bg-light-surface-container">
|
|
||||||
<img src="/stitch/profile-banner.jpg" alt="个人主页背景封面" className="w-full h-full object-cover" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="px-gutter-lg pb-gutter-md flex flex-col gap-gutter-md">
|
|
||||||
<div className="flex items-end justify-between gap-gutter-md">
|
|
||||||
<div className="-mt-14 w-28 h-28 rounded-full border-4 border-light-surface overflow-hidden bg-light-surface shrink-0">
|
|
||||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思头像" className="w-full h-full object-cover" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative flex items-center gap-gutter-sm pt-gutter-sm">
|
|
||||||
<button id="profile-more-btn" type="button" aria-label="更多选项" aria-expanded="false" aria-haspopup="menu" className="inline-flex items-center justify-center w-9 h-9 rounded-full border border-light-outline bg-light-surface hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-title-lg" aria-hidden="true">more_horiz</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div id="profile-more-menu" role="menu" className="hidden absolute right-0 top-12 z-30 w-60 rounded-lg bg-light-surface border border-light-outline-variant shadow-lg py-gutter-xs">
|
|
||||||
<button id="open-about-btn" type="button" role="menuitem" className="w-full px-gutter-lg py-2.5 flex items-center gap-gutter-md text-left hover:bg-light-surface-container-low text-light-on-surface font-title text-title-md">
|
|
||||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface" aria-hidden="true">info</span>
|
|
||||||
<span>About this account</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" role="menuitem" className="w-full px-gutter-lg py-2.5 flex items-center gap-gutter-md text-left hover:bg-light-surface-container-low text-light-on-surface font-title text-title-md">
|
|
||||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface" aria-hidden="true">chat_bubble_outline</span>
|
|
||||||
<span>View Topics</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" role="menuitem" className="w-full px-gutter-lg py-2.5 flex items-center gap-gutter-md text-left hover:bg-light-surface-container-low text-light-on-surface font-title text-title-md">
|
|
||||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface" aria-hidden="true">link</span>
|
|
||||||
<span>Copy link to profile</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button type="button" aria-label="发送私信" className="inline-flex items-center justify-center w-9 h-9 rounded-full border border-light-outline bg-light-surface hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-title-lg" aria-hidden="true">mail</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" aria-label="开启更新提醒" className="inline-flex items-center justify-center w-9 h-9 rounded-full border border-light-outline bg-light-surface hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
|
||||||
<span className="material-symbols-outlined text-title-lg" aria-hidden="true">notifications_none</span>
|
|
||||||
</button>
|
|
||||||
<button id="profile-follow-btn" type="button" data-following="false" className="px-gutter-lg py-2 rounded-full bg-light-primary text-light-on-primary font-label text-label-md hover:opacity-90 transition-opacity duration-state-change whitespace-nowrap">
|
|
||||||
<span>Follow</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex flex-col gap-gutter-sm">
|
|
||||||
<div className="flex flex-col gap-gutter-xs">
|
|
||||||
<div className="flex items-center gap-gutter-xs">
|
|
||||||
<h2 className="font-headline text-headline-lg text-light-on-surface">有点AI思</h2>
|
|
||||||
<span className="material-symbols-outlined text-title-lg text-x-blue" style={{ fontVariationSettings: "'FILL' 1" }} aria-label="已认证">verified</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-wrap items-center gap-gutter-sm font-body text-body-sm text-light-on-surface-variant">
|
|
||||||
<span>@you_dian_ai</span>
|
|
||||||
<span aria-hidden="true">·</span>
|
|
||||||
<span className="tabular-nums">小红书号:18665824520</span>
|
|
||||||
<span aria-hidden="true">·</span>
|
|
||||||
<span>IP属地:四川</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className="font-body text-body-md text-light-on-surface max-w-prose text-pretty">
|
|
||||||
Software is eating the world, AI is eating software. 分享 AI 产品拆解、独立开发实验与数字生活灵感。
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div className="flex flex-wrap items-center gap-gutter-lg font-body text-body-sm text-light-on-surface-variant">
|
|
||||||
<span className="inline-flex items-center gap-gutter-xs">
|
|
||||||
<span className="material-symbols-outlined text-title-md" aria-hidden="true">location_on</span>
|
|
||||||
<span>成都 · 四川</span>
|
|
||||||
</span>
|
|
||||||
<button id="joined-date-btn" type="button" className="inline-flex items-center gap-gutter-xs hover:underline text-light-on-surface-variant">
|
|
||||||
<span className="material-symbols-outlined text-title-md" aria-hidden="true">calendar_month</span>
|
|
||||||
<span>Joined April 2022</span>
|
|
||||||
<span className="material-symbols-outlined text-title-md" aria-hidden="true">chevron_right</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex flex-wrap items-center gap-gutter-lg pt-gutter-xs">
|
|
||||||
<span className="inline-flex items-baseline gap-gutter-xs">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface tabular-nums">10</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant">关注</span>
|
|
||||||
</span>
|
|
||||||
<span className="inline-flex items-baseline gap-gutter-xs">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface tabular-nums">87</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant">粉丝</span>
|
|
||||||
</span>
|
|
||||||
<span className="inline-flex items-baseline gap-gutter-xs">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface tabular-nums">2,987</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant">获赞与收藏</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{/* Profile Content Tabs */}
|
|
||||||
<div role="tablist" aria-label="个人主页内容分类" className="grid grid-cols-4 border-b border-light-outline-variant bg-light-surface sticky top-14 z-10">
|
|
||||||
<button role="tab" data-tab="notes" aria-selected="true" className="profile-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface hover:bg-light-surface-container-low transition-colors duration-state-change">
|
|
||||||
<span>笔记</span>
|
|
||||||
<span className="tab-indicator absolute bottom-0 w-12 h-1 rounded-full bg-x-blue"></span>
|
|
||||||
</button>
|
|
||||||
<button role="tab" data-tab="saved" aria-selected="false" className="profile-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface-variant hover:bg-light-surface-container-low transition-colors duration-state-change">
|
|
||||||
<span>收藏</span>
|
|
||||||
<span className="tab-indicator hidden absolute bottom-0 w-12 h-1 rounded-full bg-x-blue"></span>
|
|
||||||
</button>
|
|
||||||
<button role="tab" data-tab="likes" aria-selected="false" className="profile-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface-variant hover:bg-light-surface-container-low transition-colors duration-state-change">
|
|
||||||
<span>点赞</span>
|
|
||||||
<span className="tab-indicator hidden absolute bottom-0 w-12 h-1 rounded-full bg-x-blue"></span>
|
|
||||||
</button>
|
|
||||||
<button role="tab" data-tab="history" aria-selected="false" className="profile-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface-variant hover:bg-light-surface-container-low transition-colors duration-state-change">
|
|
||||||
<span>浏览记录</span>
|
|
||||||
<span className="tab-indicator hidden absolute bottom-0 w-16 h-1 rounded-full bg-x-blue"></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Profile Panel: 笔记 */}
|
|
||||||
<section id="panel-notes" role="tabpanel" className="p-gutter-lg columns-2 lg:columns-3 gap-gutter-md space-y-gutter-md">
|
|
||||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/workspace.jpg" alt="彩色玻璃光影桌面" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
<span className="absolute top-gutter-sm left-gutter-sm px-gutter-sm py-0.5 rounded-full bg-light-primary/75 text-light-on-primary font-label text-label-sm">置顶</span>
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-title text-title-md text-light-on-surface truncate">午后光影里的工作台灵感</h3>
|
|
||||||
<div className="flex items-center justify-between pt-gutter-xs">
|
|
||||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
|
||||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
|
||||||
</div>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-error shrink-0" data-liked="true" data-count="842" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-title-md like-icon" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">favorite</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">842</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant p-gutter-md flex flex-col gap-gutter-sm">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface">AI 编程助手实测对比</span>
|
|
||||||
<img src="/stitch/ai-tools.jpg" alt="AI 编程助手实测插画" className="w-full h-auto rounded-md object-cover" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-title text-title-md text-light-on-surface truncate">2026 个人开发者工作流</h3>
|
|
||||||
<div className="flex items-center justify-between pt-gutter-xs">
|
|
||||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
|
||||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
|
||||||
</div>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="615" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-title-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">615</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/rainy-harbor.jpg" alt="雨夜海港小镇体素场景" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
<span className="absolute top-gutter-sm right-gutter-sm inline-flex items-center justify-center w-6 h-6 rounded-full bg-light-primary/70 text-light-on-primary">
|
|
||||||
<span className="material-symbols-outlined text-body-md" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">play_arrow</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-title text-title-md text-light-on-surface truncate">用体素引擎做海港微缩模型</h3>
|
|
||||||
<div className="flex items-center justify-between pt-gutter-xs">
|
|
||||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
|
||||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
|
||||||
</div>
|
|
||||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="429" aria-label="点赞">
|
|
||||||
<span className="material-symbols-outlined text-title-md like-icon" aria-hidden="true">favorite_border</span>
|
|
||||||
<span className="font-body text-body-sm tabular-nums like-count">429</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{/* Profile Panel: 收藏 */}
|
|
||||||
<section id="panel-saved" role="tabpanel" className="hidden p-gutter-lg columns-2 lg:columns-3 gap-gutter-md space-y-gutter-md">
|
|
||||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/stairs.jpg" alt="建筑楼梯光影摄影" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-title text-title-md text-light-on-surface truncate">极简楼梯光影构图参考</h3>
|
|
||||||
<div className="flex items-center justify-between pt-gutter-xs">
|
|
||||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
|
||||||
<img src="/stitch/rainy-harbor.jpg" alt="建筑笔记" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">建筑笔记</span>
|
|
||||||
</div>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant tabular-nums">1.2K</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{/* Profile Panel: 点赞 */}
|
|
||||||
<section id="panel-likes" role="tabpanel" className="hidden p-gutter-lg columns-2 lg:columns-3 gap-gutter-md space-y-gutter-md">
|
|
||||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
|
||||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant">
|
|
||||||
<img src="/stitch/golden-retriever.jpg" alt="小金毛日常" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
|
||||||
</div>
|
|
||||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
|
||||||
<h3 className="font-title text-title-md text-light-on-surface truncate">家里新来的小金毛太粘人</h3>
|
|
||||||
<div className="flex items-center justify-between pt-gutter-xs">
|
|
||||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
|
||||||
<img src="/stitch/golden-retriever.jpg" alt="单棱镜" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">单棱镜</span>
|
|
||||||
</div>
|
|
||||||
<span className="font-body text-body-sm text-light-error tabular-nums">1,520</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{/* Profile Panel: 浏览记录 */}
|
|
||||||
<section id="panel-history" role="tabpanel" className="hidden p-gutter-lg flex flex-col items-center justify-center gap-gutter-sm py-section text-center">
|
|
||||||
<span className="material-symbols-outlined text-headline-lg text-light-on-surface-variant" aria-hidden="true">history</span>
|
|
||||||
<p className="font-title text-title-md text-light-on-surface">仅自己可见</p>
|
|
||||||
<p className="font-body text-body-sm text-light-on-surface-variant max-w-prose">近期浏览的笔记记录会保存在这里,方便随时回看。</p>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</main>
|
|
||||||
|
|
||||||
{/* Right Discovery Sidebar (X Design: Visible md+, Hidden below 768px) */}
|
|
||||||
<aside className="hidden md:flex md:flex-col md:justify-between gap-gutter-lg w-72 xl:w-80 shrink-0 px-gutter-lg xl:px-gutter-xl py-gutter-md self-stretch">
|
|
||||||
<div className="flex flex-col gap-gutter-lg">
|
|
||||||
<div className="sticky top-0 pt-gutter-xs pb-gutter-xs bg-light-surface z-10">
|
|
||||||
<form role="search" className="flex items-center gap-gutter-sm px-gutter-lg py-2.5 rounded-full bg-light-surface border border-light-outline focus-within:border-light-tertiary">
|
|
||||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface-variant" aria-hidden="true">search</span>
|
|
||||||
<input type="search" aria-label="Search X" placeholder="Search" className="w-full bg-transparent border-none p-0 font-body text-body-md text-light-on-surface placeholder:text-light-on-surface-variant focus:ring-0" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<section aria-label="Subscribe to Premium" className="rounded-lg border border-light-outline-variant p-gutter-lg flex flex-col gap-gutter-sm bg-light-surface">
|
|
||||||
<div className="flex items-center justify-between gap-gutter-xs">
|
|
||||||
<h2 className="font-headline text-title-lg text-light-on-surface whitespace-nowrap">Subscribe to Premium</h2>
|
|
||||||
<span className="px-gutter-sm py-0.5 rounded-full bg-light-primary-container text-light-on-primary-container font-label text-label-sm whitespace-nowrap shrink-0">50% off</span>
|
|
||||||
</div>
|
|
||||||
<p className="font-body text-body-md text-light-on-surface">Get rid of ads, see your analytics, boost your replies and unlock 20+ features.</p>
|
|
||||||
<div className="pt-gutter-xs">
|
|
||||||
<button type="button" className="px-gutter-lg py-2 rounded-full bg-light-tertiary text-light-on-tertiary font-label text-label-lg hover:opacity-90">
|
|
||||||
<span>Subscribe</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section aria-label="You might like" className="rounded-lg border border-light-outline-variant p-gutter-lg flex flex-col gap-gutter-md bg-light-surface">
|
|
||||||
<h2 className="font-headline text-headline-md text-light-on-surface">You might like</h2>
|
|
||||||
<div className="flex items-center justify-between gap-gutter-sm">
|
|
||||||
<div className="flex items-center gap-gutter-md min-w-0">
|
|
||||||
<img src="/stitch/bbg-avatar.jpg" alt="Low Quality Memes" className="w-10 h-10 rounded-full object-cover shrink-0" />
|
|
||||||
<div className="flex flex-col min-w-0">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface truncate">Low Quality Memes</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">@ipostlqmemes</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button type="button" className="follow-btn px-gutter-lg py-1.5 rounded-full bg-light-primary text-light-on-primary font-label text-label-md shrink-0" data-following="false">
|
|
||||||
<span>Follow</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center justify-between gap-gutter-sm">
|
|
||||||
<div className="flex items-center gap-gutter-md min-w-0">
|
|
||||||
<img src="/stitch/ai-tools.jpg" alt="极客小分队" className="w-10 h-10 rounded-full object-cover shrink-0" />
|
|
||||||
<div className="flex flex-col min-w-0">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface truncate">极客小分队</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">@geek_squad_cn</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button type="button" className="follow-btn px-gutter-lg py-1.5 rounded-full bg-light-primary text-light-on-primary font-label text-label-md shrink-0" data-following="false">
|
|
||||||
<span>Follow</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<a href="#show-more-people" className="font-body text-body-md text-light-tertiary hover:underline">Show more</a>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section aria-label="What's happening" className="rounded-lg border border-light-outline-variant p-gutter-lg flex flex-col gap-gutter-md bg-light-surface">
|
|
||||||
<h2 className="font-headline text-headline-md text-light-on-surface">What's happening</h2>
|
|
||||||
<div className="flex flex-col gap-gutter-md">
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant">Technology · Trending</span>
|
|
||||||
<span className="font-title text-title-md text-light-on-surface">#AICoding2026</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant">Design · Trending</span>
|
|
||||||
<span className="font-title text-title-md text-light-on-surface">小红书瀑布流</span>
|
|
||||||
</div>
|
|
||||||
<a href="#show-more" className="font-body text-body-md text-light-tertiary hover:underline">Show more</a>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer className="pt-gutter-md pb-gutter-sm flex flex-wrap gap-x-gutter-md gap-y-gutter-xs font-body text-body-sm text-light-on-surface-variant">
|
|
||||||
<a href="#terms" className="hover:underline">Terms of Service</a>
|
|
||||||
<a href="#privacy" className="hover:underline">Privacy Policy</a>
|
|
||||||
<a href="#cookies" className="hover:underline">Cookie Policy</a>
|
|
||||||
<span>© 2026 X Corp.</span>
|
|
||||||
</footer>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* About This Account Modal */}
|
|
||||||
<div id="about-modal" role="dialog" aria-modal="true" aria-labelledby="about-modal-title" className="hidden fixed inset-0 z-40 bg-light-primary/50 flex items-center justify-center p-gutter-lg">
|
|
||||||
<div className="w-full max-w-md rounded-xl bg-light-surface border border-light-outline-variant shadow-xl p-gutter-xl flex flex-col gap-gutter-lg">
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<h2 id="about-modal-title" className="font-headline text-headline-md text-light-on-surface">About this account</h2>
|
|
||||||
<button id="close-about-btn" type="button" aria-label="关闭弹窗" className="inline-flex items-center justify-center w-8 h-8 rounded-full hover:bg-light-surface-container text-light-on-surface">
|
|
||||||
<span className="material-symbols-outlined text-title-lg" aria-hidden="true">close</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-gutter-md">
|
|
||||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-12 h-12 rounded-full object-cover shrink-0" />
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="font-title text-title-lg text-light-on-surface">有点AI思</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant">@you_dian_ai · 小红书号 18665824520</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-gutter-md border-t border-light-outline-variant pt-gutter-md">
|
|
||||||
<div className="flex items-center gap-gutter-md">
|
|
||||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface-variant" aria-hidden="true">calendar_month</span>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface">Date joined</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant">April 2022</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-gutter-md">
|
|
||||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface-variant" aria-hidden="true">public</span>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface">Account based in</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant">Sichuan, China (IP属地:四川)</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-gutter-md">
|
|
||||||
<span className="material-symbols-outlined text-title-lg text-x-blue" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">verified</span>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="font-title text-title-md text-light-on-surface">Verified</span>
|
|
||||||
<span className="font-body text-body-sm text-light-on-surface-variant">Subscribed since March 2024</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Floating Bottom-Right Dock */}
|
|
||||||
<div className="hidden md:flex fixed bottom-gutter-lg right-gutter-lg z-30 flex-col gap-gutter-sm">
|
|
||||||
<button type="button" aria-label="Open Grok" className="inline-flex items-center justify-center w-11 h-11 rounded-md bg-light-surface border border-light-outline shadow-sm text-light-on-surface hover:bg-light-surface-container-low">
|
|
||||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">blur_on</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" aria-label="Open Messages" className="inline-flex items-center justify-center w-11 h-11 rounded-md bg-light-surface border border-light-outline shadow-sm text-light-on-surface hover:bg-light-surface-container-low">
|
|
||||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">mail</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,159 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { useEffect } from "react";
|
|
||||||
|
|
||||||
function selectTab(button: HTMLElement, selector: string) {
|
|
||||||
document.querySelectorAll<HTMLElement>(selector).forEach((tab) => {
|
|
||||||
const active = tab === button;
|
|
||||||
tab.setAttribute("aria-selected", String(active));
|
|
||||||
tab.classList.toggle("text-light-on-surface", active);
|
|
||||||
tab.classList.toggle("text-light-on-surface-variant", !active);
|
|
||||||
tab.querySelector(".tab-indicator")?.classList.toggle("hidden", !active);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function HomeInteractions() {
|
|
||||||
useEffect(() => {
|
|
||||||
const byId = (id: string) => document.getElementById(id);
|
|
||||||
const home = byId("view-home");
|
|
||||||
const profile = byId("view-profile");
|
|
||||||
const menu = byId("profile-more-menu");
|
|
||||||
const menuButton = byId("profile-more-btn");
|
|
||||||
const dialog = byId("about-modal");
|
|
||||||
let feed = "for-you";
|
|
||||||
let category = "all";
|
|
||||||
|
|
||||||
function switchView(view: string) {
|
|
||||||
const homeActive = view === "home";
|
|
||||||
home?.classList.toggle("hidden", !homeActive);
|
|
||||||
home?.classList.toggle("flex", homeActive);
|
|
||||||
profile?.classList.toggle("hidden", homeActive);
|
|
||||||
profile?.classList.toggle("flex", !homeActive);
|
|
||||||
|
|
||||||
document.querySelectorAll<HTMLElement>(".nav-item").forEach((item) => {
|
|
||||||
const active = item.dataset.nav === view;
|
|
||||||
if (active) item.setAttribute("aria-current", "page");
|
|
||||||
else item.removeAttribute("aria-current");
|
|
||||||
item.classList.toggle("font-title", active);
|
|
||||||
item.classList.toggle("font-body", !active);
|
|
||||||
const icon = item.querySelector<HTMLElement>(".nav-icon");
|
|
||||||
if (icon) {
|
|
||||||
icon.textContent = item.dataset.nav === "home" ? "home" : active ? "person" : "person_outline";
|
|
||||||
icon.style.fontVariationSettings = active ? "'FILL' 1" : "'FILL' 0";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateCards() {
|
|
||||||
document.querySelectorAll<HTMLElement>("#home-note-feed .note-card").forEach((card) => {
|
|
||||||
const categoryMatches = category === "all" || card.dataset.category === category;
|
|
||||||
const feedMatches = feed === "for-you" || card.dataset.following === "true";
|
|
||||||
card.style.display = categoryMatches && feedMatches ? "" : "none";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeChannel(button: HTMLElement) {
|
|
||||||
category = button.dataset.category ?? "all";
|
|
||||||
document.querySelectorAll(".channel-pill").forEach((pill) => {
|
|
||||||
const active = pill === button;
|
|
||||||
pill.setAttribute("aria-selected", String(active));
|
|
||||||
pill.classList.toggle("bg-light-primary", active);
|
|
||||||
pill.classList.toggle("text-light-on-primary", active);
|
|
||||||
pill.classList.toggle("bg-light-surface-container", !active);
|
|
||||||
pill.classList.toggle("text-light-on-surface-variant", !active);
|
|
||||||
});
|
|
||||||
updateCards();
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleFollow(button: HTMLElement) {
|
|
||||||
const following = button.dataset.following !== "true";
|
|
||||||
button.dataset.following = String(following);
|
|
||||||
for (const name of ["border", "border-light-outline", "bg-light-surface", "text-light-on-surface"]) {
|
|
||||||
button.classList.toggle(name, following);
|
|
||||||
}
|
|
||||||
for (const name of ["bg-light-primary", "text-light-on-primary"]) {
|
|
||||||
button.classList.toggle(name, !following);
|
|
||||||
}
|
|
||||||
const label = button.querySelector("span");
|
|
||||||
if (label) label.textContent = following ? "Following" : "Follow";
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleLike(button: HTMLElement) {
|
|
||||||
const liked = button.dataset.liked !== "true";
|
|
||||||
const count = Math.max(0, Number(button.dataset.count ?? "0") + (liked ? 1 : -1));
|
|
||||||
button.dataset.liked = String(liked);
|
|
||||||
button.dataset.count = String(count);
|
|
||||||
button.setAttribute("aria-pressed", String(liked));
|
|
||||||
button.classList.toggle("text-light-error", liked);
|
|
||||||
button.classList.toggle("text-light-on-surface-variant", !liked);
|
|
||||||
const icon = button.querySelector<HTMLElement>(".like-icon");
|
|
||||||
if (icon) {
|
|
||||||
icon.textContent = liked ? "favorite" : "favorite_border";
|
|
||||||
icon.style.fontVariationSettings = liked ? "'FILL' 1" : "'FILL' 0";
|
|
||||||
}
|
|
||||||
const countLabel = button.querySelector(".like-count");
|
|
||||||
if (countLabel) countLabel.textContent = String(count);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMenu(open: boolean) {
|
|
||||||
menu?.classList.toggle("hidden", !open);
|
|
||||||
menuButton?.setAttribute("aria-expanded", String(open));
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleClick(event: MouseEvent) {
|
|
||||||
const target = event.target;
|
|
||||||
if (!(target instanceof Element)) return;
|
|
||||||
const button = target.closest<HTMLElement>("button");
|
|
||||||
|
|
||||||
if (button === menuButton && menu) {
|
|
||||||
setMenu(menu.classList.contains("hidden"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!menu?.contains(target)) setMenu(false);
|
|
||||||
if (target === dialog || button?.id === "close-about-btn") {
|
|
||||||
dialog?.classList.add("hidden");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!button) return;
|
|
||||||
|
|
||||||
if (button.matches(".nav-switch") && button.dataset.nav) {
|
|
||||||
switchView(button.dataset.nav);
|
|
||||||
} else if (button.matches(".feed-tab")) {
|
|
||||||
feed = button.dataset.feed ?? "for-you";
|
|
||||||
selectTab(button, ".feed-tab");
|
|
||||||
updateCards();
|
|
||||||
} else if (button.matches(".channel-pill")) {
|
|
||||||
changeChannel(button);
|
|
||||||
} else if (button.matches(".profile-tab")) {
|
|
||||||
selectTab(button, ".profile-tab");
|
|
||||||
for (const panel of ["notes", "saved", "likes", "history"]) {
|
|
||||||
byId("panel-" + panel)?.classList.toggle("hidden", panel !== button.dataset.tab);
|
|
||||||
}
|
|
||||||
} else if (button.id === "profile-follow-btn") {
|
|
||||||
toggleFollow(button);
|
|
||||||
} else if (button.matches(".like-btn")) {
|
|
||||||
toggleLike(button);
|
|
||||||
} else if (button.id === "open-about-btn" || button.id === "joined-date-btn") {
|
|
||||||
setMenu(false);
|
|
||||||
dialog?.classList.remove("hidden");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleKey(event: KeyboardEvent) {
|
|
||||||
if (event.key === "Escape") {
|
|
||||||
setMenu(false);
|
|
||||||
dialog?.classList.add("hidden");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener("click", handleClick);
|
|
||||||
document.addEventListener("keydown", handleKey);
|
|
||||||
return () => {
|
|
||||||
document.removeEventListener("click", handleClick);
|
|
||||||
document.removeEventListener("keydown", handleKey);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import type { NextConfig } from "next";
|
|
||||||
|
|
||||||
const config: NextConfig = {
|
|
||||||
agentRules: false,
|
|
||||||
devIndicators: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@bedrock/home",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"dev": "next dev --hostname 127.0.0.1 --port 3000",
|
|
||||||
"build": "next build",
|
|
||||||
"start": "next start --hostname 127.0.0.1 --port 3000"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"next": "16.4.6",
|
|
||||||
"react": "19.3.1",
|
|
||||||
"react-dom": "19.3.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "22.20.7",
|
|
||||||
"@types/react": "19.3.0",
|
|
||||||
"@types/react-dom": "19.3.0",
|
|
||||||
"typescript": "5.9.3",
|
|
||||||
"@tailwindcss/container-queries": "0.1.1",
|
|
||||||
"@tailwindcss/forms": "0.5.10",
|
|
||||||
"autoprefixer": "10.4.21",
|
|
||||||
"postcss": "8.5.34",
|
|
||||||
"tailwindcss": "3.4.17"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export default {
|
|
||||||
plugins: {
|
|
||||||
tailwindcss: {},
|
|
||||||
autoprefixer: {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
Five original design images were embedded in the shared Stitch screen.
|
|
||||||
The following Unsplash photos are sample content used under the Unsplash License
|
|
||||||
https://unsplash.com/license
|
|
||||||
|
|
||||||
golden-retriever.jpg https://unsplash.com/photos/brown-dog-m07bsa3nG_4
|
|
||||||
dungeon.jpg https://unsplash.com/photos/a-group-of-people-playing-video-games-in-a-room-TobedMw621U
|
|
||||||
ai-tools.jpg https://unsplash.com/photos/a-laptop-computer-sitting-on-top-of-a-desk-ysZnFnexwRE
|
|
||||||
skyline.jpg https://unsplash.com/photos/a-view-of-a-city-at-night-from-the-top-of-a-building-xuNtZ_hEAhY
|
|
||||||
workspace.jpg https://unsplash.com/s/photos/writers-desk
|
|
||||||
film-walk.jpg https://unsplash.com/photos/a-group-of-people-walking-across-a-cross-walk-yCFKOJ5-F6U
|
|
||||||
profile-banner.jpg https://unsplash.com/photos/a-view-of-a-city-with-mountains-in-the-background-mxWViyBwOBM
|
|
||||||
stairs.jpg https://unsplash.com/photos/shadow-and-sunlight-cast-upon-a-concrete-staircase-xDV6YuFBkAo
|
|
||||||
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 315 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 171 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 76 KiB |
@@ -1,93 +0,0 @@
|
|||||||
Copyright 2022 The Instrument Sans Project Authors (https://github.com/Instrument/instrument-sans)
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
This license is copied below, and is also available with a FAQ at:
|
|
||||||
https://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION & CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
||||||
@@ -1,202 +0,0 @@
|
|||||||
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 179 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 93 KiB |
@@ -1,93 +0,0 @@
|
|||||||
const forms = require("@tailwindcss/forms");
|
|
||||||
const containerQueries = require("@tailwindcss/container-queries");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
content: { relative: true, files: ["./app/**/*.tsx", "./components/**/*.{ts,tsx}"] },
|
|
||||||
plugins: [forms, containerQueries],
|
|
||||||
...{
|
|
||||||
darkMode: 'class',
|
|
||||||
theme: {
|
|
||||||
extend: {
|
|
||||||
colors: {
|
|
||||||
'x-blue': '#1D9BF0',
|
|
||||||
'x-blue-dark': '#0B7BC1',
|
|
||||||
'light-primary': '#0F1419',
|
|
||||||
'light-on-primary': '#FFFFFF',
|
|
||||||
'light-primary-container': '#E8F5FD',
|
|
||||||
'light-on-primary-container': '#0A74B7',
|
|
||||||
'light-secondary': '#536471',
|
|
||||||
'light-on-secondary': '#FFFFFF',
|
|
||||||
'light-secondary-container': '#EFF3F4',
|
|
||||||
'light-on-secondary-container': '#0F1419',
|
|
||||||
'light-tertiary': '#0B7BC1',
|
|
||||||
'light-on-tertiary': '#FFFFFF',
|
|
||||||
'light-error': '#F4212E',
|
|
||||||
'light-on-error': '#131313',
|
|
||||||
'light-background': '#FFFFFF',
|
|
||||||
'light-on-background': '#0F1419',
|
|
||||||
'light-surface': '#FFFFFF',
|
|
||||||
'light-surface-container-low': '#F7F9F9',
|
|
||||||
'light-surface-container': '#EFF3F4',
|
|
||||||
'light-surface-container-high': '#E7E9EA',
|
|
||||||
'light-on-surface': '#0F1419',
|
|
||||||
'light-on-surface-variant': '#536471',
|
|
||||||
'light-outline': '#CFD9DE',
|
|
||||||
'light-outline-variant': '#EFF3F4',
|
|
||||||
'dark-primary': '#EFF3F4',
|
|
||||||
'dark-on-primary': '#0F1419',
|
|
||||||
'dark-surface': '#000000',
|
|
||||||
'dark-surface-container-low': '#16181C',
|
|
||||||
'dark-surface-container': '#202327',
|
|
||||||
'dark-on-surface': '#E7E9EA',
|
|
||||||
'dark-on-surface-variant': '#71767B',
|
|
||||||
'dark-outline': '#2F3336',
|
|
||||||
'dark-outline-variant': '#2F3336',
|
|
||||||
},
|
|
||||||
borderRadius: {
|
|
||||||
'sm': '6px',
|
|
||||||
'DEFAULT': '10px',
|
|
||||||
'md': '12px',
|
|
||||||
'lg': '16px',
|
|
||||||
'xl': '20px',
|
|
||||||
'full': '9999px',
|
|
||||||
},
|
|
||||||
spacing: {
|
|
||||||
'gutter-xs': '4px',
|
|
||||||
'gutter-sm': '8px',
|
|
||||||
'gutter-md': '12px',
|
|
||||||
'gutter-lg': '16px',
|
|
||||||
'gutter-xl': '24px',
|
|
||||||
'section': '32px',
|
|
||||||
'page-margin': '16px',
|
|
||||||
},
|
|
||||||
fontFamily: {
|
|
||||||
'headline': ['"Instrument Sans"', 'sans-serif'],
|
|
||||||
'title': ['"Instrument Sans"', 'sans-serif'],
|
|
||||||
'body': ['"Instrument Sans"', 'sans-serif'],
|
|
||||||
'label': ['"Instrument Sans"', 'sans-serif'],
|
|
||||||
},
|
|
||||||
fontSize: {
|
|
||||||
'headline-lg': ['22px', { lineHeight: '28px', letterSpacing: '-0.2px', fontWeight: '700' }],
|
|
||||||
'headline-md': ['20px', { lineHeight: '24px', letterSpacing: '-0.1px', fontWeight: '700' }],
|
|
||||||
'title-lg': ['17px', { lineHeight: '22px', letterSpacing: '0px', fontWeight: '600' }],
|
|
||||||
'title-md': ['15px', { lineHeight: '20px', letterSpacing: '0px', fontWeight: '600' }],
|
|
||||||
'body-lg': ['19px', { lineHeight: '24px', letterSpacing: '0px', fontWeight: '400' }],
|
|
||||||
'body-md': ['15px', { lineHeight: '20px', letterSpacing: '0px', fontWeight: '400' }],
|
|
||||||
'body-sm': ['13px', { lineHeight: '16px', letterSpacing: '0px', fontWeight: '400' }],
|
|
||||||
'label-lg': ['15px', { lineHeight: '20px', letterSpacing: '0px', fontWeight: '700' }],
|
|
||||||
'label-md': ['13px', { lineHeight: '16px', letterSpacing: '0px', fontWeight: '500' }],
|
|
||||||
'label-sm': ['12px', { lineHeight: '14px', letterSpacing: '0px', fontWeight: '600' }],
|
|
||||||
},
|
|
||||||
transitionDuration: {
|
|
||||||
'state-change': '120ms',
|
|
||||||
},
|
|
||||||
transitionDelay: {
|
|
||||||
'state-change': '0ms',
|
|
||||||
},
|
|
||||||
transitionTimingFunction: {
|
|
||||||
'state-change': 'ease-out',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "ES2017",
|
|
||||||
"lib": [
|
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"esnext"
|
|
||||||
],
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"strict": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"isolatedModules": true,
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "next"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"paths": {
|
|
||||||
"@/*": [
|
|
||||||
"./*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"allowJs": true,
|
|
||||||
"incremental": true,
|
|
||||||
"resolveJsonModule": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"next-env.d.ts",
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
".next/types/**/*.ts",
|
|
||||||
".next/dev/types/**/*.ts"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "bedrock-web-workspaces",
|
|
||||||
"private": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=22"
|
|
||||||
},
|
|
||||||
"workspaces": [
|
|
||||||
"home",
|
|
||||||
"dashboard",
|
|
||||||
"repository"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/node_modules/
|
|
||||||
/.next/
|
|
||||||
/out/
|
|
||||||
/coverage/
|
|
||||||
*.tsbuildinfo
|
|
||||||
next-env.d.ts
|
|
||||||
.env*
|
|
||||||
.DS_Store
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import type { Metadata } from "next";
|
|
||||||
import type { ReactNode } from "react";
|
|
||||||
|
|
||||||
export const metadata: Metadata = { title: "Repository" };
|
|
||||||
|
|
||||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
||||||
return <html lang="zh-CN"><body>{children}</body></html>;
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export default function Page() {
|
|
||||||
return <main><h1>Repository</h1></main>;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import type { NextConfig } from "next";
|
|
||||||
|
|
||||||
const config: NextConfig = {
|
|
||||||
agentRules: false,
|
|
||||||
devIndicators: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@bedrock/repository",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"dev": "next dev --hostname 127.0.0.1 --port 3002",
|
|
||||||
"build": "next build",
|
|
||||||
"start": "next start --hostname 127.0.0.1 --port 3002"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"next": "16.4.6",
|
|
||||||
"react": "19.3.1",
|
|
||||||
"react-dom": "19.3.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "22.20.7",
|
|
||||||
"@types/react": "19.3.0",
|
|
||||||
"@types/react-dom": "19.3.0",
|
|
||||||
"typescript": "5.9.3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "ES2017",
|
|
||||||
"lib": [
|
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"esnext"
|
|
||||||
],
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"strict": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"isolatedModules": true,
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "next"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"paths": {
|
|
||||||
"@/*": [
|
|
||||||
"./*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"allowJs": true,
|
|
||||||
"incremental": true,
|
|
||||||
"resolveJsonModule": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"next-env.d.ts",
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
".next/types/**/*.ts",
|
|
||||||
".next/dev/types/**/*.ts"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
|
||||||