@devtools-ui/list 0.0.2--canary.11.588

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.
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ List: () => List,
34
+ ListComponent: () => ListComponent
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
37
+
38
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/components/ListComponent.tsx
39
+ var import_react = __toESM(require("react"));
40
+ var import_react2 = require("@chakra-ui/react");
41
+ var import_react3 = require("@player-ui/react");
42
+ var ListComponent = (props) => {
43
+ return props.metaData?.ordered ? /* @__PURE__ */ import_react.default.createElement(import_react2.UnorderedList, null, props.values && props.values.map(({ asset }) => /* @__PURE__ */ import_react.default.createElement(import_react2.ListItem, { key: asset.id }, /* @__PURE__ */ import_react.default.createElement(import_react3.ReactAsset, { ...asset })))) : /* @__PURE__ */ import_react.default.createElement(import_react2.OrderedList, null, props.values && props.values.map(({ asset }) => /* @__PURE__ */ import_react.default.createElement(import_react2.ListItem, { key: asset.id }, /* @__PURE__ */ import_react.default.createElement(import_react3.ReactAsset, { ...asset }))));
44
+ };
45
+
46
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/dsl/List.tsx
47
+ var import_react4 = __toESM(require("react"));
48
+ var import_dsl = require("@player-tools/dsl");
49
+ var import_text = require("@devtools-ui/text");
50
+ var import_collection = require("@devtools-ui/collection");
51
+ var List = (props) => /* @__PURE__ */ import_react4.default.createElement(import_dsl.Asset, { type: "list", ...props });
52
+ var CollectionComp = (props) => {
53
+ return /* @__PURE__ */ import_react4.default.createElement(import_collection.Collection, null, /* @__PURE__ */ import_react4.default.createElement(import_collection.Collection.Values, null, props.children));
54
+ };
55
+ List.Values = (0, import_dsl.createSlot)({
56
+ name: "values",
57
+ TextComp: import_text.Text,
58
+ CollectionComp,
59
+ isArray: true,
60
+ wrapInAsset: true
61
+ });
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ List,
65
+ ListComponent
66
+ });
67
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/index.ts","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/components/ListComponent.tsx","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/dsl/List.tsx"],"sourcesContent":["export * from \"./types\";\nexport * from \"./components\";\nexport * from \"./dsl\";\n","import React from \"react\";\nimport { ListItem, OrderedList, UnorderedList } from \"@chakra-ui/react\";\nimport { ListAsset } from \"../types\";\nimport { ReactAsset } from \"@player-ui/react\";\n\nexport const ListComponent = (props: ListAsset) => {\n return props.metaData?.ordered ? (\n <UnorderedList>\n {props.values &&\n props.values.map(({ asset }) => (\n <ListItem key={asset.id}>\n <ReactAsset {...asset} />\n </ListItem>\n ))}\n </UnorderedList>\n ) : (\n <OrderedList>\n {props.values &&\n props.values.map(({ asset }) => (\n <ListItem key={asset.id}>\n <ReactAsset {...asset} />\n </ListItem>\n ))}\n </OrderedList>\n );\n};\n","import React from \"react\";\nimport { AssetPropsWithChildren, Asset, createSlot } from \"@player-tools/dsl\";\nimport { Text } from \"@devtools-ui/text\";\nimport type { Asset as AssetType } from \"@player-ui/player\";\nimport { Collection } from \"@devtools-ui/collection\";\nimport { ListAsset } from \"../types\";\n\nexport const List = (props: AssetPropsWithChildren<ListAsset>) => (\n <Asset type={\"list\"} {...props}></Asset>\n);\n\nconst CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {\n return (\n <Collection>\n <Collection.Values>{props.children}</Collection.Values>\n </Collection>\n );\n};\n\nList.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;AAClB,IAAAA,gBAAqD;AAErD,IAAAA,gBAA2B;AAEpB,IAAM,gBAAgB,CAAC,UAAqB;AACjD,SAAO,MAAM,UAAU,UACrB,6BAAAC,QAAA,cAAC,mCACE,MAAM,UACL,MAAM,OAAO,IAAI,CAAC,EAAE,MAAM,MACxB,6BAAAA,QAAA,cAAC,0BAAS,KAAK,MAAM,MACnB,6BAAAA,QAAA,cAAC,4BAAY,GAAG,OAAO,CACzB,CACD,CACL,IAEA,6BAAAA,QAAA,cAAC,iCACE,MAAM,UACL,MAAM,OAAO,IAAI,CAAC,EAAE,MAAM,MACxB,6BAAAA,QAAA,cAAC,0BAAS,KAAK,MAAM,MACnB,6BAAAA,QAAA,cAAC,4BAAY,GAAG,OAAO,CACzB,CACD,CACL;AAEJ;;;ACzBA,IAAAC,gBAAkB;AAClB,iBAA0D;AAC1D,kBAAqB;AAErB,wBAA2B;AAGpB,IAAM,OAAO,CAAC,UACnB,8BAAAC,QAAA,cAAC,oBAAM,MAAM,QAAS,GAAG,OAAO;AAGlC,IAAM,iBAAiB,CAAC,UAA6C;AACnE,SACE,8BAAAA,QAAA,cAAC,oCACC,8BAAAA,QAAA,cAAC,6BAAW,QAAX,MAAmB,MAAM,QAAS,CACrC;AAEJ;AAEA,KAAK,aAAS,uBAAW;AAAA,EACvB,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACf,CAAC;","names":["import_react","React","import_react","React"]}
@@ -0,0 +1,29 @@
1
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/components/ListComponent.tsx
2
+ import React from "react";
3
+ import { ListItem, OrderedList, UnorderedList } from "@chakra-ui/react";
4
+ import { ReactAsset } from "@player-ui/react";
5
+ var ListComponent = (props) => {
6
+ return props.metaData?.ordered ? /* @__PURE__ */ React.createElement(UnorderedList, null, props.values && props.values.map(({ asset }) => /* @__PURE__ */ React.createElement(ListItem, { key: asset.id }, /* @__PURE__ */ React.createElement(ReactAsset, { ...asset })))) : /* @__PURE__ */ React.createElement(OrderedList, null, props.values && props.values.map(({ asset }) => /* @__PURE__ */ React.createElement(ListItem, { key: asset.id }, /* @__PURE__ */ React.createElement(ReactAsset, { ...asset }))));
7
+ };
8
+
9
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/dsl/List.tsx
10
+ import React2 from "react";
11
+ import { Asset, createSlot } from "@player-tools/dsl";
12
+ import { Text } from "@devtools-ui/text";
13
+ import { Collection } from "@devtools-ui/collection";
14
+ var List = (props) => /* @__PURE__ */ React2.createElement(Asset, { type: "list", ...props });
15
+ var CollectionComp = (props) => {
16
+ return /* @__PURE__ */ React2.createElement(Collection, null, /* @__PURE__ */ React2.createElement(Collection.Values, null, props.children));
17
+ };
18
+ List.Values = createSlot({
19
+ name: "values",
20
+ TextComp: Text,
21
+ CollectionComp,
22
+ isArray: true,
23
+ wrapInAsset: true
24
+ });
25
+ export {
26
+ List,
27
+ ListComponent
28
+ };
29
+ //# sourceMappingURL=index.mjs.map
package/dist/index.mjs ADDED
@@ -0,0 +1,29 @@
1
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/components/ListComponent.tsx
2
+ import React from "react";
3
+ import { ListItem, OrderedList, UnorderedList } from "@chakra-ui/react";
4
+ import { ReactAsset } from "@player-ui/react";
5
+ var ListComponent = (props) => {
6
+ return props.metaData?.ordered ? /* @__PURE__ */ React.createElement(UnorderedList, null, props.values && props.values.map(({ asset }) => /* @__PURE__ */ React.createElement(ListItem, { key: asset.id }, /* @__PURE__ */ React.createElement(ReactAsset, { ...asset })))) : /* @__PURE__ */ React.createElement(OrderedList, null, props.values && props.values.map(({ asset }) => /* @__PURE__ */ React.createElement(ListItem, { key: asset.id }, /* @__PURE__ */ React.createElement(ReactAsset, { ...asset }))));
7
+ };
8
+
9
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/dsl/List.tsx
10
+ import React2 from "react";
11
+ import { Asset, createSlot } from "@player-tools/dsl";
12
+ import { Text } from "@devtools-ui/text";
13
+ import { Collection } from "@devtools-ui/collection";
14
+ var List = (props) => /* @__PURE__ */ React2.createElement(Asset, { type: "list", ...props });
15
+ var CollectionComp = (props) => {
16
+ return /* @__PURE__ */ React2.createElement(Collection, null, /* @__PURE__ */ React2.createElement(Collection.Values, null, props.children));
17
+ };
18
+ List.Values = createSlot({
19
+ name: "values",
20
+ TextComp: Text,
21
+ CollectionComp,
22
+ isArray: true,
23
+ wrapInAsset: true
24
+ });
25
+ export {
26
+ List,
27
+ ListComponent
28
+ };
29
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/components/ListComponent.tsx","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/list/src/dsl/List.tsx"],"sourcesContent":["import React from \"react\";\nimport { ListItem, OrderedList, UnorderedList } from \"@chakra-ui/react\";\nimport { ListAsset } from \"../types\";\nimport { ReactAsset } from \"@player-ui/react\";\n\nexport const ListComponent = (props: ListAsset) => {\n return props.metaData?.ordered ? (\n <UnorderedList>\n {props.values &&\n props.values.map(({ asset }) => (\n <ListItem key={asset.id}>\n <ReactAsset {...asset} />\n </ListItem>\n ))}\n </UnorderedList>\n ) : (\n <OrderedList>\n {props.values &&\n props.values.map(({ asset }) => (\n <ListItem key={asset.id}>\n <ReactAsset {...asset} />\n </ListItem>\n ))}\n </OrderedList>\n );\n};\n","import React from \"react\";\nimport { AssetPropsWithChildren, Asset, createSlot } from \"@player-tools/dsl\";\nimport { Text } from \"@devtools-ui/text\";\nimport type { Asset as AssetType } from \"@player-ui/player\";\nimport { Collection } from \"@devtools-ui/collection\";\nimport { ListAsset } from \"../types\";\n\nexport const List = (props: AssetPropsWithChildren<ListAsset>) => (\n <Asset type={\"list\"} {...props}></Asset>\n);\n\nconst CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {\n return (\n <Collection>\n <Collection.Values>{props.children}</Collection.Values>\n </Collection>\n );\n};\n\nList.Values = createSlot({\n name: \"values\",\n TextComp: Text,\n CollectionComp,\n isArray: true,\n wrapInAsset: true,\n});\n"],"mappings":";AAAA,OAAO,WAAW;AAClB,SAAS,UAAU,aAAa,qBAAqB;AAErD,SAAS,kBAAkB;AAEpB,IAAM,gBAAgB,CAAC,UAAqB;AACjD,SAAO,MAAM,UAAU,UACrB,oCAAC,qBACE,MAAM,UACL,MAAM,OAAO,IAAI,CAAC,EAAE,MAAM,MACxB,oCAAC,YAAS,KAAK,MAAM,MACnB,oCAAC,cAAY,GAAG,OAAO,CACzB,CACD,CACL,IAEA,oCAAC,mBACE,MAAM,UACL,MAAM,OAAO,IAAI,CAAC,EAAE,MAAM,MACxB,oCAAC,YAAS,KAAK,MAAM,MACnB,oCAAC,cAAY,GAAG,OAAO,CACzB,CACD,CACL;AAEJ;;;ACzBA,OAAOA,YAAW;AAClB,SAAiC,OAAO,kBAAkB;AAC1D,SAAS,YAAY;AAErB,SAAS,kBAAkB;AAGpB,IAAM,OAAO,CAAC,UACnB,gBAAAA,OAAA,cAAC,SAAM,MAAM,QAAS,GAAG,OAAO;AAGlC,IAAM,iBAAiB,CAAC,UAA6C;AACnE,SACE,gBAAAA,OAAA,cAAC,kBACC,gBAAAA,OAAA,cAAC,WAAW,QAAX,MAAmB,MAAM,QAAS,CACrC;AAEJ;AAEA,KAAK,SAAS,WAAW;AAAA,EACvB,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACf,CAAC;","names":["React"]}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@devtools-ui/list",
3
+ "version": "0.0.2--canary.11.588",
4
+ "main": "dist/cjs/index.cjs",
5
+ "dependencies": {
6
+ "@devtools-ui/collection": "0.0.2--canary.11.588",
7
+ "@devtools-ui/text": "0.0.2--canary.11.588",
8
+ "@chakra-ui/react": "^2.8.2",
9
+ "@emotion/react": "^11.11.4",
10
+ "@emotion/styled": "^11.11.0",
11
+ "@player-tools/dsl": "0.5.2--canary.87.2261",
12
+ "@player-ui/types": "0.7.1",
13
+ "@player-ui/player": "0.7.1",
14
+ "@types/react": "^18.2.51",
15
+ "framer-motion": "^11.0.8",
16
+ "react": "^18.2.0",
17
+ "dlv": "^1.1.3",
18
+ "@player-ui/react": "^0.7.1",
19
+ "eslint-plugin-storybook": "^0.8.0",
20
+ "tslib": "^2.6.2"
21
+ },
22
+ "module": "dist/index.legacy-esm.js",
23
+ "types": "types/index.d.ts",
24
+ "sideEffects": false,
25
+ "exports": {
26
+ "./package.json": "./package.json",
27
+ ".": {
28
+ "types": "./types/index.d.ts",
29
+ "import": "./dist/index.mjs",
30
+ "default": "./dist/cjs/index.cjs"
31
+ }
32
+ },
33
+ "files": [
34
+ "dist",
35
+ "src",
36
+ "types"
37
+ ],
38
+ "peerDependencies": {}
39
+ }
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import { ListItem, OrderedList, UnorderedList } from "@chakra-ui/react";
3
+ import { ListAsset } from "../types";
4
+ import { ReactAsset } from "@player-ui/react";
5
+
6
+ export const ListComponent = (props: ListAsset) => {
7
+ return props.metaData?.ordered ? (
8
+ <UnorderedList>
9
+ {props.values &&
10
+ props.values.map(({ asset }) => (
11
+ <ListItem key={asset.id}>
12
+ <ReactAsset {...asset} />
13
+ </ListItem>
14
+ ))}
15
+ </UnorderedList>
16
+ ) : (
17
+ <OrderedList>
18
+ {props.values &&
19
+ props.values.map(({ asset }) => (
20
+ <ListItem key={asset.id}>
21
+ <ReactAsset {...asset} />
22
+ </ListItem>
23
+ ))}
24
+ </OrderedList>
25
+ );
26
+ };
@@ -0,0 +1 @@
1
+ export { ListComponent } from "./ListComponent";
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import { AssetPropsWithChildren, Asset, createSlot } from "@player-tools/dsl";
3
+ import { Text } from "@devtools-ui/text";
4
+ import type { Asset as AssetType } from "@player-ui/player";
5
+ import { Collection } from "@devtools-ui/collection";
6
+ import { ListAsset } from "../types";
7
+
8
+ export const List = (props: AssetPropsWithChildren<ListAsset>) => (
9
+ <Asset type={"list"} {...props}></Asset>
10
+ );
11
+
12
+ const CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {
13
+ return (
14
+ <Collection>
15
+ <Collection.Values>{props.children}</Collection.Values>
16
+ </Collection>
17
+ );
18
+ };
19
+
20
+ List.Values = createSlot({
21
+ name: "values",
22
+ TextComp: Text,
23
+ CollectionComp,
24
+ isArray: true,
25
+ wrapInAsset: true,
26
+ });
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { describe, expect, test } from "vitest";
3
+ import { Asset, render } from "@player-tools/dsl";
4
+ import { List } from "../List";
5
+
6
+ describe("DSL: List", () => {
7
+ test("with value", async () => {
8
+ const rendered = await render(
9
+ <List>
10
+ <List.Values>
11
+ <Asset type="text">
12
+ <property name="value">Test 1</property>
13
+ </Asset>
14
+ <Asset type="text">
15
+ <property name="value">Test 2</property>
16
+ </Asset>
17
+ </List.Values>
18
+ </List>
19
+ );
20
+
21
+ expect(rendered.jsonValue).toStrictEqual({
22
+ id: "root",
23
+ type: "list",
24
+ values: [
25
+ {
26
+ asset: {
27
+ id: "values-0",
28
+ type: "text",
29
+ value: "Test 1",
30
+ },
31
+ },
32
+ {
33
+ asset: {
34
+ id: "values-1",
35
+ type: "text",
36
+ value: "Test 2",
37
+ },
38
+ },
39
+ ],
40
+ });
41
+ });
42
+ });
@@ -0,0 +1 @@
1
+ export { List } from "./List";
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export * from "./components";
3
+ export * from "./dsl";
@@ -0,0 +1,12 @@
1
+ import { Asset, AssetWrapper } from "@player-ui/types";
2
+
3
+ export interface ListAsset extends Asset<"list"> {
4
+ /** List items */
5
+ values?: Array<AssetWrapper>;
6
+
7
+ /** List metadata */
8
+ metaData?: {
9
+ /** Ordered list */
10
+ ordered?: boolean;
11
+ };
12
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ListAsset } from "../types";
3
+ export declare const ListComponent: (props: ListAsset) => React.JSX.Element;
4
+ //# sourceMappingURL=ListComponent.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { ListComponent } from "./ListComponent";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { AssetPropsWithChildren } from "@player-tools/dsl";
3
+ import { ListAsset } from "../types";
4
+ export declare const List: {
5
+ (props: AssetPropsWithChildren<ListAsset>): React.JSX.Element;
6
+ Values: (props: {
7
+ children?: React.ReactNode;
8
+ }) => React.JSX.Element;
9
+ };
10
+ //# sourceMappingURL=List.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { List } from "./List";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * from "./types";
2
+ export * from "./components";
3
+ export * from "./dsl";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { Asset, AssetWrapper } from "@player-ui/types";
2
+ export interface ListAsset extends Asset<"list"> {
3
+ /** List items */
4
+ values?: Array<AssetWrapper>;
5
+ /** List metadata */
6
+ metaData?: {
7
+ /** Ordered list */
8
+ ordered?: boolean;
9
+ };
10
+ }
11
+ //# sourceMappingURL=index.d.ts.map