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.cjs
CHANGED
|
@@ -11,9 +11,13 @@ function remoteMarkupStrokeFromPlacementPreview(preview) {
|
|
|
11
11
|
}
|
|
12
12
|
const tool = preview.tool;
|
|
13
13
|
const mapped = tool === "laser" || tool === "marker" || tool === "draw" ? tool : "draw";
|
|
14
|
+
const style = preview.style;
|
|
14
15
|
return {
|
|
15
16
|
points: preview.points,
|
|
16
|
-
tool: mapped
|
|
17
|
+
tool: mapped,
|
|
18
|
+
...style?.strokeWidth != null ? { strokeWidth: style.strokeWidth } : {},
|
|
19
|
+
...style?.stroke ? { stroke: style.stroke } : {},
|
|
20
|
+
...style?.strokeOpacity != null ? { strokeOpacity: style.strokeOpacity } : {}
|
|
17
21
|
};
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -128,7 +132,12 @@ function PresenceRemoteLayer({
|
|
|
128
132
|
const markup = peer.markupStroke;
|
|
129
133
|
let strokeNode = null;
|
|
130
134
|
if (markup && markup.points.length > 0) {
|
|
131
|
-
const
|
|
135
|
+
const fallbackPaint = strokePaint(markup.tool, color);
|
|
136
|
+
const paint = {
|
|
137
|
+
stroke: markup.stroke ?? fallbackPaint.stroke,
|
|
138
|
+
strokeOpacity: markup.strokeOpacity ?? fallbackPaint.strokeOpacity,
|
|
139
|
+
widthWorld: markup.strokeWidth ?? fallbackPaint.widthWorld
|
|
140
|
+
};
|
|
132
141
|
const d = markup.points.length >= 2 ? smoothFreehandPointsToPathD([...markup.points]) : null;
|
|
133
142
|
if (d) {
|
|
134
143
|
strokeNode = /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -257,7 +266,16 @@ function parseMarkupStroke(value) {
|
|
|
257
266
|
if (x == null || y == null) return null;
|
|
258
267
|
return { x, y };
|
|
259
268
|
}).filter((point) => point != null);
|
|
260
|
-
|
|
269
|
+
const strokeWidth = getNumber(value.strokeWidth);
|
|
270
|
+
const stroke = getString(value.stroke);
|
|
271
|
+
const strokeOpacity = getNumber(value.strokeOpacity);
|
|
272
|
+
return {
|
|
273
|
+
points,
|
|
274
|
+
tool,
|
|
275
|
+
...strokeWidth != null ? { strokeWidth } : {},
|
|
276
|
+
...stroke ? { stroke } : {},
|
|
277
|
+
...strokeOpacity != null ? { strokeOpacity } : {}
|
|
278
|
+
};
|
|
261
279
|
}
|
|
262
280
|
function parsePresencePayload(value) {
|
|
263
281
|
if (!isRecord(value)) return void 0;
|