@pixui-dev/pxw 0.1.16

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 (128) hide show
  1. package/bin/pxw.js +217 -0
  2. package/bin/wpbuild.js +10 -0
  3. package/config/default.conf +21 -0
  4. package/config/devops.js +358 -0
  5. package/config/h5es.js +10 -0
  6. package/config/index.html +181 -0
  7. package/config/pfbs.js +207 -0
  8. package/config/testhelp.js +0 -0
  9. package/config/util.js +140 -0
  10. package/config/webpack.js +291 -0
  11. package/lib/assets/border.png +0 -0
  12. package/lib/assets/check.html +62 -0
  13. package/lib/assets/pixui.png +0 -0
  14. package/lib/assets/preact.js +4354 -0
  15. package/lib/assets/preact.png +0 -0
  16. package/lib/check/main.less +63 -0
  17. package/lib/check/main.tsx +41 -0
  18. package/lib/check/tool.js +3 -0
  19. package/lib/check/util.tsx +110 -0
  20. package/lib/grpc-web/dist/ChunkParser.js +117 -0
  21. package/lib/grpc-web/dist/ChunkParser.js.map +1 -0
  22. package/lib/grpc-web/dist/Code.js +58 -0
  23. package/lib/grpc-web/dist/Code.js.map +1 -0
  24. package/lib/grpc-web/dist/client.js +299 -0
  25. package/lib/grpc-web/dist/client.js.map +1 -0
  26. package/lib/grpc-web/dist/debug.js +16 -0
  27. package/lib/grpc-web/dist/debug.js.map +1 -0
  28. package/lib/grpc-web/dist/detach.js +7 -0
  29. package/lib/grpc-web/dist/detach.js.map +1 -0
  30. package/lib/grpc-web/dist/index.js +29 -0
  31. package/lib/grpc-web/dist/index.js.map +1 -0
  32. package/lib/grpc-web/dist/invoke.js +32 -0
  33. package/lib/grpc-web/dist/invoke.js.map +1 -0
  34. package/lib/grpc-web/dist/message.js +3 -0
  35. package/lib/grpc-web/dist/message.js.map +1 -0
  36. package/lib/grpc-web/dist/metadata.js +5 -0
  37. package/lib/grpc-web/dist/metadata.js.map +1 -0
  38. package/lib/grpc-web/dist/service.js +3 -0
  39. package/lib/grpc-web/dist/service.js.map +1 -0
  40. package/lib/grpc-web/dist/transports/Transport.js +15 -0
  41. package/lib/grpc-web/dist/transports/Transport.js.map +1 -0
  42. package/lib/grpc-web/dist/transports/http/fetch.js +117 -0
  43. package/lib/grpc-web/dist/transports/http/fetch.js.map +1 -0
  44. package/lib/grpc-web/dist/transports/http/http.js +15 -0
  45. package/lib/grpc-web/dist/transports/http/http.js.map +1 -0
  46. package/lib/grpc-web/dist/transports/http/xhr.js +136 -0
  47. package/lib/grpc-web/dist/transports/http/xhr.js.map +1 -0
  48. package/lib/grpc-web/dist/transports/http/xhrUtil.js +36 -0
  49. package/lib/grpc-web/dist/transports/http/xhrUtil.js.map +1 -0
  50. package/lib/grpc-web/dist/transports/websocket/websocket.js +95 -0
  51. package/lib/grpc-web/dist/transports/websocket/websocket.js.map +1 -0
  52. package/lib/grpc-web/dist/typings/ChunkParser.d.ts +17 -0
  53. package/lib/grpc-web/dist/typings/Code.d.ts +20 -0
  54. package/lib/grpc-web/dist/typings/client.d.ts +25 -0
  55. package/lib/grpc-web/dist/typings/debug.d.ts +1 -0
  56. package/lib/grpc-web/dist/typings/detach.d.ts +1 -0
  57. package/lib/grpc-web/dist/typings/index.d.ts +45 -0
  58. package/lib/grpc-web/dist/typings/invoke.d.ts +20 -0
  59. package/lib/grpc-web/dist/typings/message.d.ts +8 -0
  60. package/lib/grpc-web/dist/typings/metadata.d.ts +2 -0
  61. package/lib/grpc-web/dist/typings/service.d.ts +16 -0
  62. package/lib/grpc-web/dist/typings/transports/Transport.d.ts +22 -0
  63. package/lib/grpc-web/dist/typings/transports/http/fetch.d.ts +6 -0
  64. package/lib/grpc-web/dist/typings/transports/http/http.d.ts +5 -0
  65. package/lib/grpc-web/dist/typings/transports/http/xhr.d.ts +27 -0
  66. package/lib/grpc-web/dist/typings/transports/http/xhrUtil.d.ts +3 -0
  67. package/lib/grpc-web/dist/typings/transports/websocket/websocket.d.ts +2 -0
  68. package/lib/grpc-web/dist/typings/unary.d.ts +23 -0
  69. package/lib/grpc-web/dist/typings/util.d.ts +2 -0
  70. package/lib/grpc-web/dist/unary.js +44 -0
  71. package/lib/grpc-web/dist/unary.js.map +1 -0
  72. package/lib/grpc-web/dist/util.js +11 -0
  73. package/lib/grpc-web/dist/util.js.map +1 -0
  74. package/lib/grpcTransport/PixHttp2Transport.ts +107 -0
  75. package/lib/grpcTransport/PixLuaTransport.ts +82 -0
  76. package/lib/h5es-types/v1.9.2/h5es.d.ts +1698 -0
  77. package/lib/h5es-types/v3.5.0/h5es.d.ts +1788 -0
  78. package/lib/pi_component/tinyList/tinyList.js +483 -0
  79. package/lib/pi_component/tinyList/tinyList.tsx +517 -0
  80. package/lib/pika-svelte/compiler.js +29829 -0
  81. package/lib/pika-svelte/easing/index.js +158 -0
  82. package/lib/pika-svelte/index.js +72 -0
  83. package/lib/pika-svelte/internal/index.js +1926 -0
  84. package/lib/pika-svelte/motion/index.js +210 -0
  85. package/lib/pika-svelte/package.json +145 -0
  86. package/lib/pika-svelte/register.js +57 -0
  87. package/lib/pika-svelte/rollup.config.js +126 -0
  88. package/lib/pika-svelte/store/index.js +123 -0
  89. package/lib/pika-svelte/transition/index.js +185 -0
  90. package/lib/preact-router.js +395 -0
  91. package/lib/preact.js +4355 -0
  92. package/lib/preact.tq.js +4385 -0
  93. package/lib/react-window/src/FixedSizeGrid.js +172 -0
  94. package/lib/react-window/src/FixedSizeList.js +91 -0
  95. package/lib/react-window/src/VariableSizeGrid.js +329 -0
  96. package/lib/react-window/src/VariableSizeList.js +231 -0
  97. package/lib/react-window/src/__tests__/FixedSizeGrid.js +942 -0
  98. package/lib/react-window/src/__tests__/FixedSizeList.js +749 -0
  99. package/lib/react-window/src/__tests__/VariableSizeGrid.js +598 -0
  100. package/lib/react-window/src/__tests__/VariableSizeList.js +345 -0
  101. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeGrid.js.snap +912 -0
  102. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeList.js.snap +568 -0
  103. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeGrid.js.snap +542 -0
  104. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeList.js.snap +331 -0
  105. package/lib/react-window/src/__tests__/areEqual.js +28 -0
  106. package/lib/react-window/src/__tests__/shouldComponentUpdate.js +32 -0
  107. package/lib/react-window/src/areEqual.js +13 -0
  108. package/lib/react-window/src/createGridComponent.js +657 -0
  109. package/lib/react-window/src/createListComponent.js +574 -0
  110. package/lib/react-window/src/domHelpers.js +69 -0
  111. package/lib/react-window/src/index.js +9 -0
  112. package/lib/react-window/src/shallowDiffers.js +17 -0
  113. package/lib/react-window/src/shouldComponentUpdate.js +11 -0
  114. package/lib/react-window/src/test.js.flow +382 -0
  115. package/lib/react-window/src/timer.js +36 -0
  116. package/lib/svelte-tab/Tab.svelte +31 -0
  117. package/lib/svelte-tab/TabList.svelte +10 -0
  118. package/lib/svelte-tab/TabPanel.svelte +13 -0
  119. package/lib/svelte-tab/Tabs.svelte +68 -0
  120. package/lib/svelte-tab/tabs.js +4 -0
  121. package/lib/types/css.d.ts +7476 -0
  122. package/lib/types/dom.ts +17 -0
  123. package/lib/types/ext.d.ts +81 -0
  124. package/lib/types/internal.d.ts +94 -0
  125. package/lib/types/jsx.d.ts +309 -0
  126. package/lib/types/preact.d.ts +340 -0
  127. package/package.json +111 -0
  128. package/tsconfig.json +30 -0
