tweak-ui 0.5.0 → 0.8.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/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/builder.d.ts +76 -140
- package/dist/lib/builder.d.ts.map +1 -1
- package/dist/lib/color/adapter.d.ts +7 -0
- package/dist/lib/color/adapter.d.ts.map +1 -0
- package/dist/lib/color/array-format.d.ts +9 -0
- package/dist/lib/color/array-format.d.ts.map +1 -0
- package/dist/lib/color/converter.d.ts.map +1 -0
- package/dist/lib/color/css-string-format.d.ts +8 -0
- package/dist/lib/color/css-string-format.d.ts.map +1 -0
- package/dist/lib/color/formatter.d.ts +9 -0
- package/dist/lib/color/formatter.d.ts.map +1 -0
- package/dist/lib/color/hex-string-format.d.ts +9 -0
- package/dist/lib/color/hex-string-format.d.ts.map +1 -0
- package/dist/lib/color/index.d.ts.map +1 -0
- package/dist/lib/color/number-format.d.ts +9 -0
- package/dist/lib/color/number-format.d.ts.map +1 -0
- package/dist/lib/{color-formats → color}/object-format.d.ts +4 -4
- package/dist/lib/color/object-format.d.ts.map +1 -0
- package/dist/lib/{color-formats → color}/types.d.ts +15 -9
- package/dist/lib/color/types.d.ts.map +1 -0
- package/dist/lib/components/container/bar.d.ts +28 -0
- package/dist/lib/components/container/bar.d.ts.map +1 -0
- package/dist/lib/components/container/dialog.d.ts +14 -0
- package/dist/lib/components/container/dialog.d.ts.map +1 -0
- package/dist/lib/components/container/grid.d.ts +22 -0
- package/dist/lib/components/container/grid.d.ts.map +1 -0
- package/dist/lib/components/container/group.d.ts +55 -0
- package/dist/lib/components/container/group.d.ts.map +1 -0
- package/dist/lib/components/container/index.d.ts +10 -0
- package/dist/lib/components/container/index.d.ts.map +1 -0
- package/dist/lib/components/container/list.d.ts +25 -0
- package/dist/lib/components/container/list.d.ts.map +1 -0
- package/dist/lib/components/container/section.d.ts +28 -0
- package/dist/lib/components/container/section.d.ts.map +1 -0
- package/dist/lib/components/container/split.d.ts +40 -0
- package/dist/lib/components/container/split.d.ts.map +1 -0
- package/dist/lib/components/container/tabs.d.ts +23 -0
- package/dist/lib/components/container/tabs.d.ts.map +1 -0
- package/dist/lib/components/container/tree.d.ts +25 -0
- package/dist/lib/components/container/tree.d.ts.map +1 -0
- package/dist/lib/components/controls/angle.d.ts +29 -33
- package/dist/lib/components/controls/angle.d.ts.map +1 -1
- package/dist/lib/components/controls/bitmask.d.ts +41 -0
- package/dist/lib/components/controls/bitmask.d.ts.map +1 -0
- package/dist/lib/components/controls/bool.d.ts +52 -0
- package/dist/lib/components/controls/bool.d.ts.map +1 -0
- package/dist/lib/components/controls/color-picker.d.ts +12 -27
- package/dist/lib/components/controls/color-picker.d.ts.map +1 -1
- package/dist/lib/components/controls/color.d.ts +12 -26
- package/dist/lib/components/controls/color.d.ts.map +1 -1
- package/dist/lib/components/controls/index.d.ts +9 -5
- package/dist/lib/components/controls/index.d.ts.map +1 -1
- package/dist/lib/components/controls/input.d.ts +44 -0
- package/dist/lib/components/controls/input.d.ts.map +1 -0
- package/dist/lib/components/controls/matrix.d.ts +58 -0
- package/dist/lib/components/controls/matrix.d.ts.map +1 -0
- package/dist/lib/components/controls/point.d.ts +10 -16
- package/dist/lib/components/controls/point.d.ts.map +1 -1
- package/dist/lib/components/controls/poll.d.ts +12 -0
- package/dist/lib/components/controls/poll.d.ts.map +1 -0
- package/dist/lib/components/controls/scalar.d.ts +67 -0
- package/dist/lib/components/controls/scalar.d.ts.map +1 -0
- package/dist/lib/components/controls/select.d.ts +8 -14
- package/dist/lib/components/controls/select.d.ts.map +1 -1
- package/dist/lib/components/controls/spherical.d.ts +18 -55
- package/dist/lib/components/controls/spherical.d.ts.map +1 -1
- package/dist/lib/components/controls/string.d.ts +46 -0
- package/dist/lib/components/controls/string.d.ts.map +1 -0
- package/dist/lib/components/controls/vector.d.ts +54 -0
- package/dist/lib/components/controls/vector.d.ts.map +1 -0
- package/dist/lib/components/elements/button.d.ts +36 -0
- package/dist/lib/components/elements/button.d.ts.map +1 -0
- package/dist/lib/components/elements/divider.d.ts +4 -0
- package/dist/lib/components/elements/divider.d.ts.map +1 -0
- package/dist/lib/components/elements/graph.d.ts +8 -0
- package/dist/lib/components/elements/graph.d.ts.map +1 -0
- package/dist/lib/components/elements/image.d.ts +33 -0
- package/dist/lib/components/elements/image.d.ts.map +1 -0
- package/dist/lib/components/elements/index.d.ts +6 -0
- package/dist/lib/components/elements/index.d.ts.map +1 -0
- package/dist/lib/components/elements/widget.d.ts +27 -0
- package/dist/lib/components/elements/widget.d.ts.map +1 -0
- package/dist/lib/components/index.d.ts +2 -4
- package/dist/lib/components/index.d.ts.map +1 -1
- package/dist/lib/core/control.d.ts +20 -0
- package/dist/lib/core/control.d.ts.map +1 -0
- package/dist/lib/core/index.d.ts +1 -2
- package/dist/lib/core/index.d.ts.map +1 -1
- package/dist/lib/core/render.d.ts +7 -9
- package/dist/lib/core/render.d.ts.map +1 -1
- package/dist/lib/core/types.d.ts +46 -60
- package/dist/lib/core/types.d.ts.map +1 -1
- package/dist/lib/core/utils.d.ts +18 -33
- package/dist/lib/core/utils.d.ts.map +1 -1
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/mount.d.ts +6 -16
- package/dist/lib/mount.d.ts.map +1 -1
- package/dist/lib/stats/index.d.ts +2 -0
- package/dist/lib/stats/index.d.ts.map +1 -0
- package/dist/lib/stats/sampler.d.ts +66 -0
- package/dist/lib/stats/sampler.d.ts.map +1 -0
- package/dist/lib/stats/stats-renderer.d.ts +16 -0
- package/dist/lib/stats/stats-renderer.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/style.d.ts +4 -0
- package/dist/tweak-ui.module.js +2946 -2738
- package/dist/tweak-ui.module.js.map +1 -1
- package/dist/tweak-ui.umd.js +33 -2
- package/dist/tweak-ui.umd.js.map +1 -1
- package/package.json +23 -20
- package/dist/lib/builder.js +0 -250
- package/dist/lib/builder.js.map +0 -1
- package/dist/lib/color-formats/array-format.d.ts +0 -9
- package/dist/lib/color-formats/array-format.d.ts.map +0 -1
- package/dist/lib/color-formats/array-format.js +0 -18
- package/dist/lib/color-formats/array-format.js.map +0 -1
- package/dist/lib/color-formats/converter.d.ts.map +0 -1
- package/dist/lib/color-formats/converter.js +0 -85
- package/dist/lib/color-formats/converter.js.map +0 -1
- package/dist/lib/color-formats/css-string-format.d.ts +0 -8
- package/dist/lib/color-formats/css-string-format.d.ts.map +0 -1
- package/dist/lib/color-formats/css-string-format.js +0 -28
- package/dist/lib/color-formats/css-string-format.js.map +0 -1
- package/dist/lib/color-formats/formatter.d.ts +0 -9
- package/dist/lib/color-formats/formatter.d.ts.map +0 -1
- package/dist/lib/color-formats/formatter.js +0 -35
- package/dist/lib/color-formats/formatter.js.map +0 -1
- package/dist/lib/color-formats/hex-string-format.d.ts +0 -8
- package/dist/lib/color-formats/hex-string-format.d.ts.map +0 -1
- package/dist/lib/color-formats/hex-string-format.js +0 -28
- package/dist/lib/color-formats/hex-string-format.js.map +0 -1
- package/dist/lib/color-formats/index.d.ts.map +0 -1
- package/dist/lib/color-formats/index.js +0 -4
- package/dist/lib/color-formats/index.js.map +0 -1
- package/dist/lib/color-formats/number-format.d.ts +0 -9
- package/dist/lib/color-formats/number-format.d.ts.map +0 -1
- package/dist/lib/color-formats/number-format.js +0 -23
- package/dist/lib/color-formats/number-format.js.map +0 -1
- package/dist/lib/color-formats/object-format.d.ts.map +0 -1
- package/dist/lib/color-formats/object-format.js +0 -23
- package/dist/lib/color-formats/object-format.js.map +0 -1
- package/dist/lib/color-formats/types.d.ts.map +0 -1
- package/dist/lib/color-formats/types.js +0 -2
- package/dist/lib/color-formats/types.js.map +0 -1
- package/dist/lib/components/button.d.ts +0 -29
- package/dist/lib/components/button.d.ts.map +0 -1
- package/dist/lib/components/button.js +0 -15
- package/dist/lib/components/button.js.map +0 -1
- package/dist/lib/components/content.d.ts +0 -22
- package/dist/lib/components/content.d.ts.map +0 -1
- package/dist/lib/components/content.js +0 -10
- package/dist/lib/components/content.js.map +0 -1
- package/dist/lib/components/controls/angle.js +0 -201
- package/dist/lib/components/controls/angle.js.map +0 -1
- package/dist/lib/components/controls/checkbox.d.ts +0 -29
- package/dist/lib/components/controls/checkbox.d.ts.map +0 -1
- package/dist/lib/components/controls/checkbox.js +0 -31
- package/dist/lib/components/controls/checkbox.js.map +0 -1
- package/dist/lib/components/controls/color-picker.js +0 -267
- package/dist/lib/components/controls/color-picker.js.map +0 -1
- package/dist/lib/components/controls/color.js +0 -77
- package/dist/lib/components/controls/color.js.map +0 -1
- package/dist/lib/components/controls/index.js +0 -11
- package/dist/lib/components/controls/index.js.map +0 -1
- package/dist/lib/components/controls/number.d.ts +0 -48
- package/dist/lib/components/controls/number.d.ts.map +0 -1
- package/dist/lib/components/controls/number.js +0 -142
- package/dist/lib/components/controls/number.js.map +0 -1
- package/dist/lib/components/controls/point.js +0 -137
- package/dist/lib/components/controls/point.js.map +0 -1
- package/dist/lib/components/controls/position.d.ts +0 -56
- package/dist/lib/components/controls/position.d.ts.map +0 -1
- package/dist/lib/components/controls/position.js +0 -36
- package/dist/lib/components/controls/position.js.map +0 -1
- package/dist/lib/components/controls/select.js +0 -132
- package/dist/lib/components/controls/select.js.map +0 -1
- package/dist/lib/components/controls/spherical.js +0 -302
- package/dist/lib/components/controls/spherical.js.map +0 -1
- package/dist/lib/components/controls/text.d.ts +0 -36
- package/dist/lib/components/controls/text.d.ts.map +0 -1
- package/dist/lib/components/controls/text.js +0 -24
- package/dist/lib/components/controls/text.js.map +0 -1
- package/dist/lib/components/groups/accordion.d.ts +0 -22
- package/dist/lib/components/groups/accordion.d.ts.map +0 -1
- package/dist/lib/components/groups/accordion.js +0 -34
- package/dist/lib/components/groups/accordion.js.map +0 -1
- package/dist/lib/components/groups/container.d.ts +0 -25
- package/dist/lib/components/groups/container.d.ts.map +0 -1
- package/dist/lib/components/groups/container.js +0 -19
- package/dist/lib/components/groups/container.js.map +0 -1
- package/dist/lib/components/groups/group.d.ts +0 -49
- package/dist/lib/components/groups/group.d.ts.map +0 -1
- package/dist/lib/components/groups/group.js +0 -50
- package/dist/lib/components/groups/group.js.map +0 -1
- package/dist/lib/components/groups/index.d.ts +0 -5
- package/dist/lib/components/groups/index.d.ts.map +0 -1
- package/dist/lib/components/groups/index.js +0 -5
- package/dist/lib/components/groups/index.js.map +0 -1
- package/dist/lib/components/groups/tabs.d.ts +0 -22
- package/dist/lib/components/groups/tabs.d.ts.map +0 -1
- package/dist/lib/components/groups/tabs.js +0 -31
- package/dist/lib/components/groups/tabs.js.map +0 -1
- package/dist/lib/components/image.d.ts +0 -37
- package/dist/lib/components/image.d.ts.map +0 -1
- package/dist/lib/components/image.js +0 -46
- package/dist/lib/components/image.js.map +0 -1
- package/dist/lib/components/index.js +0 -6
- package/dist/lib/components/index.js.map +0 -1
- package/dist/lib/core/index.js +0 -5
- package/dist/lib/core/index.js.map +0 -1
- package/dist/lib/core/registry.d.ts +0 -18
- package/dist/lib/core/registry.d.ts.map +0 -1
- package/dist/lib/core/registry.js +0 -30
- package/dist/lib/core/registry.js.map +0 -1
- package/dist/lib/core/render.js +0 -19
- package/dist/lib/core/render.js.map +0 -1
- package/dist/lib/core/types.js +0 -2
- package/dist/lib/core/types.js.map +0 -1
- package/dist/lib/core/utils.js +0 -193
- package/dist/lib/core/utils.js.map +0 -1
- package/dist/lib/core/value-accessor.d.ts +0 -18
- package/dist/lib/core/value-accessor.d.ts.map +0 -1
- package/dist/lib/core/value-accessor.js +0 -52
- package/dist/lib/core/value-accessor.js.map +0 -1
- package/dist/lib/index.js +0 -29
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/mount.js +0 -85
- package/dist/lib/mount.js.map +0 -1
- package/dist/tweak-ui.css +0 -648
- package/dist/tweak-ui.css.map +0 -1
- package/dist/tweak-ui.min.css +0 -1
- package/dist/tweak-ui.min.css.map +0 -1
- /package/dist/lib/{color-formats → color}/converter.d.ts +0 -0
- /package/dist/lib/{color-formats → color}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TweakableAttrs } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Gets a value of a view model
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
* @param control - The model of a component
|
|
7
|
+
*/
|
|
8
|
+
export declare function getControlValue<V>(control: TweakableAttrs<any, V>): V;
|
|
9
|
+
/**
|
|
10
|
+
* Sets a value on a view model
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
* @param control - The model of a component
|
|
14
|
+
* @param value - The value for the component
|
|
15
|
+
* @returns the encoded value as it was written to the model
|
|
16
|
+
*/
|
|
17
|
+
export declare function setControlValue<V, R>(control: TweakableAttrs<any, V>, value: V): unknown;
|
|
18
|
+
export declare function getRawValue(attrs: TweakableAttrs<any, any>): any;
|
|
19
|
+
export declare function setRawValue(attrs: TweakableAttrs<any, any>, value: any): void;
|
|
20
|
+
//# sourceMappingURL=control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../src/lib/core/control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAGxC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAErE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,WAI9E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,OAW1D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAmB7E"}
|
package/dist/lib/core/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
export declare function renderModel<T extends ComponentModel>(model: T): m.Vnode<import("./types").ComponentAttrs<any>, unknown>;
|
|
1
|
+
import { default as m, ChildArrayOrPrimitive, Children, FactoryComponent, Vnode } from 'mithril';
|
|
2
|
+
import { ComponentChildren } from './types';
|
|
3
|
+
export declare function isVnode(child: Children): child is Vnode;
|
|
4
|
+
export declare function mapChildren(nodes: ChildArrayOrPrimitive | undefined, fn: (child: Vnode, index: number, all: Children[]) => Children): m.Children;
|
|
5
|
+
export declare function renderChildren(children: ComponentChildren): Children;
|
|
6
|
+
export type LabeledFn<T> = ((opts: T) => Vnode<T> | null) & ((label: string, opts: Omit<T, 'label'>) => Vnode<T> | null);
|
|
7
|
+
export declare function labeledFn<T>(component: FactoryComponent<T>): LabeledFn<T>;
|
|
10
8
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/lib/core/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/lib/core/render.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,EAAE,EAAE,qBAAqB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAuB,MAAM,SAAS,CAAA;AAEhE,wBAAgB,OAAO,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,IAAI,KAAK,CAEvD;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,qBAAqB,GAAG,SAAS,EACxC,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,QAAQ,cAc/D;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,iBAAiB,GAAG,QAAQ,CAiBpE;AAOD,MAAM,MAAM,SAAS,CAAC,CAAC,IACnB,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAC9B,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;AAEhE,wBAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAazE"}
|
package/dist/lib/core/types.d.ts
CHANGED
|
@@ -1,88 +1,74 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Children, ClassComponent, FactoryComponent } from 'mithril';
|
|
2
|
+
export type EventAttrs = Partial<GlobalEventHandlers>;
|
|
3
|
+
export type StyleAttr = Partial<CSSStyleDeclaration> & {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
7
|
+
* A UI component, which can be either a Mithril factory component or a Mithril class component.
|
|
8
|
+
*
|
|
3
9
|
* @public
|
|
4
10
|
*/
|
|
5
|
-
export type
|
|
11
|
+
export type Component<Attr extends Object> = FactoryComponent<Attr> | ClassComponent<Attr>;
|
|
6
12
|
/**
|
|
7
|
-
*
|
|
13
|
+
* A descriptor for a component, which includes the component itself, its attributes, and optionally its children.
|
|
8
14
|
*
|
|
9
|
-
* @
|
|
15
|
+
* @internal
|
|
10
16
|
*/
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
+
export type ComponentDescriptor<Attr extends Object> = {
|
|
18
|
+
component: Component<Attr> | string;
|
|
19
|
+
attributes: Attr;
|
|
20
|
+
children?: ComponentChildren;
|
|
21
|
+
};
|
|
17
22
|
/**
|
|
18
|
-
* Base model for a component
|
|
19
23
|
*
|
|
20
|
-
* @public
|
|
21
24
|
*/
|
|
22
|
-
export
|
|
23
|
-
/**
|
|
24
|
-
* The type name of the component
|
|
25
|
-
*/
|
|
26
|
-
type: string;
|
|
27
|
-
/**
|
|
28
|
-
* If true, the component will not be rendered
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* This is a convenience property that allows to hide a component
|
|
32
|
-
* without removing it from the component data model.
|
|
33
|
-
*/
|
|
34
|
-
hidden?: boolean | (() => boolean);
|
|
35
|
-
/**
|
|
36
|
-
* The label for this component when rendered as a control
|
|
37
|
-
*
|
|
38
|
-
* @remarks
|
|
39
|
-
* This is only evaluated when rendered as a child of a panel component
|
|
40
|
-
*/
|
|
41
|
-
label?: string;
|
|
42
|
-
}
|
|
25
|
+
export type ComponentChildren = ComponentSchema | Children | (() => Children);
|
|
43
26
|
/**
|
|
44
|
-
*
|
|
27
|
+
* A schema for a set of components, which is an array of component descriptors.
|
|
45
28
|
*
|
|
46
|
-
* @
|
|
29
|
+
* @internal
|
|
47
30
|
*/
|
|
48
|
-
export type
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
export type KeyMatchingType<T, V> = {
|
|
52
|
-
[K in keyof T]: T[K] extends V ? K : never;
|
|
53
|
-
}[keyof T];
|
|
31
|
+
export type ComponentSchema = Array<ComponentDescriptor<any>>;
|
|
32
|
+
export declare function binding<T>(target: T, field: keyof T): ValueBinding<T, T[keyof T]>;
|
|
54
33
|
/**
|
|
55
|
-
*
|
|
34
|
+
* A get/set pair that encapsulates access to a value without exposing the source object.
|
|
56
35
|
*
|
|
57
36
|
* @public
|
|
58
37
|
*/
|
|
59
|
-
export type
|
|
60
|
-
|
|
61
|
-
|
|
38
|
+
export type ValueBinding<M, T> = {
|
|
39
|
+
get: (model: M, field?: keyof M) => T;
|
|
40
|
+
set?: (value: T, model: M, field?: keyof M) => void;
|
|
62
41
|
};
|
|
63
|
-
export type
|
|
42
|
+
export type TweakableAttrs<T, Value = unknown> = {
|
|
64
43
|
/**
|
|
65
|
-
* The object
|
|
66
|
-
*
|
|
67
|
-
* @remarks
|
|
68
|
-
* Requires the `property` option to be set.
|
|
44
|
+
* The target object being tweaked.
|
|
69
45
|
*/
|
|
70
|
-
|
|
46
|
+
value: T;
|
|
71
47
|
/**
|
|
72
|
-
* The property
|
|
73
|
-
*
|
|
74
|
-
* @remarks
|
|
75
|
-
* Requires the `target` option to be set.
|
|
48
|
+
* The property on `value` to read from and write to
|
|
76
49
|
*/
|
|
77
|
-
|
|
50
|
+
field?: keyof T;
|
|
78
51
|
/**
|
|
79
|
-
*
|
|
52
|
+
* The custom binding controller
|
|
80
53
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
54
|
+
binding?: ValueBinding<T, Value>;
|
|
55
|
+
/**
|
|
56
|
+
* An optional adapter to convert between the raw value and the control value.
|
|
57
|
+
*/
|
|
58
|
+
adapter?: ControlAdapter<any, Value>;
|
|
83
59
|
};
|
|
84
60
|
/**
|
|
61
|
+
* Converts between the raw stored value and the value the control operates on.
|
|
62
|
+
* Use when the control's internal representation differs from the source data format
|
|
63
|
+
* e.g. radians stored, degrees displayed; or a packed integer unpacked into a vector.
|
|
64
|
+
*
|
|
85
65
|
* @public
|
|
86
66
|
*/
|
|
87
|
-
export type
|
|
67
|
+
export type ControlAdapter<RawValue, ControlValue> = {
|
|
68
|
+
toControl: (value: RawValue) => ControlValue;
|
|
69
|
+
fromControl: (value: ControlValue) => RawValue;
|
|
70
|
+
};
|
|
71
|
+
export type OmitIn<A, Keys extends keyof A> = {
|
|
72
|
+
[P in keyof A as P extends Keys ? never : P]: A[P];
|
|
73
|
+
};
|
|
88
74
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEzE,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAErD,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAE7E;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,SAAS,MAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;AAE1F;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,IAAI,SAAS,MAAM,IAAI;IACrD,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;IACnC,UAAU,EAAE,IAAI,CAAA;IAChB,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC7B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,QAAQ,GAAG,CAAC,MAAM,QAAQ,CAAC,CAAA;AAE7E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAA;AAE7D,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAKjF;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,IAAI;IAC/B,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IACrC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,IAAI,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO,IAAI;IAC/C;;OAEG;IACH,KAAK,EAAE,CAAC,CAAA;IACR;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;CACrC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,QAAQ,EAAE,YAAY,IAAI;IACnD,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,YAAY,CAAA;IAC5C,WAAW,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,QAAQ,CAAA;CAC/C,CAAA;AAED,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,IAAI,SAAS,MAAM,CAAC,IAAI;KAC3C,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACnD,CAAA"}
|
package/dist/lib/core/utils.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { ArrayOrSingleOf, ComponentAttrs, ComponentModel } from './types';
|
|
2
|
-
import type { Children, Vnode } from 'mithril';
|
|
3
1
|
/**
|
|
4
2
|
* Checks if value is a string
|
|
5
3
|
* @internal
|
|
@@ -29,44 +27,35 @@ export declare function isObject(v: any): v is object;
|
|
|
29
27
|
* Calls a function if it is not null
|
|
30
28
|
* @internal
|
|
31
29
|
*/
|
|
32
|
-
export declare function call<T extends (...args: any) => any>(cb: T, ...args: Parameters<T>): any;
|
|
33
|
-
/**
|
|
34
|
-
* Resolves a property to its value
|
|
35
|
-
* @param value - the function or value to resolve
|
|
36
|
-
*/
|
|
37
|
-
export declare function resolve<T>(value: (() => T) | T): T;
|
|
38
|
-
/**
|
|
39
|
-
* Calls the callback of object is not null
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
export declare function use<T, R>(obj: T | null, cb: (it: T) => R): R | null;
|
|
30
|
+
export declare function call<T extends (...args: any) => any>(cb: T | null | undefined, ...args: Parameters<T>): any;
|
|
43
31
|
/**
|
|
44
32
|
* Clamps a number value
|
|
45
33
|
* @internal
|
|
46
34
|
*/
|
|
47
35
|
export declare function clamp(v: number, min: number, max: number): number;
|
|
36
|
+
export type ClassValue = string | null | undefined | false | ClassDictionary | ClassArray | (() => ClassValue);
|
|
37
|
+
export interface ClassDictionary {
|
|
38
|
+
[key: string]: boolean | (() => boolean);
|
|
39
|
+
}
|
|
40
|
+
export interface ClassArray extends Array<ClassValue> {
|
|
41
|
+
}
|
|
42
|
+
export declare function uiStyle(style: Partial<CSSStyleDeclaration> | undefined): Partial<CSSStyleDeclaration>;
|
|
48
43
|
/**
|
|
49
44
|
* Builds a css class from various argument types
|
|
50
45
|
* @param exp
|
|
51
46
|
*/
|
|
52
|
-
export declare function
|
|
53
|
-
[k: string]: boolean | (() => boolean);
|
|
54
|
-
}>): string;
|
|
47
|
+
export declare function uiClass(...args: ClassValue[]): string;
|
|
55
48
|
/**
|
|
56
49
|
* Pads a string
|
|
57
50
|
* @internal
|
|
58
51
|
*/
|
|
59
52
|
export declare function padLeft(value: string, length: number, char: string): string;
|
|
60
|
-
/**
|
|
61
|
-
* @internal
|
|
62
|
-
*/
|
|
63
|
-
export declare function twuiClass(name: string, variation?: string): string;
|
|
64
53
|
/**
|
|
65
54
|
* Gets current mouse coordinates from mouse or touch event
|
|
66
55
|
* @internal
|
|
67
56
|
*/
|
|
68
57
|
export declare function getTouchPoint(e: MouseEvent | TouchEvent): [number, number];
|
|
69
|
-
export declare function getTouchInTarget(e: MouseEvent, target?: HTMLElement, offset?: [number, number]): {
|
|
58
|
+
export declare function getTouchInTarget(e: MouseEvent | TouchEvent, target?: HTMLElement | null, offset?: [number, number]): {
|
|
70
59
|
width: number;
|
|
71
60
|
height: number;
|
|
72
61
|
x: number;
|
|
@@ -74,21 +63,17 @@ export declare function getTouchInTarget(e: MouseEvent, target?: HTMLElement, of
|
|
|
74
63
|
normalizedX: number;
|
|
75
64
|
normalizedY: number;
|
|
76
65
|
};
|
|
77
|
-
/**
|
|
78
|
-
* @internal
|
|
79
|
-
*/
|
|
80
|
-
export declare function viewFn<T extends ComponentModel>(fn: (data: T, node: Vnode<ComponentAttrs<T>>) => Children): (node: Vnode<ComponentAttrs<T>>) => Children;
|
|
81
|
-
export declare function dataFn<T extends ComponentModel, R>(node: Vnode<ComponentAttrs<T>>, fn: (data: T, node: Vnode<ComponentAttrs<T>>) => R): () => R;
|
|
82
66
|
export declare function dragUtil({ onStart, onMove, onEnd, }: {
|
|
83
|
-
onStart?: (e: MouseEvent) => void;
|
|
84
|
-
onMove?: (e: MouseEvent) => void;
|
|
85
|
-
onEnd?: (e: MouseEvent) => void;
|
|
67
|
+
onStart?: (e: MouseEvent | TouchEvent) => void;
|
|
68
|
+
onMove?: (e: MouseEvent | TouchEvent) => void;
|
|
69
|
+
onEnd?: (e: MouseEvent | TouchEvent) => void;
|
|
86
70
|
}): {
|
|
87
|
-
target: HTMLElement;
|
|
71
|
+
target: HTMLElement | null;
|
|
88
72
|
activate: (e: MouseEvent) => void;
|
|
89
73
|
deactivate: () => void;
|
|
90
|
-
onStart: (e: MouseEvent) => void;
|
|
91
|
-
onMove: (e: MouseEvent) => void;
|
|
92
|
-
onEnd: (e: MouseEvent) => void;
|
|
74
|
+
onStart: ((e: MouseEvent | TouchEvent) => void) | undefined;
|
|
75
|
+
onMove: ((e: MouseEvent | TouchEvent) => void) | undefined;
|
|
76
|
+
onEnd: ((e: MouseEvent | TouchEvent) => void) | undefined;
|
|
93
77
|
};
|
|
78
|
+
export declare function eventWithTimout(el: Element, event: string, timeout: number): Promise<boolean>;
|
|
94
79
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/core/utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/core/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,CAE5C;AACD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,CAE5C;AACD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAE/D;AACD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,GAAG,EAAE,CAE1C;AACD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,CAE5C;AACD;;;GAGG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,EAClD,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EACxB,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAGvB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUjE;AAED,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,IAAI,GACJ,SAAS,GACT,KAAK,GACL,eAAe,GACf,UAAU,GACV,CAAC,MAAM,UAAU,CAAC,CAAA;AAEtB,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAA;CACzC;AAED,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,UAAU,CAAC;CAAG;AAExD,wBAAgB,OAAO,CACrB,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS,GAC9C,OAAO,CAAC,mBAAmB,CAAC,CAE9B;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAA;AAsDtD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAKlE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAW1E;AAED,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,UAAU,GAAG,UAAU,EAC1B,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,EAC3B,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;;;;;;;EAwB1B;AAED,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,MAAM,EACN,KAAK,GACN,EAAE;IACD,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAA;IAC9C,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAA;IAC7C,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAA;CAC7C;YAEmB,WAAW,GAAG,IAAI;kBACpB,UAAU;;kBANZ,UAAU,GAAG,UAAU,KAAK,IAAI;iBACjC,UAAU,GAAG,UAAU,KAAK,IAAI;gBACjC,UAAU,GAAG,UAAU,KAAK,IAAI;EAqC7C;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiB7F"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
* {@link https://github.com/dataarts/dat.gui | dat.GUI}
|
|
11
11
|
* {@link https://github.com/automat/controlkit.js | controlkit}
|
|
12
12
|
* {@link https://github.com/colejd/guify | guify}
|
|
13
|
+
* {@link https://tweakpane.github.io/docs/ | tweakpane}
|
|
13
14
|
*
|
|
14
15
|
* @packageDocumentation
|
|
15
16
|
*/
|
|
16
|
-
import './components';
|
|
17
17
|
export * from './builder';
|
|
18
|
-
export * from './color
|
|
18
|
+
export * from './color';
|
|
19
19
|
export * from './components';
|
|
20
20
|
export * from './core';
|
|
21
21
|
export * from './mount';
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
|
package/dist/lib/mount.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { default as m } from 'mithril';
|
|
1
|
+
import { default as m, ChildArray, Component } from 'mithril';
|
|
3
2
|
import { BuilderFn } from './builder';
|
|
4
3
|
/**
|
|
5
4
|
* Mithril's hyperscript function.
|
|
@@ -9,28 +8,19 @@ import { BuilderFn } from './builder';
|
|
|
9
8
|
* Useful to create custom components
|
|
10
9
|
*/
|
|
11
10
|
export declare const h: m.Static;
|
|
12
|
-
/**
|
|
13
|
-
* Runs the function through a builder system and returns the created controls
|
|
14
|
-
*
|
|
15
|
-
* @param fn - The builder function
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
export declare function build(fn: BuilderFn): ComponentModel[];
|
|
19
11
|
/**
|
|
20
12
|
* Mounts a ui to the given element
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
* @param el - The ui host element
|
|
24
|
-
* @param data - The ui definition object
|
|
25
13
|
*/
|
|
26
|
-
export declare function
|
|
14
|
+
export declare function mountUi(target: Element | string, data: ChildArray): void;
|
|
15
|
+
export declare function mountUi(target: Element | string, data: BuilderFn): void;
|
|
16
|
+
export declare function mountUi<A, S>(target: Element | string, data: Component<A, S>): void;
|
|
27
17
|
/**
|
|
28
18
|
* Unmounts the ui from given host element
|
|
29
19
|
*
|
|
30
20
|
* @public
|
|
31
21
|
* @param el - The ui host element
|
|
32
22
|
*/
|
|
33
|
-
export declare function
|
|
23
|
+
export declare function unmountUi(target: Element | string): void;
|
|
34
24
|
/**
|
|
35
25
|
* Redraws the ui
|
|
36
26
|
*
|
|
@@ -42,5 +32,5 @@ export declare function unmount(el: Element | string): void;
|
|
|
42
32
|
* However if the ui description object is changed from outside the qui callback
|
|
43
33
|
* then this method must be called in order to update the visual state.
|
|
44
34
|
*/
|
|
45
|
-
export declare function
|
|
35
|
+
export declare function redrawUi(): void;
|
|
46
36
|
//# sourceMappingURL=mount.d.ts.map
|
package/dist/lib/mount.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/lib/mount.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/lib/mount.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAW,SAAS,EAAE,MAAM,WAAW,CAAA;AAG9C;;;;;;GAMG;AACH,eAAO,MAAM,CAAC,UAAI,CAAA;AAElB;;GAEG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;AACzE,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;AACxE,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAA;AAkBpF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,QAGjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,SAEvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/stats/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export type StatTransform = 'linear' | 'log' | 'exp';
|
|
2
|
+
export type SamplerConfig = {
|
|
3
|
+
/**
|
|
4
|
+
* Display name of the stat
|
|
5
|
+
*/
|
|
6
|
+
name?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Display color of the stat
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Formatting for the current value
|
|
13
|
+
*/
|
|
14
|
+
fractionDigits?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Function that returns the current value of the stat
|
|
17
|
+
*/
|
|
18
|
+
sample: () => number;
|
|
19
|
+
/**
|
|
20
|
+
* Smoothing factor for EMA calculation.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* 0 is no smoothing, 0.9 is heavy smoothing. Don't set to 1 or it will never update! Default is 0 (no smoothing).
|
|
24
|
+
*/
|
|
25
|
+
smoothing?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Expected minimum value for display. Used for normalization and auto-ranging. Default is 0.
|
|
28
|
+
*/
|
|
29
|
+
min?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Expected maximum value for display. Used for normalization and auto-ranging. Default is 1.
|
|
32
|
+
*/
|
|
33
|
+
max?: number;
|
|
34
|
+
transform?: StatTransform;
|
|
35
|
+
noGraph?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export interface Sampler {
|
|
38
|
+
color?: string;
|
|
39
|
+
noGraph?: boolean;
|
|
40
|
+
fractionDigits?: number;
|
|
41
|
+
smoothing: number;
|
|
42
|
+
transform: (v: number) => number;
|
|
43
|
+
min: number;
|
|
44
|
+
max: number;
|
|
45
|
+
sample: () => number;
|
|
46
|
+
value: number | null;
|
|
47
|
+
normalized: number;
|
|
48
|
+
buffer: Float32Array;
|
|
49
|
+
head: number;
|
|
50
|
+
count: number;
|
|
51
|
+
index: number;
|
|
52
|
+
sum: number;
|
|
53
|
+
avg: number;
|
|
54
|
+
minDeque: Float32Array;
|
|
55
|
+
maxDeque: Float32Array;
|
|
56
|
+
minIdx: Uint32Array;
|
|
57
|
+
maxIdx: Uint32Array;
|
|
58
|
+
minHead: number;
|
|
59
|
+
minTail: number;
|
|
60
|
+
maxHead: number;
|
|
61
|
+
maxTail: number;
|
|
62
|
+
minSeen: number;
|
|
63
|
+
maxSeen: number;
|
|
64
|
+
}
|
|
65
|
+
export declare function sampler(config: SamplerConfig, size: number): Sampler;
|
|
66
|
+
//# sourceMappingURL=sampler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler.d.ts","sourceRoot":"","sources":["../../../src/lib/stats/sampler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAA;AAEpD,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;OAEG;IACH,MAAM,EAAE,MAAM,MAAM,CAAA;IAEpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,SAAS,CAAC,EAAE,aAAa,CAAA;IAEzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IAEX,MAAM,EAAE,MAAM,MAAM,CAAA;IAEpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAGlB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IAGb,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IAGX,QAAQ,EAAE,YAAY,CAAA;IACtB,QAAQ,EAAE,YAAY,CAAA;IACtB,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,WAAW,CAAA;IAEnB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IAEf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAiDpE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Sampler, SamplerConfig } from './sampler';
|
|
2
|
+
export type StatsConfig<T extends SamplerConfig = SamplerConfig> = {
|
|
3
|
+
historySize?: number;
|
|
4
|
+
collapsed?: boolean;
|
|
5
|
+
rows: Array<T>;
|
|
6
|
+
};
|
|
7
|
+
export type StatsRenderer = {
|
|
8
|
+
resize: (width: number, height: number) => void;
|
|
9
|
+
configure: (config: StatsConfig) => void;
|
|
10
|
+
update: () => void;
|
|
11
|
+
render: () => void;
|
|
12
|
+
sampler: (row: number) => Sampler;
|
|
13
|
+
samplerCount: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function statsRenderer(canvas: HTMLCanvasElement): StatsRenderer;
|
|
16
|
+
//# sourceMappingURL=stats-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-renderer.d.ts","sourceRoot":"","sources":["../../../src/lib/stats/stats-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE3D,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI;IACjE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA;CACf,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAA;IACxC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;IACjC,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,aAAa,CAkHtE"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--twk-size:1.375rem;--twk-gap:.125rem;--twk-inset:.125rem;--twk-radius:.25rem;--twk-label-size:7rem;--twk-label-pad-x:.25rem;--twk-label-pad-y:0rem;--twk-input-height:var(--twk-size);--twk-input-pad-x:.375rem;--twk-input-pad-y:0rem;--twk-button-height:var(--twk-size);--twk-button-pad-x:.5rem;--twk-button-pad-y:.25rem;--twk-color-base-100:#2a303c;--twk-color-base-200:#242933;--twk-color-base-300:#20252e;--twk-color-base-content:#b2ccd6;--twk-color-neutral:#1c212b;--twk-color-neutral-content:#b2ccd6;--twk-color-accent:#f9aa33;--twk-color-bool-true:#f9aa33;--twk-color-bool-false:#2a303c}.twk-dark{--twk-color-base-100:#1d232a;--twk-color-base-200:#191e24;--twk-color-base-300:#15191e;--twk-color-base-content:#ecf9ff;--twk-color-neutral:#09090b;t:#e4e4e7;--twk-color-accent:#f9aa33}.twk-light{--twk-color-base-100:#fff;--twk-color-base-200:#f5f5f5;--twk-color-base-300:#ebebeb;--twk-color-base-content:#000;--twk-color-neutral:#000;--twk-color-neutral-content:#fff;--twk-color-accent:#2196f3}.tweak-ui{interpolate-size:allow-keywords;background-color:var(--twk-color-base-200);color:var(--twk-color-base-content);gap:var(--twk-gap);font-family:monospace;line-height:1.5;font-size:var(--twk-font-size,12px);width:var(--twk-width,20rem);box-sizing:border-box;border-radius:calc(var(--twk-radius) + var(--twk-inset));padding:0;padding:var(--twk-inset,0);flex-direction:column;flex:none;margin:0;display:flex;overflow:hidden auto}.tweak-ui::-webkit-scrollbar{width:.5rem}.tweak-ui::-webkit-scrollbar-track{background-color:var(--twk-color-base-200)}.tweak-ui::-webkit-scrollbar-thumb{background-color:var(--twk-color-base-200);border-style:solid;border-width:1px;border-color:var(--twk-color-base-300);transition:background-color .2s ease-in-out}.tweak-ui::-webkit-scrollbar-thumb:hover{background-color:var(--twk-color-primary)}.tweak-ui button,.tweak-ui input,.tweak-ui select,.tweak-ui optgroup,.tweak-ui textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border:0;border-radius:0;min-width:0;margin:0;padding:0}.tweak-ui button:not([type=checkbox],select),.tweak-ui input:not([type=checkbox],select),.tweak-ui select:not([type=checkbox],select),.tweak-ui optgroup:not([type=checkbox],select),.tweak-ui textarea:not([type=checkbox],select){appearance:none!important}.tweak-ui button:focus-visible,.tweak-ui input:focus-visible,.tweak-ui select:focus-visible,.tweak-ui optgroup:focus-visible,.tweak-ui textarea:focus-visible{outline:none}.tweak-ui input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.tweak-ui input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.tweak-ui input[type=number]{-moz-appearance:textfield}.tweak-ui .twk-input{cursor:text;box-sizing:border-box;white-space:nowrap;vertical-align:middle;touch-action:manipulation;align-items:center;gap:var(--twk-gap);height:calc(var(--twk-size));min-width:0;line-height:calc(var(--twk-size));padding:var(--twk-input-pad-y) var(--twk-input-pad-x);color:var(--twk-color-base-content);border-radius:var(--twk-radius);border:none;flex:1;transition:color .2s ease-in-out,background-color .2s ease-in-out,outline-color .2s ease-in-out;display:flex;position:relative;appearance:none!important}.tweak-ui .twk-input input{flex:1}.tweak-ui .twk-input:not(.twk-input-readonly){outline-offset:-1px;outline:1px solid #0000}.tweak-ui .twk-input:not(.twk-input-readonly):hover{background-color:var(--twk-color-base-100)}.tweak-ui .twk-input:not(.twk-input-readonly):focus-within{outline-color:var(--twk-color-accent)}.tweak-ui label{min-width:0}.tweak-ui select,.tweak-ui button,.tweak-ui a{cursor:pointer;align-items:center}.tweak-ui select:focus,.tweak-ui input:not([type=checkbox]):focus{color:var(--twk-color-accent)}.tweak-ui select{appearance:base-select;border-radius:var(--twk-radius);background:var(--twk-color-base-100);border-color:var(--twk-color-base-300);border:none}.tweak-ui ::picker(select){appearance:base-select;border-radius:var(--twk-radius);background:var(--twk-color-base-100);border-color:var(--twk-color-base-300);border:none}.tweak-ui select option{justify-content:flex-start;gap:var(--twk-gap);padding-inline:var(--twk-button-pad-x);background:var(--twk-color-base-100);color:var(--twk-color-base-content);display:flex}.tweak-ui select option:hover,.tweak-ui select option:focus{background:var(--twk-color-base-200)}.tweak-ui select{padding-inline:var(--twk-button-pad-x)}.tweak-ui .twk-btn{--twk-btn-bg:var(--twk-color-base-100);--twk-btn-color:var(--twk-color-content);--twk-btn-size:var(--twk-size);cursor:pointer;text-align:center;vertical-align:middle;-webkit-user-select:none;user-select:none;color:var(--twk-btn-color);min-height:var(--twk-btn-size);border-radius:var(--twk-radius);outline-offset:1px;background-color:var(--twk-btn-bg);padding-inline:var(--twk-button-pad-x);text-align:center;white-space:nowrap;outline-color:var(--twk-color-neutral);font-weight:700}.tweak-ui .twk-btn:hover{background-color:color-mix(in oklab, var(--btn-color,var(--twk-btn-bg)), #000 7%)}.tweak-ui .twk-btn:focus{outline-color:var(--twk-color-accent)}.tweak-ui .twk-btn:active{transform:translateY(1px)}.tweak-ui .twk-btn.twk-btn-accent{--twk-btn-bg:var(--twk-color-accent);--twk-btn-color:var(--twk-color-neutral)}.tweak-ui .twk-btn.twk-btn-lg{--twk-btn-size:calc(var(--twk-size) * 1.25)}.tweak-ui .twk-btn.twk-btn-sq{width:var(--twk-btn-size);height:var(--twk-btn-size);flex:none;padding-inline:0}.tweak-ui .twk-btn.twk-btn-bl{width:100%}dialog.twk-dialog{pointer-events:none;visibility:hidden;width:100%;max-width:none;height:100%;max-height:none;color:inherit;overscroll-behavior:contain;z-index:999;scrollbar-gutter:auto;background-color:#0000;border:none;place-items:center;margin:0;padding:0;display:grid;position:fixed;inset:0;overflow:clip}.twk-dialog-content{background-color:var(--twk-color-base-100);border-radius:var(--twk-radius);opacity:0;overscroll-behavior:contain;grid-row-start:1;grid-column-start:1;width:100%;max-width:32rem;max-height:100vh;overflow-y:auto}dialog.twk-dialog[open]{pointer-events:auto;visibility:visible;opacity:1;background-color:oklch(0% 0 0/.4)}dialog.twk-dialog[open] .twk-dialog-content{opacity:1;translate:0;scale:1}.twk-flex{align-items:stretch;gap:var(--twk-gap);flex-flow:column;display:flex}.twk-flex-row{gap:var(--twk-gap);flex-flow:row;display:flex}.twk-grid{gap:var(--twk-gap);display:grid}.twk-divider{padding:0 calc(var(--twk-size) / 2);align-items:center;display:flex}.twk-divider:not(:empty){gap:calc(var(--twk-size) / 2)}.twk-divider{height:var(--twk-size)}.twk-divider:before,.twk-divider:after{content:"";opacity:.125;background-color:currentColor;flex-grow:1;width:100%;height:1px}.twk-divider-v{flex-flow:column;align-items:center;display:flex}.twk-divider-v:not(:empty){gap:calc(var(--twk-size) / 2)}.twk-divider-v{width:var(--twk-size);height:100%}.twk-divider-v:before,.twk-divider-v:after{content:"";opacity:.125;background-color:currentColor;flex-grow:1;width:1px;height:100%}.twk-group,.twk-group-content{gap:var(--twk-gap);flex-direction:column;display:flex}.twk-group-content.animate.enter{animation:.25s ease-out forwards twk-group-content-enter;overflow:hidden}.twk-group-content.leave{animation:.25s ease-out forwards twk-group-content-leave;overflow:hidden}@keyframes twk-group-content-enter{0%{opacity:0;height:0}50%{opacity:0;height:auto}to{opacity:1;height:auto}}@keyframes twk-group-content-leave{0%{opacity:1;height:auto}50%{opacity:0;height:auto}to{opacity:0;height:0}}.twk-group-title{width:auto;height:var(--twk-size);background-color:var(--twk-color-neutral);color:var(--twk-color-neutral-content);border-radius:var(--twk-radius,0);text-transform:uppercase;flex-direction:row;align-items:center;margin:0;padding:0 .5rem;font-weight:700;display:flex}.twk-group-collapsible>.twk-group-title{cursor:pointer;-webkit-user-select:none;user-select:none;position:relative}.twk-group-collapsible>.twk-group-title:before{content:"";width:var(--twk-size);height:var(--twk-size);text-align:center;clip-path:polygon(50.05% 77.08%,83.58% 43.55%,87.11% 40.02%,80.03% 32.94%,76.5% 36.47%,50.03% 62.94%,23.56% 36.47%,20.03% 32.94%,12.95% 40.02%,16.48% 43.55%,46.48% 73.55%,50.02% 77.08%);background-color:currentColor;transition:opacity .2s ease-in-out,transform .2s ease-in-out;display:block;position:absolute;top:0;right:0;transform:scale(.5)rotate(0)}.twk-group-collapsed>.twk-group-title:before{transform:scale(.5)rotate(-90deg)}.twk-group:not(.twk-root>.twk-group) .twk-group{margin-left:calc(var(--twk-size) / 4)}.twk-group-description{opacity:.75;padding:.25rem .25rem .5rem 0;font-style:italic;line-height:1}.twk-tree{width:100%;height:100%;max-height:100vh;overflow-y:auto}.twk-tree-row{-webkit-user-select:none;user-select:none;width:100%;padding-left:calc(var(--twk-tree-row-depth) * .5 * var(--twk-tree-row-height));background-color:var(--twk-color-base-200);box-sizing:border-box;flex-direction:row;align-items:center;display:flex}.twk-tree-row:hover{background-color:var(--twk-color-base-100)}.twk-tree-row.selected{color:var(--twk-color-accent)}.twk-tree-toggle:before{content:"";width:var(--twk-tree-row-height);height:var(--twk-tree-row-height);text-align:center;transition:opacity .2s ease-in-out,transform .2s ease-in-out;display:block;transform:scale(.5)rotate(-90deg)}.twk-tree-toggle.expandable:before{clip-path:polygon(50.05% 77.08%,83.58% 43.55%,87.11% 40.02%,80.03% 32.94%,76.5% 36.47%,50.03% 62.94%,23.56% 36.47%,20.03% 32.94%,12.95% 40.02%,16.48% 43.55%,46.48% 73.55%,50.02% 77.08%);background-color:currentColor}.twk-tree-toggle.expanded:before{transform:scale(.5)rotate(0)}.twk-tree-icon{width:var(--twk-tree-row-height);height:var(--twk-tree-row-height);place-items:center;display:grid}.twk-tree-label{display:flex}.twk-tabs{border-color:var(--twk-color-base-300);align-items:stretch;gap:var(--twk-gap);flex-flow:wrap;display:flex}.twk-tabs button.twk-tab{background-color:var(--twk-color-base-100);color:color-mix(in srgb, var(--twk-color-base-content) 40%, transparent);flex:1;order:0}.twk-tabs button.twk-tab:hover{color:var(--twk-color-base-content)}.twk-tabs button.twk-tab.twk-btn:not(.active){background-color:#0000;font-weight:400}.twk-tabs button.twk-tab.twk-btn.active{color:var(--twk-color-accent);font-weight:700}.twk-tab-content{order:1;width:100%}.twk-tabs-vertical{grid-template-columns:auto 1fr;display:grid}.twk-tabs-vertical .twk-tab{grid-column:1}.twk-tabs-vertical .twk-tab-content{grid-area:1/2/-1}.twk-split-pane{overflow:hidden}.twk-split-pane.dragging{-webkit-user-select:none;user-select:none}.twk-split-pane>:not(.twk-split-gutter){flex:1;min-width:1rem;min-height:1rem}.twk-split-gutter:last-child{display:none}.twk-split-gutter:before{content:"";background-color:var(--twk-color-base-100);opacity:0;position:absolute}.twk-split-gutter:hover:before{background-color:var(--twk-color-base-100);opacity:1}.twk-split-gutter-v{cursor:row-resize;min-height:.25rem;position:relative}.twk-split-gutter-v:before{inset:1px .25rem}.twk-split-gutter-h{cursor:col-resize;min-width:.25rem;position:relative}.twk-split-gutter-h:before{inset:.25rem 1px}.twk-section{grid-template:"header""content"1fr"footer"/100%;width:100%;display:grid}.twk-section>*{grid-area:content}.twk-section-header,header{grid-area:header}.twk-section-content{grid-area:content}.twk-section-footer,footer{grid-area:footer}.twk-bar{gap:var(--twk-gap);min-height:var(--twk-size);grid-template-columns:auto 1fr auto;grid-template-areas:"start content end";align-items:center;display:grid}.twk-bar>*{grid-area:content}.twk-bar-start{grid-area:start}.twk-bar-content{grid-area:content}.twk-bar-end{grid-area:end}.twk-widget{gap:var(--twk-gap);grid-template-columns:.75fr 1fr;grid-template-areas:"label content";width:100%;display:grid}.twk-widget>*{grid-area:content;overflow:hidden}.twk-widget-label{min-height:var(--twk-size);padding:0 calc(var(--twk-size) / 4);color:color-mix(in srgb, var(--twk-color-base-content) 40%, transparent);flex:.75;grid-area:label;align-self:start;align-items:center;display:inline-flex;overflow:hidden}.twk-angle-label{height:var(--twk-size);white-space:nowrap;text-align:right}.twk-angle-input{gap:var(--twk-gap);column-gap:calc(var(--twk-gap) * 2);grid-template:"display input""display output"min-content/min-content auto;display:grid}.twk-angle-input .twk-scalar-input{grid-area:input}.twk-angle-input .twk-angle-label{grid-area:output}.twk-angle-pane{width:100%;width:var(--twk-size);height:var(--twk-size);outline:1px solid var(--twk-color-base-content);outline-offset:-1px;background-image:conic-gradient(from 0deg, var(--twk-color-base-content) calc(var(--angle-value) / 360 * 100%), transparent 0);border-radius:50%;grid-area:display}.twk-bitmask-input{gap:var(--twk-gap);flex-direction:column;display:flex}.twk-bitmask-input .twk-bitmask-row{gap:var(--twk-gap);cursor:pointer;flex-direction:row;display:flex}.twk-bitmask-input .twk-bitmask-row>*{flex:none}.twk-bitmask-input .twk-bitmask-name{text-overflow:ellipsis;flex:1;padding-left:.25rem;overflow:hidden}.twk-bitmask-input .twk-bitmask-bit{opacity:.5;padding-right:.25rem}.twk-bitmask-input .twk-bitmask-value{opacity:.5}.twk-bitmask-input .twk-bitmask-indicator{width:var(--twk-size);height:var(--twk-size);background-color:var(--twk-color-base-100)}.twk-bitmask-active .twk-bitmask-indicator:before{content:"";background-color:var(--twk-color-accent);width:50%;height:50%;margin:25%;display:block}.twk-bitmask-active .twk-bitmask-value{opacity:1}.twk-bool-input{align-items:center;gap:var(--twk-gap);flex-direction:row;display:flex}.twk-bool-input input{text-align:right;min-width:0}.twk-bool-input.twk-align-end{justify-content:flex-end}.twk-color-picker{gap:var(--twk-gap);flex-direction:row;flex:auto;display:flex}.twk-color-picker .color-picker-panel{flex:1;position:relative}.twk-color-picker .color-picker-inputs{gap:var(--twk-gap);flex-direction:column;flex:none;display:flex}.twk-color-picker .color-picker-inputs .input-r{border-left:2px solid red!important}.twk-color-picker .color-picker-inputs .input-g{border-left:2px solid #0f0!important}.twk-color-picker .color-picker-inputs .input-b{border-left:2px solid #00f!important}.twk-color-picker .color-picker-inputs .input-a{border-image:linear-gradient(90deg,#fff,#0000)}.twk-color-picker .color-picker-inputs .input-hex{border-left:2px solid #000!important}.twk-color-picker .color-picker-inputs input{flex:none;width:4rem;display:block}.twk-color-picker .color-picker-sv:focus,.twk-color-picker .color-picker-h:focus,.twk-color-picker .color-picker-a:focus{border-color:var(--twk-color-accent);outline:none}.twk-color-picker .color-picker-sv,.twk-color-picker .color-picker-h,.twk-color-picker .color-picker-a{border-radius:var(--twk-radius)}.twk-color-picker .color-picker-sv{box-sizing:border-box;cursor:crosshair;z-index:1;border-bottom:1px solid;border-color:var(--twk-color-base-300);width:100%;padding-top:100%;position:relative}.twk-color-picker .color-picker-sv-bg{border-radius:var(--twk-radius);position:absolute;inset:0}.twk-color-picker .color-picker-sv-cursor{box-sizing:border-box;border:1px solid #fff;border-radius:5px;width:10px;height:10px;margin-top:-5px;margin-left:-5px;position:absolute;box-shadow:0 0 2px 1px #000000bf}.twk-color-picker .color-picker-h,.twk-color-picker .color-picker-a{box-sizing:border-box;cursor:ew-resize;border-bottom:1px solid;border-color:var(--twk-color-base-300);height:1rem;position:relative}.twk-color-picker .color-picker-h-cursor,.twk-color-picker .color-picker-a-cursor{border:1px solid #fff;border-radius:2px;width:4px;height:calc(1rem - 2px);margin-left:-3px;position:absolute;box-shadow:0 0 2px 1px #000000bf}.twk-color-picker .color-picker-a{background-blend-mode:normal, difference, normal;background-image:linear-gradient(90deg,#0000,#0000),linear-gradient(90deg,gray 50%,#fff 50%),linear-gradient(gray 50%,#fff 50%);background-size:1rem 1rem}.twk-color-picker .color-picker-a-bg{position:absolute;inset:0}.twk-color-picker .color-picker-sv,.twk-color-picker .color-picker-h,.twk-color-picker .color-picker-a{border-color:var(--twk-color-base-300)}.twk-color-input{align-items:stretch;gap:var(--twk-gap);flex-direction:column;flex:auto;display:flex}.twk-color-input button.twk-btn{text-transform:uppercase;flex-direction:row;flex:1;justify-content:start;align-items:center;gap:.5rem;padding-left:0;display:flex}.twk-color-input button.twk-btn:before{content:"";width:calc(var(--twk-size));height:calc(var(--twk-size));background-color:var(--twk-color-value);border-radius:var(--twk-radius);flex:none;display:inline-block}.tweak-ui input[type=checkbox]{flex:none}input.twk-toggle[type=checkbox]{width:calc(var(--twk-size) * 2);height:calc(var(--twk-size));border-radius:var(--twk-size);border:2px solid var(--twk-color-base-100);background-color:var(--twk-color-base-100);cursor:pointer;appearance:none;vertical-align:middle;webkit-user-select:none;-webkit-user-select:none;user-select:none;flex-shrink:0;grid-template-columns:1fr 1fr;place-content:center;margin:0;padding:2px;display:inline-grid}input.twk-toggle[type=checkbox]:checked{border-color:var(--twk-color-base-content)}input.twk-toggle[type=checkbox]:focus{border-color:var(--twk-color-accent)}input.twk-toggle[type=checkbox]:before{aspect-ratio:1;content:"";background-color:var(--twk-color-base-content);opacity:.25;border-radius:100%;grid-row-start:1;grid-column-start:1;transition:background-color .1s,translate .2s;translate:0}input.twk-toggle[type=checkbox]:checked:before{opacity:1;translate:100%}input.twk-check[type=checkbox]{width:calc(var(--twk-size) - 4px);height:calc(var(--twk-size) - 4px);border-radius:var(--twk-radius);cursor:pointer;appearance:none;background-color:var(--twk-color-base-300);outline:1px solid var(--twk-color-base-content);outline-offset:-1px;place-content:center;margin:2px;transition:background-color .1s;display:grid;flex:none!important}input.twk-check[type=checkbox]:checked{background-color:var(--twk-color-accent);outline-color:var(--twk-color-accent)}input.twk-check[type=checkbox]:checked:before{content:"";width:calc(var(--twk-size) / 2);height:calc(var(--twk-size) / 4);border-left:2px solid var(--twk-color-base-300);border-bottom:2px solid var(--twk-color-base-300);margin-top:-2px;transform:rotate(-45deg)}canvas.twk-graph{width:100%}table.twk-graph{text-align:right;border-collapse:collapse;table-layout:fixed;width:100%;margin:0;display:table!important}table.twk-graph thead,table.twk-graph tbody{width:100%}table.twk-graph td,table.twk-graph th{white-space:nowrap;text-overflow:ellipsis;padding:0 4px;overflow:hidden}table.twk-graph th:first-child,table.twk-graph td:first-child{width:var(--twk-label-size);text-align:left}table.twk-graph .twk-current{width:70px;font-weight:600}table.twk-graph .twk-stats{color:#888;width:110px;font-size:.85em}.twk-image{max-width:100%;display:block}.twk-image.twk-loading{opacity:0}.twk-matrix-input{gap:var(--twk-gap)}.twk-point .point-area{background-color:var(--twk-color-base-100);border-color:var(--twk-color-base-300);background-image:linear-gradient(var(--twk-color-base-200) 1px, transparent 1px), linear-gradient(90deg, var(--twk-color-base-200) 1px, transparent 1px);aspect-ratio:1;box-sizing:border-box;cursor:crosshair;z-index:1;background-size:10% 10%,10% 10%;align-self:end;width:100%;transition:border-color .2s ease-in-out,background-color .2s ease-in-out;position:relative;overflow:visible}.twk-point .point-area .point-x-axis,.twk-point .point-area .point-y-axis{background-color:var(--twk-color-base-300)}.twk-point .point-area:focus .point-x-axis,.twk-point .point-area:focus .point-y-axis{background-color:var(--twk-color-accent)}.twk-point .point-area:focus{border-color:var(--twk-color-accent);outline:none}.twk-scalar-input{align-items:center;gap:var(--twk-gap);grid-auto-flow:column;display:grid;position:relative}.twk-scalar-input input{text-align:right;min-width:0}.twk-scalar-input .unit{opacity:.5}.twk-scalar-dragable input{cursor:ew-resize}.twk-scalar-range:after{pointer-events:none;content:"";opacity:.125;background:linear-gradient(to right, var(--twk-color-accent) 0%, var(--twk-color-accent) calc(var(--twk-scalar-value,0) * 100%), transparent calc(var(--twk-scalar-value,0) * 100%), transparent 100%);border-radius:var(--twk-radius);width:100%;position:absolute;top:0;bottom:0;left:0}.twk-scalar-range:hover:after{opacity:.25}.twk-spherical-label{height:var(--twk-size);white-space:nowrap;text-align:center}.twk-spherical-pane{outline:3px solid var(--twk-color-base-content);outline-offset:-3px;border-radius:50%;width:100%;max-width:150px;margin:1rem auto}.twk-spherical-arm{border:1px solid var(--twk-color-base-content);border-radius:calc(var(--twk-size) / 2);background-image:linear-gradient(to right, var(--twk-color-base-content), var(--twk-color-base-content) calc(var(--polar-value) / 90 * 100%), var(--twk-color-base-300) calc(var(--polar-value) / 90 * 100%))}.twk-spherical-knob{background-color:var(--twk-color-base-content);-webkit-user-select:none;user-select:none;width:1rem;height:1rem;box-shadow:0 0 3px var(--twk-color-neutral);border-radius:50%}.twk-spherical-knob:focus,.twk-spherical-arm:focus{outline:2px solid var(--twk-color-accent);outline-offset:2px}.twk-string-input input,.twk-string-input .twk-input-value{flex:1}.twk-vector-input{gap:var(--twk-gap)}.twk-widget .twk-poll{flex:1}.tweak-ui .twk-p-0{padding:0}.tweak-ui .twk-p-1{padding:var(--twk-gap)}.tweak-ui .twk-p-2{padding:calc(var(--twk-gap) * 2)}.tweak-ui .twk-p-4{padding:calc(var(--twk-gap) * 4)}.tweak-ui .twk-px-0{padding-inline:0}.tweak-ui .twk-px-1{padding-inline:var(--twk-gap)}.tweak-ui .twk-px-2{padding-inline:calc(var(--twk-gap) * 2)}.tweak-ui .twk-px-4{padding-inline:calc(var(--twk-gap) * 4)}.tweak-ui .twk-py-0{padding-block:0}.tweak-ui .twk-py-1{padding-block:var(--twk-gap)}.tweak-ui .twk-py-2{padding-block:calc(var(--twk-gap) * 2)}.tweak-ui .twk-py-4{padding-block:calc(var(--twk-gap) * 4)}.tweak-ui .twk-p-inset{padding:var(--twk-inset)}.tweak-ui .twk-px-label{padding-inline:var(--twk-label-pad-x)}.tweak-ui .twk-px-input{padding-inline:var(--twk-input-pad-x)}.tweak-ui .twk-px-button{padding-inline:var(--twk-button-pad-x)}.tweak-ui .twk-gap-0{gap:0}.tweak-ui .twk-gap-1{gap:var(--twk-gap)}.tweak-ui .twk-gap-2{gap:calc(var(--twk-gap) * 2)}.tweak-ui .twk-gap-4{gap:calc(var(--twk-gap) * 4)}.tweak-ui .twk-w-full{width:100%}.tweak-ui .twk-w-label{width:var(--twk-label-size)}.tweak-ui .twk-h-input{height:var(--twk-input-height)}.tweak-ui .twk-h-btn{height:var(--twk-button-height)}.tweak-ui .twk-h-full{height:100%}.tweak-ui .twk-rounded-none{border-radius:0}.tweak-ui .twk-rounded{border-radius:var(--twk-radius)}.tweak-ui .twk-rounded-full{border-radius:9999px}.tweak-ui .twk-text-end{text-align:end}.tweak-ui .twk-text-right{text-align:right}.tweak-ui .twk-text-start{text-align:start}.tweak-ui .twk-text-left{text-align:left}.tweak-ui .twk-text-center{text-align:center}.tweak-ui .twk-text-xs{font-size:.625rem}.tweak-ui .twk-text-sm{font-size:.75rem}.tweak-ui .twk-text-md{font-size:.875rem}.tweak-ui .twk-bg-100{background-color:var(--twk-color-base-100)}.tweak-ui .twk-bg-200{background-color:var(--twk-color-base-200)}.tweak-ui .twk-bg-300{background-color:var(--twk-color-base-300)}.tweak-ui .twk-bg-content{background-color:var(--twk-color-base-content)}.tweak-ui .twk-bg-neutral{background-color:var(--twk-color-neutral)}.tweak-ui .twk-bg-neutral-content{background-color:var(--twk-color-neutral-content)}.tweak-ui .twk-bg-accent{background-color:var(--twk-color-accent)}.tweak-ui .twk-color-100{color:var(--twk-color-base-100)}.tweak-ui .twk-color-200{color:var(--twk-color-base-200)}.tweak-ui .twk-color-300{color:var(--twk-color-base-300)}.tweak-ui .twk-color-content{color:var(--twk-color-base-content)}.tweak-ui .twk-color-neutral{color:var(--twk-color-neutral)}.tweak-ui .twk-color-neutral-content{color:var(--twk-color-neutral-content)}.tweak-ui .twk-color-accent{color:var(--twk-color-accent)}.tweak-ui .twk-color-muted{color:color-mix(in srgb, var(--twk-color-base-content) 40%, transparent)}.tweak-ui .twk-color-dim{color:color-mix(in srgb, var(--twk-color-base-content) 20%, transparent)}.tweak-ui .twk-glass{background-color:color-mix(in srgb, var(--twk-glass-color,#000) var(--twk-glass-percent,50%), transparent);-webkit-backdrop-filter:blur(40px);backdrop-filter:blur(40px)}.tweak-ui .twk-glass-100{--twk-glass-color:var(--twk-color-base-100)}.tweak-ui .twk-glass-200{--twk-glass-color:var(--twk-color-base-200)}.tweak-ui .twk-glass-300{--twk-glass-color:var(--twk-color-base-300)}@keyframes twk-fade{0%{opacity:0}to{opacity:1}}:root{--twk-pattern-color-a:color-mix(in srgb, var(--twk-color-base-300) 100%, transparent);--twk-pattern-color-b:color-mix(in srgb, var(--twk-color-base-100) 80%, transparent);--twk-pattern-color-line:color-mix(in srgb, var(--twk-color-base-content) 8%, transparent);--twk-pattern-size:.5rem;--twk-pattern-line-width:1px}.twk-bg-checker,.twk-bg-checker-coarse,.twk-bg-checker-fine{background-color:var(--twk-pattern-color-a);background-image:repeating-conic-gradient(var(--twk-pattern-color-b) 0% 25%, transparent 25% 50%);background-size:calc(var(--twk-pattern-size) * 2) calc(var(--twk-pattern-size) * 2);background-position:0 0}.twk-bg-checker-fine{--twk-pattern-size:.25rem}.twk-bg-checker-coarse{--twk-pattern-size:1rem}.twk-bg-grid{background-color:var(--twk-pattern-color-a);background-image:linear-gradient(to right, var(--twk-pattern-color-line) var(--twk-pattern-line-width), transparent var(--twk-pattern-line-width)), linear-gradient(to bottom, var(--twk-pattern-color-line) var(--twk-pattern-line-width), transparent var(--twk-pattern-line-width));background-size:var(--twk-pattern-size) var(--twk-pattern-size);background-position:0 0}.twk-bg-grid-axis{--twk-pattern-color-axis:color-mix(in srgb, var(--twk-color-base-content) 20%, transparent);background-color:var(--twk-pattern-color-a);background-image:linear-gradient(to right, var(--twk-pattern-color-axis) var(--twk-pattern-line-width), transparent var(--twk-pattern-line-width)), linear-gradient(to bottom, var(--twk-pattern-color-axis) var(--twk-pattern-line-width), transparent var(--twk-pattern-line-width)), linear-gradient(to right, var(--twk-pattern-color-line) var(--twk-pattern-line-width), transparent var(--twk-pattern-line-width)), linear-gradient(to bottom, var(--twk-pattern-color-line) var(--twk-pattern-line-width), transparent var(--twk-pattern-line-width));background-size:100% 100%, 100% 100%, var(--twk-pattern-size) var(--twk-pattern-size), var(--twk-pattern-size) var(--twk-pattern-size);background-position:0,50% 0,0 0,0 0}.twk-bg-dots{--twk-pattern-dot-size:1.5px;background-color:var(--twk-pattern-color-a);background-image:radial-gradient(circle, var(--twk-pattern-color-line) var(--twk-pattern-dot-size), transparent var(--twk-pattern-dot-size));background-size:var(--twk-pattern-size) var(--twk-pattern-size);background-position:0 0}.twk-bg-stripes{background-color:var(--twk-pattern-color-a);background-image:repeating-linear-gradient(-45deg, var(--twk-pattern-color-b) 0px, var(--twk-pattern-color-b) var(--twk-pattern-size), transparent var(--twk-pattern-size), transparent calc(var(--twk-pattern-size) * 2))}
|
package/dist/style.d.ts
ADDED