@novely/solid-renderer 0.35.2 → 0.35.4

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.
@@ -19,5 +19,7 @@ declare const Icon: {
19
19
  Stop(): JSX.Element;
20
20
  FilePlus(): JSX.Element;
21
21
  Files(): JSX.Element;
22
+ ChevronDown(): JSX.Element;
23
+ ChevronUp(): JSX.Element;
22
24
  };
23
25
  export { Icon };
@@ -0,0 +1,14 @@
1
+ import type { JSX, VoidComponent } from 'solid-js';
2
+ type NativeInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'class' | 'id' | 'type'>;
3
+ type RangeProps = NativeInputProps & {
4
+ /**
5
+ * Icon HTML string
6
+ */
7
+ icon: string;
8
+ /**
9
+ * Label
10
+ */
11
+ label: string;
12
+ };
13
+ declare const Range: VoidComponent<RangeProps>;
14
+ export { Range };
@@ -13,10 +13,11 @@ type CreateRootComponentOpts = {
13
13
  skipTypewriterWhenGoingBack: boolean;
14
14
  controls: 'inside' | 'outside';
15
15
  settingsIcons: SettingsIcons;
16
+ showAudioSettings: boolean;
16
17
  rendererContext: Context;
17
18
  coreOptions: RendererInit<any, any>;
18
19
  $contextState: DeepAtom<ContextStateStore<Record<PropertyKey, unknown>>>;
19
20
  $rendererState: DeepAtom<RendererStateStore<RendererStoreExtension>>;
20
21
  };
21
- declare const createRootComponent: ({ $rendererState, $contextState, coreOptions, setRoot, characters, renderer, fullscreen, emitter, controls, skipTypewriterWhenGoingBack, settingsIcons, rendererContext }: CreateRootComponentOpts) => Component;
22
+ declare const createRootComponent: ({ $rendererState, $contextState, coreOptions, setRoot, characters, renderer, showAudioSettings, fullscreen, emitter, controls, skipTypewriterWhenGoingBack, settingsIcons, rendererContext }: CreateRootComponentOpts) => Component;
22
23
  export { createRootComponent };
@@ -0,0 +1,14 @@
1
+ import type { JSX, FlowComponent } from 'solid-js';
2
+ type NativeSelectProps = Omit<JSX.SelectHTMLAttributes<HTMLSelectElement>, 'class' | 'id'>;
3
+ type SelectProps = NativeSelectProps & {
4
+ /**
5
+ * Icon HTML string
6
+ */
7
+ icon: string;
8
+ /**
9
+ * Label
10
+ */
11
+ label: string;
12
+ };
13
+ declare const Select: FlowComponent<SelectProps>;
14
+ export { Select };
@@ -0,0 +1,14 @@
1
+ import type { JSX, FlowComponent } from 'solid-js';
2
+ type NativeSelectProps = Omit<JSX.SelectHTMLAttributes<HTMLSelectElement>, 'class' | 'id'>;
3
+ type SelectProps = NativeSelectProps & {
4
+ /**
5
+ * Icon HTML string
6
+ */
7
+ icon: string;
8
+ /**
9
+ * Label
10
+ */
11
+ label: string;
12
+ };
13
+ declare const Select: FlowComponent<SelectProps>;
14
+ export { Select };
@@ -7,3 +7,5 @@ export { Save } from './Save';
7
7
  export { createTypewriter } from './Typewriter';
8
8
  export { createRootComponent } from './Root';
9
9
  export { Canvas } from './Canvas';
10
+ export { Select } from './Select';
11
+ export { Range } from './Range';
package/dist/index.jsx CHANGED
@@ -2236,7 +2236,7 @@ var require_howler = __commonJS({
2236
2236
  }
2237
2237
  });
2238
2238
 
