@ibodr/draw 0.2.12 → 0.2.14

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/index.d.ts CHANGED
@@ -2353,11 +2353,6 @@ declare class ArrowShapeUtil extends ShapeUtil<DrArrowShape> {
2353
2353
  canBeLaidOut(shape: DrArrowShape, info: DrShapeUtilCanBeLaidOutOpts): boolean;
2354
2354
  getFontFaces(shape: DrArrowShape): _ibodr_schema.DrFontFace[];
2355
2355
  getDefaultProps(): DrArrowShape['props'];
2356
- getLodStyle(shape: DrArrowShape): {
2357
- fill: null;
2358
- stroke: string;
2359
- strokeWidth: number;
2360
- };
2361
2356
  getGeometry(shape: DrArrowShape): Group2d;
2362
2357
  getHandles(shape: DrArrowShape): DrHandle[];
2363
2358
  getText(shape: DrArrowShape): string;
@@ -2477,11 +2472,6 @@ declare class DrawShapeUtil extends ShapeUtil<DrDrawShape> {
2477
2472
  hideRotateHandle(shape: DrDrawShape): boolean;
2478
2473
  hideSelectionBoundsFg(shape: DrDrawShape): boolean;
2479
2474
  getDefaultProps(): DrDrawShape['props'];
2480
- getLodStyle(shape: DrDrawShape): {
2481
- fill: string | null;
2482
- stroke: string;
2483
- strokeWidth: number;
2484
- } | null;
2485
2475
  getGeometry(shape: DrDrawShape): Polyline2d | Circle2d;
2486
2476
  component(shape: DrDrawShape): react_jsx_runtime.JSX.Element;
2487
2477
  getIndicatorPath(shape: DrDrawShape): Path2D;
@@ -3063,12 +3053,6 @@ declare class HighlightShapeUtil extends ShapeUtil<DrHighlightShape> {
3063
3053
  hideRotateHandle(shape: DrHighlightShape): boolean;
3064
3054
  hideSelectionBoundsFg(shape: DrHighlightShape): boolean;
3065
3055
  getDefaultProps(): DrHighlightShape['props'];
3066
- getLodStyle(shape: DrHighlightShape): {
3067
- fill: null;
3068
- stroke: string;
3069
- strokeWidth: number;
3070
- opacity: number;
3071
- } | null;
3072
3056
  getGeometry(shape: DrHighlightShape): Polygon2d | Circle2d;
3073
3057
  component(shape: DrHighlightShape): react_jsx_runtime.JSX.Element;
3074
3058
  backgroundComponent(shape: DrHighlightShape): react_jsx_runtime.JSX.Element;
@@ -3138,11 +3122,6 @@ declare class LineShapeUtil extends ShapeUtil<DrLineShape> {
3138
3122
  hideSelectionBoundsBg(shape: DrLineShape): boolean;
3139
3123
  hideInMinimap(): boolean;
3140
3124
  getDefaultProps(): DrLineShape['props'];
3141
- getLodStyle(shape: DrLineShape): {
3142
- fill: null;
3143
- stroke: string;
3144
- strokeWidth: number;
3145
- };
3146
3125
  getGeometry(shape: DrLineShape): PathBuilderGeometry2d;
3147
3126
  getHandles(shape: DrLineShape): DrHandle[];
3148
3127
  onResize(shape: DrLineShape, info: DrResizeInfo<DrLineShape>): {
package/dist/index.mjs CHANGED
@@ -27391,10 +27391,6 @@ var ArrowShapeUtil = class extends ShapeUtil {
27391
27391
  scale: 1
27392
27392
  };
27393
27393
  }
27394
- getLodStyle(shape) {
27395
- const dv = getDisplayValues(this, shape);
27396
- return { fill: null, stroke: dv.strokeColor, strokeWidth: dv.strokeWidth };
27397
- }
27398
27394
  getGeometry(shape) {
27399
27395
  const isEditing = this.editor.getEditingShapeId() === shape.id;
27400
27396
  const info = getArrowInfo(this.editor, shape);
@@ -28854,17 +28850,6 @@ var DrawShapeUtil = class extends ShapeUtil {
28854
28850
  scaleY: 1
28855
28851
  };
28856
28852
  }
28857
- getLodStyle(shape) {
28858
- if (!shape.props.isComplete || shape.props.segments.length === 0) return null;
28859
- const dv = getDisplayValues(this, shape);
28860
- const sw = (dv.strokeWidth + 1) * shape.props.scale;
28861
- const filled = shape.props.isClosed && shape.props.fill !== "none";
28862
- return {
28863
- fill: filled ? dv.fillColor : null,
28864
- stroke: dv.strokeColor,
28865
- strokeWidth: sw
28866
- };
28867
- }
28868
28853
  getGeometry(shape) {
28869
28854
  const points = getPointsFromDrawSegments(
28870
28855
  shape.props.segments,
@@ -30795,16 +30780,6 @@ var HighlightShapeUtil = class extends ShapeUtil {
30795
30780
  scaleY: 1
30796
30781
  };
30797
30782
  }
30798
- getLodStyle(shape) {
30799
- if (!shape.props.isComplete || shape.props.segments.length === 0) return null;
30800
- const dv = getDisplayValues(this, shape);
30801
- return {
30802
- fill: null,
30803
- stroke: dv.strokeColor,
30804
- strokeWidth: dv.strokeWidth,
30805
- opacity: dv.underlayOpacity
30806
- };
30807
- }
30808
30783
  getGeometry(shape) {
30809
30784
  const dv = getDisplayValues(this, shape);
30810
30785
  const strokeWidth = dv.strokeWidth * shape.props.scale;
@@ -31792,10 +31767,6 @@ var LineShapeUtil = class extends ShapeUtil {
31792
31767
  scale: 1
31793
31768
  };
31794
31769
  }
31795
- getLodStyle(shape) {
31796
- const dv = getDisplayValues(this, shape);
31797
- return { fill: null, stroke: dv.strokeColor, strokeWidth: dv.strokeWidth };
31798
- }
31799
31770
  getGeometry(shape) {
31800
31771
  const geometry = getPathForLineShape(shape).toGeometry();
31801
31772
  assert(geometry instanceof PathBuilderGeometry2d);
@@ -38249,23 +38220,6 @@ function InternalProviders({
38249
38220
  const mergedOverrides = useMergedOverrides(overrides);
38250
38221
  return /* @__PURE__ */ jsx(ActionsProvider, { overrides: mergedOverrides.actions, children: /* @__PURE__ */ jsx(ToolsProvider, { overrides: mergedOverrides.tools, children }) });
38251
38222
  }
38252
- function useEditorEvents() {
38253
- const editor = useEditor();
38254
- const { addToast } = useToasts();
38255
- useEffect(() => {
38256
- function handleMaxShapes({ name, count }) {
38257
- addToast({
38258
- title: "Maximum shapes reached",
38259
- description: `You've reached the maximum number of shapes allowed on ${name} (${count}). Please delete some shapes or move to a different page to continue.`,
38260
- severity: "warning"
38261
- });
38262
- }
38263
- editor.addListener("max-shapes", handleMaxShapes);
38264
- return () => {
38265
- editor.removeListener("max-shapes", handleMaxShapes);
38266
- };
38267
- }, [editor, addToast]);
38268
- }
38269
38223
  var DrawUi = React4__default.memo(function DrawUi2({
38270
38224
  renderDebugMenuItems,
38271
38225
  children,
@@ -38315,7 +38269,6 @@ var DrawUiContent = React4__default.memo(function DrawUI() {
38315
38269
  A11y,
38316
38270
  FollowingIndicator
38317
38271
  } = useDrawUiComponents();
38318
- useEditorEvents();
38319
38272
  const rIsEditingAnything = useRef(false);
38320
38273
  const rHidingTimeout = useRef(-1);
38321
38274
  const [hideToolbarWhileEditing, setHideToolbarWhileEditing] = useState(false);
@@ -40294,7 +40247,7 @@ init_sanitizeSvg();
40294
40247
  // src/index.ts
40295
40248
  registerDrawLibraryVersion(
40296
40249
  "@ibodr/draw",
40297
- "0.2.12",
40250
+ "0.2.14",
40298
40251
  "esm"
40299
40252
  );
40300
40253
  /*!