Skip to content

Commit e17334e

Browse files
authored
fix(cli): keep the rich text editor working in newly created blocks (#1705)
1 parent e5ee9b4 commit e17334e

7 files changed

Lines changed: 120 additions & 29 deletions

File tree

‎.changeset/gentle-otters-wander.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@frontify/frontify-cli": patch
3+
---
4+
5+
fix(templates): keep the rich text editor working in newly created blocks
6+
7+
Blocks created with `frontify-cli create` crashed with `Cannot read properties of undefined (reading 'slice')` as soon as a rich text editor was switched to edit mode. The block templates now pin the Slate packages that Fondue's rich text editor expects, so new blocks render and edit rich text again. They also ship with `@frontify/app-bridge` `^3.12.10` and `@frontify/guideline-blocks-settings` `^3.0.7` (previously `3.12.9` and `2.1.11`) and current tooling. Installing with npm no longer warns about unapproved install scripts, and installing with pnpm no longer fails on them.

‎packages/cli/templates/content-block-css-modules/package.json‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,39 @@
1111
"typecheck": "tsc --noEmit"
1212
},
1313
"dependencies": {
14-
"@frontify/app-bridge": "^3.12.9",
15-
"@frontify/guideline-blocks-settings": "2.1.11",
14+
"@frontify/app-bridge": "^3.12.10",
15+
"@frontify/guideline-blocks-settings": "^3.0.7",
1616
"react": "^18.3.1",
1717
"react-dom": "^18.3.1"
1818
},
1919
"devDependencies": {
2020
"@frontify/eslint-config-react": "1.0.16",
21-
"@frontify/frontify-cli": "^6.2.0",
22-
"@types/react": "^18.3.27",
21+
"@frontify/frontify-cli": "^6.4.1",
22+
"@types/react": "^18.3.31",
2323
"@types/react-dom": "^18.3.7",
24-
"eslint": "^10.2.1",
25-
"prettier": "^3.8.3",
26-
"terser": "^5.46.1",
24+
"eslint": "^10.12.0",
25+
"prettier": "^3.9.10",
26+
"terser": "^5.51.2",
2727
"typescript": "^6.0.3"
2828
},
2929
"overrides": {
3030
"@udecode/plate-common": "36.5.9",
31-
"zustand": "4.5.7"
31+
"zustand": "4.5.7",
32+
"slate": "0.102.0",
33+
"slate-react": "0.102.0",
34+
"slate-history": "0.100.0",
35+
"slate-hyperscript": "0.100.0"
3236
},
3337
"resolutions": {
3438
"@udecode/plate-common": "36.5.9",
35-
"zustand": "4.5.7"
39+
"zustand": "4.5.7",
40+
"slate": "0.102.0",
41+
"slate-react": "0.102.0",
42+
"slate-history": "0.100.0",
43+
"slate-hyperscript": "0.100.0"
44+
},
45+
"allowScripts": {
46+
"esbuild": true,
47+
"unrs-resolver": true
3648
}
3749
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Only used by pnpm. Safe to delete if you install with npm or yarn.
2+
# Allows the esbuild and unrs-resolver postinstall scripts (pnpm v10: onlyBuiltDependencies, v11: allowBuilds).
3+
onlyBuiltDependencies:
4+
- esbuild
5+
- unrs-resolver
6+
allowBuilds:
7+
esbuild: true
8+
unrs-resolver: true
9+
# Keeps Fondue's rich text editor dependencies on compatible versions (npm and yarn read these from package.json).
10+
overrides:
11+
'@udecode/plate-common': 36.5.9
12+
zustand: 4.5.7
13+
slate: 0.102.0
14+
slate-react: 0.102.0
15+
slate-history: 0.100.0
16+
slate-hyperscript: 0.100.0

