@novely/solid-renderer 0.28.11 → 0.28.12-test

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
@@ -4741,6 +4741,14 @@ var createEmitter = () => {
4741
4741
  // src/context-state.ts
4742
4742
  var { useContextState, removeContextState } = createContextStateRoot();
4743
4743
 
4744
+ // src/shared.ts
4745
+ var PRELOADED_IMAGE_MAP = /* @__PURE__ */ new Map();
4746
+ var { useShared, removeShared } = createShared(() => {
4747
+ return {
4748
+ characters: {}
4749
+ };
4750
+ });
4751
+
4744
4752
  // src/utils.ts
4745
4753
  var capitalize = (str) => {
4746
4754
  return str[0].toUpperCase() + str.slice(1);
@@ -4755,6 +4763,9 @@ var createImage = (src) => {
4755
4763
  src,
4756
4764
  crossOrigin: "*"
4757
4765
  });
4766
+ img.addEventListener("load", () => {
4767
+ PRELOADED_IMAGE_MAP.set(src, img);
4768
+ });
4758
4769
  return img;
4759
4770
  };
4760
4771
  var createCanvas = () => {
@@ -4816,14 +4827,6 @@ var getDocumentStyles = () => {
4816
4827
  return css;
4817
4828
  };
4818
4829
 
4819
- // src/shared.ts
4820
- var PRELOADED_IMAGE_MAP = /* @__PURE__ */ new Map();
4821
- var { useShared, removeShared } = createShared(() => {
4822
- return {
4823
- characters: {}
4824
- };
4825
- });
4826
-
4827
4830
  // src/hooks/useMedia.ts
4828
4831
  var useMedia = (media) => {
4829
4832
  const mq = matchMedia(media);
@@ -4881,7 +4884,7 @@ var useData = () => {
4881
4884
  };
4882
4885
 
4883
4886
  // src/screens/custom-screen.tsx
4884
- var _tmpl$ = /* @__PURE__ */ template(`<div class="root custom">`);
4887
+ var _tmpl$ = /* @__PURE__ */ template(`<div class="custom">`);
4885
4888
  var CustomScreen = (props) => {
4886
4889
  const {
4887
4890
  $rendererState
@@ -5166,6 +5169,7 @@ var createRetrieved = (fn) => {
5166
5169
 
5167
5170
  // src/components/Save.tsx
5168
5171
  var _tmpl$17 = /* @__PURE__ */ template(`<li class="saves__list-item"><div class="saves__list-item__load" role="button" tabindex="0"><iframe loading="lazy" role="button" tabindex="-1" class="saves__list-item__iframe"></iframe></div><div class="saves__list-item__description"><div></div><div></div></div><button type="reset" class="button saves__button-reset"><span>`);
5172
+ var _tmpl$24 = /* @__PURE__ */ template(`<div class="saves__list-item__overlay">`);
5169
5173
  var CURRENT_DATE = /* @__PURE__ */ new Date();
5170
5174
  var CURRENT_YEAR = CURRENT_DATE.getFullYear();
5171
5175
  var stylesheet = createRetrieved(getDocumentStyles);
@@ -5179,6 +5183,7 @@ var Save = (props) => {
5179
5183
  removeContext
5180
5184
  } = useData();
5181
5185
  const [iframe, setIframe] = createSignal();
5186
+ const [overlayShown, setOverlayShown] = createSignal(true);
5182
5187
  const [timestamp, type] = props.save[2];
5183
5188
  const date = new Date(timestamp);
5184
5189
  const KEY = `save-${Number(date)}-${type}`;
@@ -5250,6 +5255,10 @@ var Save = (props) => {
5250
5255
  return prev;
5251
5256
  });
5252
5257
  };
5258
+ const hideOverlayTimeoutID = setTimeout(() => {
5259
+ setOverlayShown(false);
5260
+ }, 1050);
5261
+ onCleanup(() => clearTimeout(hideOverlayTimeoutID));
5253
5262
  return (() => {
5254
5263
  const _el$ = _tmpl$17(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild;
5255
5264
  _el$2.$$keyup = (event) => {
@@ -5263,6 +5272,10 @@ var Save = (props) => {
5263
5272
  }
5264
5273
  };
5265
5274
  _el$2.$$click = loadSave;
5275
+ insert(_el$2, (() => {
5276
+ const _c$ = createMemo(() => !!overlayShown());
5277
+ return () => _c$() && _tmpl$24();
5278
+ })(), _el$3);
5266
5279
  use(setIframe, _el$3);
5267
5280
  setAttribute(_el$5, "aria-hidden", true);
5268
5281
  insert(_el$5, stringDate);
@@ -5473,7 +5486,7 @@ var createTypewriter = ({
5473
5486
 
5474
5487
  // src/screens/game.tsx
5475
5488
  var _tmpl$19 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">&#8203;</span><div class="dialog-panel"><span class="dialog-panel-label">`);
5476
- var _tmpl$24 = /* @__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">`);
5489
+ var _tmpl$25 = /* @__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">`);
5477
5490
  var _tmpl$33 = /* @__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">`);
5478
5491
  var _tmpl$43 = /* @__PURE__ */ template(`<button type="button" class="button control-panel__button">`);
5479
5492
  var _tmpl$53 = /* @__PURE__ */ template(`<span class="control-panel-container-fix" aria-hidden="true">&#8203;`);
@@ -5705,7 +5718,7 @@ var Game = (props) => {
5705
5718
  isOpen: () => inputState().visible,
5706
5719
  trapFocus: () => !props.isPreview && !rendererState().exitPromptShown,
5707
5720
  get children() {
5708
- 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;
5721
+ const _el$12 = _tmpl$25(), _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;
5709
5722
  insert(_el$16, () => inputState().label);
5710
5723
  insert(_el$15, () => inputState().element, _el$17);
5711
5724
  insert(_el$17, () => inputState().error);
@@ -5841,7 +5854,7 @@ var Game = (props) => {
5841
5854
  }
5842
5855
  }), null);
5843
5856
  createRenderEffect((_p$) => {
5844
- 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;
5857
+ const _v$7 = `${props.className || ""} 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;
5845
5858
  _v$7 !== _p$._v$7 && className(_el$, _p$._v$7 = _v$7);
5846
5859
  _v$8 !== _p$._v$8 && _el$.classList.toggle("preview", _p$._v$8 = _v$8);
5847
5860
  _p$._v$9 = style(_el$2, _v$9, _p$._v$9);
@@ -5873,7 +5886,7 @@ var Game = (props) => {
5873
5886
  delegateEvents(["click", "keydown"]);
5874
5887
 
5875
5888
  // src/screens/loading.tsx
5876
- var _tmpl$20 = /* @__PURE__ */ template(`<div class="root loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
5889
+ var _tmpl$20 = /* @__PURE__ */ template(`<div class="loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
5877
5890
  var Loading = (props) => {
5878
5891
  return (() => {
5879
5892
  const _el$ = _tmpl$20();
@@ -5883,8 +5896,8 @@ var Loading = (props) => {
5883
5896
  };
5884
5897
 
5885
5898
  // src/screens/mainmenu.tsx
5886
- var _tmpl$21 = /* @__PURE__ */ template(`<div class="root main-menu"><div class="main-menu__controls"><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text">`);
5887
- var _tmpl$25 = /* @__PURE__ */ template(`<button>`);
5899
+ var _tmpl$21 = /* @__PURE__ */ template(`<div class="main-menu"><div class="main-menu__controls"><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text">`);
5900
+ var _tmpl$26 = /* @__PURE__ */ template(`<button>`);
5888
5901
  var MainMenu = () => {
5889
5902
  const {
5890
5903
  t,
@@ -5940,7 +5953,7 @@ var MainMenu = () => {
5940
5953
  return rendererStore().mainmenu;
5941
5954
  },
5942
5955
  children: (item) => (() => {
5943
- const _el$11 = _tmpl$25();
5956
+ const _el$11 = _tmpl$26();
5944
5957
  spread(_el$11, mergeProps(() => item(goto)), false, false);
5945
5958
  return _el$11;
5946
5959
  })()
@@ -5952,8 +5965,8 @@ var MainMenu = () => {
5952
5965
  delegateEvents(["click"]);
5953
5966
 
5954
5967
  // src/screens/saves.tsx
5955
- var _tmpl$26 = /* @__PURE__ */ template(`<ol class="saves__list">`);
5956
- var _tmpl$27 = /* @__PURE__ */ template(`<div class="root saves"><div class="saves__controls"><button type="button" class="button saves__button"></button></div><div class="saves__list-container">`);
5968
+ var _tmpl$27 = /* @__PURE__ */ template(`<ol class="saves__list">`);
5969
+ var _tmpl$28 = /* @__PURE__ */ template(`<div class="saves"><div class="saves__controls"><button type="button" class="button saves__button"></button></div><div class="saves__list-container">`);
5957
5970
  var _tmpl$34 = /* @__PURE__ */ template(`<div class="saves__list saves__list--empty">`);
5958
5971
  var Saves = () => {
5959
5972
  const {
@@ -5964,7 +5977,7 @@ var Saves = () => {
5964
5977
  const saves = () => storageData().saves;
5965
5978
  const language = () => storageData().meta[0];
5966
5979
  return (() => {
5967
- const _el$ = _tmpl$27(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
5980
+ const _el$ = _tmpl$28(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
5968
5981
  _el$3.$$click = () => {
5969
5982
  $rendererState.setKey("screen", "mainmenu");
5970
5983
  };
@@ -5981,7 +5994,7 @@ var Saves = () => {
5981
5994
  })();
5982
5995
  },
5983
5996
  get children() {
5984
- const _el$5 = _tmpl$26();
5997
+ const _el$5 = _tmpl$27();
5985
5998
  insert(_el$5, createComponent(For, {
5986
5999
  get each() {
5987
6000
  return saves();
@@ -6002,8 +6015,8 @@ var Saves = () => {
6002
6015
  delegateEvents(["click"]);
6003
6016
 
6004
6017
  // src/screens/settings.tsx
6005
- var _tmpl$28 = /* @__PURE__ */ template(`<div class="root settings"><div class="settings__controls"><button type="button" class="button settings__button"></button><button type="button" class="button settings__button"></button></div><div class="settings__options"><div><div class="select"><label class="select__label"><span class="select__label__icon"></span> </label><select class="select__select"></select></div><div class="select"><label class="select__label"><span class="select__label__icon"></span> </label><select class="select__select"></select></div></div><div><div class="range"><label class="range__label"><span class="range__label__icon"></span> </label><input class="range__range" type="range" min="0" max="1" step="0.01"></div><div class="range"><label class="range__label"><span class="range__label__icon"></span> </label><input class="range__range" type="range" min="0" max="1" step="0.01"></div><div class="range"><label class="range__label"><span class="range__label__icon"></span> </label><input class="range__range" type="range" min="0" max="1" step="0.01">`);
6006
- var _tmpl$29 = /* @__PURE__ */ template(`<option>`);
6018
+ var _tmpl$29 = /* @__PURE__ */ template(`<div class="root settings"><div class="settings__controls"><button type="button" class="button settings__button"></button><button type="button" class="button settings__button"></button></div><div class="settings__options"><div><div class="select"><label class="select__label"><span class="select__label__icon"></span> </label><select class="select__select"></select></div><div class="select"><label class="select__label"><span class="select__label__icon"></span> </label><select class="select__select"></select></div></div><div><div class="range"><label class="range__label"><span class="range__label__icon"></span> </label><input class="range__range" type="range" min="0" max="1" step="0.01"></div><div class="range"><label class="range__label"><span class="range__label__icon"></span> </label><input class="range__range" type="range" min="0" max="1" step="0.01"></div><div class="range"><label class="range__label"><span class="range__label__icon"></span> </label><input class="range__range" type="range" min="0" max="1" step="0.01">`);
6019
+ var _tmpl$210 = /* @__PURE__ */ template(`<option>`);
6007
6020
  var Settings = (props) => {
6008
6021
  const {
6009
6022
  t,
@@ -6054,7 +6067,7 @@ var Settings = (props) => {
6054
6067
  const soundVolumeSelectID = createUniqueId();
6055
6068
  const voiceVolumeSelectID = createUniqueId();
6056
6069
  return (() => {
6057
- const _el$ = _tmpl$28(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$10 = _el$9.nextSibling, _el$11 = _el$8.nextSibling, _el$12 = _el$7.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$13.nextSibling, _el$17 = _el$6.nextSibling, _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling, _el$22 = _el$19.nextSibling, _el$23 = _el$18.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling, _el$27 = _el$24.nextSibling, _el$28 = _el$23.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$29.nextSibling;
6070
+ const _el$ = _tmpl$29(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$10 = _el$9.nextSibling, _el$11 = _el$8.nextSibling, _el$12 = _el$7.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$13.nextSibling, _el$17 = _el$6.nextSibling, _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling, _el$22 = _el$19.nextSibling, _el$23 = _el$18.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling, _el$27 = _el$24.nextSibling, _el$28 = _el$23.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$29.nextSibling;
6058
6071
  _el$3.$$click = () => {
6059
6072
  $rendererState.setKey("screen", "mainmenu");
6060
6073
  };
@@ -6073,7 +6086,7 @@ var Settings = (props) => {
6073
6086
  return options.languages;
6074
6087
  },
6075
6088
  children: (lang) => (() => {
6076
- const _el$33 = _tmpl$29();
6089
+ const _el$33 = _tmpl$210();
6077
6090
  _el$33.value = lang;
6078
6091
  insert(_el$33, () => options.getLanguageDisplayName(lang));
6079
6092
  createRenderEffect(() => _el$33.selected = lang === language());
@@ -6088,7 +6101,7 @@ var Settings = (props) => {
6088
6101
  insert(_el$16, createComponent(For, {
6089
6102
  each: ["Slow", "Medium", "Fast", "Auto"],
6090
6103
  children: (speed) => (() => {
6091
- const _el$34 = _tmpl$29();
6104
+ const _el$34 = _tmpl$210();
6092
6105
  _el$34.value = speed;
6093
6106
  insert(_el$34, () => t("TextSpeed" + speed));
6094
6107
  createRenderEffect(() => _el$34.selected = speed === textSpeed());
@@ -6134,7 +6147,7 @@ var Settings = (props) => {
6134
6147
  delegateEvents(["click"]);
6135
6148
 
6136
6149
  // src/components/Root.tsx
6137
- var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
6150
+ var _tmpl$30 = /* @__PURE__ */ template(`<div class="root">`);
6138
6151
  var createRootComponent = ({
6139
6152
  $rendererState,
6140
6153
  $contextState,
@@ -1,5 +1,6 @@
1
1
  /* src/styles/root/root.css */
2
2
  .root {
3
+ background-image: var(--novely-root-background-image);
3
4
  background-repeat: var(--novely-root-background-repeat, no-repeat);
4
5
  background-position: var(--novely-root-background-position, center);
5
6
  background-size: var(--novely-root-background-size, cover);
@@ -27,6 +28,7 @@
27
28
  Segoe UI Symbol,
28
29
  Noto Color Emoji;
29
30
  font-size: 1rem;
31
+ overflow: clip;
30
32
  }
31
33
  .root,
32
34
  .root * {
@@ -678,7 +680,7 @@
678
680
 
679
681
  /* src/styles/main-menu/main-menu.css */
680
682
  .main-menu {
681
- background-image: var(--novely-main-menu-background-image);
683
+ height: 100%;
682
684
  padding: 0 1rem;
683
685
  display: flex;
684
686
  overflow: hidden;
@@ -803,11 +805,10 @@
803
805
 
804
806
  /* src/styles/settings/settings.css */
805
807
  .settings {
806
- background-image: var(--novely-settings-background-image);
807
808
  gap: 1rem;
809
+ height: 100%;
808
810
  padding: 0 1rem;
809
811
  display: flex;
810
- overflow: hidden;
811
812
  }
812
813
  @media (max-aspect-ratio: .8) {
813
814
  .settings {
@@ -857,11 +858,10 @@
857
858
 
858
859
  /* src/styles/saves/saves.css */
859
860
  .saves {
860
- background-image: var(--novely-saves-background-image);
861
861
  gap: 1rem;
862
+ height: 100%;
862
863
  padding: 0 1rem;
863
864
  display: flex;
864
- overflow: hidden;
865
865
  }
866
866
  @media (max-aspect-ratio: .8) {
867
867
  .saves {
@@ -997,6 +997,25 @@
997
997
  left: 0;
998
998
  right: 0;
999
999
  }
1000
+ .saves__list-item__overlay {
1001
+ z-index: 3;
1002
+ pointer-events: none;
1003
+ background-color: var(--novely-saves-list-overlay-item-background-color, var(--novely-saves-list-item-background-color, #ffe9f3));
1004
+ animation: .75s ease-out .3s overlay;
1005
+ position: absolute;
1006
+ top: 0;
1007
+ bottom: 0;
1008
+ left: 0;
1009
+ right: 0;
1010
+ }
1011
+ @keyframes overlay {
1012
+ from {
1013
+ opacity: 1;
1014
+ }
1015
+ to {
1016
+ opacity: 0;
1017
+ }
1018
+ }
1000
1019
  @media (max-aspect-ratio: .8) {
1001
1020
  .saves__list {
1002
1021
  height: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.28.11",
3
+ "version": "0.28.12-test",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,8 +17,8 @@
17
17
  "dependencies": {
18
18
  "retrieved": "^0.1.0",
19
19
  "solid-js": "1.8.5",
20
- "@novely/core": "0.31.3",
21
20
  "@novely/renderer-toolkit": "0.3.1",
21
+ "@novely/core": "0.32.0",
22
22
  "@novely/typewriter": "0.5.1"
23
23
  },
24
24
  "peerDependencies": {