@w3ux/factories 2.0.2 → 2.1.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,49 @@
1
+ # Factories
2
+
3
+ A collection of general purpose TypeScript factories
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @w3ux/factories
9
+ ```
10
+
11
+ or
12
+
13
+ ```bash
14
+ yarn add @w3ux/factories
15
+ ```
16
+
17
+ or
18
+
19
+ ```bash
20
+ pnpm add @w3ux/factories
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```typescript
26
+ import { /* your imports */ } from '@w3ux/factories'
27
+ ```
28
+
29
+ ## Documentation
30
+
31
+ For comprehensive documentation and examples, visit the [w3ux documentation](https://w3ux.org/library/factories/overview).
32
+
33
+ ## Keywords
34
+
35
+ `w3ux`, `polkadot`, `web3`, `factories`, `typescript`, `patterns`
36
+
37
+ ## Repository
38
+
39
+ - **Source**: [GitHub](https://github.com/w3ux/w3ux-library)
40
+ - **Package**: [npm](https://www.npmjs.com/package/@w3ux/factories)
41
+ - **Issues**: [GitHub Issues](https://github.com/w3ux/w3ux-library/issues)
42
+
43
+ ## License
44
+
45
+ This package is licensed under the GPL-3.0-only.
46
+
47
+ ---
48
+
49
+ Part of the [w3ux library](https://github.com/w3ux/w3ux-library) - A collection of packages for building Web3 applications.
package/cjs/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./withProviders";
1
+ export * from './withProviders';
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,kDAAgC","file":"index.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nexport * from \"./withProviders\";\n"]}
1
+ {"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,kDAA+B","file":"index.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nexport * from './withProviders'\n"]}
@@ -1,3 +1,3 @@
1
- import type { FC } from "react";
1
+ import type { FC } from 'react';
2
2
  export type Provider<T> = FC<T> | [FC<T>, T];
3
3
  export declare const withProviders: (providers: Provider<any>[], Wrapped: FC) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/withProviders.tsx"],"names":[],"mappings":";;;;AAYO,MAAM,aAAa,GAAG,CAAC,SAA0B,EAAE,OAAW,EAAE,EAAE,CACvE,SAAS,CAAC,WAAW,CACnB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACZ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,OAAO,uBAAC,QAAQ,oBAAK,IAAI,CAAC,CAAC,CAAC,cAAG,GAAG,IAAY,CAAC;IACjD,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC;IACtB,OAAO,uBAAC,QAAQ,cAAE,GAAG,GAAY,CAAC;AACpC,CAAC,EACD,uBAAC,OAAO,KAAG,CACZ,CAAC;AAXS,QAAA,aAAa,iBAWtB","file":"withProviders.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nimport type { FC } from \"react\";\n\n// `providers` accepts standalone functional components or an array of a functional component and its props.\nexport type Provider<T> = FC<T> | [FC<T>, T];\n\n// A higher-order component that wraps a specified React component (Wrapped) with multiple context\n// providers. Each provider can either be a standalone component or a component with specified\n// props. The first provider in the array becomes the outermost wrapper in the rendered output.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const withProviders = (providers: Provider<any>[], Wrapped: FC) =>\n providers.reduceRight(\n (acc, prov) => {\n if (Array.isArray(prov)) {\n const Provider = prov[0];\n return <Provider {...prov[1]}>{acc}</Provider>;\n }\n const Provider = prov;\n return <Provider>{acc}</Provider>;\n },\n <Wrapped />\n );\n"]}
1
+ {"version":3,"sources":["../src/withProviders.tsx"],"names":[],"mappings":";;;;AAYO,MAAM,aAAa,GAAG,CAAC,SAA0B,EAAE,OAAW,EAAE,EAAE,CACvE,SAAS,CAAC,WAAW,CACnB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACZ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACxB,OAAO,uBAAC,QAAQ,oBAAK,IAAI,CAAC,CAAC,CAAC,cAAG,GAAG,IAAY,CAAA;IAChD,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAA;IACrB,OAAO,uBAAC,QAAQ,cAAE,GAAG,GAAY,CAAA;AACnC,CAAC,EACD,uBAAC,OAAO,KAAG,CACZ,CAAA;AAXU,QAAA,aAAa,iBAWvB","file":"withProviders.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nimport type { FC } from 'react'\n\n// `providers` accepts standalone functional components or an array of a functional component and its props.\nexport type Provider<T> = FC<T> | [FC<T>, T]\n\n// A higher-order component that wraps a specified React component (Wrapped) with multiple context\n// providers. Each provider can either be a standalone component or a component with specified\n// props. The first provider in the array becomes the outermost wrapper in the rendered output.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const withProviders = (providers: Provider<any>[], Wrapped: FC) =>\n providers.reduceRight(\n (acc, prov) => {\n if (Array.isArray(prov)) {\n const Provider = prov[0]\n return <Provider {...prov[1]}>{acc}</Provider>\n }\n const Provider = prov\n return <Provider>{acc}</Provider>\n },\n <Wrapped />\n )\n"]}
package/mjs/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./withProviders";
1
+ export * from './withProviders';
package/mjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./withProviders";
1
+ export * from './withProviders';
2
2
 
