@novely/solid-renderer 0.52.0 → 0.53.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.
Files changed (2) hide show
  1. package/dist/index.jsx +298 -297
  2. package/package.json +7 -7
package/dist/index.jsx CHANGED
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/dist/solid.js
1
+ // ../../node_modules/.pnpm/solid-js@1.9.11/node_modules/solid-js/dist/solid.js
2
2
  var sharedConfig = {
3
3
  context: void 0,
4
4
  registry: void 0,
@@ -27,10 +27,9 @@ function nextHydrateContext() {
27
27
  }
28
28
  var IS_DEV = false;
29
29
  var equalFn = (a, b) => a === b;
30
- var $PROXY = Symbol("solid-proxy");
30
+ var $PROXY = /* @__PURE__ */ Symbol("solid-proxy");
31
31
  var SUPPORTS_PROXY = typeof Proxy === "function";
32
- var $TRACK = Symbol("solid-track");
33
- var $DEVCOMP = Symbol("solid-dev-component");
32
+ var $TRACK = /* @__PURE__ */ Symbol("solid-track");
34
33
  var signalOptions = {
35
34
  equals: equalFn
36
35
  };
@@ -187,7 +186,7 @@ function useTransition() {
187
186
  return [transPending, startTransition];
188
187
  }
189
188
  function createContext(defaultValue, options) {
190
- const id = Symbol("context");
189
+ const id = /* @__PURE__ */ Symbol("context");
191
190
  return {
192
191
  id,
193
192
  Provider: createProvider(id),
@@ -618,7 +617,7 @@ function createProvider(id, options) {
618
617
  return res;
619
618
  };
620
619
  }
621
- var FALLBACK = Symbol("fallback");
620
+ var FALLBACK = /* @__PURE__ */ Symbol("fallback");
622
621
  function dispose(d) {
623
622
  for (let i = 0; i < d.length; i++) d[i]();
624
623
  }
@@ -878,8 +877,9 @@ function mergeProps(...sources) {
878
877
  return target;
879
878
  }
880
879
  function splitProps(props, ...keys) {
880
+ const len = keys.length;
881
881
  if (SUPPORTS_PROXY && $PROXY in props) {
882
- const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
882
+ const blocked = len > 1 ? keys.flat() : keys[0];
883
883
  const res = keys.map((k) => {
884
884
  return new Proxy({
885
885
  get(property) {
@@ -895,36 +895,34 @@ function splitProps(props, ...keys) {
895
895
  });
896
896
  res.push(new Proxy({
897
897
  get(property) {
898
- return blocked.has(property) ? void 0 : props[property];
898
+ return blocked.includes(property) ? void 0 : props[property];
899
899
  },
900
900
  has(property) {
901
- return blocked.has(property) ? false : property in props;
901
+ return blocked.includes(property) ? false : property in props;
902
902
  },
903
903
  keys() {
904
- return Object.keys(props).filter((k) => !blocked.has(k));
904
+ return Object.keys(props).filter((k) => !blocked.includes(k));
905
905
  }
906
906
  }, propTraps));
907
907
  return res;
908
908
  }
909
- const otherObject = {};
910
- const objects = keys.map(() => ({}));
909
+ const objects = [];
910
+ for (let i = 0; i <= len; i++) {
911
+ objects[i] = {};
912
+ }
911
913
  for (const propName of Object.getOwnPropertyNames(props)) {
912
- const desc = Object.getOwnPropertyDescriptor(props, propName);
913
- const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
914
- let blocked = false;
915
- let objectIndex = 0;
916
- for (const k of keys) {
917
- if (k.includes(propName)) {
918
- blocked = true;
919
- isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
914
+ let keyIndex = len;
915
+ for (let i = 0; i < keys.length; i++) {
916
+ if (keys[i].includes(propName)) {
917
+ keyIndex = i;
918
+ break;
920
919
  }
921
- ++objectIndex;
922
- }
923
- if (!blocked) {
924
- isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
925
920
  }
921
+ const desc = Object.getOwnPropertyDescriptor(props, propName);
922
+ const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
923
+ isDefaultDesc ? objects[keyIndex][propName] = desc.value : Object.defineProperty(objects[keyIndex], propName, desc);
926
924
  }
927
- return [...objects, otherObject];
925
+ return objects;
928
926
  }
929
927
  var counter = 0;
930
928
  function createUniqueId() {
@@ -997,9 +995,75 @@ function Match(props) {
997
995
  return props;
998
996
  }
999
997
 
1000
- // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/web/dist/web.js
1001
- var booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
1002
- var Properties = /* @__PURE__ */ new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
998
+ // ../../node_modules/.pnpm/solid-js@1.9.11/node_modules/solid-js/web/dist/web.js
999
+ var booleans = [
1000
+ "allowfullscreen",
1001
+ "async",
1002
+ "alpha",
1003
+ "autofocus",
1004
+ "autoplay",
1005
+ "checked",
1006
+ "controls",
1007
+ "default",
1008
+ "disabled",
1009
+ "formnovalidate",
1010
+ "hidden",
1011
+ "indeterminate",
1012
+ "inert",
1013
+ "ismap",
1014
+ "loop",
1015
+ "multiple",
1016
+ "muted",
1017
+ "nomodule",
1018
+ "novalidate",
1019
+ "open",
1020
+ "playsinline",
1021
+ "readonly",
1022
+ "required",
1023
+ "reversed",
1024
+ "seamless",
1025
+ "selected",
1026
+ "adauctionheaders",
1027
+ "browsingtopics",
1028
+ "credentialless",
1029
+ "defaultchecked",
1030
+ "defaultmuted",
1031
+ "defaultselected",
1032
+ "defer",
1033
+ "disablepictureinpicture",
1034
+ "disableremoteplayback",
1035
+ "preservespitch",
1036
+ "shadowrootclonable",
1037
+ "shadowrootcustomelementregistry",
1038
+ "shadowrootdelegatesfocus",
1039
+ "shadowrootserializable",
1040
+ "sharedstoragewritable"
1041
+ ];
1042
+ var Properties = /* @__PURE__ */ new Set([
1043
+ "className",
1044
+ "value",
1045
+ "readOnly",
1046
+ "noValidate",
1047
+ "formNoValidate",
1048
+ "isMap",
1049
+ "noModule",
1050
+ "playsInline",
1051
+ "adAuctionHeaders",
1052
+ "allowFullscreen",
1053
+ "browsingTopics",
1054
+ "defaultChecked",
1055
+ "defaultMuted",
1056
+ "defaultSelected",
1057
+ "disablePictureInPicture",
1058
+ "disableRemotePlayback",
1059
+ "preservesPitch",
1060
+ "shadowRootClonable",
1061
+ "shadowRootCustomElementRegistry",
1062
+ "shadowRootDelegatesFocus",
1063
+ "shadowRootSerializable",
1064
+ "sharedStorageWritable",
1065
+ ...booleans
1066
+ ]);
1003
1067
  var ChildProperties = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]);
1004
1068
  var Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
1005
1069
  className: "class",
@@ -1032,6 +1096,62 @@ var PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(nu
1032
1096
  $: "readOnly",
1033
1097
  INPUT: 1,
1034
1098
  TEXTAREA: 1
1099
+ },
1100
+ adauctionheaders: {
1101
+ $: "adAuctionHeaders",
1102
+ IFRAME: 1
1103
+ },
1104
+ allowfullscreen: {
1105
+ $: "allowFullscreen",
1106
+ IFRAME: 1
1107
+ },
1108
+ browsingtopics: {
1109
+ $: "browsingTopics",
1110
+ IMG: 1
1111
+ },
1112
+ defaultchecked: {
1113
+ $: "defaultChecked",
1114
+ INPUT: 1
1115
+ },
1116
+ defaultmuted: {
1117
+ $: "defaultMuted",
1118
+ AUDIO: 1,
1119
+ VIDEO: 1
1120
+ },
1121
+ defaultselected: {
1122
+ $: "defaultSelected",
1123
+ OPTION: 1
1124
+ },
1125
+ disablepictureinpicture: {
1126
+ $: "disablePictureInPicture",
1127
+ VIDEO: 1
1128
+ },
1129
+ disableremoteplayback: {
1130
+ $: "disableRemotePlayback",
1131
+ AUDIO: 1,
1132
+ VIDEO: 1
1133
+ },
1134
+ preservespitch: {
1135
+ $: "preservesPitch",
1136
+ AUDIO: 1,
1137
+ VIDEO: 1
1138
+ },
1139
+ shadowrootclonable: {
1140
+ $: "shadowRootClonable",
1141
+ TEMPLATE: 1
1142
+ },
1143
+ shadowrootdelegatesfocus: {
1144
+ $: "shadowRootDelegatesFocus",
1145
+ TEMPLATE: 1
1146
+ },
1147
+ shadowrootserializable: {
1148
+ $: "shadowRootSerializable",
1149
+ TEMPLATE: 1
1150
+ },
1151
+ sharedstoragewritable: {
1152
+ $: "sharedStorageWritable",
1153
+ IFRAME: 1,
1154
+ IMG: 1
1035
1155
  }
1036
1156
  });
1037
1157
  function getPropAlias(prop, tagName) {
@@ -1459,11 +1579,12 @@ function cleanChildren(parent, current, marker, replacement) {
1459
1579
  } else parent.insertBefore(node, marker);
1460
1580
  return [node];
1461
1581
  }
1462
- var RequestContext = Symbol();
1463
1582
  var isServer = false;
1464
1583
  var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
1465
- function createElement(tagName, isSVG = false) {
1466
- return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);
1584
+ function createElement(tagName, isSVG = false, is = void 0) {
1585
+ return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, {
1586
+ is
1587
+ });
1467
1588
  }
1468
1589
  function Portal(props) {
1469
1590
  const {
@@ -1607,7 +1728,7 @@ var once = (fn) => {
1607
1728
  };
1608
1729
  };
1609
1730
  var createRetrieved = (fn) => {
1610
- const key = Symbol();
1731
+ const key = /* @__PURE__ */ Symbol();
1611
1732
  let value = key;
1612
1733
  return () => {
1613
1734
  if (value === key) {
@@ -1636,7 +1757,7 @@ function cleanTasks() {
1636
1757
  }
1637
1758
 
1638
1759
  // ../../node_modules/.pnpm/nanostores@0.11.4/node_modules/nanostores/clean-stores/index.js
1639
- var clean = Symbol("clean");
1760
+ var clean = /* @__PURE__ */ Symbol("clean");
1640
1761
  var cleanStores = (...stores) => {
1641
1762
  if (false) {
1642
1763
  throw new Error(
@@ -2012,7 +2133,7 @@ function validateConcurrency(concurrency) {
2012
2133
  }
2013
2134
  }
2014
2135
 
2015
- // ../../node_modules/.pnpm/simple-web-audio@0.9.0_postcss@8.5.6/node_modules/simple-web-audio/dist/index.mjs
2136
+ // ../../node_modules/.pnpm/simple-web-audio@0.10.0/node_modules/simple-web-audio/dist/index.mjs
2016
2137
  var waitForInteraction = (() => {
2017
2138
  const { promise, resolve } = Promise.withResolvers();
2018
2139
  const onUserInteraction = () => {
@@ -2062,9 +2183,7 @@ var createMemo2 = () => {
2062
2183
  return (key, fn) => {
2063
2184
  return () => {
2064
2185
  const preserved = cache.get(key);
2065
- if (preserved) {
2066
- return preserved;
2067
- }
2186
+ if (preserved) return preserved;
2068
2187
  const promise = fn();
2069
2188
  cache.set(key, promise);
2070
2189
  return promise;
@@ -2073,9 +2192,7 @@ var createMemo2 = () => {
2073
2192
  };
2074
2193
  var fetcherMemo = createMemo2();
2075
2194
  var decoderMemo = createMemo2();
2076
- var onEndedOptions = {
2077
- once: true
2078
- };
2195
+ var onEndedOptions = { once: true };
2079
2196
  var createAudio = (options) => {
2080
2197
  let audioContext;
2081
2198
  let gainNode;
@@ -2092,11 +2209,10 @@ var createAudio = (options) => {
2092
2209
  };
2093
2210
  const createGainNode = () => {
2094
2211
  gainNode = audioContext.createGain();
2095
- const node = (options.extendAudioGraph || getGainNode)({
2212
+ (options.extendAudioGraph || getGainNode)({
2096
2213
  context: audioContext,
2097
2214
  node: gainNode
2098
- });
2099
- node.connect(audioContext.destination);
2215
+ }).connect(audioContext.destination);
2100
2216
  };
2101
2217
  const createBufferSource = () => {
2102
2218
  bufferSource = audioContext.createBufferSource();
@@ -2160,9 +2276,7 @@ var createAudio = (options) => {
2160
2276
  if (state.destroyed) return;
2161
2277
  if (audioContext.state === "suspended") {
2162
2278
  await audioContext.resume();
2163
- if (state.started) {
2164
- state.playing = true;
2165
- }
2279
+ if (state.started) state.playing = true;
2166
2280
  }
2167
2281
  if (!state.started) {
2168
2282
  bufferSource.start();
@@ -2172,9 +2286,7 @@ var createAudio = (options) => {
2172
2286
  };
2173
2287
  const pauseAudio = async () => {
2174
2288
  if (state.destroyed) return;
2175
- if (audioContext.state === "suspended" && queue.queue.at(-1) === playAudio) {
2176
- queue.queue.pop();
2177
- }
2289
+ if (audioContext.state === "suspended" && queue.queue.at(-1) === playAudio) queue.queue.pop();
2178
2290
  if (audioContext.state === "running") {
2179
2291
  await audioContext.suspend();
2180
2292
  state.playing = false;
@@ -2197,37 +2309,19 @@ var createAudio = (options) => {
2197
2309
  },
2198
2310
  async reset() {
2199
2311
  if (state.destroyed) return;
2200
- if (state.playing) {
2201
- queue.queue.push(pauseAudio);
2202
- }
2203
- queue.queue.push(
2204
- disconnectAudio,
2205
- createBufferSource,
2206
- setLoop,
2207
- connectSources
2208
- );
2209
- if (state.playing) {
2210
- queue.queue.push(playAudio);
2211
- }
2312
+ if (state.playing) queue.queue.push(pauseAudio);
2313
+ queue.queue.push(disconnectAudio, createBufferSource, setLoop, connectSources);
2314
+ if (state.playing) queue.queue.push(playAudio);
2212
2315
  return queue.execute();
2213
2316
  },
2214
2317
  async stop() {
2215
2318
  if (state.destroyed) return;
2216
- queue.queue.push(
2217
- pauseAudio,
2218
- disconnectAudio,
2219
- createBufferSource,
2220
- setLoop,
2221
- connectSources
2222
- );
2319
+ queue.queue.push(pauseAudio, disconnectAudio, createBufferSource, setLoop, connectSources);
2223
2320
  return queue.execute();
2224
2321
  },
2225
2322
  async destroy() {
2226
2323
  if (state.destroyed) return;
2227
- queue.queue = [
2228
- pauseAudio,
2229
- disconnectAudio
2230
- ];
2324
+ queue.queue = [pauseAudio, disconnectAudio];
2231
2325
  await queue.execute();
2232
2326
  state.destroyed = true;
2233
2327
  audioContext = null;
@@ -2276,37 +2370,27 @@ var createAudio = (options) => {
2276
2370
  return instance;
2277
2371
  };
2278
2372
  var prefetchAudio = (src) => {
2279
- const fetcher = fetcherMemo(src, () => fetch(src).then((res) => res.arrayBuffer()));
2280
- return fetcher();
2373
+ return fetcherMemo(src, () => fetch(src).then((res) => res.arrayBuffer()))();
2281
2374
  };
2282
2375
 
2283
- // ../renderer-toolkit/dist/index.js
2376
+ // ../renderer-toolkit/dist/index.mjs
2284
2377
  var usePath = (atomValue, getPath2) => {
2285
2378
  const targets = /* @__PURE__ */ new Set();
2286
2379
  const path = [];
2287
2380
  let current;
2288
- const proxyHandler = {
2289
- get(target, prop, receiver) {
2290
- if (targets.has(target)) {
2291
- throw new ReferenceError(`Attempted to access property on the same target multiple times.`);
2292
- }
2293
- const value = Reflect.get(target, prop, receiver);
2294
- targets.add(target);
2295
- path.push(prop);
2296
- current = value;
2297
- if (value === void 0) {
2298
- return new Proxy({}, proxyHandler);
2299
- }
2300
- if (value && typeof value === "object") {
2301
- return new Proxy(value, proxyHandler);
2302
- }
2303
- return value;
2304
- }
2305
- };
2381
+ const proxyHandler = { get(target, prop, receiver) {
2382
+ if (targets.has(target))
2383
+ throw new ReferenceError(`Attempted to access property on the same target multiple times.`);
2384
+ const value = Reflect.get(target, prop, receiver);
2385
+ targets.add(target);
2386
+ path.push(prop);
2387
+ current = value;
2388
+ if (value === void 0) return new Proxy({}, proxyHandler);
2389
+ if (value && typeof value === "object") return new Proxy(value, proxyHandler);
2390
+ return value;
2391
+ } };
2306
2392
  getPath2(new Proxy(atomValue, proxyHandler));
2307
- if (path.length === 0) {
2308
- throw new Error("No valid path extracted from the provided getPath function.");
2309
- }
2393
+ if (path.length === 0) throw new Error("No valid path extracted from the provided getPath function.");
2310
2394
  return {
2311
2395
  path,
2312
2396
  value: current
@@ -2317,9 +2401,7 @@ var deepAtom = (init) => {
2317
2401
  $atom.mutate = (getPath2, setter) => {
2318
2402
  const { path, value } = usePath($atom.get(), getPath2);
2319
2403
  const newValue = typeof setter === "function" ? setter(value) : setter;
2320
- if (newValue === value) {
2321
- return newValue;
2322
- }
2404
+ if (newValue === value) return newValue;
2323
2405
  const oldValue = $atom.value;
2324
2406
  $atom.value = setByKey($atom.value, path, newValue);
2325
2407
  $atom.notify(oldValue, path.join("."));
@@ -2329,9 +2411,7 @@ var deepAtom = (init) => {
2329
2411
  };
2330
2412
  var getDefaultContextState = () => {
2331
2413
  return {
2332
- background: {
2333
- background: "#0000"
2334
- },
2414
+ background: { background: "#0000" },
2335
2415
  characters: {},
2336
2416
  choice: {
2337
2417
  label: "",
@@ -2350,9 +2430,7 @@ var getDefaultContextState = () => {
2350
2430
  error: "",
2351
2431
  visible: false
2352
2432
  },
2353
- text: {
2354
- content: ""
2355
- },
2433
+ text: { content: "" },
2356
2434
  custom: {},
2357
2435
  meta: {
2358
2436
  restoring: false,
@@ -2365,24 +2443,19 @@ var getDefaultContextState = () => {
2365
2443
  var createContextStateRoot = (getExtension = () => ({})) => {
2366
2444
  const CACHE = /* @__PURE__ */ new Map();
2367
2445
  const make = () => {
2368
- const contextState = deepAtom({
2446
+ return deepAtom({
2369
2447
  ...getDefaultContextState(),
2370
2448
  ...getExtension()
2371
2449
  });
2372
- return contextState;
2373
2450
  };
2374
2451
  const remove = (id) => {
2375
2452
  const contextState = CACHE.get(id);
2376
- if (contextState) {
2377
- cleanStores(contextState);
2378
- }
2453
+ if (contextState) cleanStores(contextState);
2379
2454
  CACHE.delete(id);
2380
2455
  };
2381
2456
  const use2 = (id) => {
2382
2457
  const cached = CACHE.get(id);
2383
- if (cached) {
2384
- return cached;
2385
- }
2458
+ if (cached) return cached;
2386
2459
  const contextState = make();
2387
2460
  CACHE.set(id, contextState);
2388
2461
  onMount2(contextState, () => {
@@ -2399,13 +2472,12 @@ var createContextStateRoot = (getExtension = () => ({})) => {
2399
2472
  };
2400
2473
  var defaultEmpty = {};
2401
2474
  var createRendererState = (extension = defaultEmpty) => {
2402
- const rendererState = deepAtom({
2475
+ return deepAtom({
2403
2476
  screen: "mainmenu",
2404
2477
  loadingShown: false,
2405
2478
  exitPromptShown: false,
2406
2479
  ...extension
2407
2480
  });
2408
- return rendererState;
2409
2481
  };
2410
2482
  var noop = () => {
2411
2483
  };
@@ -2424,12 +2496,10 @@ var createStartFunction = (fn) => {
2424
2496
  return () => {
2425
2497
  unmount();
2426
2498
  unmount = fn();
2427
- return {
2428
- unmount: () => {
2429
- unmount();
2430
- unmount = noop;
2431
- }
2432
- };
2499
+ return { unmount: () => {
2500
+ unmount();
2501
+ unmount = noop;
2502
+ } };
2433
2503
  };
2434
2504
  };
2435
2505
  var TYPE_META_MAP = {
@@ -2465,11 +2535,8 @@ var createAudio2 = (storageData) => {
2465
2535
  const resource = getAudio(method, src);
2466
2536
  this.start();
2467
2537
  const unsubscribe = paused.subscribe((paused2) => {
2468
- if (paused2) {
2469
- resource.pause();
2470
- } else {
2471
- resource.play();
2472
- }
2538
+ if (paused2) resource.pause();
2539
+ else resource.play();
2473
2540
  });
2474
2541
  cleanup.add(unsubscribe);
2475
2542
  return {
@@ -2500,11 +2567,8 @@ var createAudio2 = (storageData) => {
2500
2567
  resource.volume = getVolume("voice");
2501
2568
  resource.play();
2502
2569
  voiceCleanup = paused.subscribe((paused2) => {
2503
- if (paused2) {
2504
- resource.pause();
2505
- } else {
2506
- resource.play();
2507
- }
2570
+ if (paused2) resource.pause();
2571
+ else resource.play();
2508
2572
  });
2509
2573
  },
2510
2574
  voiceStop() {
@@ -2518,17 +2582,17 @@ var createAudio2 = (storageData) => {
2518
2582
  if (started) return;
2519
2583
  started = true;
2520
2584
  const unsubscribe = storageData.subscribe(() => {
2521
- for (const type of ["music", "sound", "voice"]) {
2585
+ for (const type of [
2586
+ "music",
2587
+ "sound",
2588
+ "voice"
2589
+ ]) {
2522
2590
  const volume = getVolume(type);
2523
- if (type === "music" || type === "sound") {
2524
- for (const audio of Object.values(store[type])) {
2525
- if (!audio) continue;
2526
- audio.volume = volume;
2527
- }
2528
- }
2529
- if (type === "voice" && store.voice) {
2530
- store.voice.volume = volume;
2591
+ if (type === "music" || type === "sound") for (const audio of Object.values(store[type])) {
2592
+ if (!audio) continue;
2593
+ audio.volume = volume;
2531
2594
  }
2595
+ if (type === "voice" && store.voice) store.voice.volume = volume;
2532
2596
  }
2533
2597
  });
2534
2598
  cleanup.add(unsubscribe);
@@ -2550,11 +2614,7 @@ var createAudio2 = (storageData) => {
2550
2614
  };
2551
2615
  const clear = (keepAudio) => {
2552
2616
  context.voiceStop();
2553
- const entries = [
2554
- [store.music, keepAudio.music],
2555
- [store.sound, keepAudio.sounds]
2556
- ];
2557
- const clearEntries = entries.flatMap(([incoming, keep]) => {
2617
+ const clearEntries = [[store.music, keepAudio.music], [store.sound, keepAudio.sounds]].flatMap(([incoming, keep]) => {
2558
2618
  return Object.entries(incoming).filter(([name]) => !keep.has(name)).map(([_, a]) => a);
2559
2619
  });
2560
2620
  for (const music of clearEntries) {
@@ -2570,20 +2630,15 @@ var createAudio2 = (storageData) => {
2570
2630
  };
2571
2631
  };
2572
2632
  var createAudioMisc = () => {
2573
- const misc = {
2574
- preloadAudioBlocking: async (src) => {
2575
- await prefetchAudio(src);
2576
- }
2577
- };
2578
- return misc;
2633
+ return { preloadAudioBlocking: async (src) => {
2634
+ await prefetchAudio(src);
2635
+ } };
2579
2636
  };
2580
2637
  var createShared = (get) => {
2581
2638
  const CACHE = /* @__PURE__ */ new Map();
2582
2639
  const use2 = (id) => {
2583
2640
  const cached = CACHE.get(id);
2584
- if (cached) {
2585
- return cached;
2586
- }
2641
+ if (cached) return cached;
2587
2642
  const shared = get();
2588
2643
  CACHE.set(id, shared);
2589
2644
  return shared;
@@ -2601,9 +2656,7 @@ var createGetContext = () => {
2601
2656
  const getContextCached = (createContext2) => {
2602
2657
  return (key) => {
2603
2658
  const cached = CACHE.get(key);
2604
- if (cached) {
2605
- return cached;
2606
- }
2659
+ if (cached) return cached;
2607
2660
  const context = createContext2(key);
2608
2661
  CACHE.set(key, context);
2609
2662
  return context;
@@ -2626,9 +2679,7 @@ var createRootSetter = (getContext2) => {
2626
2679
  setRoot(root) {
2627
2680
  element = root;
2628
2681
  const context = getContext2();
2629
- if (!context.root) {
2630
- context.root = root;
2631
- }
2682
+ if (!context.root) context.root = root;
2632
2683
  }
2633
2684
  };
2634
2685
  };
@@ -2637,28 +2688,18 @@ var useBackground = (backgrounds, set) => {
2637
2688
  const allMedia = mediaQueries.find(({ media }) => media === "all");
2638
2689
  const handle = () => {
2639
2690
  const last = mediaQueries.findLast(({ matches, media }) => matches && media !== "all");
2640
- const bg = last ? backgrounds[last.media] : allMedia ? backgrounds["all"] : "";
2641
- set(bg);
2691
+ set(last ? backgrounds[last.media] : allMedia ? backgrounds["all"] : "");
2642
2692
  };
2643
- for (const mq of mediaQueries) {
2644
- mq.onchange = handle;
2645
- }
2693
+ for (const mq of mediaQueries) mq.onchange = handle;
2646
2694
  let disposed = false;
2647
2695
  Promise.resolve().then(() => {
2648
2696
  if (disposed) return;
2649
2697
  handle();
2650
2698
  });
2651
- return {
2652
- /**
2653
- * Remove all listeners
2654
- */
2655
- dispose() {
2656
- for (const mq of mediaQueries) {
2657
- mq.onchange = null;
2658
- }
2659
- disposed = true;
2660
- }
2661
- };
2699
+ return { dispose() {
2700
+ for (const mq of mediaQueries) mq.onchange = null;
2701
+ disposed = true;
2702
+ } };
2662
2703
  };
2663
2704
  var vibrationPossible = /* @__PURE__ */ (() => {
2664
2705
  let possible = false;
@@ -2672,35 +2713,19 @@ var vibrationPossible = /* @__PURE__ */ (() => {
2672
2713
  return isPossible;
2673
2714
  })();
2674
2715
  var vibrate = (pattern) => {
2675
- if (vibrationPossible() && "vibrate" in navigator) {
2676
- try {
2677
- navigator.vibrate(pattern);
2678
- } catch {
2679
- }
2716
+ if (vibrationPossible() && "vibrate" in navigator) try {
2717
+ navigator.vibrate(pattern);
2718
+ } catch {
2680
2719
  }
2681
2720
  };
2682
2721
  var allEmpty = (target) => {
2683
- if (typeof target === "string") {
2684
- return target == "";
2685
- }
2686
- if (typeof target === "number") {
2687
- return target == 0;
2688
- }
2689
- if (!target) {
2690
- return true;
2691
- }
2722
+ if (typeof target === "string") return target == "";
2723
+ if (typeof target === "number") return target == 0;
2724
+ if (!target) return true;
2692
2725
  if (Array.isArray(target) && target.length > 0) {
2693
- for (const inner of target) {
2694
- if (!allEmpty(inner)) {
2695
- return false;
2696
- }
2697
- }
2698
- }
2699
- for (const value of Object.values(target)) {
2700
- if (!allEmpty(value)) {
2701
- return false;
2702
- }
2726
+ for (const inner of target) if (!allEmpty(inner)) return false;
2703
2727
  }
2728
+ for (const value of Object.values(target)) if (!allEmpty(value)) return false;
2704
2729
  return true;
2705
2730
  };
2706
2731
  var handleBackgroundAction = ($contextState, background) => {
@@ -2708,10 +2733,7 @@ var handleBackgroundAction = ($contextState, background) => {
2708
2733
  const { dispose: dispose2 } = useBackground(background, (value) => {
2709
2734
  $contextState.mutate((s) => s.background.background, value);
2710
2735
  });
2711
- $contextState.mutate(
2712
- (s) => s.background.clear,
2713
- () => dispose2
2714
- );
2736
+ $contextState.mutate((s) => s.background.clear, () => dispose2);
2715
2737
  };
2716
2738
  var handleDialogAction = ($contextState, content, name, character, emotion, resolve) => {
2717
2739
  $contextState.mutate((s) => s.dialog, {
@@ -2726,70 +2748,54 @@ var handleDialogAction = ($contextState, content, name, character, emotion, reso
2726
2748
  });
2727
2749
  };
2728
2750
  var handleChoiceAction = ($contextState, label, choices, resolve) => {
2729
- $contextState.mutate((s) => s.choice, { choices, label, resolve, visible: true });
2751
+ $contextState.mutate((s) => s.choice, {
2752
+ choices,
2753
+ label,
2754
+ resolve,
2755
+ visible: true
2756
+ });
2730
2757
  };
2731
2758
  var handleClearAction = ($rendererState, $contextState, options, context, keep, keepCharacters) => {
2732
2759
  $rendererState.mutate((s) => s.exitPromptShown, false);
2733
- if (!keep.has("showBackground")) {
2734
- $contextState.mutate((s) => s.background.background, "#000");
2735
- }
2736
- if (!keep.has("choice")) {
2737
- $contextState.mutate((s) => s.choice, {
2738
- choices: [],
2739
- visible: false,
2740
- label: ""
2741
- });
2742
- }
2760
+ if (!keep.has("showBackground")) $contextState.mutate((s) => s.background.background, "#000");
2761
+ if (!keep.has("choice")) $contextState.mutate((s) => s.choice, {
2762
+ choices: [],
2763
+ visible: false,
2764
+ label: ""
2765
+ });
2743
2766
  const inputCleanup = $contextState.get().input.cleanup;
2744
- if (inputCleanup) {
2745
- inputCleanup();
2746
- }
2747
- if (!keep.has("input")) {
2748
- $contextState.mutate((s) => s.input, {
2749
- element: null,
2750
- label: "",
2751
- visible: false,
2752
- error: ""
2753
- });
2754
- }
2755
- if (!keep.has("dialog")) {
2756
- $contextState.mutate((s) => s.dialog, {
2757
- visible: false,
2758
- content: "",
2759
- name: "",
2760
- miniature: {}
2761
- });
2762
- }
2763
- if (!keep.has("text")) {
2764
- $contextState.mutate((s) => s.text, { content: "" });
2765
- }
2766
- for (const character of Object.keys($contextState.get().characters)) {
2767
- if (!keepCharacters.has(character)) {
2768
- $contextState.mutate((s) => s.characters[character], {
2769
- style: void 0,
2770
- visible: false
2771
- });
2772
- }
2773
- }
2767
+ if (inputCleanup) inputCleanup();
2768
+ if (!keep.has("input")) $contextState.mutate((s) => s.input, {
2769
+ element: null,
2770
+ label: "",
2771
+ visible: false,
2772
+ error: ""
2773
+ });
2774
+ if (!keep.has("dialog")) $contextState.mutate((s) => s.dialog, {
2775
+ visible: false,
2776
+ content: "",
2777
+ name: "",
2778
+ miniature: {}
2779
+ });
2780
+ if (!keep.has("text")) $contextState.mutate((s) => s.text, { content: "" });
2781
+ for (const character of Object.keys($contextState.get().characters)) if (!keepCharacters.has(character)) $contextState.mutate((s) => s.characters[character], {
2782
+ style: void 0,
2783
+ visible: false
2784
+ });
2774
2785
  };
2775
2786
  var handleCustomAction = ($contextState, fn) => {
2776
- if (!$contextState.get().custom[fn.key]) {
2777
- $contextState.mutate((s) => s.custom[fn.key], {
2778
- fn,
2779
- node: null
2780
- });
2781
- }
2787
+ if (!$contextState.get().custom[fn.key]) $contextState.mutate((s) => s.custom[fn.key], {
2788
+ fn,
2789
+ node: null
2790
+ });
2782
2791
  return {
2783
2792
  setMountElement(node) {
2784
- $contextState.mutate(
2785
- (s) => s.custom[fn.key],
2786
- (state) => {
2787
- return {
2788
- ...state,
2789
- node
2790
- };
2791
- }
2792
- );
2793
+ $contextState.mutate((s) => s.custom[fn.key], (state) => {
2794
+ return {
2795
+ ...state,
2796
+ node
2797
+ };
2798
+ });
2793
2799
  },
2794
2800
  remove() {
2795
2801
  $contextState.mutate((s) => s.custom[fn.key], void 0);
@@ -2798,35 +2804,30 @@ var handleCustomAction = ($contextState, fn) => {
2798
2804
  };
2799
2805
  var handleClearBlockingActions = ($contextState, preserve) => {
2800
2806
  const current = $contextState.get();
2801
- if (preserve !== "choice" && !allEmpty(current.choice)) {
2802
- $contextState.mutate((s) => s.choice, {
2803
- choices: [],
2804
- visible: false,
2805
- label: ""
2806
- });
2807
- }
2808
- if (preserve !== "input" && !allEmpty(current.input)) {
2809
- $contextState.mutate((s) => s.input, {
2810
- element: null,
2811
- label: "",
2812
- visible: false,
2813
- error: ""
2814
- });
2815
- }
2816
- if (preserve !== "text" && !allEmpty(current.text)) {
2817
- $contextState.mutate((s) => s.text, { content: "" });
2818
- }
2819
- if (preserve !== "dialog" && !allEmpty(current.dialog)) {
2820
- $contextState.mutate((s) => s.dialog, {
2821
- visible: false,
2822
- content: "",
2823
- name: "",
2824
- miniature: {}
2825
- });
2826
- }
2807
+ if (preserve !== "choice" && !allEmpty(current.choice)) $contextState.mutate((s) => s.choice, {
2808
+ choices: [],
2809
+ visible: false,
2810
+ label: ""
2811
+ });
2812
+ if (preserve !== "input" && !allEmpty(current.input)) $contextState.mutate((s) => s.input, {
2813
+ element: null,
2814
+ label: "",
2815
+ visible: false,
2816
+ error: ""
2817
+ });
2818
+ if (preserve !== "text" && !allEmpty(current.text)) $contextState.mutate((s) => s.text, { content: "" });
2819
+ if (preserve !== "dialog" && !allEmpty(current.dialog)) $contextState.mutate((s) => s.dialog, {
2820
+ visible: false,
2821
+ content: "",
2822
+ name: "",
2823
+ miniature: {}
2824
+ });
2827
2825
  };
2828
2826
  var handleTextAction = ($contextState, content, resolve) => {
2829
- $contextState.mutate((s) => s.text, { content, resolve });
2827
+ $contextState.mutate((s) => s.text, {
2828
+ content,
2829
+ resolve
2830
+ });
2830
2831
  };
2831
2832
  var handleInputAction = ($contextState, options, context, label, onInput, setup, resolve) => {
2832
2833
  const error = (value) => {
@@ -3173,7 +3174,7 @@ var Modal = (props) => {
3173
3174
  })();
3174
3175
  };
3175
3176
 
3176
- // ../../node_modules/.pnpm/@solid-primitives+transition-group@1.1.1_solid-js@1.9.7/node_modules/@solid-primitives/transition-group/dist/index.js
3177
+ // ../../node_modules/.pnpm/@solid-primitives+transition-group@1.1.1_solid-js@1.9.11/node_modules/@solid-primitives/transition-group/dist/index.js
3177
3178
  var noop2 = () => {
3178
3179
  };
3179
3180
  var noopTransition = (el, done) => done();
@@ -3239,10 +3240,7 @@ function createSwitchTransition(source, options) {
3239
3240
  return returned;
3240
3241
  }
3241
3242
 
3242
- // ../../node_modules/.pnpm/@solid-primitives+utils@6.3.1_solid-js@1.9.7/node_modules/@solid-primitives/utils/dist/index.js
3243
- var access = (v) => typeof v === "function" && !v.length ? v() : v;
3244
-
3245
- // ../../node_modules/.pnpm/@solid-primitives+refs@1.1.1_solid-js@1.9.7/node_modules/@solid-primitives/refs/dist/index.js
3243
+ // ../../node_modules/.pnpm/@solid-primitives+refs@1.1.1_solid-js@1.9.11/node_modules/@solid-primitives/refs/dist/index.js
3246
3244
  var defaultElementPredicate = isServer ? (item) => item != null && typeof item === "object" && "t" in item : (item) => item instanceof Element;
3247
3245
  function getFirstChild(value, predicate) {
3248
3246
  if (predicate(value))
@@ -3263,7 +3261,7 @@ function resolveFirst(fn, predicate = defaultElementPredicate, serverPredicate =
3263
3261
  return createMemo(() => getFirstChild(children2(), isServer ? serverPredicate : predicate));
3264
3262
  }
3265
3263
 
3266
- // ../../node_modules/.pnpm/solid-transition-group@0.3.0_solid-js@1.9.7/node_modules/solid-transition-group/dist/index.js
3264
+ // ../../node_modules/.pnpm/solid-transition-group@0.3.0_solid-js@1.9.11/node_modules/solid-transition-group/dist/index.js
3267
3265
  function createClassnames(props) {
3268
3266
  return createMemo(() => {
3269
3267
  const name = props.name || "s";
@@ -4042,7 +4040,10 @@ var Await = (props) => {
4042
4040
  });
4043
4041
  };
4044
4042
 
4045
- // ../../node_modules/.pnpm/@solid-primitives+destructure@0.2.1_solid-js@1.9.7/node_modules/@solid-primitives/destructure/dist/index.js
4043
+ // ../../node_modules/.pnpm/@solid-primitives+utils@6.4.0_solid-js@1.9.11/node_modules/@solid-primitives/utils/dist/index.js
4044
+ var access = (v) => typeof v === "function" && !v.length ? v() : v;
4045
+
4046
+ // ../../node_modules/.pnpm/@solid-primitives+destructure@0.2.3_solid-js@1.9.11/node_modules/@solid-primitives/destructure/dist/index.js
4046
4047
  var isReactiveObject = (value) => typeof value === "object" && value !== null;
4047
4048
  function createProxyCache(obj, get) {
4048
4049
  return new Proxy({}, {
@@ -5050,8 +5051,8 @@ var getIndex = (ctx, key) => {
5050
5051
  }
5051
5052
  return index;
5052
5053
  };
5053
- var SHOW_IMAGE = Symbol();
5054
- var HIDE_IMAGE = Symbol();
5054
+ var SHOW_IMAGE = /* @__PURE__ */ Symbol();
5055
+ var HIDE_IMAGE = /* @__PURE__ */ Symbol();
5055
5056
  var SHOW_HIDE_IMAGE = /* @__PURE__ */ new Set([SHOW_IMAGE, HIDE_IMAGE]);
5056
5057
  var showImage = (asset, { classesBase, classesIn, wait } = {}) => {
5057
5058
  const key = `show-image--${asset.id}`;
@@ -5166,7 +5167,7 @@ var hideImage = (asset, { classesOut, wait } = {}) => {
5166
5167
  };
5167
5168
 
5168
5169
  // src/custom-actions/mood.ts
5169
- var SET_MOOD = Symbol();
5170
+ var SET_MOOD = /* @__PURE__ */ Symbol();
5170
5171
  var setMood = (mood) => {
5171
5172
  const handler = ({ contextKey, templateReplace, state, clear }) => {
5172
5173
  const ctx = useContextState(contextKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,18 +10,18 @@
10
10
  "module": "./dist/index.jsx",
11
11
  "sideEffects": false,
12
12
  "devDependencies": {
13
- "esbuild": "^0.25.5",
13
+ "esbuild": "^0.27.4",
14
14
  "esbuild-plugin-solid": "^0.6.0",
15
- "typescript": "^5.8.3"
15
+ "typescript": "^5.9.3"
16
16
  },
17
17
  "dependencies": {
18
- "@solid-primitives/destructure": "^0.2.1",
18
+ "@solid-primitives/destructure": "^0.2.3",
19
19
  "clsx": "^2.1.1",
20
20
  "es-toolkit": "^1.39.5",
21
- "solid-js": "~1.9.7",
21
+ "solid-js": "~1.9.11",
22
22
  "solid-transition-group": "^0.3.0",
23
- "@novely/core": "^0.54.0",
24
- "@novely/renderer-toolkit": "0.13.0"
23
+ "@novely/core": "^0.55.0",
24
+ "@novely/renderer-toolkit": "0.14.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@novely/core": "*",