@heroiclands/package-build 20.6.0 → 21.0.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/CONTENT.md +134 -44
  3. package/bin/content-build.mjs +37 -5
  4. package/bin/package-build.mjs +77 -0
  5. package/content-config.mjs +59 -1
  6. package/docs/api.md +149 -19
  7. package/docs/commands.md +75 -0
  8. package/docs/configuration.md +37 -10
  9. package/docs/content-format.md +450 -49
  10. package/engine/content-format.mjs +52 -3
  11. package/engine/content-images.mjs +699 -0
  12. package/engine/dependency-bump.mjs +218 -0
  13. package/engine/frontmatter-lint.mjs +89 -2
  14. package/engine/helpers.mjs +81 -142
  15. package/engine/index.mjs +15 -0
  16. package/engine/infobox-registry.mjs +81 -0
  17. package/engine/infobox-render.mjs +381 -0
  18. package/engine/infobox.mjs +963 -0
  19. package/engine/item-registry.mjs +5 -5
  20. package/engine/journals.mjs +22 -1
  21. package/engine/map-notes.mjs +11 -5
  22. package/engine/metadata-index.mjs +5 -0
  23. package/engine/note-vocabulary.mjs +57 -2
  24. package/engine/pathnames.mjs +374 -0
  25. package/engine/pdf-build.mjs +208 -9
  26. package/engine/pdf-render.mjs +461 -21
  27. package/engine/pdf-toc.mjs +77 -5
  28. package/engine/scenes.mjs +2 -1
  29. package/engine/site-build.mjs +115 -8
  30. package/engine/site-index.mjs +93 -4
  31. package/engine/wikilinks.mjs +93 -0
  32. package/hm3/default-item-art.mjs +14 -15
  33. package/hm3/index.mjs +3 -0
  34. package/hm3/infobox.mjs +64 -0
  35. package/package.json +3 -2
  36. package/sohl/being-info.mjs +9 -3
  37. package/sohl/default-item-art.mjs +18 -16
  38. package/sohl/index.mjs +3 -0
  39. package/sohl/infobox.mjs +499 -0
  40. package/types/content-config.d.mts +7 -0
  41. package/types/engine/content-format.d.mts +36 -0
  42. package/types/engine/content-images.d.mts +281 -0
  43. package/types/engine/dependency-bump.d.mts +89 -0
  44. package/types/engine/frontmatter-lint.d.mts +23 -0
  45. package/types/engine/helpers.d.mts +30 -72
  46. package/types/engine/index.d.mts +5 -0
  47. package/types/engine/infobox-registry.d.mts +36 -0
  48. package/types/engine/infobox-render.d.mts +87 -0
  49. package/types/engine/infobox.d.mts +443 -0
  50. package/types/engine/item-registry.d.mts +5 -5
  51. package/types/engine/journals.d.mts +9 -1
  52. package/types/engine/note-vocabulary.d.mts +51 -0
  53. package/types/engine/pathnames.d.mts +189 -0
  54. package/types/engine/pdf-build.d.mts +46 -0
  55. package/types/engine/pdf-render.d.mts +99 -1
  56. package/types/engine/pdf-toc.d.mts +10 -5
  57. package/types/engine/site-build.d.mts +19 -3
  58. package/types/engine/site-index.d.mts +35 -3
  59. package/types/engine/wikilinks.d.mts +22 -0
  60. package/types/hm3/default-item-art.d.mts +5 -6
  61. package/types/hm3/index.d.mts +1 -0
  62. package/types/hm3/infobox.d.mts +22 -0
  63. package/types/sohl/being-info.d.mts +4 -3
  64. package/types/sohl/index.d.mts +1 -0
  65. package/types/sohl/infobox.d.mts +145 -0
