partforge 0.113.0 → 0.114.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/docs/AUTHORING-PARTS.md +138 -1
- package/package.json +8 -1
- package/src/framework/app.css +50 -2
- package/src/framework/lint/rules-schema.js +56 -0
- package/src/framework/lint/source-scan.js +116 -2
- package/src/framework/mount.js +21 -2
- package/src/framework/panel/author.js +5 -0
- package/src/framework/panel/json-value.js +55 -0
- package/src/framework/panel/render.js +119 -36
- package/src/framework/panel/scoped-params.js +52 -0
- package/src/framework/panel/widget-specs.js +2 -0
- package/src/framework/panel/widgets/custom.js +253 -0
- package/src/framework/panel/widgets/index.js +2 -0
- package/src/panel-values.js +6 -0
- package/types/index.d.ts +66 -0
- package/types/panel-values.d.ts +18 -0
- package/types/part.d.ts +10 -1
package/types/part.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export interface PartMeta {
|
|
|
58
58
|
export type ControlKind = "slider" | "number" | "text" | "textarea";
|
|
59
59
|
|
|
60
60
|
/** Every control type the panel can render. */
|
|
61
|
-
export type ControlType = "slider" | "number" | "text" | "textarea" | "checkbox" | "select" | "radio";
|
|
61
|
+
export type ControlType = "slider" | "number" | "text" | "textarea" | "checkbox" | "select" | "radio" | "font" | "image" | "vector" | "custom";
|
|
62
62
|
|
|
63
63
|
/** A declarative visibility condition, evaluated against raw parameters. */
|
|
64
64
|
export type WhenCondition =
|
|
@@ -94,6 +94,15 @@ export interface PanelControlEntry {
|
|
|
94
94
|
snap?: boolean;
|
|
95
95
|
/** slider: [lo, hi] band drawn on the track; outside it the value box takes a warning tint. */
|
|
96
96
|
recommended?: [number, number];
|
|
97
|
+
/**
|
|
98
|
+
* custom: the widget function. Called once per mount with a host object
|
|
99
|
+
* (see `CustomControlHost` in index.d.ts); draws into `host.el`. The key
|
|
100
|
+
* this control owns may hold a JSON value (arrays and plain objects of
|
|
101
|
+
* primitives, ≤16 KB, depth ≤8).
|
|
102
|
+
*/
|
|
103
|
+
widget?: (host: import("./index.js").CustomControlHost) => import("./index.js").CustomControlInstance | void;
|
|
104
|
+
/** custom: further scalar params the widget may write besides `key`. */
|
|
105
|
+
keys?: string[];
|
|
97
106
|
hidden?: boolean;
|
|
98
107
|
when?: WhenCondition;
|
|
99
108
|
whenFalse?: "disable";
|