@8btc/whiteboard 0.0.14 → 0.0.15
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/dist/index.js +7 -2
- package/dist/index.umd.js +7 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -691,13 +691,18 @@ class ImageNode extends BaseCanvasNode {
|
|
|
691
691
|
__privateMethod(this, _ImageNode_instances, setupEventHandlers_fn2).call(this, this.getElement());
|
|
692
692
|
}
|
|
693
693
|
createElement() {
|
|
694
|
+
const width = this.node.props.width || IMAGE.MIN_SIZE;
|
|
695
|
+
const height = this.node.props.height || IMAGE.MIN_SIZE;
|
|
694
696
|
const placeholder = document.createElement("canvas");
|
|
695
|
-
placeholder.width =
|
|
696
|
-
placeholder.height =
|
|
697
|
+
placeholder.width = width;
|
|
698
|
+
placeholder.height = height;
|
|
697
699
|
const img = new Konva.Image({
|
|
698
700
|
id: this.node.id,
|
|
699
701
|
x: this.node.props.x,
|
|
700
702
|
y: this.node.props.y,
|
|
703
|
+
width,
|
|
704
|
+
height,
|
|
705
|
+
rotation: this.node.props.rotation || 0,
|
|
701
706
|
name: `${NODE_NAMES.nodeRoot} ${NODE_NAMES.selectable} ${NODE_NAMES.image}`,
|
|
702
707
|
draggable: true,
|
|
703
708
|
image: placeholder
|
package/dist/index.umd.js
CHANGED
|
@@ -2008,13 +2008,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2008
2008
|
__privateMethod(this, _ImageNode_instances, setupEventHandlers_fn2).call(this, this.getElement());
|
|
2009
2009
|
}
|
|
2010
2010
|
createElement() {
|
|
2011
|
+
const width = this.node.props.width || IMAGE.MIN_SIZE;
|
|
2012
|
+
const height = this.node.props.height || IMAGE.MIN_SIZE;
|
|
2011
2013
|
const placeholder = document.createElement("canvas");
|
|
2012
|
-
placeholder.width =
|
|
2013
|
-
placeholder.height =
|
|
2014
|
+
placeholder.width = width;
|
|
2015
|
+
placeholder.height = height;
|
|
2014
2016
|
const img = new Konva.Image({
|
|
2015
2017
|
id: this.node.id,
|
|
2016
2018
|
x: this.node.props.x,
|
|
2017
2019
|
y: this.node.props.y,
|
|
2020
|
+
width,
|
|
2021
|
+
height,
|
|
2022
|
+
rotation: this.node.props.rotation || 0,
|
|
2018
2023
|
name: `${NODE_NAMES.nodeRoot} ${NODE_NAMES.selectable} ${NODE_NAMES.image}`,
|
|
2019
2024
|
draggable: true,
|
|
2020
2025
|
image: placeholder
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@8btc/whiteboard",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"**/*.css"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
|
-
"dev": "vite --port 6999",
|
|
23
|
+
"dev": "vite --port 6999 --host",
|
|
24
24
|
"build": "tsc -b && vite build",
|
|
25
25
|
"lint": "eslint .",
|
|
26
26
|
"preview": "vite preview",
|