@player-ui/reference-assets-plugin-react 0.4.0-next.10 → 0.4.0-next.12

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.cjs.js CHANGED
@@ -395,17 +395,7 @@ var __spreadValues = (a, b) => {
395
395
  return a;
396
396
  };
397
397
  const Info = (props) => {
398
- var _a, _b;
399
- const segmentedActions = React__default["default"].useMemo(() => {
400
- var _a2, _b2;
401
- if (!((_a2 = props.actions) == null ? void 0 : _a2.length)) {
402
- return;
403
- }
404
- return (_b2 = props.actions) == null ? void 0 : _b2.reduce((memo, next) => {
405
- memo[referenceAssetsPlugin.isBackAction(next.asset) ? "prev" : "next"].push(next);
406
- return memo;
407
- }, { prev: [], next: [] });
408
- }, [props.actions]);
398
+ var _a, _b, _c, _d;
409
399
  return /* @__PURE__ */ React__default["default"].createElement(react.Box, {
410
400
  minW: { base: void 0, md: "md" }
411
401
  }, /* @__PURE__ */ React__default["default"].createElement(react.Stack, {
@@ -418,15 +408,15 @@ const Info = (props) => {
418
408
  as: "h3"
419
409
  }, /* @__PURE__ */ React__default["default"].createElement(react$1.ReactAsset, __spreadValues({}, props.subTitle))), /* @__PURE__ */ React__default["default"].createElement(react.Box, null, props.primaryInfo && /* @__PURE__ */ React__default["default"].createElement(react$1.ReactAsset, __spreadValues({}, props.primaryInfo))), /* @__PURE__ */ React__default["default"].createElement(react.Stack, {
420
410
  gap: "4"
421
- }, segmentedActions && /* @__PURE__ */ React__default["default"].createElement(react.Divider, null), /* @__PURE__ */ React__default["default"].createElement(react.HStack, {
411
+ }, (props == null ? void 0 : props.segmentedActions) && /* @__PURE__ */ React__default["default"].createElement(react.Divider, null), /* @__PURE__ */ React__default["default"].createElement(react.HStack, {
422
412
  justifyContent: "space-between"
423
413
  }, /* @__PURE__ */ React__default["default"].createElement(react.ButtonGroup, {
424
414
  spacing: "6"
425
- }, (_a = segmentedActions == null ? void 0 : segmentedActions.prev) == null ? void 0 : _a.map((a) => /* @__PURE__ */ React__default["default"].createElement(react$1.ReactAsset, __spreadValues({
415
+ }, (_b = (_a = props == null ? void 0 : props.segmentedActions) == null ? void 0 : _a.prev) == null ? void 0 : _b.map((a) => /* @__PURE__ */ React__default["default"].createElement(react$1.ReactAsset, __spreadValues({
426
416
  key: a.asset.id
427
417
  }, a)))), /* @__PURE__ */ React__default["default"].createElement(react.ButtonGroup, {
428
418
  spacing: "6"
429
- }, (_b = segmentedActions == null ? void 0 : segmentedActions.next) == null ? void 0 : _b.map((a) => /* @__PURE__ */ React__default["default"].createElement(react$1.ReactAsset, __spreadValues({
419
+ }, (_d = (_c = props == null ? void 0 : props.segmentedActions) == null ? void 0 : _c.next) == null ? void 0 : _d.map((a) => /* @__PURE__ */ React__default["default"].createElement(react$1.ReactAsset, __spreadValues({
430
420
  key: a.asset.id
431
421
  }, a))))))));
432
422
  };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ReactPlayerPlugin, ReactPlayer } from '@player-ui/react';
2
2
  import { ExtendedPlayerPlugin, Player } from '@player-ui/player';
3
- import { InputAsset, TextAsset, ActionAsset, InfoAsset, CollectionAsset, TransformedInput, LinkModifier, TransformedAction } from '@player-ui/reference-assets-plugin';
3
+ import { InputAsset, TextAsset, ActionAsset, CollectionAsset, InfoAsset, TransformedInput, LinkModifier, TransformedAction, InfoAssetTransform } from '@player-ui/reference-assets-plugin';
4
4
  import React from 'react';
5
5
 
6
6
  /**
@@ -10,8 +10,9 @@ declare class ReferenceAssetsPlugin implements ReactPlayerPlugin, ExtendedPlayer
10
10
  InputAsset,
11
11
  TextAsset,
12
12
  ActionAsset,
13
- InfoAsset,
14
13
  CollectionAsset
14
+ ], [
15
+ InfoAsset
15
16
  ]> {
16
17
  name: string;
17
18
  applyReact(reactPlayer: ReactPlayer): void;
@@ -86,6 +87,6 @@ declare const useAction: (props: TransformedAction) => {
86
87
  };
87
88
 
88
89
  /** The info view type is used to show information to the user */
89
- declare const Info: (props: InfoAsset) => JSX.Element;
90
+ declare const Info: (props: InfoAssetTransform) => JSX.Element;
90
91
 
91
92
  export { Action, Collection, Info, Input, InputHookConfig, ReferenceAssetsPlugin, Text, TextModifierContext, TextModifierContextType, getConfig, getLinkModifier, useAction, useInputAsset, useInputBeacon, useText };
package/dist/index.esm.js CHANGED
@@ -386,17 +386,7 @@ var __spreadValues = (a, b) => {
386
386
  return a;
387
387
  };
388
388
  const Info = (props) => {
389
- var _a, _b;
390
- const segmentedActions = React.useMemo(() => {
391
- var _a2, _b2;
392
- if (!((_a2 = props.actions) == null ? void 0 : _a2.length)) {
393
- return;
394
- }
395
- return (_b2 = props.actions) == null ? void 0 : _b2.reduce((memo, next) => {
396
- memo[isBackAction(next.asset) ? "prev" : "next"].push(next);
397
- return memo;
398
- }, { prev: [], next: [] });
399
- }, [props.actions]);
389
+ var _a, _b, _c, _d;
400
390
  return /* @__PURE__ */ React.createElement(Box, {
401
391
  minW: { base: void 0, md: "md" }
402
392
  }, /* @__PURE__ */ React.createElement(Stack, {
@@ -409,15 +399,15 @@ const Info = (props) => {
409
399
  as: "h3"
410
400
  }, /* @__PURE__ */ React.createElement(ReactAsset, __spreadValues({}, props.subTitle))), /* @__PURE__ */ React.createElement(Box, null, props.primaryInfo && /* @__PURE__ */ React.createElement(ReactAsset, __spreadValues({}, props.primaryInfo))), /* @__PURE__ */ React.createElement(Stack, {
411
401
  gap: "4"
412
- }, segmentedActions && /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(HStack, {
402
+ }, (props == null ? void 0 : props.segmentedActions) && /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(HStack, {
413
403
  justifyContent: "space-between"
414
404
  }, /* @__PURE__ */ React.createElement(ButtonGroup, {
415
405
  spacing: "6"
416
- }, (_a = segmentedActions == null ? void 0 : segmentedActions.prev) == null ? void 0 : _a.map((a) => /* @__PURE__ */ React.createElement(ReactAsset, __spreadValues({
406
+ }, (_b = (_a = props == null ? void 0 : props.segmentedActions) == null ? void 0 : _a.prev) == null ? void 0 : _b.map((a) => /* @__PURE__ */ React.createElement(ReactAsset, __spreadValues({
417
407
  key: a.asset.id
418
408
  }, a)))), /* @__PURE__ */ React.createElement(ButtonGroup, {
419
409
  spacing: "6"
420
- }, (_b = segmentedActions == null ? void 0 : segmentedActions.next) == null ? void 0 : _b.map((a) => /* @__PURE__ */ React.createElement(ReactAsset, __spreadValues({
410
+ }, (_d = (_c = props == null ? void 0 : props.segmentedActions) == null ? void 0 : _c.next) == null ? void 0 : _d.map((a) => /* @__PURE__ */ React.createElement(ReactAsset, __spreadValues({
421
411
  key: a.asset.id
422
412
  }, a))))))));
423
413
  };
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
3
  "name": "ActionAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -51,7 +51,7 @@
51
51
  "beacon": {
52
52
  "required": false,
53
53
  "node": {
54
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts",
54
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts",
55
55
  "name": "BeaconDataType",
56
56
  "type": "or",
57
57
  "or": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
3
  "name": "CollectionAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
3
  "name": "InfoAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
3
  "name": "InputAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -50,7 +50,7 @@
50
50
  "beacon": {
51
51
  "required": false,
52
52
  "node": {
53
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts",
53
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts",
54
54
  "name": "BeaconDataType",
55
55
  "type": "or",
56
56
  "or": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
3
  "name": "TextAsset",
4
4
  "type": "object",
5
5
  "properties": {
@@ -16,12 +16,12 @@
16
16
  "node": {
17
17
  "type": "array",
18
18
  "elementType": {
19
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
19
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
20
20
  "name": "TextModifier",
21
21
  "type": "or",
22
22
  "or": [
23
23
  {
24
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
24
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
25
25
  "name": "BasicTextModifier",
26
26
  "type": "object",
27
27
  "properties": {
@@ -48,7 +48,7 @@
48
48
  "title": "BasicTextModifier"
49
49
  },
50
50
  {
51
- "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2442/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
51
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2768/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
52
52
  "name": "LinkModifier",
53
53
  "type": "object",
54
54
  "properties": {
@@ -1,12 +1,16 @@
1
1
  const InputAsset = require('./InputAsset.json')
2
2
  const TextAsset = require('./TextAsset.json')
3
3
  const ActionAsset = require('./ActionAsset.json')
4
- const InfoAsset = require('./InfoAsset.json')
5
4
  const CollectionAsset = require('./CollectionAsset.json')
5
+ const InfoAsset = require('./InfoAsset.json')
6
6
 
7
- module.exports = {
8
- "pluginName": "reference-assets-web-plugin",
9
- "capabilities": {
10
- "Assets":[InputAsset,TextAsset,ActionAsset,InfoAsset,CollectionAsset],
11
- }
12
- }
7
+ module.exports = {
8
+ "pluginName": "reference-assets-web-plugin",
9
+ "capabilities": {
10
+ "Assets":[InputAsset,TextAsset,ActionAsset,CollectionAsset],
11
+ "Views":[InfoAsset],
12
+ },
13
+ "customPrimitives": [
14
+ 'Expression','Asset','Binding','AssetWrapper','Schema.DataType','ExpressionHandler'
15
+ ]
16
+ }
@@ -5,8 +5,18 @@
5
5
  "InputAsset",
6
6
  "TextAsset",
7
7
  "ActionAsset",
8
- "InfoAsset",
9
8
  "CollectionAsset"
9
+ ],
10
+ "Views": [
11
+ "InfoAsset"
10
12
  ]
11
- }
13
+ },
14
+ "customPrimitives": [
15
+ "Expression",
16
+ "Asset",
17
+ "Binding",
18
+ "AssetWrapper",
19
+ "Schema.DataType",
20
+ "ExpressionHandler"
21
+ ]
12
22
  }
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@player-ui/reference-assets-plugin-react",
3
- "version": "0.4.0-next.10",
3
+ "version": "0.4.0-next.12",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
7
7
  },
8
8
  "peerDependencies": {
9
9
  "@types/node": "^16.11.12",
10
- "@player-ui/react": "0.4.0-next.10"
10
+ "@player-ui/react": "0.4.0-next.12"
11
11
  },
12
12
  "dependencies": {
13
- "@player-ui/reference-assets-plugin": "0.4.0-next.10",
14
- "@player-ui/partial-match-registry": "0.4.0-next.10",
15
- "@player-ui/asset-provider-plugin-react": "0.4.0-next.10",
16
- "@player-ui/beacon-plugin-react": "0.4.0-next.10",
13
+ "@player-ui/reference-assets-plugin": "0.4.0-next.12",
14
+ "@player-ui/partial-match-registry": "0.4.0-next.12",
15
+ "@player-ui/asset-provider-plugin-react": "0.4.0-next.12",
16
+ "@player-ui/beacon-plugin-react": "0.4.0-next.12",
17
17
  "clsx": "^1.1.1",
18
18
  "@chakra-ui/react": "^1.7.3",
19
19
  "@chakra-ui/icons": "^1.1.1",
@@ -1,9 +1,5 @@
1
1
  import React from 'react';
2
- import type {
3
- ActionAsset,
4
- InfoAsset,
5
- } from '@player-ui/reference-assets-plugin';
6
- import { isBackAction } from '@player-ui/reference-assets-plugin';
2
+ import type { InfoAssetTransform } from '@player-ui/reference-assets-plugin';
7
3
  import { ReactAsset } from '@player-ui/react';
8
4
  import {
9
5
  ButtonGroup,
@@ -13,29 +9,9 @@ import {
13
9
  Stack,
14
10
  HStack,
15
11
  } from '@chakra-ui/react';
16
- import type { AssetWrapper } from '@player-ui/react';
17
12
 
18
13
  /** The info view type is used to show information to the user */
19
- export const Info = (props: InfoAsset) => {
20
- const segmentedActions = React.useMemo(() => {
21
- if (!props.actions?.length) {
22
- return;
23
- }
24
-
25
- return props.actions?.reduce(
26
- (memo, next) => {
27
- memo[isBackAction(next.asset as ActionAsset) ? 'prev' : 'next'].push(
28
- next as AssetWrapper<ActionAsset>
29
- );
30
- return memo;
31
- },
32
- { prev: [], next: [] } as {
33
- prev: Array<AssetWrapper<ActionAsset>>;
34
- next: Array<AssetWrapper<ActionAsset>>;
35
- }
36
- );
37
- }, [props.actions]);
38
-
14
+ export const Info = (props: InfoAssetTransform) => {
39
15
  return (
40
16
  <Box minW={{ base: undefined, md: 'md' }}>
41
17
  <Stack gap="10">
@@ -51,15 +27,15 @@ export const Info = (props: InfoAsset) => {
51
27
  )}
52
28
  <Box>{props.primaryInfo && <ReactAsset {...props.primaryInfo} />}</Box>
53
29
  <Stack gap="4">
54
- {segmentedActions && <Divider />}
30
+ {props?.segmentedActions && <Divider />}
55
31
  <HStack justifyContent="space-between">
56
32
  <ButtonGroup spacing="6">
57
- {segmentedActions?.prev?.map((a) => (
33
+ {props?.segmentedActions?.prev?.map((a) => (
58
34
  <ReactAsset key={a.asset.id} {...a} />
59
35
  ))}
60
36
  </ButtonGroup>
61
37
  <ButtonGroup spacing="6">
62
- {segmentedActions?.next?.map((a) => (
38
+ {props?.segmentedActions?.next?.map((a) => (
63
39
  <ReactAsset key={a.asset.id} {...a} />
64
40
  ))}
65
41
  </ButtonGroup>
package/src/plugin.tsx CHANGED
@@ -36,7 +36,8 @@ export class ReferenceAssetsPlugin
36
36
  implements
37
37
  ReactPlayerPlugin,
38
38
  ExtendedPlayerPlugin<
39
- [InputAsset, TextAsset, ActionAsset, InfoAsset, CollectionAsset]
39
+ [InputAsset, TextAsset, ActionAsset, CollectionAsset],
40
+ [InfoAsset]
40
41
  >
41
42
  {
42
43
  name = 'reference-assets-web-plugin';