@pixui-dev/pxw 0.1.19 → 0.1.21

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 (95) hide show
  1. package/bin/pxw.js +199 -199
  2. package/bin/wpbuild.js +10 -10
  3. package/config/default.conf +20 -20
  4. package/config/devops.js +372 -361
  5. package/config/h5es.js +10 -10
  6. package/config/index.html +183 -181
  7. package/config/pfbs.js +245 -245
  8. package/config/util.js +140 -140
  9. package/config/webpack.js +325 -309
  10. package/lib/assets/check.html +62 -62
  11. package/lib/assets/preact.js +4354 -4354
  12. package/lib/check/main.less +62 -62
  13. package/lib/check/main.tsx +41 -41
  14. package/lib/check/tool.js +3 -3
  15. package/lib/check/util.tsx +110 -110
  16. package/lib/grpc-web/dist/ChunkParser.js +117 -117
  17. package/lib/grpc-web/dist/Code.js +58 -58
  18. package/lib/grpc-web/dist/client.js +299 -299
  19. package/lib/grpc-web/dist/debug.js +16 -16
  20. package/lib/grpc-web/dist/detach.js +7 -7
  21. package/lib/grpc-web/dist/index.js +29 -29
  22. package/lib/grpc-web/dist/invoke.js +32 -32
  23. package/lib/grpc-web/dist/message.js +3 -3
  24. package/lib/grpc-web/dist/metadata.js +5 -5
  25. package/lib/grpc-web/dist/service.js +3 -3
  26. package/lib/grpc-web/dist/transports/Transport.js +15 -15
  27. package/lib/grpc-web/dist/transports/http/fetch.js +117 -117
  28. package/lib/grpc-web/dist/transports/http/http.js +15 -15
  29. package/lib/grpc-web/dist/transports/http/xhr.js +136 -136
  30. package/lib/grpc-web/dist/transports/http/xhrUtil.js +36 -36
  31. package/lib/grpc-web/dist/transports/websocket/websocket.js +95 -95
  32. package/lib/grpc-web/dist/typings/ChunkParser.d.ts +17 -17
  33. package/lib/grpc-web/dist/typings/Code.d.ts +20 -20
  34. package/lib/grpc-web/dist/typings/client.d.ts +25 -25
  35. package/lib/grpc-web/dist/typings/debug.d.ts +1 -1
  36. package/lib/grpc-web/dist/typings/detach.d.ts +1 -1
  37. package/lib/grpc-web/dist/typings/index.d.ts +45 -45
  38. package/lib/grpc-web/dist/typings/invoke.d.ts +20 -20
  39. package/lib/grpc-web/dist/typings/message.d.ts +8 -8
  40. package/lib/grpc-web/dist/typings/metadata.d.ts +2 -2
  41. package/lib/grpc-web/dist/typings/service.d.ts +16 -16
  42. package/lib/grpc-web/dist/typings/transports/Transport.d.ts +22 -22
  43. package/lib/grpc-web/dist/typings/transports/http/fetch.d.ts +6 -6
  44. package/lib/grpc-web/dist/typings/transports/http/http.d.ts +5 -5
  45. package/lib/grpc-web/dist/typings/transports/http/xhr.d.ts +27 -27
  46. package/lib/grpc-web/dist/typings/transports/http/xhrUtil.d.ts +3 -3
  47. package/lib/grpc-web/dist/typings/transports/websocket/websocket.d.ts +2 -2
  48. package/lib/grpc-web/dist/typings/unary.d.ts +23 -23
  49. package/lib/grpc-web/dist/typings/util.d.ts +2 -2
  50. package/lib/grpc-web/dist/unary.js +44 -44
  51. package/lib/grpc-web/dist/util.js +11 -11
  52. package/lib/grpcTransport/PixHttp2Transport.ts +107 -107
  53. package/lib/grpcTransport/PixLuaTransport.ts +82 -82
  54. package/lib/h5es-types/v1.9.2/h5es.d.ts +1698 -1698
  55. package/lib/h5es-types/v3.5.0/h5es.d.ts +1788 -1788
  56. package/lib/pi_component/tinyList/tinyList.js +483 -483
  57. package/lib/pi_component/tinyList/tinyList.tsx +517 -517
  58. package/lib/preact-router.js +395 -395
  59. package/lib/preact.js +4355 -4355
  60. package/lib/preact.tq.js +4385 -4385
  61. package/lib/react-window/src/FixedSizeGrid.js +172 -172
  62. package/lib/react-window/src/FixedSizeList.js +91 -91
  63. package/lib/react-window/src/VariableSizeGrid.js +329 -329
  64. package/lib/react-window/src/VariableSizeList.js +231 -231
  65. package/lib/react-window/src/__tests__/FixedSizeGrid.js +942 -942
  66. package/lib/react-window/src/__tests__/FixedSizeList.js +749 -749
  67. package/lib/react-window/src/__tests__/VariableSizeGrid.js +598 -598
  68. package/lib/react-window/src/__tests__/VariableSizeList.js +345 -345
  69. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeGrid.js.snap +912 -912
  70. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeList.js.snap +568 -568
  71. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeGrid.js.snap +542 -542
  72. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeList.js.snap +331 -331
  73. package/lib/react-window/src/__tests__/areEqual.js +28 -28
  74. package/lib/react-window/src/__tests__/shouldComponentUpdate.js +32 -32
  75. package/lib/react-window/src/areEqual.js +13 -13
  76. package/lib/react-window/src/createGridComponent.js +657 -657
  77. package/lib/react-window/src/createListComponent.js +574 -574
  78. package/lib/react-window/src/domHelpers.js +69 -69
  79. package/lib/react-window/src/index.js +9 -9
  80. package/lib/react-window/src/shallowDiffers.js +17 -17
  81. package/lib/react-window/src/shouldComponentUpdate.js +11 -11
  82. package/lib/react-window/src/test.js.flow +382 -382
  83. package/lib/react-window/src/timer.js +36 -36
  84. package/lib/types/dom.ts +17 -17
  85. package/lib/types/ext.d.ts +81 -81
  86. package/lib/types/{css.d.ts → preact/css.d.ts} +7476 -7476
  87. package/lib/types/{preact.d.ts → preact/index.d.ts} +340 -340
  88. package/lib/types/{internal.d.ts → preact/internal.d.ts} +94 -94
  89. package/lib/types/{jsx.d.ts → preact/jsx.d.ts} +309 -309
  90. package/lib/types/preact-router/index.d.ts +85 -0
  91. package/package.json +113 -113
  92. package/scripts/pack.js +40 -40
  93. package/scripts/postinstall.js +11 -11
  94. package/scripts/run-pxw.js +12 -12
  95. package/tsconfig.json +30 -30
