hzerojs-plugin-yqcloud-jssdk 1.0.3 → 1.0.5

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/lib/index.css CHANGED
@@ -1,3 +1,14 @@
1
1
  .yqcloud-hzero-jssdk-popover .c7n-popover-inner-content{
2
2
  padding: 0;
3
3
  }
4
+ .yq-hzero-jssdk-btn:hover {
5
+ color: #0840f8;
6
+ }
7
+ .yq-hzero-jssdk-btn {
8
+ font-size: 13px;
9
+ color: #0f1358;
10
+ cursor: pointer;
11
+ }
12
+ .yqcloud-hzero-jssdk-popover.c7n-popover.c7n-popover .c7n-popover-content .c7n-popover-inner .c7n-popover-inner-content {
13
+ padding: 0;
14
+ }
package/lib/index.js CHANGED
@@ -39,6 +39,7 @@ var import_popover = __toESM(require("choerodon-ui/es/popover"));
39
39
  var import_button = __toESM(require("choerodon-ui/pro/es/button"));
40
40
  var import_axios = __toESM(require("axios"));
41
41
  var import_index = require("./index.css");
42
+ var import_hzero_ui = require("hzero-ui");
42
43
  var YQ_API_HOST = "https://api.test.yqcloud.com";
43
44
  var src_default = (props) => {
44
45
  var _a, _b;
@@ -83,14 +84,14 @@ var src_default = (props) => {
83
84
  console.log("【YQCloud】解析配置成功:", appConfig2);
84
85
  }
85
86
  } catch (e) {
86
- console.log("【YQCloud】解析配置失败:", e, res);
87
+ console.log("【YQCloud】解析配置失败:", e);
87
88
  }
88
89
  });
89
90
  }, [isVisible]);
90
91
  const openModal = async (openFunction) => {
91
92
  const secret = await import_axios.default.get(tokenPath || "/iam/v1/zknow/encrypt/quick");
92
93
  const authUrl = `${apiHost}/oauth/public/quick_authentication?token=${token}`;
93
- const res2 = await import_axios.default.post(authUrl, {
94
+ const res = await import_axios.default.post(authUrl, {
94
95
  secret
95
96
  // code,
96
97
  });
@@ -111,7 +112,7 @@ var src_default = (props) => {
111
112
  height: "calc(100vh - 100px)"
112
113
  },
113
114
  header: null,
114
- children: /* @__PURE__ */ import_react.default.createElement("iframe", { id: "yq-sdk-frame", style: { width: "100%", height: "100%" }, src: `${openFunction.link}&redirectFlag&access_token=${res2.accessToken}&token_type=bearer`, frameBorder: "0" }),
115
+ children: /* @__PURE__ */ import_react.default.createElement("iframe", { id: "yq-sdk-frame", style: { width: "100%", height: "100%" }, src: `${openFunction.link}&redirectFlag&access_token=${res.accessToken}&token_type=bearer`, frameBorder: "0" }),
115
116
  footer: null
116
117
  });
117
118
  function closeModal(e) {
@@ -122,8 +123,11 @@ var src_default = (props) => {
122
123
  }
123
124
  window.addEventListener("message", closeModal);
124
125
  };
125
- const menu = /* @__PURE__ */ import_react.default.createElement(import_menu.default, null, (_a = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _a.map((openFunction) => /* @__PURE__ */ import_react.default.createElement(import_menu.default.Item, { onClick: () => openModal(openFunction) }, /* @__PURE__ */ import_react.default.createElement("img", { style: { width: 18, height: 18, marginRight: 10 }, src: `${apiHost}/hfle/yqc/v1/0/files/download-by-key?fileKey=${openFunction.icon}`, alt: "" }), openFunction.displayName)));
126
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "yqcloud-hzero-jssdk", ref: eleRef }, ((_b = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _b.length) === 1 ? /* @__PURE__ */ import_react.default.createElement(import_button.default, { onClick: () => openModal(appConfig == null ? void 0 : appConfig.openFunctions[0]) }, (appConfig == null ? void 0 : appConfig.displayName) || (appConfig == null ? void 0 : appConfig.name)) : /* @__PURE__ */ import_react.default.createElement(import_popover.default, { overlayClassName: "yqcloud-hzero-jssdk-popover", overlayStyle: { padding: 0 }, openClassName: "yqcloud-hzero-jssdk-popover", content: menu, placement: "left" }, /* @__PURE__ */ import_react.default.createElement(import_button.default, { style: { padding: 0 } }, /* @__PURE__ */ import_react.default.createElement("img", { style: { width: 18, height: 18, marginRight: 10 }, src: `${apiHost}/hfle/yqc/v1/0/files/download-by-key?fileKey=${appConfig.icon}`, alt: "" }), entryDetail.entryName || (appConfig == null ? void 0 : appConfig.displayName) || (appConfig == null ? void 0 : appConfig.name))));
126
+ function defaultIcon() {
127
+ return /* @__PURE__ */ import_react.default.createElement(import_hzero_ui.Icon, { type: "picture" });
128
+ }
129
+ const menu = /* @__PURE__ */ import_react.default.createElement(import_menu.default, null, (_a = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _a.map((openFunction) => /* @__PURE__ */ import_react.default.createElement(import_menu.default.Item, { onClick: () => openModal(openFunction) }, openFunction.icon ? /* @__PURE__ */ import_react.default.createElement("img", { style: { width: 18, height: 18, marginRight: 10 }, src: `${apiHost}/hfle/yqc/v1/0/files/download-by-key?fileKey=${openFunction.icon}`, alt: "" }) : defaultIcon(), openFunction.displayName)));
130
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "yqcloud-hzero-jssdk", ref: eleRef }, ((_b = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _b.length) === 1 ? /* @__PURE__ */ import_react.default.createElement(import_button.default, { onClick: () => openModal(appConfig == null ? void 0 : appConfig.openFunctions[0]) }, (appConfig == null ? void 0 : appConfig.displayName) || (appConfig == null ? void 0 : appConfig.name)) : /* @__PURE__ */ import_react.default.createElement(import_popover.default, { overlayClassName: "yqcloud-hzero-jssdk-popover", overlayStyle: { padding: 0 }, openClassName: "yqcloud-hzero-jssdk-popover", content: menu, placement: "left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "yq-hzero-jssdk-btn", style: { padding: 0 } }, appConfig.icon ? /* @__PURE__ */ import_react.default.createElement("img", { style: { width: 18, height: 18, marginRight: 10 }, src: `${apiHost}/hfle/yqc/v1/0/files/download-by-key?fileKey=${appConfig.icon}`, alt: "" }) : /* @__PURE__ */ import_react.default.createElement(import_hzero_ui.Icon, { type: "picture", style: { width: 18, height: 18, marginRight: 10 } }), entryDetail.entryName || (appConfig == null ? void 0 : appConfig.displayName) || (appConfig == null ? void 0 : appConfig.name))));
127
131
  };
128
132
  // Annotate the CommonJS export names for ESM import in node:
129
133
  0 && (module.exports = {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hzerojs-plugin-yqcloud-jssdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "main": "lib/index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {