oipage 1.6.0 → 1.7.0-alpha.1

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 (96) hide show
  1. package/.github/FUNDING.yml +11 -11
  2. package/AUTHORS.txt +6 -6
  3. package/CHANGELOG +144 -137
  4. package/LICENSE +20 -20
  5. package/README.md +95 -95
  6. package/bin/WebSocket/decodeWsFrame.js +43 -43
  7. package/bin/WebSocket/encodeWsFrame.js +28 -28
  8. package/bin/WebSocket/headersToJSON.js +26 -26
  9. package/bin/WebSocket/index.js +80 -80
  10. package/bin/data/mineTypes.json +104 -104
  11. package/bin/disk.js +42 -42
  12. package/bin/help.js +43 -43
  13. package/bin/intercept.js +15 -15
  14. package/bin/network.js +21 -21
  15. package/bin/run +115 -115
  16. package/bin/serve.d.ts +55 -55
  17. package/bin/serve.js +158 -158
  18. package/bin/template/404.html +186 -186
  19. package/bin/tools/deleteEmptyFolder.js +23 -23
  20. package/bin/tools/format.js +75 -75
  21. package/bin/tools/network.js +42 -42
  22. package/bin/tools/resolve404.js +83 -83
  23. package/bin/tools/resolveImport.js +88 -88
  24. package/bin/website-htmls/components/ui-select-file/index.html +7 -7
  25. package/bin/website-htmls/components/ui-select-file/index.js +37 -37
  26. package/bin/website-htmls/components/ui-select-file/index.scss +44 -44
  27. package/bin/website-htmls/dialogs/imageSize/index.html +54 -54
  28. package/bin/website-htmls/dialogs/imageSize/index.js +53 -53
  29. package/bin/website-htmls/dialogs/imageSize/index.scss +138 -138
  30. package/bin/website-htmls/dialogs/index.js +52 -52
  31. package/bin/website-htmls/images/addFile.svg +1 -1
  32. package/bin/website-htmls/images/img-to-pdf.svg +1 -1
  33. package/bin/website-htmls/index.html +17 -17
  34. package/bin/website-htmls/main.js +13 -13
  35. package/bin/website-htmls/pages/App/index.html +6 -6
  36. package/bin/website-htmls/pages/App/index.js +22 -22
  37. package/bin/website-htmls/pages/App/index.scss +43 -43
  38. package/bin/website-htmls/pages/appStore/index.html +24 -24
  39. package/bin/website-htmls/pages/appStore/index.js +19 -19
  40. package/bin/website-htmls/pages/appStore/index.scss +41 -41
  41. package/bin/website-htmls/pages/chart/index.html +8 -8
  42. package/bin/website-htmls/pages/chart/index.js +72 -72
  43. package/bin/website-htmls/pages/chart/index.scss +72 -72
  44. package/bin/website-htmls/pages/image-editor/index.html +27 -27
  45. package/bin/website-htmls/pages/image-editor/index.js +106 -106
  46. package/bin/website-htmls/pages/image-editor/index.scss +45 -45
  47. package/bin/website-htmls/pages/img-to-pdf/index.html +3 -3
  48. package/bin/website-htmls/pages/img-to-pdf/index.js +44 -44
  49. package/bin/website-htmls/pages/img-to-pdf/index.scss +4 -4
  50. package/bin/website-htmls/router.config.js +19 -19
  51. package/bin/website-htmls/styles/normalize.css +94 -94
  52. package/bin/website-plugins/intercept/chart.js +33 -33
  53. package/bin/website-plugins/intercept/head.js +8 -8
  54. package/bin/website-plugins/intercept/index.js +8 -8
  55. package/bin/website-plugins/intercept/oipage-vislite-intercept.js +33 -33
  56. package/bin/website-plugins/intercept/oipage-zipaper-intercept.js +39 -39
  57. package/bin/website-plugins/loader/index.js +11 -11
  58. package/bin/website-plugins/loader/oipage-html-loader.js +7 -7
  59. package/bin/website-plugins/loader/oipage-scss-loader.js +149 -149
  60. package/nodejs/animation/index.d.ts +19 -19
  61. package/nodejs/animation/index.js +104 -104
  62. package/nodejs/cmdlog/index.d.ts +20 -20
  63. package/nodejs/cmdlog/index.js +75 -75
  64. package/nodejs/disk/index.d.ts +47 -47
  65. package/nodejs/disk/index.js +165 -165
  66. package/nodejs/format/index.d.ts +29 -29
  67. package/nodejs/format/index.js +107 -107
  68. package/nodejs/json/index.d.ts +9 -9
  69. package/nodejs/json/index.js +206 -206
  70. package/nodejs/logform/index.d.ts +18 -18
  71. package/nodejs/logform/index.js +94 -94
  72. package/nodejs/reader/index.d.ts +32 -32
  73. package/nodejs/reader/index.js +20 -20
  74. package/nodejs/remote/index.d.ts +32 -0
  75. package/nodejs/remote/index.js +71 -0
  76. package/nodejs/throttle/index.d.ts +30 -30
  77. package/nodejs/throttle/index.js +50 -50
  78. package/package.json +43 -43
  79. package/web/XMLHttpRequest/index.d.ts +17 -17
  80. package/web/XMLHttpRequest/index.js +60 -60
  81. package/web/animation/index.d.ts +19 -19
  82. package/web/animation/index.js +104 -104
  83. package/web/format/index.d.ts +29 -29
  84. package/web/format/index.js +107 -107
  85. package/web/json/index.d.ts +9 -9
  86. package/web/json/index.js +206 -206
  87. package/web/onReady/index.d.ts +7 -7
  88. package/web/onReady/index.js +8 -8
  89. package/web/performChunk/index.d.ts +4 -4
  90. package/web/performChunk/index.js +19 -19
  91. package/web/reader/index.d.ts +32 -32
  92. package/web/reader/index.js +20 -20
  93. package/web/style/index.d.ts +21 -21
  94. package/web/style/index.js +19 -19
  95. package/web/throttle/index.d.ts +30 -30
  96. 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,25 +1,25 @@
