fix(workspace): Fix widget rendering for EditorJS v2.28 (#23918)

* fix(workspace): Ensure Block.render() always return an element

If `has_data` is false, then `this.wrapper` is still empty (because it was just created and `this.make` did nothing), so it's safe to give it back to EditorJS for rendering.

* build(deps): Bump EditorJS
This commit is contained in:
Corentin Flr 2024-01-07 08:06:55 +01:00 committed by GitHub
parent 745080c56e
commit c6bdc7fe45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 39 deletions

View file

@ -32,7 +32,7 @@ export default class Card extends Block {
if (this.data && this.data.card_name) {
let has_data = this.make("card", this.data.card_name, "links");
if (!has_data) return;
if (!has_data) return this.wrapper;
}
if (!this.readOnly) {

View file

@ -33,7 +33,7 @@ export default class Chart extends Block {
if (this.data && this.data.chart_name) {
let has_data = this.make("chart", this.data.chart_name);
if (!has_data) return;
if (!has_data) return this.wrapper;
}
if (!this.readOnly) {

View file

@ -32,7 +32,7 @@ export default class CustomBlock extends Block {
if (this.data && this.data.custom_block_name) {
let has_data = this.make("custom_block", this.data.custom_block_name);
if (!has_data) return;
if (!has_data) return this.wrapper;
}
if (!this.readOnly) {

View file

@ -33,7 +33,7 @@ export default class NumberCard extends Block {
if (this.data && this.data.number_card_name) {
let has_data = this.make("number_card", this.data.number_card_name);
if (!has_data) return;
if (!has_data) return this.wrapper;
}
if (!this.readOnly) {

View file

@ -113,7 +113,7 @@ export default class Onboarding extends Block {
if (this.data && this.data.onboarding_name) {
let has_data = this.make("onboarding", this.data.onboarding_name);
if (!has_data) return;
if (!has_data) return this.wrapper;
}
if (!this.readOnly) {

View file

@ -33,7 +33,7 @@ export default class QuickList extends Block {
if (this.data && this.data.quick_list_name) {
let has_data = this.make("quick_list", this.data.quick_list_name);
if (!has_data) return;
if (!has_data) return this.wrapper;
}
if (!this.readOnly) {

View file

@ -52,7 +52,7 @@ export default class Shortcut extends Block {
if (this.data && this.data.shortcut_name) {
let has_data = this.make("shortcut", this.data.shortcut_name);
if (!has_data) return;
if (!has_data) return this.wrapper;
}
if (!this.readOnly) {

View file

@ -20,7 +20,7 @@
},
"homepage": "https://frappeframework.com",
"dependencies": {
"@editorjs/editorjs": "~2.26.3",
"@editorjs/editorjs": "^2.28.2",
"@frappe/esbuild-plugin-postcss2": "^0.1.3",
"@headlessui/vue": "^1.7.16",
"@popperjs/core": "^2.11.2",

View file

@ -31,21 +31,10 @@
"@babel/helper-validator-identifier" "^7.22.20"
to-fast-properties "^2.0.0"
"@codexteam/icons@0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@codexteam/icons/-/icons-0.1.0.tgz#a02885fe8699f69902d05b077b5f1cd48a2ca6b9"
integrity sha512-jW1fWnwtWzcP4FBGsaodbJY3s1ZaRU+IJy1pvJ7ygNQxkQinybJcwXoyt0a5mWwu/4w30A42EWhCrZn8lp4fdw==
"@editorjs/editorjs@~2.26.3":
version "2.26.5"
resolved "https://registry.yarnpkg.com/@editorjs/editorjs/-/editorjs-2.26.5.tgz#ee0f1dbd3a3c6ba97d3ed30f13ab7d2e7b29dbe4"
integrity sha512-imwXZi9NmzxKjNosa1xQf286liJYsTe2J2DWCiV5TwKhvYZ1INg5Y+FietcM2v65QmeLqP7wgBUhoI7wiCB+yQ==
dependencies:
"@codexteam/icons" "0.1.0"
codex-notifier "^1.1.2"
codex-tooltip "^1.0.5"
html-janitor "^2.0.4"
nanoid "^3.1.22"
"@editorjs/editorjs@^2.28.2":
version "2.28.2"
resolved "https://registry.yarnpkg.com/@editorjs/editorjs/-/editorjs-2.28.2.tgz#a265c7d10e83adef81813e4dc0f01fe3464dff50"
integrity sha512-g6V0Nd3W9IIWMpvxDNTssQ6e4kxBp1Y0W4GIf8cXRlmcBp3TUjrgCYJQmNy3l2a6ZzhyBAoVSe8krJEq4g7PQw==
"@esbuild/linux-loong64@0.14.54":
version "0.14.54"
@ -680,16 +669,6 @@ cluster-key-slot@1.1.2:
resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz#88ddaa46906e303b5de30d3153b7d9fe0a0c19ac"
integrity sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==
codex-notifier@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/codex-notifier/-/codex-notifier-1.1.2.tgz#a733079185f4c927fa296f1d71eb8753fe080895"
integrity sha512-DCp6xe/LGueJ1N5sXEwcBc3r3PyVkEEDNWCVigfvywAkeXcZMk9K41a31tkEFBW0Ptlwji6/JlAb49E3Yrxbtg==
codex-tooltip@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/codex-tooltip/-/codex-tooltip-1.0.5.tgz#ba25fd5b3a58ba2f73fd667c2b46987ffd1edef2"
integrity sha512-IuA8LeyLU5p1B+HyhOsqR6oxyFQ11k3i9e9aXw40CrHFTRO2Y1npNBVU3W1SvhKAbUU7R/YikUBdcYFP0RcJag==
color-convert@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
@ -1704,11 +1683,6 @@ homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1:
dependencies:
parse-passwd "^1.0.0"
html-janitor@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/html-janitor/-/html-janitor-2.0.4.tgz#ae5a115cdf3331cd5501edd7b5471b18ea44cdbb"
integrity sha512-92J5h9jNZRk30PMHapjHEJfkrBWKCOy0bq3oW2pBungky6lzYSoboBGPMvxl1XRKB2q+kniQmsLsPbdpY7RM2g==
html5-qrcode@^2.3.8:
version "2.3.8"
resolved "https://registry.yarnpkg.com/html5-qrcode/-/html5-qrcode-2.3.8.tgz#0b0cdf7a9926cfd4be530e13a51db47592adfa0d"
@ -2263,7 +2237,7 @@ ms@^2.1.1:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
nanoid@^3.1.22, nanoid@^3.3.6:
nanoid@^3.3.6:
version "3.3.7"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==