@player-ui/reference-assets-plugin-react 0.4.0-next.11 → 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 +4 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +4 -14
- package/dist/xlr/ActionAsset.json +2 -2
- package/dist/xlr/CollectionAsset.json +1 -1
- 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 +9 -6
- package/dist/xlr/manifest.json +9 -1
- package/package.json +6 -6
- package/src/assets/info/Info.tsx +5 -29
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 :
|
|
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
|
-
}, (
|
|
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, CollectionAsset, InfoAsset, 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
|
/**
|
|
@@ -87,6 +87,6 @@ declare const useAction: (props: TransformedAction) => {
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
/** The info view type is used to show information to the user */
|
|
90
|
-
declare const Info: (props:
|
|
90
|
+
declare const Info: (props: InfoAssetTransform) => JSX.Element;
|
|
91
91
|
|
|
92
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 :
|
|
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
|
-
}, (
|
|
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/
|
|
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/
|
|
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/
|
|
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": {
|
package/dist/xlr/InfoAsset.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
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": {
|
package/dist/xlr/InputAsset.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
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/
|
|
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": [
|
package/dist/xlr/TextAsset.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
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/
|
|
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/
|
|
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/
|
|
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": {
|
package/dist/xlr/manifest.js
CHANGED
|
@@ -4,10 +4,13 @@ const ActionAsset = require('./ActionAsset.json')
|
|
|
4
4
|
const CollectionAsset = require('./CollectionAsset.json')
|
|
5
5
|
const InfoAsset = require('./InfoAsset.json')
|
|
6
6
|
|
|
7
|
-
module.exports = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
module.exports = {
|
|
8
|
+
"pluginName": "reference-assets-web-plugin",
|
|
9
|
+
"capabilities": {
|
|
10
|
+
"Assets":[InputAsset,TextAsset,ActionAsset,CollectionAsset],
|
|
11
11
|
"Views":[InfoAsset],
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
},
|
|
13
|
+
"customPrimitives": [
|
|
14
|
+
'Expression','Asset','Binding','AssetWrapper','Schema.DataType','ExpressionHandler'
|
|
15
|
+
]
|
|
16
|
+
}
|
package/dist/xlr/manifest.json
CHANGED
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.
|
|
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
|
+
"@player-ui/react": "0.4.0-next.12"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@player-ui/reference-assets-plugin": "0.4.0-next.
|
|
14
|
-
"@player-ui/partial-match-registry": "0.4.0-next.
|
|
15
|
-
"@player-ui/asset-provider-plugin-react": "0.4.0-next.
|
|
16
|
-
"@player-ui/beacon-plugin-react": "0.4.0-next.
|
|
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",
|
package/src/assets/info/Info.tsx
CHANGED
|
@@ -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:
|
|
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>
|