@player-ui/reference-assets-plugin-react 0.4.0-next.1 → 0.4.0-next.11

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.d.ts CHANGED
@@ -1,12 +1,19 @@
1
1
  import { ReactPlayerPlugin, ReactPlayer } from '@player-ui/react';
2
- import { Player } from '@player-ui/player';
3
- import { TransformedInput, TextAsset, LinkModifier, CollectionAsset, TransformedAction, InfoAsset } from '@player-ui/reference-assets-plugin';
2
+ import { ExtendedPlayerPlugin, Player } from '@player-ui/player';
3
+ import { InputAsset, TextAsset, ActionAsset, CollectionAsset, InfoAsset, TransformedInput, LinkModifier, TransformedAction } from '@player-ui/reference-assets-plugin';
4
4
  import React from 'react';
5
5
 
6
6
  /**
7
7
  * A plugin to register the base reference assets
8
8
  */
9
- declare class ReferenceAssetsPlugin implements ReactPlayerPlugin {
9
+ declare class ReferenceAssetsPlugin implements ReactPlayerPlugin, ExtendedPlayerPlugin<[
10
+ InputAsset,
11
+ TextAsset,
12
+ ActionAsset,
13
+ CollectionAsset
14
+ ], [
15
+ InfoAsset
16
+ ]> {
10
17
  name: string;
11
18
  applyReact(reactPlayer: ReactPlayer): void;
12
19
  apply(player: Player): void;
@@ -0,0 +1,118 @@
1
+ {
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
+ "name": "ActionAsset",
4
+ "type": "object",
5
+ "properties": {
6
+ "value": {
7
+ "required": false,
8
+ "node": {
9
+ "type": "string",
10
+ "title": "ActionAsset.value",
11
+ "description": "The transition value of the action in the state machine"
12
+ }
13
+ },
14
+ "label": {
15
+ "required": false,
16
+ "node": {
17
+ "type": "ref",
18
+ "ref": "AssetWrapper<AnyTextAsset>",
19
+ "genericArguments": [
20
+ {
21
+ "type": "ref",
22
+ "ref": "AnyTextAsset"
23
+ }
24
+ ],
25
+ "title": "ActionAsset.label",
26
+ "description": "A text-like asset for the action's label"
27
+ }
28
+ },
29
+ "exp": {
30
+ "required": false,
31
+ "node": {
32
+ "type": "ref",
33
+ "ref": "Expression",
34
+ "title": "ActionAsset.exp",
35
+ "description": "An optional expression to execute before transitioning"
36
+ }
37
+ },
38
+ "accessibility": {
39
+ "required": false,
40
+ "node": {
41
+ "type": "string",
42
+ "title": "ActionAsset.accessibility",
43
+ "description": "An optional string that describes the action for screen-readers"
44
+ }
45
+ },
46
+ "metaData": {
47
+ "required": false,
48
+ "node": {
49
+ "type": "object",
50
+ "properties": {
51
+ "beacon": {
52
+ "required": false,
53
+ "node": {
54
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts",
55
+ "name": "BeaconDataType",
56
+ "type": "or",
57
+ "or": [
58
+ {
59
+ "type": "string",
60
+ "title": "BeaconDataType"
61
+ },
62
+ {
63
+ "type": "record",
64
+ "keyType": {
65
+ "type": "string"
66
+ },
67
+ "valueType": {
68
+ "type": "any"
69
+ },
70
+ "title": "BeaconDataType"
71
+ }
72
+ ],
73
+ "title": "ActionAsset.metaData.beacon",
74
+ "description": "Additional data to beacon"
75
+ }
76
+ },
77
+ "skipValidation": {
78
+ "required": false,
79
+ "node": {
80
+ "type": "boolean",
81
+ "title": "ActionAsset.metaData.skipValidation",
82
+ "description": "Force transition to the next view without checking for validation"
83
+ }
84
+ }
85
+ },
86
+ "additionalProperties": false,
87
+ "title": "ActionAsset.metaData",
88
+ "description": "Additional optional data to assist with the action interactions on the page"
89
+ }
90
+ }
91
+ },
92
+ "additionalProperties": false,
93
+ "title": "ActionAsset",
94
+ "description": "User actions can be represented in several places.\nEach view typically has one or more actions that allow the user to navigate away from that view.\nIn addition, several asset types can have actions that apply to that asset only.",
95
+ "genericTokens": [
96
+ {
97
+ "symbol": "AnyTextAsset",
98
+ "constraints": {
99
+ "type": "ref",
100
+ "ref": "Asset"
101
+ },
102
+ "default": {
103
+ "type": "ref",
104
+ "ref": "Asset"
105
+ }
106
+ }
107
+ ],
108
+ "extends": {
109
+ "type": "ref",
110
+ "ref": "Asset<'action'>",
111
+ "genericArguments": [
112
+ {
113
+ "type": "string",
114
+ "const": "action"
115
+ }
116
+ ]
117
+ }
118
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
+ "name": "CollectionAsset",
4
+ "type": "object",
5
+ "properties": {
6
+ "label": {
7
+ "required": false,
8
+ "node": {
9
+ "type": "ref",
10
+ "ref": "AssetWrapper",
11
+ "title": "CollectionAsset.label",
12
+ "description": "An optional label to title the collection"
13
+ }
14
+ },
15
+ "values": {
16
+ "required": false,
17
+ "node": {
18
+ "type": "array",
19
+ "elementType": {
20
+ "type": "ref",
21
+ "ref": "AssetWrapper"
22
+ },
23
+ "title": "CollectionAsset.values",
24
+ "description": "The string value to show"
25
+ }
26
+ }
27
+ },
28
+ "additionalProperties": false,
29
+ "title": "CollectionAsset",
30
+ "extends": {
31
+ "type": "ref",
32
+ "ref": "Asset<'collection'>",
33
+ "genericArguments": [
34
+ {
35
+ "type": "string",
36
+ "const": "collection"
37
+ }
38
+ ]
39
+ }
40
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
+ "name": "InfoAsset",
4
+ "type": "object",
5
+ "properties": {
6
+ "title": {
7
+ "required": false,
8
+ "node": {
9
+ "type": "ref",
10
+ "ref": "AssetWrapper",
11
+ "title": "InfoAsset.title",
12
+ "description": "The string value to show"
13
+ }
14
+ },
15
+ "subTitle": {
16
+ "required": false,
17
+ "node": {
18
+ "type": "ref",
19
+ "ref": "AssetWrapper",
20
+ "title": "InfoAsset.subTitle",
21
+ "description": "subtitle"
22
+ }
23
+ },
24
+ "primaryInfo": {
25
+ "required": false,
26
+ "node": {
27
+ "type": "ref",
28
+ "ref": "AssetWrapper",
29
+ "title": "InfoAsset.primaryInfo",
30
+ "description": "Primary place for info"
31
+ }
32
+ },
33
+ "actions": {
34
+ "required": false,
35
+ "node": {
36
+ "type": "array",
37
+ "elementType": {
38
+ "type": "ref",
39
+ "ref": "AssetWrapper"
40
+ },
41
+ "title": "InfoAsset.actions",
42
+ "description": "List of actions to show at the bottom of the page"
43
+ }
44
+ }
45
+ },
46
+ "additionalProperties": false,
47
+ "title": "InfoAsset",
48
+ "extends": {
49
+ "type": "ref",
50
+ "ref": "Asset<'info'>",
51
+ "genericArguments": [
52
+ {
53
+ "type": "string",
54
+ "const": "info"
55
+ }
56
+ ]
57
+ }
58
+ }
@@ -0,0 +1,109 @@
1
+ {
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
+ "name": "InputAsset",
4
+ "type": "object",
5
+ "properties": {
6
+ "label": {
7
+ "required": false,
8
+ "node": {
9
+ "type": "ref",
10
+ "ref": "AssetWrapper<AnyTextAsset>",
11
+ "genericArguments": [
12
+ {
13
+ "type": "ref",
14
+ "ref": "AnyTextAsset"
15
+ }
16
+ ],
17
+ "title": "InputAsset.label",
18
+ "description": "Asset container for a field label."
19
+ }
20
+ },
21
+ "note": {
22
+ "required": false,
23
+ "node": {
24
+ "type": "ref",
25
+ "ref": "AssetWrapper<AnyTextAsset>",
26
+ "genericArguments": [
27
+ {
28
+ "type": "ref",
29
+ "ref": "AnyTextAsset"
30
+ }
31
+ ],
32
+ "title": "InputAsset.note",
33
+ "description": "Asset container for a note."
34
+ }
35
+ },
36
+ "binding": {
37
+ "required": true,
38
+ "node": {
39
+ "type": "ref",
40
+ "ref": "Binding",
41
+ "title": "InputAsset.binding",
42
+ "description": "The location in the data-model to store the data"
43
+ }
44
+ },
45
+ "metaData": {
46
+ "required": false,
47
+ "node": {
48
+ "type": "object",
49
+ "properties": {
50
+ "beacon": {
51
+ "required": false,
52
+ "node": {
53
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/beacon-plugin/dist/index.d.ts",
54
+ "name": "BeaconDataType",
55
+ "type": "or",
56
+ "or": [
57
+ {
58
+ "type": "string",
59
+ "title": "BeaconDataType"
60
+ },
61
+ {
62
+ "type": "record",
63
+ "keyType": {
64
+ "type": "string"
65
+ },
66
+ "valueType": {
67
+ "type": "any"
68
+ },
69
+ "title": "BeaconDataType"
70
+ }
71
+ ],
72
+ "title": "InputAsset.metaData.beacon",
73
+ "description": "Additional data to beacon when this input changes"
74
+ }
75
+ }
76
+ },
77
+ "additionalProperties": false,
78
+ "title": "InputAsset.metaData",
79
+ "description": "Optional additional data"
80
+ }
81
+ }
82
+ },
83
+ "additionalProperties": false,
84
+ "title": "InputAsset",
85
+ "description": "This is the most generic way of gathering data. The input is bound to a data model using the 'binding' property.\nPlayers can get field type information from the 'schema' definition, thus to decide the input controls for visual rendering.",
86
+ "genericTokens": [
87
+ {
88
+ "symbol": "AnyTextAsset",
89
+ "constraints": {
90
+ "type": "ref",
91
+ "ref": "Asset"
92
+ },
93
+ "default": {
94
+ "type": "ref",
95
+ "ref": "Asset"
96
+ }
97
+ }
98
+ ],
99
+ "extends": {
100
+ "type": "ref",
101
+ "ref": "Asset<'input'>",
102
+ "genericArguments": [
103
+ {
104
+ "type": "string",
105
+ "const": "input"
106
+ }
107
+ ]
108
+ }
109
+ }
@@ -0,0 +1,125 @@
1
+ {
2
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
3
+ "name": "TextAsset",
4
+ "type": "object",
5
+ "properties": {
6
+ "value": {
7
+ "required": true,
8
+ "node": {
9
+ "type": "string",
10
+ "title": "TextAsset.value",
11
+ "description": "The text to display"
12
+ }
13
+ },
14
+ "modifiers": {
15
+ "required": false,
16
+ "node": {
17
+ "type": "array",
18
+ "elementType": {
19
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
20
+ "name": "TextModifier",
21
+ "type": "or",
22
+ "or": [
23
+ {
24
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
25
+ "name": "BasicTextModifier",
26
+ "type": "object",
27
+ "properties": {
28
+ "type": {
29
+ "required": true,
30
+ "node": {
31
+ "type": "string",
32
+ "title": "BasicTextModifier.type",
33
+ "description": "The modifier type"
34
+ }
35
+ },
36
+ "name": {
37
+ "required": false,
38
+ "node": {
39
+ "type": "string",
40
+ "title": "BasicTextModifier.name",
41
+ "description": "Modifiers can be named when used in strings"
42
+ }
43
+ }
44
+ },
45
+ "additionalProperties": {
46
+ "type": "unknown"
47
+ },
48
+ "title": "BasicTextModifier"
49
+ },
50
+ {
51
+ "source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2498/execroot/player/node_modules/@player-ui/reference-assets-plugin/dist/index.d.ts",
52
+ "name": "LinkModifier",
53
+ "type": "object",
54
+ "properties": {
55
+ "type": {
56
+ "required": true,
57
+ "node": {
58
+ "type": "string",
59
+ "const": "link",
60
+ "title": "LinkModifier.type",
61
+ "description": "The link type denotes this as a link"
62
+ }
63
+ },
64
+ "exp": {
65
+ "required": false,
66
+ "node": {
67
+ "type": "ref",
68
+ "ref": "Expression",
69
+ "title": "LinkModifier.exp",
70
+ "description": "An optional expression to run before the link is opened"
71
+ }
72
+ },
73
+ "metaData": {
74
+ "required": true,
75
+ "node": {
76
+ "type": "object",
77
+ "properties": {
78
+ "ref": {
79
+ "required": true,
80
+ "node": {
81
+ "type": "string",
82
+ "title": "LinkModifier.metaData.ref",
83
+ "description": "The location of the link to load"
84
+ }
85
+ },
86
+ "'mime-type'": {
87
+ "required": false,
88
+ "node": {
89
+ "type": "string",
90
+ "title": "LinkModifier.metaData.'mime-type'",
91
+ "description": "Used to indicate an application specific resolver to use"
92
+ }
93
+ }
94
+ },
95
+ "additionalProperties": false,
96
+ "title": "LinkModifier.metaData",
97
+ "description": "metaData about the link's target"
98
+ }
99
+ }
100
+ },
101
+ "additionalProperties": false,
102
+ "title": "LinkModifier",
103
+ "description": "A modifier to turn the text into a link"
104
+ }
105
+ ],
106
+ "title": "TextModifier"
107
+ },
108
+ "title": "TextAsset.modifiers",
109
+ "description": "Any modifiers on the text"
110
+ }
111
+ }
112
+ },
113
+ "additionalProperties": false,
114
+ "title": "TextAsset",
115
+ "extends": {
116
+ "type": "ref",
117
+ "ref": "Asset<'text'>",
118
+ "genericArguments": [
119
+ {
120
+ "type": "string",
121
+ "const": "text"
122
+ }
123
+ ]
124
+ }
125
+ }
@@ -0,0 +1,13 @@
1
+ const InputAsset = require('./InputAsset.json')
2
+ const TextAsset = require('./TextAsset.json')
3
+ const ActionAsset = require('./ActionAsset.json')
4
+ const CollectionAsset = require('./CollectionAsset.json')
5
+ const InfoAsset = require('./InfoAsset.json')
6
+
7
+ module.exports = {
8
+ "pluginName": "reference-assets-web-plugin",
9
+ "capabilities": {
10
+ "Assets":[InputAsset,TextAsset,ActionAsset,CollectionAsset],
11
+ "Views":[InfoAsset],
12
+ }
13
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "pluginName": "reference-assets-web-plugin",
3
+ "capabilities": {
4
+ "Assets": [
5
+ "InputAsset",
6
+ "TextAsset",
7
+ "ActionAsset",
8
+ "CollectionAsset"
9
+ ],
10
+ "Views": [
11
+ "InfoAsset"
12
+ ]
13
+ }
14
+ }
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.1",
3
+ "version": "0.4.0-next.11",
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.1"
10
+ "@player-ui/react": "0.4.0-next.11"
11
11
  },
12
12
  "dependencies": {
13
- "@player-ui/reference-assets-plugin": "0.4.0-next.1",
14
- "@player-ui/partial-match-registry": "0.4.0-next.1",
15
- "@player-ui/asset-provider-plugin-react": "0.4.0-next.1",
16
- "@player-ui/beacon-plugin-react": "0.4.0-next.1",
13
+ "@player-ui/reference-assets-plugin": "0.4.0-next.11",
14
+ "@player-ui/partial-match-registry": "0.4.0-next.11",
15
+ "@player-ui/asset-provider-plugin-react": "0.4.0-next.11",
16
+ "@player-ui/beacon-plugin-react": "0.4.0-next.11",
17
17
  "clsx": "^1.1.1",
18
18
  "@chakra-ui/react": "^1.7.3",
19
19
  "@chakra-ui/icons": "^1.1.1",
@@ -60,6 +60,14 @@
60
60
  {
61
61
  "name": "Kelly Harrop",
62
62
  "url": "https://github.com/kharrop"
63
+ },
64
+ {
65
+ "name": "Alejandro Fimbres",
66
+ "url": "https://github.com/lexfm"
67
+ },
68
+ {
69
+ "name": "Rafael Campos",
70
+ "url": "https://github.com/rafbcampos"
63
71
  }
64
72
  ]
65
73
  }
