@proto-labs-inc/rig-core 0.2.0 → 0.2.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/index.d.ts +4 -0
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
import { type Manifest, type ResolvedPreviewTheme, type RigToFrame } from "@proto-labs-inc/wire";
|
|
8
8
|
export { STATE_PARAM, variantParam } from "@proto-labs-inc/wire";
|
|
9
9
|
export declare const INTERNAL_PREVIEW_THEME_PARAM = "__protoTheme";
|
|
10
|
+
/** Mark the page light or dark (data-proto-theme and the "dark" class) for
|
|
11
|
+
* a prototype that styles both. The page's own CSS decides color-scheme:
|
|
12
|
+
* forcing it here gave pages that only style light mode dark form fields
|
|
13
|
+
* on a light page whenever the viewer's system was dark. */
|
|
10
14
|
export declare function applyPreviewTheme(theme: ResolvedPreviewTheme): void;
|
|
11
15
|
/** All addressable state, mirrored to the URL. Keys: "state" | "v.<component>". */
|
|
12
16
|
export declare class RigStore {
|
package/dist/index.js
CHANGED
|
@@ -7,15 +7,18 @@
|
|
|
7
7
|
import { PROTOCOL_VERSION, STATE_PARAM, variantParam, applyVariantSelection, isFrameToRig, } from "@proto-labs-inc/wire";
|
|
8
8
|
import { loadFrameTools } from "./frame-tools-loader.js";
|
|
9
9
|
export { STATE_PARAM, variantParam } from "@proto-labs-inc/wire";
|
|
10
|
-
const RIG_VERSION = "0.2.
|
|
10
|
+
const RIG_VERSION = "0.2.1";
|
|
11
11
|
export const INTERNAL_PREVIEW_THEME_PARAM = "__protoTheme";
|
|
12
|
+
/** Mark the page light or dark (data-proto-theme and the "dark" class) for
|
|
13
|
+
* a prototype that styles both. The page's own CSS decides color-scheme:
|
|
14
|
+
* forcing it here gave pages that only style light mode dark form fields
|
|
15
|
+
* on a light page whenever the viewer's system was dark. */
|
|
12
16
|
export function applyPreviewTheme(theme) {
|
|
13
17
|
if (typeof document === "undefined")
|
|
14
18
|
return;
|
|
15
19
|
const root = document.documentElement;
|
|
16
20
|
root.dataset.protoTheme = theme;
|
|
17
21
|
root.classList.toggle("dark", theme === "dark");
|
|
18
|
-
root.style.colorScheme = theme;
|
|
19
22
|
}
|
|
20
23
|
function resolvedSystemTheme() {
|
|
21
24
|
return window.matchMedia("(prefers-color-scheme: dark)").matches
|
package/package.json
CHANGED