@weasel-js/labkit 0.7.2 → 1.0.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.
- package/LICENSE +21 -0
- package/README.md +11 -3
- package/dist/_dts/{DrawCommand-CEvS5AdV.d.ts → DrawCommand-BwRCZYuo.d.ts} +106 -52
- package/dist/_dts/{useExperimentState-eSvpwV_P.d.ts → useExperimentState-CJn2hHzd.d.ts} +6 -4
- package/dist/{chunk-SSMHPMDV.js → chunk-53XSBIUK.js} +12 -11
- package/dist/chunk-53XSBIUK.js.map +1 -0
- package/dist/{chunk-BG6NLMOL.js → chunk-FP5LYDVX.js} +1229 -1227
- package/dist/chunk-FP5LYDVX.js.map +1 -0
- package/dist/{chunk-ERZQAU4N.js → chunk-HNXVLKBG.js} +3 -3
- package/dist/{chunk-ERZQAU4N.js.map → chunk-HNXVLKBG.js.map} +1 -1
- package/dist/{chunk-5XDFILHZ.js → chunk-XVBXYKFJ.js} +1675 -670
- package/dist/chunk-XVBXYKFJ.js.map +1 -0
- package/dist/fonts/inter-latin.woff2 +0 -0
- package/dist/fonts/oswald-latin-variable.woff2 +0 -0
- package/dist/index.d.ts +37 -13
- package/dist/index.js +776 -27
- package/dist/index.js.map +1 -1
- package/dist/passthrough/weasel-canvas.d.ts +1 -1
- package/dist/passthrough/weasel-canvas.js +1 -1
- package/dist/passthrough/weasel-ui.d.ts +332 -189
- package/dist/passthrough/weasel-ui.js +2 -2
- package/dist/state/index.d.ts +2 -2
- package/dist/state/index.js +2 -2
- package/dist/styles.css +229 -288
- package/dist/ui/layers/index.js +3 -3
- package/package.json +5 -6
- package/src/canvas/CanvasStack.less +1 -1
- package/src/controls/ControlPanel.less +12 -12
- package/src/dragdrop/DragGhost.less +2 -2
- package/src/dragdrop/Palette.less +6 -6
- package/src/index.ts +2 -0
- package/src/lab/Lab.test.tsx +20 -15
- package/src/lab/Lab.tsx +33 -32
- package/src/lab/LabContext.ts +3 -3
- package/src/lab/LabShell.less +14 -14
- package/src/lab/LabShell.test.tsx +7 -20
- package/src/lab/LabShell.tsx +22 -13
- package/src/lab/WorkspaceGrid.less +1 -1
- package/src/lab/WorkspaceGrid.stories.tsx +4 -4
- package/src/lab/index.ts +1 -1
- package/src/lab/useSystemMode.ts +30 -0
- package/src/layers/LayerList.less +9 -9
- package/src/primitives/FpsMeter.less +5 -5
- package/src/primitives/ScaleIndicator.less +7 -7
- package/src/primitives/Sidebar.less +12 -12
- package/src/primitives/StatusBar.less +10 -10
- package/src/primitives/Toolbar.less +16 -16
- package/src/state/store.test.ts +17 -9
- package/src/state/store.ts +13 -10
- package/src/state/types.ts +5 -2
- package/src/theme/Interstellar.stories.less +20 -20
- package/src/theme/Interstellar.stories.tsx +44 -59
- package/src/theme/base.less +29 -28
- package/src/theme/interstellar.test.ts +30 -0
- package/src/theme/interstellar.tokens.json +57 -0
- package/src/theme/interstellar.ts +9 -0
- package/src/ui/layers/LayerStack.less +21 -21
- package/src/ui/properties/CurveField.less +5 -5
- package/src/ui/properties/EffectCard.tsx +2 -2
- package/src/ui/properties/PropertyGroup.less +6 -6
- package/src/ui/properties/PropertyPanel.less +70 -70
- package/src/ui/properties/SpeechBalloonPanels.stories.tsx +1 -1
- package/src/ui/properties/storyLayouts.tsx +1 -1
- package/src/workspace/Workspace.less +14 -14
- package/src/workspace/Workspace.stories.tsx +2 -2
- package/src/workspace/Workspace.test.tsx +2 -2
- package/dist/chunk-5XDFILHZ.js.map +0 -1
- package/dist/chunk-BG6NLMOL.js.map +0 -1
- package/dist/chunk-SSMHPMDV.js.map +0 -1
- package/dist/theme-interstellar.css +0 -25
- package/dist/theme-light.css +0 -13
- package/src/fonts/oswald-latin-variable.woff2 +0 -0
- package/src/theme/interstellar.less +0 -34
- package/src/theme/light.less +0 -14
- package/src/theme/tokens.less +0 -85
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export { C as CanvasCapability, a as CanvasLayer, D as DragDropCapability, b as
|
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
8
|
import * as react from 'react';
|
|
9
9
|
import { ReactNode } from 'react';
|
|
10
|
-
import { S as StorageAdapter, W as WorkspaceRecord, e as SavedSnapshot } from './_dts/useExperimentState-
|
|
11
|
-
export { C as CreateLabStoreOptions, E as ExperimentStateHandle, b as LabStoreContext, c as LabStoreProvider, d as LabStoreState, U as UndoStack, f as WorkspaceIdContext, g as WorkspaceIdProvider, i as createMemoryAdapter, l as localStorageAdapter, n as noneAdapter, s as sessionStorageAdapter, u as urlHashAdapter, j as useExperimentState, k as useLabStore, m as useWorkspaceId } from './_dts/useExperimentState-
|
|
10
|
+
import { S as StorageAdapter, o as LabMode, W as WorkspaceRecord, e as SavedSnapshot } from './_dts/useExperimentState-CJn2hHzd.js';
|
|
11
|
+
export { C as CreateLabStoreOptions, E as ExperimentStateHandle, b as LabStoreContext, c as LabStoreProvider, d as LabStoreState, U as UndoStack, f as WorkspaceIdContext, g as WorkspaceIdProvider, i as createMemoryAdapter, l as localStorageAdapter, n as noneAdapter, s as sessionStorageAdapter, u as urlHashAdapter, j as useExperimentState, k as useLabStore, m as useWorkspaceId } from './_dts/useExperimentState-CJn2hHzd.js';
|
|
12
12
|
export { LayerList, LayerListProps } from './layers/index.js';
|
|
13
13
|
export { FpsMeter, ScaleIndicator, ScaleIndicatorProps, Sidebar, SidebarProps, StatusBar, StatusBarProps, Toolbar, ToolbarProps } from './primitives/index.js';
|
|
14
14
|
export { LayerStack, LayerStackItem, LayerStackProps } from './ui/layers/index.js';
|
|
@@ -42,18 +42,18 @@ interface LabProps {
|
|
|
42
42
|
defaultInstrument: string;
|
|
43
43
|
storage?: StorageAdapter | null;
|
|
44
44
|
storageKey?: string;
|
|
45
|
-
|
|
45
|
+
mode?: LabMode;
|
|
46
46
|
/**
|
|
47
47
|
* Optional list of CSS colors used to compose the interstellar theme's
|
|
48
48
|
* cosmic backdrop. Each color becomes one radial-gradient blob on the
|
|
49
49
|
* dark void base. Order maps to a fixed spread of positions; extras wrap
|
|
50
|
-
* around. Ignored unless
|
|
50
|
+
* around. Ignored unless the resolved mode is dark.
|
|
51
51
|
*/
|
|
52
52
|
nebula?: readonly string[];
|
|
53
53
|
title?: string;
|
|
54
54
|
children?: ReactNode;
|
|
55
55
|
}
|
|
56
|
-
declare function Lab({ instruments, defaultInstrument, storage, storageKey,
|
|
56
|
+
declare function Lab({ instruments, defaultInstrument, storage, storageKey, mode, nebula, title, children, }: LabProps): react_jsx_runtime.JSX.Element;
|
|
57
57
|
|
|
58
58
|
interface LabContextValue {
|
|
59
59
|
instruments: Instrument[];
|
|
@@ -66,13 +66,12 @@ interface LabContextValue {
|
|
|
66
66
|
saveSnapshot: (workspaceId: string, name?: string) => void;
|
|
67
67
|
loadSnapshot: (workspaceId: string, snapshotId: string) => void;
|
|
68
68
|
deleteSnapshot: (snapshotId: string) => void;
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
mode: LabMode;
|
|
70
|
+
setMode: (m: LabMode) => void;
|
|
71
71
|
}
|
|
72
72
|
declare const LabContext: react.Context<LabContextValue | null>;
|
|
73
73
|
declare function useLabContext(): LabContextValue;
|
|
74
74
|
|
|
75
|
-
type LabTheme = 'auto' | 'light' | 'interstellar';
|
|
76
75
|
interface LabShellProps {
|
|
77
76
|
title: string;
|
|
78
77
|
children: ReactNode;
|
|
@@ -80,16 +79,41 @@ interface LabShellProps {
|
|
|
80
79
|
header?: ReactNode;
|
|
81
80
|
/** Optional content rendered into the footer. */
|
|
82
81
|
footer?: ReactNode;
|
|
83
|
-
/**
|
|
84
|
-
|
|
82
|
+
/** Color mode. "auto" (default) follows prefers-color-scheme. */
|
|
83
|
+
mode?: LabMode;
|
|
85
84
|
}
|
|
86
|
-
declare function LabShell({ title, children, header, footer,
|
|
85
|
+
declare function LabShell({ title, children, header, footer, mode }: LabShellProps): react_jsx_runtime.JSX.Element;
|
|
87
86
|
|
|
88
87
|
interface WorkspaceGridProps {
|
|
89
88
|
children: ReactNode;
|
|
90
89
|
}
|
|
91
90
|
declare function WorkspaceGrid({ children }: WorkspaceGridProps): react_jsx_runtime.JSX.Element;
|
|
92
91
|
|
|
92
|
+
type TokenValue = string | number | readonly (string | number)[];
|
|
93
|
+
interface RawToken {
|
|
94
|
+
readonly type: string;
|
|
95
|
+
readonly value: TokenValue;
|
|
96
|
+
/** Render the referenced color at this alpha, 0–1. */
|
|
97
|
+
readonly alpha?: number | undefined;
|
|
98
|
+
readonly description?: string | undefined;
|
|
99
|
+
}
|
|
100
|
+
type FlatTokens = Record<string, RawToken>;
|
|
101
|
+
|
|
102
|
+
interface Theme {
|
|
103
|
+
readonly name: string;
|
|
104
|
+
readonly extends: Theme | null;
|
|
105
|
+
readonly defaultMode: string;
|
|
106
|
+
readonly tokens: FlatTokens;
|
|
107
|
+
readonly modes: Readonly<Record<string, FlatTokens>>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* labkit's theme: a cosmic dark and a warm parchment light, extending the
|
|
112
|
+
* built-in weasel theme. Authored as DTCG and loaded at import time — the
|
|
113
|
+
* interchange path a theme exported from a design tool would take.
|
|
114
|
+
*/
|
|
115
|
+
declare const interstellarTheme: Theme;
|
|
116
|
+
|
|
93
117
|
type CurveMark = {
|
|
94
118
|
kind: 'band';
|
|
95
119
|
x: [number, number];
|
|
@@ -406,5 +430,5 @@ declare function cloneWorkspace(workspaces: WorkspaceRecord[], id: string): Work
|
|
|
406
430
|
declare function closeWorkspace(workspaces: WorkspaceRecord[], id: string): WorkspaceRecord[];
|
|
407
431
|
declare function resetWorkspace(workspaces: WorkspaceRecord[], id: string, instruments: Instrument[]): WorkspaceRecord[];
|
|
408
432
|
|
|
409
|
-
export { CheckboxRow, ColorRow, ConfigField, CurveField, DefaultSidebar, DefaultStatusBar, DefaultToolbar, EffectCard, EffectCardList, Instrument, Lab, LabContext, LabShell, NumberRow, PropertyGroup, PropertyList, PropertyPanel, PropertyRow, SavedSnapshot, SelectRow, SliderRow, StorageAdapter, Subpanel, TextRow, ToggleRow, Workspace, WorkspaceChrome, WorkspaceGrid, WorkspaceRecord, addWorkspace, cloneWorkspace, closeWorkspace, defineInstrument, detectCapabilities, gridDims, resetWorkspace, useLabContext, validateConfigSchema };
|
|
410
|
-
export type { CapabilityFlags, CheckboxRowProps, ColorRowProps, CurveFieldProps, CurveMark, DefaultSidebarProps, DefaultStatusBarProps, DefaultToolbarProps, EffectCardListItem, EffectCardListProps, EffectCardProps, GridDims, LabContextValue, LabProps, LabShellProps,
|
|
433
|
+
export { CheckboxRow, ColorRow, ConfigField, CurveField, DefaultSidebar, DefaultStatusBar, DefaultToolbar, EffectCard, EffectCardList, Instrument, Lab, LabContext, LabMode, LabShell, NumberRow, PropertyGroup, PropertyList, PropertyPanel, PropertyRow, SavedSnapshot, SelectRow, SliderRow, StorageAdapter, Subpanel, TextRow, ToggleRow, Workspace, WorkspaceChrome, WorkspaceGrid, WorkspaceRecord, addWorkspace, cloneWorkspace, closeWorkspace, defineInstrument, detectCapabilities, gridDims, interstellarTheme, resetWorkspace, useLabContext, validateConfigSchema };
|
|
434
|
+
export type { CapabilityFlags, CheckboxRowProps, ColorRowProps, CurveFieldProps, CurveMark, DefaultSidebarProps, DefaultStatusBarProps, DefaultToolbarProps, EffectCardListItem, EffectCardListProps, EffectCardProps, GridDims, LabContextValue, LabProps, LabShellProps, NumberRowProps, PropertyGroupProps, PropertyListPack, PropertyListProps, PropertyPanelProps, PropertyRowLayout, PropertyRowProps, PropertyRowVariant, SelectRowProps, SidebarSlot, SliderRowProps, StatusBarSlot, SubpanelProps, TextRowProps, ToggleRowProps, ToolbarSlot, ValidationResult, WorkspaceChromeProps, WorkspaceGridProps, WorkspaceProps, WorkspaceSidebarContext, WorkspaceStatusBarContext, WorkspaceToolbarContext };
|