tweakit 0.5.1 → 0.6.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/AGENTS.md +31 -29
- package/README.md +55 -29
- package/THIRD-PARTY-NOTICES.md +0 -1
- package/dist/tweaks/auto.js +2 -0
- package/dist/tweaks/auto.js.map +6 -0
- package/dist/tweaks/bezier-JFEZMCLP.js +2 -0
- package/dist/tweaks/bezier-JFEZMCLP.js.map +6 -0
- package/dist/tweaks/chunk-6UO4DHBN.js +2 -0
- package/dist/tweaks/chunk-6UO4DHBN.js.map +6 -0
- package/dist/tweaks/chunk-DIQMLBAS.js +2 -0
- package/dist/tweaks/chunk-DIQMLBAS.js.map +6 -0
- package/dist/tweaks/chunk-XE6OUJBG.js +2 -0
- package/dist/tweaks/chunk-XE6OUJBG.js.map +6 -0
- package/dist/tweaks/clip-WW7JYO4X.js +2 -0
- package/dist/tweaks/clip-WW7JYO4X.js.map +6 -0
- package/dist/tweaks/color-YMMFURP6.js +2 -0
- package/dist/tweaks/color-YMMFURP6.js.map +6 -0
- package/dist/tweaks/core.js +2 -1
- package/dist/tweaks/core.js.map +6 -0
- package/dist/tweaks/{fold-UGN7TXGX.js → fold-U6YRZLCJ.js} +2 -1
- package/dist/tweaks/fold-U6YRZLCJ.js.map +6 -0
- package/dist/tweaks/gradient-JER7PW4D.js +2 -0
- package/dist/tweaks/gradient-JER7PW4D.js.map +6 -0
- package/dist/tweaks/heavy-CLD7UAVI.js +2 -0
- package/dist/tweaks/heavy-CLD7UAVI.js.map +6 -0
- package/dist/tweaks/image-H6QSLGO3.js +4 -0
- package/dist/tweaks/image-H6QSLGO3.js.map +6 -0
- package/dist/tweaks/image-store-WRKY2NPU.js +2 -0
- package/dist/tweaks/image-store-WRKY2NPU.js.map +6 -0
- package/dist/tweaks/interval-TEUHQGZN.js +2 -0
- package/dist/tweaks/interval-TEUHQGZN.js.map +6 -0
- package/dist/tweaks/markup-NIBJD6E2.js +2 -0
- package/dist/tweaks/markup-NIBJD6E2.js.map +6 -0
- package/dist/tweaks/monitor-3BY7YCGX.js +3 -0
- package/dist/tweaks/monitor-3BY7YCGX.js.map +6 -0
- package/dist/tweaks/motion-FQPUBKKM.js +2 -0
- package/dist/tweaks/motion-FQPUBKKM.js.map +6 -0
- package/dist/tweaks/plot-2HBNBZSG.js +3 -0
- package/dist/tweaks/plot-2HBNBZSG.js.map +6 -0
- package/dist/tweaks/point-VV6XV3I6.js +2 -0
- package/dist/tweaks/point-VV6XV3I6.js.map +6 -0
- package/dist/tweaks/shadow-5E4E55I2.js +2 -0
- package/dist/tweaks/shadow-5E4E55I2.js.map +6 -0
- package/dist/tweaks/sides-P3STEVYY.js +2 -0
- package/dist/tweaks/sides-P3STEVYY.js.map +6 -0
- package/dist/tweaks/spring-HUVSXNVN.js +2 -0
- package/dist/tweaks/spring-HUVSXNVN.js.map +6 -0
- package/dist/tweaks/tabs-76FW7LQ7.js +2 -0
- package/dist/tweaks/tabs-76FW7LQ7.js.map +6 -0
- package/dist/tweaks.css +1 -1
- package/dist/tweaks.js +6 -3
- package/dist/tweaks.js.map +6 -0
- package/dist/types/tweaks/easing.d.ts +8 -11
- package/dist/types/tweaks/panel.d.ts +7 -4
- package/dist/types/tweaks/schema.d.ts +6 -8
- package/dist/types/tweaks/standalone.d.ts +3 -3
- package/dist/types/tweaks/types.d.ts +288 -100
- package/package.json +27 -5
- package/src/tweaks/auto.ts +12 -0
- package/src/tweaks/clip.ts +94 -0
- package/src/tweaks/controls/basic.ts +403 -0
- package/src/tweaks/controls/bezier.ts +99 -0
- package/src/tweaks/controls/color.ts +412 -0
- package/src/tweaks/controls/gradient.ts +240 -0
- package/src/tweaks/controls/image.ts +299 -0
- package/src/tweaks/controls/interval.ts +104 -0
- package/src/tweaks/controls/monitor.ts +105 -0
- package/src/tweaks/controls/motion.ts +141 -0
- package/src/tweaks/controls/plot.ts +220 -0
- package/src/tweaks/controls/point.ts +119 -0
- package/src/tweaks/controls/shadow.ts +83 -0
- package/src/tweaks/controls/sides.ts +86 -0
- package/src/tweaks/controls/spring.ts +148 -0
- package/src/tweaks/controls/tabs.ts +47 -0
- package/src/tweaks/core.ts +9 -0
- package/src/tweaks/easing.ts +93 -0
- package/src/tweaks/enhance.ts +20 -0
- package/src/tweaks/feedback.ts +119 -0
- package/src/tweaks/fold.ts +21 -0
- package/src/tweaks/heavy.ts +302 -0
- package/src/tweaks/icons.ts +19 -0
- package/src/tweaks/image-store.ts +101 -0
- package/src/tweaks/lazy.ts +46 -0
- package/src/tweaks/markup.ts +154 -0
- package/src/tweaks/panel.ts +869 -0
- package/src/tweaks/schema.ts +189 -0
- package/src/tweaks/shared.ts +525 -0
- package/src/tweaks/single.ts +22 -0
- package/src/tweaks/standalone.ts +89 -0
- package/src/tweaks/types.ts +526 -0
- package/src/tweaks.css +959 -0
- package/src/wide-gamut.ts +310 -0
- package/dist/tweaks/bezier-2RABC6LD.js +0 -1
- package/dist/tweaks/chunk-4ATI34PB.js +0 -1
- package/dist/tweaks/chunk-7OSCMZ2J.js +0 -1
- package/dist/tweaks/chunk-W3JNIJ2F.js +0 -1
- package/dist/tweaks/clip-ECGCECEC.js +0 -1
- package/dist/tweaks/colour-2RE3FQ5E.js +0 -1
- package/dist/tweaks/gradient-DB6XTDHO.js +0 -1
- package/dist/tweaks/heavy-PKOMHB3C.js +0 -1
- package/dist/tweaks/image-JD2NSQYE.js +0 -1
- package/dist/tweaks/interval-L2E4L3AZ.js +0 -1
- package/dist/tweaks/markup-MLAHTUK4.js +0 -1
- package/dist/tweaks/monitor-IEK742PG.js +0 -2
- package/dist/tweaks/motion-N5UNVR55.js +0 -1
- package/dist/tweaks/plot-VVTOY3RA.js +0 -2
- package/dist/tweaks/point-YMMHSLO7.js +0 -1
- package/dist/tweaks/shadow-IKYOV3VN.js +0 -1
- package/dist/tweaks/sides-FH227Z54.js +0 -1
- package/dist/tweaks/spring-3PKAFIH7.js +0 -1
- package/dist/tweaks/tabs-BKK5NIIY.js +0 -1
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GradientValue } from "./types.js";
|
|
2
2
|
/** cubic-bezier control points [x1, y1, x2, y2]. */
|
|
3
|
-
type Bez = [number, number, number, number];
|
|
4
|
-
|
|
3
|
+
export type Bez = [number, number, number, number];
|
|
4
|
+
export declare const KEYWORDS: Record<string, Bez>;
|
|
5
|
+
/** Bezier control points, or null for linear and anything unrecognized (bad input degrades to a
|
|
5
6
|
* straight blend). x1/x2 clamp into [0,1] as CSS requires; y may overshoot. */
|
|
6
7
|
export declare function parseEasing(e: unknown): Bez | null;
|
|
7
|
-
/** The name an easing is stored under: trimmed and lowercased when parseEasing knows it, else "linear". */
|
|
8
|
-
export declare const easingName: (e: unknown) => GradientEasing;
|
|
9
8
|
/** The curve at 16 even t: [x, y] pairs, y clamped to [0,1] since it becomes a color-mix percentage. */
|
|
10
9
|
export declare function easingSamples(b: Bez): Array<[number, number]>;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
export declare function easingAt(b: Bez | null, x: number): number;
|
|
14
|
-
/** A gradient value's `<color-stop-list>` with the easing expanded; for a conic / radial gradient. */
|
|
10
|
+
/** A gradient value's `<color-stop-list>` with the easing expanded; for a conic / radial gradient.
|
|
11
|
+
* One stop comes back doubled and none as `transparent, transparent`, so the list stays valid. */
|
|
15
12
|
export declare function gradientStops(value: GradientValue): string;
|
|
16
|
-
/** The `linear-gradient(…)` for a gradient value; `direction` is degrees or any CSS direction.
|
|
13
|
+
/** The `linear-gradient(…)` for a gradient value; `direction` is degrees or any CSS direction.
|
|
14
|
+
* One stop draws a solid fill and no stops is `none`, both still valid for background-image. */
|
|
17
15
|
export declare function gradientCss(value: GradientValue, direction?: number | string): string;
|
|
18
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HeldSchema, TweaksOptions, Panel, ParamsOf, KnownTypes, Control } from "./types.js";
|
|
2
2
|
import type { Meta } from "./schema.js";
|
|
3
3
|
/** A params object or one of its folder/tabs sub-objects — the holder a control writes into. */
|
|
4
4
|
type Target = Record<string, unknown>;
|
|
@@ -14,9 +14,12 @@ export interface Entry {
|
|
|
14
14
|
persist: boolean;
|
|
15
15
|
m: Meta;
|
|
16
16
|
el: HTMLElement;
|
|
17
|
+
note?: Control["note"];
|
|
18
|
+
range?: Control["range"];
|
|
17
19
|
}
|
|
18
|
-
/** A values snapshot — params
|
|
20
|
+
/** A values snapshot — params as JSON round-trips it. */
|
|
19
21
|
export type Snapshot = Record<string, any>;
|
|
20
|
-
/** Build a panel from `schema`; the shell and API exist synchronously, lazy controls fill in on `ready`.
|
|
21
|
-
|
|
22
|
+
/** Build a panel from `schema`; the shell and API exist synchronously, lazy controls fill in on `ready`.
|
|
23
|
+
* A schema written inline (or `as const`) types `params` from its shape. */
|
|
24
|
+
export declare function tweaks<const S extends HeldSchema>(name: string, schema: S & KnownTypes<S>, opts?: TweaksOptions): Panel<ParamsOf<S>>;
|
|
22
25
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { SchemaObject, Option, Get
|
|
1
|
+
import type { SchemaObject, Option, Get } from "./types.js";
|
|
2
2
|
/** A point control's component spec, as the public verbose form declares it. */
|
|
3
3
|
type PointComponent = Extract<SchemaObject, {
|
|
4
4
|
type: "point";
|
|
5
|
+
components: ReadonlyArray<unknown>;
|
|
5
6
|
}>["components"][number];
|
|
6
7
|
/** One page of a tabs control: its slug key, title and the metas built inside it. */
|
|
7
8
|
interface TabPage {
|
|
@@ -56,6 +57,8 @@ interface Meta {
|
|
|
56
57
|
interval?: number;
|
|
57
58
|
decimals?: number;
|
|
58
59
|
maxSize?: number;
|
|
60
|
+
fit?: number | false;
|
|
61
|
+
quality?: number;
|
|
59
62
|
upload?: boolean;
|
|
60
63
|
clear?: boolean;
|
|
61
64
|
action?: () => void;
|
|
@@ -69,12 +72,7 @@ interface Meta {
|
|
|
69
72
|
/** A verbose handler's result: the control's own fields, or falsy for a malformed shape. */
|
|
70
73
|
type MetaFields = Partial<Meta> | false;
|
|
71
74
|
declare function metaFor(key: string, value: any, depth?: number): Meta | null;
|
|
72
|
-
declare const
|
|
73
|
-
declare const isReservedKey: (k: string) => k is "__proto__" | "constructor" | "prototype";
|
|
74
|
-
declare const valueChanged: (a: unknown, b: unknown) => boolean;
|
|
75
|
-
declare const restoreDefault: (ctrl: Pick<Control, "set">, raw: unknown, def: unknown) => void;
|
|
76
|
-
declare const SPRING_KEYS: string[];
|
|
77
|
-
declare const TYPED_META: Partial<Record<SchemaObject["type"], (v: any, depth: number) => MetaFields>>;
|
|
75
|
+
declare const TYPED_META: Partial<Record<SchemaObject["type"], (v: any, depth: number, key: string) => MetaFields>>;
|
|
78
76
|
declare const VALUELESS: Set<string>;
|
|
79
|
-
export { metaFor,
|
|
77
|
+
export { metaFor, VALUELESS, TYPED_META };
|
|
80
78
|
export type { Meta, TabPage, PointComponent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HeldValue, KnownType, MountOptions, MountedControl, ColorPickerOptions, ColorPicker } from "./types.js";
|
|
2
2
|
/** One control from a schema value, into `host`; a folder or tabs set is tweaks()'s to build. */
|
|
3
|
-
export declare function mountControl(host: Element, value:
|
|
4
|
-
/** The
|
|
3
|
+
export declare function mountControl<const V extends HeldValue>(host: Element, value: V & KnownType<V>, opts?: MountOptions): MountedControl;
|
|
4
|
+
/** The color editor surface alone, for a host page that brings its own swatch. */
|
|
5
5
|
export declare function createColorPicker(opts?: ColorPickerOptions): ColorPicker;
|