oipage 1.7.0-rc.0 → 1.7.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 +1 -1
  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 +45 -45
  13. package/bin/intercept.js +15 -15
  14. package/bin/network.js +21 -21
  15. package/bin/serve.d.ts +64 -64
  16. package/bin/template/404.html +186 -186
  17. package/bin/tools/deleteEmptyFolder.js +23 -23
  18. package/bin/tools/format.js +75 -75
  19. package/bin/tools/network.js +42 -42
  20. package/bin/tools/resolve404.js +83 -83
  21. package/bin/tools/resolveImport.js +88 -88
  22. package/bin/website-htmls/components/ui-select-file/index.html +7 -7
  23. package/bin/website-htmls/components/ui-select-file/index.js +37 -37
  24. package/bin/website-htmls/components/ui-select-file/index.scss +44 -44
  25. package/bin/website-htmls/dialogs/imageSize/index.html +54 -54
  26. package/bin/website-htmls/dialogs/imageSize/index.js +53 -53
  27. package/bin/website-htmls/dialogs/imageSize/index.scss +138 -138
  28. package/bin/website-htmls/dialogs/index.js +52 -52
  29. package/bin/website-htmls/images/addFile.svg +1 -1
  30. package/bin/website-htmls/images/img-to-pdf.svg +1 -1
  31. package/bin/website-htmls/index.html +17 -17
  32. package/bin/website-htmls/main.js +13 -13
  33. package/bin/website-htmls/pages/App/index.html +6 -6
  34. package/bin/website-htmls/pages/App/index.js +22 -22
  35. package/bin/website-htmls/pages/App/index.scss +43 -43
  36. package/bin/website-htmls/pages/appStore/index.html +24 -24
  37. package/bin/website-htmls/pages/appStore/index.js +19 -19
  38. package/bin/website-htmls/pages/appStore/index.scss +41 -41
  39. package/bin/website-htmls/pages/chart/index.html +8 -8
  40. package/bin/website-htmls/pages/chart/index.js +72 -72
  41. package/bin/website-htmls/pages/chart/index.scss +72 -72
  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 +45 -45
  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 +19 -19
  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 +112 -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 +165 -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 +1 -1
  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 +112 -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,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
  })