@optolith/entity-descriptions 0.4.10 → 0.4.12

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 (97) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/creator.d.ts +1 -1
  3. package/lib/entities/activatable.d.ts +1 -1
  4. package/lib/entities/activatable.js +69 -1
  5. package/lib/entities/culture.d.ts +2 -0
  6. package/lib/entities/culture.js +20 -14
  7. package/lib/entities/curriculum.js +103 -19
  8. package/lib/entities/derivedCharacteristic.d.ts +0 -2
  9. package/lib/entities/derivedCharacteristic.js +5 -10
  10. package/lib/entities/disease.d.ts +1 -1
  11. package/lib/entities/disease.js +5 -1
  12. package/lib/entities/elixir.d.ts +1 -1
  13. package/lib/entities/elixir.js +12 -10
  14. package/lib/entities/equipment.d.ts +6 -5
  15. package/lib/entities/equipment.js +19 -6
  16. package/lib/entities/equipmentPackage.d.ts +1 -1
  17. package/lib/entities/influence.d.ts +1 -1
  18. package/lib/entities/liturgicalChant.d.ts +1 -1
  19. package/lib/entities/partial/activatableNameChunks.d.ts +11 -3
  20. package/lib/entities/partial/activatableNameChunks.js +27 -12
  21. package/lib/entities/partial/adventurePointsValue.d.ts +2 -2
  22. package/lib/entities/partial/animalTypes.d.ts +1 -1
  23. package/lib/entities/partial/animalTypes.js +2 -1
  24. package/lib/entities/partial/commonnessRatedAdvantagesAndDisadvantages.d.ts +4 -4
  25. package/lib/entities/partial/commonnessRatedAdvantagesAndDisadvantages.js +56 -13
  26. package/lib/entities/partial/dice.d.ts +1 -1
  27. package/lib/entities/partial/enhancements.d.ts +1 -1
  28. package/lib/entities/partial/herbary.d.ts +1 -1
  29. package/lib/entities/partial/map.d.ts +1 -1
  30. package/lib/entities/partial/map.js +1 -1
  31. package/lib/entities/partial/markdown.d.ts +2 -2
  32. package/lib/entities/partial/markdown.js +4 -1
  33. package/lib/entities/partial/mathOperation.d.ts +1 -1
  34. package/lib/entities/partial/prerequisites/displayOption.d.ts +1 -1
  35. package/lib/entities/partial/prerequisites/index.d.ts +3 -3
  36. package/lib/entities/partial/prerequisites/index.js +1 -1
  37. package/lib/entities/partial/prerequisites/part.d.ts +1 -1
  38. package/lib/entities/partial/prerequisites/prerequisiteGroups.d.ts +2 -2
  39. package/lib/entities/partial/prerequisites/prerequisiteGroups.js +10 -7
  40. package/lib/entities/partial/prerequisites/single/activatable.d.ts +2 -2
  41. package/lib/entities/partial/prerequisites/single/animistPower.d.ts +1 -1
  42. package/lib/entities/partial/prerequisites/single/blessedTradition.d.ts +1 -1
  43. package/lib/entities/partial/prerequisites/single/culture.d.ts +1 -1
  44. package/lib/entities/partial/prerequisites/single/enhancement.d.ts +1 -1
  45. package/lib/entities/partial/prerequisites/single/influence.d.ts +1 -1
  46. package/lib/entities/partial/prerequisites/single/magicalTradition.d.ts +1 -1
  47. package/lib/entities/partial/prerequisites/single/pact.d.ts +1 -1
  48. package/lib/entities/partial/prerequisites/single/personalityTrait.d.ts +1 -1
  49. package/lib/entities/partial/prerequisites/single/primaryAttribute.d.ts +1 -1
  50. package/lib/entities/partial/prerequisites/single/profession.d.ts +1 -1
  51. package/lib/entities/partial/prerequisites/single/publication.d.ts +1 -1
  52. package/lib/entities/partial/prerequisites/single/race.d.ts +1 -1
  53. package/lib/entities/partial/prerequisites/single/rated.d.ts +1 -1
  54. package/lib/entities/partial/prerequisites/single/rated.js +2 -2
  55. package/lib/entities/partial/prerequisites/single/ratedMinimumNumber.d.ts +1 -1
  56. package/lib/entities/partial/prerequisites/single/ratedSum.d.ts +1 -1
  57. package/lib/entities/partial/prerequisites/single/rule.d.ts +1 -1
  58. package/lib/entities/partial/prerequisites/single/sex.d.ts +1 -1
  59. package/lib/entities/partial/prerequisites/single/sexualCharacteristic.d.ts +1 -1
  60. package/lib/entities/partial/prerequisites/single/socialStatus.d.ts +1 -1
  61. package/lib/entities/partial/prerequisites/single/state.d.ts +1 -1
  62. package/lib/entities/partial/prerequisites/single/text.d.ts +1 -1
  63. package/lib/entities/partial/professions.d.ts +1 -1
  64. package/lib/entities/partial/professions.js +2 -4
  65. package/lib/entities/partial/rated/activatable/castingTime.d.ts +1 -1
  66. package/lib/entities/partial/rated/activatable/checkResultBased.d.ts +1 -1
  67. package/lib/entities/partial/rated/activatable/checkResultBased.js +3 -1
  68. package/lib/entities/partial/rated/activatable/cost.d.ts +1 -1
  69. package/lib/entities/partial/rated/activatable/duration.d.ts +1 -1
  70. package/lib/entities/partial/rated/activatable/effect.d.ts +1 -1
  71. package/lib/entities/partial/rated/activatable/index.d.ts +1 -1
  72. package/lib/entities/partial/rated/activatable/range.d.ts +1 -1
  73. package/lib/entities/partial/rated/activatable/speed.d.ts +1 -1
  74. package/lib/entities/partial/rated/activatable/targetCategory.d.ts +1 -1
  75. package/lib/entities/partial/rated/improvementCost.d.ts +1 -1
  76. package/lib/entities/partial/rated/skillCheck.d.ts +1 -1
  77. package/lib/entities/partial/rated/skillCheck.js +5 -3
  78. package/lib/entities/partial/reader.d.ts +1 -1
  79. package/lib/entities/partial/responsiveText.d.ts +1 -1
  80. package/lib/entities/poison.d.ts +1 -1
  81. package/lib/entities/poison.js +20 -9
  82. package/lib/entities/profession.d.ts +2 -2
  83. package/lib/entities/profession.js +116 -21
  84. package/lib/entities/race.d.ts +3 -1
  85. package/lib/entities/race.js +89 -68
  86. package/lib/entities/skill.d.ts +1 -1
  87. package/lib/entities/spell.d.ts +4 -2
  88. package/lib/entities/spell.js +4 -4
  89. package/lib/helpers/getTypes.d.ts +1 -1
  90. package/lib/helpers/locale.d.ts +1 -1
  91. package/lib/helpers/translate.d.ts +1 -1
  92. package/lib/index.d.ts +131 -129
  93. package/lib/references/index.d.ts +1 -1
  94. package/lib/references/page.d.ts +1 -1
  95. package/lib/references/pageRange.d.ts +1 -1
  96. package/lib/tsconfig.tsbuildinfo +1 -1
  97. package/package.json +12 -12
