Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: superscipt and subscript support to rich text editor [TOL-30] #1280

Merged
merged 23 commits into from
Nov 16, 2022
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d3b1728
chore: wip []
aodhagan-cf Nov 9, 2022
dd3c066
feat: sub/superscript marks cancel each other []
aodhagan-cf Nov 14, 2022
8e967b3
chore: removing unused import []
aodhagan-cf Nov 14, 2022
b7f987d
chore: adding test for pasting sub/superscript []
aodhagan-cf Nov 14, 2022
c293fbb
chore: adding tests for sub/superscript []
aodhagan-cf Nov 14, 2022
a8d0102
chore: replacing hard coded value []
aodhagan-cf Nov 14, 2022
d00ff12
chore: removing unused line []
aodhagan-cf Nov 14, 2022
a1068f9
chore: fixing issue []
aodhagan-cf Nov 14, 2022
b9a59e8
chore: updating rich-text-types []
aodhagan-cf Nov 15, 2022
e998790
chore: fixing import []
aodhagan-cf Nov 15, 2022
71a31df
chore: pinning version []
aodhagan-cf Nov 15, 2022
214ddef
chore: fixing test []
aodhagan-cf Nov 15, 2022
38b2cdb
chore: fixing breaking tests []
aodhagan-cf Nov 15, 2022
5d8bcd3
chore: adding test for mark validations []
aodhagan-cf Nov 15, 2022
f956339
chore: using override function for mocks []
aodhagan-cf Nov 15, 2022
5fee071
chore: adding tests for hiding showing super and subscript marks []
aodhagan-cf Nov 15, 2022
879d3a2
chore: tidying up []
aodhagan-cf Nov 16, 2022
410c916
chore: tidying up []
aodhagan-cf Nov 16, 2022
9b2ffd3
chore: updating cypress test name []
aodhagan-cf Nov 16, 2022
9f7e651
chore: removing logic and tests []
aodhagan-cf Nov 16, 2022
d41af12
chore: updating snapshot title []
aodhagan-cf Nov 16, 2022
9f37dec
chore: updating snapshot []
aodhagan-cf Nov 16, 2022
af8f78b
chore: updating snapshot []
aodhagan-cf Nov 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cypress/integration/rich-text/RichTextEditor.Pasting.spec.ts
Original file line number Diff line number Diff line change
@@ -274,6 +274,22 @@ describe(
});
});

