@novely/solid-renderer 0.28.10 → 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
@@ -4261,7 +4261,8 @@ var createAudio = (storageData) => {
4261
4261
  return cached;
4262
4262
  const howl = new import_howler.Howl({
4263
4263
  src,
4264
- volume: getVolume(type)
4264
+ volume: getVolume(type),
4265
+ html5: type === "music"
4265
4266
  });
4266
4267
  store[kind][src] = howl;
4267
4268
  return howl;
@@ -4740,6 +4741,14 @@ var createEmitter = () => {
4740
4741
  // src/context-state.ts
4741
4742
  var { useContextState, removeContextState } = createContextStateRoot();
4742
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
+
4743
4752
  // src/utils.ts
4744
4753
  var capitalize = (str) => {
4745
4754
  return str[0].toUpperCase() + str.slice(1);
@@ -4754,6 +4763,9 @@ var createImage = (src) => {
4754
4763
  src,
4755
4764
  crossOrigin: "*"
4756
4765
  });
4766
+ img.addEventListener("load", () => {
4767
+ PRELOADED_IMAGE_MAP.set(src, img);
4768
+ });
4757
4769
  return img;
4758
4770
  };
4759
4771
  var createCanvas = () => {
@@ -4815,14 +4827,6 @@ var getDocumentStyles = () => {
4815
4827
  return css;
4816
4828
  };
4817
4829
 
4818
- // src/shared.ts
4819
- var PRELOADED_IMAGE_MAP = /* @__PURE__ */ new Map();
4820
- var { useShared, removeShared } = createShared(() => {
4821
- return {
4822
- characters: {}
4823
- };
4824
- });
4825
-
4826
4830
  // src/hooks/useMedia.ts
4827
4831
  var useMedia = (media) => {
4828
4832
  const mq = matchMedia(media);
@@ -4880,7 +4884,7 @@ var useData = () => {
4880
4884
  };
4881
4885
 
4882
4886
  // src/screens/custom-screen.tsx
4883
- var _tmpl$ = /* @__PURE__ */ template(`<div class="root custom">`);
4887
+ var _tmpl$ = /* @__PURE__ */ template(`<div class="custom">`);
4884
4888
  var CustomScreen = (props) => {
4885
4889
  const {
4886
4890
  $rendererState
@@ -5165,6 +5169,7 @@ var createRetrieved = (fn) => {
5165
5169
 
5166
5170
  // src/components/Save.tsx
5167
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">`);
5168
5173
  var CURRENT_DATE = /* @__PURE__ */ new Date();
5169
5174
  var CURRENT_YEAR = CURRENT_DATE.getFullYear();
5170
5175
  var stylesheet = createRetrieved(getDocumentStyles);
@@ -5178,6 +5183,7 @@ var Save = (props) => {
5178
5183
  removeContext
5179
5184
  } = useData();
5180
5185
  const [iframe, setIframe] = createSignal();
5186
+ const [overlayShown, setOverlayShown] = createSignal(true);
5181
5187
  const [timestamp, type] = props.save[2];
5182
5188
  const date = new Date(timestamp);
5183
5189
  const KEY = `save-${Number(date)}-${type}`;
@@ -5249,6 +5255,10 @@ var Save = (props) => {
5249
5255
  return prev;
5250
5256
  });
5251
5257
  };
5258
+ const hideOverlayTimeoutID = setTimeout(() => {
5259
+ setOverlayShown(false);
5260
+ }, 1050);
5261
+ onCleanup(() => clearTimeout(hideOverlayTimeoutID));
5252
5262
  return (() => {
5253
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;
5254
5264
  _el$2.$$keyup = (event) => {
@@ -5262,6 +5272,10 @@ var Save = (props) => {
5262
5272
  }
5263
5273
  };
5264
5274
  _el$2.$$click = loadSave;
5275
+ insert(_el$2, (() => {
5276
+ const _c$ = createMemo(() => !!overlayShown());
5277
+ return () => _c$() && _tmpl$24();
5278
+ })(), _el$3);
5265
5279
  use(setIframe, _el$3);
5266
5280
  setAttribute(_el$5, "aria-hidden", true);
5267
5281
  insert(_el$5, stringDate);
@@ -5472,7 +5486,7 @@ var createTypewriter = ({
5472
5486
 
5473
5487
  // src/screens/game.tsx
5474
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">`);
5475
- 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">`);
5476
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">`);
5477
5491
  var _tmpl$43 = /* @__PURE__ */ template(`<button type="button" class="button control-panel__button">`);
5478
5492
  var _tmpl$53 = /* @__PURE__ */ template(`<span class="control-panel-container-fix" aria-hidden="true">&#8203;`);
@@ -5704,7 +5718,7 @@ var Game = (props) => {
5704
5718
  isOpen: () => inputState().visible,
5705
5719
  trapFocus: () => !props.isPreview && !rendererState().exitPromptShown,
5706
5720
  get children() {
5707
- 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;
5708
5722
  insert(_el$16, () => inputState().label);
5709
5723
  insert(_el$15, () => inputState().element, _el$17);
5710
5724
  insert(_el$17, () => inputState().error);
@@ -5840,7 +5854,7 @@ var Game = (props) => {
5840
5854
  }
5841
5855
  }), null);
5842
5856
  createRenderEffect((_p$) => {
5843
- 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;
5844
5858
  _v$7 !== _p$._v$7 && className(_el$, _p$._v$7 = _v$7);
5845
5859
  _v$8 !== _p$._v$8 && _el$.classList.toggle("preview", _p$._v$8 = _v$8);
5846
5860
  _p$._v$9 = style(_el$2, _v$9, _p$._v$9);
@@ -5872,7 +5886,7 @@ var Game = (props) => {
5872
5886
  delegateEvents(["click", "keydown"]);
5873
5887
 
5874
5888
  // src/screens/loading.tsx
5875
- 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>`);
5876
5890
  var Loading = (props) => {
5877
5891
  return (() => {
5878
5892
  const _el$ = _tmpl$20();
@@ -5882,8 +5896,8 @@ var Loading = (props) => {
5882
5896
  };
5883
5897
 
5884
5898
  // src/screens/mainmenu.tsx
5885
- 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">`);
5886
- 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>`);
5887
5901
  var MainMenu = () => {
5888
5902
  const {
5889
5903
  t,
@@ -5939,7 +5953,7 @@ var MainMenu = () => {
5939
5953
  return rendererStore().mainmenu;
5940
5954
  },
5941
5955
  children: (item) => (() => {
5942
- const _el$11 = _tmpl$25();
5956
+ const _el$11 = _tmpl$26();
5943
5957
  spread(_el$11, mergeProps(() => item(goto)), false, false);
5944
5958
  return _el$11;
5945
5959
  })()
@@ -5951,8 +5965,8 @@ var MainMenu = () => {
5951
5965
  delegateEvents(["click"]);
5952
5966
 
5953
5967
  // src/screens/saves.tsx
5954
- var _tmpl$26 = /* @__PURE__ */ template(`<ol class="saves__list">`);
5955
- 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">`);
5956
5970
  var _tmpl$34 = /* @__PURE__ */ template(`<div class="saves__list saves__list--empty">`);
5957
5971
  var Saves = () => {
5958
5972
  const {
@@ -5963,7 +5977,7 @@ var Saves = () => {
5963
5977
  const saves = () => storageData().saves;
5964
5978
  const language = () => storageData().meta[0];
5965
5979
  return (() => {
5966
- 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;
5967
5981
  _el$3.$$click = () => {
5968
5982
  $rendererState.setKey("screen", "mainmenu");
5969
5983
  };
@@ -5980,7 +5994,7 @@ var Saves = () => {
5980
5994
  })();
5981
5995
  },
5982
5996
  get children() {
5983
- const _el$5 = _tmpl$26();
5997
+ const _el$5 = _tmpl$27();
5984
5998
  insert(_el$5, createComponent(For, {
5985
5999
  get each() {
5986
6000
  return saves();
@@ -6001,8 +6015,8 @@ var Saves = () => {
6001
6015
  delegateEvents(["click"]);
6002
6016
 
6003
6017
  // src/screens/settings.tsx
6004
- 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">`);
6005
- 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>`);
6006
6020
  var Settings = (props) => {
6007
6021
  const {
6008
6022
  t,
@@ -6053,7 +6067,7 @@ var Settings = (props) => {
6053
6067
  const soundVolumeSelectID = createUniqueId();
6054
6068
  const voiceVolumeSelectID = createUniqueId();
6055
6069
  return (() => {
6056
- 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;
6057
6071
  _el$3.$$click = () => {
6058
6072
  $rendererState.setKey("screen", "mainmenu");
6059
6073
  };
@@ -6072,7 +6086,7 @@ var Settings = (props) => {
6072
6086
  return options.languages;
6073
6087
  },
6074
6088
  children: (lang) => (() => {
6075
- const _el$33 = _tmpl$29();
6089
+ const _el$33 = _tmpl$210();
6076
6090
  _el$33.value = lang;
6077
6091
  insert(_el$33, () => options.getLanguageDisplayName(lang));
6078
6092
  createRenderEffect(() => _el$33.selected = lang === language());
@@ -6087,7 +6101,7 @@ var Settings = (props) => {
6087
6101
  insert(_el$16, createComponent(For, {
6088
6102
  each: ["Slow", "Medium", "Fast", "Auto"],
6089
6103
  children: (speed) => (() => {
6090
- const _el$34 = _tmpl$29();
6104
+ const _el$34 = _tmpl$210();
6091
6105
  _el$34.value = speed;
6092
6106
  insert(_el$34, () => t("TextSpeed" + speed));
6093
6107
  createRenderEffect(() => _el$34.selected = speed === textSpeed());
@@ -6133,7 +6147,7 @@ var Settings = (props) => {
6133
6147
  delegateEvents(["click"]);
6134
6148
 
6135
6149
  // src/components/Root.tsx
6136
- var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
6150
+ var _tmpl$30 = /* @__PURE__ */ template(`<div class="root">`);
6137
6151
  var createRootComponent = ({
6138
6152
  $rendererState,
6139
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.10",
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
- "@novely/renderer-toolkit": "0.3.0",
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": {