oipage 1.8.0-alpha.0 → 1.8.0

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.
Files changed (93) hide show
  1. package/.github/FUNDING.yml +11 -11
  2. package/AUTHORS.txt +6 -6
  3. package/CHANGELOG +3 -2
  4. package/LICENSE +20 -20
  5. package/bin/WebSocket/decodeWsFrame.js +43 -43
  6. package/bin/WebSocket/encodeWsFrame.js +28 -28
  7. package/bin/WebSocket/headersToJSON.js +26 -26
  8. package/bin/WebSocket/index.js +80 -80
  9. package/bin/data/mineTypes.json +104 -104
  10. package/bin/disk.js +42 -42
  11. package/bin/intercept.js +15 -15
  12. package/bin/network.js +21 -21
  13. package/bin/run +4 -1
  14. package/bin/serve.js +4 -4
  15. package/bin/template/404.html +186 -186
  16. package/bin/tools/deleteEmptyFolder.js +23 -23
  17. package/bin/tools/format.js +75 -75
  18. package/bin/tools/network.js +42 -42
  19. package/bin/tools/resolve404.js +83 -83
  20. package/bin/tools/resolveImport.js +88 -88
  21. package/bin/website-htmls/components/ui-select-file/index.html +7 -7
  22. package/bin/website-htmls/components/ui-select-file/index.js +37 -37
  23. package/bin/website-htmls/components/ui-select-file/index.scss +44 -44
  24. package/bin/website-htmls/dialogs/imageSize/index.html +54 -54
  25. package/bin/website-htmls/dialogs/imageSize/index.js +53 -53
  26. package/bin/website-htmls/dialogs/imageSize/index.scss +138 -138
  27. package/bin/website-htmls/dialogs/index.js +52 -52
  28. package/bin/website-htmls/images/addFile.svg +1 -1
  29. package/bin/website-htmls/images/img-to-pdf.svg +1 -1
  30. package/bin/website-htmls/index.html +17 -17
  31. package/bin/website-htmls/main.js +13 -13
  32. package/bin/website-htmls/pages/App/index.html +6 -6
  33. package/bin/website-htmls/pages/App/index.js +22 -22
  34. package/bin/website-htmls/pages/App/index.scss +43 -43
  35. package/bin/website-htmls/pages/appStore/index.html +5 -5
  36. package/bin/website-htmls/pages/appStore/index.js +19 -19
  37. package/bin/website-htmls/pages/chart/index.html +8 -8
  38. package/bin/website-htmls/pages/chart/index.js +72 -72
  39. package/bin/website-htmls/pages/chart/index.scss +73 -73
  40. package/bin/website-htmls/pages/home/index.html +21 -21
  41. package/bin/website-htmls/pages/home/index.js +19 -19
  42. package/bin/website-htmls/pages/image-editor/index.html +27 -27
  43. package/bin/website-htmls/pages/image-editor/index.js +106 -106
  44. package/bin/website-htmls/pages/image-editor/index.scss +47 -47
  45. package/bin/website-htmls/pages/img-to-pdf/index.html +3 -3
  46. package/bin/website-htmls/pages/img-to-pdf/index.js +44 -44
  47. package/bin/website-htmls/pages/img-to-pdf/index.scss +4 -4
  48. package/bin/website-htmls/router.config.js +26 -26
  49. package/bin/website-htmls/styles/normalize.css +94 -94
  50. package/bin/website-plugins/intercept/chart.js +33 -33
  51. package/bin/website-plugins/intercept/getPackage.js +17 -17
  52. package/bin/website-plugins/intercept/head.js +8 -8
  53. package/bin/website-plugins/intercept/index.js +8 -8
  54. package/bin/website-plugins/intercept/oipage-vislite-intercept.js +30 -30
  55. package/bin/website-plugins/intercept/oipage-zipaper-intercept.js +36 -36
  56. package/bin/website-plugins/loader/index.js +11 -11
  57. package/bin/website-plugins/loader/oipage-html-loader.js +7 -7
  58. package/bin/website-plugins/loader/oipage-scss-loader.js +149 -149
  59. package/nodejs/animation/index.d.ts +19 -19
  60. package/nodejs/animation/index.js +120 -112
  61. package/nodejs/cmdlog/index.d.ts +20 -20
  62. package/nodejs/cmdlog/index.js +75 -75
  63. package/nodejs/disk/index.d.ts +47 -47
  64. package/nodejs/disk/index.js +166 -165
  65. package/nodejs/format/index.d.ts +29 -29
  66. package/nodejs/format/index.js +107 -107
  67. package/nodejs/json/index.d.ts +9 -9
  68. package/nodejs/json/index.js +206 -206
  69. package/nodejs/logform/index.d.ts +18 -18
  70. package/nodejs/logform/index.js +94 -94
  71. package/nodejs/reader/index.d.ts +32 -32
  72. package/nodejs/reader/index.js +20 -20
  73. package/nodejs/throttle/index.d.ts +30 -30
  74. package/nodejs/throttle/index.js +50 -50
  75. package/package.json +3 -3
  76. package/web/XMLHttpRequest/index.d.ts +17 -17
  77. package/web/XMLHttpRequest/index.js +60 -60
  78. package/web/animation/index.d.ts +19 -19
  79. package/web/animation/index.js +120 -112
  80. package/web/format/index.d.ts +29 -29
  81. package/web/format/index.js +107 -107
  82. package/web/json/index.d.ts +9 -9
  83. package/web/json/index.js +206 -206
  84. package/web/onReady/index.d.ts +7 -7
  85. package/web/onReady/index.js +8 -8
  86. package/web/performChunk/index.d.ts +4 -4
  87. package/web/performChunk/index.js +19 -19
  88. package/web/reader/index.d.ts +32 -32
  89. package/web/reader/index.js +20 -20
  90. package/web/style/index.d.ts +21 -21
  91. package/web/style/index.js +19 -19
  92. package/web/throttle/index.d.ts +30 -30
  93. package/web/throttle/index.js +50 -50
