@lark-apaas/client-toolkit-lite 1.1.19-alpha.0 → 1.1.19-alpha.2
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 +25 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2141,7 +2141,7 @@ var safety_default = Safety;
|
|
|
2141
2141
|
|
|
2142
2142
|
// src/components/AppContainer/Watermark.tsx
|
|
2143
2143
|
var import_react6 = __toESM(require("react"), 1);
|
|
2144
|
-
var
|
|
2144
|
+
var import_client = require("react-dom/client");
|
|
2145
2145
|
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
2146
2146
|
|
|
2147
2147
|
// src/components/AppContainer/doubao-watermark-asset.ts
|
|
@@ -2409,6 +2409,16 @@ var MobileWatermark = /* @__PURE__ */ __name(({ onDontShow, portalContainer }) =
|
|
|
2409
2409
|
minWidth: 160
|
|
2410
2410
|
}))));
|
|
2411
2411
|
}, "MobileWatermark");
|
|
2412
|
+
var ShadowRootUI = /* @__PURE__ */ __name(({ shadowRoot }) => {
|
|
2413
|
+
const [closed, setClosed] = (0, import_react6.useState)(false);
|
|
2414
|
+
const isMobile2 = useIsMobile();
|
|
2415
|
+
if (closed) return null;
|
|
2416
|
+
return /* @__PURE__ */ import_react6.default.createElement(WatermarkContent, {
|
|
2417
|
+
isMobile: isMobile2,
|
|
2418
|
+
onClose: /* @__PURE__ */ __name(() => setClosed(true), "onClose"),
|
|
2419
|
+
portalContainer: shadowRoot
|
|
2420
|
+
});
|
|
2421
|
+
}, "ShadowRootUI");
|
|
2412
2422
|
var WatermarkContent = /* @__PURE__ */ __name(({ isMobile: isMobile2, onClose, portalContainer }) => {
|
|
2413
2423
|
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
2414
2424
|
const timer = (0, import_react6.useRef)(null);
|
|
@@ -2458,19 +2468,26 @@ var WatermarkContent = /* @__PURE__ */ __name(({ isMobile: isMobile2, onClose, p
|
|
|
2458
2468
|
}));
|
|
2459
2469
|
}, "WatermarkContent");
|
|
2460
2470
|
var Watermark = /* @__PURE__ */ __name(() => {
|
|
2461
|
-
const [closed, setClosed] = (0, import_react6.useState)(false);
|
|
2462
|
-
const [shadowRoot, setShadowRoot] = (0, import_react6.useState)(null);
|
|
2463
2471
|
const hostRef = (0, import_react6.useRef)(null);
|
|
2464
|
-
const
|
|
2472
|
+
const rootRef = (0, import_react6.useRef)(null);
|
|
2465
2473
|
useIsomorphicLayoutEffect(() => {
|
|
2466
2474
|
if (!hostRef.current) return;
|
|
2467
|
-
const
|
|
2475
|
+
const host = hostRef.current;
|
|
2476
|
+
const shadow = host.shadowRoot ?? host.attachShadow({
|
|
2468
2477
|
mode: "open"
|
|
2469
2478
|
});
|
|
2470
|
-
|
|
2479
|
+
const root = (0, import_client.createRoot)(shadow);
|
|
2480
|
+
rootRef.current = root;
|
|
2481
|
+
root.render(/* @__PURE__ */ import_react6.default.createElement(ShadowRootUI, {
|
|
2482
|
+
shadowRoot: shadow
|
|
2483
|
+
}));
|
|
2484
|
+
return () => {
|
|
2485
|
+
const r = root;
|
|
2486
|
+
queueMicrotask(() => r.unmount());
|
|
2487
|
+
rootRef.current = null;
|
|
2488
|
+
};
|
|
2471
2489
|
}, []);
|
|
2472
2490
|
if (String(process.env.MIAODA_APP_SOURCE) !== DOUBAO_SOURCE) return null;
|
|
2473
|
-
if (closed) return null;
|
|
2474
2491
|
const hostStyle = {
|
|
2475
2492
|
all: "initial",
|
|
2476
2493
|
position: "fixed",
|
|
@@ -2483,15 +2500,10 @@ var Watermark = /* @__PURE__ */ __name(() => {
|
|
|
2483
2500
|
width: "auto",
|
|
2484
2501
|
height: "auto"
|
|
2485
2502
|
};
|
|
2486
|
-
const content = /* @__PURE__ */ import_react6.default.createElement(WatermarkContent, {
|
|
2487
|
-
isMobile: isMobile2,
|
|
2488
|
-
onClose: /* @__PURE__ */ __name(() => setClosed(true), "onClose"),
|
|
2489
|
-
portalContainer: shadowRoot
|
|
2490
|
-
});
|
|
2491
2503
|
return /* @__PURE__ */ import_react6.default.createElement(HOST_TAG, {
|
|
2492
2504
|
ref: hostRef,
|
|
2493
2505
|
style: hostStyle
|
|
2494
|
-
}
|
|
2506
|
+
});
|
|
2495
2507
|
}, "Watermark");
|
|
2496
2508
|
var Watermark_default = Watermark;
|
|
2497
2509
|
|