@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 +49 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/withProviders.d.ts +1 -1
- package/cjs/withProviders.js.map +1 -1
- package/mjs/index.d.ts +1 -1
- package/mjs/index.js +1 -1
- package/mjs/index.js.map +1 -1
- package/mjs/withProviders.d.ts +1 -1
- package/mjs/withProviders.js.map +1 -1
- package/package.json +20 -3
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
|
|
1
|
+
export * from './withProviders';
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,
|
|
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"]}
|
package/cjs/withProviders.d.ts
CHANGED
package/cjs/withProviders.js.map
CHANGED
|
@@ -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,
|
|
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
|
|
1
|
+
export * from './withProviders';
|
package/mjs/index.js
CHANGED
package/mjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,
|
|
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"]}
|
package/mjs/withProviders.d.ts
CHANGED
package/mjs/withProviders.js.map
CHANGED
|
@@ -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,
|
|
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
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"license": "GPL-3.0-only",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
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",
|