@player-ui/asset-testing-library 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.
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/tools/asset-testing-library/core/src/index.ts"],"sourcesContent":["import type {\n Asset,\n Flow,\n View,\n PlayerPlugin,\n TransformFunctions,\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: TransformFunctions,\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":[]}
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/tools/asset-testing-library/core/src/index.ts"],"sourcesContent":["import type {\n Asset,\n Flow,\n View,\n PlayerPlugin,\n TransformFunctions,\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: TransformFunctions,\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
@@ -6,12 +6,12 @@
6
6
  "types"
7
7
  ],
8
8
  "name": "@player-ui/asset-testing-library",
9
- "version": "0.10.4-next.2",
9
+ "version": "0.10.4",
10
10
  "main": "dist/cjs/index.cjs",
11
11
  "dependencies": {
12
- "@player-ui/player": "0.10.4-next.2",
13
- "@player-ui/make-flow": "0.10.4-next.2",
14
- "@player-ui/asset-transform-plugin": "0.10.4-next.2",
12
+ "@player-ui/player": "0.10.4",
13
+ "@player-ui/make-flow": "0.10.4",
14
+ "@player-ui/asset-transform-plugin": "0.10.4",
15
15
  "tslib": "^2.6.2"
16
16
  },
17
17
  "module": "dist/index.legacy-esm.js",
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type {
2
- TransformFunction,
3
2
  Asset,
4
3
  Flow,
5
4
  View,
6
5
  PlayerPlugin,
6
+ TransformFunctions,
7
7
  } from "@player-ui/player";
8
8
  import { Player } from "@player-ui/player";
9
9
  import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
@@ -17,7 +17,7 @@ export function runTransform<
17
17
  TransformedAssetType extends Asset = BaseAssetType,
18
18
  >(
19
19
  type: string,
20
- transform: TransformFunction<BaseAssetType, TransformedAssetType>,
20
+ transform: TransformFunctions,
21
21
  content: BaseAssetType | Flow | Array<View>,
22
22
  additionalPlugins: Array<PlayerPlugin> = [],
23
23
  ) {
package/types/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import type { TransformFunction, Asset, Flow, View, PlayerPlugin } from "@player-ui/player";
1
+ import type { Asset, Flow, View, PlayerPlugin, TransformFunctions } from "@player-ui/player";
2
2
  import { Player } from "@player-ui/player";
3
3
  /**
4
4
  * A testing utility for transforms
5
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>): {
6
+ export declare function runTransform<BaseAssetType extends Asset, TransformedAssetType extends Asset = BaseAssetType>(type: string, transform: TransformFunctions, content: BaseAssetType | Flow | Array<View>, additionalPlugins?: Array<PlayerPlugin>): {
7
7
  player: Player;
8
8
  readonly current: TransformedAssetType | undefined;
9
9
  readonly controllers: import("@player-ui/player").ControllerState | undefined;