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,53 +1,53 @@
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
- title: this._props.title,
10
- width: this._props.width,
11
- height: this._props.height,
12
-
13
- newWidth: ref(this._props.width),
14
- newHeight: ref(this._props.height),
15
-
16
- changeType: ref('center-middle')
17
- }
18
- },
19
- methods: {
20
- calcHeight() {
21
- if (this.title == '图像大小') {
22
- this.newHeight = +(this.newWidth * this.height / this.width).toFixed(0);
23
- }
24
- },
25
-
26
- calcWidth() {
27
- if (this.title == '图像大小') {
28
- this.newWidth = +(this.newHeight * this.width / this.height).toFixed(0);
29
- }
30
- },
31
-
32
- doChangeType: function (event, target) {
33
- this.changeType = target.getAttribute('val');
34
- },
35
-
36
- // 确定
37
- doSubmit: function () {
38
- this.$closeDialog({
39
- width: +this.newWidth,
40
- height: +this.newHeight,
41
- changeType: this.changeType
42
- });
43
- },
44
-
45
- // 取消
46
- doClose: function () {
47
- this.$closeDialog();
48
- }
49
- },
50
- style: {
51
- content: style
52
- }
53
- })
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
+ title: this._props.title,
10
+ width: this._props.width,
11
+ height: this._props.height,
12
+
13
+ newWidth: ref(this._props.width),
14
+ newHeight: ref(this._props.height),
15
+
16
+ changeType: ref('center-middle')
17
+ }
18
+ },
19
+ methods: {
20
+ calcHeight() {
21
+ if (this.title == '图像大小') {
22
+ this.newHeight = +(this.newWidth * this.height / this.width).toFixed(0);
23
+ }
24
+ },
25
+
26
+ calcWidth() {
27
+ if (this.title == '图像大小') {
28
+ this.newWidth = +(this.newHeight * this.width / this.height).toFixed(0);
29
+ }
30
+ },
31
+
32
+ doChangeType: function (event, target) {
33
+ this.changeType = target.getAttribute('val');
34
+ },
35
+
36
+ // 确定
37
+ doSubmit: function () {
38
+ this.$closeDialog({
39
+ width: +this.newWidth,
40
+ height: +this.newHeight,
41
+ changeType: this.changeType
42
+ });
43
+ },
44
+
45
+ // 取消
46
+ doClose: function () {
47
+ this.$closeDialog();
48
+ }
49
+ },
50
+ style: {
51
+ content: style
52
+ }
53
+ })
@@ -1,139 +1,139 @@
1
- #dialog-root>.content.imageSize {
2
- border: 1px solid gray;
3
- min-height: 300px;
4
- width: 300px;
5
- background-color: white;
6
-
7
- &>h2 {
8
- font-size: 12px;
9
- padding-left: 30px;
10
- background-image: url('./images/image-editor.png');
11
- background-size: auto 80%;
12
- background-repeat: no-repeat;
13
- background-position: 3px center;
14
- border-bottom: 1px solid gray;
15
- line-height: 30px;
16
- height: 30px;
17
- user-select: none;
18
- }
19
-
20
- &>div.right-btn {
21
- display: flex;
22
-
23
- &>div {
24
- &:first-child {
25
- flex-grow: 1;
26
- padding: 10px 0 10px 10px;
27
- }
28
-
29
- &:last-child {
30
- text-align: center;
31
- flex-grow: 0;
32
- flex-shrink: 0;
33
- flex-basis: 70px;
34
-
35
- &>button {
36
- height: 30px;
37
- border-radius: 15px;
38
- width: 50px;
39
- margin-top: 10px;
40
-
41
- &:hover {
42
- background-color: rgb(127, 131, 131);
43
- cursor: pointer;
44
- }
45
- }
46
-
47
- }
48
- }
49
- }
50
-
51
- fieldset {
52
- margin-top: 10px;
53
- font-size: 12px;
54
- }
55
-
56
- ul {
57
-
58
- &[lock='yes'] {
59
- background-image: url('./images/lock.png');
60
- background-repeat: no-repeat;
61
- background-position: right;
62
- }
63
-
64
- &>li {
65
- line-height: 2em;
66
- margin-top: 5px;
67
-
68
- &[active='no'] {
69
- display: none;
70
- }
71
-
72
- &>label {
73
- width: 70px;
74
- display: inline-block;
75
- text-align: right;
76
- }
77
-
78
- &>input {
79
- width: 50px;
80
- margin-right: 5px;
81
- }
82
-
83
- .change-type {
84
- font-size: 0;
85
- width: 90px;
86
- display: inline-block;
87
- line-height: 0;
88
- vertical-align: top;
89
- background-image: url('./images/size.png');
90
- background-size: 100% auto;
91
- background-repeat: no-repeat;
92
-
93
- &>span {
94
- display: inline-block;
95
- width: 30px;
96
- height: 30px;
97
- cursor: pointer;
98
- outline: 1px solid #dedede;
99
- }
100
-
101
- &[type='left-top'] {
102
- background-position: -29px -32px;
103
- }
104
-
105
- &[type='center-top'] {
106
- background-position: 1px -32px;
107
- }
108
-
109
- &[type='right-top'] {
110
- background-position: 30px -32px;
111
- }
112
-
113
- &[type='left-middle'] {
114
- background-position: -29px -1px;
115
- }
116
-
117
- &[type='center-middle'] {
118
- background-position: 1px -1px;
119
- }
120
-
121
- &[type='right-middle'] {
122
- background-position: 30px -1px;
123
- }
124
-
125
- &[type='left-bottom'] {
126
- background-position: -29px 30px;
127
- }
128
-
129
- &[type='center-bottom'] {
130
- background-position: 1px 30px;
131
- }
132
-
133
- &[type='right-bottom'] {
134
- background-position: 30px 30px;
135
- }
136
- }
137
- }
138
- }
1
+ #dialog-root>.content.imageSize {
2
+ border: 1px solid gray;
3
+ min-height: 300px;
4
+ width: 300px;
5
+ background-color: white;
6
+
7
+ &>h2 {
8
+ font-size: 12px;
9
+ padding-left: 30px;
10
+ background-image: url('./images/image-editor.png');
11
+ background-size: auto 80%;
12
+ background-repeat: no-repeat;
13
+ background-position: 3px center;
14
+ border-bottom: 1px solid gray;
15
+ line-height: 30px;
16
+ height: 30px;
17
+ user-select: none;
18
+ }
19
+
20
+ &>div.right-btn {
21
+ display: flex;
22
+
23
+ &>div {
24
+ &:first-child {
25
+ flex-grow: 1;
26
+ padding: 10px 0 10px 10px;
27
+ }
28
+
29
+ &:last-child {
30
+ text-align: center;
31
+ flex-grow: 0;
32
+ flex-shrink: 0;
33
+ flex-basis: 70px;
34
+
35
+ &>button {
36
+ height: 30px;
37
+ border-radius: 15px;
38
+ width: 50px;
39
+ margin-top: 10px;
40
+
41
+ &:hover {
42
+ background-color: rgb(127, 131, 131);
43
+ cursor: pointer;
44
+ }
45
+ }
46
+
47
+ }
48
+ }
49
+ }
50
+
51
+ fieldset {
52
+ margin-top: 10px;
53
+ font-size: 12px;
54
+ }
55
+
56
+ ul {
57
+
58
+ &[lock='yes'] {
59
+ background-image: url('./images/lock.png');
60
+ background-repeat: no-repeat;
61
+ background-position: right;
62
+ }
63
+
64
+ &>li {
65
+ line-height: 2em;
66
+ margin-top: 5px;
67
+
68
+ &[active='no'] {
69
+ display: none;
70
+ }
71
+
72
+ &>label {
73
+ width: 70px;
74
+ display: inline-block;
75
+ text-align: right;
76
+ }
77
+
78
+ &>input {
79
+ width: 50px;
80
+ margin-right: 5px;
81
+ }
82
+
83
+ .change-type {
84
+ font-size: 0;
85
+ width: 90px;
86
+ display: inline-block;
87
+ line-height: 0;
88
+ vertical-align: top;
89
+ background-image: url('./images/size.png');
90
+ background-size: 100% auto;
91
+ background-repeat: no-repeat;
92
+
93
+ &>span {
94
+ display: inline-block;
95
+ width: 30px;
96
+ height: 30px;
97
+ cursor: pointer;
98
+ outline: 1px solid #dedede;
99
+ }
100
+
101
+ &[type='left-top'] {
102
+ background-position: -29px -32px;
103
+ }
104
+
105
+ &[type='center-top'] {
106
+ background-position: 1px -32px;
107
+ }
108
+
109
+ &[type='right-top'] {
110
+ background-position: 30px -32px;
111
+ }
112
+
113
+ &[type='left-middle'] {
114
+ background-position: -29px -1px;
115
+ }
116
+
117
+ &[type='center-middle'] {
118
+ background-position: 1px -1px;
119
+ }
120
+
121
+ &[type='right-middle'] {
122
+ background-position: 30px -1px;
123
+ }
124
+
125
+ &[type='left-bottom'] {
126
+ background-position: -29px 30px;
127
+ }
128
+
129
+ &[type='center-bottom'] {
130
+ background-position: 1px 30px;
131
+ }
132
+
133
+ &[type='right-bottom'] {
134
+ background-position: 30px 30px;
135
+ }
136
+ }
137
+ }
138
+ }
139
139
  }
