react-resizable-panels 2.1.6 → 2.1.7

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.
Files changed (87) hide show
  1. package/dist/react-resizable-panels.browser.cjs.js +7 -7
  2. package/dist/react-resizable-panels.browser.development.cjs.js +7 -7
  3. package/dist/react-resizable-panels.browser.development.esm.js +7 -7
  4. package/dist/react-resizable-panels.browser.esm.js +7 -7
  5. package/dist/react-resizable-panels.cjs.js +7 -7
  6. package/dist/react-resizable-panels.development.cjs.js +7 -7
  7. package/dist/react-resizable-panels.development.esm.js +7 -7
  8. package/dist/react-resizable-panels.development.node.cjs.js +7 -7
  9. package/dist/react-resizable-panels.development.node.esm.js +7 -7
  10. package/dist/react-resizable-panels.esm.js +7 -7
  11. package/dist/react-resizable-panels.node.cjs.js +7 -7
  12. package/dist/react-resizable-panels.node.esm.js +7 -7
  13. package/package.json +7 -1
  14. package/.eslintrc.cjs +0 -27
  15. package/CHANGELOG.md +0 -574
  16. package/jest.config.js +0 -10
  17. package/src/Panel.test.tsx +0 -1084
  18. package/src/Panel.ts +0 -259
  19. package/src/PanelGroup.test.tsx +0 -443
  20. package/src/PanelGroup.ts +0 -999
  21. package/src/PanelGroupContext.ts +0 -42
  22. package/src/PanelResizeHandle.test.tsx +0 -367
  23. package/src/PanelResizeHandle.ts +0 -246
  24. package/src/PanelResizeHandleRegistry.ts +0 -336
  25. package/src/constants.ts +0 -1
  26. package/src/env-conditions/browser.ts +0 -1
  27. package/src/env-conditions/development.ts +0 -1
  28. package/src/env-conditions/node.ts +0 -1
  29. package/src/env-conditions/production.ts +0 -1
  30. package/src/env-conditions/unknown.ts +0 -1
  31. package/src/hooks/useForceUpdate.ts +0 -7
  32. package/src/hooks/useIsomorphicEffect.ts +0 -8
  33. package/src/hooks/useUniqueId.ts +0 -19
  34. package/src/hooks/useWindowSplitterBehavior.ts +0 -90
  35. package/src/hooks/useWindowSplitterPanelGroupBehavior.ts +0 -201
  36. package/src/index.ts +0 -77
  37. package/src/types.ts +0 -5
  38. package/src/utils/adjustLayoutByDelta.test.ts +0 -2061
  39. package/src/utils/adjustLayoutByDelta.ts +0 -308
  40. package/src/utils/arrays.ts +0 -13
  41. package/src/utils/assert.ts +0 -10
  42. package/src/utils/calculateAriaValues.test.ts +0 -106
  43. package/src/utils/calculateAriaValues.ts +0 -45
  44. package/src/utils/calculateDeltaPercentage.ts +0 -63
  45. package/src/utils/calculateDragOffsetPercentage.ts +0 -40
  46. package/src/utils/calculateUnsafeDefaultLayout.test.ts +0 -87
  47. package/src/utils/calculateUnsafeDefaultLayout.ts +0 -50
  48. package/src/utils/callPanelCallbacks.ts +0 -49
  49. package/src/utils/compareLayouts.test.ts +0 -9
  50. package/src/utils/compareLayouts.ts +0 -12
  51. package/src/utils/computePanelFlexBoxStyle.test.ts +0 -123
  52. package/src/utils/computePanelFlexBoxStyle.ts +0 -50
  53. package/src/utils/csp.ts +0 -9
  54. package/src/utils/cursor.ts +0 -103
  55. package/src/utils/debounce.ts +0 -18
  56. package/src/utils/determinePivotIndices.ts +0 -15
  57. package/src/utils/dom/getPanelElement.ts +0 -10
  58. package/src/utils/dom/getPanelElementsForGroup.ts +0 -8
  59. package/src/utils/dom/getPanelGroupElement.ts +0 -21
  60. package/src/utils/dom/getResizeHandleElement.ts +0 -10
  61. package/src/utils/dom/getResizeHandleElementIndex.ts +0 -13
  62. package/src/utils/dom/getResizeHandleElementsForGroup.ts +0 -10
  63. package/src/utils/dom/getResizeHandlePanelIds.ts +0 -19
  64. package/src/utils/events/getResizeEventCoordinates.ts +0 -23
  65. package/src/utils/events/getResizeEventCursorPosition.ts +0 -14
  66. package/src/utils/events/index.ts +0 -13
  67. package/src/utils/getInputType.ts +0 -5
  68. package/src/utils/initializeDefaultStorage.ts +0 -26
  69. package/src/utils/numbers/fuzzyCompareNumbers.test.ts +0 -16
  70. package/src/utils/numbers/fuzzyCompareNumbers.ts +0 -21
  71. package/src/utils/numbers/fuzzyLayoutsEqual.ts +0 -22
  72. package/src/utils/numbers/fuzzyNumbersEqual.ts +0 -9
  73. package/src/utils/rects/getIntersectingRectangle.test.ts +0 -198
  74. package/src/utils/rects/getIntersectingRectangle.ts +0 -28
  75. package/src/utils/rects/intersects.test.ts +0 -197
  76. package/src/utils/rects/intersects.ts +0 -23
  77. package/src/utils/rects/types.ts +0 -6
  78. package/src/utils/resizePanel.test.ts +0 -59
  79. package/src/utils/resizePanel.ts +0 -47
  80. package/src/utils/serialization.ts +0 -87
  81. package/src/utils/test-utils.ts +0 -205
  82. package/src/utils/validatePanelConstraints.test.ts +0 -143
  83. package/src/utils/validatePanelConstraints.ts +0 -69
  84. package/src/utils/validatePanelGroupLayout.test.ts +0 -148
  85. package/src/utils/validatePanelGroupLayout.ts +0 -95
  86. package/src/vendor/react.ts +0 -73
  87. package/src/vendor/stacking-order.ts +0 -139
