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,24 +1,24 @@
1
1
  /*!
2
- * style of OIPage v1.8.0-alpha.0
2
+ * style of OIPage v1.8.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
6
- export function setStyle(el, styles) {
7
- for (var key in styles) {
8
- el.style[key] = styles[key];
9
- }
10
- }
11
-
12
- export function getStyle(el, name) {
13
-
14
- // 获取结点的全部样式
15
- var allStyle = document.defaultView && document.defaultView.getComputedStyle ?
16
- document.defaultView.getComputedStyle(el, null) :
17
- el.currentStyle;
18
-
19
- // 如果没有指定属性名称,返回全部样式
20
- return typeof name === 'string' ?
21
- allStyle.getPropertyValue(name) :
22
- allStyle;
23
-
6
+ export function setStyle(el, styles) {
7
+ for (var key in styles) {
8
+ el.style[key] = styles[key];
9
+ }
10
+ }
11
+
12
+ export function getStyle(el, name) {
13
+
14
+ // 获取结点的全部样式
15
+ var allStyle = document.defaultView && document.defaultView.getComputedStyle ?
16
+ document.defaultView.getComputedStyle(el, null) :
17
+ el.currentStyle;
18
+
19
+ // 如果没有指定属性名称,返回全部样式
20
+ return typeof name === 'string' ?
21
+ allStyle.getPropertyValue(name) :
22
+ allStyle;
23
+
24
24
  }
@@ -1,31 +1,31 @@
1
- export type throttleOpportunityType = "begin" | "end" | "wide"
2
-
3
- export interface throttleOptionType {
4
-
5
- /**
6
- * 节流时长
7
- */
8
- time?: number
9
-
10
- /**
11
- * 是否持续节流
12
- */
13
- keep?: boolean
14
-
15
- /**
16
- * 执行时机
17
- *
18
- * begin(开始触发)、end(结束触发)、wide(第一次开始触发,其余结束触发)
19
- */
20
- opportunity?: throttleOpportunityType
21
-
22
- }
23
-
24
- /**
25
- * 节流函数
26
- */
27
- export interface throttleType {
28
- (callback: Function, option?: throttleOptionType): Function
29
- }
30
-
1
+ export type throttleOpportunityType = "begin" | "end" | "wide"
2
+
3
+ export interface throttleOptionType {
4
+
5
+ /**
6
+ * 节流时长
7
+ */
8
+ time?: number
9
+
10
+ /**
11
+ * 是否持续节流
12
+ */
13
+ keep?: boolean
14
+
15
+ /**
16
+ * 执行时机
17
+ *
18
+ * begin(开始触发)、end(结束触发)、wide(第一次开始触发,其余结束触发)
19
+ */
20
+ opportunity?: throttleOpportunityType
21
+
22
+ }
23
+
24
+ /**
25
+ * 节流函数
26
+ */
27
+ export interface throttleType {
28
+ (callback: Function, option?: throttleOptionType): Function
29
+ }
30
+
31
31
  export let throttle: throttleType
@@ -1,55 +1,55 @@
1
1
  /*!
2
- * throttle of OIPage v1.8.0-alpha.0
2
+ * throttle of OIPage v1.8.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
6
- export function throttle(callback, _option) {
7
-
8
- // 缺省值
9
- var option = {
10
- time: 200,
11
- keep: false,
12
- opportunity: "end"
13
- };
14
-
15
- // 校对
16
- if (_option) {
17
- for (var key in _option) {
18
- option[key] = _option[key];
19
- }
20
- }
21
-
22
- var hadInterval = false, hadClick = false, oneClick = false, arg;
23
- return function () {
24
- const _this = this;
25
- arg = arguments;
26
-
27
- // 如果前置任务都完成了
28
- if (!hadInterval) {
29
- if (option.opportunity != 'end') {
30
- callback.apply(_this, arg);
31
- }
32
- hadInterval = true;
33
-
34
- var interval = setInterval(() => {
35
- if (hadClick) {
36
- if (!option.keep) {
37
- callback.apply(_this, arg);
38
- }
39
- } else {
40
- if (option.opportunity != 'begin') {
41
- if (oneClick || option.opportunity == 'end') callback.apply(_this, arg);
42
- }
43
- hadInterval = false;
44
- oneClick = false;
45
- clearInterval(interval);
46
- }
47
- hadClick = false;
48
- }, option.time);
49
- } else {
50
- hadClick = true;
51
- oneClick = true;
52
- }
53
-
54
- };
6
+ export function throttle(callback, _option) {
7
+
8
+ // 缺省值
9
+ var option = {
10
+ time: 200,
11
+ keep: false,
12
+ opportunity: "end"
13
+ };
14
+
15
+ // 校对
16
+ if (_option) {
17
+ for (var key in _option) {
18
+ option[key] = _option[key];
19
+ }
20
+ }
21
+
22
+ var hadInterval = false, hadClick = false, oneClick = false, arg;
23
+ return function () {
24
+ const _this = this;
25
+ arg = arguments;
26
+
27
+ // 如果前置任务都完成了
28
+ if (!hadInterval) {
29
+ if (option.opportunity != 'end') {
30
+ callback.apply(_this, arg);
31
+ }
32
+ hadInterval = true;
33
+
34
+ var interval = setInterval(() => {
35
+ if (hadClick) {
36
+ if (!option.keep) {
37
+ callback.apply(_this, arg);
38
+ }
39
+ } else {
40
+ if (option.opportunity != 'begin') {
41
+ if (oneClick || option.opportunity == 'end') callback.apply(_this, arg);
42
+ }
43
+ hadInterval = false;
44
+ oneClick = false;
45
+ clearInterval(interval);
46
+ }
47
+ hadClick = false;
48
+ }, option.time);
49
+ } else {
50
+ hadClick = true;
51
+ oneClick = true;
52
+ }
53
+
54
+ };
55
55
  }