@thi.ng/hdom-canvas 4.1.38 → 4.1.39
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/index.d.ts +24 -23
- package/index.js +24 -23
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import type { HDOMImplementation, HDOMOpts } from "@thi.ng/hdom";
|
|
2
2
|
/**
|
|
3
3
|
* Special HTML5 canvas component which injects a branch-local hdom
|
|
4
|
-
* implementation for virtual SVG-like shape components / elements.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* implementation for virtual SVG-like shape components / elements. These
|
|
5
|
+
* elements are then translated into canvas draw commands during the hdom update
|
|
6
|
+
* process.
|
|
7
7
|
*
|
|
8
|
-
* The canvas component automatically adjusts its size for HDPI displays
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* The canvas component automatically adjusts its size for HDPI displays by
|
|
9
|
+
* adding CSS `width` & `height` properties and pre-scaling the drawing context
|
|
10
|
+
* accordingly before shapes are processed.
|
|
11
11
|
*
|
|
12
|
-
* Shape components are expressed in standard hiccup syntax, however
|
|
13
|
-
*
|
|
12
|
+
* Shape components are expressed in standard hiccup syntax, however with the
|
|
13
|
+
* following restrictions:
|
|
14
14
|
*
|
|
15
15
|
* - Shape component objects with life cycle methods are only partially
|
|
16
|
-
* supported, i.e. only the
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* supported, i.e. only the
|
|
17
|
+
* [`ILifecycle.render()`](https://docs.thi.ng/umbrella/hdom/interfaces/ILifecycle.html#render)
|
|
18
|
+
* &
|
|
19
|
+
* [`ILifecycle.release()`](https://docs.thi.ng/umbrella/hdom/interfaces/ILifecycle.html#release)
|
|
20
|
+
* methods are used (Note, for performance reasons `release` methods are
|
|
21
|
+
* ignored by default. If your shape tree contains stateful components which
|
|
22
|
+
* use the `release` life cycle method, you'll need to explicitly enable the
|
|
21
23
|
* canvas component's `__release` attribute by setting it to `true`).
|
|
22
|
-
* - Currently no event listeners can be assigned to shapes (ignored),
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* - Currently no event listeners can be assigned to shapes (ignored), though
|
|
25
|
+
* this is planned for a future version. The canvas element itself can of
|
|
26
|
+
* course have event handlers as usual.
|
|
25
27
|
*
|
|
26
|
-
* All embedded component functions receive the user context object just
|
|
27
|
-
*
|
|
28
|
+
* All embedded component functions receive the user context object just like
|
|
29
|
+
* normal hdom components.
|
|
28
30
|
*
|
|
29
31
|
* For best performance, it's recommended to ensure all resulting shapes
|
|
30
|
-
* elements are provided in already normalized hiccup format (i.e.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* of all children.
|
|
32
|
+
* elements are provided in already normalized hiccup format (i.e. `[tag,
|
|
33
|
+
* {attribs}, ...]`). That way the `__normalize: false` control attribute can be
|
|
34
|
+
* added either to the canvas component itself (or to individual shapes /
|
|
35
|
+
* groups), and if present, will skip normalization of all children.
|
|
35
36
|
*
|
|
36
37
|
* @param _ - hdom user context (ignored)
|
|
37
38
|
* @param attribs - canvas attribs
|
package/index.js
CHANGED
|
@@ -9,37 +9,38 @@ const FN = "function";
|
|
|
9
9
|
const STR = "string";
|
|
10
10
|
/**
|
|
11
11
|
* Special HTML5 canvas component which injects a branch-local hdom
|
|
12
|
-
* implementation for virtual SVG-like shape components / elements.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* implementation for virtual SVG-like shape components / elements. These
|
|
13
|
+
* elements are then translated into canvas draw commands during the hdom update
|
|
14
|
+
* process.
|
|
15
15
|
*
|
|
16
|
-
* The canvas component automatically adjusts its size for HDPI displays
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* The canvas component automatically adjusts its size for HDPI displays by
|
|
17
|
+
* adding CSS `width` & `height` properties and pre-scaling the drawing context
|
|
18
|
+
* accordingly before shapes are processed.
|
|
19
19
|
*
|
|
20
|
-
* Shape components are expressed in standard hiccup syntax, however
|
|
21
|
-
*
|
|
20
|
+
* Shape components are expressed in standard hiccup syntax, however with the
|
|
21
|
+
* following restrictions:
|
|
22
22
|
*
|
|
23
23
|
* - Shape component objects with life cycle methods are only partially
|
|
24
|
-
* supported, i.e. only the
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* supported, i.e. only the
|
|
25
|
+
* [`ILifecycle.render()`](https://docs.thi.ng/umbrella/hdom/interfaces/ILifecycle.html#render)
|
|
26
|
+
* &
|
|
27
|
+
* [`ILifecycle.release()`](https://docs.thi.ng/umbrella/hdom/interfaces/ILifecycle.html#release)
|
|
28
|
+
* methods are used (Note, for performance reasons `release` methods are
|
|
29
|
+
* ignored by default. If your shape tree contains stateful components which
|
|
30
|
+
* use the `release` life cycle method, you'll need to explicitly enable the
|
|
29
31
|
* canvas component's `__release` attribute by setting it to `true`).
|
|
30
|
-
* - Currently no event listeners can be assigned to shapes (ignored),
|
|
31
|
-
*
|
|
32
|
-
*
|
|
32
|
+
* - Currently no event listeners can be assigned to shapes (ignored), though
|
|
33
|
+
* this is planned for a future version. The canvas element itself can of
|
|
34
|
+
* course have event handlers as usual.
|
|
33
35
|
*
|
|
34
|
-
* All embedded component functions receive the user context object just
|
|
35
|
-
*
|
|
36
|
+
* All embedded component functions receive the user context object just like
|
|
37
|
+
* normal hdom components.
|
|
36
38
|
*
|
|
37
39
|
* For best performance, it's recommended to ensure all resulting shapes
|
|
38
|
-
* elements are provided in already normalized hiccup format (i.e.
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* of all children.
|
|
40
|
+
* elements are provided in already normalized hiccup format (i.e. `[tag,
|
|
41
|
+
* {attribs}, ...]`). That way the `__normalize: false` control attribute can be
|
|
42
|
+
* added either to the canvas component itself (or to individual shapes /
|
|
43
|
+
* groups), and if present, will skip normalization of all children.
|
|
43
44
|
*
|
|
44
45
|
* @param _ - hdom user context (ignored)
|
|
45
46
|
* @param attribs - canvas attribs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/hdom-canvas",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.39",
|
|
4
4
|
"description": "@thi.ng/hdom component wrapper for declarative canvas scenegraphs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"test": "testament test"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@thi.ng/api": "^8.6.
|
|
40
|
+
"@thi.ng/api": "^8.6.1",
|
|
41
41
|
"@thi.ng/checks": "^3.3.5",
|
|
42
|
-
"@thi.ng/diff": "^5.1.
|
|
42
|
+
"@thi.ng/diff": "^5.1.20",
|
|
43
43
|
"@thi.ng/errors": "^2.2.6",
|
|
44
|
-
"@thi.ng/hdom": "^9.2.
|
|
45
|
-
"@thi.ng/hiccup-canvas": "^2.1.
|
|
44
|
+
"@thi.ng/hdom": "^9.2.1",
|
|
45
|
+
"@thi.ng/hiccup-canvas": "^2.1.39"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@microsoft/api-extractor": "^7.33.7",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
],
|
|
93
93
|
"year": 2018
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
96
96
|
}
|