@@ -0,0 +1,145 @@
1
+ /**
2
+ * What one entry of `sohl.items` names.
3
+ *
4
+ * An entry addresses its item three ways and every tree uses all three: a
5
+ * `model` address whose last two hyphen-separated segments are always
6
+ * `<type>-<shortcode>`, explicit `type` / `shortcode` keys, or a locally
7
+ * authored item stating its type with the shortcode inside its own `system`
8
+ * block. One decode covers all of them, so nothing downstream has to know
9
+ * which form a note happened to use.
10
+ *
11
+ * @param {object} entry - One `sohl.items` entry.
12
+ * @returns {{type: string, shortcode: string, name: string, system: object}|undefined}
13
+ * What it names, or `undefined` when it names nothing addressable.
14
+ */
15
+ export function decodeItem(entry: object): {
16
+ type: string;
17
+ shortcode: string;
18
+ name: string;
19
+ system: object;
20
+ } | undefined;
21
+ /**
22
+ * A being's box: attributes, skills, mystical abilities and equipment.
23
+ *
24
+ * Each is a section of its own, because a section is the unit that flows — the
25
+ * panel breaks between `ATTRIBUTES` and `SKILLS` rather than through either.
26
+ * A section with nothing in it is not emitted at all, which is what makes a
27
+ * sparse creature's box short rather than mostly empty.
28
+ *
29
+ * @param {object} fm - The note's frontmatter.
30
+ * @param {object} ctx - `{ block, resolve }`.
31
+ * @returns {object[]} The sections.
32
+ */
33
+ export function beingSections(fm: object, { block, resolve }: object): object[];
34
+ /**
35
+ * Armour's box: whatever the note states, then the protection it gives.
36
+ *
37
+ * Protection is shown whole, with an aspect nobody stated rendered `0`. Armour
38
+ * that stops nothing edged is a fact about the armour, and dropping the row
39
+ * would leave a reader to guess whether it was unstated or nil.
40
+ *
41
+ * @param {object} fm - The note's frontmatter.
42
+ * @param {object} ctx - The section context.
43
+ * @returns {object[]} The sections.
44
+ */
45
+ export function armorSections(fm: object, ctx: object): object[];
46
+ /**
47
+ * A weapon's box: whatever the note states, then one line per strike mode.
48
+ *
49
+ * A mode that states no attack modifier, no impact or no length is shown with
50
+ * {@link UNSTATED} in that place rather than with the clause missing: the
51
+ * modes are read against each other, and a line that is shorter than its
52
+ * neighbour for no visible reason reads as a fault.
53
+ *
54
+ * @param {object} fm - The note's frontmatter.
55
+ * @param {object} ctx - The section context.
56
+ * @returns {object[]} The sections.
57
+ */
58
+ export function weaponSections(fm: object, ctx: object): object[];
59
+ /**
60
+ * A projectile's box: whatever the note states, then what it hits for.
61
+ *
62
+ * Impact is three declared fields — dice, modifier and aspect — and a reader
63
+ * wants the one quantity they compose into. Three rows reading `Die 6`,
64
+ * `Modifier 2`, `Aspect Piercing` say the declaration's structure rather than
65
+ * the projectile's, so the three are withheld and the row they make is added
66
+ * in their place.
67
+ *
68
+ * @param {object} fm - The note's frontmatter.
69
+ * @param {object} ctx - The section context.
70
+ * @returns {object[]} The sections.
71
+ */
72
+ export function projectileSections(fm: object, ctx: object): object[];
73
+ /**
74
+ * A weapon's strike modes, whichever of the two shapes the note wrote.
75
+ *
76
+ * Both are live in the corpus and both name the same thing. A **list** carries
77
+ * the mode's identity inside it, as `shortcode`, which is the shape a
78
+ * compendium document holds; a **mapping** carries it as the key. So the
79
+ * fallback name comes from the shortcode in one and from the key in the other,
80
+ * and everything downstream sees one shape.
81
+ *
82
+ * @param {unknown} declared - What the note wrote at `strikeModes`.
83
+ * @returns {[string, object][]} Mode name → the mode.
84
+ */
85
+ export function strikeModes(declared: unknown): [string, object][];
86
+ /** What this system's box is called. @type {string} */
87
+ export const SOHL_INFOBOX_TITLE: string;
88
+ /**
89
+ * What a value nobody stated is shown as, where showing nothing would be the
90
+ * wrong answer.
91
+ *
92
+ * Rule 4 drops an absent field, and that is right almost everywhere. It is
93
+ * wrong in a table of strike modes, where a column left blank on one row and
94
+ * filled on the next reads as a rendering fault rather than as a weapon that
95
+ * cannot be used that way.
96
+ *
97
+ * @type {string}
98
+ */
99
+ export const UNSTATED: string;
100
+ /**
101
+ * The declarations of the four aspects armour is rated against, in the order a
102
+ * sheet shows them.
103
+ *
104
+ * Taken from the armour field declaration rather than listed: the declaration
105
+ * names `protection.blunt`, `protection.edged` and the rest, so the set, its
106
+ * order **and where each is authored** come from the same place the compiler
107
+ * reads them. Carrying the whole declaration rather than the aspect's word is
108
+ * what lets the grid resolve a value the way the compiler does — a note writes
109
+ * `sohl.system.protectionBase.blunt`, and a grid that read the declared
110
+ * *source* path instead would find nothing and call every aspect unstated.
111
+ *
112
+ * @type {readonly object[]}
113
+ */
114
+ export const PROTECTION_FIELDS: readonly object[];
115
+ /**
116
+ * SoHL's presentation overlay: what one of this system's fields is called, and
117
+ * the few that carry no row.
118
+ *
119
+ * **Not a second field list.** The fields come from {@link NOTE_SCHEMAS}, and
120
+ * a field this overlay does not mention still gets a row under its own
121
+ * humanised name — so a field added to a type reaches the box with no edit
122
+ * here. What the overlay adds is the two things a compiler's field list cannot
123
+ * say, because they are about a page rather than about a document:
124
+ *
125
+ * - **a reader's word** where the declaration's key is the compiler's. A key
126
+ * is named for the value it carries into a DataModel; `assocSkillCode` and
127
+ * `perceptionPenaltyBase` are exactly right there and wrong in a panel
128
+ * somebody reads.
129
+ * - **which facts belong on a page at all.** A value shown whole somewhere
130
+ * else in the same box — protection, strike modes, a projectile's impact —
131
+ * would otherwise be said twice, the second time a row at a time and worse;
132
+ * and a flag that steers a character sheet is not a fact about the subject.
133
+ *
134
+ * @type {Readonly<Record<string, {label?: string, withheld?: string}>>}
135
+ */
136
+ export const SOHL_FIELD_PRESENTATION: Readonly<Record<string, {
137
+ label?: string;
138
+ withheld?: string;
139
+ }>>;
140
+ /**
141
+ * SoHL's infobox declaration.
142
+ *
143
+ * @type {object}
144
+ */
145
+ export const SOHL_INFOBOX: object;