@novely/core 0.46.4 → 0.47.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.
package/dist/index.d.ts CHANGED
@@ -251,6 +251,7 @@ declare const getLanguage: (languages: string[]) => string;
251
251
 
252
252
  type NovelyAsset = {
253
253
  readonly source: string;
254
+ readonly id: string;
254
255
  readonly type: 'audio' | 'image';
255
256
  };
256
257
  type Thenable<T> = T | Promise<T>;
@@ -2661,6 +2661,7 @@ var Novely = (() => {
2661
2661
  loadImageFormatsSupport();
2662
2662
 
2663
2663
  // src/asset.ts
2664
+ var generateRandomId = () => Math.random().toString(36);
2664
2665
  var getType = memoize(
2665
2666
  (extensions) => {
2666
2667
  if (extensions.every((extension) => HOWLER_SUPPORTED_FILE_FORMATS.has(extension))) {
@@ -2714,7 +2715,8 @@ var Novely = (() => {
2714
2715
  },
2715
2716
  get type() {
2716
2717
  return type;
2717
- }
2718
+ },
2719
+ id: generateRandomId()
2718
2720
  };
2719
2721
  },
2720
2722
  {
@@ -2727,13 +2729,15 @@ var Novely = (() => {
2727
2729
  asset.image = (source) => {
2728
2730
  return {
2729
2731
  type: "image",
2730
- source
2732
+ source,
2733
+ id: generateRandomId()
2731
2734
  };
2732
2735
  };
2733
2736
  asset.audio = (source) => {
2734
2737
  return {
2735
2738
  type: "audio",
2736
- source
2739
+ source,
2740
+ id: generateRandomId()
2737
2741
  };
2738
2742
  };
2739
2743
  return __toCommonJS(src_exports);