@weasel-js/labkit 1.0.0 → 1.0.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/_dts/{DrawCommand-BwRCZYuo.d.ts → DrawCommand-CitWPxMY.d.ts} +8 -1
- package/dist/{chunk-HNXVLKBG.js → chunk-EXBV7A6X.js} +3 -3
- package/dist/{chunk-HNXVLKBG.js.map → chunk-EXBV7A6X.js.map} +1 -1
- package/dist/{chunk-XVBXYKFJ.js → chunk-ISEK5LXT.js} +642 -226
- package/dist/chunk-ISEK5LXT.js.map +1 -0
- package/dist/chunk-NRD3TDNQ.js +5946 -0
- package/dist/chunk-NRD3TDNQ.js.map +1 -0
- package/dist/index.js +22 -22
- package/dist/index.js.map +1 -1
- package/dist/passthrough/weasel-canvas.d.ts +29 -6
- package/dist/passthrough/weasel-canvas.js +1 -1
- package/dist/passthrough/weasel-ui.d.ts +73 -11
- package/dist/passthrough/weasel-ui.js +2 -2
- package/dist/ui/layers/index.js +3 -3
- package/package.json +1 -1
- package/src/lab/Lab.tsx +2 -2
- package/src/lab/LabShell.tsx +1 -1
- package/src/passthrough/weasel-ui.ts +4 -0
- package/src/theme/Interstellar.stories.tsx +1 -1
- package/src/theme/interstellar.test.ts +1 -1
- package/src/ui/properties/PropertyPanel.stories.tsx +0 -1
- package/dist/chunk-FP5LYDVX.js +0 -6039
- package/dist/chunk-FP5LYDVX.js.map +0 -1
- package/dist/chunk-XVBXYKFJ.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { LayerStack } from './chunk-
|
|
2
|
-
import { p, F } from './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { LayerStack } from './chunk-EXBV7A6X.js';
|
|
2
|
+
import { p, F } from './chunk-NRD3TDNQ.js';
|
|
3
|
+
import './chunk-ISEK5LXT.js';
|
|
4
4
|
import { Sidebar, StatusBar, Toolbar } from './chunk-HXZHVU4G.js';
|
|
5
5
|
export { FpsMeter, ScaleIndicator, Sidebar, StatusBar, Toolbar } from './chunk-HXZHVU4G.js';
|
|
6
6
|
import { LabStoreContext, createLabStore, noneAdapter } from './chunk-53XSBIUK.js';
|
|
@@ -15,8 +15,8 @@ export { LayerList } from './chunk-2QNYYL3V.js';
|
|
|
15
15
|
import { createEventBus, redo, undo, pushSnapshot } from './chunk-7BKDG73Z.js';
|
|
16
16
|
export { clearUndo, createEventBus, emptyStack, pushSnapshot, redo, undo } from './chunk-7BKDG73Z.js';
|
|
17
17
|
import { createContext, useContext, useMemo, useRef, useState, Children, useEffect, useCallback, useLayoutEffect } from 'react';
|
|
18
|
-
import { useStore } from 'zustand/react';
|
|
19
18
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
19
|
+
import { useStore } from 'zustand/react';
|
|
20
20
|
import { createPortal } from 'react-dom';
|
|
21
21
|
|
|
22
22
|
// src/instrument/capabilityDetector.ts
|
|
@@ -815,24 +815,6 @@ var interstellar_tokens_default = {
|
|
|
815
815
|
|
|
816
816
|
// src/theme/interstellar.ts
|
|
817
817
|
var interstellarTheme = loadDTCG(interstellar_tokens_default);
|
|
818
|
-
function query() {
|
|
819
|
-
if (typeof window === "undefined" || !window.matchMedia) return null;
|
|
820
|
-
return window.matchMedia("(prefers-color-scheme: light)");
|
|
821
|
-
}
|
|
822
|
-
function useResolvedMode(mode) {
|
|
823
|
-
const [system, setSystem] = useState(
|
|
824
|
-
() => query()?.matches ? "light" : "dark"
|
|
825
|
-
);
|
|
826
|
-
useEffect(() => {
|
|
827
|
-
if (mode !== "auto") return;
|
|
828
|
-
const mq = query();
|
|
829
|
-
if (!mq) return;
|
|
830
|
-
const onChange = (e) => setSystem(e.matches ? "light" : "dark");
|
|
831
|
-
mq.addEventListener("change", onChange);
|
|
832
|
-
return () => mq.removeEventListener("change", onChange);
|
|
833
|
-
}, [mode]);
|
|
834
|
-
return mode === "auto" ? system : mode;
|
|
835
|
-
}
|
|
836
818
|
function DragGhost({ item, screenPos }) {
|
|
837
819
|
const [mounted, setMounted] = useState(false);
|
|
838
820
|
useEffect(() => setMounted(true), []);
|
|
@@ -1408,6 +1390,24 @@ function resetWorkspace(workspaces, id, instruments) {
|
|
|
1408
1390
|
};
|
|
1409
1391
|
return [...workspaces.slice(0, idx), reset, ...workspaces.slice(idx + 1)];
|
|
1410
1392
|
}
|
|
1393
|
+
function query() {
|
|
1394
|
+
if (typeof window === "undefined" || !window.matchMedia) return null;
|
|
1395
|
+
return window.matchMedia("(prefers-color-scheme: light)");
|
|
1396
|
+
}
|
|
1397
|
+
function useResolvedMode(mode) {
|
|
1398
|
+
const [system, setSystem] = useState(
|
|
1399
|
+
() => query()?.matches ? "light" : "dark"
|
|
1400
|
+
);
|
|
1401
|
+
useEffect(() => {
|
|
1402
|
+
if (mode !== "auto") return;
|
|
1403
|
+
const mq = query();
|
|
1404
|
+
if (!mq) return;
|
|
1405
|
+
const onChange = (e) => setSystem(e.matches ? "light" : "dark");
|
|
1406
|
+
mq.addEventListener("change", onChange);
|
|
1407
|
+
return () => mq.removeEventListener("change", onChange);
|
|
1408
|
+
}, [mode]);
|
|
1409
|
+
return mode === "auto" ? system : mode;
|
|
1410
|
+
}
|
|
1411
1411
|
function LabShell({ title, children, header, footer, mode = "auto" }) {
|
|
1412
1412
|
const resolved = useResolvedMode(mode);
|
|
1413
1413
|
const outer = useThemeOptional();
|