@player-ui/asset-testing-library 0.8.0--canary.307.9621 → 0.8.0-next.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/cjs/index.cjs +60 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/index.legacy-esm.js +35 -0
- package/dist/index.mjs +35 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +22 -59
- package/src/index.ts +19 -9
- package/types/index.d.ts +11 -0
- package/dist/index.cjs.js +0 -36
- package/dist/index.d.ts +0 -13
- package/dist/index.esm.js +0 -32
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/tools/asset-testing-library/core/src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
runTransform: () => runTransform
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
var import_player = require("@player-ui/player");
|
|
27
|
+
var import_asset_transform_plugin = require("@player-ui/asset-transform-plugin");
|
|
28
|
+
var import_make_flow = require("@player-ui/make-flow");
|
|
29
|
+
function runTransform(type, transform, content, additionalPlugins = []) {
|
|
30
|
+
const player = new import_player.Player({
|
|
31
|
+
plugins: [
|
|
32
|
+
...additionalPlugins,
|
|
33
|
+
new import_asset_transform_plugin.AssetTransformPlugin([[{ type }, transform]])
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
player.start((0, import_make_flow.makeFlow)(content));
|
|
37
|
+
return {
|
|
38
|
+
player,
|
|
39
|
+
get current() {
|
|
40
|
+
const status = player.getState();
|
|
41
|
+
if (status.status === "in-progress") {
|
|
42
|
+
const view = status.controllers.view.currentView?.lastUpdate;
|
|
43
|
+
if (view) {
|
|
44
|
+
return view;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
get controllers() {
|
|
49
|
+
const status = player.getState();
|
|
50
|
+
if (status.status === "in-progress") {
|
|
51
|
+
return status.controllers;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
runTransform
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/tools/asset-testing-library/core/src/index.ts"],"sourcesContent":["import type {\n TransformFunction,\n Asset,\n Flow,\n View,\n PlayerPlugin,\n} from \"@player-ui/player\";\nimport { Player } from \"@player-ui/player\";\nimport { AssetTransformPlugin } from \"@player-ui/asset-transform-plugin\";\nimport { makeFlow } from \"@player-ui/make-flow\";\n\n/**\n * A testing utility for transforms\n */\nexport function runTransform<\n BaseAssetType extends Asset,\n TransformedAssetType extends Asset = BaseAssetType,\n>(\n type: string,\n transform: TransformFunction<BaseAssetType, TransformedAssetType>,\n content: BaseAssetType | Flow | Array<View>,\n additionalPlugins: Array<PlayerPlugin> = [],\n) {\n const player = new Player({\n plugins: [\n ...additionalPlugins,\n new AssetTransformPlugin([[{ type }, transform]]),\n ],\n });\n\n player.start(makeFlow(content));\n\n return {\n player,\n get current() {\n const status = player.getState();\n if (status.status === \"in-progress\") {\n const view = status.controllers.view.currentView?.lastUpdate;\n if (view) {\n return view as TransformedAssetType;\n }\n }\n },\n get controllers() {\n const status = player.getState();\n if (status.status === \"in-progress\") {\n return status.controllers;\n }\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,oBAAuB;AACvB,oCAAqC;AACrC,uBAAyB;AAKlB,SAAS,aAId,MACA,WACA,SACA,oBAAyC,CAAC,GAC1C;AACA,QAAM,SAAS,IAAI,qBAAO;AAAA,IACxB,SAAS;AAAA,MACP,GAAG;AAAA,MACH,IAAI,mDAAqB,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,CAAC;AAAA,IAClD;AAAA,EACF,CAAC;AAED,SAAO,UAAM,2BAAS,OAAO,CAAC;AAE9B,SAAO;AAAA,IACL;AAAA,IACA,IAAI,UAAU;AACZ,YAAM,SAAS,OAAO,SAAS;AAC/B,UAAI,OAAO,WAAW,eAAe;AACnC,cAAM,OAAO,OAAO,YAAY,KAAK,aAAa;AAClD,YAAI,MAAM;AACR,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,IACA,IAAI,cAAc;AAChB,YAAM,SAAS,OAAO,SAAS;AAC/B,UAAI,OAAO,WAAW,eAAe;AACnC,eAAO,OAAO;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/tools/asset-testing-library/core/src/index.ts
|
|
2
|
+
import { Player } from "@player-ui/player";
|
|
3
|
+
import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
|
|
4
|
+
import { makeFlow } from "@player-ui/make-flow";
|
|
5
|
+
function runTransform(type, transform, content, additionalPlugins = []) {
|
|
6
|
+
const player = new Player({
|
|
7
|
+
plugins: [
|
|
8
|
+
...additionalPlugins,
|
|
9
|
+
new AssetTransformPlugin([[{ type }, transform]])
|
|
10
|
+
]
|
|
11
|
+
});
|
|
12
|
+
player.start(makeFlow(content));
|
|
13
|
+
return {
|
|
14
|
+
player,
|
|
15
|
+
get current() {
|
|
16
|
+
const status = player.getState();
|
|
17
|
+
if (status.status === "in-progress") {
|
|
18
|
+
const view = status.controllers.view.currentView?.lastUpdate;
|
|
19
|
+
if (view) {
|
|
20
|
+
return view;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
get controllers() {
|
|
25
|
+
const status = player.getState();
|
|
26
|
+
if (status.status === "in-progress") {
|
|
27
|
+
return status.controllers;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
runTransform
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/tools/asset-testing-library/core/src/index.ts
|
|
2
|
+
import { Player } from "@player-ui/player";
|
|
3
|
+
import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
|
|
4
|
+
import { makeFlow } from "@player-ui/make-flow";
|
|
5
|
+
function runTransform(type, transform, content, additionalPlugins = []) {
|
|
6
|
+
const player = new Player({
|
|
7
|
+
plugins: [
|
|
8
|
+
...additionalPlugins,
|
|
9
|
+
new AssetTransformPlugin([[{ type }, transform]])
|
|
10
|
+
]
|
|
11
|
+
});
|
|
12
|
+
player.start(makeFlow(content));
|
|
13
|
+
return {
|
|
14
|
+
player,
|
|
15
|
+
get current() {
|
|
16
|
+
const status = player.getState();
|
|
17
|
+
if (status.status === "in-progress") {
|
|
18
|
+
const view = status.controllers.view.currentView?.lastUpdate;
|
|
19
|
+
if (view) {
|
|
20
|
+
return view;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
get controllers() {
|
|
25
|
+
const status = player.getState();
|
|
26
|
+
if (status.status === "in-progress") {
|
|
27
|
+
return status.controllers;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
runTransform
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/tools/asset-testing-library/core/src/index.ts"],"sourcesContent":["import type {\n TransformFunction,\n Asset,\n Flow,\n View,\n PlayerPlugin,\n} from \"@player-ui/player\";\nimport { Player } from \"@player-ui/player\";\nimport { AssetTransformPlugin } from \"@player-ui/asset-transform-plugin\";\nimport { makeFlow } from \"@player-ui/make-flow\";\n\n/**\n * A testing utility for transforms\n */\nexport function runTransform<\n BaseAssetType extends Asset,\n TransformedAssetType extends Asset = BaseAssetType,\n>(\n type: string,\n transform: TransformFunction<BaseAssetType, TransformedAssetType>,\n content: BaseAssetType | Flow | Array<View>,\n additionalPlugins: Array<PlayerPlugin> = [],\n) {\n const player = new Player({\n plugins: [\n ...additionalPlugins,\n new AssetTransformPlugin([[{ type }, transform]]),\n ],\n });\n\n player.start(makeFlow(content));\n\n return {\n player,\n get current() {\n const status = player.getState();\n if (status.status === \"in-progress\") {\n const view = status.controllers.view.currentView?.lastUpdate;\n if (view) {\n return view as TransformedAssetType;\n }\n }\n },\n get controllers() {\n const status = player.getState();\n if (status.status === \"in-progress\") {\n return status.controllers;\n }\n },\n };\n}\n"],"mappings":";AAOA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AAKlB,SAAS,aAId,MACA,WACA,SACA,oBAAyC,CAAC,GAC1C;AACA,QAAM,SAAS,IAAI,OAAO;AAAA,IACxB,SAAS;AAAA,MACP,GAAG;AAAA,MACH,IAAI,qBAAqB,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,CAAC;AAAA,IAClD;AAAA,EACF,CAAC;AAED,SAAO,MAAM,SAAS,OAAO,CAAC;AAE9B,SAAO;AAAA,IACL;AAAA,IACA,IAAI,UAAU;AACZ,YAAM,SAAS,OAAO,SAAS;AAC/B,UAAI,OAAO,WAAW,eAAe;AACnC,cAAM,OAAO,OAAO,YAAY,KAAK,aAAa;AAClD,YAAI,MAAM;AACR,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,IACA,IAAI,cAAc;AAChB,YAAM,SAAS,OAAO,SAAS;AAC/B,UAAI,OAAO,WAAW,eAAe;AACnC,eAAO,OAAO;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,66 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@player-ui/asset-testing-library",
|
|
3
|
-
"version": "0.8.0
|
|
4
|
-
"
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"registry": "https://registry.npmjs.org"
|
|
7
|
-
},
|
|
8
|
-
"peerDependencies": {},
|
|
3
|
+
"version": "0.8.0-next.0",
|
|
4
|
+
"main": "dist/cjs/index.cjs",
|
|
9
5
|
"dependencies": {
|
|
10
|
-
"@player-ui/player": "0.8.0
|
|
11
|
-
"@player-ui/make-flow": "0.8.0
|
|
12
|
-
"@player-ui/asset-transform-plugin": "0.8.0
|
|
13
|
-
"
|
|
6
|
+
"@player-ui/player": "0.8.0-next.0",
|
|
7
|
+
"@player-ui/make-flow": "0.8.0-next.0",
|
|
8
|
+
"@player-ui/asset-transform-plugin": "0.8.0-next.0",
|
|
9
|
+
"tslib": "^2.6.2"
|
|
14
10
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"typings": "dist/index.d.ts",
|
|
11
|
+
"module": "dist/index.legacy-esm.js",
|
|
12
|
+
"types": "types/index.d.ts",
|
|
18
13
|
"sideEffects": false,
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
"homepage": "https://player-ui.github.io",
|
|
28
|
-
"contributors": [
|
|
29
|
-
{
|
|
30
|
-
"name": "Adam Dierkens",
|
|
31
|
-
"url": "https://github.com/adierkens"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "Spencer Hamm",
|
|
35
|
-
"url": "https://github.com/spentacular"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"name": "Harris Borawski",
|
|
39
|
-
"url": "https://github.com/hborawski"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"name": "Jeremiah Zucker",
|
|
43
|
-
"url": "https://github.com/sugarmanz"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"name": "Ketan Reddy",
|
|
47
|
-
"url": "https://github.com/KetanReddy"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"name": "Brocollie08",
|
|
51
|
-
"url": "https://github.com/brocollie08"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "Kelly Harrop",
|
|
55
|
-
"url": "https://github.com/kharrop"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "Alejandro Fimbres",
|
|
59
|
-
"url": "https://github.com/lexfm"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"name": "Rafael Campos",
|
|
63
|
-
"url": "https://github.com/rafbcampos"
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
"./dist/index.css": "./dist/index.css",
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"import": "./dist/index.mjs",
|
|
20
|
+
"default": "./dist/cjs/index.cjs"
|
|
64
21
|
}
|
|
65
|
-
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"src",
|
|
26
|
+
"types"
|
|
27
|
+
],
|
|
28
|
+
"peerDependencies": {}
|
|
66
29
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type {
|
|
2
|
+
TransformFunction,
|
|
3
|
+
Asset,
|
|
4
|
+
Flow,
|
|
5
|
+
View,
|
|
6
|
+
PlayerPlugin,
|
|
7
|
+
} from "@player-ui/player";
|
|
8
|
+
import { Player } from "@player-ui/player";
|
|
9
|
+
import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
|
|
10
|
+
import { makeFlow } from "@player-ui/make-flow";
|
|
5
11
|
|
|
6
12
|
/**
|
|
7
13
|
* A testing utility for transforms
|
|
8
14
|
*/
|
|
9
15
|
export function runTransform<
|
|
10
16
|
BaseAssetType extends Asset,
|
|
11
|
-
TransformedAssetType extends Asset = BaseAssetType
|
|
17
|
+
TransformedAssetType extends Asset = BaseAssetType,
|
|
12
18
|
>(
|
|
13
19
|
type: string,
|
|
14
20
|
transform: TransformFunction<BaseAssetType, TransformedAssetType>,
|
|
15
|
-
content: BaseAssetType | Flow | Array<View
|
|
21
|
+
content: BaseAssetType | Flow | Array<View>,
|
|
22
|
+
additionalPlugins: Array<PlayerPlugin> = [],
|
|
16
23
|
) {
|
|
17
24
|
const player = new Player({
|
|
18
|
-
plugins: [
|
|
25
|
+
plugins: [
|
|
26
|
+
...additionalPlugins,
|
|
27
|
+
new AssetTransformPlugin([[{ type }, transform]]),
|
|
28
|
+
],
|
|
19
29
|
});
|
|
20
30
|
|
|
21
31
|
player.start(makeFlow(content));
|
|
@@ -24,7 +34,7 @@ export function runTransform<
|
|
|
24
34
|
player,
|
|
25
35
|
get current() {
|
|
26
36
|
const status = player.getState();
|
|
27
|
-
if (status.status ===
|
|
37
|
+
if (status.status === "in-progress") {
|
|
28
38
|
const view = status.controllers.view.currentView?.lastUpdate;
|
|
29
39
|
if (view) {
|
|
30
40
|
return view as TransformedAssetType;
|
|
@@ -33,7 +43,7 @@ export function runTransform<
|
|
|
33
43
|
},
|
|
34
44
|
get controllers() {
|
|
35
45
|
const status = player.getState();
|
|
36
|
-
if (status.status ===
|
|
46
|
+
if (status.status === "in-progress") {
|
|
37
47
|
return status.controllers;
|
|
38
48
|
}
|
|
39
49
|
},
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TransformFunction, Asset, Flow, View, PlayerPlugin } from "@player-ui/player";
|
|
2
|
+
import { Player } from "@player-ui/player";
|
|
3
|
+
/**
|
|
4
|
+
* A testing utility for transforms
|
|
5
|
+
*/
|
|
6
|
+
export declare function runTransform<BaseAssetType extends Asset, TransformedAssetType extends Asset = BaseAssetType>(type: string, transform: TransformFunction<BaseAssetType, TransformedAssetType>, content: BaseAssetType | Flow | Array<View>, additionalPlugins?: Array<PlayerPlugin>): {
|
|
7
|
+
player: Player;
|
|
8
|
+
readonly current: TransformedAssetType | undefined;
|
|
9
|
+
readonly controllers: import("@player-ui/player").ControllerState | undefined;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.cjs.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var player = require('@player-ui/player');
|
|
6
|
-
var assetTransformPlugin = require('@player-ui/asset-transform-plugin');
|
|
7
|
-
var makeFlow = require('@player-ui/make-flow');
|
|
8
|
-
|
|
9
|
-
function runTransform(type, transform, content) {
|
|
10
|
-
const player$1 = new player.Player({
|
|
11
|
-
plugins: [new assetTransformPlugin.AssetTransformPlugin([[{ type }, transform]])]
|
|
12
|
-
});
|
|
13
|
-
player$1.start(makeFlow.makeFlow(content));
|
|
14
|
-
return {
|
|
15
|
-
player: player$1,
|
|
16
|
-
get current() {
|
|
17
|
-
var _a;
|
|
18
|
-
const status = player$1.getState();
|
|
19
|
-
if (status.status === "in-progress") {
|
|
20
|
-
const view = (_a = status.controllers.view.currentView) == null ? void 0 : _a.lastUpdate;
|
|
21
|
-
if (view) {
|
|
22
|
-
return view;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
get controllers() {
|
|
27
|
-
const status = player$1.getState();
|
|
28
|
-
if (status.status === "in-progress") {
|
|
29
|
-
return status.controllers;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
exports.runTransform = runTransform;
|
|
36
|
-
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as _player_ui_player from '@player-ui/player';
|
|
2
|
-
import { Asset, TransformFunction, Flow, View, Player } from '@player-ui/player';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A testing utility for transforms
|
|
6
|
-
*/
|
|
7
|
-
declare function runTransform<BaseAssetType extends Asset, TransformedAssetType extends Asset = BaseAssetType>(type: string, transform: TransformFunction<BaseAssetType, TransformedAssetType>, content: BaseAssetType | Flow | Array<View>): {
|
|
8
|
-
player: Player;
|
|
9
|
-
readonly current: TransformedAssetType | undefined;
|
|
10
|
-
readonly controllers: _player_ui_player.ControllerState | undefined;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { runTransform };
|
package/dist/index.esm.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Player } from '@player-ui/player';
|
|
2
|
-
import { AssetTransformPlugin } from '@player-ui/asset-transform-plugin';
|
|
3
|
-
import { makeFlow } from '@player-ui/make-flow';
|
|
4
|
-
|
|
5
|
-
function runTransform(type, transform, content) {
|
|
6
|
-
const player = new Player({
|
|
7
|
-
plugins: [new AssetTransformPlugin([[{ type }, transform]])]
|
|
8
|
-
});
|
|
9
|
-
player.start(makeFlow(content));
|
|
10
|
-
return {
|
|
11
|
-
player,
|
|
12
|
-
get current() {
|
|
13
|
-
var _a;
|
|
14
|
-
const status = player.getState();
|
|
15
|
-
if (status.status === "in-progress") {
|
|
16
|
-
const view = (_a = status.controllers.view.currentView) == null ? void 0 : _a.lastUpdate;
|
|
17
|
-
if (view) {
|
|
18
|
-
return view;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
get controllers() {
|
|
23
|
-
const status = player.getState();
|
|
24
|
-
if (status.status === "in-progress") {
|
|
25
|
-
return status.controllers;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { runTransform };
|
|
32
|
-
//# sourceMappingURL=index.esm.js.map
|