skybridge 0.0.0-dev.cbd74dd → 0.0.0-dev.cc48d14
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<base href="{{serverUrl}}" />
|
|
2
|
-
<script>
|
|
2
|
+
<script type="module">window.skybridge = { hostType: "{{hostType}}" };</script>
|
|
3
3
|
<script type="module">
|
|
4
4
|
import { injectIntoGlobalHook } from "{{serverUrl}}/@react-refresh";
|
|
5
5
|
injectIntoGlobalHook(window); window.$RefreshReg$ = () => {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<base href="{{serverUrl}}" />
|
|
2
|
-
<script>
|
|
2
|
+
<script type="module">window.skybridge = { hostType: "{{hostType}}" };</script>
|
|
3
3
|
<div id="root"></div>
|
|
4
4
|
<script type="module">
|
|
5
5
|
import('{{serverUrl}}/assets/{{widgetFile}}');
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { useSyncExternalStore } from "react";
|
|
2
2
|
import { AppsSdkBridge } from "../apps-sdk-bridge";
|
|
3
3
|
import { McpAppBridge } from "../mcp-app-bridge";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
const getDefaultValueFromMcpAppBridge = (key) => {
|
|
5
|
+
const DEFAULT_VALUES_FOR_MCP_APP_BRIDGE = {
|
|
6
|
+
theme: "light",
|
|
7
|
+
locale: "en-US",
|
|
8
|
+
displayMode: "inline",
|
|
9
|
+
safeArea: {
|
|
10
|
+
insets: {
|
|
11
|
+
top: 0,
|
|
12
|
+
right: 0,
|
|
13
|
+
bottom: 0,
|
|
14
|
+
left: 0,
|
|
15
|
+
},
|
|
14
16
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
maxHeight: window.innerHeight,
|
|
18
|
+
};
|
|
19
|
+
return DEFAULT_VALUES_FOR_MCP_APP_BRIDGE[key];
|
|
17
20
|
};
|
|
18
21
|
const getExternalStore = (key) => {
|
|
19
|
-
const defaultValue =
|
|
22
|
+
const defaultValue = getDefaultValueFromMcpAppBridge(key);
|
|
20
23
|
const hostType = window.skybridge.hostType;
|
|
21
24
|
if (hostType === "apps-sdk") {
|
|
22
25
|
const bridge = AppsSdkBridge.getInstance();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-bridge.js","sourceRoot":"","sources":["../../../../../src/web/bridges/hooks/use-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQjD,MAAM,
|
|
1
|
+
{"version":3,"file":"use-bridge.js","sourceRoot":"","sources":["../../../../../src/web/bridges/hooks/use-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQjD,MAAM,+BAA+B,GAAG,CACtC,GAAM,EACc,EAAE;IACtB,MAAM,iCAAiC,GAAoB;QACzD,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,OAAO;QACf,WAAW,EAAE,QAAQ;QACrB,QAAQ,EAAE;YACR,MAAM,EAAE;gBACN,GAAG,EAAE,CAAC;gBACN,KAAK,EAAE,CAAC;gBACR,MAAM,EAAE,CAAC;gBACT,IAAI,EAAE,CAAC;aACR;SACF;QACD,SAAS,EAAE,MAAM,CAAC,WAAW;KAC9B,CAAC;IAEF,OAAO,iCAAiC,CAAC,GAAG,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CACvB,GAA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