Commit graph

276 commits

Author SHA1 Message Date
robonetphy 4f95a4e145 the drop block at start added 2023-08-28 18:52:54 +05:30
robonetphy 9f81269ad0 get block by child element added 2023-08-28 18:33:12 +05:30
robonetphy 13d92ca2f8 Merge branch 'next' into feat/dragndrop 2023-08-27 19:04:43 +05:30
Peter Savchenko 42612a0fd9
chore(blocks.render): mutex for onchange added to the blocks.render() (#2449) 2023-08-21 12:28:31 +03:00
Peter Savchenko 922dfd8741
chore(api): blocks.update(id, data) method improved (#2443)
* add custom Chai assertion "be.calledWithBatchedEvents" for testing onchange

* chore(api): blocks.update(id, data) method improved

- `blocks.update(id, data)` now can accept partial data object — it will update only passed properties, others will remain the same.
- `blocks.update(id, data)` now will trigger onChange with only `block-change` event.
- `blocks.update(id, data)` will return a promise with BlockAPI object of changed block.

* fix tests

* Update blocks.cy.ts
2023-08-19 07:53:42 +03:00
Peter Savchenko b39996616c
chore(perf): initialisation and rendering performance optimisations (#2430)
* renderer batching

* initialization and rendering performance optimized

* insertMany api method added

* Update index.html

* rm old method

* upd changelog

* upd paragraph

* paste tests fixed

* api blocks tests fixed

* backspace event tests fixed

* async issues in tests fixed

* eslint

* stub block added, tests added

* eslint

* eslint

* add test for insertMany()

* Update package.json
2023-08-08 22:17:09 +03:00
robonetphy 2de7c7dee6 Merge branch 'next' into feat/dragndrop 2023-07-26 23:52:01 +05:30
Peter Savchenko 022320940e
feat(shortcuts): convert block by tools shortcut (#2419)
* feat(conversion): allow to convert block using shortcut

* display shortcuts in conversion toolbar

* tests for the blocks.convert

* tests for the toolbox shortcuts

* Update CHANGELOG.md

* Update toolbox.cy.ts

* rm unused imports

* firefox test fixed

* test errors via to.throw
2023-07-20 23:27:18 +03:00
Peter Savchenko b24bebbc40
feat(blocks-dom): block ids exported as data-id attribute (#2404) 2023-07-06 23:59:28 +03:00
Peter Savchenko 2ab9eb13bc
feat(block-events): delete keydown handling added (#2402)
* feat(block-events): delete keydown logic added

* chore(ui-events): delete keydown will remove selected blocks

* backspace tests added

* delete keydown tests

* tests for ui added

* fix ci

* separate block events tests for several files

* Delete BlockEvents.cy.ts

* rm unused change

* add code-review fixes + corner cases handling

* Update blockEvents.ts

* allow merging only same type blocks
2023-07-06 23:45:12 +03:00
Peter Savchenko 9e64003c0a
fix(onchange): support data-mutation-free on attributes chane (#2393) 2023-06-22 20:42:14 +03:00
Peter Savchenko c8993332e3
fix(onchange): callback will be fired on removing of a whole text (#2392)
* fix(onchange): callback will be fired when the whole text is removed in a block

* whops
2023-06-21 20:32:25 +03:00
Peter Savchenko b7b00fd060
chore(onChange): bugfix, batching, improvements of ModificationsObserver (#2349)
* block onchange stash

* improve block filtration

* update tool root

* chore(block): remove willSelect und willUnselect

* onchange events batching

* get rid of CustomEvent extension, create custom event map instead

* improve types of EventsDispatcher

* fix tests

* custom sinon + chai matchers

* improve tests, add mutex for fake cursor

* add test for fake-cursor mutex

* test for batch filtering

* fix caret setting by enter press at the end of the block

* test for detectToolRootChange

* remove resolved todos

* changelog added

* fix tests

* Update CHANGELOG.md

* rename FakeCursorAboutToBeSet -> FakeCursorAboutToBeToggled

* update didMutated statements

* move inputs cache clearing to a separate method

* rm Record inheritance from Event maps

* add type alisases

* rename isElementContainsFakeCursor ->  isFakeCursorInsideContainer

* improve code style
2023-05-12 20:50:48 +03:00
Umang G. Patel 28203e547f
Merge branch 'next' into feat/dragndrop 2023-04-17 00:37:52 +05:30
Taly aafab1d395
Use Vite builder (#2300)
* vite builder initial

* save

* add displayName

* add paragraph from npm

* fix postcss apply

* remove some packages, fix tests

* Update cypress.yml

* remove logs

* remove unused packages

* update path to image

* update

* Update index.html

* Update cypress.yml

* Update cypress.yml

* Update cypress.yml

* remove displayName field

* update names

* Update index.ts

* Update index.ts

* update packages

* remove packages

* postcss preserve: true

* Update index.html

* Update editor-modules.d.ts

* use public dir for static

* Update vite.config.js

* update modules type

* Update CHANGELOG.md
2023-04-13 22:25:29 +03:00
Guillaume Leon 0491155e33
feat(toolbar-api): method for toggling toolbox (#2332)
* Expose toolbox control method

* Add test for toolbox

* rename method to toggleToolbox

* add missing test case

* Add changelog

* remove eslint rule

* Update changelog

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>

* fix linter problems

---------

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2023-04-13 20:02:46 +03:00
Umang G. Patel 09bbb9f091
Update src/components/modules/dragNDrop.ts
Co-authored-by: Ilya Maroz <37909603+ilyamore88@users.noreply.github.com>
2023-04-03 13:09:41 +05:30
robonetphy 566495095e create image logic updated 2023-04-03 13:00:25 +05:30
robonetphy c901965f71 update dropTarget => dropZonePostion 2023-04-03 12:54:48 +05:30
Ilya Maroz 1e2fd9e060
Merge branch 'next' into feat/dragndrop 2023-04-02 19:22:10 +01:00
Ilya Maroz 75379c66a9
deps(TypeScript) - upgrade to v5, upgrade ts-loader, fix types error, fix pasteConfig getter wrapper (#2322)
* deps: upgrade typescript to v5, upgrade ts-loader to support newest TS

* Fix (??) type of `pasteConfig`

TypeScript 4.9 found something is wrong with this code, but it's unclear (to me) which line is wrong. This PR is a guess, do with it what you will.

In paste.ts there's a check to see if `pasteConfig === false`:
https://github.com/codex-team/editor.js/blob/next/src/components/modules/paste.ts#L287

However, this getter never returns false because if the LHS of the `||` is `false`, `{ }` is returned instead.

It seems like this meant to be `??` instead so that if `this.constructable[InternalBlockToolSettings.PasteConfig]` was `undefined` (missing), then `{}` would be returned instead. But maybe you meant `false` here - I don't know.

* feat: create alias for PasteConfig, fix lint

* fix: problems with types

* test: add case for disabling preventing default behavior of paste event handler, add cases for pasteConfig getter in BlockTool wrapper

* chore: upgrade CHANGELOG.md

* fix: interface naming convention

* chore: apply CHANGELOG.md suggestion

* refactor: create custom Editor instance inside test case

* fix: remove editor instance destroy after PR feedback

---------

Co-authored-by: Ryan Cavanaugh <RyanCavanaugh@users.noreply.github.com>
2023-04-02 16:52:42 +01:00
robonetphy 62d07892e5 lint removed 2023-03-28 21:43:04 +05:30
robonetphy d7c0cf8ddf undefined => false 2023-03-28 12:08:17 +05:30
robonetphy 8399d54a55 improvements to logic 2023-03-28 12:02:01 +05:30
robonetphy 501f8a25a5 remove the block selection filter 2023-03-28 11:50:24 +05:30
robonetphy 92845e75f7 scrolling feature while dragging added 2023-03-27 18:45:08 +05:30
Umang G. Patel 77a37cc1dc
Update index.ts 2023-03-26 13:31:38 +05:30
Umang G. Patel 0c8bb9d863
update the problem with chrome and safari 2023-03-26 13:10:49 +05:30
Umang G. Patel a210e6f40b
Merge branch 'next' into feat/dragndrop 2023-03-24 10:41:09 +05:30
Umang G. Patel 55e31c0e2c
fix dragndrop will toolbox open 2023-03-24 10:40:33 +05:30
Peter Savchenko 5257b061c4
fix(block): remember plugin's content element instead of dom search (#2311)
* fix(block): remember plugin's content element instead of dom search

* improve doc

* test case added
2023-03-20 23:28:17 +03:00
Umang G. Patel 17d25035a6
Merge branch 'next' into feat/dragndrop 2023-03-20 17:44:16 +05:30
Anwar Hussain 86c84d8555
hotfix: add popular grammar checker extension node names (#2096)
* hotfix: add popular grammar checker extension node names

* fix: prettier messed the existing code style

* update the changelog

* Update docs/CHANGELOG.md

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>

* Update CHANGELOG.md

---------

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2023-03-15 12:27:25 +00:00
Kirk Douglas Jr 9ae96b9e17
fix(move-up-tune): scroll up offset for blocks above viewport (#2298)
* fix: scroll up offset for blocks above viewport

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2023-03-14 00:09:04 +03:00
robonetphy 856475f9e2 lint removed 2023-03-13 18:28:53 +05:30
robonetphy 10375f9e8e changes added 2023-03-13 17:39:44 +05:30
Umang G. Patel 2f43494e9c updated the logic 2023-02-28 10:02:43 +05:30
Umang G. Patel 0a4d53b2e6 comments added 2023-02-22 04:15:25 +05:30
Umang G. Patel b560b26a31
Merge branch 'next' into feat/dragndrop 2023-02-22 03:43:29 +05:30
Umang G. Patel 23b7fd6e16 add the isDragStart getter 2023-02-22 03:35:20 +05:30
Umang G. Patel fa33f1175f update the Inline tool close 2023-02-21 10:32:27 +05:30
Umang G. Patel 2167b91d16 Caret added with drag and drop 2023-02-20 22:54:59 +05:30
Umang G. Patel aa3dcd2439 drop logic updated 2023-02-20 09:49:14 +05:30
Peter Savchenko dfb07ec4e4
fix(tests): fire mutation event on tune activation (#2281)
* fix(onchange): fire mutation event if there are other changes along with mutation-free nodes

* update header dependency

* use node 16 for windows

* fix onChange firing by manual dispatchChange() call

* eslint

* use node 16 for ci tests

* Update CHANGELOG.md
2023-02-20 00:59:10 +02:00
Umang G. Patel 23682640eb unused code removed 2023-02-20 01:10:14 +05:30
Umang G. Patel b7add56b24 dragImage creation and removal functionality added 2023-02-20 01:08:43 +05:30
Umang G. Patel 722eb8ee7d unsed logic removed 2023-02-20 00:38:12 +05:30
robonetphy 445eaf3255 cleardropTargets function added 2023-02-16 18:19:22 +05:30
robonetphy 96deca87bc comments added 2023-02-16 00:04:45 +05:30
robonetphy 4c5a199661 update the enum for drop zone position 2023-02-15 23:48:45 +05:30