@lark-apaas/client-toolkit-lite 1.1.10-alpha.6 → 1.1.10-alpha.7
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 +107 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +107 -27
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2061,43 +2061,24 @@ 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);
|
|
2064
2065
|
|
|
2065
2066
|
// src/components/AppContainer/doubao-watermark-asset.ts
|
|
2066
2067
|
var CDN = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui";
|
|
2067
2068
|
var DOUBAO_LOGO_SRC = `${CDN}/setting_voice.svg`;
|
|
2068
2069
|
var DOUBAO_CLOSE_SRC = `${CDN}/icon_close_outlined.svg`;
|
|
2069
2070
|
var DOUBAO_REPORT_SRC = `${CDN}/%5BDBX%5DDropdown.svg`;
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
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");
|
|
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`;
|
|
2093
2074
|
|
|
2094
2075
|
// src/components/AppContainer/Watermark.tsx
|
|
2095
2076
|
var DOUBAO_SOURCE = "5";
|
|
2096
2077
|
var REPORT_ENABLED = false;
|
|
2097
2078
|
var REPORT_DOMAIN = {
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2079
|
+
staging: "tns.feishu-boe.cn",
|
|
2080
|
+
gray: "tns.feishu-pre.cn",
|
|
2081
|
+
online: "tns.feishu.cn"
|
|
2101
2082
|
};
|
|
2102
2083
|
var openDoubaoReport = /* @__PURE__ */ __name(() => {
|
|
2103
2084
|
const params = JSON.stringify({
|
|
@@ -2106,15 +2087,91 @@ var openDoubaoReport = /* @__PURE__ */ __name(() => {
|
|
|
2106
2087
|
entity_type: "miaoda_app",
|
|
2107
2088
|
extra: ""
|
|
2108
2089
|
});
|
|
2109
|
-
const url = `https://${REPORT_DOMAIN[
|
|
2090
|
+
const url = `https://${REPORT_DOMAIN[window.ENVIRONMENT]}/cust/lark_report/?type=common¶ms=${encodeURIComponent(params)}&lang=zh-CN`;
|
|
2110
2091
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
2111
2092
|
}, "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");
|
|
2112
2163
|
var Watermark = /* @__PURE__ */ __name(() => {
|
|
2113
2164
|
const [closed, setClosed] = (0, import_react6.useState)(false);
|
|
2114
2165
|
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
2115
2166
|
const timer = (0, import_react6.useRef)(null);
|
|
2167
|
+
const isMobile2 = useIsMobile();
|
|
2116
2168
|
if (String(process.env.MIAODA_APP_SOURCE) !== DOUBAO_SOURCE) return null;
|
|
2117
2169
|
if (closed) return null;
|
|
2170
|
+
if (isMobile2) {
|
|
2171
|
+
return /* @__PURE__ */ import_react6.default.createElement(MobileWatermark, {
|
|
2172
|
+
onDontShow: /* @__PURE__ */ __name(() => setClosed(true), "onDontShow")
|
|
2173
|
+
});
|
|
2174
|
+
}
|
|
2118
2175
|
const enter = /* @__PURE__ */ __name(() => {
|
|
2119
2176
|
if (timer.current) clearTimeout(timer.current);
|
|
2120
2177
|
setOpen(true);
|
|
@@ -2336,6 +2393,29 @@ var isIOS = /* @__PURE__ */ __name(() => {
|
|
|
2336
2393
|
return false;
|
|
2337
2394
|
}, "isIOS");
|
|
2338
2395
|
|
|
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
|
+
|
|
2339
2419
|
// src/components/AppContainer/utils/getLarkUser.ts
|
|
2340
2420
|
async function getLarkUserInfo() {
|
|
2341
2421
|
const appId = getAppId();
|