@pixui-dev/pxw 0.1.16 → 0.1.19

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 (109) hide show
  1. package/bin/pxw.js +199 -217
  2. package/bin/wpbuild.js +10 -10
  3. package/config/default.conf +20 -20
  4. package/config/devops.js +361 -358
  5. package/config/h5es.js +10 -10
  6. package/config/index.html +181 -181
  7. package/config/pfbs.js +245 -207
  8. package/config/util.js +140 -140
  9. package/config/webpack.js +309 -291
  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/css.d.ts +7476 -7476
  85. package/lib/types/dom.ts +17 -17
  86. package/lib/types/ext.d.ts +81 -81
  87. package/lib/types/internal.d.ts +94 -94
  88. package/lib/types/jsx.d.ts +309 -309
  89. package/lib/types/preact.d.ts +340 -340
  90. package/package.json +113 -111
  91. package/scripts/pack.js +40 -0
  92. package/scripts/postinstall.js +12 -0
  93. package/scripts/run-pxw.js +13 -0
  94. package/tsconfig.json +30 -30
  95. package/lib/pika-svelte/compiler.js +0 -29829
  96. package/lib/pika-svelte/easing/index.js +0 -158
  97. package/lib/pika-svelte/index.js +0 -72
  98. package/lib/pika-svelte/internal/index.js +0 -1926
  99. package/lib/pika-svelte/motion/index.js +0 -210
  100. package/lib/pika-svelte/package.json +0 -145
  101. package/lib/pika-svelte/register.js +0 -57
  102. package/lib/pika-svelte/rollup.config.js +0 -126
  103. package/lib/pika-svelte/store/index.js +0 -123
  104. package/lib/pika-svelte/transition/index.js +0 -185
  105. package/lib/svelte-tab/Tab.svelte +0 -31
  106. package/lib/svelte-tab/TabList.svelte +0 -10
  107. package/lib/svelte-tab/TabPanel.svelte +0 -13
  108. package/lib/svelte-tab/Tabs.svelte +0 -68
  109. package/lib/svelte-tab/tabs.js +0 -4
