@novely/solid-renderer 0.30.2 → 0.31.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/index.jsx CHANGED
@@ -4761,6 +4761,10 @@ var handleClearAction = ($rendererState, $contextState, context, keep, keepChara
4761
4761
  }
4762
4762
  );
4763
4763
  }
4764
+ const inputCleanup = $contextState.get().input.cleanup;
4765
+ if (inputCleanup) {
4766
+ inputCleanup();
4767
+ }
4764
4768
  if (!keep.has("input")) {
4765
4769
  $contextState.mutate(
4766
4770
  (s) => s.input,
@@ -4931,7 +4935,6 @@ var handleInputAction = ($contextState, options, context, label, onInput, setup,
4931
4935
  input.setAttribute("required", "true");
4932
4936
  input.setAttribute("autocomplete", "off");
4933
4937
  !context.meta.preview && input.addEventListener("input", onInputHandler);
4934
- setup(input, (callback) => $contextState.mutate((s) => s.input.cleanup, () => callback));
4935
4938
  $contextState.mutate(
4936
4939
  (s) => s.input,
4937
4940
  {
@@ -4939,6 +4942,7 @@ var handleInputAction = ($contextState, options, context, label, onInput, setup,
4939
4942
  label,
4940
4943
  error: "",
4941
4944
  visible: true,
4945
+ cleanup: setup(input) || noop,
4942
4946
  resolve
4943
4947
  }
4944
4948
  );
@@ -6044,7 +6048,7 @@ function destructure(source, options) {
6044
6048
  // src/screens/game.tsx
6045
6049
  var _tmpl$19 = /* @__PURE__ */ template(`<div class="action-dialog-person">`);
6046
6050
  var _tmpl$25 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">&#8203;</span><div class="dialog-panel"><span class="dialog-panel-label">`);
6047
- var _tmpl$34 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">&#8203;</span><div class="dialog-panel input-dialog-panel"><label for="novely-input" class="input-dialog-label"><span></span><span aria-live="polite" aria-atomic="true"></span></label><button type="submit" class="button dialog-input__button">`);
6051
+ var _tmpl$34 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">&#8203;</span><div class="dialog-panel input-dialog-panel"><label for="novely-input" class="input-dialog-label"><span class="input-dialog-label-text"></span></label><span class="input-dialog-label-text input-dialog-label__error" aria-live="polite" aria-atomic="true"></span><button type="submit" class="button dialog-input__button">`);
6048
6052
  var _tmpl$44 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">&#8203;</span><div class="dialog-backdrop"></div><div class="dialog-panel exit-dialog-panel"><span class="dialog-panel-label"></span><div class="exit-dialog-panel-buttons"><button type="button" class="button"></button><button type="button" class="button">`);
6049
6053
  var _tmpl$53 = /* @__PURE__ */ template(`<button type="button" class="button control-panel__button">`);
6050
6054
  var _tmpl$62 = /* @__PURE__ */ template(`<span class="control-panel-container-fix" aria-hidden="true">&#8203;`);
@@ -6295,9 +6299,9 @@ var Game = (props) => {
6295
6299
  isOpen: () => input().visible,
6296
6300
  trapFocus: () => !props.isPreview && !rendererState().exitPromptShown,
6297
6301
  get children() {
6298
- const _el$11 = _tmpl$34(), _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;
6302
+ const _el$11 = _tmpl$34(), _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.firstChild, _el$16 = _el$14.nextSibling, _el$17 = _el$16.nextSibling;
6299
6303
  insert(_el$15, () => input().label);
6300
- insert(_el$14, () => input().element, _el$16);
6304
+ insert(_el$14, () => input().element, null);
6301
6305
  insert(_el$16, () => input().error);
6302
6306
  _el$17.$$click = onInputButtonClick;
6303
6307
  insert(_el$17, () => data.t("Sumbit"));
@@ -610,18 +610,35 @@
610
610
  font-size: 1.2375rem;
611
611
  display: flex;
612
612
  }
613
- .input-dialog-label > span {
613
+ .input-dialog-label-text {
614
614
  min-height: 1rem;
615
615
  -webkit-tap-highlight-color: #0000;
616
616
  -webkit-tap-highlight-color: transparent;
617
617
  -webkit-touch-callout: none;
618
+ text-align: center;
619
+ width: 40vw;
618
620
  min-height: 1lh;
619
621
  margin: .4rem 0;
622
+ font-size: 1.2375rem;
620
623
  }
621
624
  .input-dialog-label > input {
622
625
  min-width: min(10rem, 100%);
623
626
  max-width: 100%;
624
627
  }
628
+ .input-dialog-label:has(input[type=checkbox]) {
629
+ flex-direction: row;
630
+ gap: 1.25rem;
631
+ }
632
+ .input-dialog-label:has(input[type=checkbox]) .input-dialog-label-text {
633
+ width: auto;
634
+ }
635
+ .input-dialog-label > input[type=checkbox] {
636
+ min-width: unset;
637
+ }
638
+ .input-dialog-label__error {
639
+ min-height: 2rem;
640
+ min-height: 2lh;
641
+ }
625
642
  .input-dialog-panel {
626
643
  color: var(--novely-input-dialog-color, #fff);
627
644
  border: var(--novely-input-dialog-border-width, .18rem) solid var(--novely-input-dialog-border-color, #fff);
@@ -633,6 +650,30 @@
633
650
  background-size: var(--novely-input-dialog-background-size, 6.25rem 6.25rem);
634
651
  justify-content: center;
635
652
  align-items: center;
653
+ min-width: 35vw;
654
+ }
655
+ @media (max-aspect-ratio: .8) {
656
+ .input-dialog-label-text {
657
+ width: calc(100vw - .5rem);
658
+ }
659
+ .input-dialog-label__error {
660
+ min-height: 3rem;
661
+ min-height: 3lh;
662
+ }
663
+ }
664
+
665
+ /* src/styles/input-dialog/input/input.css */
666
+ input[name=novely-input] {
667
+ border: none;
668
+ border-radius: .25rem;
669
+ padding: .25rem;
670
+ display: block;
671
+ position: relative;
672
+ }
673
+ input[name=novely-input][type=text],
674
+ input[name=novely-input][type=number],
675
+ input[name=novely-input][type=password] {
676
+ box-shadow: 0 0 0 var(--input-box-shadow-spread-radius, .15rem) var(--novely-input-border-color, #ffc7df);
636
677
  }
637
678
 
638
679
  /* src/styles/input-dialog/button/button.css */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.30.2",
3
+ "version": "0.31.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -19,8 +19,8 @@
19
19
  "retrieved": "^0.1.0",
20
20
  "solid-js": "1.8.17",
21
21
  "solid-transition-group": "^0.2.3",
22
- "@novely/core": "0.33.3",
23
- "@novely/renderer-toolkit": "0.4.0",
22
+ "@novely/core": "0.34.0",
23
+ "@novely/renderer-toolkit": "0.5.0",
24
24
  "@novely/typewriter": "0.5.1"
25
25
  },
26
26
  "peerDependencies": {