@lark-apaas/miaoda-inspector 1.0.3 → 1.0.5
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.
|
@@ -9,8 +9,7 @@ import { ClickOverlay } from "../Inspector/Overlay";
|
|
|
9
9
|
import {
|
|
10
10
|
extractPropsFromFiber,
|
|
11
11
|
getElementCodeInfo,
|
|
12
|
-
getElementInspect
|
|
13
|
-
getParentElement
|
|
12
|
+
getElementInspect
|
|
14
13
|
} from "../Inspector/utils";
|
|
15
14
|
import {
|
|
16
15
|
cx,
|
|
@@ -288,11 +287,10 @@ function MiaodaInspector(props) {
|
|
|
288
287
|
if (!selectedElement || !selectedElement.element) {
|
|
289
288
|
return;
|
|
290
289
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
290
|
+
let targetElement = selectedElement.element.parentElement;
|
|
291
|
+
while (targetElement && !targetElement.dataset.miaodaComponentName) {
|
|
292
|
+
targetElement = targetElement.parentElement;
|
|
294
293
|
}
|
|
295
|
-
const targetElement = getParentElement(htmlElementParent);
|
|
296
294
|
if (!targetElement) {
|
|
297
295
|
return;
|
|
298
296
|
}
|
|
@@ -623,7 +621,7 @@ function MiaodaInspector(props) {
|
|
|
623
621
|
postMessage({
|
|
624
622
|
type: "PageMounted",
|
|
625
623
|
data: {
|
|
626
|
-
version: "1.0.
|
|
624
|
+
version: "1.0.5",
|
|
627
625
|
feature: {
|
|
628
626
|
selectParent: true,
|
|
629
627
|
reverseSelect: true
|
package/dist/es/utils/origin.mjs
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import "../chunk-I4E63NIC.mjs";
|
|
2
2
|
function getPreviewParentOrigin() {
|
|
3
3
|
const { origin } = window.location;
|
|
4
|
+
if (origin.includes("force.byted.org")) {
|
|
5
|
+
return "https://force.feishu-boe.cn";
|
|
6
|
+
}
|
|
4
7
|
if (origin.includes("feishuapp.cn") || origin.includes("miaoda.feishuapp.net")) {
|
|
5
8
|
return "https://miaoda.feishu.cn";
|
|
6
|
-
}
|
|
7
|
-
if (origin.includes("fsapp.kundou.cn") || origin.includes("miaoda-pre.feishuapp.net")) {
|
|
9
|
+
} else if (origin.includes("fsapp.kundou.cn") || origin.includes("miaoda-pre.feishuapp.net")) {
|
|
8
10
|
return "https://miaoda.feishu-pre.cn";
|
|
11
|
+
} else {
|
|
12
|
+
return "https://miaoda.feishu-boe.cn";
|
|
9
13
|
}
|
|
10
|
-
return "https://miaoda.feishu-boe.cn";
|
|
11
14
|
}
|
|
12
15
|
function postMessage(message, targetOrigin) {
|
|
13
16
|
window.parent.postMessage(message, targetOrigin != null ? targetOrigin : getPreviewParentOrigin());
|
|
@@ -305,11 +305,10 @@ function MiaodaInspector(props) {
|
|
|
305
305
|
if (!selectedElement || !selectedElement.element) {
|
|
306
306
|
return;
|
|
307
307
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
308
|
+
let targetElement = selectedElement.element.parentElement;
|
|
309
|
+
while (targetElement && !targetElement.dataset.miaodaComponentName) {
|
|
310
|
+
targetElement = targetElement.parentElement;
|
|
311
311
|
}
|
|
312
|
-
const targetElement = (0, import_utils.getParentElement)(htmlElementParent);
|
|
313
312
|
if (!targetElement) {
|
|
314
313
|
return;
|
|
315
314
|
}
|
|
@@ -640,7 +639,7 @@ function MiaodaInspector(props) {
|
|
|
640
639
|
(0, import_utils2.postMessage)({
|
|
641
640
|
type: "PageMounted",
|
|
642
641
|
data: {
|
|
643
|
-
version: "1.0.
|
|
642
|
+
version: "1.0.5",
|
|
644
643
|
feature: {
|
|
645
644
|
selectParent: true,
|
|
646
645
|
reverseSelect: true
|
package/dist/lib/utils/origin.js
CHANGED
|
@@ -26,13 +26,16 @@ __export(origin_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(origin_exports);
|
|
27
27
|
function getPreviewParentOrigin() {
|
|
28
28
|
const { origin } = window.location;
|
|
29
|
+
if (origin.includes("force.byted.org")) {
|
|
30
|
+
return "https://force.feishu-boe.cn";
|
|
31
|
+
}
|
|
29
32
|
if (origin.includes("feishuapp.cn") || origin.includes("miaoda.feishuapp.net")) {
|
|
30
33
|
return "https://miaoda.feishu.cn";
|
|
31
|
-
}
|
|
32
|
-
if (origin.includes("fsapp.kundou.cn") || origin.includes("miaoda-pre.feishuapp.net")) {
|
|
34
|
+
} else if (origin.includes("fsapp.kundou.cn") || origin.includes("miaoda-pre.feishuapp.net")) {
|
|
33
35
|
return "https://miaoda.feishu-pre.cn";
|
|
36
|
+
} else {
|
|
37
|
+
return "https://miaoda.feishu-boe.cn";
|
|
34
38
|
}
|
|
35
|
-
return "https://miaoda.feishu-boe.cn";
|
|
36
39
|
}
|
|
37
40
|
function postMessage(message, targetOrigin) {
|
|
38
41
|
window.parent.postMessage(message, targetOrigin != null ? targetOrigin : getPreviewParentOrigin());
|
|
@@ -2,7 +2,7 @@ import { OutgoingMessage, IncomingMessage } from '../types/iframe-events.js';
|
|
|
2
2
|
import '../types/feature.js';
|
|
3
3
|
import '../config/ui-config.js';
|
|
4
4
|
|
|
5
|
-
declare function getPreviewParentOrigin():
|
|
5
|
+
declare function getPreviewParentOrigin(): "https://force.feishu-boe.cn" | "https://miaoda.feishu.cn" | "https://miaoda.feishu-pre.cn" | "https://miaoda.feishu-boe.cn";
|
|
6
6
|
declare function postMessage<T extends OutgoingMessage>(message: T, targetOrigin?: string): void;
|
|
7
7
|
declare function isOutgoingMessage<T extends OutgoingMessage['type']>(msg: OutgoingMessage, type: T): msg is Extract<OutgoingMessage, {
|
|
8
8
|
type: T;
|