describe('Superscript and subscript marks', () => {
it('works when pasting subscript and superscript from a google doc', () => {
aodhagan-cf marked this conversation as resolved.
Show resolved Hide resolved
// A simple "hello world" text with marks: superscript and subscript.
// Copied from a google doc
richText.editor.click().paste({
'text/plain': 'HelloWorld',
'text/html':
'<meta charset=\'utf-8\'><meta charset="utf-8"><b style="font-weight:normal;" id="docs-internal-guid-d846cac1-7fff-6b53-5ddb-bef1e002bcd8"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;"><span style="font-size:0.6em;vertical-align:super;">Hello</span></span><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;"><span style="font-size:0.6em;vertical-align:sub;">World</span></span></b>',
'application/x-vnd.google-docs-document-slice-clip+wrapped':
'{"dih":3014089275,"data":"{\\"resolved\\":{\\"dsl_spacers\\":\\"HelloWorld\\",\\"dsl_styleslices\\":[{\\"stsl_type\\":\\"autogen\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"cell\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"code_snippet\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"collapsed_heading\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"column_sector\\",\\"stsl_leading\\":{\\"css_cols\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}},\\"css_lb\\":false,\\"css_ltr\\":true,\\"css_st\\":\\"continuous\\",\\"css_mb\\":null,\\"css_mh\\":null,\\"css_mf\\":null,\\"css_ml\\":null,\\"css_mr\\":null,\\"css_mt\\":null,\\"css_fi\\":null,\\"css_hi\\":null,\\"css_epfi\\":null,\\"css_ephi\\":null,\\"css_fpfi\\":null,\\"css_fphi\\":null,\\"css_ufphf\\":null,\\"css_pnsi\\":null,\\"css_fpo\\":null},\\"stsl_leadingType\\":\\"column_sector\\",\\"stsl_trailing\\":{\\"css_cols\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}},\\"css_lb\\":false,\\"css_ltr\\":true,\\"css_st\\":\\"continuous\\",\\"css_mb\\":null,\\"css_mh\\":null,\\"css_mf\\":null,\\"css_ml\\":null,\\"css_mr\\":null,\\"css_mt\\":null,\\"css_fi\\":null,\\"css_hi\\":null,\\"css_epfi\\":null,\\"css_ephi\\":null,\\"css_fpfi\\":null,\\"css_fphi\\":null,\\"css_ufphf\\":null,\\"css_pnsi\\":null,\\"css_fpo\\":null},\\"stsl_trailingType\\":\\"column_sector\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"comment\\",\\"stsl_styles\\":[{\\"cs_cids\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}}}]},{\\"stsl_type\\":\\"doco_anchor\\",\\"stsl_styles\\":[{\\"das_a\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}}}]},{\\"stsl_type\\":\\"document\\",\\"stsl_leading\\":{\\"ds_b\\":{\\"bg_c2\\":{\\"clr_type\\":0,\\"hclr_color\\":null}},\\"ds_df\\":{\\"df_dm\\":0},\\"ds_fi\\":null,\\"ds_hi\\":null,\\"ds_epfi\\":null,\\"ds_ephi\\":null,\\"ds_uephf\\":false,\\"ds_fpfi\\":null,\\"ds_fphi\\":null,\\"ds_ufphf\\":false,\\"ds_pnsi\\":1,\\"ds_mb\\":72,\\"ds_ml\\":72,\\"ds_mr\\":72,\\"ds_mt\\":72,\\"ds_ph\\":792,\\"ds_pw\\":612,\\"ds_rtd\\":\\"\\",\\"ds_mh\\":36,\\"ds_mf\\":36,\\"ds_ulhfl\\":false,\\"ds_lhs\\":1,\\"ds_fpo\\":false},\\"stsl_leadingType\\":\\"document\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"equation\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"equation_function\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"field\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"footnote\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"headings\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"horizontal_rule\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"ignore_spellcheck\\",\\"stsl_styles\\":[{\\"isc_osh\\":null}]},{\\"stsl_type\\":\\"import_warnings\\",\\"stsl_styles\\":[{\\"iws_iwids\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}}}]},{\\"stsl_type\\":\\"language\\",\\"stsl_trailing\\":{\\"lgs_l\\":\\"en\\"},\\"stsl_trailingType\\":\\"language\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"link\\",\\"stsl_styles\\":[{\\"lnks_link\\":null}]},{\\"stsl_type\\":\\"list\\",\\"stsl_trailing\\":{\\"ls_nest\\":0,\\"ls_id\\":null,\\"ls_c\\":null,\\"ls_ts\\":{\\"ts_bd\\":false,\\"ts_fs\\":11,\\"ts_ff\\":\\"Arial\\",\\"ts_it\\":false,\\"ts_sc\\":false,\\"ts_st\\":false,\\"ts_tw\\":400,\\"ts_un\\":false,\\"ts_va\\":\\"nor\\",\\"ts_bgc2\\":{\\"clr_type\\":0,\\"hclr_color\\":null},\\"ts_fgc2\\":{\\"clr_type\\":0,\\"hclr_color\\":\\"#000000\\"},\\"ts_bd_i\\":false,\\"ts_fs_i\\":false,\\"ts_ff_i\\":false,\\"ts_it_i\\":false,\\"ts_sc_i\\":false,\\"ts_st_i\\":false,\\"ts_un_i\\":false,\\"ts_va_i\\":false,\\"ts_bgc2_i\\":false,\\"ts_fgc2_i\\":false}},\\"stsl_trailingType\\":\\"list\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"named_range\\",\\"stsl_styles\\":[{\\"nrs_ei\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}}}]},{\\"stsl_type\\":\\"paragraph\\",\\"stsl_trailing\\":{\\"ps_al\\":0,\\"ps_awao\\":true,\\"ps_sd\\":null,\\"ps_bbtw\\":null,\\"ps_bb\\":null,\\"ps_bl\\":null,\\"ps_br\\":null,\\"ps_bt\\":null,\\"ps_hd\\":0,\\"ps_hdid\\":\\"\\",\\"ps_ifl\\":0,\\"ps_il\\":0,\\"ps_ir\\":0,\\"ps_klt\\":false,\\"ps_kwn\\":false,\\"ps_ltr\\":true,\\"ps_ls\\":1.15,\\"ps_lslm\\":1,\\"ps_pbb\\":false,\\"ps_sm\\":0,\\"ps_sa\\":0,\\"ps_sb\\":0,\\"ps_al_i\\":false,\\"ps_awao_i\\":false,\\"ps_sd_i\\":false,\\"ps_bbtw_i\\":false,\\"ps_bb_i\\":false,\\"ps_bl_i\\":false,\\"ps_br_i\\":false,\\"ps_bt_i\\":false,\\"ps_ifl_i\\":false,\\"ps_il_i\\":false,\\"ps_ir_i\\":false,\\"ps_klt_i\\":false,\\"ps_kwn_i\\":false,\\"ps_ls_i\\":false,\\"ps_lslm_i\\":false,\\"ps_pbb_i\\":false,\\"ps_rd\\":\\"\\",\\"ps_sm_i\\":false,\\"ps_sa_i\\":false,\\"ps_sb_i\\":false,\\"ps_shd\\":false,\\"ps_ts\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}}},\\"stsl_trailingType\\":\\"paragraph\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"row\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"suppress_feature\\",\\"stsl_styles\\":[{\\"sfs_sst\\":false}]},{\\"stsl_type\\":\\"tbl\\",\\"stsl_styles\\":[]},{\\"stsl_type\\":\\"text\\",\\"stsl_styles\\":[{\\"ts_bd\\":false,\\"ts_fs\\":11,\\"ts_ff\\":\\"Arial\\",\\"ts_it\\":false,\\"ts_sc\\":false,\\"ts_st\\":false,\\"ts_tw\\":400,\\"ts_un\\":false,\\"ts_va\\":\\"sup\\",\\"ts_bgc2\\":{\\"clr_type\\":0,\\"hclr_color\\":null},\\"ts_fgc2\\":{\\"clr_type\\":0,\\"hclr_color\\":\\"#000000\\"},\\"ts_bd_i\\":false,\\"ts_fs_i\\":false,\\"ts_ff_i\\":false,\\"ts_it_i\\":false,\\"ts_sc_i\\":false,\\"ts_st_i\\":false,\\"ts_un_i\\":false,\\"ts_va_i\\":false,\\"ts_bgc2_i\\":false,\\"ts_fgc2_i\\":false},null,null,null,null,{\\"ts_bd\\":false,\\"ts_fs\\":11,\\"ts_ff\\":\\"Arial\\",\\"ts_it\\":false,\\"ts_sc\\":false,\\"ts_st\\":false,\\"ts_tw\\":400,\\"ts_un\\":false,\\"ts_va\\":\\"sub\\",\\"ts_bgc2\\":{\\"clr_type\\":0,\\"hclr_color\\":null},\\"ts_fgc2\\":{\\"clr_type\\":0,\\"hclr_color\\":\\"#000000\\"},\\"ts_bd_i\\":false,\\"ts_fs_i\\":false,\\"ts_ff_i\\":false,\\"ts_it_i\\":false,\\"ts_sc_i\\":false,\\"ts_st_i\\":false,\\"ts_un_i\\":false,\\"ts_va_i\\":false,\\"ts_bgc2_i\\":false,\\"ts_fgc2_i\\":false}]}],\\"dsl_metastyleslices\\":[{\\"stsl_type\\":\\"autocorrect\\",\\"stsl_styles\\":[{\\"ac_ot\\":null,\\"ac_ct\\":null,\\"ac_type\\":null,\\"ac_sm\\":{\\"asm_s\\":0,\\"asm_rl\\":0,\\"asm_l\\":\\"\\"},\\"ac_id\\":\\"\\"}]},{\\"stsl_type\\":\\"collapsed_content\\",\\"stsl_styles\\":[{\\"colc_icc\\":false}]},{\\"stsl_type\\":\\"composing_decoration\\",\\"stsl_styles\\":[{\\"cd_u\\":false,\\"cd_bgc\\":{\\"clr_type\\":0,\\"hclr_color\\":null}}]},{\\"stsl_type\\":\\"composing_region\\",\\"stsl_styles\\":[{\\"cr_c\\":false}]},{\\"stsl_type\\":\\"draft_comment\\",\\"stsl_styles\\":[{\\"dcs_cids\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}}}]},{\\"stsl_type\\":\\"ignore_word\\",\\"stsl_styles\\":[{\\"iwos_i\\":false}]},{\\"stsl_type\\":\\"revision_diff\\",\\"stsl_styles\\":[{\\"revdiff_dt\\":0,\\"revdiff_a\\":\\"\\",\\"revdiff_aid\\":\\"\\"}]},{\\"stsl_type\\":\\"smart_todo\\",\\"stsl_styles\\":[{\\"sts_cid\\":null,\\"sts_ot\\":null,\\"sts_ac\\":null,\\"sts_hi\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}},\\"sts_pa\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}},\\"sts_dm\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}}}]},{\\"stsl_type\\":\\"spellcheck\\",\\"stsl_styles\\":[{\\"sc_id\\":\\"\\",\\"sc_ow\\":null,\\"sc_sl\\":null,\\"sc_sugg\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}},\\"sc_sm\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}}}]},{\\"stsl_type\\":\\"voice_corrections\\",\\"stsl_styles\\":[{\\"vcs_c\\":{\\"cv\\":{\\"op\\":\\"set\\",\\"opValue\\":[]}},\\"vcs_id\\":\\"\\"}]},{\\"stsl_type\\":\\"voice_dotted_span\\",\\"stsl_styles\\":[{\\"vdss_p\\":null,\\"vdss_id\\":\\"\\"}]}],\\"dsl_suggestedinsertions\\":{\\"sgsl_sugg\\":[]},\\"dsl_suggesteddeletions\\":{\\"sgsl_sugg\\":[]},\\"dsl_entitypositionmap\\":{},\\"dsl_entitymap\\":{},\\"dsl_entitytypemap\\":{},\\"dsl_drawingrevisionaccesstokenmap\\":{},\\"dsl_relateddocslices\\":{},\\"dsl_nestedmodelmap\\":{}},\\"autotext_content\\":{}}","edi":"QT9bASY3_GwFN8ZN119g2Ja2EHnrx_nq6yjODnrlfjrbkZEpqMl5NY_AGJtzSbcFsVk9XklA8IoHTqo123xXoO8cLKmVgnTCRWC6udfsvDpa","edrk":"xKYajWttYyLMt_u511ACUFI3qewboAf7dCubtDmoDhoCHwlXkw..","dct":"kix","ds":false,"cses":false}',
});

richText.expectSnapshotValue();
});
});