2239
- // ../../node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/dist/solid.js
2239
+ // ../../node_modules/.pnpm/solid-js@1.8.18/node_modules/solid-js/dist/solid.js
2240
2240
  var sharedConfig = {
2241
2241
  context: void 0,
2242
2242
  registry: void 0
@@ -3323,7 +3323,7 @@ function Match(props) {
3323
3323
  }
3324
3324
  var SuspenseListContext = createContext();
3325
3325
 
3326
- // ../../node_modules/.pnpm/solid-js@1.8.17/node_modules/solid-js/web/dist/web.js
3326
+ // ../../node_modules/.pnpm/solid-js@1.8.18/node_modules/solid-js/web/dist/web.js
3327
3327
  var booleans = [
3328
3328
  "allowfullscreen",
3329
3329
  "async",
@@ -3750,8 +3750,11 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
3750
3750
  if (t === "string" || t === "number") {
3751
3751
  if (hydrating)
3752
3752
  return current;
3753
- if (t === "number")
3753
+ if (t === "number") {
3754
3754
  value = value.toString();
3755
+ if (value === current)
3756
+ return current;
3757
+ }
3755
3758
  if (multi) {
3756
3759
  let node = current[0];
3757
3760
  if (node && node.nodeType === 3) {
@@ -4683,13 +4686,15 @@ var createRootSetter = (getContext2) => {
4683
4686
  };
4684
4687
  };
4685
4688
  var vibrationPossible = /* @__PURE__ */ (() => {
4686
- let can = false;
4689
+ let possible = false;
4687
4690
  const onPointerDown = () => {
4688
- can = true;
4689
- document.removeEventListener("pointerdown", onPointerDown);
4691
+ possible = true;
4692
+ };
4693
+ const isPossible = () => {
4694
+ return possible;
4690
4695
  };
4691
- document.addEventListener("pointerdown", onPointerDown);
4692
- return () => can;
4696
+ document.addEventListener("pointerdown", onPointerDown, { once: true });
4697
+ return isPossible;
4693
4698
  })();
4694
4699
  var vibrate = (pattern) => {
4695
4700
  if (vibrationPossible() && "vibrate" in navigator) {
@@ -5400,6 +5405,8 @@ var _tmpl$12 = /* @__PURE__ */ template(`<svg><rect width="12.5" height="12.5" x
5400
5405
  var _tmpl$13 = /* @__PURE__ */ template(`<svg><path d="M11.25 19.25h-3.5a2 2 0 0 1-2-2V6.75a2 2 0 0 1 2-2H14L18.25 9v2.25M17 14.75v4.5M19.25 17h-4.5"></svg>`, false, true);
5401
5406
  var _tmpl$14 = /* @__PURE__ */ template(`<svg><path d="M18 9.25h-4.25V5"></svg>`, false, true);
5402
5407
  var _tmpl$15 = /* @__PURE__ */ template(`<svg><path d="M9.75 6.75h-3a2 2 0 0 0-2 2v8.5a2 2 0 0 0 2 2h6.5a2 2 0 0 0 2-2v-5m-5.5-5.5 5.5 5.5m-5.5-5.5v3.5a2 2 0 0 0 2 2h3.5m-3.5-7.5h2l5.5 5.5v5a2 2 0 0 1-2 2H15.5"></svg>`, false, true);
5408
+ var _tmpl$16 = /* @__PURE__ */ template(`<svg><path d="M15.25 10.75 12 14.25l-3.25-3.5"></svg>`, false, true);
5409
+ var _tmpl$17 = /* @__PURE__ */ template(`<svg><path d="M15.25 14.25 12 10.75l-3.25 3.5"></svg>`, false, true);
5403
5410
  var Icon = (props) => {
5404
5411
  return (() => {
5405
5412
  const _el$ = _tmpl$5();
@@ -5438,6 +5445,12 @@ Icon.FilePlus = () => {
5438
5445
  Icon.Files = () => {
5439
5446
  return _tmpl$15();
5440
5447
  };
5448
+ Icon.ChevronDown = () => {
5449
+ return _tmpl$16();
5450
+ };
5451
+ Icon.ChevronUp = () => {
5452
+ return _tmpl$17();
5453
+ };
5441
5454
 
5442
5455
  // src/actions.ts
5443
5456
  var clickOutside = (node, handler) => {
@@ -5447,7 +5460,7 @@ var clickOutside = (node, handler) => {
5447
5460
  };
5448
5461
 
5449
5462
  // src/components/Modal.tsx
5450
- var _tmpl$16 = /* @__PURE__ */ template(`<div role="dialog" class="dialog">`);
5463
+ var _tmpl$18 = /* @__PURE__ */ template(`<div role="dialog" class="dialog">`);
5451
5464
  var Modal = (props) => {
5452
5465
  let modalWindow;
5453
5466
  const handleKeydown = (event) => {
@@ -5483,7 +5496,7 @@ var Modal = (props) => {
5483
5496
  return props.isOpen();
5484
5497
  },
5485
5498
  get children() {
5486
- const _el$ = _tmpl$16();
5499
+ const _el$ = _tmpl$18();
5487
5500
  use((element) => {
5488
5501
  modalWindow = element;
5489
5502
  clickOutside(element, close);
@@ -5495,7 +5508,7 @@ var Modal = (props) => {
5495
5508
  });
5496
5509
  };
5497
5510
 
5498
- // ../../node_modules/.pnpm/@solid-primitives+transition-group@1.0.5_solid-js@1.8.17/node_modules/@solid-primitives/transition-group/dist/index.js
5511
+ // ../../node_modules/.pnpm/@solid-primitives+transition-group@1.0.5_solid-js@1.8.18/node_modules/@solid-primitives/transition-group/dist/index.js
5499
5512
  var noop2 = () => {
5500
5513
  };
5501
5514
  var noopTransition = (el, done) => done();
@@ -5563,10 +5576,10 @@ function createSwitchTransition(source, options) {
5563
5576
  return returned;
5564
5577
  }
5565
5578
 
5566
- // ../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.17/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js
5579
+ // ../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.18/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js
5567
5580
  var access = (v) => typeof v === "function" && !v.length ? v() : v;
5568
5581
 
5569
- // ../../node_modules/.pnpm/@solid-primitives+refs@1.0.8_solid-js@1.8.17/node_modules/@solid-primitives/refs/dist/index.js
5582
+ // ../../node_modules/.pnpm/@solid-primitives+refs@1.0.8_solid-js@1.8.18/node_modules/@solid-primitives/refs/dist/index.js
5570
5583
  var defaultElementPredicate = isServer ? (item) => item != null && typeof item === "object" && "t" in item : (item) => item instanceof Element;
5571
5584
  function getFirstChild(value, predicate) {
5572
5585
  if (predicate(value))
@@ -5587,7 +5600,7 @@ function resolveFirst(fn, predicate = defaultElementPredicate, serverPredicate =
5587
5600
  return createMemo(() => getFirstChild(children2(), isServer ? serverPredicate : predicate));
5588
5601
  }
5589
5602
 
5590
- // ../../node_modules/.pnpm/solid-transition-group@0.2.3_solid-js@1.8.17/node_modules/solid-transition-group/dist/index.js
5603
+ // ../../node_modules/.pnpm/solid-transition-group@0.2.3_solid-js@1.8.18/node_modules/solid-transition-group/dist/index.js
5591
5604
  function createClassnames(props) {
5592
5605
  return createMemo(() => {
5593
5606
  const name = props.name || "s";
@@ -5695,7 +5708,7 @@ var createRetrieved = (fn) => {
5695
5708
  };
5696
5709
 
5697
5710
  // src/components/Save.tsx
5698
- var _tmpl$17 = /* @__PURE__ */ template(`<div class="saves__list-item__overlay">`);
5711
+ var _tmpl$19 = /* @__PURE__ */ template(`<div class="saves__list-item__overlay">`);
5699
5712
  var _tmpl$24 = /* @__PURE__ */ template(`<iframe tabindex="-1" class="saves__list-item__iframe" src="about:blank">`);
5700
5713
  var _tmpl$33 = /* @__PURE__ */ template(`<li class="saves__list-item"><div class="saves__list-item__load" role="button" tabindex="0"></div><div class="saves__list-item__description"><div></div><div></div></div><button type="reset" class="button saves__button-reset"><span>`);
5701
5714
  var _tmpl$43 = /* @__PURE__ */ template(`<div class="saves__list-item__iframe">`);
@@ -5821,7 +5834,7 @@ var Save = (props) => {
5821
5834
  return props.overlayShown;
5822
5835
  },
5823
5836
  get children() {
5824
- return _tmpl$17();
5837
+ return _tmpl$19();
5825
5838
  }
5826
5839
  });
5827
5840
  }
@@ -6023,7 +6036,7 @@ var settingsIcons = {
6023
6036
  };
6024
6037
 
6025
6038
  // src/components/Typewriter.tsx
6026
- var _tmpl$18 = /* @__PURE__ */ template(`<span>`);
6039
+ var _tmpl$20 = /* @__PURE__ */ template(`<span>`);
6027
6040
  var PRM = matchMedia("(prefers-reduced-motion: reduce)");
6028
6041
  var createTypewriter = ({
6029
6042
  resolve
@@ -6065,7 +6078,7 @@ var createTypewriter = ({
6065
6078
  bypassed = false;
6066
6079
  });
6067
6080
  return (() => {
6068
- const _el$ = _tmpl$18();
6081
+ const _el$ = _tmpl$20();
6069
6082
  const _ref$ = node;
6070
6083
  typeof _ref$ === "function" ? use(_ref$, _el$) : node = _el$;
6071
6084
  spread(_el$, mergeProps(() => props.attributes), false, false);
@@ -6091,11 +6104,17 @@ var createTypewriter = ({
6091
6104
  };
6092
6105
 
6093
6106
  // src/components/Canvas.tsx
6094
- var _tmpl$19 = /* @__PURE__ */ template(`<canvas>`);
6107
+ var _tmpl$21 = /* @__PURE__ */ template(`<canvas>`);
6095
6108
  var Canvas = (props) => {
6096
6109
  const [local, rest] = splitProps(props, ["resize", "render"]);
6097
6110
  const [canvas, setCanvas] = createSignal();
6098
- const ctx = createMemo(() => canvas()?.getContext("2d"));
6111
+ const ctx = createMemo(() => {
6112
+ const canvasElement = canvas();
6113
+ if (!canvasElement) {
6114
+ return null;
6115
+ }
6116
+ return canvasElement.getContext("2d");
6117
+ });
6099
6118
  createEffect(() => {
6100
6119
  const canvasElement = canvas();
6101
6120
  const canvasContext = ctx();
@@ -6130,14 +6149,61 @@ var Canvas = (props) => {
6130
6149
  removeEventListener("resize", onResize);
6131
6150
  });
6132
6151
  return (() => {
6133
- const _el$ = _tmpl$19();
6152
+ const _el$ = _tmpl$21();
6134
6153
  use(setCanvas, _el$);
6135
6154
  spread(_el$, rest, false, false);
6136
6155
  return _el$;
6137
6156
  })();
6138
6157
  };
6139
6158
 
6140
- // ../../node_modules/.pnpm/@solid-primitives+destructure@0.1.17_solid-js@1.8.17/node_modules/@solid-primitives/destructure/dist/index.js
6159
+ // src/components/Select.tsx
6160
+ var _tmpl$25 = /* @__PURE__ */ template(`<div class="select"><label class="select__label"><span class="select__label__icon"></span> </label><div class="select__select-container"><select>`);
6161
+ var Select = (props) => {
6162
+ const [local, rest] = splitProps(props, ["icon", "label"]);
6163
+ const id = createUniqueId();
6164
+ return (() => {
6165
+ const _el$ = _tmpl$25(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild;
6166
+ setAttribute(_el$2, "for", id);
6167
+ setAttribute(_el$3, "aria-hidden", true);
6168
+ insert(_el$2, () => local.label, null);
6169
+ spread(_el$6, mergeProps(rest, {
6170
+ "class": "select__select",
6171
+ "id": id
6172
+ }), false, true);
6173
+ insert(_el$6, () => props.children);
6174
+ insert(_el$5, createComponent(Icon, {
6175
+ "class": "select__icon",
6176
+ "aria-hidden": true,
6177
+ get children() {
6178
+ return createComponent(Icon.ChevronDown, {});
6179
+ }
6180
+ }), null);
6181
+ createRenderEffect(() => _el$3.innerHTML = local.icon);
6182
+ return _el$;
6183
+ })();
6184
+ };
6185
+
6186
+ // src/components/Range.tsx
6187
+ var _tmpl$26 = /* @__PURE__ */ template(`<div class="range"><label class="range__label"><span class="range__label__icon"></span> </label><input>`);
6188
+ var Range = (props) => {
6189
+ const [local, rest] = splitProps(props, ["icon", "label"]);
6190
+ const id = createUniqueId();
6191
+ return (() => {
6192
+ const _el$ = _tmpl$26(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling;
6193
+ setAttribute(_el$2, "for", id);
6194
+ setAttribute(_el$3, "aria-hidden", true);
6195
+ insert(_el$2, () => local.label, null);
6196
+ spread(_el$5, mergeProps(rest, {
6197
+ "class": "range__range",
6198
+ "type": "range",
6199
+ "id": id
6200
+ }), false, false);
6201
+ createRenderEffect(() => _el$3.innerHTML = local.icon);
6202
+ return _el$;
6203
+ })();
6204
+ };
6205
+
6206
+ // ../../node_modules/.pnpm/@solid-primitives+destructure@0.1.17_solid-js@1.8.18/node_modules/@solid-primitives/destructure/dist/index.js
6141
6207
  var isReactiveObject = (value) => typeof value === "object" && value !== null;
6142
6208
  function createProxyCache(obj, get) {
6143
6209
  return new Proxy(
@@ -6183,8 +6249,8 @@ function destructure(source, options) {
6183
6249
  }
6184
6250
 
6185
6251
  // src/screens/game.tsx
6186
- var _tmpl$20 = /* @__PURE__ */ template(`<div class="action-dialog-person">`);
6187
- 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">`);
6252
+ var _tmpl$27 = /* @__PURE__ */ template(`<div class="action-dialog-person">`);
6253
+ var _tmpl$28 = /* @__PURE__ */ template(`<div class="dialog-container"><span class="dialog-fix" aria-hidden="true">&#8203;</span><div class="dialog-panel"><span class="dialog-panel-label">`);
6188
6254
  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">`);
6189
6255
  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">`);
6190
6256
  var _tmpl$53 = /* @__PURE__ */ template(`<button type="button" class="button control-panel__button">`);
@@ -6343,7 +6409,7 @@ var Game = (props) => {
6343
6409
  return dialog().miniature.emotion;
6344
6410
  },
6345
6411
  get children() {
6346
- const _el$5 = _tmpl$20();
6412
+ const _el$5 = _tmpl$27();
6347
6413
  insert(_el$5, createComponent(Show, {
6348
6414
  get when() {
6349
6415
  return dialog().miniature.emotion;
@@ -6390,7 +6456,7 @@ var Game = (props) => {
6390
6456
  isOpen: () => choice().visible,
6391
6457
  trapFocus: () => !props.isPreview && !rendererState().exitPromptShown,
6392
6458
  get children() {
6393
- const _el$7 = _tmpl$25(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$10 = _el$9.firstChild;
6459
+ const _el$7 = _tmpl$28(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$10 = _el$9.firstChild;
6394
6460
  insert(_el$10, () => choice().label || " ");
6395
6461
  insert(_el$9, createComponent(For, {
6396
6462
  get each() {
@@ -6591,18 +6657,18 @@ var Game = (props) => {
6591
6657
  delegateEvents(["click", "keydown"]);
6592
6658
 
6593
6659
  // src/screens/loading.tsx
6594
- var _tmpl$21 = /* @__PURE__ */ template(`<div class="loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
6660
+ var _tmpl$29 = /* @__PURE__ */ template(`<div class="loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
6595
6661
  var Loading = (props) => {
6596
6662
  return (() => {
6597
- const _el$ = _tmpl$21();
6663
+ const _el$ = _tmpl$29();
6598
6664
  createRenderEffect(() => _el$.classList.toggle("overlay", !!props.overlay));
6599
6665
  return _el$;
6600
6666
  })();
6601
6667
  };
6602
6668
 
6603
6669
  // src/screens/mainmenu.tsx
6604
- var _tmpl$26 = /* @__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">`);
6605
- var _tmpl$27 = /* @__PURE__ */ template(`<button>`);
6670
+ var _tmpl$30 = /* @__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">`);
6671
+ var _tmpl$210 = /* @__PURE__ */ template(`<button>`);
6606
6672
  var MainMenu = () => {
6607
6673
  const {
6608
6674
  t,
@@ -6619,7 +6685,7 @@ var MainMenu = () => {
6619
6685
  $rendererState.mutate((s) => s.screen, screen);
6620
6686
  });
6621
6687
  return (() => {
6622
- const _el$ = _tmpl$26(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$7.nextSibling, _el$10 = _el$9.firstChild;
6688
+ const _el$ = _tmpl$30(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$7.nextSibling, _el$10 = _el$9.firstChild;
6623
6689
  _el$3.$$click = () => {
6624
6690
  options.newGame();
6625
6691
  };
@@ -6658,7 +6724,7 @@ var MainMenu = () => {
6658
6724
  return rendererStore().mainmenu;
6659
6725
  },
6660
6726
  children: (item) => (() => {
6661
- const _el$11 = _tmpl$27();
6727
+ const _el$11 = _tmpl$210();
6662
6728
  spread(_el$11, mergeProps(() => item(goto)), false, false);
6663
6729
  return _el$11;
6664
6730
  })()
@@ -6670,8 +6736,8 @@ var MainMenu = () => {
6670
6736
  delegateEvents(["click"]);
6671
6737
 
6672
6738
  // src/screens/saves.tsx
6673
- var _tmpl$28 = /* @__PURE__ */ template(`<ol class="saves__list">`);
6674
- var _tmpl$29 = /* @__PURE__ */ template(`<div class="saves"><div class="saves__controls"><button type="button" class="button saves__button"></button></div><div class="saves__list-container">`);
6739
+ var _tmpl$31 = /* @__PURE__ */ template(`<ol class="saves__list">`);
6740
+ var _tmpl$211 = /* @__PURE__ */ template(`<div class="saves"><div class="saves__controls"><button type="button" class="button saves__button"></button></div><div class="saves__list-container">`);
6675
6741
  var _tmpl$35 = /* @__PURE__ */ template(`<div class="saves__list saves__list--empty">`);
6676
6742
  var Saves = () => {
6677
6743
  const {
@@ -6743,7 +6809,7 @@ var Saves = () => {
6743
6809
  return !targets.every((item) => completed.includes(item));
6744
6810
  };
6745
6811
  return (() => {
6746
- const _el$ = _tmpl$29(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
6812
+ const _el$ = _tmpl$211(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
6747
6813
  _el$3.$$click = () => {
6748
6814
  $rendererState.setKey("screen", "mainmenu");
6749
6815
  };
@@ -6760,7 +6826,7 @@ var Saves = () => {
6760
6826
  })();
6761
6827
  },
6762
6828
  get children() {
6763
- const _el$5 = _tmpl$28();
6829
+ const _el$5 = _tmpl$31();
6764
6830
  use(setList, _el$5);
6765
6831
  insert(_el$5, createComponent(For, {
6766
6832
  get each() {
@@ -6791,8 +6857,8 @@ var Saves = () => {
6791
6857
  delegateEvents(["click"]);
6792
6858
 
6793
6859
  // src/screens/settings.tsx
6794
- var _tmpl$30 = /* @__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">`);
6795
- var _tmpl$210 = /* @__PURE__ */ template(`<option>`);
6860
+ var _tmpl$36 = /* @__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><div>`);
6861
+ var _tmpl$212 = /* @__PURE__ */ template(`<option>`);
6796
6862
  var Settings = (props) => {
6797
6863
  const {
6798
6864
  t,
@@ -6837,13 +6903,8 @@ var Settings = (props) => {
6837
6903
  };
6838
6904
  return fn;
6839
6905
  };
6840
- const languageSelectID = createUniqueId();
6841
- const speedSelectID = createUniqueId();
6842
- const musicVolumeSelectID = createUniqueId();
6843
- const soundVolumeSelectID = createUniqueId();
6844
- const voiceVolumeSelectID = createUniqueId();
6845
6906
  return (() => {
6846
- const _el$ = _tmpl$30(), _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;
6907
+ const _el$ = _tmpl$36(), _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.nextSibling;
6847
6908
  _el$3.$$click = () => {
6848
6909
  $rendererState.setKey("screen", "mainmenu");
6849
6910
  };
@@ -6852,78 +6913,109 @@ var Settings = (props) => {
6852
6913
  options.restore();
6853
6914
  };
6854
6915
  insert(_el$4, () => t("ToTheGame"));
6855
- setAttribute(_el$8, "for", languageSelectID);
6856
- setAttribute(_el$9, "aria-hidden", true);
6857
- insert(_el$8, () => t("Language"), null);
6858
- _el$11.addEventListener("change", onLanguageSelect);
6859
- setAttribute(_el$11, "id", languageSelectID);
6860
- insert(_el$11, createComponent(For, {
6861
- get each() {
6862
- return options.languages;
6916
+ insert(_el$6, createComponent(Select, {
6917
+ get icon() {
6918
+ return props.icons.language;
6863
6919
  },
6864
- children: (lang) => (() => {
6865
- const _el$33 = _tmpl$210();
6866
- _el$33.value = lang;
6867
- insert(_el$33, () => options.getLanguageDisplayName(lang));
6868
- createRenderEffect(() => _el$33.selected = lang === language());
6869
- return _el$33;
6870
- })()
6871
- }));
6872
- setAttribute(_el$13, "for", speedSelectID);
6873
- setAttribute(_el$14, "aria-hidden", true);
6874
- insert(_el$13, () => t("TextSpeed"), null);
6875
- _el$16.addEventListener("change", onSpeedSelect);
6876
- setAttribute(_el$16, "id", speedSelectID);
6877
- insert(_el$16, createComponent(For, {
6878
- each: ["Slow", "Medium", "Fast", "Auto"],
6879
- children: (speed) => (() => {
6880
- const _el$34 = _tmpl$210();
6881
- _el$34.value = speed;
6882
- insert(_el$34, () => t("TextSpeed" + speed));
6883
- createRenderEffect(() => _el$34.selected = speed === textSpeed());
6884
- return _el$34;
6885
- })()
6886
- }));
6887
- setAttribute(_el$19, "for", musicVolumeSelectID);
6888
- setAttribute(_el$20, "aria-hidden", true);
6889
- insert(_el$19, () => t("MusicVolume"), null);
6890
- addEventListener2(_el$22, "change", volumeChange(2));
6891
- setAttribute(_el$22, "id", musicVolumeSelectID);
6892
- setAttribute(_el$24, "for", soundVolumeSelectID);
6893
- setAttribute(_el$25, "aria-hidden", true);
6894
- insert(_el$24, () => t("SoundVolume"), null);
6895
- addEventListener2(_el$27, "change", volumeChange(3));
6896
- setAttribute(_el$27, "id", soundVolumeSelectID);
6897
- setAttribute(_el$29, "for", voiceVolumeSelectID);
6898
- setAttribute(_el$30, "aria-hidden", true);
6899
- insert(_el$29, () => t("VoiceVolume"), null);
6900
- addEventListener2(_el$32, "change", volumeChange(4));
6901
- setAttribute(_el$32, "id", voiceVolumeSelectID);
6902
- createRenderEffect((_p$) => {
6903
- const _v$ = props.icons.language, _v$2 = props.icons.typewriter_speed, _v$3 = props.icons.music_volume, _v$4 = props.icons.sound_volume, _v$5 = props.icons.voice_volume;
6904
- _v$ !== _p$._v$ && (_el$9.innerHTML = _p$._v$ = _v$);
6905
- _v$2 !== _p$._v$2 && (_el$14.innerHTML = _p$._v$2 = _v$2);
6906
- _v$3 !== _p$._v$3 && (_el$20.innerHTML = _p$._v$3 = _v$3);
6907
- _v$4 !== _p$._v$4 && (_el$25.innerHTML = _p$._v$4 = _v$4);
6908
- _v$5 !== _p$._v$5 && (_el$30.innerHTML = _p$._v$5 = _v$5);
6909
- return _p$;
6910
- }, {
6911
- _v$: void 0,
6912
- _v$2: void 0,
6913
- _v$3: void 0,
6914
- _v$4: void 0,
6915
- _v$5: void 0
6916
- });
6917
- createRenderEffect(() => _el$22.value = volume(2));
6918
- createRenderEffect(() => _el$27.value = volume(3));
6919
- createRenderEffect(() => _el$32.value = volume(4));
6920
+ get label() {
6921
+ return t("Language");
6922
+ },
6923
+ onChange: onLanguageSelect,
6924
+ get children() {
6925
+ return createComponent(For, {
6926
+ get each() {
6927
+ return options.languages;
6928
+ },
6929
+ children: (lang) => (() => {
6930
+ const _el$8 = _tmpl$212();
6931
+ _el$8.value = lang;
6932
+ insert(_el$8, () => options.getLanguageDisplayName(lang));
6933
+ createRenderEffect(() => _el$8.selected = lang === language());
6934
+ return _el$8;
6935
+ })()
6936
+ });
6937
+ }
6938
+ }), null);
6939
+ insert(_el$6, createComponent(Select, {
6940
+ get icon() {
6941
+ return props.icons.typewriter_speed;
6942
+ },
6943
+ get label() {
6944
+ return t("TextSpeed");
6945
+ },
6946
+ onChange: onSpeedSelect,
6947
+ get children() {
6948
+ return createComponent(For, {
6949
+ each: ["Slow", "Medium", "Fast", "Auto"],
6950
+ children: (speed) => (() => {
6951
+ const _el$9 = _tmpl$212();
6952
+ _el$9.value = speed;
6953
+ insert(_el$9, () => t("TextSpeed" + speed));
6954
+ createRenderEffect(() => _el$9.selected = speed === textSpeed());
6955
+ return _el$9;
6956
+ })()
6957
+ });
6958
+ }
6959
+ }), null);
6960
+ insert(_el$7, createComponent(Range, {
6961
+ get icon() {
6962
+ return props.icons.music_volume;
6963
+ },
6964
+ get label() {
6965
+ return t("MusicVolume");
6966
+ },
6967
+ min: 0,
6968
+ max: 1,
6969
+ step: 0.01,
6970
+ get value() {
6971
+ return volume(2);
6972
+ },
6973
+ get onChange() {
6974
+ return volumeChange(2);
6975
+ }
6976
+ }), null);
6977
+ insert(_el$7, createComponent(Range, {
6978
+ get icon() {
6979
+ return props.icons.sound_volume;
6980
+ },
6981
+ get label() {
6982
+ return t("SoundVolume");
6983
+ },
6984
+ min: 0,
6985
+ max: 1,
6986
+ step: 0.01,
6987
+ get value() {
6988
+ return volume(3);
6989
+ },
6990
+ get onChange() {
6991
+ return volumeChange(3);
6992
+ }
6993
+ }), null);
6994
+ insert(_el$7, createComponent(Range, {
6995
+ get icon() {
6996
+ return props.icons.voice_volume;
6997
+ },
6998
+ get label() {
6999
+ return t("VoiceVolume");
7000
+ },
7001
+ min: 0,
7002
+ max: 1,
7003
+ step: 0.01,
7004
+ get value() {
7005
+ return volume(4);
7006
+ },
7007
+ get onChange() {
7008
+ return volumeChange(4);
7009
+ }
7010
+ }), null);
7011
+ createRenderEffect(() => _el$7.classList.toggle("settings--hidden", !props.showAudioSettings));
6920
7012
  return _el$;
6921
7013
  })();
6922
7014
  };
6923
7015
  delegateEvents(["click"]);
6924
7016
 
6925
7017
  // src/components/Root.tsx
6926
- var _tmpl$31 = /* @__PURE__ */ template(`<div class="root">`);
7018
+ var _tmpl$37 = /* @__PURE__ */ template(`<div class="root">`);
6927
7019
  var createRootComponent = ({
6928
7020
  $rendererState,
6929
7021
  $contextState,
@@ -6931,6 +7023,7 @@ var createRootComponent = ({
6931
7023
  setRoot,
6932
7024
  characters,
6933
7025
  renderer,
7026
+ showAudioSettings,
6934
7027
  fullscreen,
6935
7028
  emitter,
6936
7029
  controls,
@@ -6958,7 +7051,7 @@ var createRootComponent = ({
6958
7051
  emitter.emit("screen:change", currentScreen);
6959
7052
  });
6960
7053
  return (() => {
6961
- const _el$ = _tmpl$31();
7054
+ const _el$ = _tmpl$37();
6962
7055
  const _ref$ = setRoot;
6963
7056
  typeof _ref$ === "function" ? use(_ref$, _el$) : setRoot = _el$;
6964
7057
  insert(_el$, createComponent(Provider, {
@@ -7017,7 +7110,8 @@ var createRootComponent = ({
7017
7110
  },
7018
7111
  get children() {
7019
7112
  return createComponent(Settings, {
7020
- icons: settingsIcons2
7113
+ icons: settingsIcons2,
7114
+ showAudioSettings
7021
7115
  });
7022
7116
  }
7023
7117
  })];
@@ -7157,7 +7251,7 @@ var hideImage = (source, params = {}) => {
7157
7251
  };
7158
7252
 
7159
7253
  // src/renderer.tsx
7160
- var _tmpl$36 = /* @__PURE__ */ template(`<canvas>`);
7254
+ var _tmpl$38 = /* @__PURE__ */ template(`<canvas>`);
7161
7255
  var {
7162
7256
  preloadAudioBlocking
7163
7257
  } = createAudioMisc();
@@ -7166,7 +7260,8 @@ var createSolidRenderer = ({
7166
7260
  controls = "outside",
7167
7261
  skipTypewriterWhenGoingBack = true,
7168
7262
  target = document.body,
7169
- settingsIcons: settingsIcons2 = settingsIcons
7263
+ settingsIcons: settingsIcons2 = settingsIcons,
7264
+ showAudioSettings = true
7170
7265
  } = {}) => {
7171
7266
  const emitter = createEmitter();
7172
7267
  const $rendererState = createRendererState({
@@ -7208,7 +7303,7 @@ var createSolidRenderer = ({
7208
7303
  return chars[character];
7209
7304
  }
7210
7305
  const canvas = (() => {
7211
- const _el$ = _tmpl$36();
7306
+ const _el$ = _tmpl$38();
7212
7307
  setAttribute(_el$, "data-character", character);
7213
7308
  return _el$;
7214
7309
  })();
@@ -7396,6 +7491,7 @@ var createSolidRenderer = ({
7396
7491
  controls,
7397
7492
  skipTypewriterWhenGoingBack,
7398
7493
  settingsIcons: settingsIcons2,
7494
+ showAudioSettings,
7399
7495
  rendererContext: renderer.getContext(options.mainContextKey),
7400
7496
  coreOptions: options,
7401
7497
  $rendererState,
@@ -1,7 +1,7 @@
1
1
  import type { RendererInit, Context, Character } from '@novely/core';
2
2
  import type { StateScreen, StateScreens, StateMainmenuItem, SolidRendererStore, CreateSolidRendererOptions, EmitterEventsMap } from './types';
3
3
  import { Howl } from '@novely/renderer-toolkit';
4
- declare const createSolidRenderer: ({ fullscreen, controls, skipTypewriterWhenGoingBack, target, settingsIcons }?: CreateSolidRendererOptions) => {
4
+ declare const createSolidRenderer: ({ fullscreen, controls, skipTypewriterWhenGoingBack, target, settingsIcons, showAudioSettings }?: CreateSolidRendererOptions) => {
5
5
  emitter: import("./emitter").Emitter<EmitterEventsMap>;
6
6
  renderer<$Language extends string, $Characters extends Record<string, Character<$Language>>>(options: RendererInit<$Language, $Characters>): {
7
7
  getContext: (key: string) => Context;
@@ -2,6 +2,7 @@ import type { VoidComponent } from 'solid-js';
2
2
  import type { SettingsIcons } from '../types';
3
3
  interface SettingsProps {
4
4
  icons: SettingsIcons;
5
+ showAudioSettings: boolean;
5
6
  }
6
7
  declare const Settings: VoidComponent<SettingsProps>;
7
8
  export { Settings };
@@ -43,6 +43,7 @@
43
43
  color: var(--novely-button-color, #000);
44
44
  box-shadow: 0 0 0 var(--button-box-shadow-spread-radius, .25rem) var(--novely-button-border-color, #ffc7df);
45
45
  margin: .4rem var(--button-box-shadow-spread-radius, .25rem);
46
+ outline-offset: var(--select-box-shadow-spread-radius, .25rem);
46
47
  cursor: pointer;
47
48
  -webkit-tap-highlight-color: #0000;
48
49
  -webkit-tap-highlight-color: transparent;
@@ -267,6 +268,7 @@
267
268
  background-color: var(--novely-select-background-color, #ffe9f3);
268
269
  color: var(--novely-select-color, #000);
269
270
  box-shadow: 0 0 0 var(--select-box-shadow-spread-radius, .25rem) var(--novely-select-border-color, #ffc7df);
271
+ outline-offset: var(--select-box-shadow-spread-radius, .25rem);
270
272
  margin: calc(var(--select-box-shadow-spread-radius, .25rem) + .4rem) var(--select-box-shadow-spread-radius, .25rem);
271
273
  border: none;
272
274
  border-radius: .25rem;
@@ -274,6 +276,13 @@
274
276
  padding: .4rem;
275
277
  font-size: 1rem;
276
278
  }
279
+ @supports ((-webkit-appearance: none)) {
280
+ .select__select {
281
+ -webkit-appearance: none;
282
+ appearance: none;
283
+ padding-right: 2rem;
284
+ }
285
+ }
277
286
  @media (max-aspect-ratio: .8) {
278
287
  .select__select {
279
288
  min-width: calc(70% - var(--select-box-shadow-spread-radius, .25rem) * 2);
@@ -285,6 +294,11 @@
285
294
  }
286
295
  }
287
296
 
297
+ /* src/styles/select/select/container.css */
298
+ .select__select-container {
299
+ position: relative;
300
+ }
301
+
288
302
  /* src/styles/select/label/label.css */
289
303
  .select__label {
290
304
  background: var(--novely-select-label-background, #ffe9f3);
@@ -312,6 +326,16 @@
312
326
  }
313
327
  }
314
328
 
329
+ /* src/styles/select/icon/icon.css */
330
+ .select__icon {
331
+ pointer-events: none;
332
+ width: 1.5rem;
333
+ height: 1.5rem;
334
+ position: absolute;
335
+ top: .9rem;
336
+ right: .5rem;
337
+ }
338
+
315
339
  /* src/styles/select/index.css */
316
340
 
317
341
  /* src/styles/range/range.css */
@@ -866,6 +890,9 @@ input[name=novely-input][type=password] {
866
890
  flex-direction: column-reverse;
867
891
  }
868
892
  }
893
+ .settings--hidden {
894
+ display: none;
895
+ }
869
896
 
870
897
  /* src/styles/settings/button/button.css */
871
898
  .settings__button {
package/dist/types.d.ts CHANGED
@@ -41,6 +41,11 @@ type CreateSolidRendererOptions = {
41
41
  */
42
42
  target?: MountableElement;
43
43
  settingsIcons?: SettingsIcons;
44
+ /**
45
+ * Show audio settings in settings menu?
46
+ * @default true
47
+ */
48
+ showAudioSettings?: boolean;
44
49
  };
45
50
  type EmitterEventsMap = {
46
51
  'screen:change': PossibleScreen;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.35.2",
3
+ "version": "0.35.4",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -19,7 +19,7 @@
19
19
  "retrieved": "^0.1.0",
20
20
  "solid-js": "1.8.18",
21
21
  "solid-transition-group": "^0.2.3",
22
- "@novely/core": "0.38.0",
22
+ "@novely/core": "0.38.1",
23
23
  "@novely/renderer-toolkit": "0.7.1",
24
24
  "@novely/typewriter": "0.5.1"
25
25
  },