@@ -1,29 +1,34 @@
1
1
  import { anySameIndices } from "@elyukai/utils/array/filters";
2
- import { isNotEmpty } from "@elyukai/utils/array/nonEmpty";
2
+ import { ensureNonEmpty, isNotEmpty } from "@elyukai/utils/array/nonEmpty";
3
3
  import { deepEqual } from "@elyukai/utils/equality";
4
4
  import { on } from "@elyukai/utils/function";
5
- import { isNotNullish } from "@elyukai/utils/nullable";
5
+ import { isNotNullish, mapNullable } from "@elyukai/utils/nullable";
6
+ import { compareNumber } from "@elyukai/utils/ordering";
6
7
  import { Reader } from "@elyukai/utils/reader";
7
8
  import { sign } from "@elyukai/utils/string/number";
8
9
  import { createEntityDescriptionCreator } from "../creator.js";
9
- import { renderCommonnessRatedAdvantagesAndDisadvantages, renderCommonnessRatedAdvantagesOrDisadvantages, renderValueWithPossibleTranslation, } from "./partial/commonnessRatedAdvantagesAndDisadvantages.js";
10
- import { attributedCustomName, attributedName } from "./partial/markdown.js";
10
+ import { renderCommonnessRatedAdvantagesAndDisadvantages, renderCommonnessRatedAdvantagesOrDisadvantages, } from "./partial/commonnessRatedAdvantagesAndDisadvantages.js";
11
+ import { attributedCustomName, attributedName, attributedNameFromTranslation, } from "./partial/markdown.js";
12
+ import { getInstanceByIdR, translateMapR, } from "./partial/reader.js";
11
13
  import { MISSING_VALUE } from "./partial/unknown.js";