@@ -1,44 +1,44 @@
1
- #dialog-root {
2
- width: 0;
3
- height: 0;
4
- position: fixed;
5
- left: 0;
6
- top: 0;
7
- z-index: 101;
8
-
9
- .mask {
10
- width: 100vw;
11
- height: 100vh;
12
- background-color: #0000004f;
13
-
14
- &:last-child {
15
- display: none;
16
- }
17
- }
18
-
19
- .content {
20
- display: none;
21
- position: absolute;
22
- left: 50vw;
23
- top: 50vh;
24
- transform: translateX(-50%) translateY(-50%);
25
-
26
- &:last-child {
27
- display: block;
28
- }
29
- }
30
- }
31
-
32
- .fork {
33
- line-height: 30px;
34
- position: fixed;
35
- background-color: #607D8B;
36
- text-align: center;
37
- color: white;
38
- outline: 2px dashed #607D8B;
39
- width: 200px;
40
- transform: rotate(45deg);
41
- right: -45px;
42
- top: 45px;
43
- z-index: 1;
1
+ #dialog-root {
2
+ width: 0;
3
+ height: 0;
4
+ position: fixed;
5
+ left: 0;
6
+ top: 0;
7
+ z-index: 101;
8
+
9
+ .mask {
10
+ width: 100vw;
11
+ height: 100vh;
12
+ background-color: #0000004f;
13
+
14
+ &:last-child {
15
+ display: none;
16
+ }
17
+ }
18
+
19
+ .content {
20
+ display: none;
21
+ position: absolute;
22
+ left: 50vw;
23
+ top: 50vh;
24
+ transform: translateX(-50%) translateY(-50%);
25
+
26
+ &:last-child {
27
+ display: block;
28
+ }
29
+ }
30
+ }
31
+
32
+ .fork {
33
+ line-height: 30px;
34
+ position: fixed;
35
+ background-color: #607D8B;
36
+ text-align: center;
37
+ color: white;
38
+ outline: 2px dashed #607D8B;
39
+ width: 200px;
40
+ transform: rotate(45deg);
41
+ right: -45px;
42
+ top: 45px;
43
+ z-index: 1;
44
44
  }
@@ -1,6 +1,6 @@
1
- <div class="appstore-view">
2
- <header>
3
- 应用市场
4
- </header>
5
- <router></router>
1
+ <div class="appstore-view">
2
+ <header>
3
+ 应用市场
4
+ </header>
5
+ <router></router>
6
6
  </div>
