pixuireactcomponents 1.3.37 → 1.3.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixuireactcomponents",
3
- "version": "1.3.37",
3
+ "version": "1.3.38",
4
4
  "description": "pixui react components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,7 @@
1
1
  import { Component, CSSProperties, h } from 'preact';
2
2
  interface ImageViewerProps {
3
+ rootId?: string;
4
+ rootClassName?: string;
3
5
  src: string;
4
6
  onClose: Function;
5
7
  backgroundStyle?: CSSProperties;
@@ -90,7 +90,7 @@ var ImageViewer = /** @class */ (function (_super) {
90
90
  // forceupdate: false,
91
91
  // })
92
92
  // }
93
- return (h("div", { style: this.props.backgroundStyle, onClick: this.onClose },
93
+ return (h("div", { style: this.props.backgroundStyle, onClick: this.onClose, id: this.props.rootId, className: this.props.rootClassName },
94
94
  h("div", { style: this.props.imageBoxStyle },
95
95
  h("div", { id: "imageArea", style: this.props.imageAreaStyle },
96
96
  this.state.reCalSize &&
@@ -54,6 +54,7 @@ ImgPreLoader.preLoadUrl = function (url) { return __awaiter(void 0, void 0, void
54
54
  case 1:
55
55
  stashed = _a.sent();
56
56
  if (stashed != '') {
57
+ console.log('utils.preLoadUrl 已缓存过', url, 'filename: ', fileName_1);
57
58
  return [2 /*return*/];
58
59
  }
59
60
  xhr_1 = new XMLHttpRequest();
@@ -90,7 +91,7 @@ var getPreLoadUrl = function (url) { return __awaiter(void 0, void 0, void 0, fu
90
91
  case 0: return [4 /*yield*/, utils.readCookie(utils.getHashStr(url))];
91
92
  case 1:
92
93
  res = _a.sent();
93
- console.log('utils.getPreLoadUrl', res == '' ? '未缓存' : '已缓存');
94
+ console.log('utils.getPreLoadUrl', url, res == '' ? '未缓存' : '已缓存');
94
95
  if (res == '') {
95
96
  return [2 /*return*/, url];
96
97
  }
@@ -111,11 +112,11 @@ export var PreLoadPic = function (props) {
111
112
  if (usePreload) {
112
113
  getPreLoadUrl(url).then(function (__url) {
113
114
  if (!loaded) {
114
- console.log('PicComp--替换加载的url为base64', url);
115
+ console.log('PicComp-- 没有onload,使用cookie结果', url, __url.substring(0, 1000));
115
116
  setUrl(__url);
116
117
  }
117
118
  else {
118
- console.log('PicComp--onLoaded,不替换', url);
119
+ console.log('PicComp-- onLoaded,跳过cookie', url);
119
120
  }
120
121
  });
121
122
  }