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

EDI-3 Images #8

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 22 additions & 22 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@ 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:
labels:
- '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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linear-linker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions src/editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<NormalizedEditorProps> = { ...dirty }
Expand All @@ -29,6 +30,7 @@ export const Editor = (props: EditorProps) => {

return (
<RootProvider customExtensions={normalizedProps.customExtensions}>
<RootGlobalStyles />
{editor}
</RootProvider>
)
Expand Down
2 changes: 2 additions & 0 deletions src/editor/elements/image/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// nothing
export {}
65 changes: 48 additions & 17 deletions src/editor/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -123,30 +148,36 @@ 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);
}

ul ul,
ol ol {
margin: 0;
}

ol ol {
Expand Down