Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use stylex #52

Merged
merged 60 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d3a2e76
update pages components
linyows Feb 3, 2024
75f68ec
update gallery components
linyows Feb 3, 2024
ebc868a
add stylex token
linyows Feb 3, 2024
1c5d68f
add saveFile
linyows Feb 3, 2024
6afbe66
support pdf block and synced block
linyows Feb 3, 2024
fc3b86a
fileDir
linyows Feb 3, 2024
37bfd13
add stylex plugin to rollup
linyows Feb 3, 2024
53762ca
add .storybook
linyows Feb 3, 2024
105d6b5
fix for richtext
linyows Feb 3, 2024
78c12e2
fix import
linyows Feb 3, 2024
0e70bd1
add List.stories.tsx
linyows Feb 3, 2024
eaa12a8
remove storybook config dir
linyows Feb 3, 2024
e5db14e
change path
linyows Feb 3, 2024
13ee55a
add staticDirs to .storybook/main.ts
linyows Feb 3, 2024
2a8a978
add fixtures
linyows Feb 3, 2024
ce3c6aa
add packages
linyows Feb 3, 2024
d4996c2
fix gallery
linyows Feb 4, 2024
986b483
fix list
linyows Feb 4, 2024
53484b6
fix table
linyows Feb 4, 2024
3e76f69
fix breadcrumbs
linyows Feb 4, 2024
1b4f132
fix lint
linyows Feb 4, 2024
8e21437
fix linked component
linyows Feb 4, 2024
70933af
fix stylex output file
linyows Feb 4, 2024
e77d1b5
enable teaser in rollup config
linyows Feb 4, 2024
7195e6a
support nest numbered list items and bulleted list items
linyows Feb 5, 2024
e735770
remove unnecessary logger
linyows Feb 5, 2024
2a9ede5
support full color for callout
linyows Feb 5, 2024
8e6a97d
simplize codeblock and remove modules args
linyows Feb 5, 2024
a03a024
fix table block css
linyows Feb 5, 2024
73c7fcd
update token for stylex
linyows Feb 5, 2024
8e85413
remove modules
linyows Feb 5, 2024
5a32f9a
add prismjs and mermaid to external module
linyows Feb 5, 2024
228d040
bump version to 0.0.9
linyows Feb 5, 2024
35e43cf
fix test
linyows Feb 5, 2024
2e3b2ec
update examples
linyows Feb 6, 2024
7e1fc04
change variable for tokens.stylex
linyows Feb 9, 2024
633348b
add FileBlockObjectResponseEx
linyows Feb 9, 2024
26941d3
update styles
linyows Feb 9, 2024
1372dd5
update stories
linyows Feb 9, 2024
bd97555
remove comment for table_of_contents
linyows Feb 9, 2024
e9cddf5
support no-html bookmark
linyows Feb 9, 2024
e1b165e
support fileblock
linyows Feb 9, 2024
6ceca02
rename PageMention to PageOrDatabaseMention
linyows Feb 9, 2024
95c1205
add FileBlock.stories.tsx
linyows Feb 9, 2024
f499f53
add TextBlock.stories.tsx
linyows Feb 9, 2024
8a11385
add className to PageIcon.tsx
linyows Feb 9, 2024
4d71632
update Annotations
linyows Feb 9, 2024
69f3f74
update
linyows Feb 9, 2024
ea52b62
Support DateMention
linyows Feb 9, 2024
eb989fc
support LinkPreviewMention
linyows Feb 9, 2024
d92fc45
remove children as ReactNode
linyows Feb 9, 2024
df28157
support UserMention
linyows Feb 9, 2024
48f5fb3
fix style for text block
linyows Feb 9, 2024
3b83320
add cdate package
linyows Feb 9, 2024
91edc75
bump version to 0.0.10
linyows Feb 12, 2024
3581477
use cdate-schedule
linyows Feb 12, 2024
1484dc9
update target in package.json
linyows Feb 12, 2024
dd24c44
add test to build workflow
linyows Feb 12, 2024
4ca4f81
remove test in component
linyows Feb 12, 2024
a1fe011
update examples
linyows Feb 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ jobs:
run: |
npm install
npm run build
npm run test
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,3 @@ public
# packages
/packages/**/dist

# storybook
.storybook
storybook-static
36 changes: 36 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type { StorybookConfig } from "@storybook/react-vite";
import { stylexPlugin } from "vite-plugin-stylex-dev";

const config: StorybookConfig = {
stories: [
"../src/**/*.mdx",
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)",
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
staticDirs: ['../examples/nextjs/public'],
docs: {
autodocs: "tag",
},
async viteFinal(config) {
const { plugins = [] } = config;
plugins.push(
stylexPlugin({
unstable_moduleResolution: {
type: 'commonJS',
rootDir: process.cwd()
}
})
)
return config
},
};
export default config;
15 changes: 15 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from "@storybook/react";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
20 changes: 16 additions & 4 deletions examples/nextjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prismjs": "^1.29.0",
"react": "^18",
"react-dom": "^18",
"rotion": "^0.0.8"
"rotion": "^0.0.10"
},
"devDependencies": {
"@types/node": "^20",
Expand Down
3 changes: 1 addition & 2 deletions examples/nextjs/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import '@/styles/globals.css'
import type { AppProps } from 'next/app'
import Head from 'next/head'
import 'rotion/styles/notionate.css'
import 'rotion/styles/notionate-dark.css'
import 'rotion/style.css'
import styles from '@/styles/App.module.css'

export default function App({ Component, pageProps }: AppProps) {
Expand Down
12 changes: 4 additions & 8 deletions examples/nextjs/pages/block.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { GetStaticProps, NextPage } from 'next'
import Image from 'next/image'
import Link from 'next/link'
import { useState, useEffect } from 'react'
import Header from '@/components/Header'
import Head from 'next/head'
import styles from '@/styles/Page.module.css'
import mermaid from 'mermaid'
import prism from 'prismjs'
import mermaid from 'mermaid'

import 'prismjs/themes/prism.min.css'
import 'prismjs/components/prism-bash'
import 'prismjs/components/prism-go'
import 'prismjs/components/prism-typescript'
Expand Down Expand Up @@ -57,11 +58,6 @@ export const getStaticProps: GetStaticProps<Props> = async (context) => {
}

const BlocksPage: NextPage<Props> = ({ title, icon, blocks, breadcrumbs }) => {
const [exModules, setExModules] = useState({ mermaid, prism })
useEffect(() => {
mermaid.initialize({ theme: window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'neutral' })
setExModules({ mermaid, prism })
}, [])
const hrefs = ['/', '/[name]']

return (
Expand All @@ -86,7 +82,7 @@ const BlocksPage: NextPage<Props> = ({ title, icon, blocks, breadcrumbs }) => {
</header>

<div className={`${styles.page} ${styles.wrapperPage}`}>
<Page blocks={blocks} modules={exModules} link={Link} breadcrumb_hrefs={hrefs} />
<Page blocks={blocks} link={Link} breadcrumb_hrefs={hrefs} />
</div>
</div>
<span></span>
Expand Down
Loading
Loading