Skip to content

Commit 5d8cb8e

Browse files
committed
fix: Remove dialog-polyfill
1 parent fdffb4a commit 5d8cb8e

File tree

6 files changed

+823
-562
lines changed

6 files changed

+823
-562
lines changed

README.md

-16
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,6 @@ Copied block data by `ctrl+c` are not [validated](https://editorjs.io/blockapi#m
5656
So copied block data and output block data may be different.
5757
Please see also [this comment](https://github.com/codex-team/editor.js/issues/1280#issuecomment-706482368).
5858

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-
7559
## Build
7660

7761
```sh

docs/index.html

+2-11
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
65
<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-
/>
146
</head>
157

168
<body>
@@ -162,9 +154,8 @@
162154
document.querySelector("#button").addEventListener("click", async () => {
163155
const outputData = await editorJS.save();
164156

165-
document.querySelector("#output-data").textContent = JSON.stringify(
166-
outputData
167-
);
157+
document.querySelector("#output-data").textContent =
158+
JSON.stringify(outputData);
168159
});
169160

170161
new EditorJS({

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
},
3737
"devDependencies": {
3838
"@types/uuid": "^8.3.0",
39-
"dialog-polyfill": "^0.5.6",
4039
"ionicons": "^5.3.0",
4140
"license-checker": "^25.0.1",
4241
"prettier": "^2.2.1",

src/itemContent/createDialog.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { OutputData } from "@editorjs/editorjs";
2-
import dialogPolyfill from "dialog-polyfill";
32
import { v4 as uuidv4 } from "uuid";
43
import type { LayoutBlockToolConfig } from "../LayoutBlockTool";
54

@@ -16,8 +15,6 @@ const createDialog = ({
1615
}) => {
1716
const dialog = document.createElement("dialog");
1817

19-
dialogPolyfill.registerDialog(dialog);
20-
2118
dialog.style.maxWidth = "960px";
2219
// Make be not able to click inner
2320
dialog.style.padding = "0";
@@ -41,6 +38,7 @@ const createDialog = ({
4138
return;
4239
}
4340

41+
// @ts-expect-error
4442
dialog.close();
4543
};
4644

src/itemContent/itemContent.ts

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const renderItemContent = ({
4949
});
5050

5151
document.body.append(dialog);
52+
// @ts-expect-error
5253
dialog.showModal();
5354
});
5455
}

0 commit comments

Comments
 (0)