@forgeax/app-shell 0.11.0 → 0.11.1
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/window.js +6 -8
- package/package.json +1 -1
package/dist/window.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// src/window.ts
|
|
2
2
|
function surfaceKey(surface) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
surface.instance ?? null
|
|
8
|
-
]);
|
|
3
|
+
const id = surface.id.includes(":") || surface.id.startsWith("~") ? `~${encodeURIComponent(surface.id)}` : surface.id;
|
|
4
|
+
const pane = surface.pane ? `:${surface.pane}` : "";
|
|
5
|
+
const instance = surface.instance ? `:instance=${encodeURIComponent(surface.instance)}` : "";
|
|
6
|
+
return `${surface.kind}:${id}${pane}${instance}`;
|
|
9
7
|
}
|
|
10
8
|
var BASE64URL_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
11
9
|
function utf8ToBase64Url(value) {
|
|
@@ -32,7 +30,7 @@ function encodeSurfaceQuery(surface) {
|
|
|
32
30
|
params.set("surface", surface.kind);
|
|
33
31
|
params.set("id", surface.id);
|
|
34
32
|
if (surface.pane) params.set("pane", surface.pane);
|
|
35
|
-
if (surface.instance
|
|
33
|
+
if (surface.instance) params.set("instance", surface.instance);
|
|
36
34
|
return params.toString();
|
|
37
35
|
}
|
|
38
36
|
function decodeSurfaceFromLocation(search = typeof window !== "undefined" ? window.location.search : "") {
|
|
@@ -46,7 +44,7 @@ function decodeSurfaceFromLocation(search = typeof window !== "undefined" ? wind
|
|
|
46
44
|
kind,
|
|
47
45
|
id,
|
|
48
46
|
pane: pane === "left" || pane === "center" ? pane : void 0,
|
|
49
|
-
instance: instance
|
|
47
|
+
instance: instance || void 0
|
|
50
48
|
};
|
|
51
49
|
}
|
|
52
50
|
export {
|