rpg-engine 0.4.1 → 0.5.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/README.md +1 -1
- package/dist/commands/ask.d.ts +37 -2
- package/dist/commands/ask.js +46 -17
- package/dist/commands/config.js +4 -2
- package/dist/commands/game-extension-list.js +12 -0
- package/dist/commands/game-extensions.d.ts +1 -1
- package/dist/commands/game-extensions.js +242 -17
- package/dist/commands/game-system-code.d.ts +9 -1
- package/dist/commands/game-system-code.js +27 -11
- package/dist/commands/game-widgets.d.ts +6 -1
- package/dist/commands/game-widgets.js +52 -4
- package/dist/commands/game-world.d.ts +15 -3
- package/dist/commands/game-world.js +45 -14
- package/dist/commands/package.d.ts +7 -1
- package/dist/commands/package.js +17 -2
- package/dist/commands/scene.d.ts +1 -1
- package/dist/commands/view.d.ts +4 -0
- package/dist/commands/view.js +5 -3
- package/dist/core/context.d.ts +19 -0
- package/dist/core/files.d.ts +2 -0
- package/dist/core/files.js +10 -1
- package/dist/core/registry.d.ts +2 -0
- package/dist/dashboard/api.js +11 -3
- package/dist/dashboard/app.js +88 -8
- package/dist/dashboard/ask-card.js +118 -0
- package/dist/dashboard/dice/tray.js +5 -3
- package/dist/dashboard/extension-widgets.js +35 -9
- package/dist/dashboard/faces.js +6 -4
- package/dist/dashboard/help.js +10 -3
- package/dist/dashboard/i18n/ar.json +9 -0
- package/dist/dashboard/i18n/cs.json +9 -0
- package/dist/dashboard/i18n/da.json +9 -0
- package/dist/dashboard/i18n/de.json +9 -0
- package/dist/dashboard/i18n/el.json +9 -0
- package/dist/dashboard/i18n/es.json +9 -0
- package/dist/dashboard/i18n/fi.json +9 -0
- package/dist/dashboard/i18n/fr.json +9 -0
- package/dist/dashboard/i18n/he.json +9 -0
- package/dist/dashboard/i18n/hi.json +9 -0
- package/dist/dashboard/i18n/hu.json +9 -0
- package/dist/dashboard/i18n/is.json +9 -0
- package/dist/dashboard/i18n/it.json +9 -0
- package/dist/dashboard/i18n/ja.json +9 -0
- package/dist/dashboard/i18n/ko.json +9 -0
- package/dist/dashboard/i18n/nb.json +9 -0
- package/dist/dashboard/i18n/nl.json +9 -0
- package/dist/dashboard/i18n/pl.json +9 -0
- package/dist/dashboard/i18n/pt.json +9 -0
- package/dist/dashboard/i18n/ro.json +9 -0
- package/dist/dashboard/i18n/ru.json +9 -0
- package/dist/dashboard/i18n/sv.json +9 -0
- package/dist/dashboard/i18n/tr.json +9 -0
- package/dist/dashboard/i18n/uk.json +9 -0
- package/dist/dashboard/i18n/zh.json +9 -0
- package/dist/dashboard/pack-card.js +92 -0
- package/dist/dashboard/packages.js +11 -4
- package/dist/dashboard/rolls.js +2 -2
- package/dist/dashboard/style.css +521 -3
- package/dist/dashboard-server.js +57 -1
- package/dist/extensions/api.d.ts +148 -17
- package/dist/extensions/extension.d.ts +10 -3
- package/dist/extensions/extension.js +16 -3
- package/dist/extensions/index.d.ts +3 -3
- package/dist/extensions/index.js +2 -2
- package/dist/extensions/packages.d.ts +8 -0
- package/dist/extensions/packages.js +48 -1
- package/dist/extensions/words.d.ts +2 -1
- package/dist/extensions/words.js +5 -4
- package/dist/index.d.ts +1 -1
- package/dist/mcp-server.js +1 -1
- package/dist/pages/index.d.ts +1 -1
- package/dist/pages/index.js +1 -1
- package/dist/pages/standard-fields.d.ts +2 -0
- package/dist/pages/standard-fields.js +8 -1
- package/dist/systems/game-system.d.ts +14 -9
- package/dist/systems/game-system.js +29 -19
- package/dist/systems/index.d.ts +1 -1
- package/dist/testing.d.ts +61 -0
- package/dist/testing.js +162 -0
- package/package.json +7 -2
package/dist/dashboard/style.css
CHANGED
|
@@ -3475,6 +3475,22 @@ a {
|
|
|
3475
3475
|
margin: 0;
|
|
3476
3476
|
}
|
|
3477
3477
|
|
|
3478
|
+
/* At the guide's end, how to tell us what went wrong: two lines and the link to GitHub. */
|
|
3479
|
+
.help-report .card-body p {
|
|
3480
|
+
max-width: 64ch;
|
|
3481
|
+
margin: 0 0 8px;
|
|
3482
|
+
line-height: 1.55;
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
.help-report .help-report-note {
|
|
3486
|
+
color: var(--muted);
|
|
3487
|
+
font-size: 0.85rem;
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3490
|
+
.help-report .about-link {
|
|
3491
|
+
margin-top: 4px;
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3478
3494
|
/* The guide's text in its cards (D-413): its headings in the accent, its tables scrolling inside their card, its commands to copy, the chat's lines quoted. */
|
|
3479
3495
|
.guide p,
|
|
3480
3496
|
.guide ul,
|
|
@@ -3861,12 +3877,15 @@ a.status-chip.widget-chip {
|
|
|
3861
3877
|
gap: var(--gap);
|
|
3862
3878
|
}
|
|
3863
3879
|
|
|
3880
|
+
/* Two columns that the tracks share, so that the pips of each start in one line; the labels take at most half, and wrap. */
|
|
3864
3881
|
.widget-body {
|
|
3865
3882
|
display: grid;
|
|
3883
|
+
grid-template-columns: fit-content(50%) minmax(0, 1fr);
|
|
3866
3884
|
gap: 12px;
|
|
3867
3885
|
}
|
|
3868
3886
|
|
|
3869
3887
|
.widget-body > * {
|
|
3888
|
+
grid-column: 1 / -1;
|
|
3870
3889
|
margin: 0;
|
|
3871
3890
|
}
|
|
3872
3891
|
|
|
@@ -3902,10 +3921,13 @@ a.status-chip.widget-chip {
|
|
|
3902
3921
|
}
|
|
3903
3922
|
|
|
3904
3923
|
.widget-track {
|
|
3905
|
-
display:
|
|
3906
|
-
|
|
3924
|
+
display: grid;
|
|
3925
|
+
grid-template-columns: subgrid;
|
|
3907
3926
|
align-items: center;
|
|
3908
|
-
|
|
3927
|
+
}
|
|
3928
|
+
|
|
3929
|
+
.widget-track > .pips {
|
|
3930
|
+
flex-wrap: wrap;
|
|
3909
3931
|
}
|
|
3910
3932
|
|
|
3911
3933
|
.widget-track-label {
|
|
@@ -5265,6 +5287,84 @@ button.row,
|
|
|
5265
5287
|
background: var(--accent);
|
|
5266
5288
|
}
|
|
5267
5289
|
|
|
5290
|
+
/* A count of a widget (D-507): good ones circles in the allies' green, bad ones squares in the red of what goes against, by shape as well as colour, as
|
|
5291
|
+
the marks of the dying; a progress as tall steps. After those lit: held ones half full, a failed one crossed, those this roll may light dashed. */
|
|
5292
|
+
.pips.good {
|
|
5293
|
+
--mark: var(--ally);
|
|
5294
|
+
}
|
|
5295
|
+
|
|
5296
|
+
.pips.bad {
|
|
5297
|
+
--mark: var(--low);
|
|
5298
|
+
}
|
|
5299
|
+
|
|
5300
|
+
.pips:is(.good, .bad, .steps) .pip {
|
|
5301
|
+
position: relative;
|
|
5302
|
+
border-color: var(--mark, var(--accent));
|
|
5303
|
+
}
|
|
5304
|
+
|
|
5305
|
+
.pips:is(.good, .bad, .steps) .pip.on {
|
|
5306
|
+
background: var(--mark, var(--accent));
|
|
5307
|
+
}
|
|
5308
|
+
|
|
5309
|
+
.pips.bad .pip {
|
|
5310
|
+
border-radius: 18%;
|
|
5311
|
+
}
|
|
5312
|
+
|
|
5313
|
+
.pips.steps {
|
|
5314
|
+
align-items: flex-end;
|
|
5315
|
+
gap: 4px;
|
|
5316
|
+
}
|
|
5317
|
+
|
|
5318
|
+
.pips.steps .pip {
|
|
5319
|
+
width: 10px;
|
|
5320
|
+
height: 22px;
|
|
5321
|
+
border-radius: 3px;
|
|
5322
|
+
}
|
|
5323
|
+
|
|
5324
|
+
.pip.held {
|
|
5325
|
+
background: color-mix(in srgb, var(--mark, var(--accent)) 35%, var(--float));
|
|
5326
|
+
}
|
|
5327
|
+
|
|
5328
|
+
.pip.marked {
|
|
5329
|
+
position: relative;
|
|
5330
|
+
border-color: var(--low);
|
|
5331
|
+
background: color-mix(in srgb, var(--low) 12%, var(--float));
|
|
5332
|
+
}
|
|
5333
|
+
|
|
5334
|
+
.pip.marked::before,
|
|
5335
|
+
.pip.marked::after {
|
|
5336
|
+
content: "";
|
|
5337
|
+
position: absolute;
|
|
5338
|
+
top: 50%;
|
|
5339
|
+
left: 50%;
|
|
5340
|
+
width: 80%;
|
|
5341
|
+
max-width: 14px;
|
|
5342
|
+
height: 2px;
|
|
5343
|
+
border-radius: 2px;
|
|
5344
|
+
background: var(--low);
|
|
5345
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
5346
|
+
}
|
|
5347
|
+
|
|
5348
|
+
.pip.marked::after {
|
|
5349
|
+
transform: translate(-50%, -50%) rotate(-45deg);
|
|
5350
|
+
}
|
|
5351
|
+
|
|
5352
|
+
.pip.coming {
|
|
5353
|
+
border-style: dashed;
|
|
5354
|
+
background: color-mix(in srgb, var(--mark, var(--accent)) 10%, transparent);
|
|
5355
|
+
}
|
|
5356
|
+
|
|
5357
|
+
/* The count of steps, under them in a question's card; beside the page its marks say it. */
|
|
5358
|
+
.track-count {
|
|
5359
|
+
color: var(--muted);
|
|
5360
|
+
font-size: 0.8rem;
|
|
5361
|
+
font-weight: 700;
|
|
5362
|
+
}
|
|
5363
|
+
|
|
5364
|
+
.widget-track > .track-count {
|
|
5365
|
+
display: none;
|
|
5366
|
+
}
|
|
5367
|
+
|
|
5268
5368
|
/* Bars and tracks: the track's edge stands out of the page enough to see (WCAG 1.4.11). */
|
|
5269
5369
|
.bar-line {
|
|
5270
5370
|
display: inline-flex;
|
|
@@ -6565,6 +6665,367 @@ button.row,
|
|
|
6565
6665
|
}
|
|
6566
6666
|
}
|
|
6567
6667
|
|
|
6668
|
+
/* The card of a package's question (D-507): its widget's parts in the frame of the master's question, through the questions of one attempt. Its counts on a
|
|
6669
|
+
stage of three places, the middle one large; under them the roll's button or the choices a die asks for, and the rule; the outcome where they were. Wide,
|
|
6670
|
+
the three places side by side; on a phone the middle one alone above the two others, and once told the card scrolls with the page. */
|
|
6671
|
+
.ask-card .asked-question {
|
|
6672
|
+
margin-bottom: 4px;
|
|
6673
|
+
}
|
|
6674
|
+
|
|
6675
|
+
/* Told, the button that closes it in its corner, beside the question. */
|
|
6676
|
+
.ask-card.ended .asked-question {
|
|
6677
|
+
padding-inline-end: 36px;
|
|
6678
|
+
}
|
|
6679
|
+
|
|
6680
|
+
.ask-close {
|
|
6681
|
+
position: absolute;
|
|
6682
|
+
top: 10px;
|
|
6683
|
+
inset-inline-end: 10px;
|
|
6684
|
+
}
|
|
6685
|
+
|
|
6686
|
+
.ask-stage {
|
|
6687
|
+
display: grid;
|
|
6688
|
+
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
6689
|
+
grid-template-areas: "start center end";
|
|
6690
|
+
align-items: start;
|
|
6691
|
+
gap: 14px 24px;
|
|
6692
|
+
max-width: 760px;
|
|
6693
|
+
margin: 14px auto 16px;
|
|
6694
|
+
}
|
|
6695
|
+
|
|
6696
|
+
.ask-place {
|
|
6697
|
+
display: grid;
|
|
6698
|
+
align-content: start;
|
|
6699
|
+
justify-items: start;
|
|
6700
|
+
gap: 10px;
|
|
6701
|
+
min-width: 0;
|
|
6702
|
+
}
|
|
6703
|
+
|
|
6704
|
+
.ask-place.at-start {
|
|
6705
|
+
grid-area: start;
|
|
6706
|
+
}
|
|
6707
|
+
|
|
6708
|
+
.ask-place.at-center {
|
|
6709
|
+
grid-area: center;
|
|
6710
|
+
justify-items: center;
|
|
6711
|
+
}
|
|
6712
|
+
|
|
6713
|
+
.ask-place.at-end {
|
|
6714
|
+
grid-area: end;
|
|
6715
|
+
justify-items: end;
|
|
6716
|
+
}
|
|
6717
|
+
|
|
6718
|
+
.ask-track {
|
|
6719
|
+
display: grid;
|
|
6720
|
+
justify-items: inherit;
|
|
6721
|
+
gap: 6px;
|
|
6722
|
+
min-width: 0;
|
|
6723
|
+
}
|
|
6724
|
+
|
|
6725
|
+
/* A label in the colour of its marks, and long in some languages: it breaks rather than leave its place. */
|
|
6726
|
+
.ask-track .widget-track-label {
|
|
6727
|
+
overflow-wrap: anywhere;
|
|
6728
|
+
hyphens: auto;
|
|
6729
|
+
}
|
|
6730
|
+
|
|
6731
|
+
.ask-track.track-end .widget-track-label {
|
|
6732
|
+
text-align: end;
|
|
6733
|
+
}
|
|
6734
|
+
|
|
6735
|
+
.ask-track.good .widget-track-label {
|
|
6736
|
+
color: var(--ally);
|
|
6737
|
+
}
|
|
6738
|
+
|
|
6739
|
+
.ask-track.bad .widget-track-label {
|
|
6740
|
+
color: var(--low);
|
|
6741
|
+
}
|
|
6742
|
+
|
|
6743
|
+
.ask-track .pips {
|
|
6744
|
+
gap: 6px;
|
|
6745
|
+
}
|
|
6746
|
+
|
|
6747
|
+
.ask-track .pip {
|
|
6748
|
+
width: 20px;
|
|
6749
|
+
height: 20px;
|
|
6750
|
+
border-width: 2px;
|
|
6751
|
+
}
|
|
6752
|
+
|
|
6753
|
+
.ask-track .pips.steps {
|
|
6754
|
+
gap: 7px;
|
|
6755
|
+
}
|
|
6756
|
+
|
|
6757
|
+
.ask-track .pips.steps .pip {
|
|
6758
|
+
width: 16px;
|
|
6759
|
+
height: 34px;
|
|
6760
|
+
border-radius: 5px;
|
|
6761
|
+
}
|
|
6762
|
+
|
|
6763
|
+
.ask-facts {
|
|
6764
|
+
justify-content: flex-end;
|
|
6765
|
+
}
|
|
6766
|
+
|
|
6767
|
+
.ask-others {
|
|
6768
|
+
display: grid;
|
|
6769
|
+
gap: 10px;
|
|
6770
|
+
margin-bottom: 14px;
|
|
6771
|
+
}
|
|
6772
|
+
|
|
6773
|
+
.ask-foot {
|
|
6774
|
+
display: grid;
|
|
6775
|
+
justify-items: center;
|
|
6776
|
+
gap: 8px;
|
|
6777
|
+
text-align: center;
|
|
6778
|
+
}
|
|
6779
|
+
|
|
6780
|
+
/* The question of a die that asks a choice, as "A 1 came up: reroll?", over its two buttons: the card's title stays the attempt's. */
|
|
6781
|
+
.ask-prompt {
|
|
6782
|
+
margin: 0;
|
|
6783
|
+
font-weight: 650;
|
|
6784
|
+
}
|
|
6785
|
+
|
|
6786
|
+
.ask-choices {
|
|
6787
|
+
display: flex;
|
|
6788
|
+
flex-wrap: wrap;
|
|
6789
|
+
justify-content: center;
|
|
6790
|
+
gap: 10px;
|
|
6791
|
+
width: 100%;
|
|
6792
|
+
}
|
|
6793
|
+
|
|
6794
|
+
.ask-roll {
|
|
6795
|
+
/* The die in front hides the lines of the one behind it with the button's gold, as a check's button. */
|
|
6796
|
+
--die-ground: var(--gold);
|
|
6797
|
+
display: inline-flex;
|
|
6798
|
+
align-items: center;
|
|
6799
|
+
justify-content: center;
|
|
6800
|
+
gap: 8px;
|
|
6801
|
+
min-width: min(320px, 100%);
|
|
6802
|
+
min-height: 48px;
|
|
6803
|
+
padding: 8px 20px;
|
|
6804
|
+
border: 0;
|
|
6805
|
+
border-radius: var(--radius-m);
|
|
6806
|
+
background: var(--gold);
|
|
6807
|
+
color: var(--on-gold);
|
|
6808
|
+
font: inherit;
|
|
6809
|
+
font-weight: 650;
|
|
6810
|
+
box-shadow: var(--raise);
|
|
6811
|
+
cursor: pointer;
|
|
6812
|
+
}
|
|
6813
|
+
|
|
6814
|
+
.ask-leave {
|
|
6815
|
+
gap: 8px;
|
|
6816
|
+
min-height: 48px;
|
|
6817
|
+
padding: 8px 20px;
|
|
6818
|
+
}
|
|
6819
|
+
|
|
6820
|
+
.ask-choices:has(> :nth-child(2)) > :is(.ask-roll, .ask-leave) {
|
|
6821
|
+
min-width: min(220px, 100%);
|
|
6822
|
+
}
|
|
6823
|
+
|
|
6824
|
+
/* What the button costs or leaves, as "3 left", after its name. */
|
|
6825
|
+
.ask-note {
|
|
6826
|
+
font-weight: 400;
|
|
6827
|
+
}
|
|
6828
|
+
|
|
6829
|
+
.ask-choices > [aria-disabled="true"] {
|
|
6830
|
+
cursor: default;
|
|
6831
|
+
opacity: 0.55;
|
|
6832
|
+
}
|
|
6833
|
+
|
|
6834
|
+
.ask-choices > .sent {
|
|
6835
|
+
opacity: 1;
|
|
6836
|
+
outline: 2px solid var(--accent);
|
|
6837
|
+
outline-offset: 2px;
|
|
6838
|
+
}
|
|
6839
|
+
|
|
6840
|
+
/* The outcome, large where the buttons were and as tall: green when it went well, red when not, with the widget's icon. */
|
|
6841
|
+
.ask-outcome {
|
|
6842
|
+
display: inline-flex;
|
|
6843
|
+
align-items: center;
|
|
6844
|
+
justify-content: center;
|
|
6845
|
+
gap: 8px;
|
|
6846
|
+
min-height: 48px;
|
|
6847
|
+
margin: 0;
|
|
6848
|
+
color: var(--ink);
|
|
6849
|
+
font-size: 1.6rem;
|
|
6850
|
+
font-weight: 800;
|
|
6851
|
+
line-height: 1.2;
|
|
6852
|
+
}
|
|
6853
|
+
|
|
6854
|
+
.ask-outcome.good {
|
|
6855
|
+
color: var(--ally);
|
|
6856
|
+
}
|
|
6857
|
+
|
|
6858
|
+
.ask-outcome.bad {
|
|
6859
|
+
color: var(--low);
|
|
6860
|
+
}
|
|
6861
|
+
|
|
6862
|
+
.ask-outcome-icon {
|
|
6863
|
+
flex: 0 0 auto;
|
|
6864
|
+
width: 30px;
|
|
6865
|
+
height: 30px;
|
|
6866
|
+
fill: none;
|
|
6867
|
+
stroke: currentColor;
|
|
6868
|
+
stroke-width: 2;
|
|
6869
|
+
stroke-linecap: round;
|
|
6870
|
+
stroke-linejoin: round;
|
|
6871
|
+
}
|
|
6872
|
+
|
|
6873
|
+
.ask-then {
|
|
6874
|
+
margin: -6px 0 0;
|
|
6875
|
+
font-weight: 600;
|
|
6876
|
+
}
|
|
6877
|
+
|
|
6878
|
+
/* The player's own words, as in the master's question, the whole width it may take under the rule. */
|
|
6879
|
+
.ask-own {
|
|
6880
|
+
width: 100%;
|
|
6881
|
+
margin-top: 2px;
|
|
6882
|
+
}
|
|
6883
|
+
|
|
6884
|
+
.ask-own input {
|
|
6885
|
+
text-align: start;
|
|
6886
|
+
}
|
|
6887
|
+
|
|
6888
|
+
.ask-rule {
|
|
6889
|
+
margin: 0;
|
|
6890
|
+
color: var(--muted);
|
|
6891
|
+
font-size: 0.85rem;
|
|
6892
|
+
text-wrap: balance;
|
|
6893
|
+
}
|
|
6894
|
+
|
|
6895
|
+
@media (max-width: 600px) {
|
|
6896
|
+
/* Told, the card scrolls away with the page: the player reads on. */
|
|
6897
|
+
.ask-card.ended {
|
|
6898
|
+
position: relative;
|
|
6899
|
+
top: auto;
|
|
6900
|
+
}
|
|
6901
|
+
|
|
6902
|
+
.ask-stage {
|
|
6903
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
6904
|
+
grid-template-areas: "center center" "start end";
|
|
6905
|
+
gap: 12px;
|
|
6906
|
+
margin: 10px 0 12px;
|
|
6907
|
+
}
|
|
6908
|
+
|
|
6909
|
+
.ask-track .pip {
|
|
6910
|
+
width: 18px;
|
|
6911
|
+
height: 18px;
|
|
6912
|
+
}
|
|
6913
|
+
|
|
6914
|
+
.ask-track .pips.steps {
|
|
6915
|
+
gap: 6px;
|
|
6916
|
+
}
|
|
6917
|
+
|
|
6918
|
+
.ask-track .pips.steps .pip {
|
|
6919
|
+
width: 14px;
|
|
6920
|
+
height: 30px;
|
|
6921
|
+
}
|
|
6922
|
+
|
|
6923
|
+
.ask-roll {
|
|
6924
|
+
width: 100%;
|
|
6925
|
+
min-width: 0;
|
|
6926
|
+
}
|
|
6927
|
+
|
|
6928
|
+
/* Two choices side by side, their names over their notes. */
|
|
6929
|
+
.ask-choices:has(> :nth-child(2)) {
|
|
6930
|
+
display: grid;
|
|
6931
|
+
grid-auto-flow: column;
|
|
6932
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
6933
|
+
gap: 8px;
|
|
6934
|
+
}
|
|
6935
|
+
|
|
6936
|
+
.ask-choices:has(> :nth-child(2)) > :is(.ask-roll, .ask-leave) {
|
|
6937
|
+
display: grid;
|
|
6938
|
+
justify-items: center;
|
|
6939
|
+
align-content: center;
|
|
6940
|
+
gap: 0;
|
|
6941
|
+
min-width: 0;
|
|
6942
|
+
min-height: 56px;
|
|
6943
|
+
padding: 6px 8px;
|
|
6944
|
+
line-height: 1.2;
|
|
6945
|
+
}
|
|
6946
|
+
|
|
6947
|
+
.ask-choices:has(> :nth-child(2)) .die-icons {
|
|
6948
|
+
display: none;
|
|
6949
|
+
}
|
|
6950
|
+
|
|
6951
|
+
.ask-choices:has(> :nth-child(2)) .ask-note {
|
|
6952
|
+
font-size: 0.85rem;
|
|
6953
|
+
}
|
|
6954
|
+
|
|
6955
|
+
.ask-outcome {
|
|
6956
|
+
font-size: 1.4rem;
|
|
6957
|
+
}
|
|
6958
|
+
}
|
|
6959
|
+
|
|
6960
|
+
/* The marks move only for who wants it, and never make the player wait: the choices can be pressed as they come. While the roll is asked, the marks it may
|
|
6961
|
+
light breathe; lit by the dice, one after the other in their order; gone out from the last, falling a little; a failed one struck with a shake; a pip
|
|
6962
|
+
spent leaves a ring. Reduced, the states are simply there. */
|
|
6963
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
6964
|
+
.ask-card.asking .pip.coming {
|
|
6965
|
+
animation: ask-breathe 1.6s var(--ease) infinite alternate;
|
|
6966
|
+
}
|
|
6967
|
+
|
|
6968
|
+
.ask-track .pip.lit {
|
|
6969
|
+
animation: dying-pop var(--short) var(--ease-bounce) calc(var(--step, 0) * var(--quick) / 2) both;
|
|
6970
|
+
}
|
|
6971
|
+
|
|
6972
|
+
.ask-track .pip.out {
|
|
6973
|
+
animation: ask-out var(--short) var(--ease-in) calc(var(--step, 0) * var(--quick) / 3) both;
|
|
6974
|
+
}
|
|
6975
|
+
|
|
6976
|
+
.ask-track .pip.struck {
|
|
6977
|
+
animation: ask-struck var(--short) var(--ease-out) both;
|
|
6978
|
+
}
|
|
6979
|
+
|
|
6980
|
+
.ask-track .pips:not(.steps) .pip.out::after {
|
|
6981
|
+
content: "";
|
|
6982
|
+
position: absolute;
|
|
6983
|
+
inset: -6px;
|
|
6984
|
+
border: 2px solid var(--mark, var(--accent));
|
|
6985
|
+
border-radius: inherit;
|
|
6986
|
+
animation: dying-ring var(--long) var(--ease-out) both;
|
|
6987
|
+
}
|
|
6988
|
+
|
|
6989
|
+
.ask-card .ask-outcome {
|
|
6990
|
+
animation: dying-word var(--medium) var(--ease-out) both;
|
|
6991
|
+
}
|
|
6992
|
+
}
|
|
6993
|
+
|
|
6994
|
+
@keyframes ask-breathe {
|
|
6995
|
+
from {
|
|
6996
|
+
opacity: 0.5;
|
|
6997
|
+
}
|
|
6998
|
+
|
|
6999
|
+
to {
|
|
7000
|
+
opacity: 1;
|
|
7001
|
+
}
|
|
7002
|
+
}
|
|
7003
|
+
|
|
7004
|
+
@keyframes ask-out {
|
|
7005
|
+
from {
|
|
7006
|
+
background-color: var(--mark, var(--accent));
|
|
7007
|
+
}
|
|
7008
|
+
|
|
7009
|
+
50% {
|
|
7010
|
+
opacity: 0.7;
|
|
7011
|
+
transform: translateY(3px);
|
|
7012
|
+
}
|
|
7013
|
+
}
|
|
7014
|
+
|
|
7015
|
+
@keyframes ask-struck {
|
|
7016
|
+
0% {
|
|
7017
|
+
transform: scale(0.6);
|
|
7018
|
+
}
|
|
7019
|
+
|
|
7020
|
+
50% {
|
|
7021
|
+
transform: scale(1.15) translateX(2px);
|
|
7022
|
+
}
|
|
7023
|
+
|
|
7024
|
+
75% {
|
|
7025
|
+
transform: translateX(-2px);
|
|
7026
|
+
}
|
|
7027
|
+
}
|
|
7028
|
+
|
|
6568
7029
|
/* The dice of a rest the master asks the player to spend (D-492, ASK-14): a card in the frame of the master's question, which stays while they roll. Who rests
|
|
6569
7030
|
and the points the dice give, as a bar that keeps where the rest began; a row for each kind of die with its pips and its button; the dice rolled as chips;
|
|
6570
7031
|
the one button that ends it. Wide, the points and the dice side by side; narrow, one under the other. */
|
|
@@ -7438,6 +7899,14 @@ summary.fixed {
|
|
|
7438
7899
|
color: var(--ink);
|
|
7439
7900
|
}
|
|
7440
7901
|
|
|
7902
|
+
/* What an extension's roll says in place of a total that means nothing: words, smaller, at most two lines. */
|
|
7903
|
+
.roll-total.roll-says {
|
|
7904
|
+
max-width: 12ch;
|
|
7905
|
+
font-size: 0.95rem;
|
|
7906
|
+
font-weight: 600;
|
|
7907
|
+
text-wrap: balance;
|
|
7908
|
+
}
|
|
7909
|
+
|
|
7441
7910
|
.roll-dice {
|
|
7442
7911
|
grid-column: 2;
|
|
7443
7912
|
margin-top: 4px;
|
|
@@ -7604,6 +8073,21 @@ summary.fixed {
|
|
|
7604
8073
|
color: var(--accent);
|
|
7605
8074
|
}
|
|
7606
8075
|
|
|
8076
|
+
/* A die of a package's roll that went well or badly for who rolled it, by its colour beside its face (D-507). */
|
|
8077
|
+
.die-chip.tone-good {
|
|
8078
|
+
box-shadow: inset 0 0 0 1.5px var(--ally);
|
|
8079
|
+
color: var(--ally);
|
|
8080
|
+
}
|
|
8081
|
+
|
|
8082
|
+
.die-chip.tone-bad {
|
|
8083
|
+
box-shadow: inset 0 0 0 1.5px var(--low);
|
|
8084
|
+
color: var(--low);
|
|
8085
|
+
}
|
|
8086
|
+
|
|
8087
|
+
.die-chip:is(.tone-good, .tone-bad) svg.die {
|
|
8088
|
+
color: currentColor;
|
|
8089
|
+
}
|
|
8090
|
+
|
|
7607
8091
|
.die-chip.dropped {
|
|
7608
8092
|
background: transparent;
|
|
7609
8093
|
box-shadow: inset 0 0 0 1px var(--rule);
|
|
@@ -7814,6 +8298,18 @@ summary.fixed {
|
|
|
7814
8298
|
box-shadow: var(--plate-shadow);
|
|
7815
8299
|
}
|
|
7816
8300
|
|
|
8301
|
+
/* What the faces of a package's roll mean, in place of the total: words, smaller (D-507). */
|
|
8302
|
+
.plate-total.plate-says {
|
|
8303
|
+
max-width: 9em;
|
|
8304
|
+
color: var(--ink);
|
|
8305
|
+
font-size: 1.15rem;
|
|
8306
|
+
font-weight: 700;
|
|
8307
|
+
line-height: 1.2;
|
|
8308
|
+
letter-spacing: normal;
|
|
8309
|
+
text-align: center;
|
|
8310
|
+
text-wrap: balance;
|
|
8311
|
+
}
|
|
8312
|
+
|
|
7817
8313
|
.dice-result.free .plate-total {
|
|
7818
8314
|
color: var(--ink);
|
|
7819
8315
|
}
|
|
@@ -13528,6 +14024,28 @@ svg.icon {
|
|
|
13528
14024
|
height: 14px;
|
|
13529
14025
|
}
|
|
13530
14026
|
|
|
14027
|
+
/* Where a package's problems are reported: a link of words in its meta, never broken in two. */
|
|
14028
|
+
.package-report {
|
|
14029
|
+
color: var(--accent);
|
|
14030
|
+
font-weight: 600;
|
|
14031
|
+
white-space: nowrap;
|
|
14032
|
+
text-decoration: underline;
|
|
14033
|
+
text-decoration-thickness: 1px;
|
|
14034
|
+
text-underline-offset: 2px;
|
|
14035
|
+
}
|
|
14036
|
+
|
|
14037
|
+
/* On a phone the meta wraps: the link goes under it, never a dot left at a line's end. */
|
|
14038
|
+
@media (max-width: 600px) {
|
|
14039
|
+
.package-report-gap {
|
|
14040
|
+
display: none;
|
|
14041
|
+
}
|
|
14042
|
+
|
|
14043
|
+
.package-report {
|
|
14044
|
+
display: block;
|
|
14045
|
+
width: fit-content;
|
|
14046
|
+
}
|
|
14047
|
+
}
|
|
14048
|
+
|
|
13531
14049
|
/* Where a package is already, the system in use, an adventure in the story: words, never a button. */
|
|
13532
14050
|
.package-here,
|
|
13533
14051
|
.package-lock {
|
package/dist/dashboard-server.js
CHANGED
|
@@ -312,6 +312,10 @@ async function answer(request, response, served) {
|
|
|
312
312
|
listenForBell(request, response, served, url.searchParams.has("probe"));
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
|
+
if (request.method === "POST" && path === "/api/card" && origin !== undefined) {
|
|
316
|
+
await closeCard(request, response, served);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
315
319
|
if (request.method === "POST" && path === "/api/seen" && origin !== undefined) {
|
|
316
320
|
await pageSeen(request, response, served);
|
|
317
321
|
return;
|
|
@@ -372,6 +376,8 @@ async function answer(request, response, served) {
|
|
|
372
376
|
// The dice of a rest as they are now, read again at each look (ASK-14).
|
|
373
377
|
const spend = asked?.spending === undefined ? undefined : spendShown(asked.spending, served);
|
|
374
378
|
sendJson(response, 200, {
|
|
379
|
+
// How the card of a package's last question was left, while no other question is asked (D-507).
|
|
380
|
+
...(asked === undefined && served.card !== undefined ? { card: served.card } : {}),
|
|
375
381
|
asked: asked === undefined
|
|
376
382
|
? null
|
|
377
383
|
: {
|
|
@@ -383,6 +389,10 @@ async function answer(request, response, served) {
|
|
|
383
389
|
names,
|
|
384
390
|
...rows,
|
|
385
391
|
...(asked.rows?.save === undefined ? {} : { save: asked.rows.save }),
|
|
392
|
+
...(asked.rows?.buttons === undefined ? {} : { buttons: asked.rows.buttons }),
|
|
393
|
+
...(asked.rows?.rule === undefined ? {} : { rule: asked.rows.rule }),
|
|
394
|
+
// Its card, or that one comes, until its widget answers: the page waits for it rather than show the question twice (D-507).
|
|
395
|
+
...(asked.card !== undefined ? { card: asked.card } : asked.rows?.card === undefined ? {} : { card: { widget: asked.rows.card.widget, key: asked.rows.card.key, coming: true } }),
|
|
386
396
|
...(asked.square ? { square: true } : {}),
|
|
387
397
|
...(spend === undefined ? {} : { who: spend.who, spend }),
|
|
388
398
|
},
|
|
@@ -496,11 +506,21 @@ function sendTagged(request, response, bytes, headers) {
|
|
|
496
506
|
}
|
|
497
507
|
response.writeHead(200, all).end(request.method === "HEAD" ? undefined : bytes);
|
|
498
508
|
}
|
|
509
|
+
/** Reads what a package's card shows, never in the way of its question: given once it answers, with nothing to show when it fails or is late (D-507). */
|
|
510
|
+
function readCard(served, card, read) {
|
|
511
|
+
if (card === undefined) {
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
void card.shows().then((shows) => read({ widget: card.widget, key: card.key, ...(shows === undefined ? {} : { shows }) }), () => read({ widget: card.widget, key: card.key }));
|
|
515
|
+
}
|
|
499
516
|
/**
|
|
500
517
|
* The player through the page (D-279): the question shows on every page open, and the first click settles it; with no page open, "absent", so that ask turns to
|
|
501
518
|
* the form or to words. A stop of the call takes the question away and nothing is logged (ASK-9).
|
|
502
519
|
*/
|
|
503
520
|
function pagePlayer(served) {
|
|
521
|
+
// The card the last question on the page was asked in, which the call that asked it leaves as it ends, and how many were put (D-507).
|
|
522
|
+
let cardKey;
|
|
523
|
+
let questions = 0;
|
|
504
524
|
const put = (question, title, labels, signal, more = {}) => {
|
|
505
525
|
if (served.pages.size === 0) {
|
|
506
526
|
return Promise.resolve("absent");
|
|
@@ -509,8 +529,9 @@ function pagePlayer(served) {
|
|
|
509
529
|
if (signal?.aborted === true) {
|
|
510
530
|
return Promise.resolve(undefined);
|
|
511
531
|
}
|
|
512
|
-
// A question asked again, as after a summary, takes the place of the one before.
|
|
532
|
+
// A question asked again, as after a summary, takes the place of the one before; and of a card left from before.
|
|
513
533
|
served.asked?.settle(undefined);
|
|
534
|
+
served.card = undefined;
|
|
514
535
|
return new Promise((done) => {
|
|
515
536
|
const timer = setTimeout(() => settle(undefined), playerWait).unref();
|
|
516
537
|
const settle = (choice) => {
|
|
@@ -525,6 +546,14 @@ function pagePlayer(served) {
|
|
|
525
546
|
const stop = () => settle(undefined);
|
|
526
547
|
const asked = { id: randomUUID(), question, title, labels, ...more, settle };
|
|
527
548
|
served.asked = asked;
|
|
549
|
+
questions += 1;
|
|
550
|
+
cardKey = more.rows?.card?.key ?? cardKey;
|
|
551
|
+
readCard(served, more.rows?.card, (card) => {
|
|
552
|
+
if (served.asked === asked) {
|
|
553
|
+
asked.card = card;
|
|
554
|
+
served.notify();
|
|
555
|
+
}
|
|
556
|
+
});
|
|
528
557
|
signal?.addEventListener("abort", stop);
|
|
529
558
|
served.notify();
|
|
530
559
|
watchHidden(served);
|
|
@@ -532,6 +561,20 @@ function pagePlayer(served) {
|
|
|
532
561
|
};
|
|
533
562
|
return {
|
|
534
563
|
asking: () => served.asked !== undefined,
|
|
564
|
+
cardEnded(card) {
|
|
565
|
+
// Only a card its questions were asked in on the page.
|
|
566
|
+
if (card.key !== cardKey) {
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
const at = questions;
|
|
570
|
+
readCard(served, card, (read) => {
|
|
571
|
+
// Only while no other question came meanwhile, answered or not.
|
|
572
|
+
if (served.asked === undefined && questions === at) {
|
|
573
|
+
served.card = { ...read, ended: true };
|
|
574
|
+
served.notify();
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
},
|
|
535
578
|
async choose(question, title, labels, signal, rows) {
|
|
536
579
|
const chosen = await put(question, title, labels, signal, rows === undefined ? {} : { rows });
|
|
537
580
|
return typeof chosen === "object" && "square" in chosen ? undefined : chosen;
|
|
@@ -694,6 +737,19 @@ async function changeSetting(request, response, served) {
|
|
|
694
737
|
}
|
|
695
738
|
}
|
|
696
739
|
/** Whether a page is seen now, as it says when it comes in sight or goes out of it (D-455): a question on pages no one sees goes to the chat. */
|
|
740
|
+
/** The player closed a package's card that its call left (D-507): it is gone on every page and every device, and after a reload. */
|
|
741
|
+
async function closeCard(request, response, served) {
|
|
742
|
+
const parsed = z.object({ close: z.string().min(1).max(200) }).strict().safeParse(await readBody(request));
|
|
743
|
+
if (!parsed.success) {
|
|
744
|
+
sendJson(response, 400, { error: "Send the key of the card to close: { close }." });
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
if (served.card?.key === parsed.data.close) {
|
|
748
|
+
served.card = undefined;
|
|
749
|
+
served.notify();
|
|
750
|
+
}
|
|
751
|
+
sendJson(response, 202, {});
|
|
752
|
+
}
|
|
697
753
|
async function pageSeen(request, response, served) {
|
|
698
754
|
const parsed = z.object({ page: z.string().min(1).max(64), seen: z.boolean() }).strict().safeParse(await readBody(request));
|
|
699
755
|
if (!parsed.success) {
|