@automattic/jetpack-components 0.73.0 → 0.73.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [0.73.2] - 2025-05-22
6
+ ### Fixed
7
+ - Fixed Swipeable width being stale on window resize. [#43510]
8
+
9
+ ## [0.73.1] - 2025-05-19
10
+ ### Changed
11
+ - Update dependencies.
12
+
5
13
  ## [0.73.0] - 2025-05-12
6
14
  ### Changed
7
15
  - Use `formatCurrency()` and `getCurrencyObject()` functions from the `@automattic/number-formatters` package. [#42796]
@@ -1392,6 +1400,8 @@
1392
1400
  ### Changed
1393
1401
  - Update node version requirement to 14.16.1
1394
1402
 
1403
+ [0.73.2]: https://github.com/Automattic/jetpack-components/compare/0.73.1...0.73.2
1404
+ [0.73.1]: https://github.com/Automattic/jetpack-components/compare/0.73.0...0.73.1
1395
1405
  [0.73.0]: https://github.com/Automattic/jetpack-components/compare/0.72.6...0.73.0
1396
1406
  [0.72.6]: https://github.com/Automattic/jetpack-components/compare/0.72.5...0.72.6
1397
1407
  [0.72.5]: https://github.com/Automattic/jetpack-components/compare/0.72.4...0.72.5
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { createElement as _createElement } from "react";
2
3
  import clsx from 'clsx';
3
4
  import { Children, useState, useLayoutEffect, useRef, useCallback, useEffect } from 'react';
4
5
  import './style.scss';
@@ -274,7 +275,10 @@ export const Swipeable = ({ hasDynamicHeight = false, children, currentPage = 0,
274
275
  return null;
275
276
  }, [handleDragStart, handleDrag, handleDragEnd]);
276
277
  const offset = getOffset(currentPage);
277
- return (_jsxs(_Fragment, { children: [_jsx("div", { ...getTouchEvents(), className: "swipeable__container", ref: pagesRef, ...otherProps, children: _jsxs("div", { className: clsx('swipeable__pages', containerClassName), style: {
278
+ return (_jsxs(_Fragment, { children: [_createElement("div", { ...getTouchEvents(), className: "swipeable__container", ref: pagesRef, ...otherProps,
279
+ // Ensure that state is reset when the window is resized
280
+ key: containerWidth?.toString() },
281
+ _jsxs("div", { className: clsx('swipeable__pages', containerClassName), style: {
278
282
  ...pagesStyle,
279
283
  width: getPagesWidth(containerWidth, numPages + 2),
280
284
  transform: `translate3d(${offset}px, 0px, 0px)`,
@@ -288,6 +292,6 @@ export const Swipeable = ({ hasDynamicHeight = false, children, currentPage = 0,
288
292
  }), "data-testid": `swipeable-page-${index + 1}`, children: child }, `page-${index}`))), _jsx("div", { style: { width: `${containerWidth}px` }, className: clsx('swipeable__page', pageClassName, {
289
293
  'is-clone': true,
290
294
  'is-next': currentPage === numPages - 1,
291
- }), children: Children.toArray(children)[0] }, `clone-next-0`)] }) }), _jsx("div", { ref: resizeObserverRef, className: "swipeable__resize-observer" })] }));
295
+ }), children: Children.toArray(children)[0] }, `clone-next-0`)] })), _jsx("div", { ref: resizeObserverRef, className: "swipeable__resize-observer" })] }));
292
296
  };
293
297
  export default Swipeable;
@@ -366,6 +366,8 @@ export const Swipeable = ( {
366
366
  className="swipeable__container"
367
367
  ref={ pagesRef }
368
368
  { ...otherProps }
369
+ // Ensure that state is reset when the window is resized
370
+ key={ containerWidth?.toString() }
369
371
  >
370
372
  <div
371
373
  className={ clsx( 'swipeable__pages', containerClassName ) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "0.73.0",
3
+ "version": "0.73.2",
4
4
  "description": "Jetpack Components Package",
5
5
  "author": "Automattic",
6
6
  "license": "GPL-2.0-or-later",
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@automattic/format-currency": "1.0.1",
18
- "@automattic/jetpack-boost-score-api": "^0.1.64",
18
+ "@automattic/jetpack-boost-score-api": "^0.1.65",
19
19
  "@automattic/jetpack-api": "^0.20.2",
20
20
  "@automattic/jetpack-script-data": "^0.4.1",
21
- "@automattic/number-formatters": "^1.0.1",
21
+ "@automattic/number-formatters": "^1.0.2",
22
22
  "@babel/runtime": "^7",
23
23
  "@wordpress/browserslist-config": "6.22.0",
24
24
  "@wordpress/components": "29.8.0",