@lark-apaas/client-toolkit-lite 1.1.10-alpha.7 → 1.1.10-alpha.8

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/dist/index.cjs CHANGED
@@ -2061,24 +2061,43 @@ var safety_default = Safety;
2061
2061
 
2062
2062
  // src/components/AppContainer/Watermark.tsx
2063
2063
  var import_react6 = __toESM(require("react"), 1);
2064
- var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"), 1);
2065
2064
 
2066
2065
  // src/components/AppContainer/doubao-watermark-asset.ts
2067
2066
  var CDN = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui";
2068
2067
  var DOUBAO_LOGO_SRC = `${CDN}/setting_voice.svg`;
2069
2068
  var DOUBAO_CLOSE_SRC = `${CDN}/icon_close_outlined.svg`;
2070
2069
  var DOUBAO_REPORT_SRC = `${CDN}/%5BDBX%5DDropdown.svg`;
2071
- var DOUBAO_PILL_MOBILE_SRC = `${CDN}/Frame%202147223991%20(4).svg`;
2072
- var DOUBAO_REPORT_ITEM_SRC = `${CDN}/_Dropdown-item.svg`;
2073
- var DOUBAO_DONTSHOW_ITEM_SRC = `${CDN}/_Dropdown-item%20(1).svg`;
2070
+
2071
+ // src/utils/getEnv.ts
2072
+ function getEnv() {
2073
+ switch (globalThis.ENVIRONMENT) {
2074
+ case "staging":
2075
+ return "BOE";
2076
+ case "gray":
2077
+ return "PRE";
2078
+ case "online":
2079
+ return "ONLINE";
2080
+ default:
2081
+ break;
2082
+ }
2083
+ const { origin } = window.location;
2084
+ if (origin.includes("feishuapp.cn") || origin.includes("miaoda.feishuapp.net") || origin.includes("aiforce.cloud") || origin.includes("aiforce.run")) {
2085
+ return "ONLINE";
2086
+ } else if (origin.includes("fsapp.kundou.cn") || origin.includes("miaoda-pre.feishuapp.net") || origin.includes("aiforce-pre.bytedance.net") || origin.includes("aiforce-pre-preview.bytedance.net") || origin.includes("aiforce-pre.cloud") || origin.includes("aiforce-pre.run")) {
2087
+ return "PRE";
2088
+ } else {
2089
+ return "BOE";
2090
+ }
2091
+ }
2092
+ __name(getEnv, "getEnv");
2074
2093
 
2075
2094
  // src/components/AppContainer/Watermark.tsx
2076
2095
  var DOUBAO_SOURCE = "5";
2077
2096
  var REPORT_ENABLED = false;
2078
2097
  var REPORT_DOMAIN = {
2079
- staging: "tns.feishu-boe.cn",
2080
- gray: "tns.feishu-pre.cn",
2081
- online: "tns.feishu.cn"
2098
+ BOE: "tns.feishu-boe.cn",
2099
+ PRE: "tns.feishu-pre.cn",
2100
+ ONLINE: "tns.feishu.cn"
2082
2101
  };
