@lark-apaas/client-toolkit-lite 1.1.10 → 1.1.11-alpha.0
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 +29 -122
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -122
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2061,25 +2061,44 @@ 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
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
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
|
-
var
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
}
|
|
2097
|
+
var REPORT_DOMAIN = {
|
|
2098
|
+
BOE: "tns.feishu-boe.cn",
|
|
2099
|
+
PRE: "tns.feishu-pre.cn",
|
|
2100
|
+
ONLINE: "tns.feishu.cn"
|
|
2101
|
+
};
|
|
2083
2102
|
var openDoubaoReport = /* @__PURE__ */ __name(() => {
|
|
2084
2103
|
const params = JSON.stringify({
|
|
2085
2104
|
scene: "miaoda_app_report",
|
|
@@ -2087,104 +2106,15 @@ var openDoubaoReport = /* @__PURE__ */ __name(() => {
|
|
|
2087
2106
|
entity_type: "miaoda_app",
|
|
2088
2107
|
extra: ""
|
|
2089
2108
|
});
|
|
2090
|
-
const
|
|
2091
|
-
const url = `https://${domain}/cust/lark_report/?type=common¶ms=${encodeURIComponent(params)}&lang=zh-CN`;
|
|
2109
|
+
const url = `https://${REPORT_DOMAIN[getEnv()]}/cust/lark_report/?type=common¶ms=${encodeURIComponent(params)}&lang=zh-CN`;
|
|
2092
2110
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
2093
2111
|
}, "openDoubaoReport");
|
|
2094
|
-
var mobilePillWrapper = {
|
|
2095
|
-
position: "fixed",
|
|
2096
|
-
right: 12,
|
|
2097
|
-
bottom: 12,
|
|
2098
|
-
width: 85,
|
|
2099
|
-
height: 30,
|
|
2100
|
-
zIndex: 9999,
|
|
2101
|
-
cursor: "pointer"
|
|
2102
|
-
};
|
|
2103
|
-
var mobilePillImg = {
|
|
2104
|
-
position: "absolute",
|
|
2105
|
-
right: -12,
|
|
2106
|
-
bottom: -40,
|
|
2107
|
-
width: 129,
|
|
2108
|
-
height: 94,
|
|
2109
|
-
// 钉死尺寸:宿主页常带 Tailwind preflight 的 `img{max-width:100%;height:auto}`,
|
|
2110
|
-
// 会把这张 129x94 的图压进 85x30 包裹层导致缩水变形 + 负偏移对齐错位。
|
|
2111
|
-
// 内联 style 特异度高于 element 选择器,可盖过 preflight。
|
|
2112
|
-
maxWidth: "none",
|
|
2113
|
-
maxHeight: "none",
|
|
2114
|
-
display: "block",
|
|
2115
|
-
pointerEvents: "none"
|
|
2116
|
-
};
|
|
2117
|
-
var mobileMenu = {
|
|
2118
|
-
display: "flex",
|
|
2119
|
-
flexDirection: "column",
|
|
2120
|
-
background: "#fff",
|
|
2121
|
-
borderRadius: 12,
|
|
2122
|
-
padding: 4,
|
|
2123
|
-
boxShadow: "0px 6px 16px rgba(0,0,0,0.12)",
|
|
2124
|
-
zIndex: 1e4,
|
|
2125
|
-
// radix Content 打开时获取焦点,去掉浏览器默认 focus 描边(同 Safety sheetContent)
|
|
2126
|
-
outline: "none"
|
|
2127
|
-
};
|
|
2128
|
-
var mobileMenuItem = {
|
|
2129
|
-
display: "block",
|
|
2130
|
-
// 同药丸:钉死尺寸盖过宿主 Tailwind preflight 的 img{max-width:100%;height:auto}
|
|
2131
|
-
width: 132,
|
|
2132
|
-
height: 38,
|
|
2133
|
-
maxWidth: "none",
|
|
2134
|
-
maxHeight: "none",
|
|
2135
|
-
cursor: "pointer"
|
|
2136
|
-
};
|
|
2137
|
-
var MobileWatermark = /* @__PURE__ */ __name(({ onDontShow }) => {
|
|
2138
|
-
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
2139
|
-
return /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Root, {
|
|
2140
|
-
open,
|
|
2141
|
-
onOpenChange: setOpen
|
|
2142
|
-
}, /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Trigger, {
|
|
2143
|
-
asChild: true
|
|
2144
|
-
}, /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
2145
|
-
"data-custom-element": "doubao-watermark-mobile",
|
|
2146
|
-
style: mobilePillWrapper
|
|
2147
|
-
}, /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2148
|
-
src: DOUBAO_PILL_MOBILE_SRC,
|
|
2149
|
-
width: 129,
|
|
2150
|
-
height: 94,
|
|
2151
|
-
alt: "\u8C46\u5305 AI \u751F\u6210",
|
|
2152
|
-
style: mobilePillImg
|
|
2153
|
-
}))), /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Portal, null, /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Content, {
|
|
2154
|
-
side: "top",
|
|
2155
|
-
align: "end",
|
|
2156
|
-
sideOffset: 8,
|
|
2157
|
-
style: mobileMenu
|
|
2158
|
-
}, /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2159
|
-
src: DOUBAO_REPORT_ITEM_SRC,
|
|
2160
|
-
width: 132,
|
|
2161
|
-
height: 38,
|
|
2162
|
-
alt: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
|
|
2163
|
-
style: mobileMenuItem
|
|
2164
|
-
}), /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2165
|
-
src: DOUBAO_DONTSHOW_ITEM_SRC,
|
|
2166
|
-
width: 132,
|
|
2167
|
-
height: 38,
|
|
2168
|
-
alt: "\u4E0D\u518D\u5C55\u793A",
|
|
2169
|
-
style: mobileMenuItem,
|
|
2170
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
2171
|
-
setOpen(false);
|
|
2172
|
-
onDontShow();
|
|
2173
|
-
}, "onClick")
|
|
2174
|
-
}))));
|
|
2175
|
-
}, "MobileWatermark");
|
|
2176
2112
|
var Watermark = /* @__PURE__ */ __name(() => {
|
|
2177
2113
|
const [closed, setClosed] = (0, import_react6.useState)(false);
|
|
2178
2114
|
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
2179
2115
|
const timer = (0, import_react6.useRef)(null);
|
|
2180
|
-
const isMobile2 = useIsMobile();
|
|
2181
2116
|
if (String(process.env.MIAODA_APP_SOURCE) !== DOUBAO_SOURCE) return null;
|
|
2182
2117
|
if (closed) return null;
|
|
2183
|
-
if (isMobile2) {
|
|
2184
|
-
return /* @__PURE__ */ import_react6.default.createElement(MobileWatermark, {
|
|
2185
|
-
onDontShow: /* @__PURE__ */ __name(() => setClosed(true), "onDontShow")
|
|
2186
|
-
});
|
|
2187
|
-
}
|
|
2188
2118
|
const enter = /* @__PURE__ */ __name(() => {
|
|
2189
2119
|
if (timer.current) clearTimeout(timer.current);
|
|
2190
2120
|
setOpen(true);
|
|
@@ -2406,29 +2336,6 @@ var isIOS = /* @__PURE__ */ __name(() => {
|
|
|
2406
2336
|
return false;
|
|
2407
2337
|
}, "isIOS");
|
|
2408
2338
|
|
|
2409
|
-
// src/utils/getEnv.ts
|
|
2410
|
-
function getEnv() {
|
|
2411
|
-
switch (globalThis.ENVIRONMENT) {
|
|
2412
|
-
case "staging":
|
|
2413
|
-
return "BOE";
|
|
2414
|
-
case "gray":
|
|
2415
|
-
return "PRE";
|
|
2416
|
-
case "online":
|
|
2417
|
-
return "ONLINE";
|
|
2418
|
-
default:
|
|
2419
|
-
break;
|
|
2420
|
-
}
|
|
2421
|
-
const { origin } = window.location;
|
|
2422
|
-
if (origin.includes("feishuapp.cn") || origin.includes("miaoda.feishuapp.net") || origin.includes("aiforce.cloud") || origin.includes("aiforce.run")) {
|
|
2423
|
-
return "ONLINE";
|
|
2424
|
-
} 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")) {
|
|
2425
|
-
return "PRE";
|
|
2426
|
-
} else {
|
|
2427
|
-
return "BOE";
|
|
2428
|
-
}
|
|
2429
|
-
}
|
|
2430
|
-
__name(getEnv, "getEnv");
|
|
2431
|
-
|
|
2432
2339
|
// src/components/AppContainer/utils/getLarkUser.ts
|
|
2433
2340
|
async function getLarkUserInfo() {
|
|
2434
2341
|
const appId = getAppId();
|