@mapples/render 1.0.4 → 1.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 +3 -2
- package/dist/components/RenderProvider.d.ts +1 -0
- package/dist/components/RenderProvider.d.ts.map +1 -1
- package/dist/components/RenderProvider.js +1 -0
- package/dist/components/RenderProvider.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -126,17 +126,18 @@ The main component for rendering component trees from definitions.
|
|
|
126
126
|
|
|
127
127
|
#### `RenderProvider`
|
|
128
128
|
|
|
129
|
-
Provider component that makes registered components available to the render system.
|
|
129
|
+
Provider component that makes registered components and assets available to the render system.
|
|
130
130
|
|
|
131
131
|
**Props:**
|
|
132
132
|
|
|
133
133
|
- `components: RegisteredComponents` - Map of registered components
|
|
134
|
+
- `assets?: AnyObject` - Optional map of asset refs to values (e.g. images, fonts) for resolving `ref(type:id:name)` in component props
|
|
134
135
|
- `children: ReactNode` - Child components
|
|
135
136
|
|
|
136
137
|
**Example:**
|
|
137
138
|
|
|
138
139
|
```tsx
|
|
139
|
-
<RenderProvider components={registeredComponents}>
|
|
140
|
+
<RenderProvider components={registeredComponents} assets={assets}>
|
|
140
141
|
<App />
|
|
141
142
|
</RenderProvider>
|
|
142
143
|
```
|
|
@@ -9,6 +9,7 @@ import { RenderContextType } from '../types';
|
|
|
9
9
|
*
|
|
10
10
|
* @param {PropsWithChildren<RenderContextType>} props - The component props
|
|
11
11
|
* @param {RegisteredComponents} props.components - Map of registered components
|
|
12
|
+
* @param {AnyObject} [props.assets] - Optional map of asset refs (ref(type:id:name)) to values
|
|
12
13
|
* @param {ReactNode} props.children - Child components to render
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderProvider.d.ts","sourceRoot":"","sources":["../../src/components/RenderProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"RenderProvider.d.ts","sourceRoot":"","sources":["../../src/components/RenderProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAU5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { RenderContextProvider } from '../context';
|
|
|
8
8
|
*
|
|
9
9
|
* @param {PropsWithChildren<RenderContextType>} props - The component props
|
|
10
10
|
* @param {RegisteredComponents} props.components - Map of registered components
|
|
11
|
+
* @param {AnyObject} [props.assets] - Optional map of asset refs (ref(type:id:name)) to values
|
|
11
12
|
* @param {ReactNode} props.children - Child components to render
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderProvider.js","sourceRoot":"","sources":["../../src/components/RenderProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD
|
|
1
|
+
{"version":3,"file":"RenderProvider.js","sourceRoot":"","sources":["../../src/components/RenderProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,cAAc,GAA6C,CAAC,EAChE,UAAU,EACV,QAAQ,EACR,MAAM,GACP,EAAE,EAAE;IACH,OAAO,CACL,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CACnD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,qBAAqB,CAAC,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module @mapples/render
|
|
4
|
+
*
|
|
5
|
+
* Dynamic component rendering from JSON-like definitions. Register components,
|
|
6
|
+
* provide optional assets, and render trees from RenderComponentType with
|
|
7
|
+
* data binding and action props support.
|
|
8
|
+
*/
|
|
1
9
|
export * from './types';
|
|
2
10
|
export * from './context';
|
|
3
11
|
export * from './components';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module @mapples/render
|
|
4
|
+
*
|
|
5
|
+
* Dynamic component rendering from JSON-like definitions. Register components,
|
|
6
|
+
* provide optional assets, and render trees from RenderComponentType with
|
|
7
|
+
* data binding and action props support.
|
|
8
|
+
*/
|
|
1
9
|
export * from './types';
|
|
2
10
|
export * from './context';
|
|
3
11
|
export * from './components';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -99,10 +99,11 @@ export type RenderProps = Pick<RenderDom, 'root' | 'state'> & {
|
|
|
99
99
|
};
|
|
100
100
|
/**
|
|
101
101
|
* Context type for the render system.
|
|
102
|
-
* Provides access to registered components throughout the component tree.
|
|
102
|
+
* Provides access to registered components and assets throughout the component tree.
|
|
103
103
|
*
|
|
104
104
|
* @interface RenderContextType
|
|
105
105
|
* @property {RegisteredComponents} components - Map of registered components available for rendering
|
|
106
|
+
* @property {AnyObject} assets - Map of asset refs (e.g. ref(type:id:name)) to values for resolving in component props
|
|
106
107
|
*/
|
|
107
108
|
export interface RenderContextType {
|
|
108
109
|
components: RegisteredComponents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EA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CACZ;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CACxC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG;IAC5D,qBAAqB,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,oBAAoB,CAAC;IACjC,MAAM,EAAE,SAAS,CAAC;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapples/render",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"directory": "packages/@mapples/render"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"lodash": "^4.
|
|
23
|
+
"lodash": "^4.18.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": ">=18.0.0 <20.0.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/lodash": "^4.17.0",
|
|
31
31
|
"@types/react": ">=18.0.0 <20.0.0",
|
|
32
|
-
"typescript": "~
|
|
32
|
+
"typescript": "~6.0.3"
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"dist",
|