rpg-engine 0.7.0 → 0.9.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/adventures/index.d.ts +1 -1
- package/dist/adventures/index.js +1 -1
- package/dist/adventures/source.js +13 -13
- package/dist/campaign/create-campaign.js +10 -1
- package/dist/campaign/host-files.d.ts +2 -1
- package/dist/campaign/host-files.js +11 -11
- package/dist/campaign/index.d.ts +1 -1
- package/dist/campaign/index.js +1 -1
- package/dist/campaign/settings.d.ts +55 -64
- package/dist/campaign/settings.js +171 -174
- package/dist/{cli.js → cli/cli.js} +3 -3
- package/dist/{command-line.d.ts → cli/command-line.d.ts} +1 -1
- package/dist/{command-line.js → cli/command-line.js} +21 -20
- package/dist/commands/advance.d.ts +1 -1
- package/dist/commands/advance.js +7 -7
- package/dist/commands/ask.d.ts +1 -8
- package/dist/commands/ask.js +16 -29
- package/dist/commands/{change.d.ts → change/change.d.ts} +2 -2
- package/dist/commands/{change.js → change/change.js} +46 -52
- package/dist/commands/{game-damage.d.ts → change/damage.d.ts} +2 -2
- package/dist/commands/{game-damage.js → change/damage.js} +3 -3
- package/dist/commands/{game-recipe-pace.d.ts → change/recipe-pace.d.ts} +2 -2
- package/dist/commands/{game-recipe-pace.js → change/recipe-pace.js} +4 -4
- package/dist/commands/config.d.ts +4 -4
- package/dist/commands/config.js +142 -138
- package/dist/commands/effect.d.ts +1 -1
- package/dist/commands/effect.js +11 -12
- package/dist/commands/find.d.ts +4 -4
- package/dist/commands/find.js +2 -2
- package/dist/commands/image.js +6 -6
- package/dist/commands/{import.d.ts → import/import.d.ts} +2 -2
- package/dist/commands/{import.js → import/import.js} +101 -101
- package/dist/commands/{game-import.d.ts → import/run.d.ts} +3 -3
- package/dist/commands/{game-import.js → import/run.js} +13 -12
- package/dist/commands/index.js +7 -7
- package/dist/commands/init.js +3 -3
- 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 +13 -20
- package/dist/commands/package.d.ts +2 -2
- package/dist/commands/package.js +138 -93
- package/dist/commands/rename.js +3 -3
- package/dist/commands/reveal.js +29 -18
- package/dist/commands/{roll.d.ts → roll/roll.d.ts} +4 -4
- package/dist/commands/{roll.js → roll/roll.js} +69 -69
- package/dist/commands/{game-tables.d.ts → roll/tables.d.ts} +2 -2
- package/dist/commands/{game-tables.js → roll/tables.js} +4 -4
- package/dist/commands/rules.d.ts +2 -2
- package/dist/commands/rules.js +17 -9
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +18 -18
- package/dist/commands/scene.d.ts +4 -4
- package/dist/commands/scene.js +31 -28
- package/dist/commands/{game-advance.d.ts → shared/advance.d.ts} +4 -4
- package/dist/commands/{game-advance.js → shared/advance.js} +27 -27
- package/dist/commands/{game-adventures.d.ts → shared/adventures.d.ts} +3 -3
- package/dist/commands/{game-adventures.js → shared/adventures.js} +20 -27
- package/dist/commands/{game-bonds.d.ts → shared/bonds.d.ts} +3 -3
- package/dist/commands/{game-bonds.js → shared/bonds.js} +2 -2
- package/dist/commands/{game-checks.d.ts → shared/checks.d.ts} +3 -3
- package/dist/commands/{game-checks.js → shared/checks.js} +7 -7
- package/dist/commands/{game-dice-pool.d.ts → shared/dice-pool.d.ts} +3 -3
- package/dist/commands/{game-dice-pool.js → shared/dice-pool.js} +19 -12
- package/dist/commands/{effect-layer.d.ts → shared/effect-layer.d.ts} +2 -2
- package/dist/commands/{effect-layer.js → shared/effect-layer.js} +12 -12
- package/dist/commands/{game-effects.d.ts → shared/effects.d.ts} +7 -7
- package/dist/commands/{game-effects.js → shared/effects.js} +19 -19
- package/dist/commands/{game-environment.d.ts → shared/environment.d.ts} +1 -1
- package/dist/commands/{game-environment.js → shared/environment.js} +3 -3
- package/dist/commands/{game-events.d.ts → shared/events.d.ts} +5 -5
- package/dist/commands/{game-events.js → shared/events.js} +20 -22
- package/dist/commands/{game-examples.d.ts → shared/examples.d.ts} +4 -8
- package/dist/commands/{game-examples.js → shared/examples.js} +23 -23
- package/dist/commands/{game-experience.d.ts → shared/experience.d.ts} +2 -2
- package/dist/commands/{game-experience.js → shared/experience.js} +8 -11
- package/dist/commands/{game-grid-moves.d.ts → shared/grid-moves.d.ts} +6 -6
- package/dist/commands/{game-grid-moves.js → shared/grid-moves.js} +5 -5
- package/dist/commands/{game-grids.d.ts → shared/grids.d.ts} +4 -9
- package/dist/commands/{game-grids.js → shared/grids.js} +20 -19
- package/dist/commands/{game-images.d.ts → shared/images.d.ts} +3 -3
- package/dist/commands/{game-images.js → shared/images.js} +7 -6
- package/dist/commands/shared/inputs.d.ts +9 -0
- package/dist/commands/shared/inputs.js +12 -0
- package/dist/commands/{game-journey.d.ts → shared/journey.d.ts} +4 -6
- package/dist/commands/{game-journey.js → shared/journey.js} +13 -15
- package/dist/commands/{game-knowledge.d.ts → shared/knowledge.d.ts} +15 -8
- package/dist/commands/{game-knowledge.js → shared/knowledge.js} +56 -44
- package/dist/{library-reader.js → commands/shared/library-reader.js} +4 -4
- package/dist/commands/{game-library.d.ts → shared/library.d.ts} +7 -4
- package/dist/commands/{game-library.js → shared/library.js} +70 -50
- package/dist/commands/{game-limits.d.ts → shared/limits.d.ts} +3 -3
- package/dist/commands/{game-limits.js → shared/limits.js} +3 -3
- package/dist/commands/{game-loot.d.ts → shared/loot.d.ts} +2 -2
- package/dist/commands/{game-loot.js → shared/loot.js} +3 -3
- package/dist/commands/{game-master-rolls.d.ts → shared/master-rolls.d.ts} +2 -2
- package/dist/commands/{game-master-rolls.js → shared/master-rolls.js} +6 -6
- package/dist/commands/{game-mode.d.ts → shared/mode.d.ts} +4 -6
- package/dist/commands/{game-mode.js → shared/mode.js} +10 -10
- package/dist/commands/{game-money.d.ts → shared/money.d.ts} +3 -3
- package/dist/commands/{game-money.js → shared/money.js} +4 -4
- package/dist/commands/{game-moods.d.ts → shared/moods.d.ts} +3 -3
- package/dist/commands/{game-moods.js → shared/moods.js} +3 -3
- package/dist/commands/{game-moves.d.ts → shared/moves.d.ts} +2 -2
- package/dist/commands/{game-moves.js → shared/moves.js} +5 -5
- package/dist/commands/{game-offers.d.ts → shared/offers.d.ts} +3 -3
- package/dist/commands/{game-offers.js → shared/offers.js} +9 -12
- package/dist/commands/{game-outside.d.ts → shared/outside.d.ts} +3 -3
- package/dist/commands/{game-outside.js → shared/outside.js} +9 -9
- package/dist/commands/{game-catalog.d.ts → shared/packages/catalog.d.ts} +1 -3
- package/dist/commands/{game-catalog.js → shared/packages/catalog.js} +17 -22
- package/dist/commands/{game-package-code.d.ts → shared/packages/code.d.ts} +10 -14
- package/dist/commands/{game-package-code.js → shared/packages/code.js} +156 -59
- package/dist/commands/{game-extension-list.d.ts → shared/packages/extensions.d.ts} +6 -6
- package/dist/commands/{game-extension-list.js → shared/packages/extensions.js} +43 -22
- package/dist/commands/{game-package-hooks.d.ts → shared/packages/hooks.d.ts} +3 -3
- package/dist/commands/{game-package-hooks.js → shared/packages/hooks.js} +3 -3
- package/dist/commands/{game-widgets.d.ts → shared/packages/widgets.d.ts} +6 -10
- package/dist/commands/{game-widgets.js → shared/packages/widgets.js} +57 -57
- package/dist/commands/{page-counters.d.ts → shared/page-counters.d.ts} +3 -3
- package/dist/commands/{page-counters.js → shared/page-counters.js} +5 -5
- package/dist/{page-words.d.ts → commands/shared/page-words.d.ts} +2 -2
- package/dist/{page-words.js → commands/shared/page-words.js} +5 -4
- package/dist/commands/{parts.d.ts → shared/parts.d.ts} +3 -3
- package/dist/commands/{parts.js → shared/parts.js} +4 -4
- package/dist/commands/{game-positions.d.ts → shared/positions.d.ts} +3 -5
- package/dist/commands/{game-positions.js → shared/positions.js} +6 -7
- package/dist/commands/{problems.d.ts → shared/problems.d.ts} +3 -3
- package/dist/commands/{problems.js → shared/problems.js} +21 -22
- package/dist/commands/{progression.d.ts → shared/progression.d.ts} +2 -2
- package/dist/commands/{progression.js → shared/progression.js} +4 -4
- package/dist/commands/{game-quests.d.ts → shared/quests.d.ts} +4 -4
- package/dist/commands/{game-quests.js → shared/quests.js} +6 -6
- package/dist/commands/{game-recipes.d.ts → shared/recipes.d.ts} +3 -3
- package/dist/commands/{game-recipes.js → shared/recipes.js} +3 -3
- package/dist/commands/{game-reminders.d.ts → shared/reminders.d.ts} +4 -4
- package/dist/commands/{game-reminders.js → shared/reminders.js} +4 -4
- package/dist/commands/{game-roads.d.ts → shared/roads.d.ts} +5 -5
- package/dist/commands/{game-roads.js → shared/roads.js} +43 -44
- package/dist/commands/{game-rules.d.ts → shared/rules.d.ts} +13 -5
- package/dist/commands/shared/rules.js +66 -0
- package/dist/commands/{game-saves.d.ts → shared/saves.d.ts} +4 -4
- package/dist/commands/{game-saves.js → shared/saves.js} +51 -51
- package/dist/commands/{game-scene.d.ts → shared/scene.d.ts} +13 -3
- package/dist/commands/{game-scene.js → shared/scene.js} +41 -13
- package/dist/commands/{sheet.d.ts → shared/sheet.d.ts} +5 -5
- package/dist/commands/{sheet.js → shared/sheet.js} +76 -76
- package/dist/commands/{game-stacks.d.ts → shared/stacks.d.ts} +2 -9
- package/dist/commands/{game-stacks.js → shared/stacks.js} +22 -22
- package/dist/commands/{game-theme.d.ts → shared/theme.d.ts} +3 -3
- package/dist/commands/{game-theme.js → shared/theme.js} +2 -2
- package/dist/commands/{game-thoughts.d.ts → shared/thoughts.d.ts} +2 -4
- package/dist/commands/{game-thoughts.js → shared/thoughts.js} +6 -8
- package/dist/commands/{game-thresholds.d.ts → shared/thresholds.d.ts} +1 -1
- package/dist/commands/{game-thresholds.js → shared/thresholds.js} +4 -4
- package/dist/commands/{game-time.d.ts → shared/time.d.ts} +4 -4
- package/dist/commands/{game-time.js → shared/time.js} +6 -6
- package/dist/commands/{game-turn-uses.d.ts → shared/turn-uses.d.ts} +3 -3
- package/dist/commands/{game-turn-uses.js → shared/turn-uses.js} +12 -15
- package/dist/commands/{game-upkeep.d.ts → shared/upkeep.d.ts} +3 -3
- package/dist/commands/{game-upkeep.js → shared/upkeep.js} +69 -57
- package/dist/commands/{game-voices.d.ts → shared/voices.d.ts} +1 -1
- package/dist/commands/{game-voices.js → shared/voices.js} +2 -2
- package/dist/commands/{worked-out.d.ts → shared/worked-out.d.ts} +3 -8
- package/dist/commands/{worked-out.js → shared/worked-out.js} +238 -238
- package/dist/commands/{game-world.d.ts → shared/world.d.ts} +5 -14
- package/dist/commands/{game-world.js → shared/world.js} +72 -76
- package/dist/commands/show.d.ts +4 -1
- package/dist/commands/show.js +36 -18
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.js +28 -28
- package/dist/commands/thoughts.js +3 -3
- package/dist/commands/trade.js +9 -10
- package/dist/commands/translate.d.ts +1 -1
- package/dist/commands/translate.js +3 -3
- package/dist/commands/{game-open.d.ts → travel/open.d.ts} +3 -3
- package/dist/commands/{game-open.js → travel/open.js} +4 -5
- package/dist/commands/{route.d.ts → travel/route.d.ts} +1 -1
- package/dist/commands/{route.js → travel/route.js} +9 -10
- package/dist/commands/{travel.d.ts → travel/travel.d.ts} +2 -2
- package/dist/commands/{travel.js → travel/travel.js} +19 -21
- package/dist/commands/validate.js +5 -5
- package/dist/commands/{game-view-journal.d.ts → view/journal.d.ts} +5 -5
- package/dist/commands/{game-view-journal.js → view/journal.js} +5 -5
- package/dist/commands/{game-view-map.d.ts → view/map.d.ts} +3 -3
- package/dist/commands/{game-view-map.js → view/map.js} +15 -16
- package/dist/commands/{game-view-place.d.ts → view/place.d.ts} +6 -6
- package/dist/commands/{game-view-place.js → view/place.js} +108 -108
- package/dist/commands/{view.d.ts → view/view.d.ts} +16 -16
- package/dist/commands/{view.js → view/view.js} +41 -36
- package/dist/commands/{game-view-world.d.ts → view/world.d.ts} +4 -4
- package/dist/commands/{game-view-world.js → view/world.js} +7 -7
- package/dist/commands/{game-here.d.ts → write/here.d.ts} +5 -3
- package/dist/commands/{game-here.js → write/here.js} +18 -12
- package/dist/commands/{write.d.ts → write/write.d.ts} +6 -6
- package/dist/commands/{write.js → write/write.js} +44 -41
- package/dist/confirm/confirm.d.ts +2 -0
- package/dist/confirm/confirm.js +15 -5
- package/dist/core/consents.d.ts +3 -2
- package/dist/core/consents.js +43 -4
- package/dist/core/context.d.ts +8 -6
- package/dist/core/context.js +4 -2
- package/dist/core/download.js +16 -5
- package/dist/core/files.d.ts +8 -1
- package/dist/core/files.js +53 -21
- package/dist/core/formula.d.ts +7 -2
- package/dist/core/formula.js +63 -66
- package/dist/core/instruction-parts.js +1 -1
- package/dist/core/mood.d.ts +0 -1
- package/dist/core/mood.js +3 -3
- package/dist/core/package-api.d.ts +11 -0
- package/dist/core/package-api.js +2 -1
- package/dist/core/package-declarations.d.ts +9 -9
- package/dist/core/package-declarations.js +3 -3
- package/dist/core/process-mark.d.ts +8 -0
- package/dist/core/process-mark.js +72 -0
- package/dist/core/registry.d.ts +5 -0
- package/dist/core/registry.js +10 -0
- package/dist/core/session-store.d.ts +0 -1
- package/dist/core/session-store.js +11 -14
- package/dist/core/store.d.ts +4 -0
- package/dist/core/store.js +29 -8
- package/dist/core/text.d.ts +4 -0
- package/dist/core/text.js +11 -2
- package/dist/core/yaml-file.js +2 -2
- package/dist/dashboard/{acts.js → acts/acts.js} +2 -2
- package/dist/dashboard/{act-names.js → acts/names.js} +1 -1
- package/dist/dashboard/{act-sheet.js → acts/sheet.js} +3 -3
- package/dist/dashboard/{act-strip.js → acts/strip.js} +2 -2
- package/dist/dashboard/app.js +13 -13
- package/dist/dashboard/asked.js +1 -1
- package/dist/dashboard/dice/burn.js +1 -1
- package/dist/dashboard/dice/stage.js +1 -1
- package/dist/dashboard/game-words.js +4 -4
- package/dist/dashboard/{guide-blocks.js → help/blocks.js} +1 -1
- package/dist/dashboard/{help.js → help/help.js} +6 -6
- package/dist/dashboard/journal.js +1 -1
- package/dist/dashboard/kit.js +6 -5
- package/dist/dashboard/labels.js +7 -3
- package/dist/dashboard/markdown.js +1 -1
- package/dist/dashboard/{ask-card.js → packages/ask-card.js} +6 -6
- package/dist/dashboard/{package-page.js → packages/package-page.js} +3 -3
- package/dist/dashboard/{packages.js → packages/packages.js} +12 -12
- package/dist/dashboard/{page-code.js → packages/page-code.js} +4 -4
- package/dist/dashboard/{extension-widgets.js → packages/widgets.js} +5 -5
- package/dist/dashboard/party.js +1 -1
- package/dist/dashboard/person-panel.js +2 -13
- package/dist/dashboard/{map-sheet.js → place/map-sheet.js} +4 -4
- package/dist/dashboard/{place-map-view.js → place/map-view.js} +11 -11
- package/dist/dashboard/scene.js +4 -4
- package/dist/dashboard/settings.js +1 -1
- package/dist/dashboard/sheet.js +4 -4
- package/dist/dashboard/text.js +6 -0
- package/dist/dashboard/top.js +2 -2
- package/dist/dashboard/turns.js +2 -2
- package/dist/dashboard/widgets.js +1 -1
- package/dist/dashboard/{world-calendar.js → world/calendar.js} +7 -7
- package/dist/dashboard/{lore.js → world/known.js} +1 -1
- package/dist/dashboard/{world-lore.js → world/lore.js} +9 -9
- package/dist/dashboard/{world-map.js → world/map.js} +1 -1
- package/dist/dashboard/{world.js → world/world.js} +14 -14
- package/dist/dice/evaluate.js +1 -1
- package/dist/dice/index.d.ts +2 -2
- package/dist/dice/index.js +2 -2
- package/dist/dice/notation.d.ts +2 -0
- package/dist/dice/notation.js +22 -4
- package/dist/documents/markup.js +2 -2
- package/dist/documents/read.js +29 -13
- package/dist/effects/effect.js +2 -5
- package/dist/extensions/extension.js +6 -8
- package/dist/extensions/index.d.ts +1 -4
- package/dist/extensions/index.js +1 -4
- package/dist/extensions/words.js +2 -1
- package/dist/{pictures → helpers}/briefs.js +17 -14
- package/dist/{pictures → helpers}/claude.js +8 -18
- package/dist/{pictures → helpers}/codex.js +3 -15
- package/dist/helpers/index.d.ts +7 -0
- package/dist/helpers/index.js +9 -0
- package/dist/{pictures/helpers.d.ts → helpers/programs.d.ts} +6 -1
- package/dist/{pictures/helpers.js → helpers/programs.js} +16 -2
- package/dist/images/images.js +7 -5
- package/dist/images/index.d.ts +1 -1
- package/dist/images/index.js +1 -1
- package/dist/importer/index.d.ts +1 -1
- package/dist/importer/index.js +1 -1
- package/dist/importer/work.d.ts +0 -2
- package/dist/importer/work.js +9 -30
- package/dist/instructions/index.d.ts +2 -0
- package/dist/instructions/index.js +10 -0
- package/dist/languages/index.d.ts +1 -1
- package/dist/languages/index.js +1 -1
- package/dist/languages/language-pack.js +15 -3
- package/dist/library/books.js +29 -83
- package/dist/{extensions → packages}/engine.d.ts +1 -1
- package/dist/{extensions → packages}/engine.js +1 -1
- package/dist/packages/index.d.ts +3 -0
- package/dist/packages/index.js +4 -0
- package/dist/{extensions/packages.d.ts → packages/npm.d.ts} +2 -0
- package/dist/{extensions/packages.js → packages/npm.js} +74 -45
- package/dist/page.d.ts +9 -11
- package/dist/page.js +1 -2
- package/dist/pages/check.js +31 -40
- package/dist/pages/containers.js +20 -20
- package/dist/pages/environment.js +15 -15
- package/dist/pages/index.d.ts +9 -9
- package/dist/pages/index.js +9 -9
- package/dist/pages/inheritance.d.ts +2 -1
- package/dist/pages/inheritance.js +24 -24
- package/dist/pages/load.js +7 -7
- package/dist/pages/maps.d.ts +20 -0
- package/dist/pages/maps.js +51 -1
- package/dist/pages/markdown.d.ts +2 -0
- package/dist/pages/markdown.js +110 -79
- package/dist/pages/page-file.d.ts +2 -1
- package/dist/pages/page-file.js +31 -29
- package/dist/pages/rename-page.d.ts +4 -1
- package/dist/pages/rename-page.js +7 -3
- package/dist/pages/{stack-entry.d.ts → stacks/entry.d.ts} +0 -2
- package/dist/pages/{stack-entry.js → stacks/entry.js} +2 -6
- package/dist/pages/{stacks.d.ts → stacks/kinds.d.ts} +8 -1
- package/dist/pages/{stacks.js → stacks/kinds.js} +36 -41
- package/dist/pages/{stack-writes.d.ts → stacks/writes.d.ts} +2 -2
- package/dist/pages/{stack-writes.js → stacks/writes.js} +32 -32
- package/dist/pages/system-pages.js +15 -15
- package/dist/pages/world.d.ts +4 -0
- package/dist/pages/world.js +52 -20
- package/dist/pages/write-page.js +35 -34
- package/dist/player-notes/index.d.ts +1 -1
- package/dist/player-notes/index.js +1 -1
- package/dist/rules/page-search.js +3 -4
- package/dist/rules/rule-book.js +1 -1
- package/dist/rules/search.js +21 -21
- package/dist/rules/shown.js +1 -3
- package/dist/saves/saves.d.ts +2 -2
- package/dist/saves/saves.js +15 -3
- package/dist/{bell-listener.js → server/bell-listener.js} +3 -3
- package/dist/server/dashboard/files.d.ts +59 -0
- package/dist/server/dashboard/files.js +326 -0
- package/dist/server/dashboard/index.d.ts +114 -0
- package/dist/server/dashboard/index.js +419 -0
- package/dist/server/dashboard/news.d.ts +39 -0
- package/dist/server/dashboard/news.js +390 -0
- package/dist/server/dashboard/player.d.ts +48 -0
- package/dist/server/dashboard/player.js +242 -0
- package/dist/server/dashboard/ports.d.ts +10 -0
- package/dist/server/dashboard/ports.js +15 -0
- package/dist/server/dashboard/writes.d.ts +58 -0
- package/dist/server/dashboard/writes.js +492 -0
- package/dist/{mcp-server.d.ts → server/mcp.d.ts} +2 -2
- package/dist/{mcp-server.js → server/mcp.js} +57 -42
- package/dist/systems/game-system.d.ts +5 -3
- package/dist/systems/game-system.js +178 -149
- package/dist/systems/index.d.ts +1 -1
- package/dist/systems/index.js +1 -1
- package/dist/{testing.d.ts → testing/index.d.ts} +6 -6
- package/dist/{testing.js → testing/index.js} +32 -18
- package/dist/{system-checks.js → testing/system-checks.js} +18 -12
- package/dist/themes/theme.d.ts +3 -3
- package/dist/themes/theme.js +14 -14
- package/dist/time/calendar.js +5 -2
- package/dist/triggers/trigger.js +5 -8
- package/instructions/dashboard-guide.md +2 -1
- package/instructions/play.md +1 -1
- package/package.json +5 -5
- package/dist/commands/game-maps.d.ts +0 -20
- package/dist/commands/game-maps.js +0 -51
- package/dist/commands/game-rules.js +0 -36
- package/dist/dashboard-server.d.ts +0 -47
- package/dist/dashboard-server.js +0 -1830
- package/dist/pictures/index.d.ts +0 -7
- package/dist/pictures/index.js +0 -9
- /package/dist/{cli.d.ts → cli/cli.d.ts} +0 -0
- /package/dist/{library-reader.d.ts → commands/shared/library-reader.d.ts} +0 -0
- /package/dist/commands/{notes.d.ts → shared/notes.d.ts} +0 -0
- /package/dist/commands/{notes.js → shared/notes.js} +0 -0
- /package/dist/dashboard/{guide-markdown.js → help/markdown.js} +0 -0
- /package/dist/dashboard/{pack-card.js → packages/card.js} +0 -0
- /package/dist/dashboard/{people.js → packages/people.js} +0 -0
- /package/dist/dashboard/{place-map.js → place/map.js} +0 -0
- /package/dist/dashboard/{calendar.js → world/days.js} +0 -0
- /package/dist/{pictures → helpers}/briefs.d.ts +0 -0
- /package/dist/{pictures → helpers}/chosen.d.ts +0 -0
- /package/dist/{pictures → helpers}/chosen.js +0 -0
- /package/dist/{pictures → helpers}/claude.d.ts +0 -0
- /package/dist/{pictures → helpers}/codex.d.ts +0 -0
- /package/dist/{pictures → helpers}/stop.d.ts +0 -0
- /package/dist/{pictures → helpers}/stop.js +0 -0
- /package/dist/{pictures → helpers}/svg.d.ts +0 -0
- /package/dist/{pictures → helpers}/svg.js +0 -0
- /package/dist/{extensions → packages}/tarball.d.ts +0 -0
- /package/dist/{extensions → packages}/tarball.js +0 -0
- /package/dist/{bell-listener.d.ts → server/bell-listener.d.ts} +0 -0
- /package/dist/{player-acts.d.ts → server/player-acts.d.ts} +0 -0
- /package/dist/{player-acts.js → server/player-acts.js} +0 -0
- /package/dist/{system-checks.d.ts → testing/system-checks.d.ts} +0 -0
|
@@ -3,13 +3,13 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "preact/jsx-ru
|
|
|
3
3
|
// What they show comes from the server, in the campaign's language, checked; the page writes their values in its own language, isolated right to left.
|
|
4
4
|
import { createContext } from "preact";
|
|
5
5
|
import { useContext, useEffect, useRef } from "preact/hooks";
|
|
6
|
-
import { sectionAddress } from "
|
|
7
|
-
import { CardHead } from "
|
|
8
|
-
import { iconPath } from "
|
|
6
|
+
import { sectionAddress } from "../address.js";
|
|
7
|
+
import { CardHead } from "../card.js";
|
|
8
|
+
import { iconPath } from "../icons.js";
|
|
9
|
+
import { sideOf, Token } from "../party.js";
|
|
10
|
+
import { isolated, numberText, pageDirection, t } from "../text.js";
|
|
9
11
|
import { cardsIn, codeOfModule, ExtensionRoot, figureSize, ModulesContext, pagePropsOf, usePageModule, useWidgetData } from "./page-code.js";
|
|
10
|
-
import { sideOf, Token } from "./party.js";
|
|
11
12
|
import { PeopleContext } from "./people.js";
|
|
12
|
-
import { isolated, numberText, pageDirection, t } from "./text.js";
|
|
13
13
|
/** The widgets of the campaign's extensions, as last read: every part of the page that holds some takes its own from here. */
|
|
14
14
|
export const WidgetsContext = createContext([]);
|
|
15
15
|
/** The widget whose parts are drawn here, with its page module and data, for a count its extension draws as a figure (D-510); where it stands. */
|
package/dist/dashboard/party.js
CHANGED
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
|
2
2
|
// The party's strip (D-276): a link to each one's sheet, with their token and the pip of their state (D-419), their name, the first counter of their line and
|
|
3
3
|
// their effects; the dead go last.
|
|
4
4
|
import { useContext } from "preact/hooks";
|
|
5
|
-
import { WidgetsContext } from "./extension-widgets.js";
|
|
6
5
|
import { fieldLabel, initials, nameHue } from "./labels.js";
|
|
7
6
|
import { stripCounter } from "./layout.js";
|
|
7
|
+
import { WidgetsContext } from "./packages/widgets.js";
|
|
8
8
|
import { personShown, PersonStrip } from "./person-panel.js";
|
|
9
9
|
import { tokenSymbolsPref, usePref } from "./prefs.js";
|
|
10
10
|
import { besideWord, downTint, memberStatus, StatusPip, statusWords } from "./status.js";
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
|
-
// A package's widget on someone of the party (D-514, D-516). One that says their state (its chip) is drawn as a panel, as the 5e's death saves (D-461):
|
|
3
|
-
// its good counts on the start side as circles, its bad ones on the end side as squares, its lead's word between them with the package's figure over it,
|
|
4
|
-
// tinted by the lead's tone, greyed when dead by its rules; large under the name and in the card at hand, one line in a row of the turns, small in the
|
|
5
|
-
// party's strip; with one side only, the word beside it, the two in the middle. Any other is a small card of its package among the boxes of values under the
|
|
6
|
-
// name, as the rerolls of a lock.
|
|
7
|
-
import { useContext } from "preact/hooks";
|
|
8
|
-
import { Figure, textOf, Value, WidgetsContext } from "./extension-widgets.js";
|
|
9
2
|
import { statusIcons } from "./icons.js";
|
|
10
|
-
import { usePageModule } from "./page-code.js";
|
|
3
|
+
import { usePageModule } from "./packages/page-code.js";
|
|
4
|
+
import { Figure, textOf, Value } from "./packages/widgets.js";
|
|
11
5
|
import { numberText, t } from "./text.js";
|
|
12
6
|
/** The widgets on someone of the party that say their state (a `chip`) and draw it, in their order: each the panel of A (D-516). */
|
|
13
7
|
export function personShown(widgets, name) {
|
|
@@ -21,11 +15,6 @@ export function personBoxes(widgets, name) {
|
|
|
21
15
|
export function saysState({ widget, shows }) {
|
|
22
16
|
return shows.chip !== undefined && widget.own.place === "person";
|
|
23
17
|
}
|
|
24
|
-
/** The widgets on someone of the party, from the page's widgets as last read: their panels and their boxes. */
|
|
25
|
-
export function usePerson(name) {
|
|
26
|
-
const widgets = useContext(WidgetsContext);
|
|
27
|
-
return { panels: personShown(widgets, name), boxes: personBoxes(widgets, name) };
|
|
28
|
-
}
|
|
29
18
|
/**
|
|
30
19
|
* A package's widget on someone as boxes of the line under their name, as the sheet's own values (D-516): a count with its label, its marks or its number; a
|
|
31
20
|
* lead under the widget's title, its words and value; each value under its label.
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
|
2
2
|
// Where the player's character goes when the master asks (D-332, ASK-11): the map of the place over the whole page, its squares at least 44 px, those the
|
|
3
3
|
// character can still reach in gold; a square touched is chosen, then sent. A square can also be written, such as E4, from the keyboard.
|
|
4
4
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
5
|
-
import { Icon } from "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { Icon } from "../icons.js";
|
|
6
|
+
import { t } from "../text.js";
|
|
7
|
+
import { PlaceMap } from "./map-view.js";
|
|
8
|
+
import { isStandable, squareOf } from "./map.js";
|
|
9
9
|
export function MapSheet({ map, place, question, onPick, onClose }) {
|
|
10
10
|
const [selected, setSelected] = useState();
|
|
11
11
|
const [typed, setTyped] = useState("");
|
|
@@ -5,17 +5,17 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
5
5
|
// is where in words, the map's twin.
|
|
6
6
|
import { Fragment } from "preact";
|
|
7
7
|
import { useContext, useEffect, useRef, useState } from "preact/hooks";
|
|
8
|
-
import { TalkName, usePlayerActs } from "
|
|
9
|
-
import { CardHead } from "
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { sideIcons, sideOf } from "
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
8
|
+
import { TalkName, usePlayerActs } from "../acts/names.js";
|
|
9
|
+
import { CardHead } from "../card.js";
|
|
10
|
+
import { Glass, GlassDefs } from "../glass.js";
|
|
11
|
+
import { iconPath } from "../icons.js";
|
|
12
|
+
import { strangerLabel } from "../labels.js";
|
|
13
|
+
import { WidgetsContext } from "../packages/widgets.js";
|
|
14
|
+
import { sideIcons, sideOf } from "../party.js";
|
|
15
|
+
import { conditionsPref, tokenSymbolsPref, useChoice, usePref } from "../prefs.js";
|
|
16
|
+
import { personState, statusMarks, statusWords } from "../status.js";
|
|
17
|
+
import { t } from "../text.js";
|
|
18
|
+
import { columnName, exitSide, floorLoops, groundKinds, isSolid, isStandable, isWalled, kindAt, nextTo, piecesOf, squareName, squareOf, symbolAt, tracedLoop } from "./map.js";
|
|
19
19
|
// How wide a square is drawn, in pixels.
|
|
20
20
|
const size = 40;
|
|
21
21
|
// The order of who is where under the map.
|
package/dist/dashboard/scene.js
CHANGED
|
@@ -2,21 +2,21 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
2
2
|
// The Scene section (D-309, VIEW-6, D-444): where the party is, its picture with the places around it, its name, what holds there and its text; the open
|
|
3
3
|
// scene and who is in it; outside a scene who is there of those the character knows; the map. While the scene goes by turns, the turns first.
|
|
4
4
|
import { useContext, useEffect, useRef, useState } from "preact/hooks";
|
|
5
|
-
import { TalkName } from "./
|
|
5
|
+
import { TalkName } from "./acts/names.js";
|
|
6
6
|
import { sectionAddress } from "./address.js";
|
|
7
|
-
import { WidgetCards, WidgetsContext } from "./extension-widgets.js";
|
|
8
7
|
import { effectLabel, sinceDateLabel, terrainLabel } from "./game-words.js";
|
|
9
8
|
import { cardIcons, Icon } from "./icons.js";
|
|
10
9
|
import { phraseLabel, sceneTypeLabel, strangerLabel } from "./labels.js";
|
|
11
10
|
import { biomeLabel, biomes } from "./map-symbols.js";
|
|
12
11
|
import { InlineText, knowersOf, Markdown } from "./markdown.js";
|
|
12
|
+
import { WidgetCards, WidgetsContext } from "./packages/widgets.js";
|
|
13
13
|
import { sideOf, Token } from "./party.js";
|
|
14
|
-
import { PlaceMap } from "./place
|
|
14
|
+
import { PlaceMap } from "./place/map-view.js";
|
|
15
15
|
import { Card } from "./sheet.js";
|
|
16
16
|
import { downTint, personState, StatusPip } from "./status.js";
|
|
17
17
|
import { foldedText, t } from "./text.js";
|
|
18
18
|
import { CharacterCard, hasTurns, TurnBand, TurnsCard } from "./turns.js";
|
|
19
|
-
import { BiomeSwatch } from "./world.js";
|
|
19
|
+
import { BiomeSwatch } from "./world/world.js";
|
|
20
20
|
// How long the band takes to come in or go out, the style sheet's --short, as the master's question folds.
|
|
21
21
|
const bandTime = 250;
|
|
22
22
|
/**
|
|
@@ -3,11 +3,11 @@ import { useContext, useEffect, useRef, useState } from "preact/hooks";
|
|
|
3
3
|
import { sectionLabel } from "./address.js";
|
|
4
4
|
import { changeSetting, readSettings } from "./api.js";
|
|
5
5
|
import { coinDesignPref, coinDesigns, coinLook, coinMetals, coinPref, diceEdgesPref, diceLook, diceSetPref, diceSets, texturePath } from "./dice/sets.js";
|
|
6
|
-
import { WidgetsContext } from "./extension-widgets.js";
|
|
7
6
|
import { CoinFace } from "./faces.js";
|
|
8
7
|
import { DieSwatch, Icon } from "./icons.js";
|
|
9
8
|
import { phraseLabel, settingLabel, valueLabel } from "./labels.js";
|
|
10
9
|
import { LanguageChoice, languageLine } from "./language-choice.js";
|
|
10
|
+
import { WidgetsContext } from "./packages/widgets.js";
|
|
11
11
|
import { PageHead } from "./pages.js";
|
|
12
12
|
import { byHandPref, conditionsPref, readChoice, soundPref, tokenSymbolsPref, useChoice, usePref, usePrefChange, writeChoice } from "./prefs.js";
|
|
13
13
|
import { Confirm } from "./saves.js";
|
package/dist/dashboard/sheet.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
2
|
import { useContext, useEffect, useId, useRef, useState } from "preact/hooks";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { itemVerbs } from "./acts/acts.js";
|
|
4
|
+
import { ActName, usePlayerActs } from "./acts/names.js";
|
|
5
5
|
import { readExplanations } from "./api.js";
|
|
6
6
|
import { CardHeader, useOpen } from "./card.js";
|
|
7
7
|
import { FixedColumns } from "./columns.js";
|
|
8
|
-
import { WidgetCards, WidgetsContext } from "./extension-widgets.js";
|
|
9
8
|
import { besideLabel, memberPlaceLabel } from "./game-words.js";
|
|
10
9
|
import { cardIcons, DieIcon, Icon } from "./icons.js";
|
|
11
10
|
import { fieldLabel, groupLabels, phraseLabel, readableIds, rollLabel, shownNotation, shownText } from "./labels.js";
|
|
12
11
|
import { arrangedGroups, groupLayout, orderedValues, widgetOf } from "./layout.js";
|
|
13
12
|
import { knowersOf, Markdown, plainLine } from "./markdown.js";
|
|
14
13
|
import { MoodFace, moodLabel } from "./mood.js";
|
|
14
|
+
import { WidgetCards, WidgetsContext } from "./packages/widgets.js";
|
|
15
15
|
import { MemberToken } from "./party.js";
|
|
16
16
|
import { PersonBoxes, personBoxes, personFields, PersonPanel, personShown } from "./person-panel.js";
|
|
17
17
|
import { requestedRow, useRequested } from "./requested.js";
|
|
@@ -118,7 +118,7 @@ function Group({ member, group, fields, version, onRoll, first }) {
|
|
|
118
118
|
const line = (value) => ({ value, label: label(value.field), fields, tip: tip(value), tabIndex: stop(value.field), onRoll: throwOf, answers: answersOf(value) });
|
|
119
119
|
// A card with the number the master asks stays open while it is asked.
|
|
120
120
|
const lit = values.some((value) => answersOf(value) !== undefined);
|
|
121
|
-
return (_jsxs(Card, { name: group.name, title: systemWord("groups", group.name), icon: group.icon ?? cardIcons.plain, layout: layout, preview: preview(group, label), onReach: explain, held: lit, first: first, children: [layout === "table" && values.length > 0 && (_jsx("div", { class: "rows", onKeyDown: onKeyDown, children: values.map((value) => _jsx(Row, { ...line(value) }, value.field)) })), layout === "table" && _jsx(ItemsTable, { group: group, fields: fields }), layout === "tiles" && (_jsx("div", { class: "tiles", onKeyDown: onKeyDown, children: values.map((value) => _jsx(Tile, { ...line(value) }, value.field)) })), layout === "rows" && (_jsx("div", { class: "rows", onKeyDown: onKeyDown, children: values.map((value) => _jsx(Row, { ...line(value) }, value.field)) }))] }));
|
|
121
|
+
return (_jsxs(Card, { name: group.name, title: systemWord("groups", group.name) ?? systemWord("words", group.name), icon: group.icon ?? cardIcons.plain, layout: layout, preview: preview(group, label), onReach: explain, held: lit, first: first, children: [layout === "table" && values.length > 0 && (_jsx("div", { class: "rows", onKeyDown: onKeyDown, children: values.map((value) => _jsx(Row, { ...line(value) }, value.field)) })), layout === "table" && _jsx(ItemsTable, { group: group, fields: fields }), layout === "tiles" && (_jsx("div", { class: "tiles", onKeyDown: onKeyDown, children: values.map((value) => _jsx(Tile, { ...line(value) }, value.field)) })), layout === "rows" && (_jsx("div", { class: "rows", onKeyDown: onKeyDown, children: values.map((value) => _jsx(Row, { ...line(value) }, value.field)) }))] }));
|
|
122
122
|
}
|
|
123
123
|
/** A card of the sheet the player opens and closes (D-284): its icon and title on the left, what it holds while closed, the chevron on the right. */
|
|
124
124
|
export function Card({ name, title, icon, layout, preview, onReach, held, first, children }) {
|
package/dist/dashboard/text.js
CHANGED
|
@@ -93,6 +93,12 @@ export function systemWord(kind, english) {
|
|
|
93
93
|
const words = system[kind] ?? {};
|
|
94
94
|
return Object.hasOwn(words, english) ? words[english] : undefined;
|
|
95
95
|
}
|
|
96
|
+
/** A word of the game system whatever its capitals, as an effect written by hand: prone as Prone. */
|
|
97
|
+
export function systemWordAnyCase(kind, english) {
|
|
98
|
+
const words = system[kind] ?? {};
|
|
99
|
+
const key = Object.hasOwn(words, english) ? english : Object.keys(words).find((word) => word.toLowerCase() === english.toLowerCase());
|
|
100
|
+
return key === undefined ? undefined : words[key];
|
|
101
|
+
}
|
|
96
102
|
/**
|
|
97
103
|
* A phrase of the page in its language, or a text of the game system in its words, each {name} filled from values; the English where it has none. In a
|
|
98
104
|
* language written from right to left each value is isolated, so that a name, a number or a notation keeps its own order: +2, 1d20+5.
|
package/dist/dashboard/top.js
CHANGED
|
@@ -7,11 +7,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
7
7
|
import { Fragment } from "preact";
|
|
8
8
|
import { useEffect, useLayoutEffect, useRef, useState } from "preact/hooks";
|
|
9
9
|
import { menuPages, packagePages, sectionAddress, sectionLabel, sections } from "./address.js";
|
|
10
|
-
import { Drawn, WidgetChips } from "./extension-widgets.js";
|
|
11
10
|
import { calendarDayLabel, gameDateLabel } from "./game-words.js";
|
|
12
11
|
import { Icon } from "./icons.js";
|
|
13
12
|
import { Master } from "./master.js";
|
|
14
|
-
import { ownKey } from "./page-code.js";
|
|
13
|
+
import { ownKey } from "./packages/page-code.js";
|
|
14
|
+
import { Drawn, WidgetChips } from "./packages/widgets.js";
|
|
15
15
|
import { usePrefChange } from "./prefs.js";
|
|
16
16
|
import { t } from "./text.js";
|
|
17
17
|
import { pickTheme, shownTheme } from "./theme.js";
|
package/dist/dashboard/turns.js
CHANGED
|
@@ -4,12 +4,12 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
4
4
|
// strip that lights up on their turn, their counter, the party's as numbers and a foe's in words, their state as icons, what they keep, the death saves at 0;
|
|
5
5
|
// and the player's character's card, the fields and groups of its sheet the system names. The page never decides a rule: it shows.
|
|
6
6
|
import { useContext, useEffect, useRef } from "preact/hooks";
|
|
7
|
-
import { TalkName } from "./
|
|
7
|
+
import { TalkName } from "./acts/names.js";
|
|
8
8
|
import { CardHead, CardHeader, useOpen } from "./card.js";
|
|
9
|
-
import { WidgetsContext } from "./extension-widgets.js";
|
|
10
9
|
import { Icon, iconPath } from "./icons.js";
|
|
11
10
|
import { fieldLabel, itemLabel, phraseLabel, shownText, strangerLabel } from "./labels.js";
|
|
12
11
|
import { stripCounter } from "./layout.js";
|
|
12
|
+
import { WidgetsContext } from "./packages/widgets.js";
|
|
13
13
|
import { sideOf, Token } from "./party.js";
|
|
14
14
|
import { PersonPanel, personShown } from "./person-panel.js";
|
|
15
15
|
import { SheetAtHand } from "./sheet.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
// The widgets of a value (D-273, D-284): pips, a bar, a track centred on zero, a number's progress, chips or a list of sentences; each says its value in words
|
|
3
3
|
// for a screen reader.
|
|
4
|
-
import { ActName, usePlayerActs } from "./
|
|
4
|
+
import { ActName, usePlayerActs } from "./acts/names.js";
|
|
5
5
|
import { Coins } from "./coins.js";
|
|
6
6
|
import { besideLabel, burnsLabel, effectEndLabel, effectLabel, effectName } from "./game-words.js";
|
|
7
7
|
import { itemLabel, shownText } from "./labels.js";
|
|
@@ -4,13 +4,13 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
4
4
|
// the story lit, the scenes and deadlines marked, and the day chosen with what it holds, its scenes with their place leading to the Journal. Without a
|
|
5
5
|
// calendar start, the days of the story in the same rows, by their number.
|
|
6
6
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
7
|
-
import { sectionAddress } from "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
7
|
+
import { sectionAddress } from "../address.js";
|
|
8
|
+
import { CardHead, useMedia } from "../card.js";
|
|
9
|
+
import { calendarDayLabel, calendarMonthLabel, gameDateLabel, seasonLabel } from "../game-words.js";
|
|
10
|
+
import { Icon, iconPath } from "../icons.js";
|
|
11
|
+
import { Deadline } from "../journal.js";
|
|
12
|
+
import { arrowStep, capitalized, isolated, listText, t } from "../text.js";
|
|
13
|
+
import { calendarDateOf, dayMarks, monthAt, monthOffsetOf, storyDays } from "./days.js";
|
|
14
14
|
export function CalendarTab({ calendar }) {
|
|
15
15
|
const narrow = useMedia("(max-width: 600px)");
|
|
16
16
|
const row = narrow ? 5 : 10;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { foldedText } from "
|
|
1
|
+
import { foldedText } from "../text.js";
|
|
2
2
|
/** The groups of the lore, in the order the list shows them: people, places, factions, creatures, items, tales and events, then the rest. */
|
|
3
3
|
const loreGroups = ["people", "places", "factions", "creatures", "items", "tales", "other"];
|
|
4
4
|
/** The group a page belongs to, by its type. */
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
3
|
-
import { sectionAddress } from "
|
|
4
|
-
import { pictureAddress, readView } from "
|
|
5
|
-
import { useMedia } from "
|
|
6
|
-
import { Icon } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { sectionAddress } from "../address.js";
|
|
4
|
+
import { pictureAddress, readView } from "../api.js";
|
|
5
|
+
import { useMedia } from "../card.js";
|
|
6
|
+
import { Icon } from "../icons.js";
|
|
7
|
+
import { placeKindLabel, placeKinds } from "../map-symbols.js";
|
|
8
|
+
import { knowersOf, Markdown, plainLine } from "../markdown.js";
|
|
9
|
+
import { Token } from "../party.js";
|
|
10
|
+
import { arrowStep, capitalized, foldedText, t } from "../text.js";
|
|
11
|
+
import { documentLook, foundLore, groupedLore, knownTo, loreGroupOf } from "./known.js";
|
|
12
12
|
// From this width the reader stands beside the list.
|
|
13
13
|
const wide = "(min-width: 900px)";
|
|
14
14
|
/**
|
|
@@ -4,20 +4,20 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
4
4
|
// wheel, touch and the keys; a place opens its card. The page draws only what view gives with map and world (VIEW-7, VIEW-11): a place the character does not
|
|
5
5
|
// know never reaches it.
|
|
6
6
|
import { useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
7
|
-
import { sectionAddress } from "
|
|
8
|
-
import { pictureAddress, readMap, readView, readWorld } from "
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { PageHead } from "
|
|
16
|
-
import { PageTabs } from "
|
|
17
|
-
import { t } from "
|
|
18
|
-
import { CalendarTab } from "./
|
|
19
|
-
import { DocumentsTab, LoreTab } from "./
|
|
20
|
-
import { clampScale, fading, fitView, hexCorners, hexesOf, lengthText, liftedOf, mapLayout, mapNameOf, mapPart, marksOf, nameRun, nameShares, pathOf, placeAreaLabels, placeLabels, regionEdges, riverOutline, scaleBar, trailCourse, waterOf, wayShapes, waysOf, zoomedView, } from "./
|
|
7
|
+
import { sectionAddress } from "../address.js";
|
|
8
|
+
import { pictureAddress, readMap, readView, readWorld } from "../api.js";
|
|
9
|
+
import { fromLabel, terrainLabel } from "../game-words.js";
|
|
10
|
+
import { Glass, GlassDefs } from "../glass.js";
|
|
11
|
+
import { Icon } from "../icons.js";
|
|
12
|
+
import { biomeLabel, biomes, placeKindLabel, placeKinds, symbolRadius } from "../map-symbols.js";
|
|
13
|
+
import { plainLine } from "../markdown.js";
|
|
14
|
+
import { WidgetCards } from "../packages/widgets.js";
|
|
15
|
+
import { PageHead } from "../pages.js";
|
|
16
|
+
import { PageTabs } from "../tabs.js";
|
|
17
|
+
import { t } from "../text.js";
|
|
18
|
+
import { CalendarTab } from "./calendar.js";
|
|
19
|
+
import { DocumentsTab, LoreTab } from "./lore.js";
|
|
20
|
+
import { clampScale, fading, fitView, hexCorners, hexesOf, lengthText, liftedOf, mapLayout, mapNameOf, mapPart, marksOf, nameRun, nameShares, pathOf, placeAreaLabels, placeLabels, regionEdges, riverOutline, scaleBar, trailCourse, waterOf, wayShapes, waysOf, zoomedView, } from "./map.js";
|
|
21
21
|
// How wide the map shows around the party at first on a phone, in km; how much a step of the zoom and of the keys moves.
|
|
22
22
|
const phoneSpan = 46;
|
|
23
23
|
const zoomStep = 1.5;
|
package/dist/dice/evaluate.js
CHANGED
|
@@ -49,7 +49,7 @@ function rollDiceTerm(term, nextFace) {
|
|
|
49
49
|
let lastFace = die.value;
|
|
50
50
|
while (matches(term.explode.condition, lastFace)) {
|
|
51
51
|
if (++explosionCount > maxExplosions) {
|
|
52
|
-
throw new DiceError("Too many explosions in a single roll.");
|
|
52
|
+
throw new DiceError("Too many explosions in a single roll: explode on fewer faces, such as 1d10!>=10.");
|
|
53
53
|
}
|
|
54
54
|
lastFace = nextFace(term.sides);
|
|
55
55
|
if (term.explode.compound) {
|
package/dist/dice/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { type CoinSide, coinSides, type CoinToss, mostCoins, tossCoins } from "./coins.ts";
|
|
2
|
-
export { DiceError, parseNotation } from "./notation.ts";
|
|
3
|
-
export { askOracle, type OracleAnswer,
|
|
2
|
+
export { DiceError, diceProblem, parseNotation } from "./notation.ts";
|
|
3
|
+
export { askOracle, type OracleAnswer, oracleResult } from "./oracle.ts";
|
|
4
4
|
export { createProof, fingerprint, sha256 } from "./proof.ts";
|
|
5
5
|
export { type DiceRoll, type FaceSource, rollDice, type ThrownDie } from "./roll-dice.ts";
|
|
6
6
|
export { type RandomTable, readRandomTable, rollOnTable, type TableRoll, type TableRow } from "./tables.ts";
|
package/dist/dice/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Dice for any game: notation, digital or physical faces, proofs for hidden rolls, random tables, a yes/no oracle, coins. Depends on nothing else in rpg-engine.
|
|
2
2
|
export { coinSides, mostCoins, tossCoins } from "./coins.js";
|
|
3
|
-
export { DiceError, parseNotation } from "./notation.js";
|
|
4
|
-
export { askOracle,
|
|
3
|
+
export { DiceError, diceProblem, parseNotation } from "./notation.js";
|
|
4
|
+
export { askOracle, oracleResult } from "./oracle.js";
|
|
5
5
|
export { createProof, fingerprint, sha256 } from "./proof.js";
|
|
6
6
|
export { rollDice } from "./roll-dice.js";
|
|
7
7
|
export { readRandomTable, rollOnTable } from "./tables.js";
|
package/dist/dice/notation.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export type Term = DiceTerm | ConstantTerm;
|
|
|
36
36
|
/** A dice error the user or the AI can fix: its message says how. */
|
|
37
37
|
export declare class DiceError extends Error {
|
|
38
38
|
}
|
|
39
|
+
/** What keeps a text from reading as dice to roll, as parseNotation says it; a text of no dice, as a number alone, is no roll either. Undefined when it reads. */
|
|
40
|
+
export declare function diceProblem(text: string): string | undefined;
|
|
39
41
|
/** Reads a notation valid for any game, such as `1d20+5`, `2d20kh1`, `4d6dl1`, `2d6ro<=2`, `1d6!`, `6d10>=8`, `4dF`, `d%`. */
|
|
40
42
|
export declare function parseNotation(notation: string): Term[];
|
|
41
43
|
/** How many dice the roll needs at least, before rerolls and explosions. */
|
package/dist/dice/notation.js
CHANGED
|
@@ -4,16 +4,31 @@ export class DiceError extends Error {
|
|
|
4
4
|
const maxTerms = 20;
|
|
5
5
|
const maxDice = 100;
|
|
6
6
|
const maxSides = 1000;
|
|
7
|
+
const maxConstant = 1_000_000;
|
|
8
|
+
// What a notation that does not read is told, for any game: the shapes it takes.
|
|
9
|
+
const notationForm = "write dice as 1d20+5, 2d20kh1, 4d6dl1, 2d6ro<=2, 1d6!, 6d10>=8, 4dF or d%";
|
|
7
10
|
const conditionPattern = /^(<=|>=|<|>|=)(\d+)/;
|
|
11
|
+
/** What keeps a text from reading as dice to roll, as parseNotation says it; a text of no dice, as a number alone, is no roll either. Undefined when it reads. */
|
|
12
|
+
export function diceProblem(text) {
|
|
13
|
+
try {
|
|
14
|
+
return parseNotation(text).some((term) => term.kind === "dice") ? undefined : `${text} holds no dice.`;
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
if (error instanceof DiceError) {
|
|
18
|
+
return error.message;
|
|
19
|
+
}
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
8
23
|
/** Reads a notation valid for any game, such as `1d20+5`, `2d20kh1`, `4d6dl1`, `2d6ro<=2`, `1d6!`, `6d10>=8`, `4dF`, `d%`. */
|
|
9
24
|
export function parseNotation(notation) {
|
|
10
25
|
const compact = notation.replace(/\s+/g, "");
|
|
11
26
|
if (compact === "") {
|
|
12
|
-
throw new DiceError(
|
|
27
|
+
throw new DiceError(`The dice notation is empty: ${notationForm}.`);
|
|
13
28
|
}
|
|
14
29
|
const signedTerms = compact.match(/[+-]?[^+-]+/g) ?? [];
|
|
15
30
|
if (signedTerms.join("") !== compact) {
|
|
16
|
-
throw new DiceError(`Cannot read "${notation}".`);
|
|
31
|
+
throw new DiceError(`Cannot read "${notation}": ${notationForm}.`);
|
|
17
32
|
}
|
|
18
33
|
if (signedTerms.length > maxTerms) {
|
|
19
34
|
throw new DiceError(`Too many terms in "${notation}" (at most ${maxTerms}).`);
|
|
@@ -42,11 +57,14 @@ function parseTerm(signedTerm, notation) {
|
|
|
42
57
|
const sign = signedTerm.startsWith("-") ? -1 : 1;
|
|
43
58
|
const termText = signedTerm.replace(/^[+-]/, "");
|
|
44
59
|
if (/^\d+$/.test(termText)) {
|
|
60
|
+
if (Number(termText) > maxConstant) {
|
|
61
|
+
throw new DiceError(`"${termText}": a number added to the dice is ${maxConstant} at most.`);
|
|
62
|
+
}
|
|
45
63
|
return { kind: "constant", sign, value: Number(termText) };
|
|
46
64
|
}
|
|
47
65
|
const match = /^(\d*)d(\d+|%|F)(.*)$/i.exec(termText);
|
|
48
66
|
if (!match) {
|
|
49
|
-
throw new DiceError(`Cannot read "${termText}" in "${notation}".`);
|
|
67
|
+
throw new DiceError(`Cannot read "${termText}" in "${notation}": ${notationForm}.`);
|
|
50
68
|
}
|
|
51
69
|
const [, countText, sidesText, modifiers] = match;
|
|
52
70
|
const count = countText === "" ? 1 : Number(countText);
|
|
@@ -111,7 +129,7 @@ function parseModifiers(modifiers, term, termText) {
|
|
|
111
129
|
term.success = toCondition(match[1], match[2]);
|
|
112
130
|
}
|
|
113
131
|
else {
|
|
114
|
-
throw new DiceError(`"${termText}": unknown modifier "${remaining}".`);
|
|
132
|
+
throw new DiceError(`"${termText}": unknown modifier "${remaining}": ${notationForm}.`);
|
|
115
133
|
}
|
|
116
134
|
remaining = remaining.slice(match[0].length);
|
|
117
135
|
}
|
package/dist/documents/markup.js
CHANGED
|
@@ -104,11 +104,11 @@ export function rtfText(rtf) {
|
|
|
104
104
|
function paragraphs(text) {
|
|
105
105
|
return text
|
|
106
106
|
.split(/\n\s*\n/)
|
|
107
|
-
.map((block) => block.replace(/[ \t
|
|
107
|
+
.map((block) => block.replace(/[ \t\u00a0]+/g, " ").replace(/ *\n */g, "\n").trim())
|
|
108
108
|
.filter((block) => block !== "")
|
|
109
109
|
.join("\n\n");
|
|
110
110
|
}
|
|
111
|
-
const named = { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'", nbsp: "
|
|
111
|
+
const named = { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'", nbsp: "\u00a0", mdash: "—", ndash: "–", hellip: "…", lsquo: "‘", rsquo: "’", ldquo: "“", rdquo: "”" };
|
|
112
112
|
function entities(text) {
|
|
113
113
|
return text.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (whole, name) => {
|
|
114
114
|
if (name.startsWith("#")) {
|
package/dist/documents/read.js
CHANGED
|
@@ -2,12 +2,17 @@ import { unzipSync } from "fflate";
|
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
4
4
|
import { basename, extname, join, posix, relative, resolve } from "node:path";
|
|
5
|
+
import { textSize } from "../core/text.js";
|
|
5
6
|
import { htmlText, openDocumentText, pictureMark, rtfText, wordText } from "./markup.js";
|
|
6
7
|
import { pngOf } from "./png.js";
|
|
7
8
|
/** The kinds of file a document may be, by their extension. */
|
|
8
9
|
export const documentKinds = [".pdf", ".docx", ".odt", ".epub", ".html", ".htm", ".xhtml", ".rtf", ".txt", ".md"];
|
|
9
10
|
/** The most pictures a document gives, and the longest side of each. */
|
|
10
11
|
const mostPictures = 300;
|
|
12
|
+
// What a .docx, .odt or .epub may unpack to, its text and pictures alone, as an adventure (ADV-1): never a file of zeros that fills the memory.
|
|
13
|
+
const largestUnpacked = 512 * 1024 * 1024;
|
|
14
|
+
// The files of a packed document the reader uses: its XML, relations, chapters and pictures.
|
|
15
|
+
const unpackedKinds = /\.(?:xml|rels|opf|xhtml|html?|ncx|png|jpe?g|webp|svg)$/i;
|
|
11
16
|
const longestSide = 1600;
|
|
12
17
|
// Smaller pictures are ornaments, letters or icons; a picture on more pages than this is a page's decoration.
|
|
13
18
|
const smallestSide = 160;
|
|
@@ -197,7 +202,7 @@ function readText(kind, bytes, file, name) {
|
|
|
197
202
|
const parts = [];
|
|
198
203
|
let words = 0;
|
|
199
204
|
for (const block of blocks.filter((one) => one.trim() !== "").flatMap(pageSized)) {
|
|
200
|
-
const count =
|
|
205
|
+
const count = textSize(block);
|
|
201
206
|
if (parts.length === 0 || words + count > partWords) {
|
|
202
207
|
parts.push({ label: "", text: block });
|
|
203
208
|
words = count;
|
|
@@ -241,14 +246,9 @@ function lockOf(kind, bytes) {
|
|
|
241
246
|
? "is locked by DRM"
|
|
242
247
|
: undefined;
|
|
243
248
|
}
|
|
244
|
-
/** How long a text is, in words: a Chinese, Japanese or Korean letter counts as one, as a model reads it; else about six letters a word. */
|
|
245
|
-
function sizeOf(text) {
|
|
246
|
-
const letters = text.match(/[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af]/gu)?.length ?? 0;
|
|
247
|
-
return Math.max(text.split(/\s+/).filter((word) => word !== "").length + letters, Math.ceil(text.length / 6));
|
|
248
|
-
}
|
|
249
249
|
// A block longer than a page, as a text with a line for each paragraph or with no spaces, cut by its lines, then by its length.
|
|
250
250
|
function pageSized(block) {
|
|
251
|
-
if (
|
|
251
|
+
if (textSize(block) <= partWords) {
|
|
252
252
|
return [block];
|
|
253
253
|
}
|
|
254
254
|
const lines = block.split("\n");
|
|
@@ -256,7 +256,7 @@ function pageSized(block) {
|
|
|
256
256
|
const cut = [];
|
|
257
257
|
for (const line of lines) {
|
|
258
258
|
const last = cut.at(-1);
|
|
259
|
-
if (last !== undefined &&
|
|
259
|
+
if (last !== undefined && textSize(`${last}\n${line}`) <= partWords) {
|
|
260
260
|
cut[cut.length - 1] = `${last}\n${line}`;
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
@@ -266,7 +266,7 @@ function pageSized(block) {
|
|
|
266
266
|
return cut.flatMap(pageSized);
|
|
267
267
|
}
|
|
268
268
|
// A block of one line is cut by its length: as many letters as make a page by sizeOf.
|
|
269
|
-
const letters = Math.max(1, Math.floor((block.length * partWords) /
|
|
269
|
+
const letters = Math.max(1, Math.floor((block.length * partWords) / textSize(block)));
|
|
270
270
|
return Array.from({ length: Math.ceil(block.length / letters) }, (_, index) => block.slice(index * letters, (index + 1) * letters));
|
|
271
271
|
}
|
|
272
272
|
// A text file in UTF-8, or in UTF-16 by its mark, or else in the Windows encoding older editors wrote.
|
|
@@ -285,12 +285,12 @@ function decoded(bytes) {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
function fromPlain(kind, bytes) {
|
|
288
|
-
const text = decoded(bytes).replace(
|
|
288
|
+
const text = decoded(bytes).replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n");
|
|
289
289
|
return { text: kind === ".rtf" ? rtfText(text) : kind === ".txt" || kind === ".md" ? text.trim() : htmlText(text), files: {} };
|
|
290
290
|
}
|
|
291
291
|
// A Word document: its text from word/document.xml, its pictures by the ids its relations give them.
|
|
292
292
|
function fromWord(bytes) {
|
|
293
|
-
const zip =
|
|
293
|
+
const zip = unpacked(bytes);
|
|
294
294
|
const xml = textOf(zip, "word/document.xml");
|
|
295
295
|
if (xml === undefined) {
|
|
296
296
|
throw new Error("This .docx has no word/document.xml: it is no Word document, or it is damaged. Save it again from the program that made it.");
|
|
@@ -315,7 +315,7 @@ function fromWord(bytes) {
|
|
|
315
315
|
return { text, files };
|
|
316
316
|
}
|
|
317
317
|
function fromOpenDocument(bytes) {
|
|
318
|
-
const zip =
|
|
318
|
+
const zip = unpacked(bytes);
|
|
319
319
|
const xml = textOf(zip, "content.xml");
|
|
320
320
|
if (xml === undefined) {
|
|
321
321
|
throw new Error("This .odt has no content.xml: it is no OpenDocument text, or it is damaged. Save it again from the program that made it.");
|
|
@@ -324,7 +324,7 @@ function fromOpenDocument(bytes) {
|
|
|
324
324
|
}
|
|
325
325
|
// An EPUB: its chapters in the order of its spine, its pictures by their path in the book.
|
|
326
326
|
function fromEpub(bytes) {
|
|
327
|
-
const zip =
|
|
327
|
+
const zip = unpacked(bytes);
|
|
328
328
|
const root = /full-path="([^"]+)"/.exec(textOf(zip, "META-INF/container.xml") ?? "")?.[1];
|
|
329
329
|
const opf = root === undefined ? undefined : textOf(zip, root);
|
|
330
330
|
if (root === undefined || opf === undefined) {
|
|
@@ -344,6 +344,22 @@ function fromEpub(bytes) {
|
|
|
344
344
|
.join("\n\n");
|
|
345
345
|
return { text, files: zip };
|
|
346
346
|
}
|
|
347
|
+
/** A packed document's files that the reader uses, unpacked up to a size; it throws, saying what to do, past it. */
|
|
348
|
+
function unpacked(bytes) {
|
|
349
|
+
let declared = 0;
|
|
350
|
+
return unzipSync(bytes, {
|
|
351
|
+
filter: (file) => {
|
|
352
|
+
if (!unpackedKinds.test(file.name)) {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
declared += file.originalSize;
|
|
356
|
+
if (declared > largestUnpacked) {
|
|
357
|
+
throw new Error(`This document unpacks to more than ${largestUnpacked / 1024 / 1024} MB of text and pictures: save it again without its largest pictures, or as a PDF.`);
|
|
358
|
+
}
|
|
359
|
+
return true;
|
|
360
|
+
},
|
|
361
|
+
});
|
|
362
|
+
}
|
|
347
363
|
// A path an EPUB writes encoded, as it is when it is not: a % in a file's name.
|
|
348
364
|
function uriDecoded(path) {
|
|
349
365
|
try {
|
package/dist/effects/effect.js
CHANGED
|
@@ -40,7 +40,7 @@ export function readEffects(value) {
|
|
|
40
40
|
if ("problem" in read) {
|
|
41
41
|
return read;
|
|
42
42
|
}
|
|
43
|
-
if (effects.some((effect) =>
|
|
43
|
+
if (effects.some((effect) => sameWord(effect.name, read.effect.name))) {
|
|
44
44
|
return { problem: `The effect ${read.effect.name} is written twice: keep one.` };
|
|
45
45
|
}
|
|
46
46
|
effects.push(read.effect);
|
|
@@ -87,7 +87,7 @@ export function endsAtTurn(end, round, turn, order) {
|
|
|
87
87
|
if (round !== end.round) {
|
|
88
88
|
return round > end.round;
|
|
89
89
|
}
|
|
90
|
-
return
|
|
90
|
+
return sameWord(turn, end.turn) || !order.some((name) => sameWord(name, end.turn));
|
|
91
91
|
}
|
|
92
92
|
function withEnd(effect, endText) {
|
|
93
93
|
const text = endText.trim();
|
|
@@ -121,6 +121,3 @@ function asLine(item) {
|
|
|
121
121
|
function pageName(text) {
|
|
122
122
|
return text.trim().replace(/^\[\[(.*?)(?:\|.*)?\]\]$/, "$1").trim();
|
|
123
123
|
}
|
|
124
|
-
function sameName(first, second) {
|
|
125
|
-
return comparableText(first.trim()) === comparableText(second.trim());
|
|
126
|
-
}
|