1
- <div class="appstore-view">
2
- <header>
3
- 应用市场
4
- </header>
5
- <ul>
6
- <li z-on:click.prevent="goto" tag="chart">
7
- <img src="./images/chart.png" />
8
- <h2>
9
- 群聊天
10
- </h2>
11
- </li>
12
- <li z-on:click="goto" tag="image-editor">
13
- <img src="./images/image-editor.png" />
14
- <h2>
15
- 图片编辑器
16
- </h2>
17
- </li>
18
- <li z-on:click="goto" tag="img-to-pdf">
19
- <img src="./images/img-to-pdf.svg" />
20
- <h2>
21
- 图片转PDF
22
- </h2>
23
- </li>
24
- </ul>
1
+ <div class="appstore-view">
2
+ <header>
3
+ 应用市场
4
+ </header>
5
+ <ul>
6
+ <li z-on:click.prevent="goto" tag="chart">
7
+ <img src="./images/chart.png" />
8
+ <h2>
9
+ 群聊天
10
+ </h2>
11
+ </li>
12
+ <li z-on:click="goto" tag="image-editor">
13
+ <img src="./images/image-editor.png" />
14
+ <h2>
15
+ 图片编辑器
16
+ </h2>
17
+ </li>
18
+ <li z-on:click="goto" tag="img-to-pdf">
19
+ <img src="./images/img-to-pdf.svg" />
20
+ <h2>
21
+ 图片转PDF
22
+ </h2>
23
+ </li>
24
+ </ul>
25
25
  </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,42 +1,42 @@
