@patterkit/play-helpers 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -352,9 +352,9 @@ function createPropertyInspector(engine, opts = {}) {
|
|
|
352
352
|
read = () => {
|
|
353
353
|
if (!focused(inp)) inp.value = String(engine.getProperty(row2.ref) ?? "");
|
|
354
354
|
};
|
|
355
|
-
} else if (row2.type === "enum") {
|
|
355
|
+
} else if (row2.type === "enum" || row2.type === "quality") {
|
|
356
356
|
const sel = doc.createElement("select");
|
|
357
|
-
for (const v of row2.values ?? []) {
|
|
357
|
+
for (const v of (row2.type === "quality" ? row2.stages : row2.values) ?? []) {
|
|
358
358
|
const o = doc.createElement("option");
|
|
359
359
|
o.value = v;
|
|
360
360
|
o.textContent = v;
|
package/dist/index.d.cts
CHANGED
|
@@ -213,7 +213,7 @@ interface SequenceOptions {
|
|
|
213
213
|
}
|
|
214
214
|
/** An option's prompt beat (spec §5): a single line | text beat - the choice text. */
|
|
215
215
|
type PromptBeat = LineBeat | TextBeat;
|
|
216
|
-
type PropertyType = "boolean" | "number" | "string" | "flags" | "enum";
|
|
216
|
+
type PropertyType = "boolean" | "number" | "string" | "flags" | "enum" | "quality";
|
|
217
217
|
interface PropertyDecl {
|
|
218
218
|
name: string;
|
|
219
219
|
type: PropertyType;
|
|
@@ -237,6 +237,11 @@ interface PropertyDecl {
|
|
|
237
237
|
temporary?: boolean;
|
|
238
238
|
/** For enum / flags. */
|
|
239
239
|
values?: string[];
|
|
240
|
+
/** For quality: the ORDERED ladder of stage names (the shared engine's quality type, expr 0.4.0).
|
|
241
|
+
* Ordering operators compare by position in this list and `advance()` steps along it, so the order
|
|
242
|
+
* is the meaning - unlike `values`, whose order is presentation only. Default seeds to the first
|
|
243
|
+
* stage when no `default` is declared. */
|
|
244
|
+
stages?: string[];
|
|
240
245
|
/** Free-text author note documenting what this property is for (authoring only; shown as a hint). */
|
|
241
246
|
purpose?: string;
|
|
242
247
|
}
|
|
@@ -251,6 +256,8 @@ interface HostScopeDecl {
|
|
|
251
256
|
name: string;
|
|
252
257
|
type: PropertyType;
|
|
253
258
|
values?: string[];
|
|
259
|
+
/** For quality: the ordered stage ladder (see `PropertyDecl.stages`). */
|
|
260
|
+
stages?: string[];
|
|
254
261
|
default?: ScalarValue;
|
|
255
262
|
writable?: boolean;
|
|
256
263
|
/** Free-text author note documenting the property (authoring only; shown as a hint). */
|
package/dist/index.d.ts
CHANGED
|
@@ -213,7 +213,7 @@ interface SequenceOptions {
|
|
|
213
213
|
}
|
|
214
214
|
/** An option's prompt beat (spec §5): a single line | text beat - the choice text. */
|
|
215
215
|
type PromptBeat = LineBeat | TextBeat;
|
|
216
|
-
type PropertyType = "boolean" | "number" | "string" | "flags" | "enum";
|
|
216
|
+
type PropertyType = "boolean" | "number" | "string" | "flags" | "enum" | "quality";
|
|
217
217
|
interface PropertyDecl {
|
|
218
218
|
name: string;
|
|
219
219
|
type: PropertyType;
|
|
@@ -237,6 +237,11 @@ interface PropertyDecl {
|
|
|
237
237
|
temporary?: boolean;
|
|
238
238
|
/** For enum / flags. */
|
|
239
239
|
values?: string[];
|
|
240
|
+
/** For quality: the ORDERED ladder of stage names (the shared engine's quality type, expr 0.4.0).
|
|
241
|
+
* Ordering operators compare by position in this list and `advance()` steps along it, so the order
|
|
242
|
+
* is the meaning - unlike `values`, whose order is presentation only. Default seeds to the first
|
|
243
|
+
* stage when no `default` is declared. */
|
|
244
|
+
stages?: string[];
|
|
240
245
|
/** Free-text author note documenting what this property is for (authoring only; shown as a hint). */
|
|
241
246
|
purpose?: string;
|
|
242
247
|
}
|
|
@@ -251,6 +256,8 @@ interface HostScopeDecl {
|
|
|
251
256
|
name: string;
|
|
252
257
|
type: PropertyType;
|
|
253
258
|
values?: string[];
|
|
259
|
+
/** For quality: the ordered stage ladder (see `PropertyDecl.stages`). */
|
|
260
|
+
stages?: string[];
|
|
254
261
|
default?: ScalarValue;
|
|
255
262
|
writable?: boolean;
|
|
256
263
|
/** Free-text author note documenting the property (authoring only; shown as a hint). */
|
package/dist/index.js
CHANGED
|
@@ -311,9 +311,9 @@ function createPropertyInspector(engine, opts = {}) {
|
|
|
311
311
|
read = () => {
|
|
312
312
|
if (!focused(inp)) inp.value = String(engine.getProperty(row2.ref) ?? "");
|
|
313
313
|
};
|
|
314
|
-
} else if (row2.type === "enum") {
|
|
314
|
+
} else if (row2.type === "enum" || row2.type === "quality") {
|
|
315
315
|
const sel = doc.createElement("select");
|
|
316
|
-
for (const v of row2.values ?? []) {
|
|
316
|
+
for (const v of (row2.type === "quality" ? row2.stages : row2.values) ?? []) {
|
|
317
317
|
const o = doc.createElement("option");
|
|
318
318
|
o.value = v;
|
|
319
319
|
o.textContent = v;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patterkit/play-helpers",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Thin game-integration helpers around @patterkit/runtime: save/load serialisation, runtime property setters, a state logger, the Patterpad Live Link client + hot reload, a property inspector, and audio resolution. The Patterplay JS companion.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patterkit/runtime": "0.
|
|
37
|
+
"@patterkit/runtime": "0.5.1"
|
|
38
38
|
}
|
|
39
39
|
}
|