@@ -0,0 +1,331 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`VariableSizeList onScroll scrolling should report partial items correctly in onItemsRendered 1`] = `
4
+ Array [
5
+ Array [
6
+ Object {
7
+ "overscanStartIndex": 0,
8
+ "overscanStopIndex": 6,
9
+ "visibleStartIndex": 0,
10
+ "visibleStopIndex": 4,
11
+ },
12
+ ],
13
+ Array [
14
+ Object {
15
+ "overscanStartIndex": 1,
16
+ "overscanStopIndex": 8,
17
+ "visibleStartIndex": 2,
18
+ "visibleStopIndex": 6,
19
+ },
20
+ ],
21
+ Array [
22
+ Object {
23
+ "overscanStartIndex": 2,
24
+ "overscanStopIndex": 8,
25
+ "visibleStartIndex": 3,
26
+ "visibleStopIndex": 6,
27
+ },
28
+ ],
29
+ Array [
30
+ Object {
31
+ "overscanStartIndex": 0,
32
+ "overscanStopIndex": 7,
33
+ "visibleStartIndex": 2,
34
+ "visibleStopIndex": 6,
35
+ },
36
+ ],
37
+ Array [
38
+ Object {
39
+ "overscanStartIndex": 94,
40
+ "overscanStopIndex": 99,
41
+ "visibleStartIndex": 95,
42
+ "visibleStopIndex": 99,
43
+ },
44
+ ],
45
+ Array [
46
+ Object {
47
+ "overscanStartIndex": 95,
48
+ "overscanStopIndex": 99,
49
+ "visibleStartIndex": 96,
50
+ "visibleStopIndex": 99,
51
+ },
52
+ ],
53
+ Array [
54
+ Object {
55
+ "overscanStartIndex": 93,
56
+ "overscanStopIndex": 99,
57
+ "visibleStartIndex": 95,
58
+ "visibleStopIndex": 99,
59
+ },
60
+ ],
61
+ ]
62
+ `;
63
+
64
+ exports[`VariableSizeList scrollToItem method scroll with align = "auto" should work with partially-visible items 1`] = `
65
+ Array [
66
+ Array [
67
+ Object {
68
+ "overscanStartIndex": 0,
69
+ "overscanStopIndex": 5,
70
+ "visibleStartIndex": 0,
71
+ "visibleStopIndex": 3,
72
+ },
73
+ ],
74
+ Array [
75
+ Object {
76
+ "overscanStartIndex": 5,
77
+ "overscanStopIndex": 12,
78
+ "visibleStartIndex": 7,
79
+ "visibleStopIndex": 10,
80
+ },
81
+ ],
82
+ Array [
83
+ Object {
84
+ "overscanStartIndex": 94,
85
+ "overscanStopIndex": 99,
86
+ "visibleStartIndex": 96,
87
+ "visibleStopIndex": 99,
88
+ },
89
+ ],
90
+ Array [
91
+ Object {
92
+ "overscanStartIndex": 0,
93
+ "overscanStopIndex": 6,
94
+ "visibleStartIndex": 1,
95
+ "visibleStopIndex": 4,
96
+ },
97
+ ],
98
+ Array [
99
+ Object {
100
+ "overscanStartIndex": 0,
101
+ "overscanStopIndex": 5,
102
+ "visibleStartIndex": 0,
103
+ "visibleStopIndex": 3,
104
+ },
105
+ ],
106
+ ]
107
+ `;
108
+
109
+ exports[`VariableSizeList scrollToItem method should not set invalid offsets when the list contains few items 1`] = `[Function]`;
110
+
111
+ exports[`VariableSizeList scrollToItem method should scroll to the correct item for align = "auto" 1`] = `
112
+ Array [
113
+ Array [
114
+ Object {
115
+ "overscanStartIndex": 0,
116
+ "overscanStopIndex": 5,
117
+ "visibleStartIndex": 0,
118
+ "visibleStopIndex": 3,
119
+ },
120
+ ],
121
+ Array [
122
+ Object {
123
+ "overscanStartIndex": 6,
124
+ "overscanStopIndex": 12,
125
+ "visibleStartIndex": 8,
126
+ "visibleStopIndex": 10,
127
+ },
128
+ ],
129
+ Array [
130
+ Object {
131
+ "overscanStartIndex": 0,
132
+ "overscanStopIndex": 7,
133
+ "visibleStartIndex": 2,
134
+ "visibleStopIndex": 5,
135
+ },
136
+ ],
137
+ ]
138
+ `;
139
+
140
+ exports[`VariableSizeList scrollToItem method should scroll to the correct item for align = "center" 1`] = `
141
+ Array [
142
+ Array [
143
+ Object {
144
+ "overscanStartIndex": 0,
145
+ "overscanStopIndex": 5,
146
+ "visibleStartIndex": 0,
147
+ "visibleStopIndex": 3,
148
+ },
149
+ ],
150
+ Array [
151
+ Object {
152
+ "overscanStartIndex": 7,
153
+ "overscanStopIndex": 13,
154
+ "visibleStartIndex": 9,
155
+ "visibleStopIndex": 11,
156
+ },
157
+ ],
158
+ Array [
159
+ Object {
160
+ "overscanStartIndex": 6,
161
+ "overscanStopIndex": 12,
162
+ "visibleStartIndex": 8,
163
+ "visibleStopIndex": 10,
164
+ },
165
+ ],
166
+ Array [
167
+ Object {
168
+ "overscanStartIndex": 0,
169
+ "overscanStopIndex": 6,
170
+ "visibleStartIndex": 0,
171
+ "visibleStopIndex": 4,
172
+ },
173
+ ],
174
+ ]
175
+ `;
176
+
177
+ exports[`VariableSizeList scrollToItem method should scroll to the correct item for align = "center" 2`] = `
178
+ Array [
179
+ Array [
180
+ Object {
181
+ "overscanStartIndex": 0,
182
+ "overscanStopIndex": 5,
183
+ "visibleStartIndex": 0,
184
+ "visibleStopIndex": 3,
185
+ },
186
+ ],
187
+ Array [
188
+ Object {
189
+ "overscanStartIndex": 7,
190
+ "overscanStopIndex": 13,
191
+ "visibleStartIndex": 9,
192
+ "visibleStopIndex": 11,
193
+ },
194
+ ],
195
+ Array [
196
+ Object {
197
+ "overscanStartIndex": 6,
198
+ "overscanStopIndex": 12,
199
+ "visibleStartIndex": 8,
200
+ "visibleStopIndex": 10,
201
+ },
202
+ ],
203
+ Array [
204
+ Object {
205
+ "overscanStartIndex": 0,
206
+ "overscanStopIndex": 6,
207
+ "visibleStartIndex": 0,
208
+ "visibleStopIndex": 4,
209
+ },
210
+ ],
211
+ Array [
212
+ Object {
213
+ "overscanStartIndex": 15,
214
+ "overscanStopIndex": 19,
215
+ "visibleStartIndex": 17,
216
+ "visibleStopIndex": 19,
217
+ },
218
+ ],
219
+ ]
220
+ `;
221
+
222
+ exports[`VariableSizeList scrollToItem method should scroll to the correct item for align = "end" 1`] = `
223
+ Array [
224
+ Array [
225
+ Object {
226
+ "overscanStartIndex": 0,
227
+ "overscanStopIndex": 5,
228
+ "visibleStartIndex": 0,
229
+ "visibleStopIndex": 3,
230
+ },
231
+ ],
232
+ Array [
233
+ Object {
234
+ "overscanStartIndex": 6,
235
+ "overscanStopIndex": 12,
236
+ "visibleStartIndex": 8,
237
+ "visibleStopIndex": 10,
238
+ },
239
+ ],
240
+ Array [
241
+ Object {
242
+ "overscanStartIndex": 4,
243
+ "overscanStopIndex": 11,
244
+ "visibleStartIndex": 6,
245
+ "visibleStopIndex": 9,
246
+ },
247
+ ],
248
+ Array [
249
+ Object {
250
+ "overscanStartIndex": 0,
251
+ "overscanStopIndex": 5,
252
+ "visibleStartIndex": 0,
253
+ "visibleStopIndex": 3,
254
+ },
255
+ ],
256
+ ]
257
+ `;
258
+
259
+ exports[`VariableSizeList scrollToItem method should scroll to the correct item for align = "smart" 1`] = `
260
+ Array [
261
+ Array [
262
+ Object {
263
+ "overscanStartIndex": 0,
264
+ "overscanStopIndex": 5,
265
+ "visibleStartIndex": 0,
266
+ "visibleStopIndex": 3,
267
+ },
268
+ ],
269
+ Array [
270
+ Object {
271
+ "overscanStartIndex": 7,
272
+ "overscanStopIndex": 13,
273
+ "visibleStartIndex": 9,
274
+ "visibleStopIndex": 11,
275
+ },
276
+ ],
277
+ Array [
278
+ Object {
279
+ "overscanStartIndex": 4,
280
+ "overscanStopIndex": 11,
281
+ "visibleStartIndex": 6,
282
+ "visibleStopIndex": 9,
283
+ },
284
+ ],
285
+ Array [
286
+ Object {
287
+ "overscanStartIndex": 0,
288
+ "overscanStopIndex": 6,
289
+ "visibleStartIndex": 0,
290
+ "visibleStopIndex": 4,
291
+ },
292
+ ],
293
+ ]
294
+ `;
295
+
296
+ exports[`VariableSizeList scrollToItem method should scroll to the correct item for align = "start" 1`] = `
297
+ Array [
298
+ Array [
299
+ Object {
300
+ "overscanStartIndex": 0,
301
+ "overscanStopIndex": 5,
302
+ "visibleStartIndex": 0,
303
+ "visibleStopIndex": 3,
304
+ },
305
+ ],
306
+ Array [
307
+ Object {
308
+ "overscanStartIndex": 8,
309
+ "overscanStopIndex": 14,
310
+ "visibleStartIndex": 10,
311
+ "visibleStopIndex": 12,
312
+ },
313
+ ],
314
+ Array [
315
+ Object {
316
+ "overscanStartIndex": 7,
317
+ "overscanStopIndex": 13,
318
+ "visibleStartIndex": 9,
319
+ "visibleStopIndex": 11,
320
+ },
321
+ ],
322
+ Array [
323
+ Object {
324
+ "overscanStartIndex": 15,
325
+ "overscanStopIndex": 19,
326
+ "visibleStartIndex": 17,
327
+ "visibleStopIndex": 19,
328
+ },
329
+ ],
330
+ ]
331
+ `;
@@ -0,0 +1,28 @@
1
+ import React, { memo } from 'react';
2
+ import ReactTestRenderer from 'react-test-renderer';
3
+ import { areEqual } from '..';
4
+
5
+ describe('areEqual', () => {
6
+ let Component, MemoizedComponent;
7
+
8
+ beforeEach(() => {
9
+ Component = jest.fn(() => null);
10
+ MemoizedComponent = memo(Component, areEqual);
11
+ });
12
+
13
+ it('should not re-render when the style prop changes', () => {
14
+ const renderer = ReactTestRenderer.create(<MemoizedComponent style={{}} foo="abc" bar={123} />);
15
+ expect(Component).toHaveBeenCalledTimes(1);
16
+
17
+ renderer.update(<MemoizedComponent style={{}} foo="abc" bar={123} />);
18
+ expect(Component).toHaveBeenCalledTimes(1);
19
+ });
20
+
21
+ it('should re-render when other props change', () => {
22
+ const renderer = ReactTestRenderer.create(<MemoizedComponent style={{}} foo="abc" bar={123} />);
23
+ expect(Component).toHaveBeenCalledTimes(1);
24
+
25
+ renderer.update(<MemoizedComponent style={{}} foo="abc" bar={234} />);
26
+ expect(Component).toHaveBeenCalledTimes(2);
27
+ });
28
+ });
@@ -0,0 +1,32 @@
1
+ import React, { Component } from 'react';
2
+ import ReactTestRenderer from 'react-test-renderer';
3
+ import { shouldComponentUpdate } from '..';
4
+
5
+ describe('shouldComponentUpdate', () => {
6
+ let ClassComponent, render;
7
+
8
+ beforeEach(() => {
9
+ render = jest.fn(() => null);
10
+
11
+ ClassComponent = class extends Component {
12
+ shouldComponentUpdate = shouldComponentUpdate.bind(this);
13
+ render = render;
14
+ };
15
+ });
16
+
17
+ it('should not re-render when the style prop changes', () => {
18
+ const renderer = ReactTestRenderer.create(<ClassComponent style={{}} foo="abc" bar={123} />);
19
+ expect(render).toHaveBeenCalledTimes(1);
20
+
21
+ renderer.update(<ClassComponent style={{}} foo="abc" bar={123} />);
22
+ expect(render).toHaveBeenCalledTimes(1);
23
+ });
24
+
25
+ it('should re-render when other props change', () => {
26
+ const renderer = ReactTestRenderer.create(<ClassComponent style={{}} foo="abc" bar={123} />);
27
+ expect(render).toHaveBeenCalledTimes(1);
28
+
29
+ renderer.update(<ClassComponent style={{}} foo="abc" bar={234} />);
30
+ expect(render).toHaveBeenCalledTimes(2);
31
+ });
32
+ });
@@ -0,0 +1,13 @@
1
+ // @flow
2
+
3
+ import shallowDiffers from './shallowDiffers';
4
+
5
+ // Custom comparison function for React.memo().
6
+ // It knows to compare individual style props and ignore the wrapper object.
7
+ // See https://reactjs.org/docs/react-api.html#reactmemo
8
+ export default function areEqual(prevProps: Object, nextProps: Object): boolean {
9
+ const { style: prevStyle, ...prevRest } = prevProps;
10
+ const { style: nextStyle, ...nextRest } = nextProps;
11
+
12
+ return !shallowDiffers(prevStyle, nextStyle) && !shallowDiffers(prevRest, nextRest);
13
+ }