package/lib/types/dom.ts CHANGED
@@ -1,17 +1,17 @@
1
- import { createElement, render, Component } from 'preact';
2
-
3
- let dumpDOM = (type, props, ...children) => {
4
- console.log('==>dom', 'type', type, 'props', props, 'chlidren', children);
5
- return {
6
- type,
7
- props,
8
- children,
9
- };
10
- };
11
-
12
- console.log('preact check', createElement, render, Component);
13
-
14
- export { render, createElement } from 'preact';
15
-
16
- //注:这个是给tsx文件import h from 'preact'用的,其实有了上面的插件这句话在js层面可以省略,但少了它之后在ts层面就无法判断jsx元素的类型信息,导致editor里对attr和style的语法提示失效
17
- export default createElement;
1
+ import { createElement, render, Component } from 'preact';
2
+
3
+ let dumpDOM = (type, props, ...children) => {
4
+ console.log('==>dom', 'type', type, 'props', props, 'chlidren', children);
5
+ return {
6
+ type,
7
+ props,
8
+ children,
9
+ };
10
+ };
11
+
12
+ console.log('preact check', createElement, render, Component);
13
+
14
+ export { render, createElement } from 'preact';
15
+
16
+ //注:这个是给tsx文件import h from 'preact'用的,其实有了上面的插件这句话在js层面可以省略,但少了它之后在ts层面就无法判断jsx元素的类型信息,导致editor里对attr和style的语法提示失效
17
+ export default createElement;
@@ -1,81 +1,81 @@
1
- interface NodeModule {
2
- hot: any;
3
- }
4
-
5
- declare module '*.less' {
6
- const resource: { [key: string]: string };
7
- export = resource;
8
- }
9
-
10
- declare module '*.png' {
11
- const value: any;
12
- export default value;
13
- }
14
- declare module '*.gif' {
15
- const value: any;
16
- export default value;
17
- }
18
- declare module '*.jpg' {
19
- const value: any;
20
- export default value;
21
- }
22
-
23
- declare module '*.mp4' {
24
- const value: any;
25
- export default value;
26
- }
27
-
28
- declare module '*.lottie' {
29
- const value: any;
30
- export default value;
31
- }
32
-
33
- interface Console {
34
- enable_trace: (boolean) => {};
35
- }
36
-
37
- declare class Http2Connection {
38
- constructor(url: string, metadata?: string[string], debug?: bool);
39
-
40
- send(msg: Uint8Array): number;
41
-
42
- close(msg: Record<string, any>): number;
43
-
44
- setHeadersCallBack(func: Function): number;
45
-
46
- setDataCallBack(func: Function): number;
47
-
48
- setEndCallBack(func: Function): number;
49
- }
50
-
51
- interface Window {
52
- Http2Connection: any;
53
- noProto: any;
54
- }
55
-
56
- interface External {
57
- sendMessage: (msg: any) => void;
58
-
59
- onmessage: any;
60
-
61
- profileJS: (b: bool) => void;
62
- preloadImage: (url: string[], cb: () => void) => void;
63
- }
64
-
65
- declare function LuaProxy(): lua;
66
- declare class WxCard {
67
- Ping(msg: string) {}
68
- }
69
- declare class PandoraCommon {
70
- static callLua(msg: string): any;
71
- }
72
- declare class PandoraSDKAdapter {
73
- static external: any;
74
- static getInstance();
75
- static callLua(name: string, f1: Function, f2: Function, msg: string): any;
76
- }
77
- declare class Lua {
78
- constructor();
79
- callLua(name: string, f1: Function, f2: Function, msg: string): any;
80
- PixWxCardRequest: WxCard;
81
- }
1
+ interface NodeModule {
2
+ hot: any;
3
+ }
4
+
5
+ declare module '*.less' {
6
+ const resource: { [key: string]: string };
7
+ export = resource;
8
+ }
9
+
10
+ declare module '*.png' {
11
+ const value: any;
12
+ export default value;
13
+ }
14
+ declare module '*.gif' {
15
+ const value: any;
16
+ export default value;
17
+ }
18
+ declare module '*.jpg' {
19
+ const value: any;
20
+ export default value;
21
+ }
22
+
23
+ declare module '*.mp4' {
24
+ const value: any;
25
+ export default value;
26
+ }
27
+
28
+ declare module '*.lottie' {
29
+ const value: any;
30
+ export default value;
31
+ }
32
+
33
+ interface Console {
34
+ enable_trace: (boolean) => {};
35
+ }
36
+
37
+ declare class Http2Connection {
38
+ constructor(url: string, metadata?: string[string], debug?: bool);
39
+
40
+ send(msg: Uint8Array): number;
41
+
42
+ close(msg: Record<string, any>): number;
43
+
44
+ setHeadersCallBack(func: Function): number;
45
+
46
+ setDataCallBack(func: Function): number;
47
+
48
+ setEndCallBack(func: Function): number;
49
+ }
50
+
51
+ interface Window {
52
+ Http2Connection: any;
53
+ noProto: any;
54
+ }
55
+
56
+ interface External {
57
+ sendMessage: (msg: any) => void;
58
+
59
+ onmessage: any;
60
+
61
+ profileJS: (b: bool) => void;
62
+ preloadImage: (url: string[], cb: () => void) => void;
63
+ }
64
+
65
+ declare function LuaProxy(): lua;
66
+ declare class WxCard {
67
+ Ping(msg: string) {}
68
+ }
69
+ declare class PandoraCommon {
70
+ static callLua(msg: string): any;
71
+ }
72
+ declare class PandoraSDKAdapter {
73
+ static external: any;
74
+ static getInstance();
75
+ static callLua(name: string, f1: Function, f2: Function, msg: string): any;
76
+ }
77
+ declare class Lua {
78
+ constructor();
79
+ callLua(name: string, f1: Function, f2: Function, msg: string): any;
80
+ PixWxCardRequest: WxCard;
81
+ }
@@ -1,94 +1,94 @@
1
- import * as preact from '../preact';
2
-
3
- export interface Options extends preact.Options {
4
- /** Attach a hook that is invoked before render, mainly to check the arguments. */
5
- _root?(
6
- vnode: preact.ComponentChild,
7
- parent: Element | Document | ShadowRoot | DocumentFragment
8
- ): void;
9
- /** Attach a hook that is invoked before a vnode is diffed. */
10
- _diff?(vnode: VNode): void;
11
- /** Attach a hook that is invoked after a tree was mounted or was updated. */
12
- _commit?(vnode: VNode, commitQueue: Component[]): void;
13
- /** Attach a hook that is invoked before a vnode has rendered. */
14
- _render?(vnode: VNode): void;
15
- /** Attach a hook that is invoked before a hook's state is queried. */
16
- _hook?(component: Component): void;
17
- /** Attach a hook that is invoked after an error is caught in a component but before calling lifecycle hooks */
18
- _catchError(error: any, vnode: VNode, oldVNode: VNode | undefined): void;
19
- }
20
-
21
- export interface FunctionalComponent<P = {}>
22
- extends preact.FunctionComponent<P> {
23
- // Define getDerivedStateFromProps as undefined on FunctionalComponent
24
- // to get rid of some errors in `diff()`
25
- getDerivedStateFromProps?: undefined;
26
- }
27
-
28
- // Redefine ComponentFactory using our new internal FunctionalComponent interface above
29
- export type ComponentFactory<P> =
30
- | preact.ComponentClass<P>
31
- | FunctionalComponent<P>;
32
-
33
- export interface PreactElement extends HTMLElement {
34
- _children?: VNode<any> | null;
35
- /** Event listeners to support event delegation */
36
- _listeners: Record<string, (e: Event) => void>;
37
-
38
- // Preact uses this attribute to detect SVG nodes
39
- ownerSVGElement?: SVGElement | null;
40
-
41
- // style: HTMLElement["style"]; // From HTMLElement
42
-
43
- data?: string | number; // From Text node
44
- }
45
-
46
- export interface VNode<P = {}> extends preact.VNode<P> {
47
- // Redefine type here using our internal ComponentFactory type
48
- type: string | ComponentFactory<P>;
49
- props: P & { children: preact.ComponentChildren };
50
- _children: Array<VNode<any>> | null;
51
- _parent: VNode | null;
52
- _depth: number | null;
53
- /**
54
- * The [first (for Fragments)] DOM child of a VNode
55
- */
56
- _dom: PreactElement | Text | null;
57
- /**
58
- * The last dom child of a Fragment, or components that return a Fragment
59
- */
60
- _nextDom: PreactElement | Text | null;
61
- _component: Component | null;
62
- constructor: undefined;
63
- _original?: VNode | null;
64
- }
65
-
66
- export interface Component<P = {}, S = {}> extends preact.Component<P, S> {
67
- // When component is functional component, this is reset to functional component
68
- constructor: preact.ComponentType<P>;
69
- state: S; // Override Component["state"] to not be readonly for internal use, specifically Hooks
70
- base?: PreactElement;
71
-
72
- _dirty: boolean;
73
- _force?: boolean;
74
- _renderCallbacks: Array<() => void>; // Only class components
75
- _globalContext?: any;
76
- _vnode?: VNode<P> | null;
77
- _nextState?: S | null; // Only class components
78
- /** Only used in the devtools to later dirty check if state has changed */
79
- _prevState?: S | null;
80
- /**
81
- * Pointer to the parent dom node. This is only needed for top-level Fragment
82
- * components or array returns.
83
- */
84
- _parentDom?: PreactElement | null;
85
- // Always read, set only when handling error
86
- _processingException?: Component<any, any> | null;
87
- // Always read, set only when handling error. This is used to indicate at diffTime to set _processingException
88
- _pendingError?: Component<any, any> | null;
89
- }
90
-
91
- export interface PreactContext extends preact.Context<any> {
92
- _id: string;
93
- _defaultValue: any;
94
- }
1
+ import * as preact from '../preact';
2
+
3
+ export interface Options extends preact.Options {
4
+ /** Attach a hook that is invoked before render, mainly to check the arguments. */
5
+ _root?(
6
+ vnode: preact.ComponentChild,
7
+ parent: Element | Document | ShadowRoot | DocumentFragment
8
+ ): void;
9
+ /** Attach a hook that is invoked before a vnode is diffed. */
10
+ _diff?(vnode: VNode): void;
11
+ /** Attach a hook that is invoked after a tree was mounted or was updated. */
12
+ _commit?(vnode: VNode, commitQueue: Component[]): void;
13
+ /** Attach a hook that is invoked before a vnode has rendered. */
14
+ _render?(vnode: VNode): void;
15
+ /** Attach a hook that is invoked before a hook's state is queried. */
16
+ _hook?(component: Component): void;
17
+ /** Attach a hook that is invoked after an error is caught in a component but before calling lifecycle hooks */
18
+ _catchError(error: any, vnode: VNode, oldVNode: VNode | undefined): void;
19
+ }
20
+
21
+ export interface FunctionalComponent<P = {}>
22
+ extends preact.FunctionComponent<P> {
23
+ // Define getDerivedStateFromProps as undefined on FunctionalComponent
24
+ // to get rid of some errors in `diff()`
25
+ getDerivedStateFromProps?: undefined;
26
+ }
27
+
28
+ // Redefine ComponentFactory using our new internal FunctionalComponent interface above
29
+ export type ComponentFactory<P> =
30
+ | preact.ComponentClass<P>
31
+ | FunctionalComponent<P>;
32
+
33
+ export interface PreactElement extends HTMLElement {
34
+ _children?: VNode<any> | null;
35
+ /** Event listeners to support event delegation */
36
+ _listeners: Record<string, (e: Event) => void>;
37
+
38
+ // Preact uses this attribute to detect SVG nodes
39
+ ownerSVGElement?: SVGElement | null;
40
+
41
+ // style: HTMLElement["style"]; // From HTMLElement
42
+
43
+ data?: string | number; // From Text node
44
+ }
45
+
46
+ export interface VNode<P = {}> extends preact.VNode<P> {
47
+ // Redefine type here using our internal ComponentFactory type
48
+ type: string | ComponentFactory<P>;
49
+ props: P & { children: preact.ComponentChildren };
50
+ _children: Array<VNode<any>> | null;
51
+ _parent: VNode | null;
52
+ _depth: number | null;
53
+ /**
54
+ * The [first (for Fragments)] DOM child of a VNode
55
+ */
56
+ _dom: PreactElement | Text | null;
57
+ /**
58
+ * The last dom child of a Fragment, or components that return a Fragment
59
+ */
60
+ _nextDom: PreactElement | Text | null;
61
+ _component: Component | null;
62
+ constructor: undefined;
63
+ _original?: VNode | null;
64
+ }
65
+
66
+ export interface Component<P = {}, S = {}> extends preact.Component<P, S> {
67
+ // When component is functional component, this is reset to functional component
68
+ constructor: preact.ComponentType<P>;
69
+ state: S; // Override Component["state"] to not be readonly for internal use, specifically Hooks
70
+ base?: PreactElement;
71
+
72
+ _dirty: boolean;
73
+ _force?: boolean;
74
+ _renderCallbacks: Array<() => void>; // Only class components
75
+ _globalContext?: any;
76
+ _vnode?: VNode<P> | null;
77
+ _nextState?: S | null; // Only class components
78
+ /** Only used in the devtools to later dirty check if state has changed */
79
+ _prevState?: S | null;
80
+ /**
81
+ * Pointer to the parent dom node. This is only needed for top-level Fragment
82
+ * components or array returns.
83
+ */
84
+ _parentDom?: PreactElement | null;
85
+ // Always read, set only when handling error
86
+ _processingException?: Component<any, any> | null;
87
+ // Always read, set only when handling error. This is used to indicate at diffTime to set _processingException
88
+ _pendingError?: Component<any, any> | null;
89
+ }
90
+
91
+ export interface PreactContext extends preact.Context<any> {
92
+ _id: string;
93
+ _defaultValue: any;
94
+ }