@novely/solid-renderer 0.28.1 → 0.28.3

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/index.jsx CHANGED
@@ -5392,7 +5392,7 @@ var _tmpl$43 = /* @__PURE__ */ template(`<button type="button" class="button con
5392
5392
  var _tmpl$53 = /* @__PURE__ */ template(`<span class="control-panel-container-fix" aria-hidden="true">&#8203;`);
5393
5393
  var _tmpl$62 = /* @__PURE__ */ template(`<div class="control-panel-container-backdrop">`);
5394
5394
  var _tmpl$72 = /* @__PURE__ */ template(`<div class="control-panel"><div role="menubar" class="control-panel-container">`);
5395
- var _tmpl$82 = /* @__PURE__ */ template(`<div><div class="characters"></div><div class="action-dialog"><div class="action-dialog-container" role="button" tabindex="0"><div class="action-dialog-person"></div><div class="action-dialog-content"></div></div></div><div></div><div class="action-text" role="button" tabindex="0">`);
5395
+ var _tmpl$82 = /* @__PURE__ */ template(`<div><div class="background"></div><div class="characters"></div><div class="action-dialog"><div class="action-dialog-container" role="button" tabindex="0"><div class="action-dialog-person"></div><div class="action-dialog-content"></div></div></div><div></div><div class="action-text" role="button" tabindex="0">`);
5396
5396
  var _tmpl$92 = /* @__PURE__ */ template(`<button type="button" class="button">`);
5397
5397
  var Game = (props) => {
5398
5398
  const data = useData();
@@ -5506,9 +5506,9 @@ var Game = (props) => {
5506
5506
  }, 0);
5507
5507
  });
