canvu-react 0.3.24 → 0.3.26
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/chatbot.d.cts +1 -1
- package/dist/chatbot.d.ts +1 -1
- package/dist/index.cjs +49 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +49 -31
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +116 -33
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +116 -33
- package/dist/react.js.map +1 -1
- package/dist/realtime.cjs +21 -3
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +21 -3
- package/dist/realtime.js.map +1 -1
- package/dist/{types-7kfWcm0L.d.cts → types-BLXR7g_L.d.cts} +7 -0
- package/dist/{types-C4k_AMvi.d.ts → types-Cm7IsgL4.d.ts} +7 -0
- package/package.json +1 -1
package/dist/realtime.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PlacementPreview, R as RemotePresenceMarkupStroke, A as RemotePresencePeer, D as RemotePresenceCamera, E as RealtimeConnectionState, q as VectorViewportHandle, V as VectorToolDefinition, r as VectorViewportProps, C as CanvasPlugin, e as CanvasPluginRenderContext } from './types-
|
|
2
|
-
export { F as PresenceOverlayRenderContext } from './types-
|
|
1
|
+
import { P as PlacementPreview, R as RemotePresenceMarkupStroke, A as RemotePresencePeer, D as RemotePresenceCamera, E as RealtimeConnectionState, q as VectorViewportHandle, V as VectorToolDefinition, r as VectorViewportProps, C as CanvasPlugin, e as CanvasPluginRenderContext } from './types-BLXR7g_L.cjs';
|
|
2
|
+
export { F as PresenceOverlayRenderContext } from './types-BLXR7g_L.cjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { C as Camera2D } from './camera-BwQjm5oh.cjs';
|
|
5
5
|
import { V as VectorSceneItem, R as Rect } from './types-CB0TZZuk.cjs';
|
package/dist/realtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PlacementPreview, R as RemotePresenceMarkupStroke, A as RemotePresencePeer, D as RemotePresenceCamera, E as RealtimeConnectionState, q as VectorViewportHandle, V as VectorToolDefinition, r as VectorViewportProps, C as CanvasPlugin, e as CanvasPluginRenderContext } from './types-
|
|
2
|
-
export { F as PresenceOverlayRenderContext } from './types-
|
|
1
|
+
import { P as PlacementPreview, R as RemotePresenceMarkupStroke, A as RemotePresencePeer, D as RemotePresenceCamera, E as RealtimeConnectionState, q as VectorViewportHandle, V as VectorToolDefinition, r as VectorViewportProps, C as CanvasPlugin, e as CanvasPluginRenderContext } from './types-Cm7IsgL4.js';
|
|
2
|
+
export { F as PresenceOverlayRenderContext } from './types-Cm7IsgL4.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { C as Camera2D } from './camera-KwCYYPhm.js';
|
|
5
5
|
import { V as VectorSceneItem, R as Rect } from './types-CB0TZZuk.js';
|
package/dist/realtime.js
CHANGED
|
@@ -9,9 +9,13 @@ function remoteMarkupStrokeFromPlacementPreview(preview) {
|
|
|
9
9
|
}
|
|
10
10
|
const tool = preview.tool;
|
|
11
11
|
const mapped = tool === "laser" || tool === "marker" || tool === "draw" ? tool : "draw";
|
|
12
|
+
const style = preview.style;
|
|
12
13
|
return {
|
|
13
14
|
points: preview.points,
|
|
14
|
-
tool: mapped
|
|
15
|
+
tool: mapped,
|
|
16
|
+
...style?.strokeWidth != null ? { strokeWidth: style.strokeWidth } : {},
|
|
17
|
+
...style?.stroke ? { stroke: style.stroke } : {},
|
|
18
|
+
...style?.strokeOpacity != null ? { strokeOpacity: style.strokeOpacity } : {}
|
|
15
19
|
};
|
|
16
20
|
}
|
|
17
21
|
|
|
@@ -126,7 +130,12 @@ function PresenceRemoteLayer({
|
|
|
126
130
|
const markup = peer.markupStroke;
|
|
127
131
|
let strokeNode = null;
|
|
128
132
|
if (markup && markup.points.length > 0) {
|
|
129
|
-
const
|
|
133
|
+
const fallbackPaint = strokePaint(markup.tool, color);
|
|
134
|
+
const paint = {
|
|
135
|
+
stroke: markup.stroke ?? fallbackPaint.stroke,
|
|
136
|
+
strokeOpacity: markup.strokeOpacity ?? fallbackPaint.strokeOpacity,
|
|
137
|
+
widthWorld: markup.strokeWidth ?? fallbackPaint.widthWorld
|
|
138
|
+
};
|
|
130
139
|
const d = markup.points.length >= 2 ? smoothFreehandPointsToPathD([...markup.points]) : null;
|
|
131
140
|
if (d) {
|
|
132
141
|
strokeNode = /* @__PURE__ */ jsx(
|
|
@@ -255,7 +264,16 @@ function parseMarkupStroke(value) {
|
|
|
255
264
|
if (x == null || y == null) return null;
|
|
256
265
|
return { x, y };
|
|
257
266
|
}).filter((point) => point != null);
|
|
258
|
-
|
|
267
|
+
const strokeWidth = getNumber(value.strokeWidth);
|
|
268
|
+
const stroke = getString(value.stroke);
|
|
269
|
+
const strokeOpacity = getNumber(value.strokeOpacity);
|
|
270
|
+
return {
|
|
271
|
+
points,
|
|
272
|
+
tool,
|
|
273
|
+
...strokeWidth != null ? { strokeWidth } : {},
|
|
274
|
+
...stroke ? { stroke } : {},
|
|
275
|
+
...strokeOpacity != null ? { strokeOpacity } : {}
|
|
276
|
+
};
|
|
259
277
|
}
|
|
260
278
|
function parsePresencePayload(value) {
|
|
261
279
|
if (!isRecord(value)) return void 0;
|