Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1f6f92a
chore(block-tune-toggler): toggler moved to the left (draft)
neSpecc Sep 30, 2021
cdbe9e1
toolbox ui updated
neSpecc Oct 28, 2021
5ba7743
fixd caret jumpling, improved some styles
neSpecc Nov 4, 2021
2ef108a
toolbar moving by block-hover
neSpecc Nov 19, 2021
ae3386d
the dark-theme to the example-dev.html
neSpecc Nov 19, 2021
b313238
positioning improved
neSpecc Nov 19, 2021
c64ee97
fix(rectangle-selection): first click after RS does not clears select…
neSpecc Nov 19, 2021
167ecb1
toolbox position fixed
neSpecc Nov 19, 2021
38a188f
the toolbox module became a standalone class
neSpecc Nov 19, 2021
72774fa
new(api.listeners): `on()` now returns the listener id. The new `offB…
neSpecc Nov 19, 2021
efcd617
fix bug with Tab pressing on hovered but not focused block
neSpecc Nov 19, 2021
6a22d94
mobile version improved
neSpecc Nov 20, 2021
6445d83
upd example dev
neSpecc Nov 20, 2021
9035227
small updaets
neSpecc Nov 20, 2021
5138560
add nested-list
neSpecc Nov 20, 2021
54d7b7f
linting
neSpecc Nov 20, 2021
d9f9c1c
(api.toolbar): `toggleBlockSettings` now fires toggling event with th…
neSpecc Nov 22, 2021
d0aff29
EventDispatcher used instead of callbacks for the Toolbox
neSpecc Nov 22, 2021
27042e0
UIApi added
neSpecc Nov 23, 2021
35461ed
fix ci
neSpecc Nov 23, 2021
5442321
git submodules removed from the ci flow
neSpecc Nov 24, 2021
8cc4cb6
branch updated
neSpecc Nov 24, 2021
13813ff
add paragraph submodule to the ci flow
neSpecc Nov 24, 2021
ce991b6
Update CHANGELOG.md
neSpecc Nov 24, 2021
4e465ab
Update package.json
neSpecc Nov 24, 2021
27f377c
use ubuntu-latest for chrome ci
neSpecc Nov 24, 2021
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
8 changes: 4 additions & 4 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ jobs:
options: --user 1001
steps:
- uses: actions/checkout@v2
- run: yarn pull_tools && yarn tools:update
- run: yarn ci:pull_paragraph
- uses: cypress-io/github-action@v2
with:
config: video=false
browser: firefox
build: yarn build
chrome:
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn pull_tools && yarn tools:update
- run: yarn ci:pull_paragraph
- uses: cypress-io/github-action@v2
with:
config: video=false
Expand All @@ -28,7 +28,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- run: yarn pull_tools && yarn tools:update
- run: yarn ci:pull_paragraph
- uses: cypress-io/github-action@v2
with:
config: video=false
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@
[submodule "example/tools/underline"]
path = example/tools/underline
url = https://github.com/editor-js/underline
[submodule "example/tools/nested-list"]
path = example/tools/nested-list
url = https://github.com/editor-js/nested-list
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,4 @@ CodeX is a team of digital specialists around the world interested in building h

| 🌐 | Join 👋 | Twitter | Instagram |
| -- | -- | -- | -- |
| [codex.so](https://codex.so) | [codex.so/join](https://codex.so/join) |[@codex_team](http://twitter.com/codex_team) | [@codex_team](http://instagram.com/codex_team) |
| [codex.so](https://codex.so) | [codex.so/join](https://codex.so/join) |[@codex_team](http://twitter.com/codex_team) | [@codex_team](http://instagram.com/codex_team/) |
20 changes: 18 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,24 @@

### 2.23.0

- `Improvement` — The `onChange` callback now accepts two arguments: EditorJS API and the CustomEvent with `type` and `detail` allowing to determine what happened with a Block
- `New` *Block API* — The new `dispatchChange()` method allows to manually trigger the 'onChange' callback. Useful when Tool made a state mutation that is invisible for editor core.
- `Improvement` — *EditorConfig* — The `onChange` callback now accepts two arguments: EditorJS API and the CustomEvent with `type` and `detail` allowing to determine what happened with a Block
- `New` — *Block API* — The new `dispatchChange()` method allows to manually trigger the 'onChange' callback. Useful when Tool made a state mutation that is invisible for editor core.
- `Improvement` — *UI* — Block Tunes toggler moved to the left
- `Improvement` — *UI* — Block Actions (BT toggler + Plus Button) will appear on block hovering instead of click
- `Improvement` — *UI* — Block Tunes toggler icon and Plus button icon updated
- `Improvement` — *Dev Example Page* — The menu with helpful buttons added to the bottom of the screen
- `Improvement` — *Dev Example Page* — The 'dark' theme added. Now we can code at night more comfortably.
- `Improvement` — *Rectangle Selection* — paint optimized
- `Fix` — *Rectangle Selection* — the first click after RS was not clear selection state. Now does.
- `Improvement` — *Blocks API* — toolbar moving logic removed from `blocks.move()` and `blocks.swap()` methods. Instead, you should use Toolbar API (it was used by MoveUp and MoveDown tunes, they were updated).
- `New` — *Blocks API* — The `getBlockIndex()` method added
- `New` — *Blocks API* — the `insert()` method now has the `replace: boolean` parameter
- `New` — *Blocks API* — the `insert()` method now returns the inserted `Block API`
- `New` — *Listeners API* — the `on()` method now returns the listener id.
- `New` — *Listeners API* — the new `offById()` method added
- `New` — `API` — The new `UiApi` section was added. It allows accessing some editor UI nodes and methods.
- `Refactoring` — Toolbox became a standalone class instead of a Module. It can be accessed only through the Toolbar module.
- `Refactoring` — CI flow optimized.

### 2.22.3

Expand Down
229 changes: 195 additions & 34 deletions example/assets/demo.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
/**
* Styles for the example page
*/

:root {
--color-bg-main: #fff;
--color-border-light: #E8E8EB;
--color-text-main: #000;
}

.dark-mode {
--color-border-light: rgba(255, 255, 255,.08);
--color-bg-main: #1c1e24;
--color-text-main: #737886;
}


body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
font-size: 14px;
line-height: 1.5em;
margin: 0;
background: var(--color-bg-main);
color: var(--color-text-main);
}

.ce-example {
font-size: 16.2px;
}

.ce-example__header {
border-bottom: 1px solid #E8E8EB;
border-bottom: 1px solid var(--color-border-light);
height: 50px;
line-height: 50px;
display: flex;
Expand Down Expand Up @@ -62,23 +78,17 @@ body {
-moz-osx-font-smoothing: grayscale;
}

.ce-example__content--small {
.thin-mode .ce-example__content {
max-width: 500px;
border-left: 1px solid #eee;
border-right: 1px solid #eee;
padding: 0 15px;
}

.ce-example__content--with-bg {
background: #f4f4f4;
max-width: none;
margin-top: -30px;
}

.ce-example__output {
background: #1B202B;
overflow-x: auto;
padding: 0 30px;
padding: 0 30px 80px;
}

.ce-example__output-content {
Expand Down Expand Up @@ -127,29 +137,94 @@ body {
}

.ce-example__statusbar {
display: flex;
align-items: center;
position: fixed;
bottom: 10px;
right: 10px;
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
font-size: 12px;
bottom: 0;
right: 0;
left: 0;
background: var(--color-bg-main);
border-radius: 8px 8px 0 0;
border-top: 1px solid var(--color-border-light);
box-shadow: 0 2px 6px var(--color-border-light);
font-size: 13px;
padding: 8px 15px;
z-index: 1;
user-select: none;
}

@media (max-width: 768px) {
.ce-example__statusbar {
display: none;
}
}

.ce-example__statusbar-item:not(:last-of-type)::after {
content: '|';
color: #ddd;
margin: 0 15px 0 12px;
}

.ce-example__statusbar-item--right {
margin-left: auto;
}

.ce-example__statusbar-button {
display: inline-flex;
margin-left: 10px;
background: #4A9DF8;
padding: 6px 12px;
box-shadow: 0 7px 8px -4px rgba(137, 207, 255, 0.77);
display: inline-block;
padding: 3px 12px;
transition: all 150ms ease;
cursor: pointer;
border-radius: 31px;
background: #eff1f4;
text-align: center;
user-select: none;
}

.ce-example__statusbar-button:hover {
background: #e0e4eb;
}

.ce-example__statusbar-button-primary {
background: #4A9DF8;
color: #fff;
box-shadow: 0 7px 8px -4px rgba(137, 207, 255, 0.77);
font-family: 'PT Mono', Menlo, Monaco, Consolas, Courier New, monospace;
text-align: center;
}

.ce-example__statusbar {
--toggler-size: 20px;
}

.ce-example__statusbar-toggler {
position: relative;
background: #7b8799;
border-radius: 20px;
padding: 2px;
width: calc(var(--toggler-size) * 2.2);
cursor: pointer;
user-select: none;
}

.ce-example__statusbar-toggler::before {
display: block;
content: '';
width: var(--toggler-size);
height: var(--toggler-size);
background: #fff;
border-radius: 50%;
transition: transform 100ms ease-in;
}

.ce-example__statusbar-toggler::after {
--moon-size: calc(var(--toggler-size) * 0.5);
content: '';
position: absolute;
top: 5px;
right: 5px;
height: var(--moon-size);
width: var(--moon-size);
box-shadow: calc(var(--moon-size) * 0.25 * -1) calc(var(--moon-size) * 0.18) 0 calc(var(--moon-size) * 0.05) white;
border-radius: 50%;
}

@media all and (max-width: 730px){
Expand Down Expand Up @@ -178,22 +253,10 @@ body {
color: rgb(247, 60, 173);
}

.ce-example .ce-block:first-of-type h2.ce-header{
.ce-example .ce-block:first-of-type h1.ce-header{
font-size: 50px;
}

.ce-example h2.ce-header{
font-size: 30px;
}

.ce-example h3.ce-header {
font-size: 24px;
}

.ce-example h4.ce-header {
font-size: 18px;
}

.ce-example-multiple {
display: grid;
grid-template-columns: calc(50% - 15px) calc(50% - 15px);
Expand All @@ -206,3 +269,101 @@ body {
border-radius: 7px;
padding: 30px;
}

.show-block-boundaries .ce-block {
box-shadow: inset 0 0 0 1px #eff2f5;
}

.show-block-boundaries .ce-block__content {
box-shadow: 0 0 0 1px rgba(224, 231, 241, 0.61) inset;
}
.show-block-boundaries #showBlocksBoundariesButton span,
.thin-mode #enableThinModeButton span {
font-size: 0;
vertical-align: bottom;
}

.show-block-boundaries #showBlocksBoundariesButton span::before,
.thin-mode #enableThinModeButton span::before {
content: attr(data-toggled-text);
display: inline;
font-size: 13px;
}



/**
* Dark theme overrides
*/
.dark-mode img {
opacity: 0.5;
}

.dark-mode .cdx-simple-image__picture--with-border,
.dark-mode .cdx-input {
border-color: var(--color-border-light);
}

.dark-mode .ce-example__button {
box-shadow: 0 24px 18px -14px rgba(4, 154, 255, 0.24);
}

.dark-mode .ce-example__output {
background-color: #17191f;
}

.dark-mode .inline-code {
background-color: rgba(53, 56, 68, 0.62);
color: #727683;
}

.dark-mode a {
color: #959ba8;
}

.dark-mode .ce-example__statusbar-toggler,
.dark-mode .ce-example__statusbar-button {
background-color: #343842;
}

.dark-mode .ce-example__statusbar-toggler::before {
transform: translateX(calc(var(--toggler-size) * 2.2 - var(--toggler-size)));
}

.dark-mode .ce-example__statusbar-toggler::after {
content: '*';
right: auto;
left: 6px;
top: 7px;
color: #fff;
box-shadow: none;
font-size: 32px;
}

.dark-mode.show-block-boundaries .ce-block,
.dark-mode.show-block-boundaries .ce-block__content {
box-shadow: 0 0 0 1px rgba(128, 144, 159, 0.09) inset;
}

.dark-mode.thin-mode .ce-example__content{
border-color: var(--color-border-light);
}

.dark-mode .ce-example__statusbar-item:not(:last-of-type)::after {
color: var(--color-border-light);
}

.dark-mode .ce-block--selected .ce-block__content,
.dark-mode ::selection{
background-color: rgba(57, 68, 84, 0.57);
}

.dark-mode .ce-toolbox__button,
.dark-mode .ce-toolbar__settings-btn,
.dark-mode .ce-toolbar__plus {
color: inherit;
}

.dark-mode .ce-stub {
opacity: 0.3;
}
Loading