@@ -1,53 +1,53 @@
1
- import { createApp } from "zipaper";
2
-
3
- const dialogs = {
4
- imageSize: () => import("./imageSize/index.js")
5
- };
6
-
7
- let dialogsResolve = [];
8
- export default {
9
- install(Zipaper) {
10
-
11
- // 打开弹框
12
- Zipaper.prototype.$openDialog = function (dialogName, data) {
13
- let el = document.createElement("div");
14
-
15
- dialogs[dialogName]().then(App => {
16
-
17
- // 准备好挂载点
18
- el.setAttribute("class", "content " + dialogName);
19
-
20
- // 创建并挂载
21
- document.getElementById("dialog-root").appendChild(el);
22
-
23
- if (data) {
24
- let props = {};
25
- for (let key in data) {
26
- props[key] = {
27
- default: data[key]
28
- };
29
- }
30
- App.default.props = props;
31
- } else {
32
- App.default.props = {};
33
- }
34
-
35
- createApp(App.default).mount(el);
36
- });
37
-
38
- return new Promise((resolve) => {
39
- dialogsResolve.push({
40
- resolve,
41
- el
42
- });
43
- });
44
- };
45
-
46
- // 关闭弹框
47
- Zipaper.prototype.$closeDialog = function (data) {
48
- let dialog = dialogsResolve.pop();
49
- dialog.el.parentNode.removeChild(dialog.el);
50
- dialog.resolve(data);
51
- };
52
- }
1
+ import { createApp } from "zipaper";
2
+
3
+ const dialogs = {
4
+ imageSize: () => import("./imageSize/index.js")
5
+ };
6
+
7
+ let dialogsResolve = [];
8
+ export default {
9
+ install(Zipaper) {
10
+
11
+ // 打开弹框
12
+ Zipaper.prototype.$openDialog = function (dialogName, data) {
13
+ let el = document.createElement("div");
14
+
15
+ dialogs[dialogName]().then(App => {
16
+
17
+ // 准备好挂载点
18
+ el.setAttribute("class", "content " + dialogName);
19
+
20
+ // 创建并挂载
21
+ document.getElementById("dialog-root").appendChild(el);
22
+
23
+ if (data) {
24
+ let props = {};
25
+ for (let key in data) {
26
+ props[key] = {
27
+ default: data[key]
28
+ };
29
+ }
30
+ App.default.props = props;
31
+ } else {
32
+ App.default.props = {};
33
+ }
34
+
35
+ createApp(App.default).mount(el);
36
+ });
37
+
38
+ return new Promise((resolve) => {
39
+ dialogsResolve.push({
40
+ resolve,
41
+ el
42
+ });
43
+ });
44
+ };
45
+
46
+ // 关闭弹框
47
+ Zipaper.prototype.$closeDialog = function (data) {
48
+ let dialog = dialogsResolve.pop();
49
+ dialog.el.parentNode.removeChild(dialog.el);
50
+ dialog.resolve(data);
51
+ };
52
+ }
53
53
  }
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 12v-2h1v2h2v1h-2v2h-1v-2h-2v-1h2zm5 8H6V4H5v17h13v-1zm1 0v2H4V3h2V1h10l5 5v14h-2zM7 2v17h13V6l-4-4H7zm9 0l4 4h-4V2z"></path></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 12v-2h1v2h2v1h-2v2h-1v-2h-2v-1h2zm5 8H6V4H5v17h13v-1zm1 0v2H4V3h2V1h10l5 5v14h-2zM7 2v17h13V6l-4-4H7zm9 0l4 4h-4V2z"></path></svg>
@@ -1 +1 @@
1
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z" fill="#FFB700"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.99992 8L13.9999 14.5625L16.9544 11.7927L24 17.5625V20L17.0455 14.3589L13.9999 17.2141L6.99992 10.6517L0 17.1875V14.5625L6.99992 8Z" fill="white"></path><circle cx="18" cy="6" r="3" fill="white"></circle></svg>
1
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z" fill="#FFB700"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.99992 8L13.9999 14.5625L16.9544 11.7927L24 17.5625V20L17.0455 14.3589L13.9999 17.2141L6.99992 10.6517L0 17.1875V14.5625L6.99992 8Z" fill="white"></path><circle cx="18" cy="6" r="3" fill="white"></circle></svg>
@@ -1,18 +1,18 @@
1
- <!DOCTYPE html>
2
- <html lang="zh-cn">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>OIPage 应用市场</title>
8
- <link rel="shortcut icon" href="./images/logo.png">
9
- <link rel="stylesheet" href="./styles/normalize.css">
10
- <link rel="stylesheet" href="./styles/common.css">
11
- </head>
12
-
13
- <body>
14
- <div id="root"></div>
15
- <script type="module" src="./main.js"></script>
16
- </body>
17
-
1
+ <!DOCTYPE html>
2
+ <html lang="zh-cn">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>OIPage 应用市场</title>
8
+ <link rel="shortcut icon" href="./images/logo.png">
9
+ <link rel="stylesheet" href="./styles/normalize.css">
10
+ <link rel="stylesheet" href="./styles/common.css">
11
+ </head>
12
+
13
+ <body>
14
+ <div id="root"></div>
15
+ <script type="module" src="./main.js"></script>
16
+ </body>
17
+
18
18
  </html>
@@ -1,14 +1,14 @@
1
- import { createApp } from "zipaper"
2
-
3
- import App from "./pages/App/index.js"
4
- import router from "./router.config.js"
5
- import dialogs from "./dialogs/index.js"
6
- import uiSelectFile from "./components/ui-select-file/index.js"
7
-
8
- // https://oi-contrib.github.io/Zipaper/index.html
9
-
10
- createApp(App)
11
- .use(router) // 路由
12
- .use(dialogs) // 弹框
13
- .component("ui-select-file", uiSelectFile)
1
+ import { createApp } from "zipaper"
2
+
3
+ import App from "./pages/App/index.js"
4
+ import router from "./router.config.js"
5
+ import dialogs from "./dialogs/index.js"
6
+ import uiSelectFile from "./components/ui-select-file/index.js"
7
+
8
+ // https://oi-contrib.github.io/Zipaper/index.html
9
+
10
+ createApp(App)
11
+ .use(router) // 路由
12
+ .use(dialogs) // 弹框
13
+ .component("ui-select-file", uiSelectFile)
14
14
  .mount(document.getElementById("root")) // 挂载到页面
@@ -1,7 +1,7 @@
1
- <router></router>
2
- <div id="dialog-root">
3
- <div class="mask" z-on:click="closeDialog"></div>
4
- </div>
5
- <a class="fork" href="https://github.com/oi-contrib/OIPage" target="_blank">
6
- Fork me on Github
1
+ <router></router>
2
+ <div id="dialog-root">
3
+ <div class="mask" z-on:click="closeDialog"></div>
4
+ </div>
5
+ <a class="fork" href="https://github.com/oi-contrib/OIPage" target="_blank">
6
+ Fork me on Github
7
7
  </a>
@@ -1,23 +1,23 @@
1
- import { defineElement } 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
-
14
- // 点击遮罩关闭弹框
15
- closeDialog() {
16
- this.$closeDialog()
17
- }
18
-
19
- },
20
- style: {
21
- content: style
22
- }
1
+ import { defineElement } 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
+
14
+ // 点击遮罩关闭弹框
15
+ closeDialog() {
16
+ this.$closeDialog()
17
+ }
18
+
19
+ },
20
+ style: {
21
+ content: style
22
+ }
23
23
  })