File tree 6 files changed +823
-562
lines changed
6 files changed +823
-562
lines changed Original file line number Diff line number Diff line change @@ -56,22 +56,6 @@ Copied block data by `ctrl+c` are not [validated](https://editorjs.io/blockapi#m
56
56
So copied block data and output block data may be different.
57
57
Please see also [ this comment] ( https://github.com/codex-team/editor.js/issues/1280#issuecomment-706482368 ) .
58
58
59
- ## < ; dialog> ; polyfill
60
-
61
- editorjs-layout uses ` <dialog> ` element and [ GoogleChrome/dialog-polyfill] ( https://github.com/GoogleChrome/dialog-polyfill ) .
62
- Please load ` dialog-polyfill.css ` in your document.
63
-
64
- ``` html
65
- <head >
66
- <link
67
- rel =" stylesheet"
68
- href =
" https://cdn.jsdelivr.net/npm/[email protected] /dist/dialog-polyfill.css"
69
- integrity =" sha256-hT0ET4tfm+7MyjeBepBgV2N5tOmsAVKcTWhH82jvoaA="
70
- crossorigin =" anonymous"
71
- />
72
- </head >
73
- ```
74
-
75
59
## Build
76
60
77
61
``` sh
Original file line number Diff line number Diff line change 2
2
< html >
3
3
< head >
4
4
< meta charset ="utf-8 " />
5
-
6
5
< title > editorjs-layout</ title >
7
-
8
- < link
9
- rel ="stylesheet "
10
- href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/dialog-polyfill.css "
11
- integrity ="sha256-hT0ET4tfm+7MyjeBepBgV2N5tOmsAVKcTWhH82jvoaA= "
12
- crossorigin ="anonymous "
13
- />
14
6
</ head >
15
7
16
8
< body >
162
154
document . querySelector ( "#button" ) . addEventListener ( "click" , async ( ) => {
163
155
const outputData = await editorJS . save ( ) ;
164
156
165
- document . querySelector ( "#output-data" ) . textContent = JSON . stringify (
166
- outputData
167
- ) ;
157
+ document . querySelector ( "#output-data" ) . textContent =
158
+ JSON . stringify ( outputData ) ;
168
159
} ) ;
169
160
170
161
new EditorJS ( {
Original file line number Diff line number Diff line change 36
36
},
37
37
"devDependencies" : {
38
38
"@types/uuid" : " ^8.3.0" ,
39
- "dialog-polyfill" : " ^0.5.6" ,
40
39
"ionicons" : " ^5.3.0" ,
41
40
"license-checker" : " ^25.0.1" ,
42
41
"prettier" : " ^2.2.1" ,
Original file line number Diff line number Diff line change 1
1
import type { OutputData } from "@editorjs/editorjs" ;
2
- import dialogPolyfill from "dialog-polyfill" ;
3
2
import { v4 as uuidv4 } from "uuid" ;
4
3
import type { LayoutBlockToolConfig } from "../LayoutBlockTool" ;
5
4
@@ -16,8 +15,6 @@ const createDialog = ({
16
15
} ) => {
17
16
const dialog = document . createElement ( "dialog" ) ;
18
17
19
- dialogPolyfill . registerDialog ( dialog ) ;
20
-
21
18
dialog . style . maxWidth = "960px" ;
22
19
// Make be not able to click inner
23
20
dialog . style . padding = "0" ;
@@ -41,6 +38,7 @@ const createDialog = ({
41
38
return ;
42
39
}
43
40
41
+ // @ts -expect-error
44
42
dialog . close ( ) ;
45
43
} ;
46
44
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ const renderItemContent = ({
49
49
} ) ;
50
50
51
51
document . body . append ( dialog ) ;
52
+ // @ts -expect-error
52
53
dialog . showModal ( ) ;
53
54
} ) ;
54
55
}
You can’t perform that action at this time.
0 commit comments