‎packages/cli/templates/content-block-css/package.json‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,39 @@
1111
"typecheck": "tsc --noEmit"
1212
},
1313
"dependencies": {
14-
"@frontify/app-bridge": "^3.12.9",
15-
"@frontify/guideline-blocks-settings": "2.1.11",
14+
"@frontify/app-bridge": "^3.12.10",
15+
"@frontify/guideline-blocks-settings": "^3.0.7",
1616
"react": "^18.3.1",
1717
"react-dom": "^18.3.1"
1818
},
1919
"devDependencies": {
2020
"@frontify/eslint-config-react": "1.0.16",
21-
"@frontify/frontify-cli": "^6.2.0",
22-
"@types/react": "^18.3.27",
21+
"@frontify/frontify-cli": "^6.4.1",
22+
"@types/react": "^18.3.31",
2323
"@types/react-dom": "^18.3.7",
24-
"eslint": "^10.2.1",
25-
"prettier": "^3.8.3",
26-
"terser": "^5.46.1",
24+
"eslint": "^10.12.0",
25+
"prettier": "^3.9.10",
26+
"terser": "^5.51.2",
2727
"typescript": "^6.0.3"
2828
},
2929
"overrides": {
3030
"@udecode/plate-common": "36.5.9",
31-
"zustand": "4.5.7"
31+
"zustand": "4.5.7",
32+
"slate": "0.102.0",
33+
"slate-react": "0.102.0",
34+
"slate-history": "0.100.0",
35+
"slate-hyperscript": "0.100.0"
3236
},
3337
"resolutions": {
3438
"@udecode/plate-common": "36.5.9",
35-
"zustand": "4.5.7"
39+
"zustand": "4.5.7",
40+
"slate": "0.102.0",
41+
"slate-react": "0.102.0",
42+
"slate-history": "0.100.0",
43+
"slate-hyperscript": "0.100.0"
44+
},
45+
"allowScripts": {
46+
"esbuild": true,
47+
"unrs-resolver": true
3648
}
3749
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Only used by pnpm. Safe to delete if you install with npm or yarn.
2+
# Allows the esbuild and unrs-resolver postinstall scripts (pnpm v10: onlyBuiltDependencies, v11: allowBuilds).
3+
onlyBuiltDependencies:
4+
- esbuild
5+
- unrs-resolver
6+
allowBuilds:
7+
esbuild: true
8+
unrs-resolver: true
9+
# Keeps Fondue's rich text editor dependencies on compatible versions (npm and yarn read these from package.json).
10+
overrides:
11+
'@udecode/plate-common': 36.5.9
12+
zustand: 4.5.7
13+
slate: 0.102.0
14+
slate-react: 0.102.0
15+
slate-history: 0.100.0
16+
slate-hyperscript: 0.100.0

‎packages/cli/templates/content-block-tailwind/package.json‎

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,42 @@
1111
"typecheck": "tsc --noEmit"
1212
},
1313
"dependencies": {
14-
"@frontify/app-bridge": "^3.12.9",
15-
"@frontify/guideline-blocks-settings": "2.1.11",
14+
"@frontify/app-bridge": "^3.12.10",
15+
"@frontify/guideline-blocks-settings": "^3.0.7",
1616
"react": "^18.3.1",
1717
"react-dom": "^18.3.1"
1818
},
1919
"devDependencies": {
2020
"@frontify/eslint-config-react": "1.0.16",
21-
"@frontify/frontify-cli": "^6.2.0",
22-
"@types/react": "^18.3.27",
21+
"@frontify/frontify-cli": "^6.4.1",
22+
"@types/react": "^18.3.31",
2323
"@types/react-dom": "^18.3.7",
24-
"autoprefixer": "^10.5.0",
25-
"eslint": "^10.2.1",
26-
"postcss": "^8.5.10",
27-
"prettier": "^3.8.3",
24+
"autoprefixer": "^10.6.1",
25+
"eslint": "^10.12.0",
26+
"postcss": "^8.5.30",
27+
"prettier": "^3.9.10",
2828
"tailwindcss": "^3.4.19",
29-
"terser": "^5.46.1",
29+
"terser": "^5.51.2",
3030
"typescript": "^6.0.3"
3131
},
3232
"overrides": {
3333
"@udecode/plate-common": "36.5.9",
34-
"zustand": "4.5.7"
34+
"zustand": "4.5.7",
35+
"slate": "0.102.0",
36+
"slate-react": "0.102.0",
37+
"slate-history": "0.100.0",
38+
"slate-hyperscript": "0.100.0"
3539
},
3640
"resolutions": {
3741
"@udecode/plate-common": "36.5.9",
38-
"zustand": "4.5.7"
42+
"zustand": "4.5.7",
43+
"slate": "0.102.0",
44+
"slate-react": "0.102.0",
45+
"slate-history": "0.100.0",
46+
"slate-hyperscript": "0.100.0"
47+
},
48+
"allowScripts": {
49+
"esbuild": true,
50+
"unrs-resolver": true
3951
}
4052
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Only used by pnpm. Safe to delete if you install with npm or yarn.
2+
# Allows the esbuild and unrs-resolver postinstall scripts (pnpm v10: onlyBuiltDependencies, v11: allowBuilds).
3+
onlyBuiltDependencies:
4+
- esbuild
5+
- unrs-resolver
6+
allowBuilds:
7+
esbuild: true
8+
unrs-resolver: true
9+
# Keeps Fondue's rich text editor dependencies on compatible versions (npm and yarn read these from package.json).
10+
overrides:
11+
'@udecode/plate-common': 36.5.9
12+
zustand: 4.5.7
13+
slate: 0.102.0
14+
slate-react: 0.102.0
15+
slate-history: 0.100.0
16+
slate-hyperscript: 0.100.0

0 commit comments

Comments
 (0)