Commit graph

237 commits

Author SHA1 Message Date
Peter Savchenko 35337747c5
fix(inline-toolbar): editor element grow on inline toolbar close (#2516) 2023-10-19 00:44:06 +03:00
github-actions[bot] d936bf08b7
Bump version (#2515)
Co-authored-by: github-actions <action@github.com>
2023-10-17 19:15:43 +03:00
Peter Savchenko e8acc59487
fix(onchange): blocks.render would not call onChange in safari (#2514) 2023-10-17 18:26:23 +03:00
Peter Savchenko 7d0db9b622
chore(patch): pull 2.28.1 patch to the next (#2507)
* fix(paste): delay onPaste call to be sure that block is ready (#2506)

* chore(package.json): increment patch version

* Update CHANGELOG.md
2023-10-11 20:28:16 +03:00
github-actions[bot] c9014e670d
Bump version (#2485)
Co-authored-by: github-actions <action@github.com>
2023-09-20 11:19:42 +03:00
github-actions[bot] 77eb320203
Bump version up to 2.28.1-rc.0 (#2468)
* Bump version

* use 2.29.0-rc.0

---------

Co-authored-by: github-actions <action@github.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2023-09-05 11:33:27 +03:00
Peter Savchenko 59c8d28da5
chore(release): bump version to 2.28.0 (#2455) 2023-08-25 00:23:57 +03:00
github-actions[bot] f8e9414217
Bump version (#2450)
Co-authored-by: github-actions <action@github.com>
2023-08-21 12:29:45 +03:00
github-actions[bot] be0d33ce0f
Bump version (#2447)
Co-authored-by: github-actions <action@github.com>
2023-08-20 17:29:21 +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
github-actions[bot] 0e64665b0f
Bump version (#2424)
Co-authored-by: github-actions <action@github.com>
2023-07-20 23:34:45 +03:00
github-actions[bot] 41dc65274d
chore(package.json): bump version up to 2.28.0-rc.0 (#2355)
* Bump version

* 2.28.0-rc.0

---------

Co-authored-by: github-actions <action@github.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2023-07-07 00:16:55 +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 1f74c5bec9
chore(release): change log updated, version updated (#2356)
* changelog updated, version updated
2023-05-15 22:43:45 +03:00
github-actions[bot] e6c265d0fa
Bump version (#2313)
Co-authored-by: github-actions <action@github.com>
2023-05-12 21:02:47 +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
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
Ilya Maroz d7f1853ca1
deps(Cypress): upgrade library and related packages to latest versions, migrate config, fix type error (#2327)
* deps: upgrade cypress and related libraries

* chore: automate migrate cypress config, rename spec files

* fix: custom commands types

* chore: upgrade CHANGELOG.md

* ci: upgrade cypress action to support new config file format

* ci: remove container from firefox job, upgrade checkout action
2023-04-02 19:20:59 +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
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
github-actions[bot] e9e0146961
Bump version (#2308)
Co-authored-by: github-actions <action@github.com>
Co-authored-by: Ilya Maroz <37909603+ilyamore88@users.noreply.github.com>
2023-03-16 15:33:14 +00:00
github-actions[bot] 7cf5266a23
Bump version (#2304)
Co-authored-by: github-actions <action@github.com>
Co-authored-by: Ilya Maroz <37909603+ilyamore88@users.noreply.github.com>
2023-03-15 12:41:03 +00:00
github-actions[bot] 58d6869285
Bump version (#2197)
Co-authored-by: github-actions <action@github.com>
2023-02-20 22:00:25 +02:00
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
Tatiana Fomina 07b1ce2aca
Chore/popover refactoring (#2249)
* Add new popover class

* Add flipper

* confirmation

* confirmation

* Add confirmation support

* Add search

* Add toggle group support and update popover tests

* Add custom content support

* Fix scroll issue

* Add mobile version

* Integration

* Fix animation

* Cleanup

* Fix popover position for narrow mode

* Fix tests

* Update version and changelog

* Rename css classes

* Move files

* Stop using PopoverItem from outside of popover context

* Fix jsdoc

* Move error animation to popover item

* Update css variables

* Update docs/CHANGELOG.md

Co-authored-by: Ilya Maroz <37909603+ilyamore88@users.noreply.github.com>

* Update src/components/block-tunes/block-tune-move-down.ts

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

* Update src/components/block-tunes/block-tune-move-up.ts

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

* Fixes

* Fix imports

* Fix toolbox close event

* Move search-input file

* Fix comment

* Rename method

* Cleanup

* Remove onFlip callback from popover item

* Rename

* Fix removing event listener

* Move popover animations to popover.css file

* Cleanup styles

* Fix jsdoc

* Fix confirmation chains

* Close toolbox oly when it's open

* Change activation error animation

* Update version and changelog

* Fix overlay

* Update icon border-radius on mobile

* Disable item text select

* Update changelog

* Update yarn.lock

* Add rc postfix to version

---------

Co-authored-by: Ilya Maroz <37909603+ilyamore88@users.noreply.github.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2023-02-10 21:29:58 +03:00
Denys Vuika d6cad60af3
Remove incorrect import for typings (#2252)
* Remove incorrect import for typings

Removes incorrect `'cypress/types/bluebird'` import; fixes #2251

* Update changelog and version

* Update CHANGELOG.md

---------

Co-authored-by: Tanya Fomina <fomina.tatianaaa@yandex.ru>
2023-01-31 20:32:43 +03:00
Tatiana Fomina 870e265af0
fix(tunes): Make label an alias for title in tunes menu item (#2198)
* Make label an alias for title in tunes item

* Cleanup

* Update version and changelog

* Update changelog

* Move resolveAlias to utils

* Add fallback for popover item title

* Lint

* Lint

* Add fallback icon and title to popover

* Update version

* Lint

* Fix changelog

* Fallback to empty string

This reverts commit ae9d643557.

* Fix changelog again

* Cleanup

* Add deprecated
2022-12-14 23:46:36 +03:00
Umang G. Patel c97f0842f5
fix(paste): handle pasteConfig with tag names specified in upper case (#2217)
* toLower case added

* regression test case added

* change log update

* version updated

* Apply suggestions from code review

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

* Update docs/CHANGELOG.md

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

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2022-12-14 14:25:02 +05:30
Tatiana Fomina b9a0665672
fix(tunes): make installed tunes render above default tunes (#2204)
* Fix tunes order

* Update version and changelog

* Fix tests
2022-12-06 16:32:57 +03:00
Tatiana Fomina 913ad0c8dc
feat: Add toggle group support (#2195)
* Add toggle group support

* Update version and changelog

* Fix

* Simplify

* Update test/cypress/tests/utils/popover.spec.ts

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

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2022-12-01 20:58:58 +03:00
github-actions[bot] 320a30afcc
bump: 2.26.0 is ready (#2189)
* Bump version

* Update package.json

Co-authored-by: github-actions <action@github.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2022-11-29 22:03:33 +04:00
github-actions[bot] 04118b2d6e
bump: 2.26.0-rc.7
Co-authored-by: github-actions <action@github.com>
2022-11-28 20:28:41 +04:00
github-actions[bot] a8026e6829
Bump version (#2183)
Co-authored-by: github-actions <action@github.com>
2022-11-26 11:37:53 +04:00
github-actions[bot] 6088aaead6
bump: 2.26.0-rc.5
Co-authored-by: github-actions <action@github.com>
2022-11-26 10:48:28 +04:00
github-actions[bot] fb86d71828
bump: 2.26.0-rc.4
Co-authored-by: github-actions <action@github.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2022-11-26 03:09:00 +04:00
github-actions[bot] a1071b7229
Bump version (#2178)
Co-authored-by: github-actions <action@github.com>
2022-11-25 22:29:01 +04:00
Peter Savchenko b1b582b150
feat(icons): codex icons package is used instead of svg sprite (#2173)
* chore(icons): migrating to the coded icon pack

* conversion toolbar

* inline toolbar, part 1

* inline-link tool has the new icons

* added a test for creating a link by Enter keydown in link input

* rm last icons, svg sprite, loaders

* rollback .ce-settings styles

* Update CHANGELOG.md

* Update settings.json
2022-11-25 22:26:23 +04:00
github-actions[bot] f0f8f8fcb5
Bump version (#2177)
Co-authored-by: github-actions <action@github.com>
2022-11-25 22:01:02 +04:00
Peter Savchenko 3272efc3f7
chore(linting): eslint updated, code linted (#2174)
* update eslint + autofix

* a bunch of eslint fixes

* some spelling & eslint fixes

* fix some eslint errors and spells

* Update __module.ts

* a bunch of eslint fixes in tests

* Update cypress.yml

* Update cypress.yml

* fix cypress docker image name

* fixes for tests

* more tests fixed

* rm rule ignore

* rm another ignored rule

* Update .eslintrc
2022-11-25 21:56:50 +04:00
github-actions[bot] 19f3790cfd
Bump version (#2169)
Co-authored-by: github-actions <action@github.com>
2022-11-22 00:30:24 +04:00
github-actions[bot] cd06bfc9c5
Bump version up to 2.26.0-rc.0 (#2105)
* Bump version

* Update package.json

* Update changelog

Co-authored-by: github-actions <action@github.com>
Co-authored-by: Tanya Fomina <fomina.tatianaaa@yandex.ru>
2022-11-03 22:39:51 +03:00
Tatiana Fomina 581289c03e
Block tunes as a popover (#2091)
* Default tunes to popover

* Add the rest of default tunes

* Add popover

* Cleanup

* Rename custom content

* Cleanup

* Add ability to open block settings upwards

* Fix tests

* Cleanup default tunes

* Rename and cleanup

* Add ability to display rendered custom tunes

* cleanup

* Rename

* Add flag to close tunes popover

* Cleanup

* i18n

* Cleanup

* Fix build and tests

* Fix for iframe

* Add comments

* Display active item, move closeOnActivate to popover

* Add confirmation support to popover

* Handle boolean value in confirmation param

* Clarify flippable logic in popover

* Comments

* Pass editor element as a param of popover constructor

* Fix readability

* Tests

* Fix flipper for confirmation element

* Update confirmation config structure

* Rename onClick to onActivate

* Fix tests and build

* Make confirmation props optional

* Simplify processing tunes

* Renamings

* Fix text block tunes

* Docs

* Update event type

* Move enabling confirmation state to separate method

* move popover types

* Unhardcode color

* Support toggling

* Add support of disabled items

* Fix tab in empty block leading to selecting second item in popover

* Remove margins for styles api settings button class

* Fix arrow navigation between blocks after opening block tunes

* Cleaup in default tunes code

* Fix chaining confirmations

* Colors

* Types

* Change the way flippable elements of popover custom area are set

* Remove borders around popover icons

* Fix untabbable inline toolbar

* Fix locked scroll after closing tunes popover on mobile

* Cleanup

* Set max popover width

* Make popover icon's border outside

* Fix tab issue

* Fix focus/hover issue

* Reformat

* Cleanup

* Fix opening block tunes via keyboard

* Add disableSpecialHoverAndFocusBehavior

* Add deprecated comment

* Cleanup

* Fix popover active state

* Fix checklist deletion with confirmation

* Fix checklist deletion 2

* Fix popover focus

* Fix popover items being impossible to flip after searching

* Fix popover item highlighting issue

* Update flipper.spec.ts

* Fixes after review

* Add Tunes Api tests

* Fix multiple popover entries configured by one tune

* Add tool's renderSettings() tests

* Add popover confirmation state test

* Fix popover width on mobile

* Add popover tests

* Add changelog and update version

* Update changelog

* Fix block tunes being unable to open after tune activation

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2022-11-03 20:52:33 +03:00
Tanya 6c0555a322
[Feature] Multiple toolbox items for single tool (#2050)
* the popover component, vertical toolbox

* toolbox position improved

* popover width improved

* always show the plus button

* search field added

* search input in popover

* trying to create mobile toolbox

* FIx mobile popover fixed positioning

* Add mobile popover overlay

* Hide mobile popover on scroll

* Tmp

* feat(toolbox): popover adapted for mobile devices (#2004)

* FIx mobile popover fixed positioning

* Add mobile popover overlay

* Hide mobile popover on scroll

* Alter toolbox buttons hover

* Fix closing popover on overlay click

* Tests fix

* Fix onchange test

* restore focus after toolbox closing by ESC

* don't move toolbar by block-hover on mobile

Resolves #1972

* popover mobile styles improved

* Cleanup

* Remove scroll event listener

* Lock scroll on mobile

* don't show shortcuts in mobile popover

* Change data attr name

* Remove unused styles

* Remove unused listeners

* disable hover on mobile popover

* Scroll fix

* Lint

* Revert "Scroll fix"

This reverts commit 82deae543e.

* Return back background color for active state of toolbox buttons

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

* Vertical toolbox fixes (#2017)

* Replace visibility property with display for hiding popover

* Disable arrow right and left keys for popover

* Revert "Replace visibility property with display for hiding popover"

This reverts commit af521cf6f2.

* Hide popover via setting max-height to 0 to fix animation in safari

* Remove redundant condition

* Extend element interface to avoid ts errors

* Do not subscribe to block hovered if mobile

* Add unsubscribing from overlay click event

* Rename isMobile to isMobileScreen

* Cleanup

* fix: popover opening direction (#2022)

* Change popover opening direction based on available space below it

* Update check

* Use cacheable decorator

* Update src/components/flipper.ts

Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>

* Fixes

* Fix test

* Clear search on popover hide

* Fix popover width

* Fix for tests

* Update todos

* Linter fixes

* rm todo about beforeInsert

because I have no idea what does it mean

* i18n for search labels done

* rm methods for hiding/showing of +

* some code style update

* Update CHANGELOG.md

* make the list items a little bit compact

* fix z-index issue caused by block-appearing animation

also, improve popover padding for two reasons:

- make the popover more consistent with the Table tool popover (in future, it can be done with the same api method)
- make popover looks better

* Some progress

Use overriden config

tmp

* Cleanup

* Proceed cleanup

* Update tool-settings.d.ts

* Get rid of isToolboxItemActive

* Get rid of key

* Filter out duplicates in conversion menu

* Rename hash to id

* Change function for generating hash

* Cleanup

* Further cleanup

* [Feature] Multiple toolbox items: using of data overrides instead of config overrides (#2064)

* Use data instead of config

* check if active toolbox entry exists

* comparison improved

* eslint fix

* rename toolbox types, simplify hasTools method

* add empty line

* wrong line

* add multiple toobox note to the doc

* Update toolbox configs merge logic

* Add a test case

* Add toolbox ui tests

* Update tests

* upd doc

* Update header

* Update changelog and package.json

* Update changelog

* Update jsdoc

* Remove unused dependency

* Make BlockTool's toolbox getter always return an array

* Fix for unconfigured toolbox

* Revert "Fix for unconfigured toolbox"

This reverts commit dff1df2304.

* Change return type

* Merge data overrides with actual block data when inserting a block

* Revert "Merge data overrides with actual block data when inserting a block"

This reverts commit eb0a59cc64.

* Merge tool's data with data overrides

* Move merging block data with data overrides to insertNewBlock

* Update changelog

* Rename getDefaultBlockData to composeBlockData

* Create block data on condition

* Update types/api/blocks.d.ts

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

* Update src/components/modules/api/blocks.ts

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

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>
2022-06-17 18:31:55 +03:00
Tanya Fomina 8fec2e71c3
[Fix] Toolbox prevents text selection (#2051)
* Add padding only to opened popover

* Update version and changelog

* Update docs/CHANGELOG.md

Co-authored-by: Ilya Moroz <37909603+ilyamore88@users.noreply.github.com>

* Use pointer event approach

Co-authored-by: Ilya Moroz <37909603+ilyamore88@users.noreply.github.com>
2022-05-06 13:26:52 +03:00
Umang G. Patel f2b19cc766
update the script to support windows (#2033) 2022-05-01 18:57:40 +05:30
github-actions[bot] 3cbe128af9
Bump version up to 2.24.2 (#2041)
* Bump version

* Change version to the 2.24.2

Co-authored-by: github-actions <action@github.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2022-05-01 15:32:08 +03:00
Tanya Fomina 96c0bcb573
fix(ui): toolbox items labels i18n (#2031)
* Fix toolbox item label translation

* Update version

* Update changelog

* Update docs/CHANGELOG.md

Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>

* Add fallback for missing toolbox title

* Update docs/CHANGELOG.md

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

* Add test

* Add testcase for missing toolbox title

Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2022-04-28 19:26:47 +03:00
github-actions[bot] 8bf4dcde9f
Bump version up to 2.24.0 (#1955)
* Bump version

* Update package.json

Co-authored-by: github-actions <action@github.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2022-04-26 22:51:33 +03:00
Umang G. Patel 18feb06a88
Fix OnChange Event Invocation (#2007)
* fix: call onchange event after block insert

* changelog updated

* patch version updated

* removed the modification observer from saver

* only changelog version added

* delimiter added

* feat: test case added for save inside the onchange
2022-04-07 14:33:09 +05:30