Skip to content

Commit

Permalink
Merge pull request #970 from contentful/next
Browse files Browse the repository at this point in the history
Release@main
  • Loading branch information
Spring3 authored Jan 31, 2025
2 parents d55ffb7 + 9379ffb commit af0d41f
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"npmClient": "npm",
"version": "1.30.0",
"version": "1.30.1-beta.0",
"command": {
"version": {
"allowBranch": ["main", "next", "development"],
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/experiences-components-react",
"version": "1.30.0",
"version": "1.30.1-beta.0",
"description": "A basic set of components to use with Studio Experiences",
"homepage": "https://github.com/contentful/experience-builder/tree/next/packages/components#readme",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/experiences-core",
"version": "1.30.0",
"version": "1.30.1-beta.0",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-contentful-studio-experiences/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-contentful-studio-experiences",
"version": "1.30.0",
"version": "1.30.1-beta.0",
"description": "A CLI tool to get up and running with Contentful Studio Experiences quickly",
"homepage": "https://github.com/contentful/experience-builder/tree/next/packages/create-contentful-studio-experiences#readme",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/experience-builder-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/experiences-sdk-react",
"version": "1.30.0",
"version": "1.30.1-beta.0",
"main": "./dist/index.js",
"module": "./dist/index.js",
"typings": "./dist/src/index.d.ts",
Expand Down
6 changes: 4 additions & 2 deletions packages/experience-builder-sdk/src/hooks/useBreakpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { useCallback, useEffect, useState } from 'react';
* and then decending by screen width. For mobile-first designs, the order would be ascending
*/
export const useBreakpoints = (breakpoints: Breakpoint[]) => {
const [mediaQueryMatchers, initialMediaQueryMatches] = mediaQueryMatcher(breakpoints);
const [, initialMediaQueryMatches] = mediaQueryMatcher(breakpoints);

const [mediaQueryMatches, setMediaQueryMatches] =
useState<Record<string, boolean>>(initialMediaQueryMatches);
Expand All @@ -26,12 +26,14 @@ export const useBreakpoints = (breakpoints: Breakpoint[]) => {

// Register event listeners to update the media query states
useEffect(() => {
const [mediaQueryMatchers] = mediaQueryMatcher(breakpoints);
const eventListeners = mediaQueryMatchers.map(({ id, signal }) => {
const onChange = () =>
setMediaQueryMatches((prev) => ({
...prev,
[id]: signal.matches,
}));

signal.addEventListener('change', onChange);
return onChange;
});
Expand All @@ -41,7 +43,7 @@ export const useBreakpoints = (breakpoints: Breakpoint[]) => {
mediaQueryMatchers[index].signal.removeEventListener('change', eventListener);
});
};
}, [mediaQueryMatchers]);
}, [breakpoints]);

const activeBreakpointIndex = getActiveBreakpointIndex(
breakpoints,
Expand Down
2 changes: 1 addition & 1 deletion packages/validators/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/experiences-validators",
"version": "1.30.0",
"version": "1.30.1-beta.0",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/visual-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/experiences-visual-editor-react",
"version": "1.30.0",
"version": "1.30.1-beta.0",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand Down

0 comments on commit af0d41f

Please sign in to comment.