From 039ebe02216f4d0617c26034e303b4e3864d3352 Mon Sep 17 00:00:00 2001 From: risenforces Date: Sat, 26 Jun 2021 19:40:47 +0500 Subject: [PATCH 1/5] wip: add nothing --- src/editor/elements/image/index.ts | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/editor/elements/image/index.ts diff --git a/src/editor/elements/image/index.ts b/src/editor/elements/image/index.ts new file mode 100644 index 0000000..b406cfa --- /dev/null +++ b/src/editor/elements/image/index.ts @@ -0,0 +1,2 @@ +// nothing +export {} From a1e7be7fcb0b7973a16c6f43ec475f4fbdea768a Mon Sep 17 00:00:00 2001 From: risenforces Date: Sat, 26 Jun 2021 20:39:45 +0500 Subject: [PATCH 2/5] ci: handle PRs edit --- .github/workflows/linear-linker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linear-linker.yml b/.github/workflows/linear-linker.yml index 994529b..8c76824 100644 --- a/.github/workflows/linear-linker.yml +++ b/.github/workflows/linear-linker.yml @@ -2,7 +2,7 @@ name: Linear.app Linker on: pull_request: - types: [opened, closed, reopened, synchronize, ready_for_review] + types: [opened, edited, closed, reopened, synchronize, ready_for_review] jobs: linear_linker: From 4e70388c16a98584162a8569c5642817de95024e Mon Sep 17 00:00:00 2001 From: risenforces Date: Sat, 26 Jun 2021 21:10:45 +0500 Subject: [PATCH 3/5] feat: add editor css variables --- README.md | 27 +++++++++++++++++++ src/editor/editor.tsx | 2 ++ src/editor/styles.ts | 60 +++++++++++++++++++++++++++++++------------ 3 files changed, 72 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index c0a23d4..902ee0e 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,33 @@ Write `1.` or `1)` + space to create an ordered list. Use `Tab` and `Shift+Tab` to manage the items nesting level. +## Styles + +```css +:root { + --editor-font-family: 'Open Sans', sans-serif; + --editor-font-size: 16px; + --editor-line-height: 24px; + + --editor-mod-bold-font-weight: 600; + --editor-mod-inline-code-font-family: 'Source Code Pro', monospace; + --editor-mod-inline-code-padding: 4px 6px; + --editor-mod-inline-code-background: #f7f6f9; + --editor-mod-inline-code-border-radius: 6px; + --editor-mod-link-color: rgb(75, 50, 195); + + --editor-paragraph-margin: 1em 0; + + --editor-heading1-margin: 0.67em 0; + --editor-heading1-font-size: 30px; + --editor-heading1-line-height: 36px; + --editor-heading1-font-weight: 400; + + --editor-list-margin: 1em 0; + --editor-list-padding: 0 0 0 24px; + } +``` + ## Architecture [Excalidraw](https://excalidraw.com/#json=4811335044956160,DJxYluN2Ua3_wl756Fv62A) diff --git a/src/editor/editor.tsx b/src/editor/editor.tsx index acc0bca..80cbf09 100644 --- a/src/editor/editor.tsx +++ b/src/editor/editor.tsx @@ -3,6 +3,7 @@ import { RootProvider } from './root-provider' import { EditorProps, NormalizedEditorProps } from './types/editor-props' import { EditableEditor } from './editable-editor' import { ReadonlyEditor } from './readonly-editor' +import { RootGlobalStyles } from './styles' function normalizeProps(dirty: EditorProps): NormalizedEditorProps { const normalized: Partial = { ...dirty } @@ -29,6 +30,7 @@ export const Editor = (props: EditorProps) => { return ( + {editor} ) diff --git a/src/editor/styles.ts b/src/editor/styles.ts index d496754..87eb54b 100644 --- a/src/editor/styles.ts +++ b/src/editor/styles.ts @@ -108,13 +108,38 @@ export const TippyStyles = createGlobalStyle` } ` +export const RootGlobalStyles = createGlobalStyle` + :root { + --editor-font-family: 'Open Sans', sans-serif; + --editor-font-size: 16px; + --editor-line-height: 24px; + + --editor-mod-bold-font-weight: 600; + --editor-mod-inline-code-font-family: 'Source Code Pro', monospace; + --editor-mod-inline-code-padding: 4px 6px; + --editor-mod-inline-code-background: #f7f6f9; + --editor-mod-inline-code-border-radius: 6px; + --editor-mod-link-color: rgb(75, 50, 195); + + --editor-paragraph-margin: 1em 0; + + --editor-heading1-margin: 0.67em 0; + --editor-heading1-font-size: 30px; + --editor-heading1-line-height: 36px; + --editor-heading1-font-weight: 400; + + --editor-list-margin: 1em 0; + --editor-list-padding: 0 0 0 24px; + } +` + export const StyledEditor = styled.div` - font-family: 'Open Sans', sans-serif; - font-size: 16px; - line-height: 24px; + font-family: var(--editor-font-family); + font-size: var(--editor-font-size); + line-height: var(--editor-line-height); a { - color: rgb(75, 50, 195); + color: var(--editor-mod-link-color); text-decoration: none; } @@ -123,30 +148,31 @@ export const StyledEditor = styled.div` } code { - font-family: 'Source Code Pro', monospace; - padding: 4px 6px; - background: #f7f6f9; - border-radius: 6px; + font-family: var(--editor-mod-inline-code-font-family); + padding: var(--editor-mod-inline-code-padding); + background: var(--editor-mod-inline-code-background); + border-radius: var(--editor-mod-inline-code-border-radius); } b { - font-weight: 600; + font-weight: var(--editor-mod-bold-font-weight); } - h1 { - font-size: 30px; - line-height: 36px; - font-weight: 400; + p { + margin: var(--editor-paragraph-margin); } - p { - font-size: 16px; - line-height: 24px; + h1 { + margin: var(--editor-heading1-margin); + font-size: var(--editor-heading1-font-size); + line-height: var(--editor-heading1-line-height); + font-weight: var(--editor-heading1-font-weight); } ol, ul { - padding-left: 24px; + margin: var(--editor-list-margin); + padding: var(--editor-list-padding); } ol ol { From 1b185fcf75863072f6ec495e7efe1d8117ceb03f Mon Sep 17 00:00:00 2001 From: risenforces Date: Sat, 26 Jun 2021 21:12:46 +0500 Subject: [PATCH 4/5] fix: list margins --- src/editor/styles.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/editor/styles.ts b/src/editor/styles.ts index 87eb54b..30e96a9 100644 --- a/src/editor/styles.ts +++ b/src/editor/styles.ts @@ -175,6 +175,11 @@ export const StyledEditor = styled.div` padding: var(--editor-list-padding); } + ul ul, + ol ol { + margin: 0; + } + ol ol { list-style-type: lower-roman; } From 696bf9ac5f7b884d4137310752818fe4cc478a7a Mon Sep 17 00:00:00 2001 From: risenforces Date: Sat, 26 Jun 2021 22:56:15 +0500 Subject: [PATCH 5/5] ci: fix labels case --- .github/release-drafter.yml | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index fcb961c..094e2b0 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -4,35 +4,35 @@ categories: - title: '๐Ÿš€ Features' labels: - - 'feature' - - 'enhancement' + - 'Feature' + - 'Enhancement' - title: '๐Ÿ› Bug Fixes' labels: - - 'fix' - - 'bugfix' - - 'bug' + - 'Fix' + - 'Bugfix' + - 'Bug' - title: '๐Ÿ›  Refactor' - label: 'refactor' + label: 'Refactor' - title: '๐Ÿ’… Style' - label: 'style' + label: 'Style' - title: '๐Ÿงฐ Maintenance' labels: - - 'chore' - - 'dependencies' - - 'ci' + - 'Chore' + - 'Dependencies' + - 'CI' - title: '๐Ÿ“š Documentation' - label: 'documentation' + label: 'Documentation' - title: '๐Ÿงช Tests' - label: 'tests' + label: 'Tests' - title: '๐ŸŽ Optimizations' - label: 'optimizations' + label: 'Optimizations' version-resolver: major: @@ -40,17 +40,17 @@ version-resolver: - 'BREAKING CHANGES' minor: labels: - - 'feature' - - 'enhancement' - - 'dependencies' + - 'Feature' + - 'Enhancement' + - 'Dependencies' patch: labels: - - 'fix' - - 'bugfix' - - 'bug' - - 'optimizations' - - 'refactor' - - 'style' + - 'Fix' + - 'Bugfix' + - 'Bug' + - 'Optimizations' + - 'Refactor' + - 'Style' default: patch name-template: 'v$RESOLVED_VERSION'