@lark-apaas/client-toolkit-lite 1.1.10-alpha.1 → 1.1.10-alpha.10
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 +120 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +120 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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,103 @@ 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
|
+
// 钉死尺寸:宿主页常带 Tailwind preflight 的 `img{max-width:100%;height:auto}`,
|
|
2109
|
+
// 会把这张 129x94 的图压进 85x30 包裹层导致缩水变形 + 负偏移对齐错位。
|
|
2110
|
+
// 内联 style 特异度高于 element 选择器,可盖过 preflight。
|
|
2111
|
+
maxWidth: "none",
|
|
2112
|
+
maxHeight: "none",
|
|
2113
|
+
display: "block",
|
|
2114
|
+
pointerEvents: "none"
|
|
2115
|
+
};
|
|
2116
|
+
var mobileMenu = {
|
|
2117
|
+
display: "flex",
|
|
2118
|
+
flexDirection: "column",
|
|
2119
|
+
background: "#fff",
|
|
2120
|
+
borderRadius: 12,
|
|
2121
|
+
padding: 4,
|
|
2122
|
+
boxShadow: "0px 6px 16px rgba(0,0,0,0.12)",
|
|
2123
|
+
zIndex: 1e4,
|
|
2124
|
+
// radix Content 打开时获取焦点,去掉浏览器默认 focus 描边(同 Safety sheetContent)
|
|
2125
|
+
outline: "none"
|
|
2126
|
+
};
|
|
2127
|
+
var mobileMenuItem = {
|
|
2128
|
+
display: "block",
|
|
2129
|
+
// 同药丸:钉死尺寸盖过宿主 Tailwind preflight 的 img{max-width:100%;height:auto}
|
|
2130
|
+
width: 132,
|
|
2131
|
+
height: 38,
|
|
2132
|
+
maxWidth: "none",
|
|
2133
|
+
maxHeight: "none",
|
|
2134
|
+
cursor: "pointer"
|
|
2135
|
+
};
|
|
2136
|
+
var MobileWatermark = /* @__PURE__ */ __name(({ onDontShow }) => {
|
|
2137
|
+
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
2138
|
+
return /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Root, {
|
|
2139
|
+
open,
|
|
2140
|
+
onOpenChange: setOpen
|
|
2141
|
+
}, /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Trigger, {
|
|
2142
|
+
asChild: true
|
|
2143
|
+
}, /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
2144
|
+
"data-custom-element": "doubao-watermark-mobile",
|
|
2145
|
+
style: mobilePillWrapper
|
|
2146
|
+
}, /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2147
|
+
src: DOUBAO_PILL_MOBILE_SRC,
|
|
2148
|
+
width: 129,
|
|
2149
|
+
height: 94,
|
|
2150
|
+
alt: "\u8C46\u5305 AI \u751F\u6210",
|
|
2151
|
+
style: mobilePillImg
|
|
2152
|
+
}))), /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Portal, null, /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Content, {
|
|
2153
|
+
side: "top",
|
|
2154
|
+
align: "end",
|
|
2155
|
+
sideOffset: 8,
|
|
2156
|
+
style: mobileMenu
|
|
2157
|
+
}, /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2158
|
+
src: DOUBAO_REPORT_ITEM_SRC,
|
|
2159
|
+
width: 132,
|
|
2160
|
+
height: 38,
|
|
2161
|
+
alt: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
|
|
2162
|
+
style: mobileMenuItem
|
|
2163
|
+
}), /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2164
|
+
src: DOUBAO_DONTSHOW_ITEM_SRC,
|
|
2165
|
+
width: 132,
|
|
2166
|
+
height: 38,
|
|
2167
|
+
alt: "\u4E0D\u518D\u5C55\u793A",
|
|
2168
|
+
style: mobileMenuItem,
|
|
2169
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
2170
|
+
setOpen(false);
|
|
2171
|
+
onDontShow();
|
|
2172
|
+
}, "onClick")
|
|
2173
|
+
}))));
|
|
2174
|
+
}, "MobileWatermark");
|
|
2112
2175
|
var Watermark = /* @__PURE__ */ __name(() => {
|
|
2113
2176
|
const [closed, setClosed] = (0, import_react6.useState)(false);
|
|
2114
2177
|
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
2115
2178
|
const timer = (0, import_react6.useRef)(null);
|
|
2179
|
+
const isMobile2 = useIsMobile();
|
|
2116
2180
|
if (String(process.env.MIAODA_APP_SOURCE) !== DOUBAO_SOURCE) return null;
|
|
2117
2181
|
if (closed) return null;
|
|
2182
|
+
if (isMobile2) {
|
|
2183
|
+
return /* @__PURE__ */ import_react6.default.createElement(MobileWatermark, {
|
|
2184
|
+
onDontShow: /* @__PURE__ */ __name(() => setClosed(true), "onDontShow")
|
|
2185
|
+
});
|
|
2186
|
+
}
|
|
2118
2187
|
const enter = /* @__PURE__ */ __name(() => {
|
|
2119
2188
|
if (timer.current) clearTimeout(timer.current);
|
|
2120
2189
|
setOpen(true);
|
|
@@ -2336,6 +2405,29 @@ var isIOS = /* @__PURE__ */ __name(() => {
|
|
|
2336
2405
|
return false;
|
|
2337
2406
|
}, "isIOS");
|
|
2338
2407
|
|
|
2408
|
+
// src/utils/getEnv.ts
|
|
2409
|
+
function getEnv() {
|
|
2410
|
+
switch (globalThis.ENVIRONMENT) {
|
|
2411
|
+
case "staging":
|
|
2412
|
+
return "BOE";
|
|
2413
|
+
case "gray":
|
|
2414
|
+
return "PRE";
|
|
2415
|
+
case "online":
|
|
2416
|
+
return "ONLINE";
|
|
2417
|
+
default:
|
|
2418
|
+
break;
|
|
2419
|
+
}
|
|
2420
|
+
const { origin } = window.location;
|
|
2421
|
+
if (origin.includes("feishuapp.cn") || origin.includes("miaoda.feishuapp.net") || origin.includes("aiforce.cloud") || origin.includes("aiforce.run")) {
|
|
2422
|
+
return "ONLINE";
|
|
2423
|
+
} 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")) {
|
|
2424
|
+
return "PRE";
|
|
2425
|
+
} else {
|
|
2426
|
+
return "BOE";
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
__name(getEnv, "getEnv");
|
|
2430
|
+
|
|
2339
2431
|
// src/components/AppContainer/utils/getLarkUser.ts
|
|
2340
2432
|
async function getLarkUserInfo() {
|
|
2341
2433
|
const appId = getAppId();
|
|
@@ -2425,7 +2517,7 @@ var AppContainer = /* @__PURE__ */ __name(({ children }) => {
|
|
|
2425
2517
|
});
|
|
2426
2518
|
}
|
|
2427
2519
|
}, []);
|
|
2428
|
-
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, String(process.env.MIAODA_APP_TYPE) !== "7" && /* @__PURE__ */ import_react10.default.createElement(safety_default, null), process.env.NODE_ENV !== "production" && /* @__PURE__ */ import_react10.default.createElement(import_miaoda_inspector.MiaodaInspector, null), process.env.NODE_ENV !== "production" && /* @__PURE__ */ import_react10.default.createElement(IframeBridge, null), /* @__PURE__ */ import_react10.default.createElement(
|
|
2520
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, String(process.env.MIAODA_APP_TYPE) !== "7" && /* @__PURE__ */ import_react10.default.createElement(safety_default, null), process.env.NODE_ENV !== "production" && /* @__PURE__ */ import_react10.default.createElement(import_miaoda_inspector.MiaodaInspector, null), process.env.NODE_ENV !== "production" && /* @__PURE__ */ import_react10.default.createElement(IframeBridge, null), /* @__PURE__ */ import_react10.default.createElement(Watermark_default, null), /* @__PURE__ */ import_react10.default.createElement(QueryProvider_default, null, children));
|
|
2429
2521
|
}, "AppContainer");
|
|
2430
2522
|
var AppContainer_default = AppContainer;
|
|
2431
2523
|
|