@@ -1,69 +1,69 @@
1
- // @flow
2
-
3
- let size: number = -1;
4
-
5
- // This utility copied from "dom-helpers" package.
6
- export function getScrollbarSize(recalculate?: boolean = false): number {
7
- if (size === -1 || recalculate) {
8
- const div = document.createElement('div');
9
- const style = div.style;
10
- style.width = '50px';
11
- style.height = '50px';
12
- style.overflow = 'scroll';
13
-
14
- ((document.body: any): HTMLBodyElement).appendChild(div);
15
-
16
- size = div.offsetWidth - div.clientWidth;
17
-
18
- ((document.body: any): HTMLBodyElement).removeChild(div);
19
- }
20
-
21
- return size;
22
- }
23
-
24
- export type RTLOffsetType = 'negative' | 'positive-descending' | 'positive-ascending';
25
-
26
- let cachedRTLResult: RTLOffsetType | null = null;
27
-
28
- // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
29
- // Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).
30
- // Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.
31
- // The safest way to check this is to intentionally set a negative offset,
32
- // and then verify that the subsequent "scroll" event matches the negative offset.
33
- // If it does not match, then we can assume a non-standard RTL scroll implementation.
34
- export function getRTLOffsetType(recalculate?: boolean = false): RTLOffsetType {
35
- if (cachedRTLResult === null || recalculate) {
36
- const outerDiv = document.createElement('div');
37
- const outerStyle = outerDiv.style;
38
- outerStyle.width = '50px';
39
- outerStyle.height = '50px';
40
- outerStyle.overflow = 'scroll';
41
- outerStyle.direction = 'rtl';
42
-
43
- const innerDiv = document.createElement('div');
44
- const innerStyle = innerDiv.style;
45
- innerStyle.width = '100px';
46
- innerStyle.height = '100px';
47
-
48
- outerDiv.appendChild(innerDiv);
49
-
50
- ((document.body: any): HTMLBodyElement).appendChild(outerDiv);
51
-
52
- if (outerDiv.scrollLeft > 0) {
53
- cachedRTLResult = 'positive-descending';
54
- } else {
55
- outerDiv.scrollLeft = 1;
56
- if (outerDiv.scrollLeft === 0) {
57
- cachedRTLResult = 'negative';
58
- } else {
59
- cachedRTLResult = 'positive-ascending';
60
- }
61
- }
62
-
63
- ((document.body: any): HTMLBodyElement).removeChild(outerDiv);
64
-
65
- return cachedRTLResult;
66
- }
67
-
68
- return cachedRTLResult;
69
- }
1
+ // @flow
2
+
3
+ let size: number = -1;
4
+
5
+ // This utility copied from "dom-helpers" package.
6
+ export function getScrollbarSize(recalculate?: boolean = false): number {
7
+ if (size === -1 || recalculate) {
8
+ const div = document.createElement('div');
9
+ const style = div.style;
10
+ style.width = '50px';
11
+ style.height = '50px';
12
+ style.overflow = 'scroll';
13
+
14
+ ((document.body: any): HTMLBodyElement).appendChild(div);
15
+
16
+ size = div.offsetWidth - div.clientWidth;
17
+
18
+ ((document.body: any): HTMLBodyElement).removeChild(div);
19
+ }
20
+
21
+ return size;
22
+ }
23
+
24
+ export type RTLOffsetType = 'negative' | 'positive-descending' | 'positive-ascending';
25
+
26
+ let cachedRTLResult: RTLOffsetType | null = null;
27
+
28
+ // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
29
+ // Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).
30
+ // Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.
31
+ // The safest way to check this is to intentionally set a negative offset,
32
+ // and then verify that the subsequent "scroll" event matches the negative offset.
33
+ // If it does not match, then we can assume a non-standard RTL scroll implementation.
34
+ export function getRTLOffsetType(recalculate?: boolean = false): RTLOffsetType {
35
+ if (cachedRTLResult === null || recalculate) {
36
+ const outerDiv = document.createElement('div');
37
+ const outerStyle = outerDiv.style;
38
+ outerStyle.width = '50px';
39
+ outerStyle.height = '50px';
40
+ outerStyle.overflow = 'scroll';
41
+ outerStyle.direction = 'rtl';
42
+
43
+ const innerDiv = document.createElement('div');
44
+ const innerStyle = innerDiv.style;
45
+ innerStyle.width = '100px';
46
+ innerStyle.height = '100px';
47
+
48
+ outerDiv.appendChild(innerDiv);
49
+
50
+ ((document.body: any): HTMLBodyElement).appendChild(outerDiv);
51
+
52
+ if (outerDiv.scrollLeft > 0) {
53
+ cachedRTLResult = 'positive-descending';
54
+ } else {
55
+ outerDiv.scrollLeft = 1;
56
+ if (outerDiv.scrollLeft === 0) {
57
+ cachedRTLResult = 'negative';
58
+ } else {
59
+ cachedRTLResult = 'positive-ascending';
60
+ }
61
+ }
62
+
63
+ ((document.body: any): HTMLBodyElement).removeChild(outerDiv);
64
+
65
+ return cachedRTLResult;
66
+ }
67
+
68
+ return cachedRTLResult;
69
+ }
@@ -1,9 +1,9 @@
1
- // @flow
2
-
3
- export { default as VariableSizeGrid } from './VariableSizeGrid';
4
- export { default as VariableSizeList } from './VariableSizeList';
5
- export { default as FixedSizeGrid } from './FixedSizeGrid';
6
- export { default as FixedSizeList } from './FixedSizeList';
7
-
8
- export { default as areEqual } from './areEqual';
9
- export { default as shouldComponentUpdate } from './shouldComponentUpdate';
1
+ // @flow
2
+
3
+ export { default as VariableSizeGrid } from './VariableSizeGrid';
4
+ export { default as VariableSizeList } from './VariableSizeList';
5
+ export { default as FixedSizeGrid } from './FixedSizeGrid';
6
+ export { default as FixedSizeList } from './FixedSizeList';
7
+
8
+ export { default as areEqual } from './areEqual';
9
+ export { default as shouldComponentUpdate } from './shouldComponentUpdate';
@@ -1,17 +1,17 @@
1
- // @flow
2
-
3
- // Pulled from react-compat
4
- // https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349
5
- export default function shallowDiffers(prev: Object, next: Object): boolean {
6
- for (let attribute in prev) {
7
- if (!(attribute in next)) {
8
- return true;
9
- }
10
- }
11
- for (let attribute in next) {
12
- if (prev[attribute] !== next[attribute]) {
13
- return true;
14
- }
15
- }
16
- return false;
17
- }
1
+ // @flow
2
+
3
+ // Pulled from react-compat
4
+ // https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349
5
+ export default function shallowDiffers(prev: Object, next: Object): boolean {
6
+ for (let attribute in prev) {
7
+ if (!(attribute in next)) {
8
+ return true;
9
+ }
10
+ }
11
+ for (let attribute in next) {
12
+ if (prev[attribute] !== next[attribute]) {
13
+ return true;
14
+ }
15
+ }
16
+ return false;
17
+ }
@@ -1,11 +1,11 @@
1
- // @flow
2
-
3
- import areEqual from './areEqual';
4
- import shallowDiffers from './shallowDiffers';
5
-
6
- // Custom shouldComponentUpdate for class components.
7
- // It knows to compare individual style props and ignore the wrapper object.
8
- // See https://reactjs.org/docs/react-component.html#shouldcomponentupdate
9
- export default function shouldComponentUpdate(nextProps: Object, nextState: Object): boolean {
10
- return !areEqual(this.props, nextProps) || shallowDiffers(this.state, nextState);
11
- }
1
+ // @flow
2
+
3
+ import areEqual from './areEqual';
4
+ import shallowDiffers from './shallowDiffers';
5
+
6
+ // Custom shouldComponentUpdate for class components.
7
+ // It knows to compare individual style props and ignore the wrapper object.
8
+ // See https://reactjs.org/docs/react-component.html#shouldcomponentupdate
9
+ export default function shouldComponentUpdate(nextProps: Object, nextState: Object): boolean {
10
+ return !areEqual(this.props, nextProps) || shallowDiffers(this.state, nextState);
11
+ }