@devtools-ui/navigation 0.4.0 → 0.4.1-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/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # @devtools-ui/navigation
2
+
3
+ ## Overview
4
+
5
+ `@devtools-ui/navigation` is a component package designed to be leveraged by a [Player-UI assets plugin](https://player-ui.github.io/next/plugins).
6
+
7
+ It provides a `Navigation` component that can be used to group actions in a row.
8
+
9
+ ## Installation
10
+
11
+ To install `@devtools-ui/navigation`, you can use pnpm or yarn:
12
+
13
+ ```sh
14
+ pnpm i @devtools-ui/navigation
15
+ ```
16
+
17
+ or
18
+
19
+ ```sh
20
+ yarn add @devtools-ui/navigation
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ You can leverage this asset through the `@devtools-ui/plugin`:
26
+
27
+ ```ts
28
+ import { Navigation } from "@devtools-ui/plugin";
29
+
30
+ // and use it to define your Player-UI content:
31
+ myFlow = {
32
+ id: "my_flow",
33
+ views: [
34
+ <MyView>
35
+ <Navigation>
36
+ <Navigation.Values>
37
+ <Asset type="action" />
38
+ <Asset type="action" />
39
+ </Navigation.Values>
40
+ </Navigation>
41
+ </MyView>,
42
+ ],
43
+ };
44
+ ```
45
+
46
+ For more information on how to author Player-UI content using DSL, please check our [Player-UI docs](https://player-ui.github.io/next/dsl#tsxjsx-content-authoring-player-dsl).
47
+
48
+ Or, your can leverage this asset in your own plugin:
49
+
50
+ ```ts
51
+ // TransformPlugin.ts
52
+ import type { Player, PlayerPlugin } from "@player-ui/player";
53
+ import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
54
+ import { navigationTransform } from "@devtools-ui/navigation";
55
+
56
+ export class TransformsPlugin implements PlayerPlugin {
57
+ name = "my-plugin-transforms";
58
+
59
+ apply(player: Player) {
60
+ player.registerPlugin(
61
+ new AssetTransformPlugin([[{ type: "navigation" }, navigationTransform]])
62
+ );
63
+ }
64
+ }
65
+ ```
66
+
67
+ ```ts
68
+ // AssetRegistryPlugin.ts
69
+ import React from "react";
70
+ import type { Player } from "@player-ui/player";
71
+ import type {
72
+ ExtendedPlayerPlugin,
73
+ ReactPlayer,
74
+ ReactPlayerPlugin,
75
+ } from "@player-ui/react";
76
+ import { AssetProviderPlugin } from "@player-ui/asset-provider-plugin-react";
77
+ import { TransformsPlugin } from "./TransformPlugin";
78
+ import { NavigationAsset, NavigationComponent } from "@devtools-ui/navigation";
79
+
80
+ export class AssetsRegistryPlugin
81
+ implements ReactPlayerPlugin, ExtendedPlayerPlugin<[NavigationAsset]>
82
+ {
83
+ name = "my-plugin";
84
+
85
+ applyReact(reactPlayer: ReactPlayer) {
86
+ reactPlayer.registerPlugin(
87
+ new AssetProviderPlugin([["navigation", NavigationComponent]])
88
+ );
89
+ }
90
+
91
+ apply(player: Player) {
92
+ player.registerPlugin(new TransformsPlugin());
93
+ }
94
+ }
95
+ ```
96
+
97
+ ## Contributing
98
+
99
+ We welcome contributions to `@devtools-ui/navigation`!
@@ -46,17 +46,17 @@ var NavigationComponent = (props) => {
46
46
 
47
47
  // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx
48
48
  var import_react4 = __toESM(require("react"));
49
- var import_dsl = require("@player-tools/dsl");
49
+ var import_react_dsl = require("@player-lang/react-dsl");
50
50
  var import_text = require("@devtools-ui/text");
51
51
  var import_collection = require("@devtools-ui/collection");
52
52
  var Navigation = (props) => {
53
53
  const { children, ...rest } = props;
54
- return /* @__PURE__ */ import_react4.default.createElement(import_dsl.Asset, { type: "navigation", ...rest }, children);
54
+ return /* @__PURE__ */ import_react4.default.createElement(import_react_dsl.Asset, { type: "navigation", ...rest }, children);
55
55
  };
56
56
  var CollectionComp = (props) => {
57
57
  return /* @__PURE__ */ import_react4.default.createElement(import_collection.Collection, null, /* @__PURE__ */ import_react4.default.createElement(import_collection.Collection.Values, null, props.children));
58
58
  };
59
- Navigation.Values = (0, import_dsl.createSlot)({
59
+ Navigation.Values = (0, import_react_dsl.createSlot)({
60
60
  name: "values",
61
61
  TextComp: import_text.Text,
62
62
  CollectionComp,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/index.ts","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/components/NavigationComponent.tsx","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx"],"sourcesContent":["export * from \"./types\";\nexport * from \"./components\";\nexport * from \"./dsl\";\n","import React from \"react\";\nimport { NavigationAsset } from \"../types\";\nimport { Stack } from \"@chakra-ui/react\";\nimport { ReactAsset } from \"@player-ui/react\";\n\nexport const NavigationComponent = (props: NavigationAsset) => {\n const { values, ...rest } = props;\n\n return (\n <Stack direction=\"row\" spacing={4} {...rest}>\n {values?.map((a) => (\n <ReactAsset w=\"100%\" key={a.asset.id} {...a} />\n ))}\n </Stack>\n );\n};\n","import React from \"react\";\nimport { AssetPropsWithChildren, Asset, createSlot } from \"@player-tools/dsl\";\nimport type { Asset as AssetType } from \"@player-ui/player\";\nimport { Text } from \"@devtools-ui/text\";\nimport { Collection } from \"@devtools-ui/collection\";\nimport { NavigationAsset } from \"../types\";\n\nexport const Navigation = (props: AssetPropsWithChildren<NavigationAsset>) => {\n const { children, ...rest } = props;\n return (\n <Asset type=\"navigation\" {...rest}>\n {children}\n </Asset>\n );\n};\n\nconst CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {\n return (\n <Collection>\n <Collection.Values>{props.children}</Collection.Values>\n </Collection>\n );\n};\n\nNavigation.Values = createSlot({\n name: \"values\",\n TextComp: Text,\n CollectionComp,\n isArray: true,\n wrapInAsset: true,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAElB,IAAAA,gBAAsB;AACtB,IAAAA,gBAA2B;AAEpB,IAAM,sBAAsB,CAAC,UAA2B;AAC7D,QAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAE5B,SACE,6BAAAC,QAAA,cAAC,uBAAM,WAAU,OAAM,SAAS,GAAI,GAAG,QACpC,QAAQ,IAAI,CAAC,MACZ,6BAAAA,QAAA,cAAC,4BAAW,GAAE,QAAO,KAAK,EAAE,MAAM,IAAK,GAAG,GAAG,CAC9C,CACH;AAEJ;;;ACfA,IAAAC,gBAAkB;AAClB,iBAA0D;AAE1D,kBAAqB;AACrB,wBAA2B;AAGpB,IAAM,aAAa,CAAC,UAAmD;AAC5E,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI;AAC9B,SACE,8BAAAC,QAAA,cAAC,oBAAM,MAAK,cAAc,GAAG,QAC1B,QACH;AAEJ;AAEA,IAAM,iBAAiB,CAAC,UAA6C;AACnE,SACE,8BAAAA,QAAA,cAAC,oCACC,8BAAAA,QAAA,cAAC,6BAAW,QAAX,MAAmB,MAAM,QAAS,CACrC;AAEJ;AAEA,WAAW,aAAS,uBAAW;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACf,CAAC;","names":["import_react","React","import_react","React"]}
1
+ {"version":3,"sources":["../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/index.ts","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/components/NavigationComponent.tsx","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx"],"sourcesContent":["export * from \"./types\";\nexport * from \"./components\";\nexport * from \"./dsl\";\n","import React from \"react\";\nimport { NavigationAsset } from \"../types\";\nimport { Stack } from \"@chakra-ui/react\";\nimport { ReactAsset } from \"@player-ui/react\";\n\nexport const NavigationComponent = (props: NavigationAsset) => {\n const { values, ...rest } = props;\n\n return (\n <Stack direction=\"row\" spacing={4} {...rest}>\n {values?.map((a) => (\n <ReactAsset w=\"100%\" key={a.asset.id} {...a} />\n ))}\n </Stack>\n );\n};\n","import React from \"react\";\nimport {\n AssetPropsWithChildren,\n Asset,\n createSlot,\n} from \"@player-lang/react-dsl\";\nimport type { Asset as AssetType } from \"@player-ui/player\";\nimport { Text } from \"@devtools-ui/text\";\nimport { Collection } from \"@devtools-ui/collection\";\nimport { NavigationAsset } from \"../types\";\n\nexport const Navigation = (props: AssetPropsWithChildren<NavigationAsset>) => {\n const { children, ...rest } = props;\n return (\n <Asset type=\"navigation\" {...rest}>\n {children}\n </Asset>\n );\n};\n\nconst CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {\n return (\n <Collection>\n <Collection.Values>{props.children}</Collection.Values>\n </Collection>\n );\n};\n\nNavigation.Values = createSlot({\n name: \"values\",\n TextComp: Text,\n CollectionComp,\n isArray: true,\n wrapInAsset: true,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAElB,IAAAA,gBAAsB;AACtB,IAAAA,gBAA2B;AAEpB,IAAM,sBAAsB,CAAC,UAA2B;AAC7D,QAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAE5B,SACE,6BAAAC,QAAA,cAAC,uBAAM,WAAU,OAAM,SAAS,GAAI,GAAG,QACpC,QAAQ,IAAI,CAAC,MACZ,6BAAAA,QAAA,cAAC,4BAAW,GAAE,QAAO,KAAK,EAAE,MAAM,IAAK,GAAG,GAAG,CAC9C,CACH;AAEJ;;;ACfA,IAAAC,gBAAkB;AAClB,uBAIO;AAEP,kBAAqB;AACrB,wBAA2B;AAGpB,IAAM,aAAa,CAAC,UAAmD;AAC5E,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI;AAC9B,SACE,8BAAAC,QAAA,cAAC,0BAAM,MAAK,cAAc,GAAG,QAC1B,QACH;AAEJ;AAEA,IAAM,iBAAiB,CAAC,UAA6C;AACnE,SACE,8BAAAA,QAAA,cAAC,oCACC,8BAAAA,QAAA,cAAC,6BAAW,QAAX,MAAmB,MAAM,QAAS,CACrC;AAEJ;AAEA,WAAW,aAAS,6BAAW;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACf,CAAC;","names":["import_react","React","import_react","React"]}
@@ -9,7 +9,10 @@ var NavigationComponent = (props) => {
9
9
 
10
10
  // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx
11
11
  import React2 from "react";
12
- import { Asset, createSlot } from "@player-tools/dsl";
12
+ import {
13
+ Asset,
14
+ createSlot
15
+ } from "@player-lang/react-dsl";
13
16
  import { Text } from "@devtools-ui/text";
14
17
  import { Collection } from "@devtools-ui/collection";
15
18
  var Navigation = (props) => {
package/dist/index.mjs CHANGED
@@ -9,7 +9,10 @@ var NavigationComponent = (props) => {
9
9
 
10
10
  // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx
11
11
  import React2 from "react";
12
- import { Asset, createSlot } from "@player-tools/dsl";
12
+ import {
13
+ Asset,
14
+ createSlot
15
+ } from "@player-lang/react-dsl";
13
16
  import { Text } from "@devtools-ui/text";
14
17
  import { Collection } from "@devtools-ui/collection";
15
18
  var Navigation = (props) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/components/NavigationComponent.tsx","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx"],"sourcesContent":["import React from \"react\";\nimport { NavigationAsset } from \"../types\";\nimport { Stack } from \"@chakra-ui/react\";\nimport { ReactAsset } from \"@player-ui/react\";\n\nexport const NavigationComponent = (props: NavigationAsset) => {\n const { values, ...rest } = props;\n\n return (\n <Stack direction=\"row\" spacing={4} {...rest}>\n {values?.map((a) => (\n <ReactAsset w=\"100%\" key={a.asset.id} {...a} />\n ))}\n </Stack>\n );\n};\n","import React from \"react\";\nimport { AssetPropsWithChildren, Asset, createSlot } from \"@player-tools/dsl\";\nimport type { Asset as AssetType } from \"@player-ui/player\";\nimport { Text } from \"@devtools-ui/text\";\nimport { Collection } from \"@devtools-ui/collection\";\nimport { NavigationAsset } from \"../types\";\n\nexport const Navigation = (props: AssetPropsWithChildren<NavigationAsset>) => {\n const { children, ...rest } = props;\n return (\n <Asset type=\"navigation\" {...rest}>\n {children}\n </Asset>\n );\n};\n\nconst CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {\n return (\n <Collection>\n <Collection.Values>{props.children}</Collection.Values>\n </Collection>\n );\n};\n\nNavigation.Values = createSlot({\n name: \"values\",\n TextComp: Text,\n CollectionComp,\n isArray: true,\n wrapInAsset: true,\n});\n"],"mappings":";AAAA,OAAO,WAAW;AAElB,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAEpB,IAAM,sBAAsB,CAAC,UAA2B;AAC7D,QAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAE5B,SACE,oCAAC,SAAM,WAAU,OAAM,SAAS,GAAI,GAAG,QACpC,QAAQ,IAAI,CAAC,MACZ,oCAAC,cAAW,GAAE,QAAO,KAAK,EAAE,MAAM,IAAK,GAAG,GAAG,CAC9C,CACH;AAEJ;;;ACfA,OAAOA,YAAW;AAClB,SAAiC,OAAO,kBAAkB;AAE1D,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAGpB,IAAM,aAAa,CAAC,UAAmD;AAC5E,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI;AAC9B,SACE,gBAAAA,OAAA,cAAC,SAAM,MAAK,cAAc,GAAG,QAC1B,QACH;AAEJ;AAEA,IAAM,iBAAiB,CAAC,UAA6C;AACnE,SACE,gBAAAA,OAAA,cAAC,kBACC,gBAAAA,OAAA,cAAC,WAAW,QAAX,MAAmB,MAAM,QAAS,CACrC;AAEJ;AAEA,WAAW,SAAS,WAAW;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACf,CAAC;","names":["React"]}
1
+ {"version":3,"sources":["../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/components/NavigationComponent.tsx","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx"],"sourcesContent":["import React from \"react\";\nimport { NavigationAsset } from \"../types\";\nimport { Stack } from \"@chakra-ui/react\";\nimport { ReactAsset } from \"@player-ui/react\";\n\nexport const NavigationComponent = (props: NavigationAsset) => {\n const { values, ...rest } = props;\n\n return (\n <Stack direction=\"row\" spacing={4} {...rest}>\n {values?.map((a) => (\n <ReactAsset w=\"100%\" key={a.asset.id} {...a} />\n ))}\n </Stack>\n );\n};\n","import React from \"react\";\nimport {\n AssetPropsWithChildren,\n Asset,\n createSlot,\n} from \"@player-lang/react-dsl\";\nimport type { Asset as AssetType } from \"@player-ui/player\";\nimport { Text } from \"@devtools-ui/text\";\nimport { Collection } from \"@devtools-ui/collection\";\nimport { NavigationAsset } from \"../types\";\n\nexport const Navigation = (props: AssetPropsWithChildren<NavigationAsset>) => {\n const { children, ...rest } = props;\n return (\n <Asset type=\"navigation\" {...rest}>\n {children}\n </Asset>\n );\n};\n\nconst CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {\n return (\n <Collection>\n <Collection.Values>{props.children}</Collection.Values>\n </Collection>\n );\n};\n\nNavigation.Values = createSlot({\n name: \"values\",\n TextComp: Text,\n CollectionComp,\n isArray: true,\n wrapInAsset: true,\n});\n"],"mappings":";AAAA,OAAO,WAAW;AAElB,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAEpB,IAAM,sBAAsB,CAAC,UAA2B;AAC7D,QAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAE5B,SACE,oCAAC,SAAM,WAAU,OAAM,SAAS,GAAI,GAAG,QACpC,QAAQ,IAAI,CAAC,MACZ,oCAAC,cAAW,GAAE,QAAO,KAAK,EAAE,MAAM,IAAK,GAAG,GAAG,CAC9C,CACH;AAEJ;;;ACfA,OAAOA,YAAW;AAClB;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAGpB,IAAM,aAAa,CAAC,UAAmD;AAC5E,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI;AAC9B,SACE,gBAAAA,OAAA,cAAC,SAAM,MAAK,cAAc,GAAG,QAC1B,QACH;AAEJ;AAEA,IAAM,iBAAiB,CAAC,UAA6C;AACnE,SACE,gBAAAA,OAAA,cAAC,kBACC,gBAAAA,OAAA,cAAC,WAAW,QAAX,MAAmB,MAAM,QAAS,CACrC;AAEJ;AAEA,WAAW,SAAS,WAAW;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACf,CAAC;","names":["React"]}
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
+ "sideEffects": false,
3
+ "files": [
4
+ "dist",
5
+ "src",
6
+ "types"
7
+ ],
2
8
  "name": "@devtools-ui/navigation",
3
- "version": "0.4.0",
9
+ "version": "0.4.1-next.0",
4
10
  "main": "dist/cjs/index.cjs",
5
11
  "dependencies": {
6
- "@devtools-ui/collection": "0.4.0",
7
- "@devtools-ui/text": "0.4.0",
12
+ "@devtools-ui/collection": "0.4.1-next.0",
13
+ "@devtools-ui/text": "0.4.1-next.0",
8
14
  "@chakra-ui/react": "^2.8.2",
9
15
  "@emotion/react": "^11.11.4",
10
16
  "@emotion/styled": "^11.11.0",
@@ -16,7 +22,6 @@
16
22
  },
17
23
  "module": "dist/index.legacy-esm.js",
18
24
  "types": "types/index.d.ts",
19
- "sideEffects": false,
20
25
  "exports": {
21
26
  "./package.json": "./package.json",
22
27
  "./dist/index.css": "./dist/index.css",
@@ -26,15 +31,10 @@
26
31
  "default": "./dist/cjs/index.cjs"
27
32
  }
28
33
  },
29
- "files": [
30
- "dist",
31
- "src",
32
- "types"
33
- ],
34
34
  "peerDependencies": {
35
- "@player-tools/dsl": "0.7.0-next.3",
36
- "@player-ui/types": "0.9.1-next.0",
37
- "@player-ui/player": "0.9.1-next.0",
38
- "@player-ui/react": "0.9.1-next.0"
35
+ "@player-lang/react-dsl": "1.0.1",
36
+ "@player-ui/types": "0.15.5",
37
+ "@player-ui/player": "0.15.5",
38
+ "@player-ui/react": "0.15.5"
39
39
  }
40
40
  }
@@ -1,5 +1,9 @@
1
1
  import React from "react";
2
- import { AssetPropsWithChildren, Asset, createSlot } from "@player-tools/dsl";
2
+ import {
3
+ AssetPropsWithChildren,
4
+ Asset,
5
+ createSlot,
6
+ } from "@player-lang/react-dsl";
3
7
  import type { Asset as AssetType } from "@player-ui/player";
4
8
  import { Text } from "@devtools-ui/text";
5
9
  import { Collection } from "@devtools-ui/collection";
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { describe, expect, test } from "vitest";
3
- import { Asset, render } from "@player-tools/dsl";
3
+ import { Asset, render } from "@player-lang/react-dsl";
4
4
  import { Navigation } from "../index";
5
5
 
6
6
  describe("DSL: Navigation", () => {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { AssetPropsWithChildren } from "@player-tools/dsl";
2
+ import { AssetPropsWithChildren } from "@player-lang/react-dsl";
3
3
  import { NavigationAsset } from "../types";
4
4
  export declare const Navigation: {
5
5
  (props: AssetPropsWithChildren<NavigationAsset>): React.JSX.Element;