package/src/plugin.tsx CHANGED
@@ -1,11 +1,21 @@
1
1
  import React from 'react';
2
2
  import type { ReactPlayer, ReactPlayerPlugin } from '@player-ui/react';
3
- import type { Player } from '@player-ui/player';
3
+ import type { Player, ExtendedPlayerPlugin } from '@player-ui/player';
4
4
  import { AssetProviderPlugin } from '@player-ui/asset-provider-plugin-react';
5
5
  import { ChakraProvider, useTheme } from '@chakra-ui/react';
6
+ import type {
7
+ InputAsset,
8
+ TextAsset,
9
+ CollectionAsset,
10
+ ActionAsset,
11
+ InfoAsset,
12
+ } from '@player-ui/reference-assets-plugin';
6
13
  import { ReferenceAssetsPlugin as ReferenceAssetsCorePlugin } from '@player-ui/reference-assets-plugin';
7
14
  import { Input, Text, Collection, Action, Info } from './assets';
8
15
 
16
+ /**
17
+ *
18
+ */
9
19
  const OptionalChakraThemeProvider = (
10
20
  props: React.PropsWithChildren<unknown>
11
21
  ) => {
@@ -22,7 +32,14 @@ const OptionalChakraThemeProvider = (
22
32
  /**
23
33
  * A plugin to register the base reference assets
24
34
  */
25
- export class ReferenceAssetsPlugin implements ReactPlayerPlugin {
35
+ export class ReferenceAssetsPlugin
36
+ implements
37
+ ReactPlayerPlugin,
38
+ ExtendedPlayerPlugin<
39
+ [InputAsset, TextAsset, ActionAsset, CollectionAsset],
40
+ [InfoAsset]
41
+ >
42
+ {
26
43
  name = 'reference-assets-web-plugin';
27
44
 
28
45
  applyReact(reactPlayer: ReactPlayer) {