1
- .appstore-view {
2
-
3
- header {
4
- height: 50px;
5
- line-height: 50px;
6
- background-color: white;
7
- box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 4px;
8
- background-image: url("./images/logo.png");
9
- background-size: auto 90%;
10
- background-repeat: no-repeat;
11
- background-position-x: 5px;
12
- padding-left: 50px;
13
- font-size: 18px;
14
- font-weight: 800;
15
- }
16
-
17
- ul {
18
- text-align: center;
19
- padding: 50px 0;
20
-
21
- &>li {
22
- display: inline-block;
23
- margin: 0 10px;
24
-
25
- &:hover {
26
- text-decoration: underline;
27
- cursor: pointer;
28
- }
29
-
30
- &>img {
31
- border-radius: 10px;
32
- width: 70px;
33
- }
34
-
35
- &>h2 {
36
- font-size: 14px;
37
- line-height: 2em;
38
- }
39
- }
40
- }
41
-
1
+ .appstore-view {
2
+
3
+ header {
4
+ height: 50px;
5
+ line-height: 50px;
6
+ background-color: white;
7
+ box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 4px;
8
+ background-image: url("./images/logo.png");
9
+ background-size: auto 90%;
10
+ background-repeat: no-repeat;
11
+ background-position-x: 5px;
12
+ padding-left: 50px;
13
+ font-size: 18px;
14
+ font-weight: 800;
15
+ }
16
+
17
+ ul {
18
+ text-align: center;
19
+ padding: 50px 0;
20
+
21
+ &>li {
22
+ display: inline-block;
23
+ margin: 0 10px;
24
+
25
+ &:hover {
26
+ text-decoration: underline;
27
+ cursor: pointer;
28
+ }
29
+
30
+ &>img {
31
+ border-radius: 10px;
32
+ width: 70px;
33
+ }
34
+
35
+ &>h2 {
36
+ font-size: 14px;
37
+ line-height: 2em;
38
+ }
39
+ }
40
+ }
41
+
42
42
  }
@@ -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,73 +1,73 @@
1
- .chart-view {
2
- &>.content {
3
- position: fixed;
4
- width: 350px;
5
- height: calc(100% - 130px);
6
- border: 2px solid #000000;
7
- left: 50%;
8
- top: 50px;
9
- transform: translateX(-50%);
10
- padding: 5px;
11
- overflow: auto;
12
-
13
- &::-webkit-scrollbar {
14
- width: 0;
15
- height: 0;
16
- }
17
-
18
- &>.item {
19
- display: flex;
20
- padding: 5px;
21
-
22
- &[tag="sender"] {
23
- flex-direction: row-reverse;
24
- padding-left: 50px;
25
- }
26
-
27
- &[tag="receiver"] {
28
- flex-direction: row;
29
- padding-right: 50px;
30
- }
31
-
32
- &>.text {
33
- background-color: #dfdbdb;
34
- padding: 5px;
35
- width: fit-content;
36
- border-radius: 5px;
37
- font-size: 12px;
38
- }
39
- }
40
- }
41
-
42
- &>.input {
43
- position: fixed;
44
- width: 350px;
45
- height: 30px;
46
- left: 50%;
47
- bottom: 50px;
48
- transform: translateX(-50%);
49
- display: flex;
50
-
51
- &>input {
52
- flex-grow: 1;
53
- resize: none;
54
- outline: none;
55
- border: 2px solid #000000;
56
- border-top-width: 0;
57
- border-radius: 0;
58
- }
59
-
60
- &>button {
61
- width: 70px;
62
- cursor: pointer;
63
- background-color: #000000;
64
- color: white;
65
- outline: none;
66
- border: none;
67
-
68
- &:hover {
69
- text-decoration: underline;
70
- }
71
- }
72
- }
1
+ .chart-view {
2
+ &>.content {
3
+ position: fixed;
4
+ width: 350px;
5
+ height: calc(100% - 130px);
6
+ border: 2px solid #000000;
7
+ left: 50%;
8
+ top: 50px;
9
+ transform: translateX(-50%);
10
+ padding: 5px;
11
+ overflow: auto;
12
+
13
+ &::-webkit-scrollbar {
14
+ width: 0;
15
+ height: 0;
16
+ }
17
+
18
+ &>.item {
19
+ display: flex;
20
+ padding: 5px;
21
+
22
+ &[tag="sender"] {
23
+ flex-direction: row-reverse;
24
+ padding-left: 50px;
25
+ }
26
+
27
+ &[tag="receiver"] {
28
+ flex-direction: row;
29
+ padding-right: 50px;
30
+ }
31
+
32
+ &>.text {
33
+ background-color: #dfdbdb;
34
+ padding: 5px;
35
+ width: fit-content;
36
+ border-radius: 5px;
37
+ font-size: 12px;
38
+ }
39
+ }
40
+ }
41
+
42
+ &>.input {
43
+ position: fixed;
44
+ width: 350px;
45
+ height: 30px;
46
+ left: 50%;
47
+ bottom: 50px;
48
+ transform: translateX(-50%);
49
+ display: flex;
50
+
51
+ &>input {
52
+ flex-grow: 1;
53
+ resize: none;
54
+ outline: none;
55
+ border: 2px solid #000000;
56
+ border-top-width: 0;
57
+ border-radius: 0;
58
+ }
59
+
60
+ &>button {
61
+ width: 70px;
62
+ cursor: pointer;
63
+ background-color: #000000;
64
+ color: white;
65
+ outline: none;
66
+ border: none;
67
+
68
+ &:hover {
69
+ text-decoration: underline;
70
+ }
71
+ }
72
+ }
73
73
  }
@@ -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>