@thi.ng/rdom-canvas 0.4.39 → 0.4.41
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/CHANGELOG.md +1 -1
- package/README.md +8 -11
- package/index.d.ts +9 -8
- package/index.js +7 -7
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/rdom-canvas)
|
|
6
6
|

|
|
7
|
-
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
This project is part of the
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
@@ -21,7 +21,7 @@ This project is part of the
|
|
|
21
21
|
|
|
22
22
|
## About
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
@thi.ng/rdom component wrapper for @thi.ng/hiccup-canvas and declarative canvas drawing
|
|
25
25
|
|
|
26
26
|
## Status
|
|
27
27
|
|
|
@@ -32,7 +32,7 @@ This project is part of the
|
|
|
32
32
|
## Related packages
|
|
33
33
|
|
|
34
34
|
- [@thi.ng/hiccup-canvas](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup-canvas) - Hiccup shape tree renderer for vanilla Canvas 2D contexts
|
|
35
|
-
- [@thi.ng/hiccup-svg](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup-svg) - SVG element functions for [@thi.ng/hiccup](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup) &
|
|
35
|
+
- [@thi.ng/hiccup-svg](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup-svg) - SVG element functions for [@thi.ng/hiccup](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup) & related tooling
|
|
36
36
|
- [@thi.ng/geom](https://github.com/thi-ng/umbrella/tree/develop/packages/geom) - Functional, polymorphic API for 2D geometry types & SVG generation
|
|
37
37
|
- [@thi.ng/scenegraph](https://github.com/thi-ng/umbrella/tree/develop/packages/scenegraph) - Extensible 2D/3D scene graph with [@thi.ng/hiccup-canvas](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup-canvas) support
|
|
38
38
|
|
|
@@ -52,11 +52,8 @@ ES module import:
|
|
|
52
52
|
|
|
53
53
|
For Node.js REPL:
|
|
54
54
|
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
node --experimental-repl-await
|
|
58
|
-
|
|
59
|
-
> const rdomCanvas = await import("@thi.ng/rdom-canvas");
|
|
55
|
+
```js
|
|
56
|
+
const rdomCanvas = await import("@thi.ng/rdom-canvas");
|
|
60
57
|
```
|
|
61
58
|
|
|
62
59
|
Package sizes (brotli'd, pre-treeshake): ESM: 646 bytes
|
|
@@ -93,7 +90,7 @@ TODO
|
|
|
93
90
|
|
|
94
91
|
## Authors
|
|
95
92
|
|
|
96
|
-
Karsten Schmidt
|
|
93
|
+
- [Karsten Schmidt](https://thi.ng)
|
|
97
94
|
|
|
98
95
|
If this project contributes to an academic publication, please cite it as:
|
|
99
96
|
|
|
@@ -108,4 +105,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
108
105
|
|
|
109
106
|
## License
|
|
110
107
|
|
|
111
|
-
© 2020 - 2022 Karsten Schmidt // Apache
|
|
108
|
+
© 2020 - 2022 Karsten Schmidt // Apache License 2.0
|
package/index.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ export interface CanvasOpts {
|
|
|
12
12
|
*/
|
|
13
13
|
onunmount: Fn<HTMLCanvasElement, void>;
|
|
14
14
|
/**
|
|
15
|
-
* Custom component event handler called when canvas size has changed (only
|
|
15
|
+
* Custom component event handler called when canvas size has changed (only
|
|
16
|
+
* used when canvas size is initially given as reactive value).
|
|
16
17
|
*/
|
|
17
18
|
onresize: Fn3<HTMLCanvasElement, CanvasRenderingContext2D, number[], void>;
|
|
18
19
|
/**
|
|
@@ -22,15 +23,15 @@ export interface CanvasOpts {
|
|
|
22
23
|
[id: string]: any;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
|
-
* Reactive
|
|
26
|
-
* canvas component wrapped in a {@link $sub} and
|
|
27
|
-
* canvas with each new input received from `body`.
|
|
26
|
+
* Reactive [thi.ng/hiccup-canvas](https://thi.ng/hiccup-canvas) component
|
|
27
|
+
* wrapper. Returns a canvas component wrapped in a {@link $sub} and
|
|
28
|
+
* updates/re-renders canvas with each new input received from `body`.
|
|
28
29
|
*
|
|
29
30
|
* @remarks
|
|
30
|
-
* If `size` is subscribable, the canvas is resized each time a new
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* If `size` is subscribable, the canvas is resized each time a new value is
|
|
32
|
+
* received, else will only be used to define initial canvas size. The `attribs`
|
|
33
|
+
* SHOULD not include `width`, `height`, since these will be overriden in any
|
|
34
|
+
* way by `size` arg.
|
|
34
35
|
*/
|
|
35
36
|
export declare const $canvas: (body: ISubscription<any, any[] | IToHiccup>, size: number[] | ISubscription<any, number[]>, attribs?: Partial<CanvasOpts>) => IComponent<any[] | IToHiccup>;
|
|
36
37
|
export declare class $Canvas extends Component implements IMountWithState<any[] | IToHiccup> {
|
package/index.js
CHANGED
|
@@ -9,15 +9,15 @@ import { isSubscribable } from "@thi.ng/rstream/checks";
|
|
|
9
9
|
import { reactive } from "@thi.ng/rstream/stream";
|
|
10
10
|
import { sideEffect } from "@thi.ng/transducers/side-effect";
|
|
11
11
|
/**
|
|
12
|
-
* Reactive
|
|
13
|
-
* canvas component wrapped in a {@link $sub} and
|
|
14
|
-
* canvas with each new input received from `body`.
|
|
12
|
+
* Reactive [thi.ng/hiccup-canvas](https://thi.ng/hiccup-canvas) component
|
|
13
|
+
* wrapper. Returns a canvas component wrapped in a {@link $sub} and
|
|
14
|
+
* updates/re-renders canvas with each new input received from `body`.
|
|
15
15
|
*
|
|
16
16
|
* @remarks
|
|
17
|
-
* If `size` is subscribable, the canvas is resized each time a new
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* If `size` is subscribable, the canvas is resized each time a new value is
|
|
18
|
+
* received, else will only be used to define initial canvas size. The `attribs`
|
|
19
|
+
* SHOULD not include `width`, `height`, since these will be overriden in any
|
|
20
|
+
* way by `size` arg.
|
|
21
21
|
*/
|
|
22
22
|
export const $canvas = (body, size, attribs) => $sub(body, new $Canvas(size, attribs));
|
|
23
23
|
export class $Canvas extends Component {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rdom-canvas",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.41",
|
|
4
4
|
"description": "@thi.ng/rdom component wrapper for @thi.ng/hiccup-canvas and declarative canvas drawing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/thi-ng/umbrella/tree/
|
|
13
|
+
"homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/rdom-canvas#readme",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://patreon.com/thing_umbrella"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"author": "Karsten Schmidt
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -34,22 +34,22 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/adapt-dpi": "^2.2.
|
|
38
|
-
"@thi.ng/api": "^8.
|
|
39
|
-
"@thi.ng/associative": "^6.2.
|
|
40
|
-
"@thi.ng/checks": "^3.3.
|
|
41
|
-
"@thi.ng/hiccup-canvas": "^2.1.
|
|
42
|
-
"@thi.ng/rdom": "^0.10.
|
|
43
|
-
"@thi.ng/rstream": "^7.2.
|
|
44
|
-
"@thi.ng/transducers": "^8.3.
|
|
37
|
+
"@thi.ng/adapt-dpi": "^2.2.4",
|
|
38
|
+
"@thi.ng/api": "^8.6.1",
|
|
39
|
+
"@thi.ng/associative": "^6.2.20",
|
|
40
|
+
"@thi.ng/checks": "^3.3.5",
|
|
41
|
+
"@thi.ng/hiccup-canvas": "^2.1.39",
|
|
42
|
+
"@thi.ng/rdom": "^0.10.3",
|
|
43
|
+
"@thi.ng/rstream": "^7.2.32",
|
|
44
|
+
"@thi.ng/transducers": "^8.3.27"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@microsoft/api-extractor": "^7.33.
|
|
48
|
-
"@thi.ng/testament": "^0.3.
|
|
47
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
48
|
+
"@thi.ng/testament": "^0.3.7",
|
|
49
49
|
"rimraf": "^3.0.2",
|
|
50
50
|
"tools": "^0.0.1",
|
|
51
|
-
"typedoc": "^0.23.
|
|
52
|
-
"typescript": "^4.
|
|
51
|
+
"typedoc": "^0.23.22",
|
|
52
|
+
"typescript": "^4.9.4"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"animation",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"status": "alpha",
|
|
91
91
|
"year": 2020
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
94
94
|
}
|