@@ -331,8 +331,8 @@ function intersects(rectOne, rectTwo, strict) {
331
331
  /**
332
332
  * Determine which of two nodes appears in front of the other —
333
333
  * if `a` is in front, returns 1, otherwise returns -1
334
- * @param {HTMLElement} a
335
- * @param {HTMLElement} b
334
+ * @param {HTMLElement | SVGElement} a
335
+ * @param {HTMLElement | SVGElement} b
336
336
  */
337
337
  function compare(a, b) {
338
338
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -370,7 +370,7 @@ function compare(a, b) {
370
370
  }
371
371
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
372
372
 
373
- /** @param {HTMLElement} node */
373
+ /** @param {HTMLElement | SVGElement} node */
374
374
  function is_flex_item(node) {
375
375
  var _get_parent;
376
376
  // @ts-ignore
@@ -378,7 +378,7 @@ function is_flex_item(node) {
378
378
  return display === "flex" || display === "inline-flex";
379
379
  }
380
380
 
381
- /** @param {HTMLElement} node */
381
+ /** @param {HTMLElement | SVGElement} node */
382
382
  function creates_stacking_context(node) {
383
383
  const style = getComputedStyle(node);
384
384
 
@@ -403,7 +403,7 @@ function creates_stacking_context(node) {
403
403
  return false;
404
404
  }
405
405
 
406
- /** @param {HTMLElement[]} nodes */
406
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
407
407
  function find_stacking_context(nodes) {
408
408
  let i = nodes.length;
409
409
  while (i--) {
@@ -414,7 +414,7 @@ function find_stacking_context(nodes) {
414
414
  return null;
415
415
  }
416
416
 
417
- /** @param {HTMLElement} node */
417
+ /** @param {HTMLElement | SVGElement} node */
418
418
  function get_z_index(node) {
419
419
  return node && Number(getComputedStyle(node).zIndex) || 0;
420
420
  }
@@ -576,7 +576,7 @@ function recalculateIntersectingHandles({
576
576
  }) {
577
577
  intersectingHandles.splice(0);
578
578
  let targetElement = null;
579
- if (target instanceof HTMLElement) {
579
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
580
580
  targetElement = target;
581
581
  }
582
582
  registeredResizeHandlers.forEach(data => {
@@ -337,8 +337,8 @@ function intersects(rectOne, rectTwo, strict) {
337
337
  /**
338
338
  * Determine which of two nodes appears in front of the other —
339
339
  * if `a` is in front, returns 1, otherwise returns -1
340
- * @param {HTMLElement} a
341
- * @param {HTMLElement} b
340
+ * @param {HTMLElement | SVGElement} a
341
+ * @param {HTMLElement | SVGElement} b
342
342
  */
343
343
  function compare(a, b) {
344
344
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -376,7 +376,7 @@ function compare(a, b) {
376
376
  }
377
377
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
378
378
 
379
- /** @param {HTMLElement} node */
379
+ /** @param {HTMLElement | SVGElement} node */
380
380
  function is_flex_item(node) {
381
381
  var _get_parent;
382
382
  // @ts-ignore
@@ -384,7 +384,7 @@ function is_flex_item(node) {
384
384
  return display === "flex" || display === "inline-flex";
385
385
  }
386
386
 
387
- /** @param {HTMLElement} node */
387
+ /** @param {HTMLElement | SVGElement} node */
388
388
  function creates_stacking_context(node) {
389
389
  const style = getComputedStyle(node);
390
390
 
@@ -409,7 +409,7 @@ function creates_stacking_context(node) {
409
409
  return false;
410
410
  }
411
411
 
412
- /** @param {HTMLElement[]} nodes */
412
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
413
413
  function find_stacking_context(nodes) {
414
414
  let i = nodes.length;
415
415
  while (i--) {
@@ -420,7 +420,7 @@ function find_stacking_context(nodes) {
420
420
  return null;
421
421
  }
422
422
 
423
- /** @param {HTMLElement} node */
423
+ /** @param {HTMLElement | SVGElement} node */
424
424
  function get_z_index(node) {
425
425
  return node && Number(getComputedStyle(node).zIndex) || 0;
426
426
  }
@@ -582,7 +582,7 @@ function recalculateIntersectingHandles({
582
582
  }) {
583
583
  intersectingHandles.splice(0);
584
584
  let targetElement = null;
585
- if (target instanceof HTMLElement) {
585
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
586
586
  targetElement = target;
587
587
  }
588
588
  registeredResizeHandlers.forEach(data => {
@@ -313,8 +313,8 @@ function intersects(rectOne, rectTwo, strict) {
313
313
  /**
314
314
  * Determine which of two nodes appears in front of the other —
315
315
  * if `a` is in front, returns 1, otherwise returns -1
316
- * @param {HTMLElement} a
317
- * @param {HTMLElement} b
316
+ * @param {HTMLElement | SVGElement} a
317
+ * @param {HTMLElement | SVGElement} b
318
318
  */
319
319
  function compare(a, b) {
320
320
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -352,7 +352,7 @@ function compare(a, b) {
352
352
  }
353
353
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
354
354
 
355
- /** @param {HTMLElement} node */
355
+ /** @param {HTMLElement | SVGElement} node */
356
356
  function is_flex_item(node) {
357
357
  var _get_parent;
358
358
  // @ts-ignore
@@ -360,7 +360,7 @@ function is_flex_item(node) {
360
360
  return display === "flex" || display === "inline-flex";
361
361
  }
362
362
 
363
- /** @param {HTMLElement} node */
363
+ /** @param {HTMLElement | SVGElement} node */
364
364
  function creates_stacking_context(node) {
365
365
  const style = getComputedStyle(node);
366
366
 
@@ -385,7 +385,7 @@ function creates_stacking_context(node) {
385
385
  return false;
386
386
  }
387
387
 
388
- /** @param {HTMLElement[]} nodes */
388
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
389
389
  function find_stacking_context(nodes) {
390
390
  let i = nodes.length;
391
391
  while (i--) {
@@ -396,7 +396,7 @@ function find_stacking_context(nodes) {
396
396
  return null;
397
397
  }
398
398
 
399
- /** @param {HTMLElement} node */
399
+ /** @param {HTMLElement | SVGElement} node */
400
400
  function get_z_index(node) {
401
401
  return node && Number(getComputedStyle(node).zIndex) || 0;
402
402
  }
@@ -558,7 +558,7 @@ function recalculateIntersectingHandles({
558
558
  }) {
559
559
  intersectingHandles.splice(0);
560
560
  let targetElement = null;
561
- if (target instanceof HTMLElement) {
561
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
562
562
  targetElement = target;
563
563
  }
564
564
  registeredResizeHandlers.forEach(data => {
@@ -307,8 +307,8 @@ function intersects(rectOne, rectTwo, strict) {
307
307
  /**
308
308
  * Determine which of two nodes appears in front of the other —
309
309
  * if `a` is in front, returns 1, otherwise returns -1
310
- * @param {HTMLElement} a
311
- * @param {HTMLElement} b
310
+ * @param {HTMLElement | SVGElement} a
311
+ * @param {HTMLElement | SVGElement} b
312
312
  */
313
313
  function compare(a, b) {
314
314
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -346,7 +346,7 @@ function compare(a, b) {
346
346
  }
347
347
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
348
348
 
349
- /** @param {HTMLElement} node */
349
+ /** @param {HTMLElement | SVGElement} node */
350
350
  function is_flex_item(node) {
351
351
  var _get_parent;
352
352
  // @ts-ignore
@@ -354,7 +354,7 @@ function is_flex_item(node) {
354
354
  return display === "flex" || display === "inline-flex";
355
355
  }
356
356
 
357
- /** @param {HTMLElement} node */
357
+ /** @param {HTMLElement | SVGElement} node */
358
358
  function creates_stacking_context(node) {
359
359
  const style = getComputedStyle(node);
360
360
 
@@ -379,7 +379,7 @@ function creates_stacking_context(node) {
379
379
  return false;
380
380
  }
381
381
 
382
- /** @param {HTMLElement[]} nodes */
382
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
383
383
  function find_stacking_context(nodes) {
384
384
  let i = nodes.length;
385
385
  while (i--) {
@@ -390,7 +390,7 @@ function find_stacking_context(nodes) {
390
390
  return null;
391
391
  }
392
392
 
393
- /** @param {HTMLElement} node */
393
+ /** @param {HTMLElement | SVGElement} node */
394
394
  function get_z_index(node) {
395
395
  return node && Number(getComputedStyle(node).zIndex) || 0;
396
396
  }
@@ -552,7 +552,7 @@ function recalculateIntersectingHandles({
552
552
  }) {
553
553
  intersectingHandles.splice(0);
554
554
  let targetElement = null;
555
- if (target instanceof HTMLElement) {
555
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
556
556
  targetElement = target;
557
557
  }
558
558
  registeredResizeHandlers.forEach(data => {
@@ -333,8 +333,8 @@ function intersects(rectOne, rectTwo, strict) {
333
333
  /**
334
334
  * Determine which of two nodes appears in front of the other —
335
335
  * if `a` is in front, returns 1, otherwise returns -1
336
- * @param {HTMLElement} a
337
- * @param {HTMLElement} b
336
+ * @param {HTMLElement | SVGElement} a
337
+ * @param {HTMLElement | SVGElement} b
338
338
  */
339
339
  function compare(a, b) {
340
340
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -372,7 +372,7 @@ function compare(a, b) {
372
372
  }
373
373
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
374
374
 
375
- /** @param {HTMLElement} node */
375
+ /** @param {HTMLElement | SVGElement} node */
376
376
  function is_flex_item(node) {
377
377
  var _get_parent;
378
378
  // @ts-ignore
@@ -380,7 +380,7 @@ function is_flex_item(node) {
380
380
  return display === "flex" || display === "inline-flex";
381
381
  }
382
382
 
383
- /** @param {HTMLElement} node */
383
+ /** @param {HTMLElement | SVGElement} node */
384
384
  function creates_stacking_context(node) {
385
385
  const style = getComputedStyle(node);
386
386
 
@@ -405,7 +405,7 @@ function creates_stacking_context(node) {
405
405
  return false;
406
406
  }
407
407
 
408
- /** @param {HTMLElement[]} nodes */
408
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
409
409
  function find_stacking_context(nodes) {
410
410
  let i = nodes.length;
411
411
  while (i--) {
@@ -416,7 +416,7 @@ function find_stacking_context(nodes) {
416
416
  return null;
417
417
  }
418
418
 
419
- /** @param {HTMLElement} node */
419
+ /** @param {HTMLElement | SVGElement} node */
420
420
  function get_z_index(node) {
421
421
  return node && Number(getComputedStyle(node).zIndex) || 0;
422
422
  }
@@ -578,7 +578,7 @@ function recalculateIntersectingHandles({
578
578
  }) {
579
579
  intersectingHandles.splice(0);
580
580
  let targetElement = null;
581
- if (target instanceof HTMLElement) {
581
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
582
582
  targetElement = target;
583
583
  }
584
584
  registeredResizeHandlers.forEach(data => {
@@ -344,8 +344,8 @@ function intersects(rectOne, rectTwo, strict) {
344
344
  /**
345
345
  * Determine which of two nodes appears in front of the other —
346
346
  * if `a` is in front, returns 1, otherwise returns -1
347
- * @param {HTMLElement} a
348
- * @param {HTMLElement} b
347
+ * @param {HTMLElement | SVGElement} a
348
+ * @param {HTMLElement | SVGElement} b
349
349
  */
350
350
  function compare(a, b) {
351
351
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -383,7 +383,7 @@ function compare(a, b) {
383
383
  }
384
384
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
385
385
 
386
- /** @param {HTMLElement} node */
386
+ /** @param {HTMLElement | SVGElement} node */
387
387
  function is_flex_item(node) {
388
388
  var _get_parent;
389
389
  // @ts-ignore
@@ -391,7 +391,7 @@ function is_flex_item(node) {
391
391
  return display === "flex" || display === "inline-flex";
392
392
  }
393
393
 
394
- /** @param {HTMLElement} node */
394
+ /** @param {HTMLElement | SVGElement} node */
395
395
  function creates_stacking_context(node) {
396
396
  const style = getComputedStyle(node);
397
397
 
@@ -416,7 +416,7 @@ function creates_stacking_context(node) {
416
416
  return false;
417
417
  }
418
418
 
419
- /** @param {HTMLElement[]} nodes */
419
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
420
420
  function find_stacking_context(nodes) {
421
421
  let i = nodes.length;
422
422
  while (i--) {
@@ -427,7 +427,7 @@ function find_stacking_context(nodes) {
427
427
  return null;
428
428
  }
429
429
 
430
- /** @param {HTMLElement} node */
430
+ /** @param {HTMLElement | SVGElement} node */
431
431
  function get_z_index(node) {
432
432
  return node && Number(getComputedStyle(node).zIndex) || 0;
433
433
  }
@@ -589,7 +589,7 @@ function recalculateIntersectingHandles({
589
589
  }) {
590
590
  intersectingHandles.splice(0);
591
591
  let targetElement = null;
592
- if (target instanceof HTMLElement) {
592
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
593
593
  targetElement = target;
594
594
  }
595
595
  registeredResizeHandlers.forEach(data => {
@@ -320,8 +320,8 @@ function intersects(rectOne, rectTwo, strict) {
320
320
  /**
321
321
  * Determine which of two nodes appears in front of the other —
322
322
  * if `a` is in front, returns 1, otherwise returns -1
323
- * @param {HTMLElement} a
324
- * @param {HTMLElement} b
323
+ * @param {HTMLElement | SVGElement} a
324
+ * @param {HTMLElement | SVGElement} b
325
325
  */
326
326
  function compare(a, b) {
327
327
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -359,7 +359,7 @@ function compare(a, b) {
359
359
  }
360
360
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
361
361
 
362
- /** @param {HTMLElement} node */
362
+ /** @param {HTMLElement | SVGElement} node */
363
363
  function is_flex_item(node) {
364
364
  var _get_parent;
365
365
  // @ts-ignore
@@ -367,7 +367,7 @@ function is_flex_item(node) {
367
367
  return display === "flex" || display === "inline-flex";
368
368
  }
369
369
 
370
- /** @param {HTMLElement} node */
370
+ /** @param {HTMLElement | SVGElement} node */
371
371
  function creates_stacking_context(node) {
372
372
  const style = getComputedStyle(node);
373
373
 
@@ -392,7 +392,7 @@ function creates_stacking_context(node) {
392
392
  return false;
393
393
  }
394
394
 
395
- /** @param {HTMLElement[]} nodes */
395
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
396
396
  function find_stacking_context(nodes) {
397
397
  let i = nodes.length;
398
398
  while (i--) {
@@ -403,7 +403,7 @@ function find_stacking_context(nodes) {
403
403
  return null;
404
404
  }
405
405
 
406
- /** @param {HTMLElement} node */
406
+ /** @param {HTMLElement | SVGElement} node */
407
407
  function get_z_index(node) {
408
408
  return node && Number(getComputedStyle(node).zIndex) || 0;
409
409
  }
@@ -565,7 +565,7 @@ function recalculateIntersectingHandles({
565
565
  }) {
566
566
  intersectingHandles.splice(0);
567
567
  let targetElement = null;
568
- if (target instanceof HTMLElement) {
568
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
569
569
  targetElement = target;
570
570
  }
571
571
  registeredResizeHandlers.forEach(data => {
@@ -306,8 +306,8 @@ function intersects(rectOne, rectTwo, strict) {
306
306
  /**
307
307
  * Determine which of two nodes appears in front of the other —
308
308
  * if `a` is in front, returns 1, otherwise returns -1
309
- * @param {HTMLElement} a
310
- * @param {HTMLElement} b
309
+ * @param {HTMLElement | SVGElement} a
310
+ * @param {HTMLElement | SVGElement} b
311
311
  */
312
312
  function compare(a, b) {
313
313
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -345,7 +345,7 @@ function compare(a, b) {
345
345
  }
346
346
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
347
347
 
348
- /** @param {HTMLElement} node */
348
+ /** @param {HTMLElement | SVGElement} node */
349
349
  function is_flex_item(node) {
350
350
  var _get_parent;
351
351
  // @ts-ignore
@@ -353,7 +353,7 @@ function is_flex_item(node) {
353
353
  return display === "flex" || display === "inline-flex";
354
354
  }
355
355
 
356
- /** @param {HTMLElement} node */
356
+ /** @param {HTMLElement | SVGElement} node */
357
357
  function creates_stacking_context(node) {
358
358
  const style = getComputedStyle(node);
359
359
 
@@ -378,7 +378,7 @@ function creates_stacking_context(node) {
378
378
  return false;
379
379
  }
380
380
 
381
- /** @param {HTMLElement[]} nodes */
381
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
382
382
  function find_stacking_context(nodes) {
383
383
  let i = nodes.length;
384
384
  while (i--) {
@@ -389,7 +389,7 @@ function find_stacking_context(nodes) {
389
389
  return null;
390
390
  }
391
391
 
392
- /** @param {HTMLElement} node */
392
+ /** @param {HTMLElement | SVGElement} node */
393
393
  function get_z_index(node) {
394
394
  return node && Number(getComputedStyle(node).zIndex) || 0;
395
395
  }
@@ -551,7 +551,7 @@ function recalculateIntersectingHandles({
551
551
  }) {
552
552
  intersectingHandles.splice(0);
553
553
  let targetElement = null;
554
- if (target instanceof HTMLElement) {
554
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
555
555
  targetElement = target;
556
556
  }
557
557
  registeredResizeHandlers.forEach(data => {
@@ -282,8 +282,8 @@ function intersects(rectOne, rectTwo, strict) {
282
282
  /**
283
283
  * Determine which of two nodes appears in front of the other —
284
284
  * if `a` is in front, returns 1, otherwise returns -1
285
- * @param {HTMLElement} a
286
- * @param {HTMLElement} b
285
+ * @param {HTMLElement | SVGElement} a
286
+ * @param {HTMLElement | SVGElement} b
287
287
  */
288
288
  function compare(a, b) {
289
289
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -321,7 +321,7 @@ function compare(a, b) {
321
321
  }
322
322
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
323
323
 
324
- /** @param {HTMLElement} node */
324
+ /** @param {HTMLElement | SVGElement} node */
325
325
  function is_flex_item(node) {
326
326
  var _get_parent;
327
327
  // @ts-ignore
@@ -329,7 +329,7 @@ function is_flex_item(node) {
329
329
  return display === "flex" || display === "inline-flex";
330
330
  }
331
331
 
332
- /** @param {HTMLElement} node */
332
+ /** @param {HTMLElement | SVGElement} node */
333
333
  function creates_stacking_context(node) {
334
334
  const style = getComputedStyle(node);
335
335
 
@@ -354,7 +354,7 @@ function creates_stacking_context(node) {
354
354
  return false;
355
355
  }
356
356
 
357
- /** @param {HTMLElement[]} nodes */
357
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
358
358
  function find_stacking_context(nodes) {
359
359
  let i = nodes.length;
360
360
  while (i--) {
@@ -365,7 +365,7 @@ function find_stacking_context(nodes) {
365
365
  return null;
366
366
  }
367
367
 
368
- /** @param {HTMLElement} node */
368
+ /** @param {HTMLElement | SVGElement} node */
369
369
  function get_z_index(node) {
370
370
  return node && Number(getComputedStyle(node).zIndex) || 0;
371
371
  }
@@ -527,7 +527,7 @@ function recalculateIntersectingHandles({
527
527
  }) {
528
528
  intersectingHandles.splice(0);
529
529
  let targetElement = null;
530
- if (target instanceof HTMLElement) {
530
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
531
531
  targetElement = target;
532
532
  }
533
533
  registeredResizeHandlers.forEach(data => {
@@ -309,8 +309,8 @@ function intersects(rectOne, rectTwo, strict) {
309
309
  /**
310
310
  * Determine which of two nodes appears in front of the other —
311
311
  * if `a` is in front, returns 1, otherwise returns -1
312
- * @param {HTMLElement} a
313
- * @param {HTMLElement} b
312
+ * @param {HTMLElement | SVGElement} a
313
+ * @param {HTMLElement | SVGElement} b
314
314
  */
315
315
  function compare(a, b) {
316
316
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -348,7 +348,7 @@ function compare(a, b) {
348
348
  }
349
349
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
350
350
 
351
- /** @param {HTMLElement} node */
351
+ /** @param {HTMLElement | SVGElement} node */
352
352
  function is_flex_item(node) {
353
353
  var _get_parent;
354
354
  // @ts-ignore
@@ -356,7 +356,7 @@ function is_flex_item(node) {
356
356
  return display === "flex" || display === "inline-flex";
357
357
  }
358
358
 
359
- /** @param {HTMLElement} node */
359
+ /** @param {HTMLElement | SVGElement} node */
360
360
  function creates_stacking_context(node) {
361
361
  const style = getComputedStyle(node);
362
362
 
@@ -381,7 +381,7 @@ function creates_stacking_context(node) {
381
381
  return false;
382
382
  }
383
383
 
384
- /** @param {HTMLElement[]} nodes */
384
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
385
385
  function find_stacking_context(nodes) {
386
386
  let i = nodes.length;
387
387
  while (i--) {
@@ -392,7 +392,7 @@ function find_stacking_context(nodes) {
392
392
  return null;
393
393
  }
394
394
 
395
- /** @param {HTMLElement} node */
395
+ /** @param {HTMLElement | SVGElement} node */
396
396
  function get_z_index(node) {
397
397
  return node && Number(getComputedStyle(node).zIndex) || 0;
398
398
  }
@@ -554,7 +554,7 @@ function recalculateIntersectingHandles({
554
554
  }) {
555
555
  intersectingHandles.splice(0);
556
556
  let targetElement = null;
557
- if (target instanceof HTMLElement) {
557
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
558
558
  targetElement = target;
559
559
  }
560
560
  registeredResizeHandlers.forEach(data => {
@@ -295,8 +295,8 @@ function intersects(rectOne, rectTwo, strict) {
295
295
  /**
296
296
  * Determine which of two nodes appears in front of the other —
297
297
  * if `a` is in front, returns 1, otherwise returns -1
298
- * @param {HTMLElement} a
299
- * @param {HTMLElement} b
298
+ * @param {HTMLElement | SVGElement} a
299
+ * @param {HTMLElement | SVGElement} b
300
300
  */
301
301
  function compare(a, b) {
302
302
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -334,7 +334,7 @@ function compare(a, b) {
334
334
  }
335
335
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
336
336
 
337
- /** @param {HTMLElement} node */
337
+ /** @param {HTMLElement | SVGElement} node */
338
338
  function is_flex_item(node) {
339
339
  var _get_parent;
340
340
  // @ts-ignore
@@ -342,7 +342,7 @@ function is_flex_item(node) {
342
342
  return display === "flex" || display === "inline-flex";
343
343
  }
344
344
 
345
- /** @param {HTMLElement} node */
345
+ /** @param {HTMLElement | SVGElement} node */
346
346
  function creates_stacking_context(node) {
347
347
  const style = getComputedStyle(node);
348
348
 
@@ -367,7 +367,7 @@ function creates_stacking_context(node) {
367
367
  return false;
368
368
  }
369
369
 
370
- /** @param {HTMLElement[]} nodes */
370
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
371
371
  function find_stacking_context(nodes) {
372
372
  let i = nodes.length;
373
373
  while (i--) {
@@ -378,7 +378,7 @@ function find_stacking_context(nodes) {
378
378
  return null;
379
379
  }
380
380
 
381
- /** @param {HTMLElement} node */
381
+ /** @param {HTMLElement | SVGElement} node */
382
382
  function get_z_index(node) {
383
383
  return node && Number(getComputedStyle(node).zIndex) || 0;
384
384
  }
@@ -540,7 +540,7 @@ function recalculateIntersectingHandles({
540
540
  }) {
541
541
  intersectingHandles.splice(0);
542
542
  let targetElement = null;
543
- if (target instanceof HTMLElement) {
543
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
544
544
  targetElement = target;
545
545
  }
546
546
  registeredResizeHandlers.forEach(data => {
@@ -271,8 +271,8 @@ function intersects(rectOne, rectTwo, strict) {
271
271
  /**
272
272
  * Determine which of two nodes appears in front of the other —
273
273
  * if `a` is in front, returns 1, otherwise returns -1
274
- * @param {HTMLElement} a
275
- * @param {HTMLElement} b
274
+ * @param {HTMLElement | SVGElement} a
275
+ * @param {HTMLElement | SVGElement} b
276
276
  */
277
277
  function compare(a, b) {
278
278
  if (a === b) throw new Error("Cannot compare node with itself");
@@ -310,7 +310,7 @@ function compare(a, b) {
310
310
  }
311
311
  const props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
312
312
 
313
- /** @param {HTMLElement} node */
313
+ /** @param {HTMLElement | SVGElement} node */
314
314
  function is_flex_item(node) {
315
315
  var _get_parent;
316
316
  // @ts-ignore
@@ -318,7 +318,7 @@ function is_flex_item(node) {
318
318
  return display === "flex" || display === "inline-flex";
319
319
  }
320
320
 
321
- /** @param {HTMLElement} node */
321
+ /** @param {HTMLElement | SVGElement} node */
322
322
  function creates_stacking_context(node) {
323
323
  const style = getComputedStyle(node);
324
324
 
@@ -343,7 +343,7 @@ function creates_stacking_context(node) {
343
343
  return false;
344
344
  }
345
345
 
346
- /** @param {HTMLElement[]} nodes */
346
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
347
347
  function find_stacking_context(nodes) {
348
348
  let i = nodes.length;
349
349
  while (i--) {
@@ -354,7 +354,7 @@ function find_stacking_context(nodes) {
354
354
  return null;
355
355
  }
356
356
 
357
- /** @param {HTMLElement} node */
357
+ /** @param {HTMLElement | SVGElement} node */
358
358
  function get_z_index(node) {
359
359
  return node && Number(getComputedStyle(node).zIndex) || 0;
360
360
  }
@@ -516,7 +516,7 @@ function recalculateIntersectingHandles({
516
516
  }) {
517
517
  intersectingHandles.splice(0);
518
518
  let targetElement = null;
519
- if (target instanceof HTMLElement) {
519
+ if (target instanceof HTMLElement || target instanceof SVGElement) {
520
520
  targetElement = target;
521
521
  }
522
522
  registeredResizeHandlers.forEach(data => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-resizable-panels",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "React components for resizable panel groups/layouts",
5
5
  "author": "Brian Vaughn <brian.david.vaughn@gmail.com>",
6
6
  "license": "MIT",
@@ -11,6 +11,12 @@
11
11
  "source": "src/index.ts",
12
12
  "main": "dist/react-resizable-panels.cjs.js",
13
13
  "module": "dist/react-resizable-panels.esm.js",
14
+ "files": [
15
+ "dist",
16
+ "package.json",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
14
20
  "exports": {
15
21
  ".": {
16
22
  "types": {