5508
5508
  return (() => {
5509
- const _el$ = _tmpl$82(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$26 = _el$3.nextSibling, _el$27 = _el$26.nextSibling;
5510
- setAttribute(_el$2, "data-characters", true);
5511
- insert(_el$2, createComponent(For, {
5509
+ const _el$ = _tmpl$82(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$27 = _el$4.nextSibling, _el$28 = _el$27.nextSibling;
5510
+ setAttribute(_el$3, "data-characters", true);
5511
+ insert(_el$3, createComponent(For, {
5512
5512
  get each() {
5513
5513
  return Object.entries(charactersState());
5514
5514
  },
@@ -5527,7 +5527,7 @@ var Game = (props) => {
5527
5527
  }
5528
5528
  })
5529
5529
  }));
5530
- insert(_el$3, createComponent(DialogName, {
5530
+ insert(_el$4, createComponent(DialogName, {
5531
5531
  get character() {
5532
5532
  return dialogState().miniature.character;
5533
5533
  },
@@ -5537,11 +5537,11 @@ var Game = (props) => {
5537
5537
  get characters() {
5538
5538
  return data.characters;
5539
5539
  }
5540
- }), _el$4);
5541
- addEventListener2(_el$4, "keydown", onKey(DialogWriter.clear, " "), true);
5542
- addEventListener2(_el$4, "keypress", onKey(DialogWriter.clear, "Enter"));
5543
- addEventListener2(_el$4, "click", DialogWriter.clear, true);
5544
- insert(_el$5, createComponent(Show, {
5540
+ }), _el$5);
5541
+ addEventListener2(_el$5, "keydown", onKey(DialogWriter.clear, " "), true);
5542
+ addEventListener2(_el$5, "keypress", onKey(DialogWriter.clear, "Enter"));
5543
+ addEventListener2(_el$5, "click", DialogWriter.clear, true);
5544
+ insert(_el$6, createComponent(Show, {
5545
5545
  get when() {
5546
5546
  return dialogState().miniature.emotion;
5547
5547
  },
@@ -5560,7 +5560,7 @@ var Game = (props) => {
5560
5560
  return canvas;
5561
5561
  }
5562
5562
  }));
5563
- insert(_el$6, createComponent(DialogWriter.Typewriter, {
5563
+ insert(_el$7, createComponent(DialogWriter.Typewriter, {
5564
5564
  get attributes() {
5565
5565
  return {
5566
5566
  title: DialogWriter.state() === "idle" ? void 0 : data.t(DialogWriter.state() === "processing" ? "CompleteText" : "GoForward")
@@ -5583,9 +5583,9 @@ var Game = (props) => {
5583
5583
  isOpen: () => choiceState().visible,
5584
5584
  trapFocus: () => !props.isPreview && !rendererState().exitPromptShown,
5585
5585
  get children() {
5586
- const _el$7 = _tmpl$19(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$10 = _el$9.firstChild;
5587
- insert(_el$10, () => choiceState().label || " ");
5588
- insert(_el$9, createComponent(For, {
5586
+ const _el$8 = _tmpl$19(), _el$9 = _el$8.firstChild, _el$10 = _el$9.nextSibling, _el$11 = _el$10.firstChild;
5587
+ insert(_el$11, () => choiceState().label || " ");
5588
+ insert(_el$10, createComponent(For, {
5589
5589
  get each() {
5590
5590
  return choiceState().choices;
5591
5591
  },
@@ -5593,69 +5593,69 @@ var Game = (props) => {
5593
5593
  const disabled = !active;
5594
5594
  const index = i();
5595
5595
  return (() => {
5596
- const _el$33 = _tmpl$92();
5597
- _el$33.$$click = onChoicesButtonClick;
5598
- _el$33.$$clickData = [disabled, index];
5599
- setAttribute(_el$33, "aria-disabled", disabled);
5600
- insert(_el$33, text);
5601
- return _el$33;
5596
+ const _el$34 = _tmpl$92();
5597
+ _el$34.$$click = onChoicesButtonClick;
5598
+ _el$34.$$clickData = [disabled, index];
5599
+ setAttribute(_el$34, "aria-disabled", disabled);
5600
+ insert(_el$34, text);
5601
+ return _el$34;
5602
5602
  })();
5603
5603
  }
5604
5604
  }), null);
5605
5605
  createRenderEffect((_p$) => {
5606
5606
  const _v$ = Boolean(choiceState().label), _v$2 = !choiceState().label;
5607
- _v$ !== _p$._v$ && setAttribute(_el$10, "data-used", _p$._v$ = _v$);
5608
- _v$2 !== _p$._v$2 && setAttribute(_el$10, "aria-hidden", _p$._v$2 = _v$2);
5607
+ _v$ !== _p$._v$ && setAttribute(_el$11, "data-used", _p$._v$ = _v$);
5608
+ _v$2 !== _p$._v$2 && setAttribute(_el$11, "aria-hidden", _p$._v$2 = _v$2);
5609
5609
  return _p$;
5610
5610
  }, {
5611
5611
  _v$: void 0,
5612
5612
  _v$2: void 0
5613
5613
  });
5614
- return _el$7;
5614
+ return _el$8;
5615
5615
  }
5616
- }), _el$26);
5616
+ }), _el$27);
5617
5617
  insert(_el$, createComponent(Modal, {
5618
5618
  isOpen: () => inputState().visible,
5619
5619
  trapFocus: () => !props.isPreview && !rendererState().exitPromptShown,
5620
5620
  get children() {
5621
- const _el$11 = _tmpl$24(), _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$14.nextSibling;
5622
- insert(_el$15, () => inputState().label);
5623
- insert(_el$14, () => inputState().element, _el$16);
5624
- insert(_el$16, () => inputState().error);
5625
- _el$17.$$click = onInputButtonClick;
5626
- insert(_el$17, () => data.t("Sumbit"));
5627
- createRenderEffect(() => setAttribute(_el$17, "aria-disabled", Boolean(inputState().error)));
5628
- return _el$11;
5621
+ const _el$12 = _tmpl$24(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$15.nextSibling;
5622
+ insert(_el$16, () => inputState().label);
5623
+ insert(_el$15, () => inputState().element, _el$17);
5624
+ insert(_el$17, () => inputState().error);
5625
+ _el$18.$$click = onInputButtonClick;
5626
+ insert(_el$18, () => data.t("Sumbit"));
5627
+ createRenderEffect(() => setAttribute(_el$18, "aria-disabled", Boolean(inputState().error)));
5628
+ return _el$12;
5629
5629
  }
5630
- }), _el$26);
5630
+ }), _el$27);
5631
5631
  insert(_el$, createComponent(Modal, {
5632
5632
  isOpen: () => rendererState().exitPromptShown && !props.isPreview,
5633
5633
  trapFocus: () => !props.isPreview && rendererState().exitPromptShown,
5634
5634
  get children() {
5635
- const _el$18 = _tmpl$33(), _el$19 = _el$18.firstChild, _el$20 = _el$19.nextSibling, _el$21 = _el$20.nextSibling, _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling;
5636
- insert(_el$22, () => data.t("ExitDialogWarning"));
5637
- _el$24.$$click = () => {
5635
+ const _el$19 = _tmpl$33(), _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling, _el$22 = _el$21.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
5636
+ insert(_el$23, () => data.t("ExitDialogWarning"));
5637
+ _el$25.$$click = () => {
5638
5638
  data.$rendererState.setKey("exitPromptShown", false);
5639
5639
  };
5640
- insert(_el$24, () => data.t("ExitDialogBack"));
5641
- _el$25.$$click = () => {
5640
+ insert(_el$25, () => data.t("ExitDialogBack"));
5641
+ _el$26.$$click = () => {
5642
5642
  data.options.exit(true);
5643
5643
  };
5644
- insert(_el$25, () => data.t("ExitDialogExit"));
5645
- return _el$18;
5644
+ insert(_el$26, () => data.t("ExitDialogExit"));
5645
+ return _el$19;
5646
5646
  }
5647
- }), _el$26);
5648
- setAttribute(_el$26, "data-custom", true);
5649
- insert(_el$26, createComponent(For, {
5647
+ }), _el$27);
5648
+ setAttribute(_el$27, "data-custom", true);
5649
+ insert(_el$27, createComponent(For, {
5650
5650
  get each() {
5651
5651
  return layers();
5652
5652
  },
5653
5653
  children: (value) => value.dom
5654
5654
  }));
5655
- addEventListener2(_el$27, "keydown", onKey(TextWriter.clear, " "), true);
5656
- addEventListener2(_el$27, "keypress", onKey(TextWriter.clear, "Enter"));
5657
- addEventListener2(_el$27, "click", TextWriter.clear, true);
5658
- insert(_el$27, createComponent(TextWriter.Typewriter, {
5655
+ addEventListener2(_el$28, "keydown", onKey(TextWriter.clear, " "), true);
5656
+ addEventListener2(_el$28, "keypress", onKey(TextWriter.clear, "Enter"));
5657
+ addEventListener2(_el$28, "click", TextWriter.clear, true);
5658
+ insert(_el$28, createComponent(TextWriter.Typewriter, {
5659
5659
  get attributes() {
5660
5660
  return {
5661
5661
  title: TextWriter.state() === "idle" ? void 0 : data.t(TextWriter.state() === "processing" ? "CompleteText" : "GoForward")
@@ -5679,8 +5679,8 @@ var Game = (props) => {
5679
5679
  return !props.isPreview;
5680
5680
  },
5681
5681
  get children() {
5682
- const _el$28 = _tmpl$72(), _el$32 = _el$28.firstChild;
5683
- insert(_el$28, createComponent(Show, {
5682
+ const _el$29 = _tmpl$72(), _el$33 = _el$29.firstChild;
5683
+ insert(_el$29, createComponent(Show, {
5684
5684
  get when() {
5685
5685
  return data.media.hyperWide();
5686
5686
  },
@@ -5690,48 +5690,48 @@ var Game = (props) => {
5690
5690
  return !controlPanelMenuExpanded();
5691
5691
  },
5692
5692
  get children() {
5693
- const _el$29 = _tmpl$43();
5694
- _el$29.$$click = () => {
5693
+ const _el$30 = _tmpl$43();
5694
+ _el$30.$$click = () => {
5695
5695
  setControlPanelMenuExpanded((prev) => !prev);
5696
5696
  };
5697
- setAttribute(_el$29, "aria-controls", controlPanelMenuID);
5698
- insert(_el$29, createComponent(Icon, {
5697
+ setAttribute(_el$30, "aria-controls", controlPanelMenuID);
5698
+ insert(_el$30, createComponent(Icon, {
5699
5699
  get children() {
5700
5700
  return Icon.Menu();
5701
5701
  }
5702
5702
  }));
5703
5703
  createRenderEffect((_p$) => {
5704
5704
  const _v$3 = data.t("OpenMenu"), _v$4 = controlPanelMenuExpanded();
5705
- _v$3 !== _p$._v$3 && setAttribute(_el$29, "title", _p$._v$3 = _v$3);
5706
- _v$4 !== _p$._v$4 && setAttribute(_el$29, "aria-expanded", _p$._v$4 = _v$4);
5705
+ _v$3 !== _p$._v$3 && setAttribute(_el$30, "title", _p$._v$3 = _v$3);
5706
+ _v$4 !== _p$._v$4 && setAttribute(_el$30, "aria-expanded", _p$._v$4 = _v$4);
5707
5707
  return _p$;
5708
5708
  }, {
5709
5709
  _v$3: void 0,
5710
5710
  _v$4: void 0
5711
5711
  });
5712
- return _el$29;
5712
+ return _el$30;
5713
5713
  }
5714
5714
  });
5715
5715
  }
5716
- }), _el$32);
5717
- insert(_el$28, createComponent(Show, {
5716
+ }), _el$33);
5717
+ insert(_el$29, createComponent(Show, {
5718
5718
  get when() {
5719
5719
  return createMemo(() => !!(data.media.hyperWide() && controlPanelMenuExpanded()))() && !rendererState().exitPromptShown;
5720
5720
  },
5721
5721
  get children() {
5722
5722
  return [_tmpl$53(), _tmpl$62()];
5723
5723
  }
5724
- }), _el$32);
5724
+ }), _el$33);
5725
5725
  use((element) => {
5726
5726
  clickOutside(element, () => {
5727
5727
  if (untrack(data.media.hyperWide) && untrack(controlPanelMenuExpanded)) {
5728
5728
  setControlPanelMenuExpanded(false);
5729
5729
  }
5730
5730
  });
5731
- }, _el$32);
5732
- setAttribute(_el$32, "id", controlPanelMenuID);
5733
- _el$32.classList.toggle("control-panel-container--center", !!(controls === "inside"));
5734
- insert(_el$32, createComponent(ControlPanelButtons, {
5731
+ }, _el$33);
5732
+ setAttribute(_el$33, "id", controlPanelMenuID);
5733
+ _el$33.classList.toggle("control-panel-container--center", !!(controls === "inside"));
5734
+ insert(_el$33, createComponent(ControlPanelButtons, {
5735
5735
  openSettings: () => {
5736
5736
  data.$rendererState.setKey("screen", "settings");
5737
5737
  },
@@ -5743,29 +5743,29 @@ var Game = (props) => {
5743
5743
  }));
5744
5744
  createRenderEffect((_p$) => {
5745
5745
  const _v$5 = !!(data.media.hyperWide() && !controlPanelMenuExpanded()), _v$6 = !!(data.media.hyperWide() && controlPanelMenuExpanded());
5746
- _v$5 !== _p$._v$5 && _el$32.classList.toggle("control-panel-container--wide-closed", _p$._v$5 = _v$5);
5747
- _v$6 !== _p$._v$6 && _el$32.classList.toggle("control-panel-container--wide-open", _p$._v$6 = _v$6);
5746
+ _v$5 !== _p$._v$5 && _el$33.classList.toggle("control-panel-container--wide-closed", _p$._v$5 = _v$5);
5747
+ _v$6 !== _p$._v$6 && _el$33.classList.toggle("control-panel-container--wide-open", _p$._v$6 = _v$6);
5748
5748
  return _p$;
5749
5749
  }, {
5750
5750
  _v$5: void 0,
5751
5751
  _v$6: void 0
5752
5752
  });
5753
- return _el$28;
5753
+ return _el$29;
5754
5754
  }
5755
5755
  }), null);
5756
5756
  createRenderEffect((_p$) => {
5757
- const _v$7 = background(), _v$8 = `${props.className || ""} root game`, _v$9 = !!props.isPreview, _v$10 = charactersCount(), _v$11 = !!dialogState().visible, _v$12 = !dialogState().visible, _v$13 = !(dialogState().miniature.character && dialogState().miniature.emotion), _v$14 = !dialogState().content, _v$15 = !!props.isPreview, _v$16 = Boolean(textState().content), _v$17 = !textState().content;
5758
- _p$._v$7 = style(_el$, _v$7, _p$._v$7);
5759
- _v$8 !== _p$._v$8 && className(_el$, _p$._v$8 = _v$8);
5760
- _v$9 !== _p$._v$9 && _el$.classList.toggle("preview", _p$._v$9 = _v$9);
5761
- _v$10 !== _p$._v$10 && ((_p$._v$10 = _v$10) != null ? _el$2.style.setProperty("--shown-characters-count", _v$10) : _el$2.style.removeProperty("--shown-characters-count"));
5762
- _v$11 !== _p$._v$11 && _el$3.classList.toggle("action-dialog--visible", _p$._v$11 = _v$11);
5763
- _v$12 !== _p$._v$12 && _el$3.classList.toggle("action-dialog--hidden", _p$._v$12 = _v$12);
5764
- _v$13 !== _p$._v$13 && setAttribute(_el$4, "data-no-person", _p$._v$13 = _v$13);
5765
- _v$14 !== _p$._v$14 && setAttribute(_el$4, "aria-disabled", _p$._v$14 = _v$14);
5766
- _v$15 !== _p$._v$15 && _el$6.classList.toggle("action-dialog-content--disable-shadow", _p$._v$15 = _v$15);
5767
- _v$16 !== _p$._v$16 && setAttribute(_el$27, "data-shown", _p$._v$16 = _v$16);
5768
- _v$17 !== _p$._v$17 && setAttribute(_el$27, "aria-disabled", _p$._v$17 = _v$17);
5757
+ const _v$7 = `${props.className || ""} root game`, _v$8 = !!props.isPreview, _v$9 = background(), _v$10 = charactersCount(), _v$11 = !!dialogState().visible, _v$12 = !dialogState().visible, _v$13 = !(dialogState().miniature.character && dialogState().miniature.emotion), _v$14 = !dialogState().content, _v$15 = !!props.isPreview, _v$16 = Boolean(textState().content), _v$17 = !textState().content;
5758
+ _v$7 !== _p$._v$7 && className(_el$, _p$._v$7 = _v$7);
5759
+ _v$8 !== _p$._v$8 && _el$.classList.toggle("preview", _p$._v$8 = _v$8);
5760
+ _p$._v$9 = style(_el$2, _v$9, _p$._v$9);
5761
+ _v$10 !== _p$._v$10 && ((_p$._v$10 = _v$10) != null ? _el$3.style.setProperty("--shown-characters-count", _v$10) : _el$3.style.removeProperty("--shown-characters-count"));
5762
+ _v$11 !== _p$._v$11 && _el$4.classList.toggle("action-dialog--visible", _p$._v$11 = _v$11);
5763
+ _v$12 !== _p$._v$12 && _el$4.classList.toggle("action-dialog--hidden", _p$._v$12 = _v$12);
5764
+ _v$13 !== _p$._v$13 && setAttribute(_el$5, "data-no-person", _p$._v$13 = _v$13);
5765
+ _v$14 !== _p$._v$14 && setAttribute(_el$5, "aria-disabled", _p$._v$14 = _v$14);
5766
+ _v$15 !== _p$._v$15 && _el$7.classList.toggle("action-dialog-content--disable-shadow", _p$._v$15 = _v$15);
5767
+ _v$16 !== _p$._v$16 && setAttribute(_el$28, "data-shown", _p$._v$16 = _v$16);
5768
+ _v$17 !== _p$._v$17 && setAttribute(_el$28, "aria-disabled", _p$._v$17 = _v$17);
5769
5769
  return _p$;
5770
5770
  }, {
5771
5771
  _v$7: void 0,
@@ -76,6 +76,7 @@
76
76
  /* src/styles/characters/characters.css */
77
77
  .characters {
78
78
  z-index: 3;
79
+ pointer-events: none;
79
80
  justify-content: center;
80
81
  align-items: flex-end;
81
82
  width: 100vw;
@@ -199,7 +200,7 @@
199
200
  z-index: 10;
200
201
  text-align: center;
201
202
  max-width: 100vw;
202
- font-size: 1.5rem;
203
+ font-size: 2rem;
203
204
  display: none;
204
205
  position: fixed;
205
206
  top: 0;
@@ -230,6 +231,19 @@
230
231
  -webkit-touch-callout: none;
231
232
  touch-action: none;
232
233
  }
234
+ @media (max-aspect-ratio: .8) {
235
+ .action-text {
236
+ font-size: 1.2rem;
237
+ }
238
+ }
239
+ @media only screen and (min-aspect-ratio: .8) and (pointer: coarse) {
240
+ .action-text {
241
+ font-size: 1.2rem;
242
+ }
243
+ }
244
+ .preview .action-text {
245
+ font-size: 2rem;
246
+ }
233
247
 
234
248
  /* src/styles/action-text/index.css */
235
249
 
@@ -444,7 +458,7 @@
444
458
  border-radius: .438rem .438rem 0 0;
445
459
  width: fit-content;
446
460
  margin-left: 5vmin;
447
- font-size: 1.4375rem;
461
+ font-size: 1.65rem;
448
462
  line-height: 1.2;
449
463
  }
450
464
  .action-dialog-content {
@@ -495,12 +509,19 @@
495
509
  }
496
510
  }
497
511
  @media only screen and (min-aspect-ratio: .8) and (pointer: coarse) {
512
+ .action-dialog-name {
513
+ font-size: 1.2rem;
514
+ }
498
515
  .action-dialog-content {
499
516
  text-shadow: none;
500
517
  font-size: 1.2rem;
501
518
  line-height: 1.15;
502
519
  }
503
520
  }
521
+ .preview .action-dialog-name,
522
+ .preview.action-dialog-content {
523
+ font-size: 2rem;
524
+ }
504
525
 
505
526
  /* src/styles/action-dialog/index.css */
506
527
 
@@ -631,6 +652,19 @@
631
652
 
632
653
  /* src/styles/exit-dialog/index.css */
633
654
 
655
+ /* src/styles/game/background/background.css */
656
+ .background {
657
+ z-index: 1;
658
+ background-position: center;
659
+ background-repeat: no-repeat;
660
+ background-size: cover;
661
+ width: 100vw;
662
+ height: 100vh;
663
+ position: fixed;
664
+ }
665
+
666
+ /* src/styles/game/index.css */
667
+
634
668
  /* src/styles/main-menu/main-menu.css */
635
669
  .main-menu {
636
670
  background-image: var(--novely-main-menu-background-image);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.28.1",
3
+ "version": "0.28.3",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"