@vinena/knobs 0.5.1 → 0.5.3
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/CHANGELOG.md +29 -0
- package/README.md +7 -0
- package/dist/early.global.js +6 -6
- package/dist/{elementsview-tf4qzmtw.js → elementsview-1wsxcdtj.js} +4 -4
- package/dist/{elementsview-jnkbhzkj.js → elementsview-3kv34jfx.js} +4 -4
- package/dist/engine/browserdraw.d.ts +29 -2
- package/dist/engine/browserkit.d.ts +20 -1
- package/dist/engine/browserui.d.ts +162 -22
- package/dist/engine/devices.d.ts +3 -2
- package/dist/engine/devicon.d.ts +59 -0
- package/dist/engine/fit.d.ts +4 -3
- package/dist/engine/foldflip.d.ts +40 -0
- package/dist/engine/frames.d.ts +1 -0
- package/dist/engine/identity.d.ts +12 -5
- package/dist/engine/index.d.ts +2 -0
- package/dist/engine/mock.d.ts +14 -0
- package/dist/engine/mockdata.d.ts +5 -1
- package/dist/engine/morphrun.d.ts +4 -0
- package/dist/engine/native.d.ts +31 -3
- package/dist/engine/notice.d.ts +1 -2
- package/dist/engine/pageshot.d.ts +5 -2
- package/dist/engine/safaridraw.d.ts +162 -10
- package/dist/engine/screen.d.ts +24 -0
- package/dist/engine/store.d.ts +2 -1
- package/dist/engine/tabicon.d.ts +43 -0
- package/dist/engine/toplayer.d.ts +62 -0
- package/dist/engine/touchpointer.d.ts +0 -21
- package/dist/engine/underbar.d.ts +61 -0
- package/dist/engine/width.d.ts +3 -0
- package/dist/{framekit-3n7p79ht.js → framekit-cjz0e4y8.js} +2492 -1587
- package/dist/{framekit-g96t6nmq.js → framekit-yk1jxjv7.js} +2492 -1587
- package/dist/host.d.ts +51 -0
- package/dist/{index-33x9hxe3.js → index-6wbgqkdz.js} +626 -189
- package/dist/{index-2d6wvs8h.js → index-9jhatmky.js} +4 -4
- package/dist/{index-zvze25nf.js → index-begsqdm0.js} +1 -1
- package/dist/{index-peh33xjv.js → index-j1h13ahg.js} +1 -1
- package/dist/{index-5baxvd3v.js → index-p57fdttx.js} +307 -129
- package/dist/{index-dvr4x91q.js → index-prjpx67p.js} +20 -8
- package/dist/{index-d0cjxjsm.js → index-q73py563.js} +1 -1
- package/dist/{index-ke6v7919.js → index-sn2y6j09.js} +20 -8
- package/dist/{index-0casarhy.js → index-vgfn2n1h.js} +1 -1
- package/dist/{index-k015tb6c.js → index-zt3rheck.js} +4 -4
- package/dist/index.d.ts +26 -1
- package/dist/index.global.js +299 -176
- package/dist/index.js +424 -124
- package/dist/instance.d.ts +23 -4
- package/dist/{react-qv0nykcv.js → react-3rhdj2k1.js} +623 -186
- package/dist/{react-carf84xv.js → react-6tss0r9f.js} +307 -129
- package/dist/{react-eygws6cx.js → react-7vjfsh40.js} +4 -4
- package/dist/{react-71a9ypex.js → react-806qmkyz.js} +4 -4
- package/dist/{react-65tgdbs8.js → react-gefkdkdz.js} +1 -1
- package/dist/{react-sq9pkw4k.js → react-mmq2zya3.js} +1 -1
- package/dist/{react-xxfpfddf.js → react-qfpg79hs.js} +1 -1
- package/dist/{react-pdvseef0.js → react-qgz9afa2.js} +1 -1
- package/dist/react.js +420 -123
- package/dist/{storageview-sb23henh.js → storageview-7cv0vpdm.js} +4 -4
- package/dist/{storageview-vf8v8q8j.js → storageview-dyhpgt8f.js} +4 -4
- package/dist/types.d.ts +14 -0
- package/dist/ui/footer.d.ts +9 -2
- package/dist/ui/panel.d.ts +16 -2
- package/dist/ui/settings.d.ts +25 -1
- package/dist/version.d.ts +2 -0
- package/package.json +3 -2
- package/skills/devknobs/SKILL.md +1 -1
- package/dist/engine/endroom.d.ts +0 -21
|
@@ -6,27 +6,30 @@ import {
|
|
|
6
6
|
grabColor,
|
|
7
7
|
isCLike,
|
|
8
8
|
isElement
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-9jhatmky.js";
|
|
10
10
|
import {
|
|
11
11
|
quietFetch
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-q73py563.js";
|
|
13
13
|
import {
|
|
14
14
|
middle,
|
|
15
15
|
shorthand,
|
|
16
16
|
sizeText,
|
|
17
17
|
tidy
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-vgfn2n1h.js";
|
|
19
19
|
import"./index-78r0f8pw.js";
|
|
20
20
|
import {
|
|
21
|
+
HOST_RESET,
|
|
22
|
+
LAYER,
|
|
21
23
|
composedParent,
|
|
22
24
|
getState,
|
|
23
25
|
grabTargetAt,
|
|
26
|
+
holdInTopLayer,
|
|
24
27
|
icon,
|
|
25
28
|
isDevknobs,
|
|
26
29
|
isGrabbable,
|
|
27
30
|
pause,
|
|
28
31
|
subscribe
|
|
29
|
-
} from "./index-
|
|
32
|
+
} from "./index-6wbgqkdz.js";
|
|
30
33
|
import {
|
|
31
34
|
RINGS,
|
|
32
35
|
addStyle,
|
|
@@ -46,7 +49,7 @@ import {
|
|
|
46
49
|
ringQuads,
|
|
47
50
|
systemMedia,
|
|
48
51
|
watchSystemMedia
|
|
49
|
-
} from "./index-
|
|
52
|
+
} from "./index-p57fdttx.js";
|
|
50
53
|
|
|
51
54
|
// src/grab/preview.ts
|
|
52
55
|
var ELEMENT_NODE = 1;
|
|
@@ -3717,7 +3720,14 @@ function createThemeReader() {
|
|
|
3717
3720
|
}
|
|
3718
3721
|
|
|
3719
3722
|
// src/grab/overlay.ts
|
|
3720
|
-
var Z_INDEX =
|
|
3723
|
+
var Z_INDEX = 2147483646;
|
|
3724
|
+
var HOST_CSS = `
|
|
3725
|
+
:host([popover]) {
|
|
3726
|
+
inset: 0 !important;
|
|
3727
|
+
width: auto !important;
|
|
3728
|
+
height: auto !important;
|
|
3729
|
+
pointer-events: none !important;
|
|
3730
|
+
}`;
|
|
3721
3731
|
var GAP = 6;
|
|
3722
3732
|
var MARGIN = 8;
|
|
3723
3733
|
var MIN_RADIUS = 2;
|
|
@@ -4037,9 +4047,9 @@ function place(node, shape, ratio) {
|
|
|
4037
4047
|
function createOverlay(quiet = false, model = false) {
|
|
4038
4048
|
const host = document.createElement("div");
|
|
4039
4049
|
host.setAttribute("data-devknobs", "grab");
|
|
4040
|
-
host.style.cssText = `position:fixed;inset:0;pointer-events:none;z-index:${Z_INDEX}`;
|
|
4050
|
+
host.style.cssText = `position:fixed;inset:0;width:auto;height:auto;pointer-events:none;z-index:${Z_INDEX}`;
|
|
4041
4051
|
const root = host.attachShadow({ mode: "open" });
|
|
4042
|
-
addStyle(root, CSS2);
|
|
4052
|
+
addStyle(root, HOST_RESET + HOST_CSS + CSS2);
|
|
4043
4053
|
const layer = document.createElement("div");
|
|
4044
4054
|
layer.className = "layer";
|
|
4045
4055
|
const glow = document.createElement("div");
|
|
@@ -4098,6 +4108,7 @@ function createOverlay(quiet = false, model = false) {
|
|
|
4098
4108
|
layer.append(glow, glide, tip);
|
|
4099
4109
|
root.append(layer);
|
|
4100
4110
|
(document.body ?? document.documentElement).append(host);
|
|
4111
|
+
const hold = holdInTopLayer(host, LAYER.overlay);
|
|
4101
4112
|
const reduce = baseMatchMedia("(prefers-reduced-motion: reduce)");
|
|
4102
4113
|
let reduced = reduce.matches;
|
|
4103
4114
|
const radii = new WeakMap;
|
|
@@ -4383,6 +4394,7 @@ ${card.write(said, rows)}` : key;
|
|
|
4383
4394
|
reduce.removeEventListener("change", still);
|
|
4384
4395
|
stopSystem();
|
|
4385
4396
|
stopColor();
|
|
4397
|
+
hold.release();
|
|
4386
4398
|
host.remove();
|
|
4387
4399
|
}
|
|
4388
4400
|
const stopSystem = watchSystemMedia(still);
|
|
@@ -7,27 +7,30 @@ import {
|
|
|
7
7
|
grabColor,
|
|
8
8
|
isCLike,
|
|
9
9
|
isElement
|
|
10
|
-
} from "./react-
|
|
10
|
+
} from "./react-806qmkyz.js";
|
|
11
11
|
import {
|
|
12
12
|
quietFetch
|
|
13
|
-
} from "./react-
|
|
13
|
+
} from "./react-gefkdkdz.js";
|
|
14
14
|
import {
|
|
15
15
|
middle,
|
|
16
16
|
shorthand,
|
|
17
17
|
sizeText,
|
|
18
18
|
tidy
|
|
19
|
-
} from "./react-
|
|
19
|
+
} from "./react-qgz9afa2.js";
|
|
20
20
|
import"./react-adky72h9.js";
|
|
21
21
|
import {
|
|
22
|
+
HOST_RESET,
|
|
23
|
+
LAYER,
|
|
22
24
|
composedParent,
|
|
23
25
|
getState,
|
|
24
26
|
grabTargetAt,
|
|
27
|
+
holdInTopLayer,
|
|
25
28
|
icon,
|
|
26
29
|
isDevknobs,
|
|
27
30
|
isGrabbable,
|
|
28
31
|
pause,
|
|
29
32
|
subscribe
|
|
30
|
-
} from "./react-
|
|
33
|
+
} from "./react-3rhdj2k1.js";
|
|
31
34
|
import {
|
|
32
35
|
RINGS,
|
|
33
36
|
addStyle,
|
|
@@ -47,7 +50,7 @@ import {
|
|
|
47
50
|
ringQuads,
|
|
48
51
|
systemMedia,
|
|
49
52
|
watchSystemMedia
|
|
50
|
-
} from "./react-
|
|
53
|
+
} from "./react-6tss0r9f.js";
|
|
51
54
|
|
|
52
55
|
// src/grab/preview.ts
|
|
53
56
|
var ELEMENT_NODE = 1;
|
|
@@ -3718,7 +3721,14 @@ function createThemeReader() {
|
|
|
3718
3721
|
}
|
|
3719
3722
|
|
|
3720
3723
|
// src/grab/overlay.ts
|
|
3721
|
-
var Z_INDEX =
|
|
3724
|
+
var Z_INDEX = 2147483646;
|
|
3725
|
+
var HOST_CSS = `
|
|
3726
|
+
:host([popover]) {
|
|
3727
|
+
inset: 0 !important;
|
|
3728
|
+
width: auto !important;
|
|
3729
|
+
height: auto !important;
|
|
3730
|
+
pointer-events: none !important;
|
|
3731
|
+
}`;
|
|
3722
3732
|
var GAP = 6;
|
|
3723
3733
|
var MARGIN = 8;
|
|
3724
3734
|
var MIN_RADIUS = 2;
|
|
@@ -4038,9 +4048,9 @@ function place(node, shape, ratio) {
|
|
|
4038
4048
|
function createOverlay(quiet = false, model = false) {
|
|
4039
4049
|
const host = document.createElement("div");
|
|
4040
4050
|
host.setAttribute("data-devknobs", "grab");
|
|
4041
|
-
host.style.cssText = `position:fixed;inset:0;pointer-events:none;z-index:${Z_INDEX}`;
|
|
4051
|
+
host.style.cssText = `position:fixed;inset:0;width:auto;height:auto;pointer-events:none;z-index:${Z_INDEX}`;
|
|
4042
4052
|
const root = host.attachShadow({ mode: "open" });
|
|
4043
|
-
addStyle(root, CSS2);
|
|
4053
|
+
addStyle(root, HOST_RESET + HOST_CSS + CSS2);
|
|
4044
4054
|
const layer = document.createElement("div");
|
|
4045
4055
|
layer.className = "layer";
|
|
4046
4056
|
const glow = document.createElement("div");
|
|
@@ -4099,6 +4109,7 @@ function createOverlay(quiet = false, model = false) {
|
|
|
4099
4109
|
layer.append(glow, glide, tip);
|
|
4100
4110
|
root.append(layer);
|
|
4101
4111
|
(document.body ?? document.documentElement).append(host);
|
|
4112
|
+
const hold = holdInTopLayer(host, LAYER.overlay);
|
|
4102
4113
|
const reduce = baseMatchMedia("(prefers-reduced-motion: reduce)");
|
|
4103
4114
|
let reduced = reduce.matches;
|
|
4104
4115
|
const radii = new WeakMap;
|
|
@@ -4384,6 +4395,7 @@ ${card.write(said, rows)}` : key;
|
|
|
4384
4395
|
reduce.removeEventListener("change", still);
|
|
4385
4396
|
stopSystem();
|
|
4386
4397
|
stopColor();
|
|
4398
|
+
hold.release();
|
|
4387
4399
|
host.remove();
|
|
4388
4400
|
}
|
|
4389
4401
|
const stopSystem = watchSystemMedia(still);
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
lay,
|
|
5
5
|
rowBox,
|
|
6
6
|
rowButton
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-begsqdm0.js";
|
|
8
8
|
import {
|
|
9
9
|
getState,
|
|
10
10
|
icon
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-6wbgqkdz.js";
|
|
12
12
|
import {
|
|
13
13
|
__require,
|
|
14
14
|
isDevknobsFrame,
|
|
15
15
|
newer,
|
|
16
16
|
webStorage
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-p57fdttx.js";
|
|
18
18
|
|
|
19
19
|
// src/storage/onload.ts
|
|
20
20
|
var PRESETS_KEY = "devknobs:storage-presets";
|
|
@@ -321,7 +321,7 @@ function createPane(context) {
|
|
|
321
321
|
// src/ui/storageaction.ts
|
|
322
322
|
var STORAGE_VIEW = "storage";
|
|
323
323
|
function load() {
|
|
324
|
-
return import("./storageview-
|
|
324
|
+
return import("./storageview-dyhpgt8f.js").then((loaded) => loaded.storageView({
|
|
325
325
|
visible: () => getState().panel.open && !document.hidden
|
|
326
326
|
}));
|
|
327
327
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as engine from "./engine";
|
|
2
2
|
import { type KnobDescription } from "./engine/describe";
|
|
3
3
|
import type { GrabOptions, GrabResult } from "./grab/types";
|
|
4
|
+
import { type HostBuild, type PreferSetting, type PreferValue } from "./host";
|
|
4
5
|
import type { DevknobsState, DevknobsStatePatch, GrabColorValue } from "./types";
|
|
5
|
-
export type { BarsValue, BrowserValue, ClockMode, ClockValue, ConnectionValue, ContrastValue, DevknobsState, DevknobsStatePatch, DirValue, DprValue, EdgeValue, GeoErrorValue, GeoValue, GrabColorValue, HeightValue, Knob, LocaleValue, MotionValue, NetworkValue, OnlineValue, OrientationValue, PanelValue, SaveDataValue, SchemeValue, SideValue, SpeedValue, TextValue, TimeZoneValue, TransparencyValue, UaValue, VisionValue, WidthValue, ZoomValue, } from "./types";
|
|
6
|
+
export type { BarsValue, BrowserValue, ClockMode, ClockValue, ConnectionValue, ContrastValue, DevknobsState, DevknobsStatePatch, DevIconValue, DirValue, DprValue, EdgeValue, GeoErrorValue, GeoValue, GrabColorValue, HeightValue, Knob, LocaleValue, MotionValue, NetworkValue, OnlineValue, OrientationValue, PanelValue, SaveDataValue, SchemeValue, SideValue, SpeedValue, TextValue, TimeZoneValue, TransparencyValue, UaValue, VisionValue, WidthValue, ZoomValue, } from "./types";
|
|
6
7
|
export type { KnobDescription, KnobField, KnobReload, KnobShape, KnobValue, } from "./engine/describe";
|
|
7
8
|
export type { DeviceKind, DevicePreset } from "./engine/devices";
|
|
8
9
|
export type { GeoPreset } from "./engine/geo";
|
|
@@ -10,6 +11,7 @@ export type { UaBrand, UaHints, UaPreset } from "./engine/ua";
|
|
|
10
11
|
export type { EngineOptions } from "./engine";
|
|
11
12
|
export type { FrameRefusal, NativeDriver, NativeMedia, NativeSetting, NativeUa, NativeViewport } from "./engine/native";
|
|
12
13
|
export type { SystemMedia } from "./engine/system";
|
|
14
|
+
export type { HostBuild, PreferSetting, PreferValue } from "./host";
|
|
13
15
|
export type { GrabEntry, GrabFrame, GrabOptions, GrabPayload, GrabResult, ResolvedSource, } from "./grab/types";
|
|
14
16
|
export interface MountOptions extends engine.EngineOptions {
|
|
15
17
|
/**
|
|
@@ -44,6 +46,23 @@ export interface MountOptions extends engine.EngineOptions {
|
|
|
44
46
|
* Defaults to false.
|
|
45
47
|
*/
|
|
46
48
|
host?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* For a host: who runs the panel where the page mounts its own copy, its
|
|
51
|
+
* choice in the panel's settings and the footer naming the copy that runs.
|
|
52
|
+
* With `page`, a copy the page mounts takes the page from this one, now or
|
|
53
|
+
* once `setPrefer` says so, and this one does not take it back.
|
|
54
|
+
*/
|
|
55
|
+
prefer?: PreferSetting;
|
|
56
|
+
/**
|
|
57
|
+
* For a host: which build it is. Where two hosts meet on a page, such as a
|
|
58
|
+
* store and a local build of the extension, the one that ranks higher holds
|
|
59
|
+
* it whichever mounted first, and the other stands down for that page load:
|
|
60
|
+
* a local build over a store one, then the newer version. A host with none
|
|
61
|
+
* takes the page as before, from any copy.
|
|
62
|
+
*/
|
|
63
|
+
build?: HostBuild;
|
|
64
|
+
/** For a host with a `build`: it stood down for another host, which holds the page for this load. */
|
|
65
|
+
stoodDown?: () => void;
|
|
47
66
|
}
|
|
48
67
|
export declare const PRESETS: {
|
|
49
68
|
locale: readonly ["en", "en-US", "tr", "de", "fr", "es", "ar", "he", "ja", "zh-CN"];
|
|
@@ -62,6 +81,11 @@ export declare const PRESETS: {
|
|
|
62
81
|
* the extension's copy, it takes this mount's choices instead.
|
|
63
82
|
*/
|
|
64
83
|
export declare function mount(options?: MountOptions): void;
|
|
84
|
+
/**
|
|
85
|
+
* The host's preference changed, or came in after its mount: with `page`, it
|
|
86
|
+
* steps aside at once for a page copy that waits. The settings show it.
|
|
87
|
+
*/
|
|
88
|
+
export declare function setPrefer(value: PreferValue): void;
|
|
65
89
|
/** Remove the panel and undo every knob. A copy that was taken over has done so already. */
|
|
66
90
|
export declare function unmount(): void;
|
|
67
91
|
/**
|
|
@@ -70,6 +94,7 @@ export declare function unmount(): void;
|
|
|
70
94
|
* to those queries.
|
|
71
95
|
*/
|
|
72
96
|
export { setSystemMedia } from "./engine/system";
|
|
97
|
+
export { holdInTopLayer, LAYER, type TopLayerHold } from "./engine/toplayer";
|
|
73
98
|
/**
|
|
74
99
|
* Turn the `native` driver off or on, every knob kept: off, the page emulates
|
|
75
100
|
* them as with no driver. For a host that keeps the choice of its `setting`
|