3
3
  //# sourceMappingURL=index.js.map
4
4
 
package/mjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,CAAC","file":"index.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nexport * from \"./withProviders\";\n"]}
1
+ {"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,CAAA","file":"index.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nexport * from './withProviders'\n"]}
@@ -1,3 +1,3 @@
1
- import type { FC } from "react";
1
+ import type { FC } from 'react';
2
2
  export type Provider<T> = FC<T> | [FC<T>, T];
3
3
  export declare const withProviders: (providers: Provider<any>[], Wrapped: FC) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/withProviders.tsx"],"names":[],"mappings":";AAYA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAA0B,EAAE,OAAW,EAAE,EAAE,CACvE,SAAS,CAAC,WAAW,CACnB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACZ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,OAAO,KAAC,QAAQ,OAAK,IAAI,CAAC,CAAC,CAAC,YAAG,GAAG,GAAY,CAAC;IACjD,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC;IACtB,OAAO,KAAC,QAAQ,cAAE,GAAG,GAAY,CAAC;AACpC,CAAC,EACD,KAAC,OAAO,KAAG,CACZ,CAAC","file":"withProviders.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nimport type { FC } from \"react\";\n\n// `providers` accepts standalone functional components or an array of a functional component and its props.\nexport type Provider<T> = FC<T> | [FC<T>, T];\n\n// A higher-order component that wraps a specified React component (Wrapped) with multiple context\n// providers. Each provider can either be a standalone component or a component with specified\n// props. The first provider in the array becomes the outermost wrapper in the rendered output.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const withProviders = (providers: Provider<any>[], Wrapped: FC) =>\n providers.reduceRight(\n (acc, prov) => {\n if (Array.isArray(prov)) {\n const Provider = prov[0];\n return <Provider {...prov[1]}>{acc}</Provider>;\n }\n const Provider = prov;\n return <Provider>{acc}</Provider>;\n },\n <Wrapped />\n );\n"]}
1
+ {"version":3,"sources":["../src/withProviders.tsx"],"names":[],"mappings":";AAYA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAA0B,EAAE,OAAW,EAAE,EAAE,CACvE,SAAS,CAAC,WAAW,CACnB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACZ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACxB,OAAO,KAAC,QAAQ,OAAK,IAAI,CAAC,CAAC,CAAC,YAAG,GAAG,GAAY,CAAA;IAChD,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAA;IACrB,OAAO,KAAC,QAAQ,cAAE,GAAG,GAAY,CAAA;AACnC,CAAC,EACD,KAAC,OAAO,KAAG,CACZ,CAAA","file":"withProviders.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nimport type { FC } from 'react'\n\n// `providers` accepts standalone functional components or an array of a functional component and its props.\nexport type Provider<T> = FC<T> | [FC<T>, T]\n\n// A higher-order component that wraps a specified React component (Wrapped) with multiple context\n// providers. Each provider can either be a standalone component or a component with specified\n// props. The first provider in the array becomes the outermost wrapper in the rendered output.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const withProviders = (providers: Provider<any>[], Wrapped: FC) =>\n providers.reduceRight(\n (acc, prov) => {\n if (Array.isArray(prov)) {\n const Provider = prov[0]\n return <Provider {...prov[1]}>{acc}</Provider>\n }\n const Provider = prov\n return <Provider>{acc}</Provider>\n },\n <Wrapped />\n )\n"]}
package/package.json CHANGED
@@ -1,9 +1,26 @@
1
1
  {
2
2
  "name": "@w3ux/factories",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "license": "GPL-3.0-only",
5
- "main": "cjs/index.js",
6
- "module": "mjs/index.js",
5
+ "type": "module",
6
+ "description": "A collection of general purpose TypeScript factories",
7
+ "keywords": [
8
+ "w3ux",
9
+ "polkadot",
10
+ "web3",
11
+ "factories",
12
+ "typescript",
13
+ "patterns"
14
+ ],
15
+ "homepage": "https://w3ux.org/library/factories/overview",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/w3ux/w3ux-library.git",
19
+ "directory": "library/factories"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/w3ux/w3ux-library/issues"
23
+ },
7
24
  "exports": {
8
25
  ".": {
9
26
  "import": "./mjs/index.js",