@player-ui/reference-assets-plugin 0.10.4-next.2 → 0.10.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.
- package/dist/ReferenceAssetsPlugin.native.js +7497 -398
- package/dist/ReferenceAssetsPlugin.native.js.map +1 -1
- package/dist/cjs/index.cjs +24 -5
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +19 -2
- package/dist/index.mjs +19 -2
- package/dist/index.mjs.map +1 -1
- package/dist/xlr/ActionAsset.json +2 -2
- package/dist/xlr/ChatMessageAsset.json +27 -0
- package/dist/xlr/ChoiceAsset.json +5 -5
- package/dist/xlr/CollectionAsset.json +1 -1
- package/dist/xlr/ImageAsset.json +2 -2
- package/dist/xlr/InfoAsset.json +1 -1
- package/dist/xlr/InputAsset.json +2 -2
- package/dist/xlr/TextAsset.json +4 -4
- package/dist/xlr/manifest.js +2 -1
- package/dist/xlr/manifest.json +2 -1
- package/package.json +5 -4
- package/src/assets/chat-message/__tests__/transform.test.ts +61 -0
- package/src/assets/chat-message/index.ts +2 -0
- package/src/assets/chat-message/transform.ts +27 -0
- package/src/assets/chat-message/types.ts +5 -0
- package/src/assets/index.ts +1 -0
- package/src/plugin.ts +4 -0
- package/types/assets/chat-message/index.d.ts +3 -0
- package/types/assets/chat-message/transform.d.ts +12 -0
- package/types/assets/chat-message/types.d.ts +5 -0
- package/types/assets/index.d.ts +1 -0
- package/types/plugin.d.ts +3 -2
package/src/assets/index.ts
CHANGED
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,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
|
package/types/assets/index.d.ts
CHANGED
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
|
]> {
|