pixuireactcomponents 1.2.0 → 1.2.1
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.
- package/README.md +5 -6
- package/package.json +9 -66
- package/tsconfig.json +27 -13
- package/.eslintignore +0 -7
- package/.eslintrc.js +0 -48
- package/.pixiderc/apps.json +0 -12
- package/.pixiderc/devel-config.meta.json +0 -23
- package/.pixiderc/postinstall.js +0 -17
- package/.pixiderc/util.js +0 -136
- package/.pixiderc/webpack.js +0 -180
- package/faas/helloworld.js +0 -8
- package/gen/pbo/pandora_pb.d.ts +0 -1179
- package/gen/pbo/pandora_pb.js +0 -10475
- package/gen/pbo/pandora_pb_service.d.ts +0 -1317
- package/gen/pbo/pandora_pb_service.js +0 -2307
- package/gen/pbo/test_pb.d.ts +0 -99
- package/gen/pbo/test_pb.js +0 -889
- package/gen/pbo/test_pb_service.d.ts +0 -82
- package/gen/pbo/test_pb_service.js +0 -117
- package/lib/assets/border.png +0 -0
- package/lib/assets/check.html +0 -54
- package/lib/assets/pixui.png +0 -0
- package/lib/assets/preact.png +0 -0
- package/lib/check/main.less +0 -63
- package/lib/check/main.tsx +0 -42
- package/lib/check/tool.js +0 -3
- package/lib/check/util.tsx +0 -107
- package/lib/dom.ts +0 -16
- package/lib/ext.d.ts +0 -95
- package/lib/grpc-web/dist/ChunkParser.js +0 -115
- package/lib/grpc-web/dist/ChunkParser.js.map +0 -1
- package/lib/grpc-web/dist/Code.js +0 -58
- package/lib/grpc-web/dist/Code.js.map +0 -1
- package/lib/grpc-web/dist/client.js +0 -299
- package/lib/grpc-web/dist/client.js.map +0 -1
- package/lib/grpc-web/dist/debug.js +0 -16
- package/lib/grpc-web/dist/debug.js.map +0 -1
- package/lib/grpc-web/dist/detach.js +0 -7
- package/lib/grpc-web/dist/detach.js.map +0 -1
- package/lib/grpc-web/dist/index.js +0 -29
- package/lib/grpc-web/dist/index.js.map +0 -1
- package/lib/grpc-web/dist/invoke.js +0 -32
- package/lib/grpc-web/dist/invoke.js.map +0 -1
- package/lib/grpc-web/dist/message.js +0 -3
- package/lib/grpc-web/dist/message.js.map +0 -1
- package/lib/grpc-web/dist/metadata.js +0 -5
- package/lib/grpc-web/dist/metadata.js.map +0 -1
- package/lib/grpc-web/dist/service.js +0 -3
- package/lib/grpc-web/dist/service.js.map +0 -1
- package/lib/grpc-web/dist/transports/Transport.js +0 -13
- package/lib/grpc-web/dist/transports/Transport.js.map +0 -1
- package/lib/grpc-web/dist/transports/http/fetch.js +0 -112
- package/lib/grpc-web/dist/transports/http/fetch.js.map +0 -1
- package/lib/grpc-web/dist/transports/http/http.js +0 -15
- package/lib/grpc-web/dist/transports/http/http.js.map +0 -1
- package/lib/grpc-web/dist/transports/http/xhr.js +0 -127
- package/lib/grpc-web/dist/transports/http/xhr.js.map +0 -1
- package/lib/grpc-web/dist/transports/http/xhrUtil.js +0 -37
- package/lib/grpc-web/dist/transports/http/xhrUtil.js.map +0 -1
- package/lib/grpc-web/dist/transports/websocket/websocket.js +0 -95
- package/lib/grpc-web/dist/transports/websocket/websocket.js.map +0 -1
- package/lib/grpc-web/dist/typings/ChunkParser.d.ts +0 -17
- package/lib/grpc-web/dist/typings/Code.d.ts +0 -20
- package/lib/grpc-web/dist/typings/client.d.ts +0 -22
- package/lib/grpc-web/dist/typings/debug.d.ts +0 -1
- package/lib/grpc-web/dist/typings/detach.d.ts +0 -1
- package/lib/grpc-web/dist/typings/index.d.ts +0 -60
- package/lib/grpc-web/dist/typings/invoke.d.ts +0 -17
- package/lib/grpc-web/dist/typings/message.d.ts +0 -8
- package/lib/grpc-web/dist/typings/metadata.d.ts +0 -2
- package/lib/grpc-web/dist/typings/service.d.ts +0 -16
- package/lib/grpc-web/dist/typings/transports/Transport.d.ts +0 -22
- package/lib/grpc-web/dist/typings/transports/http/fetch.d.ts +0 -6
- package/lib/grpc-web/dist/typings/transports/http/http.d.ts +0 -5
- package/lib/grpc-web/dist/typings/transports/http/xhr.d.ts +0 -27
- package/lib/grpc-web/dist/typings/transports/http/xhrUtil.d.ts +0 -3
- package/lib/grpc-web/dist/typings/transports/websocket/websocket.d.ts +0 -2
- package/lib/grpc-web/dist/typings/unary.d.ts +0 -20
- package/lib/grpc-web/dist/typings/util.d.ts +0 -2
- package/lib/grpc-web/dist/unary.js +0 -44
- package/lib/grpc-web/dist/unary.js.map +0 -1
- package/lib/grpc-web/dist/util.js +0 -11
- package/lib/grpc-web/dist/util.js.map +0 -1
- package/lib/grpcTransport/PixHttp2Transport.ts +0 -104
- package/lib/grpcTransport/PixLuaTransport.ts +0 -80
- package/lib/pi_component/tinyList/tinyList.js +0 -573
- package/lib/pi_component/tinyList/tinyList.tsx +0 -586
- package/lib/preact/compat/src/Children.js +0 -26
- package/lib/preact/compat/src/PureComponent.js +0 -19
- package/lib/preact/compat/src/events.js +0 -36
- package/lib/preact/compat/src/forwardRef.js +0 -29
- package/lib/preact/compat/src/index.d.ts +0 -121
- package/lib/preact/compat/src/index.js +0 -159
- package/lib/preact/compat/src/internal.d.ts +0 -45
- package/lib/preact/compat/src/memo.js +0 -34
- package/lib/preact/compat/src/portals.js +0 -85
- package/lib/preact/compat/src/render.js +0 -166
- package/lib/preact/compat/src/suspense-list.d.ts +0 -14
- package/lib/preact/compat/src/suspense-list.js +0 -127
- package/lib/preact/compat/src/suspense.d.ts +0 -15
- package/lib/preact/compat/src/suspense.js +0 -165
- package/lib/preact/compat/src/util.js +0 -23
- package/lib/preact/hooks/src/index.d.ts +0 -133
- package/lib/preact/hooks/src/index.js +0 -339
- package/lib/preact/hooks/src/internal.d.ts +0 -55
- package/lib/preact/src/clone-element.js +0 -27
- package/lib/preact/src/compat.ts +0 -0
- package/lib/preact/src/component.js +0 -219
- package/lib/preact/src/constants.js +0 -3
- package/lib/preact/src/create-context.js +0 -55
- package/lib/preact/src/create-element.js +0 -102
- package/lib/preact/src/css.d.ts +0 -30341
- package/lib/preact/src/diff/catch-error.js +0 -41
- package/lib/preact/src/diff/children.js +0 -259
- package/lib/preact/src/diff/index.js +0 -445
- package/lib/preact/src/diff/props.js +0 -163
- package/lib/preact/src/index.d.ts +0 -275
- package/lib/preact/src/index.js +0 -14
- package/lib/preact/src/internal.d.ts +0 -94
- package/lib/preact/src/jsx.d.ts +0 -884
- package/lib/preact/src/options.js +0 -16
- package/lib/preact/src/render.js +0 -98
- package/lib/preact/src/util.js +0 -25
- package/lib/preact-router/.travis.yml +0 -3
- package/lib/preact-router/LICENSE +0 -21
- package/lib/preact-router/README.md +0 -254
- package/lib/preact-router/index.d.ts +0 -71
- package/lib/preact-router/match/index.d.ts +0 -16
- package/lib/preact-router/match/package.json +0 -13
- package/lib/preact-router/match/src/cjs.js +0 -4
- package/lib/preact-router/match/src/index.js +0 -36
- package/lib/preact-router/package-lock.json +0 -12330
- package/lib/preact-router/package.json +0 -78
- package/lib/preact-router/src/cjs.js +0 -11
- package/lib/preact-router/src/index.js +0 -270
- package/lib/preact-router/src/util.js +0 -87
- package/lib/react-window/src/FixedSizeGrid.js +0 -244
- package/lib/react-window/src/FixedSizeList.js +0 -130
- package/lib/react-window/src/VariableSizeGrid.js +0 -507
- package/lib/react-window/src/VariableSizeList.js +0 -316
- package/lib/react-window/src/__tests__/FixedSizeGrid.js +0 -1336
- package/lib/react-window/src/__tests__/FixedSizeList.js +0 -966
- package/lib/react-window/src/__tests__/VariableSizeGrid.js +0 -779
- package/lib/react-window/src/__tests__/VariableSizeList.js +0 -442
- package/lib/react-window/src/__tests__/__snapshots__/FixedSizeGrid.js.snap +0 -912
- package/lib/react-window/src/__tests__/__snapshots__/FixedSizeList.js.snap +0 -568
- package/lib/react-window/src/__tests__/__snapshots__/VariableSizeGrid.js.snap +0 -542
- package/lib/react-window/src/__tests__/__snapshots__/VariableSizeList.js.snap +0 -331
- package/lib/react-window/src/__tests__/areEqual.js +0 -32
- package/lib/react-window/src/__tests__/shouldComponentUpdate.js +0 -36
- package/lib/react-window/src/areEqual.js +0 -18
- package/lib/react-window/src/createGridComponent.js +0 -919
- package/lib/react-window/src/createListComponent.js +0 -729
- package/lib/react-window/src/domHelpers.js +0 -72
- package/lib/react-window/src/index.js +0 -9
- package/lib/react-window/src/shallowDiffers.js +0 -17
- package/lib/react-window/src/shouldComponentUpdate.js +0 -16
- package/lib/react-window/src/test.js.flow +0 -382
- package/lib/react-window/src/timer.js +0 -36
- package/src/app/demopage.tsx +0 -77
- package/src/app/index.html +0 -48
- package/src/app/main.tsx +0 -30
- package/src/asset/Textures/Alert/bg_tips.png +0 -0
- package/src/asset/Textures/Alert/btn_zhedie_a.png +0 -0
- package/src/asset/Textures/Alert/com_home_bg_left.png +0 -0
- package/src/asset/Textures/Alert/com_home_bg_rightbar.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_a.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_back_top.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_bottombar_sheet.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_list_xiala.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_rightbar_line.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_rightbar_selected.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_touxiang_140.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_touxiang_60.png +0 -0
- package/src/asset/Textures/Commons/com_home_bg_touxiang_80.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_back.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_bottombar.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_bottombar_fadongtai.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_close.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_guanzhu_126.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_guanzhu_86.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_left_bianji.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_left_dongtai.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_left_touxiang.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_selet.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_yiguanzhu_126.png +0 -0
- package/src/asset/Textures/Commons/com_home_btn_yiguanzhu_86.png +0 -0
- package/src/asset/Textures/Commons/com_home_icon_bottombar_fadongtai.png +0 -0
- package/src/asset/Textures/Commons/com_home_icon_bottombar_red.png +0 -0
- package/src/asset/Textures/Commons/com_home_icon_loading.png +0 -0
- package/src/asset/Textures/Commons/com_home_pic_touxiang_moren.png +0 -0
- package/src/asset/Textures/Commons/com_home_tab_left_a.png +0 -0
- package/src/asset/Textures/Commons/com_home_tab_left_b.png +0 -0
- package/src/asset/Textures/Commons/com_home_tab_left_c.png +0 -0
- package/src/asset/Textures/Commons/feedItems/gc1_huati_icon_middle_v.png +0 -0
- package/src/asset/Textures/Commons/feedItems/gc1_huati_icon_middle_yonghurenzheng.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg_line.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg_middle_chakan.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg_middle_input.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_bg_zan.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_middle_input.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_more.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_photo_more.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_a.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_a_shadow.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_b_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_b_pressed.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_a_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_a_pressed.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_b_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_c_normal.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_d.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_e.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_f_share.png +0 -0
- package/src/asset/Textures/Commons/feedItems/pinglun_icon_middle_input_back.png +0 -0
- package/src/asset/Textures/Commons/gc1_huati_bg_middle_topbtn.png +0 -0
- package/src/asset/Textures/Commons/gc1_huati_bg_middle_topbtn_pressd.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_bg_music.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_btn_a.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_btn_b.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_icon_b.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_icon_d.png +0 -0
- package/src/asset/Textures/Commons/karaoke/rukou_icon_e.png +0 -0
- package/src/asset/Textures/Commons/rukou_bg_bottombar_line.png +0 -0
- package/src/asset/Textures/Commons/rukou_icon_a.png +0 -0
- package/src/asset/Textures/Commons/tc_bianji_tab_a.png +0 -0
- package/src/asset/Textures/Commons/tc_zanshang_bg_line.png +0 -0
- package/src/asset/Textures/Commons/touxiang_bg_tishikuang.png +0 -0
- package/src/asset/Textures/Commons/video/rukou_icon_shipin.png +0 -0
- package/src/asset/Textures/Commons/video/xiangce_btn_bofang.png +0 -0
- package/src/asset/Textures/Commons/voice/rukou_icon_yuyin.png +0 -0
- package/src/asset/Textures/Commons/voice/tc_yuyin_bg.png +0 -0
- package/src/asset/Textures/Commons/voice/tc_yuyin_bg_load.png +0 -0
- package/src/asset/Textures/Commons/voice/tc_yuyin_bg_xinhao_a.png +0 -0
- package/src/asset/Textures/Commons/voice/tc_yuyin_bg_xinhao_b.png +0 -0
- package/src/asset/Textures/Commons/xiangce_icon_bottombar_gulita.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_bottom.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_input.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_tips.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_topbar_a.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_topbar_line.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_upload_photo.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_upload_photo_line.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_bg_zhaopian_line.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_btn.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_btn_close.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_btn_upload_photo.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_radio_normal.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_radio_normal_@slice_0.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_radio_selected.png +0 -0
- package/src/asset/Textures/SocialSecond/com_tc_tab_a.png +0 -0
- package/src/asset/Textures/SocialSecond/gc1_huati_bg_middle_topbar.png +0 -0
- package/src/asset/Textures/SocialSecond/gc1_huati_bg_middle_topbar_pre.png +0 -0
- package/src/asset/Textures/SocialSecond/newmessage_bg_left_line.png +0 -0
- package/src/asset/Textures/SocialSecond/newmessage_bg_left_normal.png +0 -0
- package/src/asset/Textures/SocialSecond/newmessage_bg_left_selected.png +0 -0
- package/src/asset/Textures/SocialSecond/newmessage_bg_middle_new.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_list.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_list_line.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_list_my.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_list_top.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_bg_topbar_a.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_icon_topbar_selected.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_pic_1.png +0 -0
- package/src/asset/Textures/SocialSecond/paihang_pic_2.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_fadongtai_btn_close.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_guanzhu_bg_topbar.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_guanzhu_bg_topbar_selected.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_bg.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_bg_daoju.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_btn_a.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_btn_b.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_btn_c.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_pic_daoju1.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_pic_daoju2.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_liwu_pic_daoju3.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_pinglun_bg.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_shipin_tianjiashipin.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_bg.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_bg_delete.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_bg_xinhao_a.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_bg_xinhao_b.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_star.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_yuyin_stop.png +0 -0
- package/src/asset/Textures/SocialSecond/tc_zanshang_bg_line.png +0 -0
- package/src/asset/Textures/SocialSecond/touxiang_bg_tishikuang.png +0 -0
- package/src/asset/Textures/SocialSecond/xiangce_huadong.png +0 -0
- package/src/asset/Textures/SocialSecond/xiangce_huadong_xuanzhong.png +0 -0
- package/src/asset/Textures/SocialSecond/xiangce_icon_xiazai.png +0 -0
- package/src/asset/Textures/SocialVideo/com_home_btn_close.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_bg_guodu.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_jinduanjian.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_jindutiao.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_jindutiao_hui.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_play.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_play_big.png +0 -0
- package/src/asset/Textures/SocialVideo/tc_shipin_stop.png +0 -0
- package/src/asset/laugh.gif +0 -0
- package/src/asset/npms.png +0 -0
- package/src/asset/pixui.png +0 -0
- package/src/asset/preact.png +0 -0
- package/src/asset/template.html +0 -47
- package/src/common/frame/appsettings.js +0 -111
- package/src/common/frame/common.js +0 -17
- package/src/common/frame/platform-api-callback.js +0 -341
- package/src/common/frame/platform-api.d.ts +0 -156
- package/src/common/frame/platform-api.js +0 -479
- package/src/common/main.less +0 -119
- package/src/pixUIReactComponents/README.md +0 -8
- package/src/pixUIReactComponents/package.json +0 -11
- package/src/pixUIReactComponents/tsconfig.json +0 -45
- package/src/pixUIReactUtils/GenerateConstructorAndGeterSeter.js +0 -227
- package/src/pixUIReactUtils/MakeImage.js +0 -207
- package/src/pixUIReactUtils/README.md +0 -124
- package/src/pixUIReactUtils/Version.js +0 -3
- package/src/pixUIReactUtils/img/makeImage.png +0 -0
- package/src/pixUIReactUtils/index.js +0 -1
- package/src/pixUIReactUtils/package.json +0 -16
- package/src/preprocess/index.html +0 -48
- package/src/preprocess/main.tsx +0 -17
- package/src/preprocess/preprocesspage.tsx +0 -41
- /package/{src/pixUIReactComponents/cmdAfterTsBuild.js → cmdAfterTsBuild.js} +0 -0
- /package/{src/pixUIReactComponents/index.js → index.js} +0 -0
- /package/{src/pixUIReactComponents/tools → tools}/EventDispatcherJs.tsx +0 -0
- /package/{src/pixUIReactComponents/tools → tools}/Logger.tsx +0 -0
- /package/{src/pixUIReactComponents/tools → tools}/img/logger.png +0 -0
- /package/{src/pixUIReactComponents/tools → tools}/tools.md +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/bulletscreen/BulletItemAnimation.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/bulletscreen/BulletScreenAnimation.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/bulletscreen/bullet.less +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/button/Button.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/carousel/Carousel.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/checkBox/CheckBox.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/Dropdown.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/DropdownOptionUI.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/DropdownSpreadMainUI.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/DropdownUnspreadMainUI.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/gradient/GradientText.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/outlinetext/OutlineText.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/progress/Progress.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/slapface/Slapface.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/slapface/less/Slapface.less +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/slider/Slider.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/tab/Tab.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/tab/Tabs.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/togglegroup/ToggleGroup.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/videoplayer/VideoPlayer.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/waterfallcomponent/WaterfallComponent.jsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/components/waterfallcomponent/less/WaterfallComponent.less +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/Images.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/OutlineText/OutlineDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/Slapface/SlapfaceDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/btn_close.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/changtai_button.jpg +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/checkbox0.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/checkbox1.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/data_arrow_down.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/data_arrow_up.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/dot.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/inner.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/item_reddot.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/loading.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/money_dropdown.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/money_dropdownall.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/outer.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic1.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic2.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic3.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic4.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic5.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic6.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/tab_choosed.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/tabs_bg.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/video_pause.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/video_play.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/video_reload.png +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/xuanfu_button.jpg +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/asset/yaxia_button.jpg +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/bulletscreen/BulletDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/button/ButtonDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/carousel/carouselDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/checkBox/checkBoxDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/DropdownDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/MoneyDropdownOption.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/MoneyDropdownSpreadMain.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/MoneyDropdownUnspreadMain.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/gradient/GradientDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/less/video.less +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/progress/ProgressDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/slider/SliderDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/tab/TabDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/tab/TopTab.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/togglegroup/ToggleGroupDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/videoplayer/VideoPlayerDemo.tsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/sample/waterfallcomponent/WaterfallComponentDemo.jsx +0 -0
- /package/{src/pixUIReactComponents/ui → ui}/ui.md +0 -0
package/README.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
#
|
|
2
|
-
PixUI应用已经落地多款业务。面向应用层开发,已解决过很多问题,有一些积累和沉淀。
|
|
1
|
+
# 组件库
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
本组件库目前分为2大类:ui组件和工具组件。分别参见目录ui/和目录tools。
|
|
4
|
+
具体组件说明,参见对应类别目录下的md文档
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
* 各种脚本工具,参见src/ pixUIReactUtils目录; 已打成npm包 pixuireactutils,直接安装即可使用。
|
|
6
|
+
## 使用说明
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
https://gamelet.qq.com/docv2/public/d/Client-Development-Guide/PixUI-React-Components
|
package/package.json
CHANGED
|
@@ -1,68 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@tencent/pandora-sdk-utils": "^1.0.0",
|
|
12
|
-
"animate.css": "^3.7.2",
|
|
13
|
-
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
|
14
|
-
"google-protobuf": "^3.8.0",
|
|
15
|
-
"grpc-promise": "^1.4.0",
|
|
16
|
-
"gsap": "^3.2.6",
|
|
17
|
-
"mobx": "^5.10.1",
|
|
18
|
-
"mobx-react": "^6.2.2",
|
|
19
|
-
"preact": "^10.4.0",
|
|
20
|
-
"react-virtualized": "^9.21.2",
|
|
21
|
-
"react-window": "^1.8.5",
|
|
22
|
-
"replace": "^1.1.0",
|
|
23
|
-
"rxjs": "^6.5.5",
|
|
24
|
-
"screenfull": "^5.0.2",
|
|
25
|
-
"typescript": "^3.9.7"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@babel/core": "^7.9.0",
|
|
29
|
-
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
|
30
|
-
"@babel/plugin-proposal-decorators": "^7.8.3",
|
|
31
|
-
"@babel/plugin-syntax-jsx": "^7.8.3",
|
|
32
|
-
"@babel/plugin-transform-flow-strip-types": "^7.9.0",
|
|
33
|
-
"@babel/plugin-transform-react-jsx": "^7.9.4",
|
|
34
|
-
"@babel/preset-env": "^7.9.6",
|
|
35
|
-
"@babel/preset-typescript": "^7.9.0",
|
|
36
|
-
"@types/jest": "25.2.1",
|
|
37
|
-
"@types/node": "13.11.1",
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^2.28.0",
|
|
39
|
-
"@typescript-eslint/parser": "^2.28.0",
|
|
40
|
-
"babel-loader": "^8.1.0",
|
|
41
|
-
"babel-plugin-import": "^1.12.0",
|
|
42
|
-
"babel-plugin-jsx-pragmatic": "^1.0.2",
|
|
43
|
-
"babel-plugin-module-resolver": "^4.0.0",
|
|
44
|
-
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
45
|
-
"clean-webpack-plugin": "^3.0.0",
|
|
46
|
-
"cross-env": "^7.0.3",
|
|
47
|
-
"css-loader": "^3.5.2",
|
|
48
|
-
"error-overlay-webpack-plugin": "^0.4.1",
|
|
49
|
-
"eslint": "^6.8.0",
|
|
50
|
-
"eslint-plugin-jest": "^23.8.2",
|
|
51
|
-
"extract-text-webpack-plugin": "^3.0.2",
|
|
52
|
-
"file-loader": "^6.0.0",
|
|
53
|
-
"fork-ts-checker-webpack-plugin": "^4.1.3",
|
|
54
|
-
"html-webpack-plugin": "^4.2.0",
|
|
55
|
-
"less": "^3.11.1",
|
|
56
|
-
"less-loader": "^5.0.0",
|
|
57
|
-
"prettier": "2.0.4",
|
|
58
|
-
"sass": "^1.26.5",
|
|
59
|
-
"sass-loader": "^8.0.2",
|
|
60
|
-
"source-map-explorer": "^2.0.1",
|
|
61
|
-
"style-loader": "^1.1.3",
|
|
62
|
-
"ts-protoc-gen": "^0.10.0",
|
|
63
|
-
"webpack": "^4.42.1",
|
|
64
|
-
"webpack-bundle-analyzer": "^3.7.0",
|
|
65
|
-
"webpack-cli": "^3.3.11",
|
|
66
|
-
"webpack-dev-server": "^3.10.3"
|
|
67
|
-
}
|
|
2
|
+
"name": "pixuireactcomponents",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "pixui react components",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"author": "hardenzheng",
|
|
10
|
+
"license": "ISC"
|
|
68
11
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,31 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "es5",
|
|
4
|
-
"module": "
|
|
5
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
|
+
"module": "ES6",
|
|
6
5
|
"baseUrl": ".",
|
|
7
6
|
"paths": {
|
|
8
|
-
"preact": ["lib/preact/src"],
|
|
9
|
-
"preact/hooks": ["lib/preact/hooks/src"],
|
|
10
|
-
"preact-router": ["lib/preact-router"],
|
|
11
|
-
"preact-router/match": ["lib/preact-router/match"]
|
|
7
|
+
"preact": ["../../lib/preact/src"],
|
|
12
8
|
},
|
|
13
|
-
"outDir": "
|
|
14
|
-
"experimentalDecorators": true,
|
|
9
|
+
"outDir": "../publish_components",
|
|
15
10
|
"allowJs": true,
|
|
16
11
|
"skipLibCheck": true,
|
|
17
12
|
"esModuleInterop": true,
|
|
18
13
|
"allowSyntheticDefaultImports": true,
|
|
19
14
|
"strict": true,
|
|
20
15
|
"forceConsistentCasingInFileNames": true,
|
|
21
|
-
"moduleResolution":
|
|
16
|
+
"moduleResolution":"node",
|
|
22
17
|
"resolveJsonModule": true,
|
|
23
18
|
"noImplicitAny": false,
|
|
24
|
-
"jsx":
|
|
19
|
+
"jsx":"react",
|
|
25
20
|
"jsxFactory": "h",
|
|
26
|
-
|
|
21
|
+
// "sourceMap": false,
|
|
22
|
+
"declaration": true,
|
|
23
|
+
"declarationDir": "../publish_components"
|
|
27
24
|
// "noEmit": true
|
|
28
25
|
},
|
|
29
|
-
"
|
|
30
|
-
|
|
26
|
+
"files":[
|
|
27
|
+
"index.js",
|
|
28
|
+
"package.json",
|
|
29
|
+
],
|
|
30
|
+
"include": [
|
|
31
|
+
"ui/components/tab/*",
|
|
32
|
+
"ui/components/slider/*",
|
|
33
|
+
"ui/components/progress/*",
|
|
34
|
+
"ui/components/dropdown/*",
|
|
35
|
+
"ui/components/gradient/*",
|
|
36
|
+
"ui/components/outlinetext",
|
|
37
|
+
"tools/*",
|
|
38
|
+
"ui/components/carousel/*",
|
|
39
|
+
"ui/components/slapface/*",
|
|
40
|
+
"ui/components/slapface/less/*",
|
|
41
|
+
"ui/components/button/*",
|
|
42
|
+
|
|
43
|
+
],
|
|
44
|
+
|
|
31
45
|
}
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
node: true,
|
|
5
|
-
},
|
|
6
|
-
parser: '@typescript-eslint/parser',
|
|
7
|
-
parserOptions: {
|
|
8
|
-
project: './tsconfig.json',
|
|
9
|
-
},
|
|
10
|
-
plugins: ['jest', '@typescript-eslint'],
|
|
11
|
-
extends: [
|
|
12
|
-
'eslint:recommended',
|
|
13
|
-
// 'plugin:react/recommended',
|
|
14
|
-
'plugin:@typescript-eslint/eslint-recommended',
|
|
15
|
-
'plugin:@typescript-eslint/recommended',
|
|
16
|
-
],
|
|
17
|
-
overrides: [
|
|
18
|
-
{
|
|
19
|
-
files: ['*.ts', '*.tsx'],
|
|
20
|
-
rules: {
|
|
21
|
-
'prefer-const': [0],
|
|
22
|
-
'no-var': [2],
|
|
23
|
-
'no-constant-condition': [0],
|
|
24
|
-
'@typescript-eslint/camelcase': [0],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
rules: {
|
|
29
|
-
'prefer-const': [0],
|
|
30
|
-
'linebreak-style': ['error', 'unix'],
|
|
31
|
-
quotes: ['error', 'single', { avoidEscape: true }],
|
|
32
|
-
semi: ['error', 'always'],
|
|
33
|
-
'no-console': [1, { allow: ['warn', 'error', 'log', 'enable_trace'] }],
|
|
34
|
-
'no-unused-vars': [0],
|
|
35
|
-
// 'comma-dangle': ['error', 'always-multiline'],
|
|
36
|
-
// 'react/prop-types': [0],
|
|
37
|
-
'@typescript-eslint/no-explicit-any': [0],
|
|
38
|
-
'@typescript-eslint/no-empty-function': [0],
|
|
39
|
-
'@typescript-eslint/no-empty-interface': [0],
|
|
40
|
-
'@typescript-eslint/no-unused-vars': [0],
|
|
41
|
-
'@typescript-eslint/no-use-before-define': [0],
|
|
42
|
-
'@typescript-eslint/explicit-member-accessibility': [0],
|
|
43
|
-
'@typescript-eslint/no-var-requires': [0],
|
|
44
|
-
'@typescript-eslint/no-non-null-assertion': [0],
|
|
45
|
-
'@typescript-eslint/explicit-function-return-type': [0],
|
|
46
|
-
},
|
|
47
|
-
settings: {},
|
|
48
|
-
};
|
package/.pixiderc/apps.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "http://px.woa.com/schemas/devel-config",
|
|
4
|
-
"title": "Development Config Schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"required": [],
|
|
7
|
-
"properties": {
|
|
8
|
-
"clientLogEnablement": {
|
|
9
|
-
"title": "客户端日志开关",
|
|
10
|
-
"type": "boolean"
|
|
11
|
-
},
|
|
12
|
-
"customConfig": {
|
|
13
|
-
"type": "object",
|
|
14
|
-
"title": "自定义配置",
|
|
15
|
-
"patternProperties": {
|
|
16
|
-
"^[a-zA-Z][a-zA-Z0-9_]*$": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"title": "自定义开发配置项"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
package/.pixiderc/postinstall.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const { rmdirSync, existsSync } = require('fs');
|
|
2
|
-
const { resolve: pathResolve } = require('path');
|
|
3
|
-
|
|
4
|
-
// rm -rf node_modules/@types/react && rm -rf node_modules/preact
|
|
5
|
-
|
|
6
|
-
const dirs = [
|
|
7
|
-
pathResolve(__dirname, '..', 'node_modules/@types/react'),
|
|
8
|
-
pathResolve(__dirname, '..', 'node_modules/preact'),
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
dirs.forEach(dir => {
|
|
12
|
-
existsSync(dir) && rmdirSync(dir, {recursive: true});
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
// > 14.14之后可以使用rmSync:
|
|
16
|
-
// rmSync(pathResolve(__dirname, '..', 'node_modules/@types/react'), {recursive: true, force: true});
|
|
17
|
-
// rmSync(pathResolve(__dirname, '..', 'node_modules/preact'), {recursive: true, force: true});
|
package/.pixiderc/util.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
const port = process.env.port || 8080;
|
|
2
|
-
const { rtCompilerToolPath } = process.env;
|
|
3
|
-
module.exports.getLocalIP = function () {
|
|
4
|
-
let os = require('os');
|
|
5
|
-
let ifaces = os.networkInterfaces();
|
|
6
|
-
|
|
7
|
-
let ipList = [];
|
|
8
|
-
Object.keys(ifaces).forEach(function (ifname) {
|
|
9
|
-
let alias = 0;
|
|
10
|
-
|
|
11
|
-
ifaces[ifname].forEach(function (iface) {
|
|
12
|
-
if ('IPv4' !== iface.family || iface.internal !== false) {
|
|
13
|
-
// skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
ipList.push(iface.address);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
console.log('iplist', ipList);
|
|
20
|
-
return ipList;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
module.exports.setupFilter = (appDef) =>
|
|
24
|
-
function (app, servers) {
|
|
25
|
-
let log = () => {};
|
|
26
|
-
log = console.log;
|
|
27
|
-
|
|
28
|
-
app.disable('etag');
|
|
29
|
-
|
|
30
|
-
app.get('/log0', (req, res) => {
|
|
31
|
-
log = () => {};
|
|
32
|
-
res.send('ok');
|
|
33
|
-
});
|
|
34
|
-
app.get('/log1', (req, res) => {
|
|
35
|
-
log = console.log;
|
|
36
|
-
res.send('ok');
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
//拦截输出,当agent为PixUI且输出类型为html时,转换为fbs二进制数据再返回
|
|
40
|
-
app.use((req, res, next) => {
|
|
41
|
-
//去掉缓存标记,因为很可能源文件没变,但转换后的表示变了
|
|
42
|
-
delete req.headers['if-none-match'];
|
|
43
|
-
let ua = req.get('User-Agent');
|
|
44
|
-
log('req', req.url, ua, JSON.stringify(req.headers));
|
|
45
|
-
|
|
46
|
-
let _write = res.write;
|
|
47
|
-
let _end = res.end;
|
|
48
|
-
let _send = res.send;
|
|
49
|
-
|
|
50
|
-
let buffers = [];
|
|
51
|
-
var addBuffer = (chunk, encoding) => {
|
|
52
|
-
if (chunk === undefined) return;
|
|
53
|
-
if (typeof chunk === 'string') {
|
|
54
|
-
chunk = Buffer.from(chunk, encoding);
|
|
55
|
-
}
|
|
56
|
-
buffers.push(chunk);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
//处理直接裸写的情况,一般见于发送静态文件
|
|
60
|
-
res.write = function (chunk, encoding) {
|
|
61
|
-
let type = res.get('Content-Type');
|
|
62
|
-
log('hook write...', type, chunk);
|
|
63
|
-
addBuffer(chunk, encoding);
|
|
64
|
-
};
|
|
65
|
-
res.end = function (chunk, encoding) {
|
|
66
|
-
let type = res.get('Content-Type');
|
|
67
|
-
if (chunk) addBuffer(chunk, encoding);
|
|
68
|
-
let data = Buffer.concat(buffers);
|
|
69
|
-
log('hook end...', type, data.length);
|
|
70
|
-
res.write = _write;
|
|
71
|
-
res.end = _end;
|
|
72
|
-
_send.call(this, data);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
//处理通过send发送的情况,如webpack合成的html
|
|
76
|
-
res.send = function (c) {
|
|
77
|
-
let type = res.get('Content-Type') || 'text/plain';
|
|
78
|
-
let isPixUI = /PixUI/.test(ua);
|
|
79
|
-
let ver = /(\d)\.(\d)\.(\d+)/.exec(ua); // 0.2.*以上
|
|
80
|
-
let isHTML = type.indexOf('text/html') >= 0;
|
|
81
|
-
let isJS = type.indexOf('javascript') >= 0;
|
|
82
|
-
let isCSS = type.indexOf('text/css') >= 0;
|
|
83
|
-
log('hook send...', c.length, type);
|
|
84
|
-
if (isPixUI && parseInt(ver[2]) >= 2 && (isHTML || isJS)) {
|
|
85
|
-
let cp = require('child_process');
|
|
86
|
-
let opts = isJS ? ['--js'] : [];
|
|
87
|
-
let child = cp.spawn(rtCompilerToolPath, ['--src', 'stdin', ...opts]);
|
|
88
|
-
child.stdin.write(c);
|
|
89
|
-
child.stdout.on('data', (data) => {
|
|
90
|
-
// console.log('get data from fbs', req.url, data.byteLength);
|
|
91
|
-
addBuffer(data);
|
|
92
|
-
});
|
|
93
|
-
child.stdout.on('close', () => {
|
|
94
|
-
// console.log('get data from fbs finish!!', req.url);
|
|
95
|
-
res.end();
|
|
96
|
-
});
|
|
97
|
-
child.stderr.on('data', (data) => {
|
|
98
|
-
console.log('get err from fbs', data.toString());
|
|
99
|
-
});
|
|
100
|
-
child.stdin.end();
|
|
101
|
-
} else {
|
|
102
|
-
_send.call(this, c);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
next();
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
//一个虚拟path,可以随时修改指向地址,可以将此地址硬编码到测试代码里,每次想切换测试页面就不用改代码重新编译了
|
|
109
|
-
let testTo;
|
|
110
|
-
app.get('/test', (req, res) => {
|
|
111
|
-
if (req.query.to) {
|
|
112
|
-
testTo = '/' + req.query.to;
|
|
113
|
-
res.send(`set /test to ${testTo}`);
|
|
114
|
-
return;
|
|
115
|
-
} else {
|
|
116
|
-
if (!testTo) {
|
|
117
|
-
res.send('use /test?to=xxx to set redirect target');
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
res.redirect(testTo);
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
//定制首页显示所有entry,方便浏览
|
|
125
|
-
app.get(`/`, (req, res) => {
|
|
126
|
-
res.setHeader('content-type', 'text/html');
|
|
127
|
-
res.send(
|
|
128
|
-
appDef
|
|
129
|
-
.concat([{ name: 'test' }])
|
|
130
|
-
.map((v) => {
|
|
131
|
-
return `<a href=${port}/${v.name} style='font-size:36px'>${v.name}</a>`;
|
|
132
|
-
})
|
|
133
|
-
.join('<br>') + "<div style='font-size:40pt' onclick='window.close();'>close</div>"
|
|
134
|
-
);
|
|
135
|
-
});
|
|
136
|
-
};
|
package/.pixiderc/webpack.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const webpack = require('webpack');
|
|
4
|
-
|
|
5
|
-
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
6
|
-
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
7
|
-
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
8
|
-
const { getLocalIP, setupFilter } = require('./util');
|
|
9
|
-
|
|
10
|
-
const pr = path.resolve;
|
|
11
|
-
let isShipping = process.env.mode != 'development';
|
|
12
|
-
let rootDir = pr(__dirname, '..', 'dist');
|
|
13
|
-
let pandoraHtmlDir = pr(__dirname, '..');
|
|
14
|
-
let buildOutputPath = pr(rootDir, 'html' + (isShipping ? '-pro' : '-dev'));
|
|
15
|
-
|
|
16
|
-
function getHtmlName(v) {
|
|
17
|
-
switch (v.name) {
|
|
18
|
-
case 'app': {
|
|
19
|
-
return 'index.html'; // app不允许自定义
|
|
20
|
-
}
|
|
21
|
-
case 'preprocess': {
|
|
22
|
-
return 'preprocess.html'; // preprocess不允许自定义
|
|
23
|
-
}
|
|
24
|
-
default: {
|
|
25
|
-
return v.output ? `${v.output}.html` : `${v.name}.html`;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// let port = 8080;
|
|
31
|
-
// const port = require(pr(__dirname, '..', '.pixiderc.json'))['devServer.port'];
|
|
32
|
-
const port = process.env.port || 8080;
|
|
33
|
-
///////////////////////////////////
|
|
34
|
-
//所有app定义在这里
|
|
35
|
-
// TODO 把这部分配置放到单独的JSON文件中,便于自动生成或者通过图形界面管理
|
|
36
|
-
let appDef = require(pr(__dirname, 'apps.json'));
|
|
37
|
-
if (fs.existsSync(pr(__dirname, 'custom.json'))) {
|
|
38
|
-
appDef = [...appDef, ...require(pr(__dirname, 'custom.json'))]
|
|
39
|
-
}
|
|
40
|
-
const appSettings = require(pr(__dirname, 'appsettings.json'));
|
|
41
|
-
|
|
42
|
-
console.log({isShipping});
|
|
43
|
-
|
|
44
|
-
const htmlCopyPlugins = appDef.map((app) => {
|
|
45
|
-
return app.template ? new HtmlWebpackPlugin({
|
|
46
|
-
hash: isShipping,
|
|
47
|
-
minify: isShipping,
|
|
48
|
-
chunks: [app.name],
|
|
49
|
-
template: app.template,
|
|
50
|
-
filename: app.name + '/' + getHtmlName(app),
|
|
51
|
-
}) : false;
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
let plugins = [
|
|
55
|
-
new webpack.DefinePlugin({
|
|
56
|
-
APP_SETTING: JSON.stringify(appSettings),
|
|
57
|
-
}),
|
|
58
|
-
new CleanWebpackPlugin({
|
|
59
|
-
cleanOnceBeforeBuildPatterns: [
|
|
60
|
-
'**/*',
|
|
61
|
-
path.join(rootDir, '.build'),
|
|
62
|
-
|
|
63
|
-
]
|
|
64
|
-
}),
|
|
65
|
-
new ForkTsCheckerWebpackPlugin({ async: false }),
|
|
66
|
-
...htmlCopyPlugins,
|
|
67
|
-
!isShipping ? new webpack.HotModuleReplacementPlugin() : undefined,
|
|
68
|
-
].filter((v) => !!v);
|
|
69
|
-
|
|
70
|
-
let rewrites = appDef.map((v) => {
|
|
71
|
-
return { from: new RegExp(`^/${v.name}/`), to: `/${v.name}` };
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
module.exports = {
|
|
75
|
-
entry: Object.fromEntries(appDef.map((v) => [v.name, v.entry])),
|
|
76
|
-
output: {
|
|
77
|
-
path: buildOutputPath,
|
|
78
|
-
filename: '[name]/[name].js',
|
|
79
|
-
publicPath: isShipping
|
|
80
|
-
? '../' //发布后都从文件系统加载,使用相对路径引用素材
|
|
81
|
-
: '/', // `http://${getLocalIP()[0]}:${port}/`, //开发时绑定到外部ip,方便手机访问
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
resolve: {
|
|
85
|
-
modules: [`${pandoraHtmlDir}/src/node_modules`, pandoraHtmlDir, `${pandoraHtmlDir}/node_modules`], //必须使用绝对路径,不然那些符号链接过来的源文件会找不到当前目录下的node_modules
|
|
86
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
87
|
-
alias: {
|
|
88
|
-
['preact$']: path.resolve('./lib/preact/src'),
|
|
89
|
-
['preact/hooks$']: path.resolve('./lib/preact/hooks/src'),
|
|
90
|
-
['preact-router$']: path.resolve('./lib/preact-router/src'),
|
|
91
|
-
['preact-router/match']: path.resolve('./lib/preact-router/match/src'),
|
|
92
|
-
['react-window']: path.resolve('./lib/react-window/src'),
|
|
93
|
-
['@improbable-eng/grpc-web']: path.resolve('./lib/grpc-web/dist'),
|
|
94
|
-
react: path.resolve('./lib/preact/compat/src'),
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
module: {
|
|
99
|
-
rules: [
|
|
100
|
-
{
|
|
101
|
-
test: /.(js|ts)x?$/,
|
|
102
|
-
use: {
|
|
103
|
-
loader: require.resolve('babel-loader'),
|
|
104
|
-
options: {
|
|
105
|
-
presets: [['@babel/preset-typescript', { allowNamespaces: true }]],
|
|
106
|
-
plugins: [
|
|
107
|
-
'@babel/plugin-transform-flow-strip-types',
|
|
108
|
-
'@babel/plugin-syntax-jsx',
|
|
109
|
-
['@babel/plugin-proposal-decorators', { legacy: true }],
|
|
110
|
-
['@babel/plugin-proposal-class-properties'],
|
|
111
|
-
['@babel/plugin-proposal-optional-chaining'],
|
|
112
|
-
['@babel/plugin-transform-react-jsx', { pragma: 'makeDOM' }],
|
|
113
|
-
['babel-plugin-jsx-pragmatic', { module: __dirname + '/../lib/dom', import: 'makeDOM' }],
|
|
114
|
-
// 'babel-plugin-transform-remove-console',
|
|
115
|
-
],
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
// include: [path.resolve(__dirname + '/../')],
|
|
119
|
-
exclude: /node_modules/,
|
|
120
|
-
},
|
|
121
|
-
//注:我们自己不写css,因此只有第3方库有css,它们的css不使用module(antd)
|
|
122
|
-
{
|
|
123
|
-
test: /\.css$/,
|
|
124
|
-
use: [require.resolve('style-loader'), require.resolve('css-loader')],
|
|
125
|
-
},
|
|
126
|
-
//我们自己只写less或sass,且必须使用module
|
|
127
|
-
{
|
|
128
|
-
test: /\.less$/,
|
|
129
|
-
use: ['style-loader', { loader: require.resolve('css-loader'), options: { modules: true } }, { loader: require.resolve('less-loader'), options: { javascriptEnabled: true } }],
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
test: /\.s[ac]ss$/i,
|
|
133
|
-
use: ['style-loader', { loader: require.resolve('css-loader'), options: { modules: false } }, 'sass-loader'],
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
test: /\.(png|jpg|gif|lottie)$/,
|
|
137
|
-
loader: require.resolve('file-loader'),
|
|
138
|
-
options: {
|
|
139
|
-
name: 'static/media/[name].[hash:8].[ext]',
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
optimization: {
|
|
146
|
-
minimize: false,
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
devtool: 'source-map',
|
|
150
|
-
|
|
151
|
-
plugins,
|
|
152
|
-
|
|
153
|
-
devServer: {
|
|
154
|
-
sockPath: `/${port}/sockjs-node`,
|
|
155
|
-
sockPort: port,
|
|
156
|
-
port,
|
|
157
|
-
host: '0.0.0.0',
|
|
158
|
-
transportMode: 'ws',
|
|
159
|
-
|
|
160
|
-
hot: true,
|
|
161
|
-
liveReload: true,
|
|
162
|
-
// inline: false,
|
|
163
|
-
disableHostCheck: true,
|
|
164
|
-
overlay: true,
|
|
165
|
-
writeToDisk: true,
|
|
166
|
-
|
|
167
|
-
contentBase: [__dirname + '/../lib/assets'],
|
|
168
|
-
watchContentBase: true,
|
|
169
|
-
|
|
170
|
-
historyApiFallback: {
|
|
171
|
-
rewrites,
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
headers: {
|
|
175
|
-
'Access-Control-Allow-Origin': '*', //方便本机用localhost打开,难记ip
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
before: setupFilter(appDef),
|
|
179
|
-
},
|
|
180
|
-
};
|