describe('copy from safari (no href in anchors)', () => {
it('recognizes entry hyperlink', () => {
richText.editor.click().paste({
116 changes: 79 additions & 37 deletions cypress/integration/rich-text/RichTextEditor.spec.ts
Original file line number Diff line number Diff line change
@@ -208,19 +208,31 @@ describe('Rich Text Editor', { viewportHeight: 2000 }, () => {
});

describe('Marks', () => {
const findMarkViaToolbar = (mark: MARKS) => cy.findByTestId(`${mark}-toolbar-button`);
const toggleMarkViaToolbar = (mark: MARKS) => cy.findByTestId(`${mark}-toolbar-button`).click();

it(`shows ${MARKS.BOLD}, ${MARKS.ITALIC}, ${MARKS.UNDERLINE}, ${MARKS.CODE} if not explicitly allowed`, () => {
cy.setFieldValidations([]);
cy.reload();
findMarkViaToolbar(MARKS.BOLD).should('be.visible');
findMarkViaToolbar(MARKS.ITALIC).should('be.visible');
findMarkViaToolbar(MARKS.UNDERLINE).should('be.visible');
findMarkViaToolbar(MARKS.CODE).should('be.visible');
});

[
[MARKS.BOLD, `{${mod}}b`],
[MARKS.ITALIC, `{${mod}}i`],
[MARKS.UNDERLINE, `{${mod}}u`],
[MARKS.CODE, `{${mod}}/`],
[MARKS.SUPERSCRIPT],
[MARKS.SUBSCRIPT],
].forEach(([mark, shortcut]) => {
const toggleMarkViaToolbar = () => cy.findByTestId(`${mark}-toolbar-button`).click();

describe(`${mark} mark toggle via toolbar`, () => {
it('allows writing marked text', () => {
richText.editor.click();

toggleMarkViaToolbar();
toggleMarkViaToolbar(mark);

richText.editor.type('some text');

@@ -234,7 +246,7 @@ describe('Rich Text Editor', { viewportHeight: 2000 }, () => {
it('allows writing marked text by selecting text', () => {
richText.editor.click().type('some text{selectall}');

toggleMarkViaToolbar();
toggleMarkViaToolbar(mark);

const expectedValue = doc(
block(BLOCKS.PARAGRAPH, {}, text('some text', [{ type: mark }]))
@@ -246,8 +258,8 @@ describe('Rich Text Editor', { viewportHeight: 2000 }, () => {
it('allows writing unmarked text', () => {
richText.editor.click();

toggleMarkViaToolbar();
toggleMarkViaToolbar();
toggleMarkViaToolbar(mark);
toggleMarkViaToolbar(mark);

richText.editor.type('some text');

@@ -259,65 +271,95 @@ describe('Rich Text Editor', { viewportHeight: 2000 }, () => {
it('allows writing unmarked text by selecting text', () => {
richText.editor.click().type('some text{selectall}');

toggleMarkViaToolbar();
toggleMarkViaToolbar(mark);

cy.wait(100);

richText.editor.click().type('{selectall}');

toggleMarkViaToolbar();
toggleMarkViaToolbar(mark);

const expectedValue = doc(block(BLOCKS.PARAGRAPH, {}, text('some text', [])));

richText.expectValue(expectedValue);
});
});

describe(`${mark} mark toggle via shortcut`, () => {
it('allows writing marked text', () => {
richText.editor.click().type(shortcut).type('some text');
if (shortcut) {
describe(`${mark} mark toggle via shortcut`, () => {
it('allows writing marked text', () => {
richText.editor.click().type(shortcut).type('some text');

const expectedValue = doc(
block(BLOCKS.PARAGRAPH, {}, text('some text', [{ type: mark }]))
);
const expectedValue = doc(
block(BLOCKS.PARAGRAPH, {}, text('some text', [{ type: mark }]))
);

richText.expectValue(expectedValue);
});
richText.expectValue(expectedValue);
});

it('allows writing marked text by selecting text', () => {
richText.editor.click().type('some text');
it('allows writing marked text by selecting text', () => {
richText.editor.click().type('some text');

cy.wait(100);
cy.wait(100);

richText.editor.type('{selectall}').type(shortcut);
richText.editor.type('{selectall}').type(shortcut);

const expectedValue = doc(
block(BLOCKS.PARAGRAPH, {}, text('some text', [{ type: mark }]))
);
const expectedValue = doc(
block(BLOCKS.PARAGRAPH, {}, text('some text', [{ type: mark }]))
);

richText.expectValue(expectedValue);
});
richText.expectValue(expectedValue);
});

it('allows writing unmarked text', () => {
richText.editor.click().type(shortcut).type(shortcut).type('some text');
it('allows writing unmarked text', () => {
richText.editor.click().type(shortcut).type(shortcut).type('some text');

const expectedValue = doc(block(BLOCKS.PARAGRAPH, {}, text('some text', [])));
const expectedValue = doc(block(BLOCKS.PARAGRAPH, {}, text('some text', [])));

richText.expectValue(expectedValue);
});
richText.expectValue(expectedValue);
});

it('allows writing unmarked text by selecting text', () => {
richText.editor.click().type('some text');
it('allows writing unmarked text by selecting text', () => {
richText.editor.click().type('some text');

cy.wait(100);
cy.wait(100);

richText.editor.type('{selectall}').type(shortcut).type('{selectall}').type(shortcut);
richText.editor.type('{selectall}').type(shortcut).type('{selectall}').type(shortcut);

const expectedValue = doc(block(BLOCKS.PARAGRAPH, {}, text('some text', [])));
const expectedValue = doc(block(BLOCKS.PARAGRAPH, {}, text('some text', [])));

richText.expectValue(expectedValue);
richText.expectValue(expectedValue);
});
});
});
}
});

it('should remove subscript when superscript mark is selected', () => {
richText.editor.click().type('should only be superscript{selectall}');
toggleMarkViaToolbar(MARKS.SUBSCRIPT);
richText.editor.click().type('{selectall}');
toggleMarkViaToolbar(MARKS.SUPERSCRIPT);

const expectedValue = doc(
block(
BLOCKS.PARAGRAPH,
{},
text('should only be superscript', [{ type: MARKS.SUPERSCRIPT }])
)
);
richText.expectValue(expectedValue);
});

it('should remove superscript when subscript mark is selected', () => {
richText.editor.click().type('should only be subscript{selectall}');
toggleMarkViaToolbar(MARKS.SUPERSCRIPT);
richText.editor.click().type('{selectall}');
toggleMarkViaToolbar(MARKS.SUBSCRIPT);

const expectedValue = doc(
block(BLOCKS.PARAGRAPH, {}, text('should only be subscript', [{ type: MARKS.SUBSCRIPT }]))
);
richText.expectValue(expectedValue);
});
});

Original file line number Diff line number Diff line change
@@ -2955,6 +2955,7 @@ exports[`Rich Text Editor > Tables > Google Docs - <table> around <div> #0`] =
"data": {},
"nodeType": "document"
};

exports[`Rich Text Editor > Tables > removes table wrappers when pasting a single cell #0`] =
{
"nodeType": "document",
@@ -2964,32 +2965,99 @@ exports[`Rich Text Editor > Tables > removes table wrappers when pasting a singl
"nodeType": "paragraph",
"data": {},
"content": [
{
"nodeType": "text",
"value": "cell content with a link and inline entry",
"marks": [],
"data": {}
},
{
"nodeType": "embedded-entry-inline",
"data": {
"target": {
"sys": {
"id": "example-entity-id",
"type": "Link",
"linkType": "Entry"
}
{
"nodeType": "text",
"value": "cell content with a link and inline entry",
"marks": [],
"data": {}
},
{
"nodeType": "embedded-entry-inline",
"data": {
"target": {
"sys": {
"id": "example-entity-id",
"type": "Link",
"linkType": "Entry"
}
},
"content": []
}
},
{
"nodeType": "text",
"value": ".",
"marks": [],
"data": {}
}
"content": []
},
{
"nodeType": "text",
"value": ".",
"marks": [],
"data": {}
}
]
}
]
};

exports[`Rich Text Editor > works when pasting from another RT editor > works when pasting subscript and superscript from a google doc #0`] =
{
"content": [
{
"content": [
{
"data": {},
"marks": [
{
"type": "bold"
},
{
"type": "italic"
},
{
"type": "underline"
},
{
"type": "code"
}
],
"nodeType": "text",
"value": "hello world"
}
],
"data": {},
"nodeType": "paragraph"
}
],
"data": {},
"nodeType": "document"
};

exports[`Rich Text Editor > Superscript and subscript marks > works when pasting subscript and superscript from a google doc #0`] =
{
"content": [
{
"content": [
{
"data": {},
"marks": [
{
"type": "superscript"
}
],
"nodeType": "text",
"value": "Hello"
},
{
"data": {},
"marks": [
{
"type": "subscript"
}
],
"nodeType": "text",
"value": "World"
}
],
"data": {},
"nodeType": "paragraph"
}
],
"data": {},
"nodeType": "document"
};
2 changes: 1 addition & 1 deletion packages/rich-text/package.json
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
"@contentful/field-editor-reference": "^5.5.2",
"@contentful/field-editor-shared": "^1.1.3",
"@contentful/rich-text-plain-text-renderer": "^15.12.1",
"@contentful/rich-text-types": "^15.12.3",
"@contentful/rich-text-types": "15.14.0",
"@popperjs/core": "^2.11.5",
"@udecode/plate-basic-marks": "^10.4.0",
"@udecode/plate-break": "^10.4.0",
Loading