Skip to content

Commit f489789

Browse files
authored
chore(rich-text): bump forma36 to v6 (#2106)
This upgrade bumps packages to use dependency/devDependency and/or peerDependency of @contentful/f36-components@6.7.1, @contentful/f36-icons@6.7.1 and @contentful/f36-tokens@6.1.2 Adds explicit react (>=18.3.1) as peer dependencies to make the React version requirement visible to consumers, rather than leaving it as an implicit transitive dependency through F36 v6. Deprecated emotion@10 in order to use emotion/css@^11.13.5 and follow the Forma36 pattern. BREAKING CHANGE: Mograte from `emotion@10.` to `emotion/css@^11.13.4`. Consumers also must be on Forma 36 v6 and React `18.3.1+`
1 parent 79ea202 commit f489789

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+113
-87
lines changed

cypress/component/rich-text/RichTextEditor.EmbeddedEntryInlines.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ describe(
7272
),
7373
);
7474

75-
cy.findByTestId('cf-ui-card-actions').click({ force: true });
76-
cy.findByTestId('delete').click({ force: true });
75+
cy.findByTestId('cf-ui-card-actions').click();
76+
cy.findByTestId('delete').click();
7777

7878
richText.expectValue(doc(block(BLOCKS.PARAGRAPH, {}, text('hello world'))));
7979
});

cypress/component/rich-text/RichTextPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class RichTextPage {
2424

2525
toggleHeading(type: string) {
2626
this.headingsDropdown.click();
27-
cy.findByTestId(`dropdown-option-${type}`).click({ force: true });
27+
cy.findByTestId(`dropdown-option-${type}`).click();
2828
},
2929

3030
get undo() {

packages/rich-text/package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@
4040
"dependencies": {
4141
"@contentful/app-sdk": "^4.42.0",
4242
"@contentful/contentful-slatejs-adapter": "^16.1.6",
43-
"@contentful/f36-components": "^5.4.1",
44-
"@contentful/f36-icons": "^5.4.1",
45-
"@contentful/f36-tokens": "^5.1.0",
46-
"@contentful/f36-utils": "^5.1.0",
47-
"@contentful/field-editor-reference": "^7.0.1",
48-
"@contentful/field-editor-shared": "^3.0.1",
43+
"@contentful/f36-components": "^6.7.1",
44+
"@contentful/f36-icon": "^6.7.1",
45+
"@contentful/f36-icons": "^6.7.1",
46+
"@contentful/f36-tokens": "^6.1.2",
47+
"@contentful/f36-utils": "^6.1.0",
48+
"@contentful/field-editor-reference": "^7.0.0",
49+
"@contentful/field-editor-shared": "^3.0.0",
4950
"@contentful/rich-text-plain-text-renderer": "^17.0.0",
5051
"@contentful/rich-text-types": "^17.2.5",
5152
"@popperjs/core": "^2.11.5",
@@ -61,6 +62,7 @@
6162
"@udecode/plate-table": "36.5.9",
6263
"@udecode/plate-trailing-block": "36.0.0",
6364
"constate": "^3.3.2",
65+
"@emotion/css": "^11.13.5",
6466
"fast-deep-equal": "^3.1.3",
6567
"is-hotkey": "^0.2.0",
6668
"is-plain-obj": "^3.0.0",
@@ -77,8 +79,8 @@
7779
"peerDependencies": {
7880
"@lingui/core": "^5.3.0",
7981
"@tanstack/react-query": "^4.3.9",
80-
"react": ">=16.14.0",
81-
"react-dom": ">=16.14.0"
82+
"react": ">=18.3.1",
83+
"react-dom": ">=18.3.1"
8284
},
8385
"devDependencies": {
8486
"@contentful/field-editor-test-utils": "^2.0.0",
@@ -92,4 +94,4 @@
9294
"publishConfig": {
9395
"registry": "https://npm.pkg.github.com/"
9496
}
95-
}
97+
}

packages/rich-text/src/CharConstraints.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
import tokens from '@contentful/f36-tokens';
44
import { CharValidation, ConstraintsUtils } from '@contentful/field-editor-shared';
5-
import { css, cx } from 'emotion';
5+
import { css, cx } from '@emotion/css';
66

77
import { usePlateEditorState } from './internal/hooks';
88
import { useSdkContext } from './SdkProvider';

packages/rich-text/src/RichTextEditor.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import tokens from '@contentful/f36-tokens';
2-
import { css } from 'emotion';
2+
import { css } from '@emotion/css';
33

44
const STYLE_EDITOR_BORDER = `1px solid ${tokens.gray400}`;
55

packages/rich-text/src/RichTextEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { FieldAppSDK } from '@contentful/app-sdk';
44
import { EntityProvider } from '@contentful/field-editor-reference';
55
import { FieldConnector } from '@contentful/field-editor-shared';
66
import * as Contentful from '@contentful/rich-text-types';
7+
import { css, cx } from '@emotion/css';
78
import { QueryClient } from '@tanstack/react-query';
89
import { PlateContent, Plate, PlatePlugin, PlateContentProps } from '@udecode/plate-common';
9-
import { css, cx } from 'emotion';
1010
import deepEquals from 'fast-deep-equal';
1111
import noop from 'lodash/noop';
1212
import { useDeepCompareMemo } from 'use-deep-compare';

packages/rich-text/src/Toolbar/components/StickyToolbarWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { ReactNode } from 'react';
22

3-
import { css } from 'emotion';
3+
import { css } from '@emotion/css';
44

55
const styles = {
66
nativeSticky: (offset?: number) => css`

packages/rich-text/src/Toolbar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Flex, IconButton, Menu } from '@contentful/f36-components';
55
import { DotsThreeIcon } from '@contentful/f36-icons';
66
import tokens from '@contentful/f36-tokens';
77
import { BLOCKS, INLINES, MARKS } from '@contentful/rich-text-types';
8-
import { css } from 'emotion';
8+
import { css } from '@emotion/css';
99

1010
import { useContentfulEditor } from '../ContentfulEditorProvider';
1111
import { isNodeTypeSelected } from '../helpers/editor';

packages/rich-text/src/dialogs/HypelinkDialog/HyperlinkDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {
1313
} from '@contentful/f36-components';
1414
import tokens from '@contentful/f36-tokens';
1515
import { EntityProvider } from '@contentful/field-editor-reference';
16+
import { css } from '@emotion/css';
1617
import { t } from '@lingui/core/macro';
17-
import { css } from 'emotion';
1818
import PropTypes from 'prop-types';
1919

2020
import { FetchingWrappedAssetCard } from '../../plugins/shared/FetchingWrappedAssetCard';

packages/rich-text/src/plugins/CommandPalette/components/CommandList.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import tokens from '@contentful/f36-tokens';
2-
import { css } from 'emotion';
2+
import { css } from '@emotion/css';
33

44
const styles = {
55
container: css({

0 commit comments

Comments
 (0)