@novely/core 0.31.0 → 0.31.2

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.d.ts CHANGED
@@ -276,6 +276,9 @@ type TranslationDescription = {
276
276
  plural?: Record<string, Pluralization>;
277
277
  actions?: TranslationActions;
278
278
  };
279
+ type DefaultEmotions<$Characters extends Record<string, Character<Lang>>> = {
280
+ [Character in keyof $Characters]?: (keyof $Characters[Character]['emotions'] & string);
281
+ };
279
282
  interface NovelyInit<$Language extends Lang, $Characters extends Record<string, Character<NoInfer<$Language>>>, $State extends State, $Data extends Data, $Actions extends Record<string, (...args: any[]) => ValidAction>> {
280
283
  /**
281
284
  * An object containing the characters in the game.
@@ -323,9 +326,7 @@ interface NovelyInit<$Language extends Lang, $Characters extends Record<string,
323
326
  * })
324
327
  * ```
325
328
  */
326
- defaultEmotions?: {
327
- [Character in keyof NoInfer<$Characters>]?: (keyof NoInfer<$Characters>[Character]['emotions'] & string);
328
- };
329
+ defaultEmotions?: DefaultEmotions<NoInfer<$Characters>>;
329
330
  /**
330
331
  * An object that provides access to the game's storage system.
331
332
  * @default localStorage // at key `novely-game-storage`
@@ -699,10 +700,6 @@ declare const novely: <$Language extends string, $Characters extends Record<stri
699
700
  * ```
700
701
  */
701
702
  typeEssentials: TypeEssentials<$Language, $State, $Data, $Characters>;
702
- /**
703
- * @deprecated Renamed into `templateReplace`
704
- */
705
- unwrap(content: TextContent<$Language, $Data>): string;
706
703
  /**
707
704
  * Replaces content inside {{braces}} with using global data
708
705
  * @example
@@ -462,10 +462,10 @@ var Novely = (() => {
462
462
  const next = (i) => queue.slice(i + 1);
463
463
  for (const [i, item] of queue.entries()) {
464
464
  const [action, ...params] = item;
465
- keep.add(action);
466
465
  if (options.skip.has(item) && item !== options.skipPreserve) {
467
466
  continue;
468
467
  }
468
+ keep.add(action);
469
469
  if (action === "function" || action === "custom") {
470
470
  if (action === "custom" && params[0].callOnlyLatest) {
471
471
  const notLatest = next(i).some(([, func]) => {
@@ -1149,11 +1149,10 @@ var Novely = (() => {
1149
1149
  const [path] = stack.value = latest;
1150
1150
  renderer.ui.showScreen("game");
1151
1151
  const { queue, skip, skipPreserve } = getActionsFromPath(story, path, false);
1152
- const processor = createQueueProcessor(queue, {
1152
+ const { run, keep: { keep, characters: characters2, audio } } = createQueueProcessor(queue, {
1153
1153
  skip,
1154
1154
  skipPreserve
1155
1155
  });
1156
- const { keep, characters: characters2, audio } = processor.keep;
1157
1156
  if (previous) {
1158
1157
  const { queue: prevQueue } = getActionsFromPath(story, previous[0], false);
1159
1158
  for (let i = prevQueue.length - 1; i > queue.length - 1; i--) {
@@ -1173,7 +1172,7 @@ var Novely = (() => {
1173
1172
  });
1174
1173
  const lastQueueItem = queue.at(-1) || [];
1175
1174
  const lastQueueItemRequiresUserAction = isSkippedDuringRestore(lastQueueItem[0]) || isUserRequiredAction(lastQueueItem);
1176
- await processor.run((item) => {
1175
+ await run((item) => {
1177
1176
  if (!latest)
1178
1177
  return;
1179
1178
  if (lastQueueItem === item && lastQueueItemRequiresUserAction) {
@@ -1783,12 +1782,6 @@ var Novely = (() => {
1783
1782
  * ```
1784
1783
  */
1785
1784
  typeEssentials,
1786
- /**
1787
- * @deprecated Renamed into `templateReplace`
1788
- */
1789
- unwrap(content) {
1790
- return templateReplace(content);
1791
- },
1792
1785
  /**
1793
1786
  * Replaces content inside {{braces}} with using global data
1794
1787
  * @example