@canvas-harness/react 0.0.1 → 0.0.2
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.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -981,6 +981,7 @@ function CanvasSurface({
|
|
|
981
981
|
onCreateDrag,
|
|
982
982
|
arrowDefaults,
|
|
983
983
|
background,
|
|
984
|
+
selectionColor,
|
|
984
985
|
renderCustomNodeView,
|
|
985
986
|
children
|
|
986
987
|
}) {
|
|
@@ -1013,6 +1014,7 @@ function CanvasSurface({
|
|
|
1013
1014
|
width: w,
|
|
1014
1015
|
height: h,
|
|
1015
1016
|
background,
|
|
1017
|
+
selectionColor,
|
|
1016
1018
|
onOverlayChange: (ids) => setMountedIds(ids)
|
|
1017
1019
|
});
|
|
1018
1020
|
r.start();
|
|
@@ -1026,6 +1028,9 @@ function CanvasSurface({
|
|
|
1026
1028
|
react.useEffect(() => {
|
|
1027
1029
|
rendererRef.current?.setBackground(background);
|
|
1028
1030
|
}, [background]);
|
|
1031
|
+
react.useEffect(() => {
|
|
1032
|
+
if (selectionColor !== void 0) rendererRef.current?.setSelectionColor(selectionColor);
|
|
1033
|
+
}, [selectionColor]);
|
|
1029
1034
|
react.useEffect(() => {
|
|
1030
1035
|
const el = wrapRef.current;
|
|
1031
1036
|
if (!el) return;
|
|
@@ -1063,6 +1068,7 @@ function CanvasSurface({
|
|
|
1063
1068
|
el.removeEventListener("dblclick", onDoubleClickHandler);
|
|
1064
1069
|
};
|
|
1065
1070
|
}, [store, onClick, onDoubleClick]);
|
|
1071
|
+
const justCommittedRef = react.useRef(false);
|
|
1066
1072
|
react.useEffect(() => {
|
|
1067
1073
|
const el = wrapRef.current;
|
|
1068
1074
|
if (!el || !onCreateDrag) return;
|
|
@@ -1070,7 +1076,6 @@ function CanvasSurface({
|
|
|
1070
1076
|
let startScreen = null;
|
|
1071
1077
|
let activePointerId = null;
|
|
1072
1078
|
let committed = false;
|
|
1073
|
-
const justCommittedRef = { current: false };
|
|
1074
1079
|
const screenFromEvent = (e) => {
|
|
1075
1080
|
const rect = el.getBoundingClientRect();
|
|
1076
1081
|
return { x: e.clientX - rect.left, y: e.clientY - rect.top };
|