@@ -1,20 +1,20 @@
1
- import { defineElement, ref } from "zipaper"
2
- import template from "./index.html"
3
- import style from "./index.scss"
4
-
5
- export default defineElement({
6
- template,
7
- data() {
8
- return {
9
-
10
- }
11
- },
12
- methods: {
13
- goto(event, target) {
14
- this.$goto("/" + target.getAttribute("tag"))
15
- }
16
- },
17
- style: {
18
- content: style
19
- }
1
+ import { defineElement, ref } from "zipaper"
2
+ import template from "./index.html"
3
+ import style from "./index.scss"
4
+
5
+ export default defineElement({
6
+ template,
7
+ data() {
8
+ return {
9
+
10
+ }
11
+ },
12
+ methods: {
13
+ goto(event, target) {
14
+ this.$goto("/" + target.getAttribute("tag"))
15
+ }
16
+ },
17
+ style: {
18
+ content: style
19
+ }
20
20
  })
@@ -1,9 +1,9 @@
1
- <form z-on:submit.prevent="doSubmit">
2
- <div class="chart-view">
3
- <div class="content" id="chart-content-id"></div>
4
- <div class="input">
5
- <input placeholder="请输入内容......" z-model="msg" spellcheck="false" autocomplete="off" />
6
- <button type="submit">发送</button>
7
- </div>
8
- </div>
1
+ <form z-on:submit.prevent="doSubmit">
2
+ <div class="chart-view">
3
+ <div class="content" id="chart-content-id"></div>
4
+ <div class="input">
5
+ <input placeholder="请输入内容......" z-model="msg" spellcheck="false" autocomplete="off" />
6
+ <button type="submit">发送</button>
7
+ </div>
8
+ </div>
9
9
  </form>
@@ -1,73 +1,73 @@
1
- import { defineElement, ref } from "zipaper"
2
- import template from "./index.html"
3
- import style from "./index.scss"
4
-
5
- export default defineElement({
6
- template,
7
- data() {
8
- return {
9
- uniqueid: new Date().valueOf() + "#" + (Math.random() * 10000).toFixed(0),
10
- msg: ref("")
11
- }
12
- },
13
- created() {
14
-
15
- let ws = new WebSocket('ws://' + window.location.hostname + ':' + (+window.location.port + 1) + '/');
16
-
17
- // 连接成功
18
- ws.addEventListener('open', () => {
19
- ws.send('客户端和服务器建立连接成功!(' + this.uniqueid + ')');
20
- });
21
-
22
- // 监听来自服务器的数据
23
- ws.addEventListener('message', (event) => {
24
- let data = JSON.parse(event.data);
25
-
26
- let contentEl = document.getElementById("chart-content-id");
27
-
28
- let itemEl = document.createElement("div");
29
- contentEl.appendChild(itemEl);
30
-
31
- itemEl.setAttribute("class", "item");
32
-
33
- if (data.uniqueid === this.uniqueid) {
34
- itemEl.setAttribute("tag", "sender");
35
- } else {
36
- itemEl.setAttribute("tag", "receiver");
37
- }
38
-
39
- let textEl = document.createElement("div");
40
- textEl.innerText = data.msg;
41
- itemEl.appendChild(textEl);
42
- textEl.setAttribute("class", "text");
43
-
44
- itemEl.scrollIntoView({
45
- behavior: 'smooth',
46
- block: 'end',
47
- inline: 'nearest'
48
- });
49
- });
50
-
51
- },
52
- methods: {
53
- doSubmit() {
54
- fetch("./chart/sendMsg", {
55
- method: "POST",
56
- headers: {
57
- "Content-Type": "application/json;charset=utf-8"
58
- },
59
- body: JSON.stringify({
60
- msg: this.msg,
61
- uniqueid: this.uniqueid
62
- })
63
- }).then(() => {
64
- this.msg = "";
65
- }).catch(() => {
66
- alert("发送失败!");
67
- });
68
- }
69
- },
70
- style: {
71
- content: style
72
- }
1
+ import { defineElement, ref } from "zipaper"
2
+ import template from "./index.html"
3
+ import style from "./index.scss"
4
+
5
+ export default defineElement({
6
+ template,
7
+ data() {
8
+ return {
9
+ uniqueid: new Date().valueOf() + "#" + (Math.random() * 10000).toFixed(0),
10
+ msg: ref("")
11
+ }
12
+ },
13
+ created() {
14
+
15
+ let ws = new WebSocket('ws://' + window.location.hostname + ':' + (+window.location.port + 1) + '/');
16
+
17
+ // 连接成功
18
+ ws.addEventListener('open', () => {
19
+ ws.send('客户端和服务器建立连接成功!(' + this.uniqueid + ')');
20
+ });
21
+
22
+ // 监听来自服务器的数据
23
+ ws.addEventListener('message', (event) => {
24
+ let data = JSON.parse(event.data);
25
+
26
+ let contentEl = document.getElementById("chart-content-id");
27
+
28
+ let itemEl = document.createElement("div");
29
+ contentEl.appendChild(itemEl);
30
+
31
+ itemEl.setAttribute("class", "item");
32
+
33
+ if (data.uniqueid === this.uniqueid) {
34
+ itemEl.setAttribute("tag", "sender");
35
+ } else {
36
+ itemEl.setAttribute("tag", "receiver");
37
+ }
38
+
39
+ let textEl = document.createElement("div");
40
+ textEl.innerText = data.msg;
41
+ itemEl.appendChild(textEl);
42
+ textEl.setAttribute("class", "text");
43
+
44
+ itemEl.scrollIntoView({
45
+ behavior: 'smooth',
46
+ block: 'end',
47
+ inline: 'nearest'
48
+ });
49
+ });
50
+
51
+ },
52
+ methods: {
53
+ doSubmit() {
54
+ fetch("./chart/sendMsg", {
55
+ method: "POST",
56
+ headers: {
57
+ "Content-Type": "application/json;charset=utf-8"
58
+ },
59
+ body: JSON.stringify({
60
+ msg: this.msg,
61
+ uniqueid: this.uniqueid
62
+ })
63
+ }).then(() => {
64
+ this.msg = "";
65
+ }).catch(() => {
66
+ alert("发送失败!");
67
+ });
68
+ }
69
+ },
70
+ style: {
71
+ content: style
72
+ }
73
73
  })
@@ -1,74 +1,74 @@
1
- .chart-view {
2
- &>.content {
3
- position: fixed;
4
- width: 350px;
5
- height: calc(100% - 150px);
6
- border: 2px solid #000000;
7
- left: 50%;
8
- top: 100px;
9
- transform: translateX(-50%);
10
- padding: 5px;
11
- overflow: auto;
12
- border-radius: 10px 10px 0 0;
13
-
14
- &::-webkit-scrollbar {
15
- width: 0;
16
- height: 0;
17
- }
18
-
19
- &>.item {
20
- display: flex;
21
- padding: 5px;
22
-
23
- &[tag="sender"] {
24
- flex-direction: row-reverse;
25
- padding-left: 50px;
26
- }
27
-
28
- &[tag="receiver"] {
29
- flex-direction: row;
30
- padding-right: 50px;
31
- }
32
-
33
- &>.text {
34
- background-color: #dfdbdb;
35
- padding: 5px;
36
- width: fit-content;
37
- border-radius: 5px;
38
- font-size: 12px;
39
- }
40
- }
41
- }
42
-
43
- &>.input {
44
- position: fixed;
45
- width: 350px;
46
- height: 30px;
47
- left: 50%;
48
- bottom: 50px;
49
- transform: translateX(-50%);
50
- display: flex;
51
-
52
- &>input {
53
- flex-grow: 1;
54
- resize: none;
55
- outline: none;
56
- border: 2px solid #000000;
57
- border-top-width: 0;
58
- border-radius: 0;
59
- }
60
-
61
- &>button {
62
- width: 70px;
63
- cursor: pointer;
64
- background-color: #000000;
65
- color: white;
66
- outline: none;
67
- border: none;
68
-
69
- &:hover {
70
- text-decoration: underline;
71
- }
72
- }
73
- }
1
+ .chart-view {
2
+ &>.content {
3
+ position: fixed;
4
+ width: 350px;
5
+ height: calc(100% - 150px);
6
+ border: 2px solid #000000;
7
+ left: 50%;
8
+ top: 100px;
9
+ transform: translateX(-50%);
10
+ padding: 5px;
11
+ overflow: auto;
12
+ border-radius: 10px 10px 0 0;
13
+
14
+ &::-webkit-scrollbar {
15
+ width: 0;
16
+ height: 0;
17
+ }
18
+
19
+ &>.item {
20
+ display: flex;
21
+ padding: 5px;
22
+
23
+ &[tag="sender"] {
24
+ flex-direction: row-reverse;
25
+ padding-left: 50px;
26
+ }
27
+
28
+ &[tag="receiver"] {
29
+ flex-direction: row;
30
+ padding-right: 50px;
31
+ }
32
+
33
+ &>.text {
34
+ background-color: #dfdbdb;
35
+ padding: 5px;
36
+ width: fit-content;
37
+ border-radius: 5px;
38
+ font-size: 12px;
39
+ }
40
+ }
41
+ }
42
+
43
+ &>.input {
44
+ position: fixed;
45
+ width: 350px;
46
+ height: 30px;
47
+ left: 50%;
48
+ bottom: 50px;
49
+ transform: translateX(-50%);
50
+ display: flex;
51
+
52
+ &>input {
53
+ flex-grow: 1;
54
+ resize: none;
55
+ outline: none;
56
+ border: 2px solid #000000;
57
+ border-top-width: 0;
58
+ border-radius: 0;
59
+ }
60
+
61
+ &>button {
62
+ width: 70px;
63
+ cursor: pointer;
64
+ background-color: #000000;
65
+ color: white;
66
+ outline: none;
67
+ border: none;
68
+
69
+ &:hover {
70
+ text-decoration: underline;
71
+ }
72
+ }
73
+ }
74
74
  }
@@ -1,22 +1,22 @@
1
- <div class="home-view">
2
- <ul>
3
- <li z-on:click.prevent="goto" tag="chart">
4
- <img src="./images/chart.png" />
5
- <h2>
6
- 群聊天
7
- </h2>
8
- </li>
9
- <li z-on:click="goto" tag="image-editor">
10
- <img src="./images/image-editor.png" />
11
- <h2>
12
- 图片编辑器
13
- </h2>
14
- </li>
15
- <li z-on:click="goto" tag="img-to-pdf">
16
- <img src="./images/img-to-pdf.svg" />
17
- <h2>
18
- 图片转PDF
19
- </h2>
20
- </li>
21
- </ul>
1
+ <div class="home-view">
2
+ <ul>
3
+ <li z-on:click.prevent="goto" tag="chart">
4
+ <img src="./images/chart.png" />
5
+ <h2>
6
+ 群聊天
7
+ </h2>
8
+ </li>
9
+ <li z-on:click="goto" tag="image-editor">
10
+ <img src="./images/image-editor.png" />
11
+ <h2>
12
+ 图片编辑器
13
+ </h2>
14
+ </li>
15
+ <li z-on:click="goto" tag="img-to-pdf">
16
+ <img src="./images/img-to-pdf.svg" />
17
+ <h2>
18
+ 图片转PDF
19
+ </h2>
20
+ </li>
21
+ </ul>
22
22
  </div>
@@ -1,20 +1,20 @@
1
- import { defineElement, ref } from "zipaper"
2
- import template from "./index.html"
3
- import style from "./index.scss"
4
-
5
- export default defineElement({
6
- template,
7
- data() {
8
- return {
9
-
10
- }
11
- },
12
- methods: {
13
- goto(event, target) {
14
- this.$goto("/appStore/" + target.getAttribute("tag"))
15
- }
16
- },
17
- style: {
18
- content: style
19
- }
1
+ import { defineElement, ref } from "zipaper"
2
+ import template from "./index.html"
3
+ import style from "./index.scss"
4
+
5
+ export default defineElement({
6
+ template,
7
+ data() {
8
+ return {
9
+
10
+ }
11
+ },
12
+ methods: {
13
+ goto(event, target) {
14
+ this.$goto("/appStore/" + target.getAttribute("tag"))
15
+ }
16
+ },
17
+ style: {
18
+ content: style
19
+ }
20
20
  })
@@ -1,28 +1,28 @@
1
- <div class="image-editor-view">
2
- <ul class="menu">
3
- <li>
4
- <label for="openImage">打开</label>
5
- </li>
6
- <li>
7
- <label z-on:click="changeSize">画布大小</label>
8
- </li>
9
- <li>
10
- <label z-on:click="changeSize">图像大小</label>
11
- </li>
12
- <li>
13
- <label z-on:click="download" type="jpeg">下载JPEG</label>
14
- </li>
15
- <li>
16
- <label z-on:click="download" type="png">下载PNG</label>
17
- </li>
18
- </ul>
19
- <div class="content">
20
- <div id="drawId"></div>
21
- </div>
22
- <div class="no-view">
23
-
24
- <!-- 选择图片 -->
25
- <input type="file" id="openImage" z-on:change="openImage" accept="image/*" />
26
-
27
- </div>
1
+ <div class="image-editor-view">
2
+ <ul class="menu">
3
+ <li>
4
+ <label for="openImage">打开</label>
5
+ </li>
6
+ <li>
7
+ <label z-on:click="changeSize">画布大小</label>
8
+ </li>
9
+ <li>
10
+ <label z-on:click="changeSize">图像大小</label>
11
+ </li>
12
+ <li>
13
+ <label z-on:click="download" type="jpeg">下载JPEG</label>
14
+ </li>
15
+ <li>
16
+ <label z-on:click="download" type="png">下载PNG</label>
17
+ </li>
18
+ </ul>
19
+ <div class="content">
20
+ <div id="drawId"></div>
21
+ </div>
22
+ <div class="no-view">
23
+
24
+ <!-- 选择图片 -->
25
+ <input type="file" id="openImage" z-on:change="openImage" accept="image/*" />
26
+
27
+ </div>
28
28
  </div>