@lvce-editor/main-process 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@lvce-editor/main-process",
3
+ "version": "1.0.3",
4
+ "description": "",
5
+ "main": "dist/mainProcessMain.js",
6
+ "type": "module",
7
+ "keywords": [
8
+ "lvce-editor",
9
+ "electron"
10
+ ],
11
+ "author": "LVCE Editor",
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/lvce-editor/main-process.git"
16
+ },
17
+ "engines": {
18
+ "node": ">=22"
19
+ },
20
+ "dependencies": {
21
+ "electron": "33.2.1"
22
+ }
23
+ }
@@ -0,0 +1,18 @@
1
+ html,
2
+ body {
3
+ width: 100%;
4
+ height: 100%;
5
+ background: white;
6
+ margin: 0;
7
+ font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
8
+ }
9
+
10
+ body {
11
+ display: flex;
12
+ justify-content: center;
13
+ }
14
+
15
+ main {
16
+ padding: 0 10%;
17
+ margin-top: 14vh;
18
+ }
@@ -0,0 +1,11 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Error</title>
7
+ <link rel="stylesheet" href="error.css" />
8
+ <script type="module" src="error.js"></script>
9
+ </head>
10
+ <body></body>
11
+ </html>
@@ -0,0 +1,22 @@
1
+ import { getError } from './errorMessage.js'
2
+
3
+ const main = () => {
4
+ const { href } = location
5
+ const url = new URL(href)
6
+ const code = url.searchParams.get('code')
7
+ const error = getError(code)
8
+
9
+ const $Heading = document.createElement('h1')
10
+ $Heading.textContent = error.message
11
+
12
+ const $ErrorCode = document.createElement('div')
13
+ $ErrorCode.className = 'ErrorCode'
14
+ $ErrorCode.textContent = code
15
+
16
+ const $Main = document.createElement('main')
17
+ $Main.append($Heading, $ErrorCode)
18
+
19
+ document.body.append($Main)
20
+ }
21
+
22
+ main()
@@ -0,0 +1,26 @@
1
+ const knownErrors = [
2
+ {
3
+ code: 'ERR_SSL_PROTOCOL_ERROR',
4
+ message: 'This site can’t provide a secure connection',
5
+ },
6
+ {
7
+ code: 'ERR_NAME_NOT_RESOLVED',
8
+ message: 'This site can’t be reached',
9
+ },
10
+ {
11
+ code: 'ERR_CONNECTION_REFUSED',
12
+ message: "This site can't be reached",
13
+ },
14
+ ]
15
+
16
+ export const getError = (code) => {
17
+ for (const error of knownErrors) {
18
+ if (error.code === code) {
19
+ return error
20
+ }
21
+ }
22
+ return {
23
+ code,
24
+ message: 'Site could not be loaded',
25
+ }
26
+ }
@@ -0,0 +1,70 @@
1
+ body {
2
+ background: var(--MainBackground, white);
3
+ color: var(--TreeItemForeground, black);
4
+ margin: 0;
5
+ }
6
+
7
+ h1 {
8
+ margin: 20px 10px;
9
+ }
10
+
11
+ #ProcessExplorer {
12
+ white-space: nowrap;
13
+ border-collapse: collapse;
14
+ user-select: none;
15
+ }
16
+
17
+ #ProcessExplorer tr > td:not(:first-child),
18
+ #ProcessExplorer tr > th:not(:first-child) {
19
+ padding-left: 3ch;
20
+ text-align: right;
21
+ }
22
+
23
+ .ColumnProcessName {
24
+ min-width: 180px;
25
+ }
26
+
27
+ .Row {
28
+ contain: strict;
29
+ }
30
+
31
+ .Row:focused {
32
+ }
33
+
34
+ .Row[aria-expanded] td:first-child::before {
35
+ content: '';
36
+ width: 1em;
37
+ aspect-ratio: 1;
38
+ background: currentColor;
39
+ display: inline-block;
40
+ mask-image: url(../../../../static/icons/chevron-down.svg);
41
+ mask-repeat: no-repeat;
42
+ mask-position: center;
43
+ mask-size: 85%;
44
+ vertical-align: middle;
45
+ line-height: normal;
46
+ margin-right: 1px;
47
+ }
48
+
49
+ .Row[aria-expanded='false'] td:first-child::before {
50
+ mask-image: url(../../../../static/icons/chevron-right.svg);
51
+ }
52
+
53
+ .Row {
54
+ margin-left: 100px;
55
+ }
56
+
57
+ .Cell {
58
+ max-width: 50vw;
59
+ contain: content;
60
+ text-overflow: ellipsis;
61
+ }
62
+
63
+ .Row:focus,
64
+ .Cell:focus {
65
+ outline: var(--FocusOutline);
66
+ outline-offset: -1px;
67
+ outline-style: solid;
68
+ outline-width: 1px;
69
+ background-color: #405c50;
70
+ }
@@ -0,0 +1,32 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Process Explorer</title>
7
+ <link rel="stylesheet" href="/process-explorer/process-explorer-theme.css" />
8
+ <link rel="stylesheet" href="./process-explorer.css" />
9
+ </head>
10
+ <body>
11
+ <h1>Process Explorer</h1>
12
+
13
+ <table id="ProcessExplorer" role="treegrid" aria-label="Process Explorer" id="ProcessExplorer">
14
+ <colgroup>
15
+ <col class="ColumnProcessName" />
16
+ <col class="ColumnProcessId" />
17
+ <col class="ColumnMemory" />
18
+ </colgroup>
19
+ <thead>
20
+ <tr>
21
+ <th scope="col">Process Name</th>
22
+ <th scope="col">Id</th>
23
+ <th scope="col">Memory</th>
24
+ </tr>
25
+ </thead>
26
+ <tbody></tbody>
27
+ </table>
28
+
29
+ <output id="Output"></output>
30
+ <script src="./process-explorer.js"></script>
31
+ </body>
32
+ </html>