@player-ui/reference-assets-plugin 0.10.4-next.2 → 0.10.4-next.3

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.
@@ -0,0 +1,5 @@
1
+ import type { AssetWrapper, Asset } from "@player-ui/player";
2
+
3
+ export interface ChatMessageAsset extends Asset<"chat-message"> {
4
+ value?: AssetWrapper;
5
+ }
@@ -5,3 +5,4 @@ export * from "./info";
5
5
  export * from "./text";
6
6
  export * from "./image";
7
7
  export * from "./choice";
8
+ export * from "./chat-message";
package/src/plugin.ts CHANGED
@@ -8,6 +8,7 @@ import type {
8
8
  TextAsset,
9
9
  CollectionAsset,
10
10
  ChoiceAsset,
11
+ ChatMessageAsset,
11
12
  } from "./assets";
12
13
  import {
13
14
  inputTransform,
@@ -15,6 +16,7 @@ import {
15
16
  imageTransform,
16
17
  infoTransform,
17
18
  choiceTransform,
19
+ chatMessageTransform,
18
20
  } from "./assets";
19
21
 
20
22
  /**
@@ -30,6 +32,7 @@ export class ReferenceAssetsPlugin
30
32
  TextAsset,
31
33
  CollectionAsset,
32
34
  ChoiceAsset,
35
+ ChatMessageAsset,
33
36
  ],
34
37
  [InfoAsset]
35
38
  >
@@ -44,6 +47,7 @@ export class ReferenceAssetsPlugin
44
47
  [{ type: "image" }, imageTransform],
45
48
  [{ type: "info" }, infoTransform],
46
49
  [{ type: "choice" }, choiceTransform],
50
+ [{ type: "chat-message" }, chatMessageTransform],
47
51
  ]),
48
52
  );
49
53
  }
@@ -0,0 +1,3 @@
1
+ export * from "./transform";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ import type { BeforeTransformFunction, TransformFunctions } from "@player-ui/player";
2
+ import { ChatMessageAsset } from "./types";
3
+ /**
4
+ * In beforeTransform function, pass in flatten marker and call beforeResolve function.
5
+ * Flatten default value is true.
6
+ * input: ChatMessageAsset
7
+ * @param asset - Asset to apply the transform to
8
+ * @returns - transformed asset with async node and asset node
9
+ */
10
+ export declare const transform: BeforeTransformFunction<ChatMessageAsset>;
11
+ export declare const chatMessageTransform: TransformFunctions;
12
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { AssetWrapper, Asset } from "@player-ui/player";
2
+ export interface ChatMessageAsset extends Asset<"chat-message"> {
3
+ value?: AssetWrapper;
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -5,4 +5,5 @@ export * from "./info";
5
5
  export * from "./text";
6
6
  export * from "./image";
7
7
  export * from "./choice";
8
+ export * from "./chat-message";
8
9
  //# sourceMappingURL=index.d.ts.map
package/types/plugin.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Player, ExtendedPlayerPlugin } from "@player-ui/player";
2
- import type { ActionAsset, InputAsset, ImageAsset, InfoAsset, TextAsset, CollectionAsset, ChoiceAsset } from "./assets";
2
+ import type { ActionAsset, InputAsset, ImageAsset, InfoAsset, TextAsset, CollectionAsset, ChoiceAsset, ChatMessageAsset } from "./assets";
3
3
  /**
4
4
  * A plugin to add transforms for the reference assets
5
5
  */
@@ -9,7 +9,8 @@ export declare class ReferenceAssetsPlugin implements ExtendedPlayerPlugin<[
9
9
  ImageAsset,
10
10
  TextAsset,
11
11
  CollectionAsset,
12
- ChoiceAsset
12
+ ChoiceAsset,
13
+ ChatMessageAsset
13
14
  ], [
14
15
  InfoAsset
15
16
  ]> {