12
- const renderBaseValueItem = (label, value) => Reader.asks(({ translate }) => ({
13
- label: translate(label),
14
- value: value < 0 ? sign(value) : value.toFixed(),
15
- }));
16
- const renderAttributeAdjustmentsItem = (totalAttributesCount, adjustments) => Reader.asks(({ translate, translateMap, localeJoin, getInstanceById, }) => {
14
+ const renderBaseValues = (values) => Reader.traverse(Object.entries(values), ([id, { value }]) => getInstanceByIdR("DerivedCharacteristic", id).thenW(derivedCharacteristic => translateMapR(derivedCharacteristic?.translations).thenW(translation => Reader.asks(({ translate }) => [
15
+ derivedCharacteristic?.position ?? 0,
16
+ {
17
+ label: translate("{$derivedCharacteristic} Base Value", {
18
+ derivedCharacteristic: attributedNameFromTranslation(translation, "base-values", "DerivedCharacteristic", id) ?? MISSING_VALUE,
19
+ }),
20
+ value: value < 0 ? sign(value) : value.toFixed(),
21
+ },
22
+ ])))).map(items => items.sort(on(item => item[0], compareNumber)).map(item => item[1]));
23
+ const renderAttributeAdjustmentsItem = (totalAttributesCount, adjustments) => Reader.asks(({ translate, translateMap, localeJoin, getInstanceById }) => {
17
24
  const getAttributeAbbreviation = (id) => attributedCustomName(translateMap, getInstanceById, "race", t => t.abbreviation, "Attribute", id) ?? MISSING_VALUE;
18
- return {
19
- label: translate("Attribute Adjustments"),
20
- value: [
21
- ...(adjustments.fixed?.map(adj => `${getAttributeAbbreviation(adj.id)} ${sign(adj.value)}`) ?? []),
22
- ...(adjustments.selectable?.map(adj => `${adj.list.length === totalAttributesCount ? translate("one attribute of your choice") : localeJoin(adj.list.map(getAttributeAbbreviation), "disjunction")} ${sign(adj.value)}`) ?? []),
23
- ].join("; "),
24
- };
25
+ return [
26
+ ...(adjustments.fixed?.map(adj => `${getAttributeAbbreviation(adj.id)} ${sign(adj.value)}`) ??
27
+ []),
28
+ ...(adjustments.selectable?.map(adj => `${adj.list.length === totalAttributesCount ? translate("one attribute of your choice") : localeJoin(adj.list.map(getAttributeAbbreviation), "disjunction")} ${sign(adj.value)}`) ?? []),
29
+ ].join("; ");
25
30
  });
26
- const renderVariantValues = (label, variants, selector, renderValue, translationSelector) => Reader.asks(({ translate, translateMap, localeCompare, localeJoin, }) => {
31
+ const renderVariantValues = (label, variants, selector, renderValue, translationSelector, allowEmpty = false, textPrefix) => Reader.asks(({ translate, translateMap, localeCompare, localeJoin, }) => {
27
32
  const values = variants.map(variant => {
28
33
  const translation = translateMap(variant.translations);
29
34
  return {
@@ -34,37 +39,52 @@ const renderVariantValues = (label, variants, selector, renderValue, translation
34
39
  : undefined,
35
40
  };
36
41
  });
37
- const sameValues = anySameIndices(values, on(value => [value.value, value.valueTranslation], deepEqual));
38
- if (isNotEmpty(sameValues) &&
39
- sameValues.length === 1 &&
40
- sameValues[0].length === values.length) {
41
- return {
42
- label: translate(label),
43
- value: values[0] === undefined
44
- ? MISSING_VALUE
45
- : (values[0].valueTranslation ?? renderValue(values[0].value)),
46
- };
42
+ if (isNotEmpty(values)) {
43
+ const sameValues = anySameIndices(values, on(value => [value.value, value.valueTranslation], deepEqual));
44
+ if (values.length === 1 ||
45
+ (isNotEmpty(sameValues) &&
46
+ sameValues.length === 1 &&
47
+ sameValues[0].length === values.length)) {
48
+ return values[0].value === undefined &&
49
+ values[0].valueTranslation === undefined &&
50
+ allowEmpty
51
+ ? undefined
52
+ : mapNullable(
53
+ /* values[0].valueTranslation ?? */ renderValue(values[0].value, false), renderedValue => ({
54
+ label: translate(label),
55
+ value: (textPrefix ?? "") + renderedValue,
56
+ }));
57
+ }
58
+ else {
59
+ return {
60
+ label: translate(label),
61
+ value: [
62
+ ...(textPrefix !== undefined ? [{ type: "plain", text: textPrefix }] : []),
63
+ {
64
+ type: "definitionList",
65
+ style: "nested",
66
+ items: Map.groupBy(values
67
+ .toSorted(on(item => item.name, localeCompare))
68
+ .map(value => mapNullable(
69
+ /* value.valueTranslation ?? */ renderValue(value.value, true), renderedValue => ({
70
+ label: value.name,
71
+ value: renderedValue,
72
+ })))
73
+ .filter(isNotNullish), item => item.value)
74
+ .entries()
75
+ .map(([value, items]) => ({
76
+ label: localeJoin(items.map(item => item.label), "conjunction"),
77
+ value,
78
+ }))
79
+ .toArray(),
80
+ },
81
+ ],
82
+ };
83
+ }
47
84
  }
48
85
  else {
49
- return {
50
- label: translate(label),
51
- value: [
52
- {
53
- type: "definitionList",
54
- style: "nested",
55
- items: Map.groupBy(values.toSorted(on(item => item.name, localeCompare)).map(value => ({
56
- label: value.name,
57
- value: value.valueTranslation ?? renderValue(value.value),
58
- })), item => item.value)
59
- .entries()
60
- .map(([value, items]) => ({
61
- label: localeJoin(items.map(item => item.label), "conjunction"),
62
- value,
63
- }))
64
- .toArray(),
65
- },
66
- ],
67
- };
86
+ // at least one value and thus one variant is required
87
+ return undefined;
68
88
  }
69
89
  });
70
90
  const renderAutomaticAdvantagesOrDisadvantages = (entity, items) => Reader.asks(({ translate, translateMap, getInstanceById, localeCompare }) => items === undefined || !isNotEmpty(items)
@@ -83,7 +103,7 @@ const renderCommonCultures = (items) => Reader.asks(({ translate, translateMap,
83
103
  /**
84
104
  * Get a JSON representation of the rules text for a race.
85
105
  */
86
- export const getRaceEntityDescription = createEntityDescriptionCreator(({ getInstanceById, countInstances, getChildInstancesForInstanceId }, { translate, translateMap, join: localeJoin, compare: localeCompare }, { id, content: entry }) => {
106
+ export const getRaceEntityDescription = createEntityDescriptionCreator(({ getInstanceById, countInstances, getChildInstancesForInstanceId, getResolvedSelectOptionById, }, { translate, translateMap, join: localeJoin, compare: localeCompare }, { id, content: entry }) => {
87
107
  const translation = translateMap(entry.translations);
88
108
  if (translation === undefined) {
89
109
  return undefined;
@@ -95,6 +115,7 @@ export const getRaceEntityDescription = createEntityDescriptionCreator(({ getIns
95
115
  translateMap,
96
116
  localeJoin,
97
117
  localeCompare,
118
+ getResolvedSelectOptionById,
98
119
  getInstanceById,
99
120
  };
100
121
  return {
@@ -110,29 +131,29 @@ export const getRaceEntityDescription = createEntityDescriptionCreator(({ getIns
110
131
  value: entry.ap_value,
111
132
  }),
112
133
  },
113
- renderBaseValueItem("Life Point Base Value", entry.base_values.life_points).run(env),
114
- renderBaseValueItem("Spirit Base Value", entry.base_values.spirit).run(env),
115
- renderBaseValueItem("Toughness Base Value", entry.base_values.toughness).run(env),
116
- renderBaseValueItem("Movement Base Value", entry.base_values.movement).run(env),
117
- renderAttributeAdjustmentsItem(totalAttributesCount, entry.attribute_adjustments).run(env),
134
+ ...renderBaseValues(entry.base_values).run(env),
135
+ renderVariantValues("Attribute Adjustments", raceVariants, v => v.attribute_adjustments, attrs => renderAttributeAdjustmentsItem(totalAttributesCount, attrs).run(env)).run(env),
118
136
  renderVariantValues("Common Cultures", raceVariants, v => v.common_cultures, cultures => renderCommonCultures(cultures).run(env)).run(env),
119
- entry.automatic_advantages === undefined
120
- ? undefined
121
- : renderValueWithPossibleTranslation("Automatic Advantages", entry.automatic_advantages, v => renderAutomaticAdvantagesOrDisadvantages("Advantage", v).run(env), translation.automatic_advantages).run(env),
122
- entry.automatic_disadvantages === undefined
123
- ? undefined
124
- : renderValueWithPossibleTranslation("Automatic Disadvantages", entry.automatic_disadvantages, v => renderAutomaticAdvantagesOrDisadvantages("Disadvantage", v).run(env), translation.automatic_disadvantages).run(env),
125
- entry.strongly_recommended_advantages === undefined &&
126
- entry.strongly_recommended_disadvantages === undefined
137
+ renderVariantValues("Automatic Advantages", raceVariants, v => v.automatic_advantages, advs => renderAutomaticAdvantagesOrDisadvantages("Advantage", advs).run(env), vt => vt.automatic_advantages, true).run(env),
138
+ renderVariantValues("Automatic Disadvantages", raceVariants, v => v.automatic_disadvantages, advs => renderAutomaticAdvantagesOrDisadvantages("Disadvantage", advs).run(env), vt => vt.automatic_disadvantages, true).run(env),
139
+ renderVariantValues("Strongly recommended Advantages and Disadvantages", raceVariants, v => v.strongly_recommended_advantages === undefined &&
140
+ v.strongly_recommended_disadvantages === undefined
127
141
  ? undefined
128
- : {
129
- label: translate("Strongly recommended Advantages and Disadvantages"),
130
- value: `${translate("The following advantages and disadvantages distinguish Aventurian {$race}. You should choose these advantages and disadvantages. If you don’t want to take them, talk to your GM.", { race: translation.name })} ${renderCommonnessRatedAdvantagesAndDisadvantages(entry.strongly_recommended_advantages, entry.strongly_recommended_disadvantages).run(env)}`,
131
- },
132
- renderVariantValues("Common Advantages", raceVariants, v => v.common_advantages, advs => renderCommonnessRatedAdvantagesOrDisadvantages("Advantage", advs).run(env), vt => vt.common_advantages).run(env),
133
- renderVariantValues("Common Disadvantages", raceVariants, v => v.common_disadvantages, advs => renderCommonnessRatedAdvantagesOrDisadvantages("Disadvantage", advs).run(env), vt => vt.common_disadvantages).run(env),
134
- renderVariantValues("Uncommon Advantages", raceVariants, v => v.uncommon_advantages, advs => renderCommonnessRatedAdvantagesOrDisadvantages("Advantage", advs).run(env), vt => vt.uncommon_advantages).run(env),
135
- renderVariantValues("Uncommon Disadvantages", raceVariants, v => v.uncommon_disadvantages, advs => renderCommonnessRatedAdvantagesOrDisadvantages("Disadvantage", advs).run(env), vt => vt.uncommon_disadvantages).run(env),
142
+ : [
143
+ v.strongly_recommended_advantages,
144
+ v.strongly_recommended_disadvantages,
145
+ ], (advsDisadvs, isSplit) => advsDisadvs === undefined
146
+ ? isSplit
147
+ ? undefined
148
+ : translate("none")
149
+ : renderCommonnessRatedAdvantagesAndDisadvantages(...advsDisadvs, isSplit ? undefined : translate("none")).run(env), vt => ensureNonEmpty([
150
+ vt.strongly_recommended_advantages,
151
+ vt.strongly_recommended_disadvantages,
152
+ ].filter(isNotNullish))?.join("; "), true, `${translate("The following advantages and disadvantages distinguish Aventurian {$race}. You should choose these advantages and disadvantages. If you don’t want to take them, talk to your GM.", { race: translation.name })} `).run(env),
153
+ renderVariantValues("Common Advantages", raceVariants, v => v.common_advantages, (advs, isSplit) => renderCommonnessRatedAdvantagesOrDisadvantages("Advantage", advs, isSplit ? undefined : translate("none")).run(env), vt => vt.common_advantages).run(env),
154
+ renderVariantValues("Common Disadvantages", raceVariants, v => v.common_disadvantages, (advs, isSplit) => renderCommonnessRatedAdvantagesOrDisadvantages("Disadvantage", advs, isSplit ? undefined : translate("none")).run(env), vt => vt.common_disadvantages).run(env),
155
+ renderVariantValues("Uncommon Advantages", raceVariants, v => v.uncommon_advantages, (advs, isSplit) => renderCommonnessRatedAdvantagesOrDisadvantages("Advantage", advs, isSplit ? undefined : translate("none")).run(env), vt => vt.uncommon_advantages).run(env),
156
+ renderVariantValues("Uncommon Disadvantages", raceVariants, v => v.uncommon_disadvantages, (advs, isSplit) => renderCommonnessRatedAdvantagesOrDisadvantages("Disadvantage", advs, isSplit ? undefined : translate("none")).run(env), vt => vt.uncommon_disadvantages).run(env),
136
157
  ],
137
158
  },
138
159
  ],
@@ -1,4 +1,4 @@
1
- import type { ActivatableIdentifier } from "optolith-database-schema/gen";
1
+ import type { ActivatableIdentifier } from "@optolith/database-schema/gen";
2
2
  import type { GetAllChildInstancesForParent, GetAllInstances, GetInstanceById } from "../helpers/getTypes.js";
3
3
  import type { GetAllResolvedNewSkillApplications, GetAllResolvedSkillUses } from "../index.js";
4
4
  /**
@@ -1,6 +1,7 @@
1
- import { type RatedIdentifier } from "optolith-database-schema/gen";
1
+ import { type ActivatableIdentifier, type RatedIdentifier } from "@optolith/database-schema/gen";
2
2
  import type { GetAllChildInstancesForParent, GetInstanceById } from "../helpers/getTypes.js";
3
3
  import { type IdMap } from "../index.js";
4
+ import type { GetResolvedSelectOptionById } from "./partial/prerequisites/single/activatable.js";
4
5
  /**
5
6
  * Get a JSON representation of the rules text for a cantrip.
6
7
  */
@@ -72,7 +73,8 @@ export declare const getAnimistPowerEntityDescription: import("../creator.js").E
72
73
  * Get a JSON representation of the rules text for a Goede ritual.
73
74
  */
74
75
  export declare const getGeodeRitualEntityDescription: import("../creator.js").EntityDescriptionCreator<"GeodeRitual", {
75
- getInstanceById: GetInstanceById<"Publication" | "Attribute" | "SkillModificationLevel" | "TargetCategory" | "Property" | "MagicalTradition" | "DerivedCharacteristic" | "Influence">;
76
+ getInstanceById: GetInstanceById<"Publication" | "Attribute" | "SkillModificationLevel" | "TargetCategory" | "Property" | "MagicalTradition" | "DerivedCharacteristic" | "Influence" | ActivatableIdentifier["kind"] | "Aspect">;
77
+ getResolvedSelectOptionById: GetResolvedSelectOptionById;
76
78
  }, import("../index.js").EntityDescription>;
77
79
  /**
78
80
  * Get a JSON representation of the rules text for a jester trick.
@@ -666,7 +666,7 @@ export const getAnimistPowerEntityDescription = createEntityDescriptionCreator((
666
666
  /**
667
667
  * Get a JSON representation of the rules text for a Goede ritual.
668
668
  */
669
- export const getGeodeRitualEntityDescription = createEntityDescriptionCreator(({ getInstanceById }, locale, { content: entry }) => {
669
+ export const getGeodeRitualEntityDescription = createEntityDescriptionCreator(({ getInstanceById, getResolvedSelectOptionById }, locale, { content: entry }) => {
670
670
  const { translate, translateMap } = locale;
671
671
  const translation = translateMap(entry.translations);
672
672
  if (translation === undefined) {
@@ -707,7 +707,7 @@ export const getGeodeRitualEntityDescription = createEntityDescriptionCreator(({
707
707
  ? undefined
708
708
  : {
709
709
  label: translate("Prerequisites"),
710
- value: printGeodeRitualPrerequisites(getInstanceById, locale, entry.prerequisites),
710
+ value: printGeodeRitualPrerequisites(getInstanceById, getResolvedSelectOptionById, locale, entry.prerequisites),
711
711
  },
712
712
  renderProperty(entry.property).run(env),
713
713
  {
@@ -836,7 +836,7 @@ const renderMagicalRuneCost = (options, cost) => {
836
836
  }
837
837
  };
838
838
  const renderSplitMagicalRuneParameterTranslation = (parameter) => responsiveR(() => parameter.fast.full, () => parameter.fast.abbr).map2(responsiveR(() => parameter.slow.full, () => parameter.slow.abbr), (fast, slow) => `${slow} / ${fast}`);
839
- const renderMagicalRunCraftingTimePart = (craftingTime, unit) => formatTimeSpanR(unit, craftingTime.value).thenW(text => {
839
+ const renderMagicalRuneCraftingTimePart = (craftingTime, unit) => formatTimeSpanR(unit, craftingTime.value).thenW(text => {
840
840
  if (craftingTime.per === undefined) {
841
841
  return Reader.of(text);
842
842
  }
@@ -851,7 +851,7 @@ const renderMagicalRunCraftingTimePart = (craftingTime, unit) => formatTimeSpanR
851
851
  }));
852
852
  });
853
853
  });
854
- const renderMagicalRuneCraftingTime = (craftingTime) => renderMagicalRunCraftingTimePart(craftingTime, "Actions").map2(renderMagicalRunCraftingTimePart(craftingTime, "Days"), (fast, slow) => `${slow} / ${fast}`);
854
+ const renderMagicalRuneCraftingTime = (craftingTime) => renderMagicalRuneCraftingTimePart(craftingTime, "Actions").map2(renderMagicalRuneCraftingTimePart(craftingTime, "Days"), (fast, slow) => `${slow} / ${fast}`);
855
855
  const renderMagicalRuneDuration = (duration) => renderCheckResultBasedDuration(duration.fast).map2(renderCheckResultBasedDuration(duration.slow), (fast, slow) => `${slow} / ${fast}`);
856
856
  const renderMagicalRuneImprovementCost = (options, improvementCost) => {
857
857
  switch (improvementCost.kind) {
@@ -1,4 +1,4 @@
1
- import type * as Database from "optolith-database-schema/gen";
1
+ import type * as Database from "@optolith/database-schema/gen";
2
2
  import type { IdArgsVariant } from "tsondb/schema/gen";
3
3
  export type GetInstanceById<in T extends Extract<keyof Database.EntityMap, string>> = <U extends T>(...args: IdArgsVariant<Database.EntityMap, U>) => Database.EntityMap[U] | undefined;
4
4
  export type GetAllInstances<T extends keyof Database.EntityMap> = <U extends T>(entity: U) => {
@@ -1,5 +1,5 @@
1
+ import type { LocaleMeasurementAdjustments } from "@optolith/database-schema/gen";
1
2
  import type { Compare } from "@optolith/helpers/compare";
2
- import type { LocaleMeasurementAdjustments } from "optolith-database-schema/gen";
3
3
  import type { Format, Translate, TranslateMap } from "./translate.js";
4
4
  /**
5
5
  * The type of list to join in a locale-aware way.
@@ -1,4 +1,4 @@
1
- import type { Locale } from "optolith-database-schema/gen";
1
+ import type { Locale } from "@optolith/database-schema/gen";
2
2
  import { ResponsiveTextSize } from "../entities/partial/responsiveText.js";
3
3
  /**
4
4
  * The type of all translations