@patterkit/model 0.14.0 → 0.15.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.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -402,19 +402,27 @@ type BundleCastMember = Omit<CastMember, "notes" | "actor" | "gender">;
|
|
|
402
402
|
/** A node TYPE that can carry author-defined gameData fields (the gameData schema, project-level).
|
|
403
403
|
* Beat kinds map straight through: dialogue = `line`, narration = `text`, game event = `gameEvent`. */
|
|
404
404
|
type GameDataNodeKind = "scene" | "block" | "snippet" | "line" | "text" | "gameEvent";
|
|
405
|
-
/** The value type of a gameData field
|
|
406
|
-
*
|
|
407
|
-
|
|
405
|
+
/** The value type of a gameData field: the family's one field-type list, shared with Storylets' card and
|
|
406
|
+
* outcome fields (patterkit design/family-parity-2026-10.md item 9, patter-qualities.md section 1). Drives
|
|
407
|
+
* the inspector's editor widget (text / textarea / number / toggle / enum dropdown / flags checklist /
|
|
408
|
+
* quality ladder). A `quality` value is a stage of the field's own ladder (`stages`), compared by position by
|
|
409
|
+
* a host, never by the engine. */
|
|
410
|
+
type GameDataFieldType = "text" | "multiline" | "number" | "boolean" | "enum" | "flags" | "quality";
|
|
408
411
|
/** One author-defined custom field on a node type (host-integration metadata, NOT expression state). */
|
|
409
412
|
interface GameDataField {
|
|
410
413
|
/** Field key - also the key a node stores its value under in `gameData` (values are name-keyed). */
|
|
411
414
|
name: string;
|
|
412
415
|
type: GameDataFieldType;
|
|
413
416
|
/** The value used when a node sets nothing. Storage is SPARSE - nodes hold only their overrides, and
|
|
414
|
-
* a reader falls back to this default (so changing it here propagates to every node that didn't set it).
|
|
417
|
+
* a reader falls back to this default (so changing it here propagates to every node that didn't set it).
|
|
418
|
+
* Optional in source: left out, the type's default holds (by the kernel's `defaultFor`), and the compiler
|
|
419
|
+
* writes it into the bundle, so a bundle's field always has one. An enum's may be `""`, none chosen. */
|
|
415
420
|
default?: ScalarValue;
|
|
416
|
-
/** Allowed values when `type` is "enum". */
|
|
421
|
+
/** Allowed values when `type` is "enum", or the flags a "flags" value may hold. */
|
|
417
422
|
values?: string[];
|
|
423
|
+
/** A "quality" field's ordered ladder, by the family's one rule (at least two stages, none empty, none
|
|
424
|
+
* twice; `@wildwinter/expr`'s `qualityDeclarationProblems`). */
|
|
425
|
+
stages?: string[];
|
|
418
426
|
/** Free-text description of what the field is for - shown as a rollover hint in the inspector. */
|
|
419
427
|
purpose?: string;
|
|
420
428
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -402,19 +402,27 @@ type BundleCastMember = Omit<CastMember, "notes" | "actor" | "gender">;
|
|
|
402
402
|
/** A node TYPE that can carry author-defined gameData fields (the gameData schema, project-level).
|
|
403
403
|
* Beat kinds map straight through: dialogue = `line`, narration = `text`, game event = `gameEvent`. */
|
|
404
404
|
type GameDataNodeKind = "scene" | "block" | "snippet" | "line" | "text" | "gameEvent";
|
|
405
|
-
/** The value type of a gameData field
|
|
406
|
-
*
|
|
407
|
-
|
|
405
|
+
/** The value type of a gameData field: the family's one field-type list, shared with Storylets' card and
|
|
406
|
+
* outcome fields (patterkit design/family-parity-2026-10.md item 9, patter-qualities.md section 1). Drives
|
|
407
|
+
* the inspector's editor widget (text / textarea / number / toggle / enum dropdown / flags checklist /
|
|
408
|
+
* quality ladder). A `quality` value is a stage of the field's own ladder (`stages`), compared by position by
|
|
409
|
+
* a host, never by the engine. */
|
|
410
|
+
type GameDataFieldType = "text" | "multiline" | "number" | "boolean" | "enum" | "flags" | "quality";
|
|
408
411
|
/** One author-defined custom field on a node type (host-integration metadata, NOT expression state). */
|
|
409
412
|
interface GameDataField {
|
|
410
413
|
/** Field key - also the key a node stores its value under in `gameData` (values are name-keyed). */
|
|
411
414
|
name: string;
|
|
412
415
|
type: GameDataFieldType;
|
|
413
416
|
/** The value used when a node sets nothing. Storage is SPARSE - nodes hold only their overrides, and
|
|
414
|
-
* a reader falls back to this default (so changing it here propagates to every node that didn't set it).
|
|
417
|
+
* a reader falls back to this default (so changing it here propagates to every node that didn't set it).
|
|
418
|
+
* Optional in source: left out, the type's default holds (by the kernel's `defaultFor`), and the compiler
|
|
419
|
+
* writes it into the bundle, so a bundle's field always has one. An enum's may be `""`, none chosen. */
|
|
415
420
|
default?: ScalarValue;
|
|
416
|
-
/** Allowed values when `type` is "enum". */
|
|
421
|
+
/** Allowed values when `type` is "enum", or the flags a "flags" value may hold. */
|
|
417
422
|
values?: string[];
|
|
423
|
+
/** A "quality" field's ordered ladder, by the family's one rule (at least two stages, none empty, none
|
|
424
|
+
* twice; `@wildwinter/expr`'s `qualityDeclarationProblems`). */
|
|
425
|
+
stages?: string[];
|
|
418
426
|
/** Free-text description of what the field is for - shown as a rollover hint in the inspector. */
|
|
419
427
|
purpose?: string;
|
|
420
428
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patterkit/model",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Patter data-model types: source (scene/block/group/snippet/beat/jump), project, locale, authoring. The shape source-of-truth.",
|
|
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
|
-
"@wildwinter/expr": "^0.
|
|
37
|
+
"@wildwinter/expr": "^0.6.0"
|
|
38
38
|
}
|
|
39
39
|
}
|