@skyvexsoftware/stratos-sdk 0.24.0 → 0.26.0
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,6 +1,7 @@
|
|
|
1
1
|
declare const _default: any;
|
|
2
2
|
export default _default;
|
|
3
3
|
export declare const __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE: any;
|
|
4
|
+
export declare const browser: any;
|
|
4
5
|
export declare const createPortal: any;
|
|
5
6
|
export declare const flushSync: any;
|
|
6
7
|
export declare const preconnect: any;
|
package/dist/shims/react-dom.js
CHANGED
|
@@ -8,6 +8,7 @@ if (!__m)
|
|
|
8
8
|
throw new Error('Stratos: window.__stratos_modules__["react-dom"] is not available. The shell must initialize it before plugin modules evaluate.');
|
|
9
9
|
export default __m.default ?? __m;
|
|
10
10
|
export const __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = __m.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
11
|
+
export const browser = __m.browser;
|
|
11
12
|
export const createPortal = __m.createPortal;
|
|
12
13
|
export const flushSync = __m.flushSync;
|
|
13
14
|
export const preconnect = __m.preconnect;
|
package/dist/shims/react.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPG
|
|
|
4
4
|
export declare const __COMPILER_RUNTIME: any;
|
|
5
5
|
export declare const act: any;
|
|
6
6
|
export declare const Activity: any;
|
|
7
|
+
export declare const addTransitionType: any;
|
|
7
8
|
export declare const cache: any;
|
|
8
9
|
export declare const cacheSignal: any;
|
|
9
10
|
export declare const captureOwnerStack: any;
|
|
@@ -44,4 +45,5 @@ export declare const useState: any;
|
|
|
44
45
|
export declare const useSyncExternalStore: any;
|
|
45
46
|
export declare const useTransition: any;
|
|
46
47
|
export declare const version: any;
|
|
48
|
+
export declare const ViewTransition: any;
|
|
47
49
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/shims/react.js
CHANGED
|
@@ -11,6 +11,7 @@ export const __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = _
|
|
|
11
11
|
export const __COMPILER_RUNTIME = __m.__COMPILER_RUNTIME;
|
|
12
12
|
export const act = __m.act;
|
|
13
13
|
export const Activity = __m.Activity;
|
|
14
|
+
export const addTransitionType = __m.addTransitionType;
|
|
14
15
|
export const cache = __m.cache;
|
|
15
16
|
export const cacheSignal = __m.cacheSignal;
|
|
16
17
|
export const captureOwnerStack = __m.captureOwnerStack;
|
|
@@ -51,3 +52,4 @@ export const useState = __m.useState;
|
|
|
51
52
|
export const useSyncExternalStore = __m.useSyncExternalStore;
|
|
52
53
|
export const useTransition = __m.useTransition;
|
|
53
54
|
export const version = __m.version;
|
|
55
|
+
export const ViewTransition = __m.ViewTransition;
|
package/dist/ui/stratos-map.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import { Component, useLayoutEffect, useRef, useState, } from "react";
|
|
3
3
|
import { Map } from "react-map-gl/maplibre";
|
|
4
4
|
import { useTheme } from "../hooks/useTheme";
|
|
5
|
+
import { Button } from "./button";
|
|
5
6
|
import { applyStratosLabels } from "./stratos-map-labels";
|
|
6
7
|
const LIGHT_STYLE = "https://tiles.openfreemap.org/styles/positron";
|
|
7
8
|
const DARK_STYLE = "https://tiles.openfreemap.org/styles/dark";
|
|
@@ -21,6 +22,26 @@ const STYLES = `
|
|
|
21
22
|
`;
|
|
22
23
|
const ATTRIBUTION = { compact: true };
|
|
23
24
|
const isStratosStyle = (style) => style === LIGHT_STYLE || style === DARK_STYLE;
|
|
25
|
+
// MapLibre draws synchronously inside React's commit, so a GPU that can't
|
|
26
|
+
// compile a shader (or has lost its WebGL context) throws during render.
|
|
27
|
+
// Catch it here so only the map goes, not the plugin page around it.
|
|
28
|
+
class MapErrorBoundary extends Component {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
this.state = { failed: false };
|
|
32
|
+
}
|
|
33
|
+
static getDerivedStateFromError() {
|
|
34
|
+
return { failed: true };
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
if (!this.state.failed)
|
|
38
|
+
return this.props.children;
|
|
39
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground absolute inset-0 flex flex-col items-center justify-center gap-3 p-4 text-center text-sm", children: [_jsx("p", { children: "Map unavailable. Your graphics driver couldn't draw it." }), _jsx(Button, { variant: "outline", size: "sm", onClick: () => {
|
|
40
|
+
this.props.onRetry();
|
|
41
|
+
this.setState({ failed: false });
|
|
42
|
+
}, children: "Try again" })] }));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
24
45
|
/**
|
|
25
46
|
* react-map-gl's `Map` (every prop and child passes through) in Stratos's
|
|
26
47
|
* map style, light or dark to match the theme, with English labels and the
|
|
@@ -33,6 +54,8 @@ export function StratosMap({ lightStyle = LIGHT_STYLE, darkStyle = DARK_STYLE, o
|
|
|
33
54
|
const mapStyle = useTheme() === "dark" ? darkStyle : lightStyle;
|
|
34
55
|
const [loaded, setLoaded] = useState(false);
|
|
35
56
|
const [drawing, setDrawing] = useState(true);
|
|
57
|
+
// Bumped by "Try again" so MapLibre remounts with a fresh GL context.
|
|
58
|
+
const [attempt, setAttempt] = useState(0);
|
|
36
59
|
// "style" while a style URL loads (a diffed switch reports idle on the old
|
|
37
60
|
// style meanwhile), "draw" until the map is next idle, null when drawn.
|
|
38
61
|
const phase = useRef("draw");
|
|
@@ -74,8 +97,8 @@ export function StratosMap({ lightStyle = LIGHT_STYLE, darkStyle = DARK_STYLE, o
|
|
|
74
97
|
};
|
|
75
98
|
return (
|
|
76
99
|
// No box of its own: the map sizes against the parent as it would bare.
|
|
77
|
-
_jsxs("div", { "data-stratos-map": "", "data-attribution-ready": loaded ? "" : undefined, "data-stratos-map-drawing": drawing ? "" : undefined, style: { display: "contents" }, children: [_jsx("style", { href: "stratos-map", precedence: "default", children: STYLES }), _jsx(Map, { ...props, ref: ref, mapStyle: mapStyle,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
100
|
+
_jsxs("div", { "data-stratos-map": "", "data-attribution-ready": loaded ? "" : undefined, "data-stratos-map-drawing": drawing ? "" : undefined, style: { display: "contents" }, children: [_jsx("style", { href: "stratos-map", precedence: "default", children: STYLES }), _jsx(MapErrorBoundary, { onRetry: () => setAttempt((n) => n + 1), children: _jsx(Map, { ...props, ref: ref, mapStyle: mapStyle,
|
|
101
|
+
// Reload Stratos's style from scratch on a theme switch, so style.load
|
|
102
|
+
// fires and the label tweaks go back on (a diff would undo them).
|
|
103
|
+
styleDiffing: isStratosStyle(mapStyle) ? false : props.styleDiffing, attributionControl: ATTRIBUTION, onLoad: handleLoad }, attempt) })] }));
|
|
81
104
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyvexsoftware/stratos-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Plugin SDK for Stratos — types, hooks, and UI components",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Skyvex Software Pty Ltd",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"class-variance-authority": "^0.7.0",
|
|
108
108
|
"cmdk": "^1.0.0",
|
|
109
109
|
"lucide-react": ">=0.300.0",
|
|
110
|
-
"maplibre-gl": "^
|
|
110
|
+
"maplibre-gl": "^6.0.0",
|
|
111
111
|
"react": "^19.0.0",
|
|
112
112
|
"react-map-gl": "^8.0.0",
|
|
113
113
|
"socket.io-client": "^4.0.0",
|
|
@@ -122,34 +122,35 @@
|
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"dependencies": {
|
|
125
|
-
"axios": "^1.
|
|
125
|
+
"axios": "^1.20.0",
|
|
126
126
|
"clsx": "^2.1.1",
|
|
127
127
|
"magic-string": "^0.30.21",
|
|
128
|
-
"tailwind-merge": "^3.
|
|
128
|
+
"tailwind-merge": "^3.7.0"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@radix-ui/react-alert-dialog": "^1.1
|
|
132
|
-
"@radix-ui/react-dialog": "^1.1
|
|
131
|
+
"@radix-ui/react-alert-dialog": "^1.2.1",
|
|
132
|
+
"@radix-ui/react-dialog": "^1.3.1",
|
|
133
133
|
"@radix-ui/react-label": "2.1.7",
|
|
134
|
-
"@radix-ui/react-popover": "^1.1
|
|
135
|
-
"@radix-ui/react-radio-group": "^1.
|
|
136
|
-
"@radix-ui/react-select": "^2.1
|
|
134
|
+
"@radix-ui/react-popover": "^1.3.1",
|
|
135
|
+
"@radix-ui/react-radio-group": "^1.5.1",
|
|
136
|
+
"@radix-ui/react-select": "^2.4.1",
|
|
137
137
|
"@radix-ui/react-separator": "1.1.7",
|
|
138
|
-
"@radix-ui/react-slider": "^1.
|
|
138
|
+
"@radix-ui/react-slider": "^1.6.1",
|
|
139
139
|
"@radix-ui/react-slot": "1.2.3",
|
|
140
|
-
"@radix-ui/react-tabs": "^1.1
|
|
141
|
-
"@radix-ui/react-tooltip": "^1.1
|
|
142
|
-
"@types/react": "^19.
|
|
143
|
-
"@types/react-dom": "^19.
|
|
144
|
-
"@vitejs/plugin-react": "^5.
|
|
140
|
+
"@radix-ui/react-tabs": "^1.2.1",
|
|
141
|
+
"@radix-ui/react-tooltip": "^1.4.1",
|
|
142
|
+
"@types/react": "^19.3.0",
|
|
143
|
+
"@types/react-dom": "^19.3.0",
|
|
144
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
145
145
|
"class-variance-authority": "^0.7.1",
|
|
146
146
|
"cmdk": "^1.1.1",
|
|
147
147
|
"lucide-react": "^0.577.0",
|
|
148
|
-
"maplibre-gl": "
|
|
149
|
-
"react
|
|
150
|
-
"react-
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"
|
|
148
|
+
"maplibre-gl": "6.16.0",
|
|
149
|
+
"react": "19.3.0",
|
|
150
|
+
"react-dom": "19.3.0",
|
|
151
|
+
"react-map-gl": "8.1.3",
|
|
152
|
+
"socket.io-client": "^4.8.4",
|
|
153
|
+
"typescript": "^5.9.3",
|
|
154
|
+
"vite": "^7.3.7"
|
|
154
155
|
}
|
|
155
156
|
}
|