canvu-react 0.4.32 → 0.4.34
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 +2 -1
- package/dist/chatbot.d.ts +2 -1
- package/dist/index.cjs +1 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -10
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +240 -33
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +10 -1
- package/dist/native.d.ts +10 -1
- package/dist/native.js +241 -34
- package/dist/native.js.map +1 -1
- package/dist/react.cjs +2 -11
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +3 -2
- package/dist/react.d.ts +3 -2
- package/dist/react.js +2 -11
- package/dist/react.js.map +1 -1
- package/dist/realtime.cjs +18 -3
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +3 -2
- package/dist/realtime.d.ts +3 -2
- package/dist/realtime.js +18 -3
- package/dist/realtime.js.map +1 -1
- package/dist/realtimeNative.cjs +2124 -0
- package/dist/realtimeNative.cjs.map +1 -0
- package/dist/realtimeNative.d.cts +255 -0
- package/dist/realtimeNative.d.ts +255 -0
- package/dist/realtimeNative.js +2097 -0
- package/dist/realtimeNative.js.map +1 -0
- package/dist/tldraw.cjs +1 -10
- package/dist/tldraw.cjs.map +1 -1
- package/dist/tldraw.js +1 -10
- package/dist/tldraw.js.map +1 -1
- package/dist/types-B82WiQQh.d.ts +69 -0
- package/dist/types-BQUbxMgz.d.cts +69 -0
- package/dist/{types-UZYYwK-v.d.ts → types-DeDm865m.d.ts} +2 -67
- package/dist/{types-BS-YG8Hx.d.cts → types-NBYvslB-.d.cts} +2 -67
- package/package.json +7 -1
package/dist/realtime.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { P as PlacementPreview,
|
|
2
|
-
|
|
1
|
+
import { P as PlacementPreview, q as VectorViewportHandle, V as VectorToolDefinition, r as VectorViewportProps, C as CanvasPlugin, e as CanvasPluginRenderContext } from './types-NBYvslB-.cjs';
|
|
2
|
+
import { a as RemotePresenceMarkupStroke, R as RemotePresencePeer, b as RemotePresenceCamera, c as RealtimeConnectionState } from './types-BQUbxMgz.cjs';
|
|
3
|
+
export { P as PresenceOverlayRenderContext } from './types-BQUbxMgz.cjs';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import { C as Camera2D } from './shape-builders-CKEMjivV.cjs';
|
|
5
6
|
import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.cjs';
|
package/dist/realtime.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { P as PlacementPreview,
|
|
2
|
-
|
|
1
|
+
import { P as PlacementPreview, q as VectorViewportHandle, V as VectorToolDefinition, r as VectorViewportProps, C as CanvasPlugin, e as CanvasPluginRenderContext } from './types-DeDm865m.js';
|
|
2
|
+
import { a as RemotePresenceMarkupStroke, R as RemotePresencePeer, b as RemotePresenceCamera, c as RealtimeConnectionState } from './types-B82WiQQh.js';
|
|
3
|
+
export { P as PresenceOverlayRenderContext } from './types-B82WiQQh.js';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import { C as Camera2D } from './shape-builders-Cyh8zvDG.js';
|
|
5
6
|
import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.js';
|
package/dist/realtime.js
CHANGED
|
@@ -1989,6 +1989,12 @@ function useRealtimePeerFollow(options) {
|
|
|
1989
1989
|
}, [followedPeerId, onFollowEnd, sessionPeers, viewportRef]);
|
|
1990
1990
|
}
|
|
1991
1991
|
var ITEMS_KEY = "items";
|
|
1992
|
+
var CLIENT_ONLY_IMAGE_KEYS = /* @__PURE__ */ new Set([
|
|
1993
|
+
"imageBlobId",
|
|
1994
|
+
"imageThumbnailBlobId",
|
|
1995
|
+
"imageRasterHref",
|
|
1996
|
+
"imageThumbnailHref"
|
|
1997
|
+
]);
|
|
1992
1998
|
var SERVER_ADD_RACE_WINDOW_MS = 2e3;
|
|
1993
1999
|
function createYjsBoardDoc() {
|
|
1994
2000
|
const doc = new Y.Doc();
|
|
@@ -2011,7 +2017,7 @@ function getItemId(item) {
|
|
|
2011
2017
|
}
|
|
2012
2018
|
function vectorItemToYMap(item) {
|
|
2013
2019
|
const yMap = new Y.Map();
|
|
2014
|
-
for (const [key, value] of Object.entries(item)) {
|
|
2020
|
+
for (const [key, value] of Object.entries(normalizeRealtimeItem(item))) {
|
|
2015
2021
|
if (value === void 0) continue;
|
|
2016
2022
|
yMap.set(key, value);
|
|
2017
2023
|
}
|
|
@@ -2056,11 +2062,12 @@ function valuesEqual(left, right) {
|
|
|
2056
2062
|
}
|
|
2057
2063
|
function serializeItem(value) {
|
|
2058
2064
|
const item = value instanceof Y.Map ? yMapToVectorItem(value) : value;
|
|
2059
|
-
return JSON.stringify(item);
|
|
2065
|
+
return JSON.stringify(normalizeRealtimeItem(item));
|
|
2060
2066
|
}
|
|
2061
2067
|
function updateYMapInPlace(yMap, next) {
|
|
2068
|
+
const normalizedNext = normalizeRealtimeItem(next);
|
|
2062
2069
|
const nextKeys = /* @__PURE__ */ new Set();
|
|
2063
|
-
for (const [key, value] of Object.entries(
|
|
2070
|
+
for (const [key, value] of Object.entries(normalizedNext)) {
|
|
2064
2071
|
if (value === void 0) continue;
|
|
2065
2072
|
nextKeys.add(key);
|
|
2066
2073
|
const current = yMap.get(key);
|
|
@@ -2072,6 +2079,14 @@ function updateYMapInPlace(yMap, next) {
|
|
|
2072
2079
|
if (!nextKeys.has(key)) yMap.delete(key);
|
|
2073
2080
|
}
|
|
2074
2081
|
}
|
|
2082
|
+
function normalizeRealtimeItem(item) {
|
|
2083
|
+
if (item.toolKind !== "image") return item;
|
|
2084
|
+
const normalized = Object.fromEntries(
|
|
2085
|
+
Object.entries(item).filter(([key]) => !CLIENT_ONLY_IMAGE_KEYS.has(key))
|
|
2086
|
+
);
|
|
2087
|
+
normalized.childrenSvg = "";
|
|
2088
|
+
return normalized;
|
|
2089
|
+
}
|
|
2075
2090
|
function applyLocalItemsToYDoc(board, options) {
|
|
2076
2091
|
const { items, origin } = options;
|
|
2077
2092
|
const addedIds = [];
|