canvu-react 0.4.68 → 0.4.70
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-Dw99FGJB.d.cts → asset-hydration-D2xaUoAT.d.cts} +1 -1
- package/dist/{asset-hydration-aNXfeayg.d.ts → asset-hydration-D9eThWse.d.ts} +1 -1
- package/dist/chatbot.d.cts +2 -2
- package/dist/chatbot.d.ts +2 -2
- package/dist/index.cjs +36 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +36 -1
- package/dist/index.js.map +1 -1
- package/dist/{raster-image-canvas-BZh73aoc.d.ts → raster-image-canvas-CCOmB4NY.d.ts} +39 -1
- package/dist/{raster-image-canvas-zerVYllB.d.cts → raster-image-canvas-nK9kM9UJ.d.cts} +39 -1
- package/dist/react.cjs +85 -21
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +6 -6
- package/dist/react.d.ts +6 -6
- package/dist/react.js +85 -21
- package/dist/react.js.map +1 -1
- 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.map +1 -1
- package/dist/{types-94XpQMy7.d.ts → types-CMuEaiM7.d.ts} +1 -1
- package/dist/{types-BZ9wK9Y3.d.cts → types-D402X18k.d.cts} +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,8 +2,8 @@ import { C as Camera2D } from './shape-builders-DzhCOuzo.cjs';
|
|
|
2
2
|
export { a as Camera2DOptions, D as DEFAULT_STROKE_STYLE, F as FreehandSvgPayload, S as StrokeStyle, b as applyStrokeToItem, c as buildArchitecturalCloudPathD, d as buildArchitecturalCloudSvg, e as buildArrowSvg, f as buildDrawDotSvg, g as buildEllipseSvg, h as buildFreehandPathSvg, i as buildLineSvg, j as buildRectSvg, k as computeFreehandSvgPayload, l as createArchitecturalCloudItem, m as createDrawDotItem, n as createEllipseItem, o as createFreehandStrokeItem, p as createImageFromVectorTrace, q as createImageItem, r as createLineItem, s as createRectangleItem, t as createShapeId, u as createTextItem, v as lineEndpointsToLocal, w as rebuildItemSvg, x as resolveStrokeStyle } from './shape-builders-DzhCOuzo.cjs';
|
|
3
3
|
import { V as VectorSceneItem, A as ArrowEndpointBinding, C as CustomShapeResizeHandles, R as Rect } from './types-fJNwEnHf.cjs';
|
|
4
4
|
export { a as ArrowBindings, b as ResizeHandleId, c as VectorPathPoint, n as normalizeRect, r as rectsIntersect } from './types-fJNwEnHf.cjs';
|
|
5
|
-
export { H as HydratedSceneItemsWithAssetsResult, h as hydrateSceneItemsWithAssets } from './asset-hydration-
|
|
6
|
-
import { R as RasterImageCanvasRenderingOptions } from './raster-image-canvas-
|
|
5
|
+
export { H as HydratedSceneItemsWithAssetsResult, h as hydrateSceneItemsWithAssets } from './asset-hydration-D2xaUoAT.cjs';
|
|
6
|
+
import { R as RasterImageCanvasRenderingOptions } from './raster-image-canvas-nK9kM9UJ.cjs';
|
|
7
7
|
export { C as CanvuLinkData, D as DEFAULT_LINK_CARD_SIZE, L as LINK_PLUGIN_KEY, b as buildLinkCardSvg, c as createLinkItem, g as getLinkData, i as isLinkItem } from './link-item-BMV3VUCr.cjs';
|
|
8
8
|
|
|
9
9
|
type EncodeCanvasToBlobOptions = {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { C as Camera2D } from './shape-builders-xG3A66sv.js';
|
|
|
2
2
|
export { a as Camera2DOptions, D as DEFAULT_STROKE_STYLE, F as FreehandSvgPayload, S as StrokeStyle, b as applyStrokeToItem, c as buildArchitecturalCloudPathD, d as buildArchitecturalCloudSvg, e as buildArrowSvg, f as buildDrawDotSvg, g as buildEllipseSvg, h as buildFreehandPathSvg, i as buildLineSvg, j as buildRectSvg, k as computeFreehandSvgPayload, l as createArchitecturalCloudItem, m as createDrawDotItem, n as createEllipseItem, o as createFreehandStrokeItem, p as createImageFromVectorTrace, q as createImageItem, r as createLineItem, s as createRectangleItem, t as createShapeId, u as createTextItem, v as lineEndpointsToLocal, w as rebuildItemSvg, x as resolveStrokeStyle } from './shape-builders-xG3A66sv.js';
|
|
3
3
|
import { V as VectorSceneItem, A as ArrowEndpointBinding, C as CustomShapeResizeHandles, R as Rect } from './types-fJNwEnHf.js';
|
|
4
4
|
export { a as ArrowBindings, b as ResizeHandleId, c as VectorPathPoint, n as normalizeRect, r as rectsIntersect } from './types-fJNwEnHf.js';
|
|
5
|
-
export { H as HydratedSceneItemsWithAssetsResult, h as hydrateSceneItemsWithAssets } from './asset-hydration-
|
|
6
|
-
import { R as RasterImageCanvasRenderingOptions } from './raster-image-canvas-
|
|
5
|
+
export { H as HydratedSceneItemsWithAssetsResult, h as hydrateSceneItemsWithAssets } from './asset-hydration-D9eThWse.js';
|
|
6
|
+
import { R as RasterImageCanvasRenderingOptions } from './raster-image-canvas-CCOmB4NY.js';
|
|
7
7
|
export { C as CanvuLinkData, D as DEFAULT_LINK_CARD_SIZE, L as LINK_PLUGIN_KEY, b as buildLinkCardSvg, c as createLinkItem, g as getLinkData, i as isLinkItem } from './link-item-COoNNvCu.js';
|
|
8
8
|
|
|
9
9
|
type EncodeCanvasToBlobOptions = {
|
package/dist/index.js
CHANGED
|
@@ -2579,6 +2579,7 @@ function resolveRasterImageCanvasRenderingOptions(options) {
|
|
|
2579
2579
|
if (!options) return null;
|
|
2580
2580
|
const fallbackDevicePixelRatio = typeof window === "undefined" ? 1 : window.devicePixelRatio;
|
|
2581
2581
|
return {
|
|
2582
|
+
resolveSourceSize: options.resolveSourceSize,
|
|
2582
2583
|
resolveRenderTarget: options.resolveRenderTarget,
|
|
2583
2584
|
devicePixelRatio: toPositiveFiniteNumber(
|
|
2584
2585
|
options.devicePixelRatio,
|
|
@@ -2621,6 +2622,28 @@ function getRasterImageContentRect(item) {
|
|
|
2621
2622
|
const height = width / imageAspectRatio;
|
|
2622
2623
|
return { x: 0, y: (bounds.height - height) / 2, width, height };
|
|
2623
2624
|
}
|
|
2625
|
+
function resolveRasterImageCanvasSourceSize({
|
|
2626
|
+
item,
|
|
2627
|
+
href,
|
|
2628
|
+
intrinsicSize,
|
|
2629
|
+
contentRect,
|
|
2630
|
+
viewportSize,
|
|
2631
|
+
cameraZoom,
|
|
2632
|
+
options
|
|
2633
|
+
}) {
|
|
2634
|
+
const resolved = options.resolveSourceSize?.({
|
|
2635
|
+
item,
|
|
2636
|
+
href,
|
|
2637
|
+
intrinsicSize,
|
|
2638
|
+
contentRect,
|
|
2639
|
+
viewportSize,
|
|
2640
|
+
cameraZoom,
|
|
2641
|
+
devicePixelRatio: options.devicePixelRatio
|
|
2642
|
+
});
|
|
2643
|
+
const width = toPositiveFiniteNumber(resolved?.width, intrinsicSize.width);
|
|
2644
|
+
const height = toPositiveFiniteNumber(resolved?.height, intrinsicSize.height);
|
|
2645
|
+
return { width, height };
|
|
2646
|
+
}
|
|
2624
2647
|
function getRasterImageCanvasTargetSize({
|
|
2625
2648
|
intrinsicSize,
|
|
2626
2649
|
contentRect,
|
|
@@ -2660,6 +2683,7 @@ function resolveRasterImageCanvasRenderTarget({
|
|
|
2660
2683
|
item,
|
|
2661
2684
|
href,
|
|
2662
2685
|
intrinsicSize,
|
|
2686
|
+
sourceSize,
|
|
2663
2687
|
contentRect,
|
|
2664
2688
|
targetSize,
|
|
2665
2689
|
viewportSize,
|
|
@@ -2670,6 +2694,7 @@ function resolveRasterImageCanvasRenderTarget({
|
|
|
2670
2694
|
item,
|
|
2671
2695
|
href,
|
|
2672
2696
|
intrinsicSize,
|
|
2697
|
+
sourceSize,
|
|
2673
2698
|
contentRect,
|
|
2674
2699
|
targetSize,
|
|
2675
2700
|
viewportSize,
|
|
@@ -3005,9 +3030,18 @@ var SvgVectorRenderer = class {
|
|
|
3005
3030
|
this.releaseRasterImageCanvas(cached);
|
|
3006
3031
|
return;
|
|
3007
3032
|
}
|
|
3008
|
-
const
|
|
3033
|
+
const sourceSize = resolveRasterImageCanvasSourceSize({
|
|
3034
|
+
item,
|
|
3035
|
+
href: item.imageRasterHref,
|
|
3009
3036
|
intrinsicSize: item.imageIntrinsicSize,
|
|
3010
3037
|
contentRect,
|
|
3038
|
+
viewportSize,
|
|
3039
|
+
cameraZoom: this.camera.zoom,
|
|
3040
|
+
options
|
|
3041
|
+
});
|
|
3042
|
+
const targetSize = getRasterImageCanvasTargetSize({
|
|
3043
|
+
intrinsicSize: sourceSize,
|
|
3044
|
+
contentRect,
|
|
3011
3045
|
cameraZoom: this.camera.zoom,
|
|
3012
3046
|
devicePixelRatio: options.devicePixelRatio,
|
|
3013
3047
|
pixelHeadroom: options.pixelHeadroom,
|
|
@@ -3018,6 +3052,7 @@ var SvgVectorRenderer = class {
|
|
|
3018
3052
|
item,
|
|
3019
3053
|
href: item.imageRasterHref,
|
|
3020
3054
|
intrinsicSize: item.imageIntrinsicSize,
|
|
3055
|
+
sourceSize,
|
|
3021
3056
|
contentRect,
|
|
3022
3057
|
targetSize,
|
|
3023
3058
|
viewportSize,
|