rpg-engine 0.15.0 → 0.16.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/campaign/index.d.ts +1 -1
- package/dist/campaign/index.js +1 -1
- package/dist/campaign/settings.d.ts +6 -0
- package/dist/campaign/settings.js +22 -1
- package/dist/cli/cli.js +1 -1
- package/dist/cli/command-line.js +1 -1
- package/dist/commands/advance.d.ts +1 -1
- package/dist/commands/advance.js +6 -6
- package/dist/commands/ask.js +7 -7
- package/dist/commands/change/amounts.d.ts +32 -0
- package/dist/commands/change/amounts.js +150 -0
- package/dist/commands/change/change.d.ts +4 -54
- package/dist/commands/change/change.js +19 -749
- package/dist/commands/change/damage.d.ts +30 -0
- package/dist/commands/change/damage.js +73 -2
- package/dist/commands/change/dice.d.ts +34 -0
- package/dist/commands/change/dice.js +59 -0
- package/dist/commands/change/fields.d.ts +37 -0
- package/dist/commands/change/fields.js +156 -0
- package/dist/commands/change/holder.d.ts +48 -0
- package/dist/commands/change/holder.js +162 -0
- package/dist/commands/change/recipe-pace.js +1 -1
- package/dist/commands/change/recipe.d.ts +58 -0
- package/dist/commands/change/recipe.js +179 -0
- package/dist/commands/choices.js +3 -3
- package/dist/commands/config/config.d.ts +15 -0
- package/dist/commands/config/config.js +355 -0
- package/dist/commands/config/custom-levels.d.ts +7 -0
- package/dist/commands/config/custom-levels.js +32 -0
- package/dist/commands/{config.d.ts → config/dashboard.d.ts} +2 -24
- package/dist/commands/config/dashboard.js +171 -0
- package/dist/commands/config/entries.d.ts +17 -0
- package/dist/commands/config/entries.js +76 -0
- package/dist/commands/config/news.d.ts +7 -0
- package/dist/commands/config/news.js +88 -0
- package/dist/commands/config/shown.d.ts +9 -0
- package/dist/commands/config/shown.js +80 -0
- package/dist/commands/config/words.d.ts +27 -0
- package/dist/commands/config/words.js +204 -0
- package/dist/commands/effect.js +9 -9
- package/dist/commands/find.js +1 -1
- package/dist/commands/image.js +6 -6
- package/dist/commands/import/import.d.ts +0 -2
- package/dist/commands/import/import.js +45 -44
- package/dist/commands/import/run.js +1 -1
- package/dist/commands/index.js +3 -3
- package/dist/commands/init.js +2 -2
- package/dist/commands/install.js +1 -1
- package/dist/commands/instructions.js +6 -6
- package/dist/commands/mode.d.ts +2 -2
- package/dist/commands/mode.js +8 -8
- package/dist/commands/mood.js +4 -4
- package/dist/commands/move.js +10 -10
- package/dist/commands/package/consent.d.ts +11 -0
- package/dist/commands/package/consent.js +52 -0
- package/dist/commands/package/here.d.ts +51 -0
- package/dist/commands/package/here.js +128 -0
- package/dist/commands/package/install.d.ts +10 -0
- package/dist/commands/package/install.js +337 -0
- package/dist/commands/package/package.d.ts +18 -0
- package/dist/commands/package/package.js +236 -0
- package/dist/commands/package/result.d.ts +90 -0
- package/dist/commands/package/result.js +1 -0
- package/dist/commands/package/uninstall.d.ts +6 -0
- package/dist/commands/package/uninstall.js +70 -0
- package/dist/commands/rename.js +3 -3
- package/dist/commands/reveal.js +5 -5
- package/dist/commands/roll/roll.js +11 -9
- package/dist/commands/roll/tables.js +1 -1
- package/dist/commands/rules.d.ts +2 -2
- package/dist/commands/rules.js +3 -3
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +2 -2
- package/dist/commands/scene/close.d.ts +18 -0
- package/dist/commands/scene/close.js +179 -0
- package/dist/commands/scene/members.d.ts +14 -0
- package/dist/commands/scene/members.js +32 -0
- package/dist/commands/scene/open.d.ts +6 -0
- package/dist/commands/scene/open.js +298 -0
- package/dist/commands/scene/result.d.ts +98 -0
- package/dist/commands/scene/result.js +2 -0
- package/dist/commands/{scene.d.ts → scene/scene.d.ts} +10 -36
- package/dist/commands/scene/scene.js +210 -0
- package/dist/commands/scene/turns.d.ts +18 -0
- package/dist/commands/scene/turns.js +229 -0
- package/dist/commands/shared/{adventures.d.ts → books/adventures.d.ts} +5 -3
- package/dist/commands/shared/{adventures.js → books/adventures.js} +23 -19
- package/dist/commands/shared/{library-reader.js → books/library-reader.js} +3 -3
- package/dist/commands/shared/{library.d.ts → books/library.d.ts} +2 -2
- package/dist/commands/shared/{library.js → books/library.js} +9 -9
- package/dist/commands/shared/{rules.d.ts → books/rules.d.ts} +2 -2
- package/dist/commands/shared/{rules.js → books/rules.js} +5 -5
- package/dist/commands/shared/{system-texts.d.ts → books/system-texts.d.ts} +2 -2
- package/dist/commands/shared/{system-texts.js → books/system-texts.js} +9 -8
- package/dist/commands/shared/{page-words.d.ts → books/words.d.ts} +2 -2
- package/dist/commands/shared/{page-words.js → books/words.js} +4 -4
- package/dist/commands/shared/{checks.d.ts → campaign/checks.d.ts} +3 -3
- package/dist/commands/shared/{checks.js → campaign/checks.js} +7 -7
- package/dist/commands/shared/{images.d.ts → campaign/images.d.ts} +3 -3
- package/dist/commands/shared/{images.js → campaign/images.js} +5 -5
- package/dist/commands/shared/{mode.d.ts → campaign/mode.d.ts} +4 -4
- package/dist/commands/shared/{mode.js → campaign/mode.js} +24 -13
- package/dist/commands/shared/{money.d.ts → campaign/money.d.ts} +3 -3
- package/dist/commands/shared/{money.js → campaign/money.js} +2 -2
- package/dist/commands/shared/{offers.d.ts → campaign/offers.d.ts} +3 -3
- package/dist/commands/shared/{offers.js → campaign/offers.js} +3 -3
- package/dist/commands/shared/{outside.d.ts → campaign/outside.d.ts} +3 -3
- package/dist/commands/shared/{outside.js → campaign/outside.js} +7 -7
- package/dist/commands/shared/{parts.d.ts → campaign/parts.d.ts} +3 -3
- package/dist/commands/shared/{parts.js → campaign/parts.js} +3 -3
- package/dist/commands/shared/{problems.d.ts → campaign/problems.d.ts} +3 -3
- package/dist/commands/shared/{problems.js → campaign/problems.js} +17 -17
- package/dist/commands/shared/{quests.d.ts → campaign/quests.d.ts} +4 -4
- package/dist/commands/shared/{quests.js → campaign/quests.js} +6 -6
- package/dist/commands/shared/{saves.d.ts → campaign/saves.d.ts} +4 -4
- package/dist/commands/shared/{saves.js → campaign/saves.js} +10 -10
- package/dist/commands/shared/{theme.d.ts → campaign/theme.d.ts} +3 -3
- package/dist/commands/shared/{theme.js → campaign/theme.js} +1 -1
- package/dist/commands/shared/{world.d.ts → campaign/world.d.ts} +5 -5
- package/dist/commands/shared/{world.js → campaign/world.js} +17 -14
- package/dist/commands/shared/{knowledge.d.ts → characters/knowledge.d.ts} +3 -3
- package/dist/commands/shared/{knowledge.js → characters/knowledge.js} +4 -4
- package/dist/commands/shared/{moods.d.ts → characters/moods.d.ts} +3 -3
- package/dist/commands/shared/{moods.js → characters/moods.js} +3 -3
- package/dist/commands/shared/characters/orders.d.ts +4 -0
- package/dist/commands/shared/characters/orders.js +10 -0
- package/dist/commands/shared/{thoughts.d.ts → characters/thoughts.d.ts} +2 -2
- package/dist/commands/shared/{thoughts.js → characters/thoughts.js} +3 -3
- package/dist/commands/shared/{voices.d.ts → characters/voices.d.ts} +1 -1
- package/dist/commands/shared/{voices.js → characters/voices.js} +2 -2
- package/dist/commands/shared/examples.js +2 -2
- package/dist/commands/shared/packages/catalog.js +2 -2
- package/dist/commands/shared/packages/code.d.ts +1 -1
- package/dist/commands/shared/packages/code.js +8 -8
- package/dist/commands/shared/packages/extensions.d.ts +1 -1
- package/dist/commands/shared/packages/extensions.js +1 -1
- package/dist/commands/shared/packages/hooks.d.ts +1 -1
- package/dist/commands/shared/packages/hooks.js +1 -1
- package/dist/commands/shared/packages/widgets.d.ts +3 -3
- package/dist/commands/shared/packages/widgets.js +3 -3
- package/dist/commands/shared/{environment.d.ts → places/environment.d.ts} +1 -1
- package/dist/commands/shared/{environment.js → places/environment.js} +4 -4
- package/dist/commands/shared/{grid-moves.d.ts → places/grid-moves.d.ts} +4 -4
- package/dist/commands/shared/{grid-moves.js → places/grid-moves.js} +8 -7
- package/dist/commands/shared/{grids.d.ts → places/grids.d.ts} +4 -4
- package/dist/commands/shared/{grids.js → places/grids.js} +6 -6
- package/dist/commands/shared/{journey.d.ts → places/journey.d.ts} +3 -3
- package/dist/commands/shared/{journey.js → places/journey.js} +6 -6
- package/dist/commands/shared/{moves.d.ts → places/moves.d.ts} +2 -2
- package/dist/commands/shared/{moves.js → places/moves.js} +4 -4
- package/dist/commands/shared/{positions.d.ts → places/positions.d.ts} +2 -2
- package/dist/commands/shared/{positions.js → places/positions.js} +4 -4
- package/dist/commands/shared/{roads.d.ts → places/roads.d.ts} +5 -5
- package/dist/commands/shared/{roads.js → places/roads.js} +6 -6
- package/dist/commands/shared/{effects.d.ts → scene/effects.d.ts} +7 -7
- package/dist/commands/shared/{effects.js → scene/effects.js} +10 -10
- package/dist/commands/shared/{loot.d.ts → scene/loot.d.ts} +2 -2
- package/dist/commands/shared/{loot.js → scene/loot.js} +3 -3
- package/dist/commands/shared/{master-rolls.d.ts → scene/master-rolls.d.ts} +2 -2
- package/dist/commands/shared/{master-rolls.js → scene/master-rolls.js} +5 -5
- package/dist/commands/shared/{reminders.d.ts → scene/reminders.d.ts} +4 -4
- package/dist/commands/shared/{reminders.js → scene/reminders.js} +4 -4
- package/dist/commands/shared/{scene.d.ts → scene/scene.d.ts} +3 -3
- package/dist/commands/shared/{scene.js → scene/scene.js} +7 -7
- package/dist/commands/shared/{bonds.d.ts → sheet/bonds.d.ts} +3 -3
- package/dist/commands/shared/{bonds.js → sheet/bonds.js} +2 -2
- package/dist/commands/shared/{page-counters.d.ts → sheet/counters.d.ts} +3 -3
- package/dist/commands/shared/{page-counters.js → sheet/counters.js} +5 -5
- package/dist/commands/shared/{effect-layer.d.ts → sheet/effect-layer.d.ts} +2 -2
- package/dist/commands/shared/{effect-layer.js → sheet/effect-layer.js} +9 -6
- package/dist/commands/shared/sheet/effect-values.d.ts +9 -0
- package/dist/commands/shared/sheet/effect-values.js +69 -0
- package/dist/commands/shared/{experience.d.ts → sheet/experience.d.ts} +3 -3
- package/dist/commands/shared/{experience.js → sheet/experience.js} +5 -5
- package/dist/commands/shared/sheet/formula-problems.d.ts +8 -0
- package/dist/commands/shared/sheet/formula-problems.js +140 -0
- package/dist/commands/shared/sheet/formula-scope.d.ts +32 -0
- package/dist/commands/shared/sheet/formula-scope.js +235 -0
- package/dist/commands/shared/{limits.d.ts → sheet/limits.d.ts} +3 -3
- package/dist/commands/shared/{limits.js → sheet/limits.js} +5 -4
- package/dist/commands/shared/{progression.d.ts → sheet/progression.d.ts} +2 -2
- package/dist/commands/shared/{progression.js → sheet/progression.js} +4 -4
- package/dist/commands/shared/{sheet.d.ts → sheet/sheet.d.ts} +5 -5
- package/dist/commands/shared/{sheet.js → sheet/sheet.js} +11 -7
- package/dist/commands/shared/{stacks.d.ts → sheet/stacks.d.ts} +2 -2
- package/dist/commands/shared/{stacks.js → sheet/stacks.js} +4 -4
- package/dist/commands/shared/sheet/system-fields.d.ts +21 -0
- package/dist/commands/shared/sheet/system-fields.js +45 -0
- package/dist/commands/shared/{thresholds.d.ts → sheet/thresholds.d.ts} +1 -1
- package/dist/commands/shared/{thresholds.js → sheet/thresholds.js} +4 -4
- package/dist/commands/shared/{turn-uses.d.ts → sheet/turn-uses.d.ts} +3 -3
- package/dist/commands/shared/{turn-uses.js → sheet/turn-uses.js} +4 -3
- package/dist/commands/shared/{worked-out.d.ts → sheet/worked-out.d.ts} +11 -46
- package/dist/commands/shared/sheet/worked-out.js +291 -0
- package/dist/commands/shared/sheet/worked-text.d.ts +14 -0
- package/dist/commands/shared/sheet/worked-text.js +55 -0
- package/dist/commands/shared/{advance.d.ts → time/advance.d.ts} +3 -3
- package/dist/commands/shared/{advance.js → time/advance.js} +11 -11
- package/dist/commands/shared/{dice-pool.d.ts → time/dice-pool.d.ts} +3 -3
- package/dist/commands/shared/{dice-pool.js → time/dice-pool.js} +11 -11
- package/dist/commands/shared/{events.d.ts → time/events.d.ts} +5 -5
- package/dist/commands/shared/{events.js → time/events.js} +10 -13
- package/dist/commands/shared/{recipes.d.ts → time/recipes.d.ts} +3 -3
- package/dist/commands/shared/{recipes.js → time/recipes.js} +6 -5
- package/dist/commands/shared/{time.d.ts → time/time.d.ts} +4 -4
- package/dist/commands/shared/{time.js → time/time.js} +6 -6
- package/dist/commands/shared/{upkeep.d.ts → time/upkeep.d.ts} +3 -3
- package/dist/commands/shared/{upkeep.js → time/upkeep.js} +14 -13
- package/dist/commands/show.d.ts +3 -0
- package/dist/commands/show.js +28 -9
- package/dist/commands/status.d.ts +2 -1
- package/dist/commands/status.js +28 -22
- package/dist/commands/thoughts.js +3 -3
- package/dist/commands/trade.js +8 -8
- package/dist/commands/translate.d.ts +1 -1
- package/dist/commands/translate.js +3 -3
- package/dist/commands/travel/open.d.ts +1 -1
- package/dist/commands/travel/open.js +2 -2
- package/dist/commands/travel/route.js +7 -6
- package/dist/commands/travel/travel.d.ts +1 -1
- package/dist/commands/travel/travel.js +8 -8
- package/dist/commands/validate.js +3 -3
- package/dist/commands/view/journal.d.ts +2 -2
- package/dist/commands/view/journal.js +2 -2
- package/dist/commands/view/map.d.ts +1 -1
- package/dist/commands/view/map.js +6 -6
- package/dist/commands/view/memory.d.ts +16 -0
- package/dist/commands/view/memory.js +90 -0
- package/dist/commands/view/page.d.ts +32 -0
- package/dist/commands/view/page.js +163 -0
- package/dist/commands/view/place.d.ts +7 -2
- package/dist/commands/view/place.js +30 -12
- package/dist/commands/view/result.d.ts +245 -0
- package/dist/commands/view/result.js +1 -0
- package/dist/commands/view/saves.d.ts +6 -0
- package/dist/commands/view/saves.js +53 -0
- package/dist/commands/view/story.d.ts +32 -0
- package/dist/commands/view/story.js +227 -0
- package/dist/commands/view/view.d.ts +26 -292
- package/dist/commands/view/view.js +26 -534
- package/dist/commands/view/world.d.ts +1 -1
- package/dist/commands/view/world.js +3 -3
- package/dist/commands/write/checks.d.ts +42 -0
- package/dist/commands/write/checks.js +291 -0
- package/dist/commands/write/here.d.ts +1 -1
- package/dist/commands/write/here.js +5 -5
- package/dist/commands/write/inheritance.d.ts +40 -0
- package/dist/commands/write/inheritance.js +189 -0
- package/dist/commands/write/input.d.ts +29 -0
- package/dist/commands/write/input.js +124 -0
- package/dist/commands/write/layer.d.ts +36 -0
- package/dist/commands/write/layer.js +48 -0
- package/dist/commands/write/notes.d.ts +22 -0
- package/dist/commands/write/notes.js +76 -0
- package/dist/commands/write/progression.d.ts +27 -0
- package/dist/commands/write/progression.js +175 -0
- package/dist/commands/write/write.d.ts +1 -0
- package/dist/commands/write/write.js +32 -816
- package/dist/core/files.d.ts +2 -0
- package/dist/core/files.js +7 -0
- package/dist/core/{package-declarations.d.ts → packages/declarations.d.ts} +1 -1
- package/dist/core/{package-declarations.js → packages/declarations.js} +1 -1
- package/dist/core/session-store.js +3 -3
- package/dist/core/store.d.ts +2 -2
- package/dist/core/store.js +18 -4
- package/dist/dashboard/acts/acts.js +1 -1
- package/dist/dashboard/acts/sending.js +110 -0
- package/dist/dashboard/acts/sheet.js +2 -2
- package/dist/dashboard/acts/strip.js +1 -1
- package/dist/dashboard/address.js +6 -0
- package/dist/dashboard/api.js +1 -1
- package/dist/dashboard/app.js +47 -171
- package/dist/dashboard/dice/roller.js +1 -1
- package/dist/dashboard/dice/sets.js +2 -2
- package/dist/dashboard/dice/stage.js +1 -1
- package/dist/dashboard/dice/tray.js +6 -6
- package/dist/dashboard/guide/ar.md +5 -3
- package/dist/dashboard/guide/cs.md +5 -3
- package/dist/dashboard/guide/da.md +5 -3
- package/dist/dashboard/guide/de.md +5 -3
- package/dist/dashboard/guide/el.md +5 -3
- package/dist/dashboard/guide/en.md +2 -0
- package/dist/dashboard/guide/es.md +4 -2
- package/dist/dashboard/guide/fi.md +5 -3
- package/dist/dashboard/guide/fr.md +4 -2
- package/dist/dashboard/guide/he.md +4 -2
- package/dist/dashboard/guide/hi.md +6 -4
- package/dist/dashboard/guide/hu.md +4 -2
- package/dist/dashboard/guide/is.md +5 -3
- package/dist/dashboard/guide/it.md +3 -1
- package/dist/dashboard/guide/ja.md +7 -5
- package/dist/dashboard/guide/ko.md +6 -4
- package/dist/dashboard/guide/nb.md +4 -2
- package/dist/dashboard/guide/nl.md +5 -3
- package/dist/dashboard/guide/pl.md +4 -2
- package/dist/dashboard/guide/pt.md +4 -2
- package/dist/dashboard/guide/ro.md +5 -3
- package/dist/dashboard/guide/ru.md +5 -3
- package/dist/dashboard/guide/sv.md +5 -3
- package/dist/dashboard/guide/tr.md +6 -4
- package/dist/dashboard/guide/uk.md +4 -2
- package/dist/dashboard/guide/zh.md +5 -3
- package/dist/dashboard/help/help.js +3 -3
- package/dist/dashboard/i18n/ar.json +4 -0
- package/dist/dashboard/i18n/cs.json +4 -0
- package/dist/dashboard/i18n/da.json +4 -0
- package/dist/dashboard/i18n/de.json +4 -0
- package/dist/dashboard/i18n/el.json +4 -0
- package/dist/dashboard/i18n/es.json +4 -0
- package/dist/dashboard/i18n/fi.json +4 -0
- package/dist/dashboard/i18n/fr.json +4 -0
- package/dist/dashboard/i18n/he.json +4 -0
- package/dist/dashboard/i18n/hi.json +4 -0
- package/dist/dashboard/i18n/hu.json +4 -0
- package/dist/dashboard/i18n/is.json +4 -0
- package/dist/dashboard/i18n/it.json +4 -0
- package/dist/dashboard/i18n/ja.json +5 -1
- package/dist/dashboard/i18n/ko.json +4 -0
- package/dist/dashboard/i18n/nb.json +4 -0
- package/dist/dashboard/i18n/nl.json +4 -0
- package/dist/dashboard/i18n/pl.json +4 -0
- package/dist/dashboard/i18n/pt.json +4 -0
- package/dist/dashboard/i18n/ro.json +4 -0
- package/dist/dashboard/i18n/ru.json +4 -0
- package/dist/dashboard/i18n/sv.json +4 -0
- package/dist/dashboard/i18n/tr.json +4 -0
- package/dist/dashboard/i18n/uk.json +4 -0
- package/dist/dashboard/i18n/zh.json +4 -0
- package/dist/dashboard/{journal.js → journal/journal.js} +16 -16
- package/dist/dashboard/{notes.js → journal/notes.js} +4 -4
- package/dist/dashboard/kit.js +3 -3
- package/dist/dashboard/packages/ask-card.js +3 -3
- package/dist/dashboard/packages/catalog.js +196 -0
- package/dist/dashboard/packages/engine.js +87 -0
- package/dist/dashboard/packages/installed.js +53 -0
- package/dist/dashboard/packages/library.js +97 -0
- package/dist/dashboard/packages/outcomes.js +45 -0
- package/dist/dashboard/packages/packages.js +20 -576
- package/dist/dashboard/packages/page-code.js +15 -2
- package/dist/dashboard/packages/{package-page.js → page.js} +12 -5
- package/dist/dashboard/packages/rows.js +84 -0
- package/dist/dashboard/packages/share.js +44 -0
- package/dist/dashboard/packages/widgets.js +3 -3
- package/dist/dashboard/{card.js → parts/card.js} +1 -1
- package/dist/dashboard/{faces.js → parts/faces.js} +5 -5
- package/dist/dashboard/{game-words.js → parts/game-words.js} +1 -1
- package/dist/dashboard/{icons.js → parts/icons.js} +1 -1
- package/dist/dashboard/{labels.js → parts/labels.js} +2 -1
- package/dist/dashboard/{map-symbols.js → parts/map-symbols.js} +1 -1
- package/dist/dashboard/{markdown.js → parts/markdown.js} +2 -2
- package/dist/dashboard/{mood.js → parts/mood.js} +1 -1
- package/dist/dashboard/{refusals.js → parts/refusals.js} +1 -1
- package/dist/dashboard/{status.js → parts/status.js} +4 -4
- package/dist/dashboard/{widgets.js → parts/widgets.js} +2 -2
- package/dist/dashboard/place/key.js +24 -0
- package/dist/dashboard/place/paper.js +67 -0
- package/dist/dashboard/place/{map-sheet.js → sheet.js} +2 -2
- package/dist/dashboard/place/things.js +129 -0
- package/dist/dashboard/place/tokens.js +93 -0
- package/dist/dashboard/place/view.js +124 -0
- package/dist/dashboard/{asked-dice.js → play/asked-dice.js} +3 -3
- package/dist/dashboard/{asked.js → play/asked.js} +10 -10
- package/dist/dashboard/{choices.js → play/choices.js} +9 -9
- package/dist/dashboard/{requested.js → play/requested.js} +1 -1
- package/dist/dashboard/{rolls.js → play/rolls.js} +9 -9
- package/dist/dashboard/{scene.js → play/scene.js} +14 -14
- package/dist/dashboard/{turns.js → play/turns.js} +12 -12
- package/dist/dashboard/{language-choice.js → settings/language-choice.js} +1 -1
- package/dist/dashboard/{languages.js → settings/languages.js} +1 -1
- package/dist/dashboard/{saves.js → settings/saves.js} +8 -8
- package/dist/dashboard/{settings.js → settings/settings.js} +17 -15
- package/dist/dashboard/{setup.js → settings/setup.js} +5 -5
- package/dist/dashboard/{party.js → sheet/party.js} +8 -8
- package/dist/dashboard/{person-panel.js → sheet/person-panel.js} +4 -4
- package/dist/dashboard/{sheet.js → sheet/sheet.js} +17 -17
- package/dist/dashboard/{story.js → sheet/story.js} +3 -3
- package/dist/dashboard/{columns.js → shell/columns.js} +1 -1
- package/dist/dashboard/{footer.js → shell/footer.js} +3 -3
- package/dist/dashboard/{master.js → shell/master.js} +2 -2
- package/dist/dashboard/{notices.js → shell/notices.js} +3 -3
- package/dist/dashboard/{pages.js → shell/pages.js} +5 -5
- package/dist/dashboard/shell/shown.js +37 -0
- package/dist/dashboard/{table.js → shell/table.js} +2 -2
- package/dist/dashboard/{tabs.js → shell/tabs.js} +2 -2
- package/dist/dashboard/{top.js → shell/top.js} +7 -7
- package/dist/dashboard/style.css +74 -3
- package/dist/dashboard/world/calendar.js +4 -4
- package/dist/dashboard/world/drawing.js +92 -0
- package/dist/dashboard/world/key.js +21 -0
- package/dist/dashboard/world/lore.js +5 -5
- package/dist/dashboard/world/map-card.js +186 -0
- package/dist/dashboard/world/place-card.js +39 -0
- package/dist/dashboard/world/places.js +29 -0
- package/dist/dashboard/world/world.js +9 -341
- package/dist/extensions/extension.d.ts +1 -1
- package/dist/extensions/extension.js +1 -1
- package/dist/images/images.js +12 -9
- package/dist/index.d.ts +1 -1
- package/dist/languages/index.d.ts +1 -1
- package/dist/languages/index.js +1 -1
- package/dist/packages/npm.js +1 -1
- package/dist/page.d.ts +2 -2
- package/dist/page.js +1 -1
- package/dist/pages/check.js +23 -1
- package/dist/pages/containers.d.ts +1 -1
- package/dist/pages/containers.js +1 -1
- package/dist/pages/index.d.ts +4 -2
- package/dist/pages/index.js +4 -2
- package/dist/pages/inheritance.d.ts +2 -2
- package/dist/pages/layers.d.ts +50 -0
- package/dist/pages/layers.js +97 -0
- package/dist/pages/rename-page.js +1 -1
- package/dist/pages/stacks/writes.js +48 -22
- package/dist/pages/standard-fields.d.ts +1 -1
- package/dist/pages/system-pages.d.ts +5 -3
- package/dist/pages/system-pages.js +16 -7
- package/dist/pages/world.d.ts +8 -1
- package/dist/pages/world.js +16 -4
- package/dist/pages/write-layer.d.ts +18 -0
- package/dist/pages/write-layer.js +108 -0
- package/dist/pages/write-page.d.ts +2 -2
- package/dist/pages/write-page.js +2 -2
- package/dist/rules/index.d.ts +1 -1
- package/dist/rules/index.js +1 -1
- package/dist/rules/search.d.ts +1 -1
- package/dist/rules/shown.d.ts +1 -1
- package/dist/server/dashboard/choices.js +3 -3
- package/dist/server/dashboard/files.js +5 -5
- package/dist/server/dashboard/index.d.ts +2 -2
- package/dist/server/dashboard/index.js +2 -2
- package/dist/server/dashboard/news.js +4 -3
- package/dist/server/dashboard/player.js +1 -1
- package/dist/server/dashboard/writes.js +9 -7
- package/dist/server/mcp.js +28 -13
- package/dist/systems/campaign-data.d.ts +15 -0
- package/dist/systems/campaign-data.js +85 -0
- package/dist/systems/{system-code.d.ts → code.d.ts} +1 -1
- package/dist/systems/{system-code.js → code.js} +2 -2
- package/dist/systems/game-system.d.ts +7 -61
- package/dist/systems/game-system.js +1 -984
- package/dist/systems/index.d.ts +6 -3
- package/dist/systems/index.js +6 -3
- package/dist/systems/installed.d.ts +31 -0
- package/dist/systems/installed.js +89 -0
- package/dist/systems/maps.d.ts +3 -0
- package/dist/systems/maps.js +9 -0
- package/dist/systems/read.d.ts +3 -0
- package/dist/systems/read.js +471 -0
- package/dist/systems/schema.d.ts +289 -0
- package/dist/systems/schema.js +243 -0
- package/dist/systems/settings.d.ts +19 -0
- package/dist/systems/settings.js +78 -0
- package/dist/systems/versions.d.ts +12 -0
- package/dist/systems/versions.js +52 -0
- package/dist/testing/index.js +1 -1
- package/instructions/import.md +1 -1
- package/instructions/play.md +1 -1
- package/package.json +1 -1
- package/dist/commands/config.js +0 -948
- package/dist/commands/package.d.ts +0 -143
- package/dist/commands/package.js +0 -785
- package/dist/commands/scene.js +0 -894
- package/dist/commands/shared/worked-out.js +0 -805
- package/dist/dashboard/place/map-view.js +0 -417
- /package/dist/commands/shared/{library-reader.d.ts → books/library-reader.d.ts} +0 -0
- /package/dist/core/{package-api.d.ts → packages/api.d.ts} +0 -0
- /package/dist/core/{package-api.js → packages/api.js} +0 -0
- /package/dist/dashboard/{coins.js → parts/coins.js} +0 -0
- /package/dist/dashboard/{glass.js → parts/glass.js} +0 -0
- /package/dist/dashboard/{layout.js → parts/layout.js} +0 -0
- /package/dist/dashboard/{mood-faces.js → parts/mood-faces.js} +0 -0
- /package/dist/dashboard/{free-rolls.js → play/free-rolls.js} +0 -0
- /package/dist/dashboard/{reactions.js → play/reactions.js} +0 -0
- /package/dist/dashboard/{prefs.js → shell/prefs.js} +0 -0
- /package/dist/dashboard/{system-style.js → shell/system-style.js} +0 -0
- /package/dist/dashboard/{theme.js → shell/theme.js} +0 -0
- /package/dist/languages/{language-pack.d.ts → pack.d.ts} +0 -0
- /package/dist/languages/{language-pack.js → pack.js} +0 -0
- /package/dist/pages/{page-file.d.ts → file.d.ts} +0 -0
- /package/dist/pages/{page-file.js → file.js} +0 -0
- /package/dist/pages/{page-types.d.ts → types.d.ts} +0 -0
- /package/dist/pages/{page-types.js → types.js} +0 -0
- /package/dist/rules/{rule-book.d.ts → book.d.ts} +0 -0
- /package/dist/rules/{rule-book.js → book.js} +0 -0
- /package/dist/systems/{system-folders.d.ts → folders.d.ts} +0 -0
- /package/dist/systems/{system-folders.js → folders.js} +0 -0
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
"add a die to the die {condition}": "{condition} aynı zara bir zar daha ekle",
|
|
144
144
|
"Add to {setting}": "{setting} ayarına ekle",
|
|
145
145
|
"Add what you know, e.g. Initiative": "Bildiklerini ekle, örneğin inisiyatif",
|
|
146
|
+
"Add, e.g. leave one alive": "Ekle, örn. birini sağ bırakın",
|
|
146
147
|
"Add, e.g. spiders": "Ekle, örneğin örümcekler",
|
|
147
148
|
"Add, e.g. torture": "Ekle, örneğin işkence",
|
|
148
149
|
"Add…": "Ekle…",
|
|
@@ -874,6 +875,7 @@
|
|
|
874
875
|
"south-south-west": "güney-güneybatı",
|
|
875
876
|
"south-west": "güneybatı",
|
|
876
877
|
"spring": "ilkbahar",
|
|
878
|
+
"Standing orders": "Kalıcı emirler",
|
|
877
879
|
"Start a new chat in the campaign, as you always do.": "Her zamanki gibi kampanyada yeni bir sohbet başlat.",
|
|
878
880
|
"Start over": "Baştan başla",
|
|
879
881
|
"Start the campaign over?": "Kampanya baştan başlatılsın mı?",
|
|
@@ -1000,6 +1002,7 @@
|
|
|
1000
1002
|
"The note was not saved: try again.": "Not kaydedilmedi: tekrar dene.",
|
|
1001
1003
|
"The note's title": "Notun başlığı",
|
|
1002
1004
|
"The order of the turns": "Sıra düzeni",
|
|
1005
|
+
"the orders you give your companions, kept until you lift one": "yoldaşlarına verdiğin emirler, sen kaldırana kadar geçerli kalır",
|
|
1003
1006
|
"The page stays in English: Codex or Claude Code would translate it into {language} on this computer.": "Sayfa İngilizce kalır: Codex veya Claude Code bu bilgisayarda sayfayı {language} diline çevirebilir.",
|
|
1004
1007
|
"The page's": "Sayfanın",
|
|
1005
1008
|
"the page's look": "sayfanın görünümü",
|
|
@@ -1192,6 +1195,7 @@
|
|
|
1192
1195
|
"your character never dies": "karakterin asla ölmez",
|
|
1193
1196
|
"Your character's story and look, in your words. It goes to the master, who writes it in your page with you.": "Karakterinin hikâyesi ve görünüşü, senin sözlerinle. Oyun yöneticisine gider; o da seninle birlikte sayfana yazar.",
|
|
1194
1197
|
"Your choice": "Senin seçimin",
|
|
1198
|
+
"Your companions": "Yoldaşların",
|
|
1195
1199
|
"Your free roll, not logged:": "Serbest atışın, kayda geçmedi:",
|
|
1196
1200
|
"Your game": "Oyunun",
|
|
1197
1201
|
"your own wishes for how the master writes, in a few words, such as third person, past tense": "oyun yöneticisinin nasıl yazmasını istediğin, birkaç sözcükle, örneğin üçüncü kişi, geçmiş zaman",
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
"add a die to the die {condition}": "додати ще один кидок до цього кубика {condition}",
|
|
144
144
|
"Add to {setting}": "Додати до {setting}",
|
|
145
145
|
"Add what you know, e.g. Initiative": "Додай те, що знаєш, наприклад, ініціативу",
|
|
146
|
+
"Add, e.g. leave one alive": "Додай, наприклад: залиште одного живим",
|
|
146
147
|
"Add, e.g. spiders": "Додай, наприклад, павуків",
|
|
147
148
|
"Add, e.g. torture": "Додай, наприклад, катування",
|
|
148
149
|
"Add…": "Додати…",
|
|
@@ -874,6 +875,7 @@
|
|
|
874
875
|
"south-south-west": "південно-південний захід",
|
|
875
876
|
"south-west": "південний захід",
|
|
876
877
|
"spring": "весна",
|
|
878
|
+
"Standing orders": "Постійні накази",
|
|
877
879
|
"Start a new chat in the campaign, as you always do.": "Почни новий чат у кампанії, як завжди.",
|
|
878
880
|
"Start over": "Почати знову",
|
|
879
881
|
"Start the campaign over?": "Почати кампанію знову?",
|
|
@@ -1000,6 +1002,7 @@
|
|
|
1000
1002
|
"The note was not saved: try again.": "Нотатку не збережено: спробуй ще раз.",
|
|
1001
1003
|
"The note's title": "Заголовок нотатки",
|
|
1002
1004
|
"The order of the turns": "Порядок ходів",
|
|
1005
|
+
"the orders you give your companions, kept until you lift one": "накази, які ти даєш своїм супутникам, діють, доки ти їх не скасуєш",
|
|
1003
1006
|
"The page stays in English: Codex or Claude Code would translate it into {language} on this computer.": "Сторінка залишається англійською: Codex або Claude Code могли б перекласти її мовою «{language}» на цьому комп'ютері.",
|
|
1004
1007
|
"The page's": "Сторінки",
|
|
1005
1008
|
"the page's look": "вигляд сторінки",
|
|
@@ -1192,6 +1195,7 @@
|
|
|
1192
1195
|
"your character never dies": "твій персонаж ніколи не гине",
|
|
1193
1196
|
"Your character's story and look, in your words. It goes to the master, who writes it in your page with you.": "Історія й вигляд твого персонажа твоїми словами. Вона надходить майстру, який запише її на твою сторінку разом із тобою.",
|
|
1194
1197
|
"Your choice": "Твій вибір",
|
|
1198
|
+
"Your companions": "Твої супутники",
|
|
1195
1199
|
"Your free roll, not logged:": "Твій вільний кидок, не записаний:",
|
|
1196
1200
|
"Your game": "Твоя гра",
|
|
1197
1201
|
"your own wishes for how the master writes, in a few words, such as third person, past tense": "твої побажання до того, як пише майстер, кількома словами, наприклад: третя особа, минулий час",
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
"add a die to the die {condition}": "{condition}时给该骰子追加一次掷骰",
|
|
144
144
|
"Add to {setting}": "添加到{setting}",
|
|
145
145
|
"Add what you know, e.g. Initiative": "添加你已了解的,例如先攻",
|
|
146
|
+
"Add, e.g. leave one alive": "添加,例如:留一个活口",
|
|
146
147
|
"Add, e.g. spiders": "添加,例如蜘蛛",
|
|
147
148
|
"Add, e.g. torture": "添加,例如酷刑",
|
|
148
149
|
"Add…": "添加…",
|
|
@@ -874,6 +875,7 @@
|
|
|
874
875
|
"south-south-west": "西南偏南",
|
|
875
876
|
"south-west": "西南",
|
|
876
877
|
"spring": "春季",
|
|
878
|
+
"Standing orders": "长期指令",
|
|
877
879
|
"Start a new chat in the campaign, as you always do.": "像平常一样,在战役中开始一个新聊天。",
|
|
878
880
|
"Start over": "重新开始",
|
|
879
881
|
"Start the campaign over?": "重新开始战役?",
|
|
@@ -1000,6 +1002,7 @@
|
|
|
1000
1002
|
"The note was not saved: try again.": "笔记没有保存:请重试。",
|
|
1001
1003
|
"The note's title": "笔记标题",
|
|
1002
1004
|
"The order of the turns": "回合顺序",
|
|
1005
|
+
"the orders you give your companions, kept until you lift one": "你给同伴下达的指令,撤销前一直有效",
|
|
1003
1006
|
"The page stays in English: Codex or Claude Code would translate it into {language} on this computer.": "页面仍显示英文:可由这台电脑上的 Codex 或 Claude Code 将其翻译成{language}。",
|
|
1004
1007
|
"The page's": "页面的",
|
|
1005
1008
|
"the page's look": "页面外观",
|
|
@@ -1192,6 +1195,7 @@
|
|
|
1192
1195
|
"your character never dies": "你的角色永不死亡",
|
|
1193
1196
|
"Your character's story and look, in your words. It goes to the master, who writes it in your page with you.": "用你自己的话写下角色的故事和外貌。内容会发给主持人,由主持人和你一起写进页面。",
|
|
1194
1197
|
"Your choice": "你的选择",
|
|
1198
|
+
"Your companions": "你的同伴",
|
|
1195
1199
|
"Your free roll, not logged:": "你的自由掷骰,不记录:",
|
|
1196
1200
|
"Your game": "你的游戏",
|
|
1197
1201
|
"your own wishes for how the master writes, in a few words, such as third person, past tense": "用几个词写下你希望主持人怎么写,例如第三人称、过去时",
|
|
@@ -4,21 +4,21 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
4
4
|
// small beside the page, or in Scene and Combat on a narrow screen; the story by its scenes, as chapters, the last first, each with what the diary tells of it; the companions'
|
|
5
5
|
// diaries (D-497); and the player's own notes.
|
|
6
6
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
7
|
-
import { sectionAddress } from "
|
|
8
|
-
import { pictureAddress, readJournal } from "
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
7
|
+
import { sectionAddress } from "../address.js";
|
|
8
|
+
import { pictureAddress, readJournal } from "../api.js";
|
|
9
|
+
import { WidgetCards } from "../packages/widgets.js";
|
|
10
|
+
import { CardHeader, useOpen } from "../parts/card.js";
|
|
11
|
+
import { byDateLabel, factLabel, gameDateLabel } from "../parts/game-words.js";
|
|
12
|
+
import { Icon, iconPath } from "../parts/icons.js";
|
|
13
|
+
import { fieldLabel, phraseLabel, sceneTypeLabel } from "../parts/labels.js";
|
|
14
|
+
import { endedQuests, followedQuests, keptFollowed } from "../parts/layout.js";
|
|
15
|
+
import { placeKinds } from "../parts/map-symbols.js";
|
|
16
|
+
import { knowersOf, Markdown } from "../parts/markdown.js";
|
|
17
|
+
import { PageHead } from "../shell/pages.js";
|
|
18
|
+
import { useChoice, useKeptText } from "../shell/prefs.js";
|
|
19
|
+
import { PageTabs } from "../shell/tabs.js";
|
|
20
|
+
import { arrowStep, t } from "../text.js";
|
|
16
21
|
import { Notes } from "./notes.js";
|
|
17
|
-
import { WidgetCards } from "./packages/widgets.js";
|
|
18
|
-
import { PageHead } from "./pages.js";
|
|
19
|
-
import { useChoice, useKeptText } from "./prefs.js";
|
|
20
|
-
import { PageTabs } from "./tabs.js";
|
|
21
|
-
import { arrowStep, t } from "./text.js";
|
|
22
22
|
// The tab the player last chose, kept in this browser.
|
|
23
23
|
const tabChoice = { key: "rpg-engine.journal-tab", initial: "quests", values: ["quests", "story", "companions", "notes"] };
|
|
24
24
|
/** The Journal: the tab the player last chose, or the one the address says, as #/journal/story, and a chapter in the story, as #/journal/story/3. */
|
|
@@ -126,7 +126,7 @@ function TrackedQuest({ quest, onUnfollow }) {
|
|
|
126
126
|
const next = quest.goals.find((goal) => !goal.done);
|
|
127
127
|
const id = `tracked-${quest.name.replace(/[^\p{L}\p{N}]+/gu, "-")}`;
|
|
128
128
|
const kind = quest.main ? t("Main") : t("Side quest");
|
|
129
|
-
return (_jsxs("li", { class: open ? "tracked open" : "tracked", children: [_jsx("span", { class: "tracked-mark", role: "img", "aria-label": kind, "data-tip": kind, children: _jsx("svg", { class: quest.main ? "main" : undefined, viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: questFlag }) }) }), _jsxs("button", { type: "button", class: "tracked-what", "aria-expanded": open, "aria-controls": id, onClick: toggle, children: [_jsx("span", { class: "followed-name", children: quest.name }), !open && next !== undefined && _jsx("span", { class: "followed-next", dir: "auto", children: plainText(next.text) })] }), _jsxs("span", { class: "tracked-time", children: [quest.clock !== undefined && _jsx(ClockTip, { clock: quest.clock }), quest.deadline !== undefined && _jsx(Deadline, { deadline: quest.deadline })] }), open && (_jsxs("div", { class: "tracked-more", id: id, children: [_jsx(Goals, { quest: quest }), _jsx("button", { type: "button", class: "tracked-unfollow", onClick: onUnfollow, children: t("Stop following") })] }))] }));
|
|
129
|
+
return (_jsxs("li", { class: open ? "tracked open" : "tracked", children: [_jsx("span", { class: "tracked-mark", role: "img", "aria-label": kind, "data-tip": kind, children: _jsx("svg", { class: quest.main ? "main" : undefined, viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: questFlag }) }) }), _jsxs("button", { type: "button", class: "tracked-what", "aria-expanded": open, "aria-controls": id, onClick: toggle, children: [_jsx("span", { class: "followed-name", children: quest.name }), !open && next !== undefined && _jsx("span", { class: "followed-next", dir: "auto", title: plainText(next.text), children: plainText(next.text) })] }), _jsxs("span", { class: "tracked-time", children: [quest.clock !== undefined && _jsx(ClockTip, { clock: quest.clock }), quest.deadline !== undefined && _jsx(Deadline, { deadline: quest.deadline })] }), open && (_jsxs("div", { class: "tracked-more", id: id, children: [_jsx(Goals, { quest: quest }), _jsx("button", { type: "button", class: "tracked-unfollow", onClick: onUnfollow, children: t("Stop following") })] }))] }));
|
|
130
130
|
}
|
|
131
131
|
/** A quest's clock, small, with its name and count as its tooltip. */
|
|
132
132
|
function ClockTip({ clock }) {
|
|
@@ -136,7 +136,7 @@ function ClockTip({ clock }) {
|
|
|
136
136
|
/** One followed quest as a strip, on a narrow screen: its star, which stops following it, its picture, its name and next goal leading to the Journal, its clock and time left. */
|
|
137
137
|
function FollowedStrip({ quest, onUnfollow }) {
|
|
138
138
|
const next = quest.goals.find((goal) => !goal.done);
|
|
139
|
-
return (_jsxs("div", { class: "followed", children: [_jsx("button", { type: "button", class: "followed-star on", "aria-label": t("Follow {quest}", { quest: quest.name }), "aria-pressed": true, onClick: onUnfollow, children: _jsx(Star, {}) }), _jsx(QuestFace, { quest: quest, small: true }), _jsxs("a", { class: "followed-what", href: sectionAddress("journal"), children: [_jsx("span", { class: "followed-name", children: quest.name }), next !== undefined && _jsx("span", { class: "followed-next", dir: "auto", children: plainText(next.text) })] }), quest.clock !== undefined && _jsx(ClockFace, { clock: quest.clock, small: true }), quest.deadline !== undefined && _jsx(Deadline, { deadline: quest.deadline })] }));
|
|
139
|
+
return (_jsxs("div", { class: "followed", children: [_jsx("button", { type: "button", class: "followed-star on", "aria-label": t("Follow {quest}", { quest: quest.name }), "aria-pressed": true, onClick: onUnfollow, children: _jsx(Star, {}) }), _jsx(QuestFace, { quest: quest, small: true }), _jsxs("a", { class: "followed-what", href: sectionAddress("journal"), children: [_jsx("span", { class: "followed-name", children: quest.name }), next !== undefined && _jsx("span", { class: "followed-next", dir: "auto", title: plainText(next.text), children: plainText(next.text) })] }), quest.clock !== undefined && _jsx(ClockFace, { clock: quest.clock, small: true }), quest.deadline !== undefined && _jsx(Deadline, { deadline: quest.deadline })] }));
|
|
140
140
|
}
|
|
141
141
|
/** A quest's goals, done ones ticked; a failed quest's undone ones marked missed. */
|
|
142
142
|
function Goals({ quest }) {
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
2
2
|
// The player's notes (D-371), a tab of the Journal: free notes, a title and a text each, saved by themselves as the player writes, kept outside the game; one may
|
|
3
3
|
// be shared with the master, who hears it at their next call, and taken back until then (D-381).
|
|
4
4
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
5
|
-
import { readNotes, sendNote } from "
|
|
6
|
-
import { Icon } from "
|
|
7
|
-
import { realTimeLabel } from "
|
|
8
|
-
import { t } from "
|
|
5
|
+
import { readNotes, sendNote } from "../api.js";
|
|
6
|
+
import { Icon } from "../parts/icons.js";
|
|
7
|
+
import { realTimeLabel } from "../parts/labels.js";
|
|
8
|
+
import { t } from "../text.js";
|
|
9
9
|
// How long the page waits after the last key before it saves a note, in milliseconds.
|
|
10
10
|
const savePause = 800;
|
|
11
11
|
export function Notes({ version }) {
|
package/dist/dashboard/kit.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "preact/jsx-runtime";
|
|
2
2
|
import { useContext } from "preact/hooks";
|
|
3
|
-
import { NotationIcons } from "./icons.js";
|
|
4
3
|
import { PeopleContext } from "./packages/people.js";
|
|
5
4
|
import { Drawn, Text } from "./packages/widgets.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { NotationIcons } from "./parts/icons.js";
|
|
6
|
+
import { sideOf, Token } from "./sheet/party.js";
|
|
8
7
|
export { Choices } from "./packages/ask-card.js";
|
|
9
8
|
export { cardPages } from "./packages/page-code.js";
|
|
10
9
|
export { Text, Track, Value, Who } from "./packages/widgets.js";
|
|
10
|
+
export { statusIcons } from "./parts/icons.js";
|
|
11
11
|
/** A button of words, as the page's: gold for the one main action, quiet for a secondary one, danger for one that loses something. */
|
|
12
12
|
export function Button({ children, onClick, kind, disabled, tip }) {
|
|
13
13
|
return (_jsx("button", { type: "button", class: kind === undefined ? "button" : `button ${kind}`, "aria-disabled": disabled === true ? "true" : undefined, "data-tip": tip, onClick: () => disabled !== true && onClick(), children: children }));
|
|
@@ -4,10 +4,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
4
4
|
// asks for, and the rule; once the dice have spoken, the outcome where the buttons were. Its extension's page code may draw the middle's figure, or the
|
|
5
5
|
// whole inside, the frame staying the page's (D-510). What the dice changed moves once they land; the card stays until the player closes it.
|
|
6
6
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
7
|
-
import { Icon, NotationIcons } from "../icons.js";
|
|
8
|
-
import { checkOf, fieldLabel } from "../labels.js";
|
|
7
|
+
import { Icon, NotationIcons } from "../parts/icons.js";
|
|
8
|
+
import { checkOf, fieldLabel } from "../parts/labels.js";
|
|
9
|
+
import { turnWords } from "../play/turns.js";
|
|
9
10
|
import { t } from "../text.js";
|
|
10
|
-
import { turnWords } from "../turns.js";
|
|
11
11
|
import { cardLayout, labelKey, trackChanges } from "./card.js";
|
|
12
12
|
import { deepQuery, ExtensionRoot, figureSize, pagePropsOf, usePageModule } from "./page-code.js";
|
|
13
13
|
import { Drawn, OwnerContext, Part, Text, textOf, Track, Who } from "./widgets.js";
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "preact/hooks";
|
|
3
|
+
import { useMedia } from "../parts/card.js";
|
|
4
|
+
import { Icon } from "../parts/icons.js";
|
|
5
|
+
import { phraseLabel, systemNameLabel } from "../parts/labels.js";
|
|
6
|
+
import { languageName } from "../settings/languages.js";
|
|
7
|
+
import { arrowStep, foldedText, isolated, pageDirection, t } from "../text.js";
|
|
8
|
+
import { PackageRow, pageLanguage, SaidNote, Trust, WorkNote } from "./rows.js";
|
|
9
|
+
// The rows of the catalog shown before "Show more": fewer on a phone, where the installed come after it.
|
|
10
|
+
const shownWide = 5;
|
|
11
|
+
const shownNarrow = 3;
|
|
12
|
+
/**
|
|
13
|
+
* The one field that adds (D-485 (1)): a link, a GitHub repository's too, an npm name or a folder written by hand, as the browser gives no folder's path; or a
|
|
14
|
+
* file. The field keeps the focus and what was written while the work goes; it empties once added.
|
|
15
|
+
*/
|
|
16
|
+
export function AddField({ state, onAdd, onFile }) {
|
|
17
|
+
const [source, setSource] = useState("");
|
|
18
|
+
const [empty, setEmpty] = useState(false);
|
|
19
|
+
const picker = useRef(null);
|
|
20
|
+
const sent = useRef(undefined);
|
|
21
|
+
// Added: the field is ready for the next one.
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (state.said?.problem === false && sent.current === source) {
|
|
24
|
+
setSource("");
|
|
25
|
+
}
|
|
26
|
+
}, [state.said]);
|
|
27
|
+
const submit = () => {
|
|
28
|
+
// A path copied with its quotes, as the file manager copies it, without them; an address copied without its scheme, as github.com/someone/an-adventure, as https.
|
|
29
|
+
const given = source.trim().replace(/^"(.*)"$/, "$1").replace(/^(?=[\w-]+(?:\.[\w-]+)+\/)/, "https://");
|
|
30
|
+
if (state.busy) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
setEmpty(given === "");
|
|
34
|
+
if (given !== "") {
|
|
35
|
+
sent.current = source;
|
|
36
|
+
onAdd(given);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return (_jsxs("form", { class: "package-add", noValidate: true, onSubmit: (event) => {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
submit();
|
|
42
|
+
}, children: [_jsx("label", { class: "package-label", for: "package-source", children: t("From a link, an npm name or a folder of this computer") }), _jsxs("div", { class: "package-add-line", children: [_jsx("input", { id: "package-source", dir: "auto", type: "text", inputMode: "url", enterKeyHint: "go", autocomplete: "off", spellcheck: false, maxLength: 2000, value: source, readOnly: state.work !== undefined, "aria-invalid": state.said?.problem === true || empty, "aria-describedby": "package-source-about", placeholder: t("github.com/someone/an-adventure"), onInput: (event) => setSource(event.currentTarget.value) }), _jsxs("button", { type: "submit", class: "button package-button", "aria-disabled": state.busy, children: [_jsx(Icon, { name: "plus" }), t("Add")] }), _jsxs("button", { type: "button", class: "button package-button", "aria-disabled": state.busy, onClick: () => !state.busy && picker.current?.click(), children: [_jsx(Icon, { name: "file" }), t("From a file…")] }), _jsx("input", { ref: picker, type: "file", accept: ".zip,.tgz,.gz,application/zip,application/gzip", hidden: true, onChange: (event) => {
|
|
43
|
+
const file = event.currentTarget.files?.[0];
|
|
44
|
+
event.currentTarget.value = "";
|
|
45
|
+
if (file !== undefined) {
|
|
46
|
+
onFile(file);
|
|
47
|
+
}
|
|
48
|
+
} })] }), _jsx("p", { class: "package-note", id: "package-source-about", children: t("It tells the kind by itself: a game system, an adventure, an extension or a language. A file is a .zip or a .tgz.") }), empty && state.work === undefined && _jsx("p", { class: "package-said problem", role: "status", children: t("Write a link, an npm name or a folder first.") }), _jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said, onSee: state.onSee })] }));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The catalog (D-486), always open: a search, chips for the kinds with how many each has, wrapping on a phone; the first rows, five or three on a phone, then
|
|
52
|
+
* the others on asking. A source that does not answer is said in the page's words, with its own under them.
|
|
53
|
+
*/
|
|
54
|
+
export function CatalogList({ catalog, view, state, needs, onAdd, onUpdate, onRetry }) {
|
|
55
|
+
const [kind, setKind] = useState("all");
|
|
56
|
+
const [query, setQuery] = useState("");
|
|
57
|
+
const [all, setAll] = useState(false);
|
|
58
|
+
const narrow = useMedia("(max-width: 600px)");
|
|
59
|
+
const list = useRef(null);
|
|
60
|
+
const chips = useRef(null);
|
|
61
|
+
const limit = narrow ? shownNarrow : shownWide;
|
|
62
|
+
const entries = catalog.read?.entries ?? [];
|
|
63
|
+
const found = entries.filter((entry) => matchesQuery(entry, query));
|
|
64
|
+
const kinds = kindOrder.filter((one) => entries.some((entry) => entry.kind === one));
|
|
65
|
+
const chosen = kinds.includes(kind) ? kind : "all";
|
|
66
|
+
const shown = found.filter((entry) => chosen === "all" || entry.kind === chosen);
|
|
67
|
+
// A row past the first ones stays in view while it is worked on or says what happened, as after a reload.
|
|
68
|
+
const visible = all ? shown : shown.filter((entry, index) => index < limit || state(entry).work !== undefined || state(entry).said !== undefined);
|
|
69
|
+
const failed = catalog.error === undefined ? catalog.read?.failed ?? {} : { npm: catalog.error, github: catalog.error };
|
|
70
|
+
// The rows asked for come after those shown: the focus goes to the first of them.
|
|
71
|
+
const showAll = () => {
|
|
72
|
+
setAll(true);
|
|
73
|
+
requestAnimationFrame(() => list.current?.children[limit]?.focus());
|
|
74
|
+
};
|
|
75
|
+
// The chips are one stop of Tab; the arrows go along them, as the page reads.
|
|
76
|
+
const chipKey = (event) => {
|
|
77
|
+
const buttons = [...chips.current?.querySelectorAll("button") ?? []];
|
|
78
|
+
const at = buttons.indexOf(event.target);
|
|
79
|
+
const step = arrowStep(event.key, true);
|
|
80
|
+
const to = event.key === "Home" ? 0 : event.key === "End" ? buttons.length - 1 : step === 0 ? -1 : (at + step + buttons.length) % buttons.length;
|
|
81
|
+
if (to >= 0) {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
buttons[to]?.focus();
|
|
84
|
+
buttons[to]?.click();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const chip = (one, count) => (_jsxs("button", { type: "button", "aria-pressed": chosen === one, tabIndex: chosen === one ? 0 : -1, onClick: () => setKind(one), children: [one === "all" ? t("All") : kindsLabel(one), _jsx("span", { class: "package-count", children: count })] }, one));
|
|
88
|
+
return (_jsxs("div", { class: "package-catalog", children: [_jsxs("div", { class: "package-catalog-head", children: [_jsx("h4", { class: "eyebrow package-sub", id: "package-catalog-title", children: t("Catalog") }), entries.length > 0 && (_jsxs("span", { class: "search", children: [_jsx(Icon, { name: "search" }), _jsx("input", { type: "search", value: query, placeholder: t("Search"), "aria-label": t("Search the catalog"), onInput: (event) => setQuery(event.currentTarget.value) })] }))] }), kinds.length > 1 && (_jsxs("div", { class: "filter-chips", role: "group", "aria-label": t("Kind"), ref: chips, onKeyDown: chipKey, children: [chip("all", found.length), kinds.map((one) => chip(one, found.filter((entry) => entry.kind === one).length))] })), (failed.npm !== undefined || failed.github !== undefined) && _jsx(CatalogAway, { failed: failed, asking: catalog.asking, onRetry: onRetry }), catalog.asking && catalog.read === undefined && catalog.error === undefined && _jsx("p", { class: "package-note", role: "status", children: t("Asking npm and GitHub…") }), !catalog.asking && entries.length === 0 && failed.npm === undefined && failed.github === undefined && _jsx("p", { class: "package-note", children: t("Nothing to add for now.") }), entries.length > 0 && shown.length === 0 && _jsx("p", { class: "package-note", children: t("Nothing matches “{query}”.", { query: query.trim() }) }), visible.length > 0 && (_jsx("ul", { class: "package-list", ref: list, "aria-labelledby": "package-catalog-title", children: visible.map((entry) => (_jsx(CatalogRow, { entry: entry, named: chosen === "all", view: view, state: state(entry), needs: needs(entry), onAdd: () => onAdd(entry), onUpdate: () => onUpdate(entry) }, `${entry.kind}:${entry.source}`))) })), shown.length > visible.length && (_jsxs("button", { type: "button", class: "package-show", onClick: showAll, children: [t("Show the other {count}", { count: shown.length - visible.length }), _jsx(Icon, { name: "more" })] }))] }));
|
|
89
|
+
}
|
|
90
|
+
/** npm's newer version of a package here, as the catalog says it. */
|
|
91
|
+
export function newerOf(name, kind, catalog) {
|
|
92
|
+
const entry = entryOf(name, kind, catalog);
|
|
93
|
+
return entry?.update === true ? entry.version : undefined;
|
|
94
|
+
}
|
|
95
|
+
/** A package here as the catalog has it. */
|
|
96
|
+
export function entryOf(name, kind, catalog) {
|
|
97
|
+
return catalog?.entries.find((one) => one.kind === kind && samePackage(one, name));
|
|
98
|
+
}
|
|
99
|
+
/** How many packages here npm has a newer version of: the count on the Installed tab. */
|
|
100
|
+
export function updateCount(view, catalog) {
|
|
101
|
+
const systems = (view.systems ?? []).filter((one) => one.package !== undefined && newerOf(one.package, "system", catalog) !== undefined);
|
|
102
|
+
const extensions = view.installed.filter((one) => newerOf(one.package, "extension", catalog) !== undefined);
|
|
103
|
+
const languages = (view.languages ?? []).filter((one) => newerOf(one.package, "language", catalog) !== undefined);
|
|
104
|
+
return systems.length + extensions.length + languages.length;
|
|
105
|
+
}
|
|
106
|
+
/** A catalog's title: an adventure's as its author wrote it; an npm package's name with its first letter a capital, as the rows of what is here. */
|
|
107
|
+
export function entryTitle(entry) {
|
|
108
|
+
// A language by its code, as lang-de: named in the page's language.
|
|
109
|
+
const code = entry.kind === "language" ? /^(?:lang-)?([a-z]{2,3}(?:-[a-z0-9]+)?)$/i.exec(entry.title)?.[1] : undefined;
|
|
110
|
+
const language = code === undefined ? undefined : languageName(code, pageLanguage());
|
|
111
|
+
return entry.kind === "adventure" ? entry.title : phraseLabel(language ?? entry.title);
|
|
112
|
+
}
|
|
113
|
+
/** npm or GitHub away, or both: the rest is added all the same; the engine's words under the page's, and Try again. */
|
|
114
|
+
function CatalogAway({ failed, asking, onRetry }) {
|
|
115
|
+
const both = failed.npm !== undefined && failed.github !== undefined;
|
|
116
|
+
const [headline, line] = both
|
|
117
|
+
? [t("The catalog does not answer."), t("A file, a link or a folder can be added all the same.")]
|
|
118
|
+
: failed.npm !== undefined
|
|
119
|
+
? [t("npm does not answer."), t("Game systems, extensions and languages come from npm: a file, a link or a folder can be added all the same.")]
|
|
120
|
+
: [t("GitHub does not answer."), t("The catalog's adventures come from GitHub: a .zip or a link can be added all the same.")];
|
|
121
|
+
const why = [...new Set([failed.npm, failed.github].filter((one) => one !== undefined))];
|
|
122
|
+
return (_jsxs("div", { class: "package-offline", role: "status", children: [_jsx(Icon, { name: "offline" }), _jsxs("div", { children: [_jsxs("p", { children: [_jsx("strong", { children: headline }), " ", line] }), why.map((one) => (_jsx("p", { class: "package-why", children: _jsx("bdi", { children: one }) }, one))), _jsxs("button", { type: "button", class: "button package-button", "aria-disabled": asking, onClick: () => !asking && onRetry(), children: [_jsx(Icon, { name: "update" }), t("Try again")] })] })] }));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A row of the catalog (D-486 (4)): its tile, its title with its kind in All and whose it is, a line of what it is, its facts; then what can be done: add it,
|
|
126
|
+
* with "…" when a window will ask the player's yes; update it; download a game system for a new campaign; or where it is already.
|
|
127
|
+
*/
|
|
128
|
+
function CatalogRow({ entry, named, view, state, needs, onAdd, onUpdate }) {
|
|
129
|
+
const here = hereState(entry, view);
|
|
130
|
+
const asksYes = !entry.verified && entry.code;
|
|
131
|
+
// An extension made for another game system than the campaign's says so in the place of Add: it would be refused once downloaded (D-548).
|
|
132
|
+
const elsewhere = entry.kind === "extension" && entry.system !== undefined && view.system !== null && foldedText(entry.system) !== foldedText(view.system.name);
|
|
133
|
+
const facts = [
|
|
134
|
+
entry.author !== undefined && !entry.verified && !entry.code ? t("by {author}", { author: entry.author }) : "",
|
|
135
|
+
entry.levels === undefined ? "" : levelsText(entry.levels),
|
|
136
|
+
entry.length ?? "",
|
|
137
|
+
entry.language === undefined ? "" : languageName(entry.language, pageLanguage()) ?? entry.language,
|
|
138
|
+
entry.stars === undefined || entry.stars === 0 ? "" : `★ ${entry.stars}`,
|
|
139
|
+
asksYes ? t("has code: asks your yes") : "",
|
|
140
|
+
entry.kind === "system" && here === "none" && view.system !== null ? t("for a new campaign: this one stays in {system}", { system: systemNameLabel(view.system.name) }) : "",
|
|
141
|
+
].filter((fact) => fact !== "");
|
|
142
|
+
const version = entry.update && entry.installed !== undefined && entry.version !== undefined
|
|
143
|
+
? (_jsxs("span", { class: "package-update", children: [_jsx(Icon, { name: "update" }), `${isolated(entry.installed)} ${pageDirection() === "rtl" ? "←" : "→"} ${isolated(entry.version)}`] }))
|
|
144
|
+
: entry.version;
|
|
145
|
+
const action = (word, label, icon, onClick, accent = false) => (_jsxs("button", { type: "button", class: accent ? "button package-button accent" : "button package-button", "aria-label": label, "aria-disabled": state.busy, onClick: () => !state.busy && onClick(), children: [_jsx(Icon, { name: icon }), word] }));
|
|
146
|
+
return (_jsxs(PackageRow, { tile: kindIcon[entry.kind], tone: entry.kind === "adventure" ? "cover" : undefined, name: entryTitle(entry), badges: _jsxs(_Fragment, { children: [named && _jsx("span", { class: "package-kind", children: kindLabel(entry.kind) }), _jsx(Trust, { verified: entry.verified, code: entry.code, author: entry.author })] }), about: entry.description === undefined || entry.kind === "adventure" ? entry.description : phraseLabel(entry.description), meta: (version !== undefined || facts.length > 0) && (_jsxs(_Fragment, { children: [version, version !== undefined && facts.length > 0 && " · ", facts.map(isolated).join(" · ")] })), needs: needs, focusable: true, actions: entry.update && entry.kind !== "adventure"
|
|
147
|
+
? action(t("Update"), t("Update {name} to {version}", { name: entryTitle(entry), version: entry.version ?? "" }), "update", onUpdate, true)
|
|
148
|
+
: here === "used" || (here === "here" && entry.kind !== "extension")
|
|
149
|
+
? (_jsxs("span", { class: "package-here", children: [_jsx(Icon, { name: "check" }), entry.kind === "adventure" || entry.kind === "extension" ? t("In the campaign") : t("On this computer")] }))
|
|
150
|
+
: elsewhere && here === "none"
|
|
151
|
+
? (_jsxs("span", { class: "package-here", children: [_jsx(Icon, { name: "lock" }), t("for {system}: this campaign plays {campaign}", { system: entry.system ?? "", campaign: view.system === null ? "" : systemNameLabel(view.system.name) })] }))
|
|
152
|
+
: entry.kind === "system" && here === "none"
|
|
153
|
+
? action(t("Download"), t("Download {name}", { name: entryTitle(entry) }), "download", onAdd)
|
|
154
|
+
: action(asksYes ? t("Add…") : t("Add"), t("Add {name}", { name: entryTitle(entry) }), "plus", onAdd), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said, onSee: state.onSee })] }));
|
|
155
|
+
}
|
|
156
|
+
// The kinds in the order of the chips, each with its tile.
|
|
157
|
+
const kindOrder = ["system", "adventure", "extension", "language"];
|
|
158
|
+
const kindIcon = { system: "dice", adventure: "world", extension: "packages", language: "language" };
|
|
159
|
+
/** A kind, for one package. */
|
|
160
|
+
function kindLabel(kind) {
|
|
161
|
+
const labels = { system: t("System"), adventure: t("Adventure"), extension: t("Extension"), language: t("Language") };
|
|
162
|
+
return labels[kind];
|
|
163
|
+
}
|
|
164
|
+
/** A kind, for its chip. */
|
|
165
|
+
function kindsLabel(kind) {
|
|
166
|
+
const labels = { system: t("Systems"), adventure: t("Adventures"), extension: t("Extensions"), language: t("Languages") };
|
|
167
|
+
return labels[kind];
|
|
168
|
+
}
|
|
169
|
+
/** Whether an entry matches what the player searched: by its title, what it is or who wrote it, case and accents aside. */
|
|
170
|
+
function matchesQuery(entry, query) {
|
|
171
|
+
const wanted = foldedText(query.trim());
|
|
172
|
+
return wanted === "" || [entry.title, entry.description ?? "", entry.author ?? ""].some((text) => foldedText(text).includes(wanted));
|
|
173
|
+
}
|
|
174
|
+
/** Where a catalog's package is here: in the campaign, only on this computer, or not here. */
|
|
175
|
+
function hereState(entry, view) {
|
|
176
|
+
if (entry.installed === undefined) {
|
|
177
|
+
return "none";
|
|
178
|
+
}
|
|
179
|
+
if (entry.kind === "adventure") {
|
|
180
|
+
return "used";
|
|
181
|
+
}
|
|
182
|
+
if (entry.kind !== "extension") {
|
|
183
|
+
return "here";
|
|
184
|
+
}
|
|
185
|
+
const extension = view.installed.find((one) => samePackage(entry, one.package));
|
|
186
|
+
return extension !== undefined && !("broken" in extension) && extension.used ? "used" : "here";
|
|
187
|
+
}
|
|
188
|
+
/** Whether a catalog's entry is this package: ours by its name alone, another's by its npm name. */
|
|
189
|
+
function samePackage(entry, name) {
|
|
190
|
+
const source = entry.source.replace(/^npm:/, "");
|
|
191
|
+
return name === source || name === `@rpgengine/${source}`;
|
|
192
|
+
}
|
|
193
|
+
/** An adventure's levels: one, or from one to another. */
|
|
194
|
+
function levelsText(levels) {
|
|
195
|
+
return levels.includes("-") ? t("levels {levels}", { levels: levels.replace("-", "–") }) : t("level {level}", { level: levels });
|
|
196
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
// RPG Engine itself on the Packages page: its card, how a new chat takes the version installed, and what a package's latest needs of it.
|
|
3
|
+
import { useEffect, useRef } from "preact/hooks";
|
|
4
|
+
import { CardHead } from "../parts/card.js";
|
|
5
|
+
import { Icon, iconPath } from "../parts/icons.js";
|
|
6
|
+
import { t } from "../text.js";
|
|
7
|
+
import { PackageRow, SaidNote, UpdateButton, VersionMeta, WorkNote } from "./rows.js";
|
|
8
|
+
// The engine's own name, never translated.
|
|
9
|
+
export const engineName = "RPG Engine";
|
|
10
|
+
// Where the engine installed from this page is kept while the chat goes on with the one before it: in this tab, through a reload.
|
|
11
|
+
const updatedKey = "rpg-engine-updated";
|
|
12
|
+
/** The engine installed from this page in this tab, if any. */
|
|
13
|
+
export function keptUpdate() {
|
|
14
|
+
try {
|
|
15
|
+
const kept = JSON.parse(sessionStorage.getItem(updatedKey) ?? "null");
|
|
16
|
+
return kept !== null && typeof kept.to === "string" && typeof kept.from === "string" ? { from: kept.from, to: kept.to, restart: kept.restart === "app" ? "app" : "chat" } : undefined;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function keepUpdate(updated) {
|
|
23
|
+
try {
|
|
24
|
+
if (updated === undefined) {
|
|
25
|
+
sessionStorage.removeItem(updatedKey);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
sessionStorage.setItem(updatedKey, JSON.stringify(updated));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// A browser that keeps nothing says it until the page is drawn again.
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** The focus to the engine's card: its Update, else its title. */
|
|
36
|
+
export function focusEngine() {
|
|
37
|
+
const target = document.getElementById("engine-update") ?? document.getElementById("packages-engine");
|
|
38
|
+
target?.focus({ preventScroll: true });
|
|
39
|
+
target?.scrollIntoView({ block: "center" });
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* RPG Engine itself (D-515 (3)), first among the installed: its version and npm's newer one, with Update when npm installed it globally; installed another way,
|
|
43
|
+
* why the page does not update it; once updated, how a new chat, or the app opened again, brings it, as the chat and this page go on with this one.
|
|
44
|
+
*/
|
|
45
|
+
export function EngineCard({ engine, updated, newer, state, onUpdate }) {
|
|
46
|
+
const folder = engine?.folder ?? "";
|
|
47
|
+
const why = engine === undefined
|
|
48
|
+
? t("Asking npm for the newest version…")
|
|
49
|
+
: engine.install === "link"
|
|
50
|
+
? t("Installed with npm link from {folder}, for its development: update it there, with git pull and npm run build.", { folder })
|
|
51
|
+
: engine.install === "other"
|
|
52
|
+
? t("Installed another way, in {folder}: update it the way you installed it.", { folder })
|
|
53
|
+
: engine.failed !== undefined
|
|
54
|
+
? t("npm does not answer: a newer version cannot be checked now.")
|
|
55
|
+
: undefined;
|
|
56
|
+
// A newer one this page does not install is still said, by its version.
|
|
57
|
+
const shownNewer = updated === undefined && engine?.update === true ? engine.latest : undefined;
|
|
58
|
+
return (_jsxs("section", { class: "card", "aria-labelledby": "packages-engine", children: [_jsx(CardHead, { icon: iconPath("engine"), title: _jsx("h3", { id: "packages-engine", tabIndex: -1, children: t("Engine") }) }), _jsx("div", { class: "card-body package-body", children: _jsx("ul", { class: "package-list", children: _jsxs(PackageRow, { tile: "engine", name: engineName, about: t("What runs the game: the master's tools and this page."), meta: engine !== undefined && _jsx(VersionMeta, { version: engine.version, newer: shownNewer }), needs: why === undefined ? undefined : _jsx("span", { class: "package-needs", children: why }), actions: newer !== undefined
|
|
59
|
+
? _jsx(UpdateButton, { id: "engine-update", name: engineName, version: newer, busy: state.busy, onClick: onUpdate })
|
|
60
|
+
: engine?.update === false && engine.install === "global" && updated === undefined && (_jsxs("span", { class: "package-here", children: [_jsx(Icon, { name: "check" }), t("Up to date")] })), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said }), updated !== undefined && _jsx(RestartNote, { updated: updated })] }) }) })] }));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* What a package's latest needs of the engine (D-515 (2)), under its meta: which version of it, and the way to the engine's card, to update it first; the
|
|
64
|
+
* version offered meanwhile is the newest this engine reads.
|
|
65
|
+
*/
|
|
66
|
+
export function NeedsEngine({ newer, canUpdate, onGo }) {
|
|
67
|
+
const { version, engine } = newer;
|
|
68
|
+
return (_jsxs("span", { class: "package-needs", children: [_jsx("span", { children: engine === undefined ? t("Version {version} needs a newer RPG Engine.", { version }) : t("Version {version} needs RPG Engine {engine}.", { version, engine }) }), _jsxs("button", { type: "button", class: "package-see", onClick: onGo, children: [canUpdate ? t("Update RPG Engine first") : t("See RPG Engine"), _jsx(Icon, { name: "fold" })] })] }));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The engine installed, and how the master comes to use it, in the player's words: this chat goes on with the one it started with; a new chat, or the app
|
|
72
|
+
* opened again, takes the new one, and this page is read again after it, never by itself, as the running game would serve it the new one's files.
|
|
73
|
+
*/
|
|
74
|
+
function RestartNote({ updated }) {
|
|
75
|
+
const note = useRef(null);
|
|
76
|
+
// Just updated, the focus Update had comes here; kept from before a reload, it stays where the page puts it.
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (updated.now) {
|
|
79
|
+
note.current?.focus({ preventScroll: true });
|
|
80
|
+
note.current?.scrollIntoView({ block: "nearest" });
|
|
81
|
+
}
|
|
82
|
+
}, []);
|
|
83
|
+
const steps = updated.restart === "app"
|
|
84
|
+
? [t("Quit the app you play in completely, not just its window, then open it again."), t("Start a new chat in the campaign, as you always do."), t("Reload this page.")]
|
|
85
|
+
: [t("Close this chat."), t("Start a new chat in the campaign, as you always do."), t("Reload this page.")];
|
|
86
|
+
return (_jsxs("div", { ref: note, class: "package-said package-restart", role: "status", tabIndex: -1, children: [_jsx("p", { children: `✓ ${t("RPG Engine {version} is installed.", { version: updated.to })}` }), _jsx("p", { children: t("The master goes on with {version} in this chat. To play with {next}:", { version: updated.from, next: updated.to }) }), _jsx("ol", { children: steps.map((step) => _jsx("li", { children: step }, step)) })] }));
|
|
87
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { gameDateLabel, sinceDateLabel } from "../parts/game-words.js";
|
|
3
|
+
import { Icon } from "../parts/icons.js";
|
|
4
|
+
import { phraseLabel, systemTitleLabel } from "../parts/labels.js";
|
|
5
|
+
import { languageName } from "../settings/languages.js";
|
|
6
|
+
import { t } from "../text.js";
|
|
7
|
+
import { OwnPageLinks } from "./page.js";
|
|
8
|
+
import { PackageRow, pageLanguage, ReportLink, SaidNote, Trust, UninstallButton, UpdateButton, VersionMeta, WorkNote } from "./rows.js";
|
|
9
|
+
/**
|
|
10
|
+
* A game system here: the campaign's, chosen in its setup and locked; another, for a new campaign, which can go off this computer when npm installed it; npm's
|
|
11
|
+
* newer version, to update it.
|
|
12
|
+
*/
|
|
13
|
+
export function SystemRow({ system, newer, needs, fresh, state, onUpdate, onUninstall }) {
|
|
14
|
+
const target = system.package ?? system.name;
|
|
15
|
+
return (_jsxs(PackageRow, { tile: "dice", tone: system.used ? undefined : "dim", name: _jsx("span", { class: "system-chip", children: system.name }), badges: _jsx(Trust, { verified: system.verified, code: system.code }), about: systemTitleLabel(system.title), meta: _jsxs(_Fragment, { children: [_jsx(VersionMeta, { version: system.version, newer: newer }), _jsx(ReportLink, { issues: system.issues, name: system.name, after: system.version !== undefined || newer !== undefined }), _jsx(OwnPageLinks, { name: system.package })] }), needs: needs, row: `system:${system.name}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: system.name, version: newer, busy: state.busy, onClick: () => onUpdate(target) }), system.used
|
|
16
|
+
? (_jsxs("span", { class: "package-lock", children: [_jsx(Icon, { name: "lock" }), t("In use · chosen in the setup")] }))
|
|
17
|
+
: (_jsxs(_Fragment, { children: [_jsx("span", { class: "package-quiet", children: t("Not in this campaign") }), system.package !== undefined && _jsx(UninstallButton, { name: system.name, busy: state.busy, onClick: () => onUninstall(target) })] }))] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
|
|
18
|
+
}
|
|
19
|
+
/** An adventure of the campaign: the day it came in on and its version; taken out while the story has not touched it, else part of the story. */
|
|
20
|
+
export function AdventureRow({ adventure, fresh, state, onTakeOut }) {
|
|
21
|
+
const since = adventure.since === undefined ? undefined : sinceDateLabel(adventure.since);
|
|
22
|
+
return (_jsxs(PackageRow, { tile: "world", tone: "cover", name: adventure.title, meta: since === undefined ? adventure.version : _jsx("span", { title: gameDateLabel(adventure.since ?? ""), children: `${since} · ${adventure.version}` }), row: `adventure:${adventure.title}`, fresh: fresh, actions: adventure.removable
|
|
23
|
+
? (_jsxs("button", { type: "button", class: "button package-button", "aria-label": t("Take {name} out of the campaign…", { name: adventure.title }), "aria-disabled": state.busy, onClick: () => !state.busy && onTakeOut(), children: [_jsx(Icon, { name: "minus" }), t("Take out…")] }))
|
|
24
|
+
: (_jsxs("span", { class: "package-lock", children: [_jsx(Icon, { name: "lock" }), t("Part of the story")] })), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
|
|
25
|
+
}
|
|
26
|
+
/** An extension here: whose it is, what it is, its version and npm's newer one; whether the campaign uses it, as a switch; one that does not read, in red. */
|
|
27
|
+
export function ExtensionRow({ extension, newer, needs, fresh, state, onUse, onUpdate, onUninstall }) {
|
|
28
|
+
const name = phraseLabel(extension.name);
|
|
29
|
+
if ("broken" in extension) {
|
|
30
|
+
return (_jsxs(PackageRow, { tile: "alert", tone: "broken", name: name, about: _jsx("span", { class: "package-red", children: t("It does not read: install it again.") }), meta: _jsxs(_Fragment, { children: [_jsx("bdi", { class: "package-why", children: extension.broken }), _jsx(ReportLink, { issues: extension.issues, name: name, after: true })] }), actions: _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", class: "button package-button", "aria-label": t("Install {name} again", { name }), "aria-disabled": state.busy, onClick: () => !state.busy && onUpdate(), children: [_jsx(Icon, { name: "update" }), t("Install it again")] }), _jsx(UninstallButton, { name: name, busy: state.busy, onClick: onUninstall })] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
|
|
31
|
+
}
|
|
32
|
+
return (_jsxs(PackageRow, { tile: "packages", name: name, badges: _jsx(Trust, { verified: extension.verified, code: false }), about: `${phraseLabel(extension.about.replace(/\.$/, ""))}.`, meta: _jsxs(_Fragment, { children: [_jsx(VersionMeta, { version: extension.version, newer: newer }), _jsx(ReportLink, { issues: extension.issues, name: name, after: true }), _jsx(OwnPageLinks, { name: extension.package })] }), needs: needs, row: `extension:${extension.package}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: name, version: newer, busy: state.busy, onClick: onUpdate }), _jsxs("label", { class: "package-use", children: [_jsx("input", { type: "checkbox", role: "switch", checked: extension.used, "aria-label": t("{name}: in use", { name }), "aria-disabled": state.busy, onClick: (event) => {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
if (!state.busy) {
|
|
35
|
+
onUse(!extension.used);
|
|
36
|
+
}
|
|
37
|
+
} }), t("In use")] }), _jsx(UninstallButton, { name: name, busy: state.busy, onClick: onUninstall })] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
|
|
38
|
+
}
|
|
39
|
+
/** An extension the campaign lists and this computer lacks: in red, with Install. */
|
|
40
|
+
export function MissingRow({ name, state, onInstall }) {
|
|
41
|
+
const shown = phraseLabel(name.replace(/^@[^/]+\//, ""));
|
|
42
|
+
return (_jsxs(PackageRow, { tile: "alert", tone: "broken", name: shown, about: _jsx("span", { class: "package-red", children: t("Missing on this computer: the master does not use it until you install it.") }), actions: _jsxs("button", { type: "button", class: "button package-button", "aria-label": t("Install {name}", { name: shown }), "aria-disabled": state.busy, onClick: () => !state.busy && onInstall(), children: [_jsx(Icon, { name: "download" }), t("Install")] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
|
|
43
|
+
}
|
|
44
|
+
/** A language package: its name, whose it is, its version and npm's newer one, and whether this page is written in it. */
|
|
45
|
+
export function LanguageRow({ language, newer, needs, fresh, state, onUpdate, onUninstall }) {
|
|
46
|
+
const page = pageLanguage().toLowerCase().split("-")[0] === language.code.toLowerCase().split("-")[0];
|
|
47
|
+
const name = languageTitle(language);
|
|
48
|
+
return (_jsxs(PackageRow, { tile: "language", name: name, badges: _jsx(Trust, { verified: language.verified, code: false }), meta: _jsxs(_Fragment, { children: [_jsx(VersionMeta, { version: language.version, newer: newer }), page && ` · ${t("the language of this page")}`, _jsx(ReportLink, { issues: language.issues, name: name, after: true })] }), needs: needs, row: `language:${language.code}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: name, version: newer, busy: state.busy, onClick: onUpdate }), _jsx(UninstallButton, { name: name, busy: state.busy, onClick: onUninstall })] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
|
|
49
|
+
}
|
|
50
|
+
/** A language package's name in the page's language, else its own. */
|
|
51
|
+
export function languageTitle(language) {
|
|
52
|
+
return phraseLabel(languageName(language.code, pageLanguage()) ?? language.name);
|
|
53
|
+
}
|