canvu-react 0.3.29 → 0.3.30
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/{asset-hydration-BEG21hMp.d.ts → asset-hydration-DrTOgDdd.d.ts} +2 -2
- package/dist/{asset-hydration-3Iv5xHxM.d.cts → asset-hydration-EtEuBwb7.d.cts} +2 -2
- package/dist/{camera-KwCYYPhm.d.ts → camera-AoTwBSoE.d.ts} +1 -1
- package/dist/{camera-BwQjm5oh.d.cts → camera-Di5R_Rwl.d.cts} +1 -1
- package/dist/chatbot.d.cts +4 -4
- package/dist/chatbot.d.ts +4 -4
- package/dist/index.cjs +118 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +116 -2
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +99 -0
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +2 -2
- package/dist/native.d.ts +2 -2
- package/dist/native.js +99 -0
- package/dist/native.js.map +1 -1
- package/dist/react.cjs +175 -7
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +15 -12
- package/dist/react.d.ts +15 -12
- package/dist/react.js +175 -8
- package/dist/react.js.map +1 -1
- package/dist/realtime.cjs +10 -0
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +6 -6
- package/dist/realtime.d.ts +6 -6
- package/dist/realtime.js +10 -0
- package/dist/realtime.js.map +1 -1
- package/dist/{shape-builders-DFudWDFI.d.cts → shape-builders-CsSXKCcs.d.ts} +43 -2
- package/dist/{shape-builders-ENwnK-zT.d.ts → shape-builders-CsbSRZnQ.d.cts} +43 -2
- package/dist/tldraw.cjs +101 -2
- package/dist/tldraw.cjs.map +1 -1
- package/dist/tldraw.d.cts +1 -1
- package/dist/tldraw.d.ts +1 -1
- package/dist/tldraw.js +101 -2
- package/dist/tldraw.js.map +1 -1
- package/dist/{types-DNwjgs5U.d.cts → types-B2Na677H.d.cts} +1 -1
- package/dist/{types-BLXR7g_L.d.cts → types-B6PAYKzx.d.ts} +4 -4
- package/dist/{types-CB0TZZuk.d.cts → types-Bnq2HtHQ.d.cts} +1 -1
- package/dist/{types-CB0TZZuk.d.ts → types-Bnq2HtHQ.d.ts} +1 -1
- package/dist/{types-Cm7IsgL4.d.ts → types-DWGk2_GZ.d.cts} +4 -4
- package/dist/{types-BtAJFS_-.d.ts → types-zmUah-vP.d.ts} +1 -1
- package/package.json +1 -1
package/dist/react.cjs
CHANGED
|
@@ -181,6 +181,8 @@ __export(shape_builders_exports, {
|
|
|
181
181
|
DEFAULT_TEXT_FONT_SIZE: () => DEFAULT_TEXT_FONT_SIZE,
|
|
182
182
|
applyStrokeToItem: () => applyStrokeToItem,
|
|
183
183
|
applyTextDraftWhileEditing: () => applyTextDraftWhileEditing,
|
|
184
|
+
buildArchitecturalCloudPathD: () => buildArchitecturalCloudPathD,
|
|
185
|
+
buildArchitecturalCloudSvg: () => buildArchitecturalCloudSvg,
|
|
184
186
|
buildArrowSvg: () => buildArrowSvg,
|
|
185
187
|
buildDrawDotSvg: () => buildDrawDotSvg,
|
|
186
188
|
buildEllipseSvg: () => buildEllipseSvg,
|
|
@@ -192,6 +194,7 @@ __export(shape_builders_exports, {
|
|
|
192
194
|
buildTextSvg: () => buildTextSvg,
|
|
193
195
|
computeFreehandSvgPayload: () => computeFreehandSvgPayload,
|
|
194
196
|
computeStraightArrowGeometry: () => computeStraightArrowGeometry,
|
|
197
|
+
createArchitecturalCloudItem: () => createArchitecturalCloudItem,
|
|
195
198
|
createDrawDotItem: () => createDrawDotItem,
|
|
196
199
|
createEllipseItem: () => createEllipseItem,
|
|
197
200
|
createFreehandStrokeItem: () => createFreehandStrokeItem,
|
|
@@ -283,6 +286,41 @@ function resolveStrokeStyle(item) {
|
|
|
283
286
|
function strokeOpacityAttr(style) {
|
|
284
287
|
return style.strokeOpacity != null ? ` stroke-opacity="${style.strokeOpacity}"` : "";
|
|
285
288
|
}
|
|
289
|
+
function clampNumber(value, min, max) {
|
|
290
|
+
return Math.min(max, Math.max(min, value));
|
|
291
|
+
}
|
|
292
|
+
function svgNumber(value) {
|
|
293
|
+
if (!Number.isFinite(value)) return "0";
|
|
294
|
+
return Number(value.toFixed(3)).toString();
|
|
295
|
+
}
|
|
296
|
+
function architecturalCloudScallopCount(length, depth) {
|
|
297
|
+
if (length <= 1e-6) return 0;
|
|
298
|
+
return Math.max(1, Math.round(length / Math.max(depth * 2.05, 8)));
|
|
299
|
+
}
|
|
300
|
+
function appendHorizontalScallops(segments, startX, endX, y, controlY, count) {
|
|
301
|
+
if (count <= 0) return;
|
|
302
|
+
const step = (endX - startX) / count;
|
|
303
|
+
for (let index = 1; index <= count; index += 1) {
|
|
304
|
+
const x0 = startX + step * (index - 1);
|
|
305
|
+
const x1 = index === count ? endX : startX + step * index;
|
|
306
|
+
const cx = (x0 + x1) / 2;
|
|
307
|
+
segments.push(
|
|
308
|
+
`Q${svgNumber(cx)} ${svgNumber(controlY)} ${svgNumber(x1)} ${svgNumber(y)}`
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
function appendVerticalScallops(segments, startY, endY, x, controlX, count) {
|
|
313
|
+
if (count <= 0) return;
|
|
314
|
+
const step = (endY - startY) / count;
|
|
315
|
+
for (let index = 1; index <= count; index += 1) {
|
|
316
|
+
const y0 = startY + step * (index - 1);
|
|
317
|
+
const y1 = index === count ? endY : startY + step * index;
|
|
318
|
+
const cy = (y0 + y1) / 2;
|
|
319
|
+
segments.push(
|
|
320
|
+
`Q${svgNumber(controlX)} ${svgNumber(cy)} ${svgNumber(x)} ${svgNumber(y1)}`
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
286
324
|
function buildRectSvg(width, height, style = DEFAULT_STROKE_STYLE) {
|
|
287
325
|
return `<rect width="${width}" height="${height}" fill="none" stroke="${style.stroke}" stroke-width="${style.strokeWidth}" rx="4"${strokeOpacityAttr(style)} />`;
|
|
288
326
|
}
|
|
@@ -291,6 +329,63 @@ function buildEllipseSvg(width, height, style = DEFAULT_STROKE_STYLE) {
|
|
|
291
329
|
const ry = height / 2;
|
|
292
330
|
return `<ellipse cx="${rx}" cy="${ry}" rx="${rx}" ry="${ry}" fill="none" stroke="${style.stroke}" stroke-width="${style.strokeWidth}"${strokeOpacityAttr(style)} />`;
|
|
293
331
|
}
|
|
332
|
+
function buildArchitecturalCloudPathD(width, height, strokeWidth = DEFAULT_STROKE_STYLE.strokeWidth) {
|
|
333
|
+
const w = Math.max(0, width);
|
|
334
|
+
const h = Math.max(0, height);
|
|
335
|
+
if (w <= 0 || h <= 0) return "";
|
|
336
|
+
const inset = Math.min(w / 2, h / 2, Math.max(0.5, strokeWidth / 2));
|
|
337
|
+
const x0 = inset;
|
|
338
|
+
const y0 = inset;
|
|
339
|
+
const x1 = Math.max(x0, w - inset);
|
|
340
|
+
const y1 = Math.max(y0, h - inset);
|
|
341
|
+
const innerW = Math.max(0, x1 - x0);
|
|
342
|
+
const innerH = Math.max(0, y1 - y0);
|
|
343
|
+
if (innerW <= 0 || innerH <= 0) return "";
|
|
344
|
+
const maxDepth = Math.max(0.5, Math.min(innerW, innerH) * 0.18);
|
|
345
|
+
const depth = clampNumber(Math.min(w, h) * 0.08, 2, Math.min(12, maxDepth));
|
|
346
|
+
const corner = Math.min(depth * 1.2, innerW / 2, innerH / 2);
|
|
347
|
+
const topStart = x0 + corner;
|
|
348
|
+
const topEnd = x1 - corner;
|
|
349
|
+
const rightStart = y0 + corner;
|
|
350
|
+
const rightEnd = y1 - corner;
|
|
351
|
+
const bottomStart = x1 - corner;
|
|
352
|
+
const bottomEnd = x0 + corner;
|
|
353
|
+
const leftStart = y1 - corner;
|
|
354
|
+
const leftEnd = y0 + corner;
|
|
355
|
+
const topCount = architecturalCloudScallopCount(topEnd - topStart, depth);
|
|
356
|
+
const rightCount = architecturalCloudScallopCount(rightEnd - rightStart, depth);
|
|
357
|
+
const bottomCount = architecturalCloudScallopCount(bottomStart - bottomEnd, depth);
|
|
358
|
+
const leftCount = architecturalCloudScallopCount(leftStart - leftEnd, depth);
|
|
359
|
+
const segments = [`M${svgNumber(topStart)} ${svgNumber(y0)}`];
|
|
360
|
+
appendHorizontalScallops(segments, topStart, topEnd, y0, y0 + depth, topCount);
|
|
361
|
+
segments.push(
|
|
362
|
+
`Q${svgNumber(x1)} ${svgNumber(y0)} ${svgNumber(x1)} ${svgNumber(rightStart)}`
|
|
363
|
+
);
|
|
364
|
+
appendVerticalScallops(segments, rightStart, rightEnd, x1, x1 - depth, rightCount);
|
|
365
|
+
segments.push(
|
|
366
|
+
`Q${svgNumber(x1)} ${svgNumber(y1)} ${svgNumber(bottomStart)} ${svgNumber(y1)}`
|
|
367
|
+
);
|
|
368
|
+
appendHorizontalScallops(
|
|
369
|
+
segments,
|
|
370
|
+
bottomStart,
|
|
371
|
+
bottomEnd,
|
|
372
|
+
y1,
|
|
373
|
+
y1 - depth,
|
|
374
|
+
bottomCount
|
|
375
|
+
);
|
|
376
|
+
segments.push(
|
|
377
|
+
`Q${svgNumber(x0)} ${svgNumber(y1)} ${svgNumber(x0)} ${svgNumber(leftStart)}`
|
|
378
|
+
);
|
|
379
|
+
appendVerticalScallops(segments, leftStart, leftEnd, x0, x0 + depth, leftCount);
|
|
380
|
+
segments.push(
|
|
381
|
+
`Q${svgNumber(x0)} ${svgNumber(y0)} ${svgNumber(topStart)} ${svgNumber(y0)} Z`
|
|
382
|
+
);
|
|
383
|
+
return segments.join(" ");
|
|
384
|
+
}
|
|
385
|
+
function buildArchitecturalCloudSvg(width, height, style = DEFAULT_STROKE_STYLE) {
|
|
386
|
+
const d = buildArchitecturalCloudPathD(width, height, style.strokeWidth);
|
|
387
|
+
return `<path d="${d}" fill="none" stroke="${style.stroke}" stroke-width="${style.strokeWidth}" stroke-linecap="round" stroke-linejoin="round"${strokeOpacityAttr(style)} />`;
|
|
388
|
+
}
|
|
294
389
|
function buildLineSvg(line, style = DEFAULT_STROKE_STYLE) {
|
|
295
390
|
return `<line x1="${line.x1}" y1="${line.y1}" x2="${line.x2}" y2="${line.y2}" stroke="${style.stroke}" stroke-width="${style.strokeWidth}"${strokeOpacityAttr(style)} />`;
|
|
296
391
|
}
|
|
@@ -433,6 +528,13 @@ function rebuildItemSvg(item) {
|
|
|
433
528
|
childrenSvg: buildEllipseSvg(b.width, b.height, style)
|
|
434
529
|
};
|
|
435
530
|
}
|
|
531
|
+
if (k === "architectural-cloud") {
|
|
532
|
+
const b = normalizeRect(item.bounds);
|
|
533
|
+
return {
|
|
534
|
+
...item,
|
|
535
|
+
childrenSvg: buildArchitecturalCloudSvg(b.width, b.height, style)
|
|
536
|
+
};
|
|
537
|
+
}
|
|
436
538
|
if ((k === "line" || k === "arrow") && item.line) {
|
|
437
539
|
const line = item.line;
|
|
438
540
|
const childrenSvg = k === "arrow" ? buildArrowSvg(item.id, line, style) : buildLineSvg(line, style);
|
|
@@ -545,6 +647,21 @@ function createEllipseItem(id, bounds, style) {
|
|
|
545
647
|
childrenSvg: ""
|
|
546
648
|
});
|
|
547
649
|
}
|
|
650
|
+
function createArchitecturalCloudItem(id, bounds, style) {
|
|
651
|
+
const r = normalizeRect(bounds);
|
|
652
|
+
const s = { ...DEFAULT_STROKE_STYLE, ...style };
|
|
653
|
+
return rebuildItemSvg({
|
|
654
|
+
id,
|
|
655
|
+
x: r.x,
|
|
656
|
+
y: r.y,
|
|
657
|
+
bounds: { ...r },
|
|
658
|
+
toolKind: "architectural-cloud",
|
|
659
|
+
stroke: s.stroke,
|
|
660
|
+
strokeWidth: s.strokeWidth,
|
|
661
|
+
...s.strokeOpacity != null ? { strokeOpacity: s.strokeOpacity } : {},
|
|
662
|
+
childrenSvg: ""
|
|
663
|
+
});
|
|
664
|
+
}
|
|
548
665
|
function createLineItem(id, bounds, line, toolKind, style, arrowBind) {
|
|
549
666
|
const r = normalizeRect(bounds);
|
|
550
667
|
const s = { ...DEFAULT_STROKE_STYLE, ...style };
|
|
@@ -3049,6 +3166,9 @@ function IconRect(props) {
|
|
|
3049
3166
|
function IconEllipse(props) {
|
|
3050
3167
|
return /* @__PURE__ */ jsxRuntime.jsx("svg", { ...base, ...props, "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "12", cy: "12", rx: "9", ry: "6" }) });
|
|
3051
3168
|
}
|
|
3169
|
+
function IconArchitecturalCloud(props) {
|
|
3170
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { ...base, ...props, "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.5 7.5Q4.4 7.5 4.4 9.4Q3 9.9 3 11.6Q3 13.5 5.2 13.5Q5.8 16 8.3 15.2Q9.2 17.2 11.3 15.7Q12.8 17 14.3 15.5Q16.5 16.4 17 14Q20.7 13.7 20.2 10.9Q21 8.5 18 8.3Q17.2 5.9 14.8 6.7Q13.2 5.2 11.5 6.5Q9.1 5.1 7.8 7.2Q7.2 7.2 6.5 7.5Z" }) });
|
|
3171
|
+
}
|
|
3052
3172
|
function IconLine(props) {
|
|
3053
3173
|
return /* @__PURE__ */ jsxRuntime.jsx("svg", { ...base, ...props, "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "5", y1: "19", x2: "19", y2: "5" }) });
|
|
3054
3174
|
}
|
|
@@ -3093,6 +3213,7 @@ var ic = { size: 20, strokeWidth: 2 };
|
|
|
3093
3213
|
var DEFAULT_OVERFLOW_TOOL_IDS = [
|
|
3094
3214
|
"rect",
|
|
3095
3215
|
"ellipse",
|
|
3216
|
+
"architectural-cloud",
|
|
3096
3217
|
"line",
|
|
3097
3218
|
"marker",
|
|
3098
3219
|
"laser",
|
|
@@ -3123,6 +3244,13 @@ var DEFAULT_VECTOR_TOOLS = [
|
|
|
3123
3244
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { ...ic, "aria-hidden": true }),
|
|
3124
3245
|
shortcutHint: "O"
|
|
3125
3246
|
},
|
|
3247
|
+
{
|
|
3248
|
+
id: "architectural-cloud",
|
|
3249
|
+
label: "Nuvem arquitetural",
|
|
3250
|
+
tooltipLabel: "Architectural cloud",
|
|
3251
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(IconArchitecturalCloud, { "aria-hidden": true }),
|
|
3252
|
+
shortcutHint: "C"
|
|
3253
|
+
},
|
|
3126
3254
|
{
|
|
3127
3255
|
id: "line",
|
|
3128
3256
|
label: "Line",
|
|
@@ -3200,7 +3328,7 @@ function normalizeHex(stroke) {
|
|
|
3200
3328
|
return "#2563eb";
|
|
3201
3329
|
}
|
|
3202
3330
|
function isStylableKind(tk) {
|
|
3203
|
-
return tk === "rect" || tk === "ellipse" || tk === "line" || tk === "arrow" || tk === "draw" || tk === "pencil" || tk === "brush" || tk === "marker" || tk === "text";
|
|
3331
|
+
return tk === "rect" || tk === "ellipse" || tk === "architectural-cloud" || tk === "line" || tk === "arrow" || tk === "draw" || tk === "pencil" || tk === "brush" || tk === "marker" || tk === "text";
|
|
3204
3332
|
}
|
|
3205
3333
|
function VectorSelectionInspector({
|
|
3206
3334
|
items: itemsProp,
|
|
@@ -4561,6 +4689,7 @@ var HandBinding = makeToolBinding("hand");
|
|
|
4561
4689
|
var SelectBinding = makeToolBinding("select");
|
|
4562
4690
|
var RectBinding = makeToolBinding("rect");
|
|
4563
4691
|
var EllipseBinding = makeToolBinding("ellipse");
|
|
4692
|
+
var ArchitecturalCloudBinding = makeToolBinding("architectural-cloud");
|
|
4564
4693
|
var LineBinding = makeToolBinding("line");
|
|
4565
4694
|
var ArrowBinding = makeToolBinding("arrow");
|
|
4566
4695
|
var DrawBinding = makeToolBinding("draw");
|
|
@@ -4580,6 +4709,7 @@ var VectorToolbar = Object.assign(
|
|
|
4580
4709
|
Select: SelectBinding,
|
|
4581
4710
|
Rect: RectBinding,
|
|
4582
4711
|
Ellipse: EllipseBinding,
|
|
4712
|
+
ArchitecturalCloud: ArchitecturalCloudBinding,
|
|
4583
4713
|
Line: LineBinding,
|
|
4584
4714
|
Arrow: ArrowBinding,
|
|
4585
4715
|
Draw: DrawBinding,
|
|
@@ -5309,7 +5439,7 @@ function isArrowBindTarget(item) {
|
|
|
5309
5439
|
if (item.locked) return false;
|
|
5310
5440
|
const k = item.toolKind;
|
|
5311
5441
|
if (!k) return false;
|
|
5312
|
-
return k === "rect" || k === "ellipse" || k === "text" || k === "image" || k === "custom";
|
|
5442
|
+
return k === "rect" || k === "ellipse" || k === "architectural-cloud" || k === "text" || k === "image" || k === "custom";
|
|
5313
5443
|
}
|
|
5314
5444
|
function closestPointOnShapeBoundaryLocal(item, lx, ly, w, h) {
|
|
5315
5445
|
if (item.toolKind === "ellipse") {
|
|
@@ -5648,6 +5778,16 @@ function resizeItemByHandle(item, start, handle, currentWorld) {
|
|
|
5648
5778
|
childrenSvg: buildEllipseSvg(nb.width, nb.height, style)
|
|
5649
5779
|
};
|
|
5650
5780
|
}
|
|
5781
|
+
if (k === "architectural-cloud") {
|
|
5782
|
+
const style = resolveStrokeStyle(item);
|
|
5783
|
+
return {
|
|
5784
|
+
...item,
|
|
5785
|
+
x: nb.x,
|
|
5786
|
+
y: nb.y,
|
|
5787
|
+
bounds: nb,
|
|
5788
|
+
childrenSvg: buildArchitecturalCloudSvg(nb.width, nb.height, style)
|
|
5789
|
+
};
|
|
5790
|
+
}
|
|
5651
5791
|
if (k === "text" && item.text !== void 0) {
|
|
5652
5792
|
const sfw = Math.max(sb.width, 1e-6);
|
|
5653
5793
|
const sfh = Math.max(sb.height, 1e-6);
|
|
@@ -6190,7 +6330,7 @@ function InteractionOverlay({
|
|
|
6190
6330
|
vectorEffect: "non-scaling-stroke"
|
|
6191
6331
|
}
|
|
6192
6332
|
);
|
|
6193
|
-
} else if (placementPreview.kind === "rect" || placementPreview.kind === "ellipse") {
|
|
6333
|
+
} else if (placementPreview.kind === "rect" || placementPreview.kind === "ellipse" || placementPreview.kind === "architectural-cloud") {
|
|
6194
6334
|
const r = normalizeRect(placementPreview.rect);
|
|
6195
6335
|
preview = placementPreview.kind === "rect" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6196
6336
|
"rect",
|
|
@@ -6205,7 +6345,7 @@ function InteractionOverlay({
|
|
|
6205
6345
|
strokeDasharray: dashPattern,
|
|
6206
6346
|
vectorEffect: "non-scaling-stroke"
|
|
6207
6347
|
}
|
|
6208
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
6348
|
+
) : placementPreview.kind === "ellipse" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6209
6349
|
"ellipse",
|
|
6210
6350
|
{
|
|
6211
6351
|
cx: r.x + r.width / 2,
|
|
@@ -6218,7 +6358,19 @@ function InteractionOverlay({
|
|
|
6218
6358
|
strokeDasharray: dashPattern,
|
|
6219
6359
|
vectorEffect: "non-scaling-stroke"
|
|
6220
6360
|
}
|
|
6221
|
-
)
|
|
6361
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${r.x}, ${r.y})`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6362
|
+
"path",
|
|
6363
|
+
{
|
|
6364
|
+
d: buildArchitecturalCloudPathD(r.width, r.height, overlayStrokePx),
|
|
6365
|
+
fill: "none",
|
|
6366
|
+
stroke: "#64748b",
|
|
6367
|
+
strokeWidth: overlayStrokePx,
|
|
6368
|
+
strokeDasharray: dashPattern,
|
|
6369
|
+
strokeLinecap: "round",
|
|
6370
|
+
strokeLinejoin: "round",
|
|
6371
|
+
vectorEffect: "non-scaling-stroke"
|
|
6372
|
+
}
|
|
6373
|
+
) });
|
|
6222
6374
|
} else if (placementPreview.kind === "line" || placementPreview.kind === "arrow") {
|
|
6223
6375
|
const { start, end } = placementPreview;
|
|
6224
6376
|
const geometry = placementPreview.kind === "arrow" ? computeStraightArrowGeometry(
|
|
@@ -6791,6 +6943,7 @@ function cursorForVectorToolId(toolId) {
|
|
|
6791
6943
|
return "default";
|
|
6792
6944
|
case "rect":
|
|
6793
6945
|
case "ellipse":
|
|
6946
|
+
case "architectural-cloud":
|
|
6794
6947
|
case "line":
|
|
6795
6948
|
case "arrow":
|
|
6796
6949
|
return "crosshair";
|
|
@@ -6841,7 +6994,7 @@ function replaceItem(items, id, next) {
|
|
|
6841
6994
|
}
|
|
6842
6995
|
function supportsResizeHandles(item) {
|
|
6843
6996
|
const k = item?.toolKind;
|
|
6844
|
-
if (k === "rect" || k === "ellipse" || k === "line" || k === "arrow" || k === "image" || k === "text") {
|
|
6997
|
+
if (k === "rect" || k === "ellipse" || k === "architectural-cloud" || k === "line" || k === "arrow" || k === "image" || k === "text") {
|
|
6845
6998
|
return true;
|
|
6846
6999
|
}
|
|
6847
7000
|
if ((k === "draw" || k === "pencil" || k === "brush" || k === "marker") && item?.pathPointsLocal && item.pathPointsLocal.length > 0) {
|
|
@@ -6898,6 +7051,9 @@ function defaultPlacementWorld(tool, center) {
|
|
|
6898
7051
|
if (tool === "ellipse") {
|
|
6899
7052
|
return { raw: { x: cx - 70, y: cy - 45, width: 140, height: 90 } };
|
|
6900
7053
|
}
|
|
7054
|
+
if (tool === "architectural-cloud") {
|
|
7055
|
+
return { raw: { x: cx - 90, y: cy - 50, width: 180, height: 100 } };
|
|
7056
|
+
}
|
|
6901
7057
|
const a = { x: cx - 50, y: cy };
|
|
6902
7058
|
const b = { x: cx + 50, y: cy };
|
|
6903
7059
|
return {
|
|
@@ -8801,7 +8957,7 @@ var VectorViewport = react.forwardRef(
|
|
|
8801
8957
|
return;
|
|
8802
8958
|
}
|
|
8803
8959
|
const cp = customPlacementRef.current;
|
|
8804
|
-
if (tool === "rect" || tool === "ellipse" || tool === "line" || tool === "arrow" || cp && tool === cp.toolId) {
|
|
8960
|
+
if (tool === "rect" || tool === "ellipse" || tool === "architectural-cloud" || tool === "line" || tool === "arrow" || cp && tool === cp.toolId) {
|
|
8805
8961
|
dragStateRef.current = {
|
|
8806
8962
|
kind: "place",
|
|
8807
8963
|
tool,
|
|
@@ -9221,6 +9377,11 @@ var VectorViewport = react.forwardRef(
|
|
|
9221
9377
|
setPlacementPreview({ kind: "rect", rect: rectFromCorners(a, b) });
|
|
9222
9378
|
} else if (st.tool === "ellipse") {
|
|
9223
9379
|
setPlacementPreview({ kind: "ellipse", rect: rectFromCorners(a, b) });
|
|
9380
|
+
} else if (st.tool === "architectural-cloud") {
|
|
9381
|
+
setPlacementPreview({
|
|
9382
|
+
kind: "architectural-cloud",
|
|
9383
|
+
rect: rectFromCorners(a, b)
|
|
9384
|
+
});
|
|
9224
9385
|
} else if (st.tool === "line") {
|
|
9225
9386
|
setPlacementPreview({
|
|
9226
9387
|
kind: "line",
|
|
@@ -9479,6 +9640,12 @@ var VectorViewport = react.forwardRef(
|
|
|
9479
9640
|
} else if (st.tool === "ellipse") {
|
|
9480
9641
|
change([...itemsRef.current, createEllipseItem(id, raw, pen)]);
|
|
9481
9642
|
setEffectiveSelectedIdsRef.current([id]);
|
|
9643
|
+
} else if (st.tool === "architectural-cloud") {
|
|
9644
|
+
change([
|
|
9645
|
+
...itemsRef.current,
|
|
9646
|
+
createArchitecturalCloudItem(id, raw, pen)
|
|
9647
|
+
]);
|
|
9648
|
+
setEffectiveSelectedIdsRef.current([id]);
|
|
9482
9649
|
} else if (st.tool === "line" || st.tool === "arrow") {
|
|
9483
9650
|
const line = lineEndpointsToLocal(raw, lineA, lineB);
|
|
9484
9651
|
change([
|
|
@@ -9800,6 +9967,7 @@ exports.CanvuPluginContext = CanvuPluginContext;
|
|
|
9800
9967
|
exports.DEFAULT_OVERFLOW_TOOL_IDS = DEFAULT_OVERFLOW_TOOL_IDS;
|
|
9801
9968
|
exports.DEFAULT_VECTOR_CANVAS_STORAGE_KEY = DEFAULT_VECTOR_CANVAS_STORAGE_KEY;
|
|
9802
9969
|
exports.DEFAULT_VECTOR_TOOLS = DEFAULT_VECTOR_TOOLS;
|
|
9970
|
+
exports.IconArchitecturalCloud = IconArchitecturalCloud;
|
|
9803
9971
|
exports.IconArrow = IconArrow;
|
|
9804
9972
|
exports.IconDraw = IconDraw;
|
|
9805
9973
|
exports.IconEllipse = IconEllipse;
|