2083
2102
  var openDoubaoReport = /* @__PURE__ */ __name(() => {
2084
2103
  const params = JSON.stringify({
@@ -2087,91 +2106,15 @@ var openDoubaoReport = /* @__PURE__ */ __name(() => {
2087
2106
  entity_type: "miaoda_app",
2088
2107
  extra: ""
2089
2108
  });
2090
- const url = `https://${REPORT_DOMAIN[window.ENVIRONMENT]}/cust/lark_report/?type=common&params=${encodeURIComponent(params)}&lang=zh-CN`;
2109
+ const url = `https://${REPORT_DOMAIN[getEnv()]}/cust/lark_report/?type=common&params=${encodeURIComponent(params)}&lang=zh-CN`;
2091
2110
  window.open(url, "_blank", "noopener,noreferrer");
2092
2111
  }, "openDoubaoReport");
2093
- var mobilePillWrapper = {
2094
- position: "fixed",
2095
- right: 12,
2096
- bottom: 12,
2097
- width: 85,
2098
- height: 30,
2099
- zIndex: 9999,
2100
- cursor: "pointer"
2101
- };
2102
- var mobilePillImg = {
2103
- position: "absolute",
2104
- right: -12,
2105
- bottom: -40,
2106
- width: 129,
2107
- height: 94,
2108
- display: "block",
2109
- pointerEvents: "none"
2110
- };
2111
- var mobileMenu = {
2112
- display: "flex",
2113
- flexDirection: "column",
2114
- background: "#fff",
2115
- borderRadius: 12,
2116
- padding: 4,
2117
- boxShadow: "0px 6px 16px rgba(0,0,0,0.12)",
2118
- zIndex: 1e4
2119
- };
2120
- var mobileMenuItem = {
2121
- display: "block",
2122
- cursor: "pointer"
2123
- };
2124
- var MobileWatermark = /* @__PURE__ */ __name(({ onDontShow }) => {
2125
- const [open, setOpen] = (0, import_react6.useState)(false);
2126
- return /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Root, {
2127
- open,
2128
- onOpenChange: setOpen
2129
- }, /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Trigger, {
2130
- asChild: true
2131
- }, /* @__PURE__ */ import_react6.default.createElement("div", {
2132
- "data-custom-element": "doubao-watermark-mobile",
2133
- style: mobilePillWrapper
2134
- }, /* @__PURE__ */ import_react6.default.createElement("img", {
2135
- src: DOUBAO_PILL_MOBILE_SRC,
2136
- width: 129,
2137
- height: 94,
2138
- alt: "\u8C46\u5305 AI \u751F\u6210",
2139
- style: mobilePillImg
2140
- }))), /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Portal, null, /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Content, {
2141
- side: "top",
2142
- align: "end",
2143
- sideOffset: 8,
2144
- style: mobileMenu
2145
- }, /* @__PURE__ */ import_react6.default.createElement("img", {
2146
- src: DOUBAO_REPORT_ITEM_SRC,
2147
- width: 132,
2148
- height: 38,
2149
- alt: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
2150
- style: mobileMenuItem
2151
- }), /* @__PURE__ */ import_react6.default.createElement("img", {
2152
- src: DOUBAO_DONTSHOW_ITEM_SRC,
2153
- width: 132,
2154
- height: 38,
2155
- alt: "\u4E0D\u518D\u5C55\u793A",
2156
- style: mobileMenuItem,
2157
- onClick: /* @__PURE__ */ __name(() => {
2158
- setOpen(false);
2159
- onDontShow();
2160
- }, "onClick")
2161
- }))));
2162
- }, "MobileWatermark");
2163
2112
  var Watermark = /* @__PURE__ */ __name(() => {
2164
2113
  const [closed, setClosed] = (0, import_react6.useState)(false);
2165
2114
  const [open, setOpen] = (0, import_react6.useState)(false);
2166
2115
  const timer = (0, import_react6.useRef)(null);
2167
- const isMobile2 = useIsMobile();
2168
2116
  if (String(process.env.MIAODA_APP_SOURCE) !== DOUBAO_SOURCE) return null;
2169
2117
  if (closed) return null;
2170
- if (isMobile2) {
2171
- return /* @__PURE__ */ import_react6.default.createElement(MobileWatermark, {
2172
- onDontShow: /* @__PURE__ */ __name(() => setClosed(true), "onDontShow")
2173
- });
2174
- }
2175
2118
  const enter = /* @__PURE__ */ __name(() => {
2176
2119
  if (timer.current) clearTimeout(timer.current);
2177
2120
  setOpen(true);
@@ -2393,29 +2336,6 @@ var isIOS = /* @__PURE__ */ __name(() => {
2393
2336
  return false;
2394
2337
  }, "isIOS");
2395
2338
 
2396
- // src/utils/getEnv.ts
2397
- function getEnv() {
2398
- switch (globalThis.ENVIRONMENT) {
2399
- case "staging":
2400
- return "BOE";
2401
- case "gray":
2402
- return "PRE";
2403
- case "online":
2404
- return "ONLINE";
2405
- default:
2406
- break;
2407
- }
2408
- const { origin } = window.location;
2409
- if (origin.includes("feishuapp.cn") || origin.includes("miaoda.feishuapp.net") || origin.includes("aiforce.cloud") || origin.includes("aiforce.run")) {
2410
- return "ONLINE";
2411
- } else if (origin.includes("fsapp.kundou.cn") || origin.includes("miaoda-pre.feishuapp.net") || origin.includes("aiforce-pre.bytedance.net") || origin.includes("aiforce-pre-preview.bytedance.net") || origin.includes("aiforce-pre.cloud") || origin.includes("aiforce-pre.run")) {
2412
- return "PRE";
2413
- } else {
2414
- return "BOE";
2415
- }
2416
- }
2417
- __name(getEnv, "getEnv");
2418
-
2419
2339
  // src/components/AppContainer/utils/getLarkUser.ts
2420
2340
  async function getLarkUserInfo() {
2421
2341
  const appId = getAppId();