chore: set up test mock data for tiptap
This commit is contained in:
@@ -934,7 +934,23 @@ export const data: Array<UmbMockDataTypeModel> = [
|
||||
},
|
||||
{
|
||||
name: 'Rich Text Editor',
|
||||
id: 'dt-richTextEditor',
|
||||
id: 'dt-richTextEditorTiptap',
|
||||
parent: null,
|
||||
editorAlias: 'Umbraco.RichText',
|
||||
editorUiAlias: 'Umb.PropertyEditorUi.Tiptap',
|
||||
hasChildren: false,
|
||||
isFolder: false,
|
||||
isDeletable: true,
|
||||
canIgnoreStartNodes: false,
|
||||
values: [
|
||||
{ alias: 'dimensions', value: { height: 500 } },
|
||||
{ alias: 'maxImageSize', value: 500 },
|
||||
{ alias: 'ignoreUserStartNodes', value: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Rich Text Editor (TinyMCE)',
|
||||
id: 'dt-richTextEditorTinyMce',
|
||||
parent: null,
|
||||
editorAlias: 'Umbraco.RichText',
|
||||
editorUiAlias: 'Umb.PropertyEditorUi.TinyMCE',
|
||||
|
||||
@@ -87,10 +87,34 @@ export const data: Array<UmbMockDocumentTypeModel> = [
|
||||
id: 'all-properties-group-key',
|
||||
},
|
||||
alias: 'richTextEditor',
|
||||
name: 'Rich Text editor',
|
||||
name: 'Rich Text editor (Tiptap)',
|
||||
description: 'Some description to test with a long description.',
|
||||
dataType: {
|
||||
id: 'dt-richTextEditor',
|
||||
id: 'dt-richTextEditorTiptap',
|
||||
},
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
sortOrder: 0,
|
||||
validation: {
|
||||
mandatory: true,
|
||||
mandatoryMessage: null,
|
||||
regEx: null,
|
||||
regExMessage: null,
|
||||
},
|
||||
appearance: {
|
||||
labelOnTop: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
container: {
|
||||
id: 'all-properties-group-key',
|
||||
},
|
||||
alias: 'richTextEditorTinyMce',
|
||||
name: 'Rich Text editor (TinyMce)',
|
||||
description: 'Some description to test with a long description.',
|
||||
dataType: {
|
||||
id: 'dt-richTextEditorTinyMce',
|
||||
},
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
@@ -1721,4 +1745,90 @@ export const data: Array<UmbMockDocumentTypeModel> = [
|
||||
properties: [],
|
||||
containers: [],
|
||||
},
|
||||
{
|
||||
allowedTemplates: [],
|
||||
defaultTemplate: { id: 'all-rtes-document-type-id' },
|
||||
id: 'all-rtes-document-type-id',
|
||||
alias: 'allRtesDocumentType',
|
||||
name: 'All RTEs document type',
|
||||
description: null,
|
||||
icon: 'icon-document',
|
||||
allowedAsRoot: true,
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
isElement: false,
|
||||
hasChildren: false,
|
||||
parent: null,
|
||||
isFolder: false,
|
||||
properties: [
|
||||
{
|
||||
id: '1dd0d4d2-cda8-4ac2-affd-a69fc10382b1',
|
||||
container: { id: 'the-simplest-document-type-id-container' },
|
||||
alias: 'tiptap',
|
||||
name: 'Tiptap',
|
||||
description:
|
||||
'This is to test the default configuration for the Tiptap editor.\n\nSearch for **dt-richTextEditorTiptap** in the codebase to find the configuration and add configuration values.',
|
||||
dataType: { id: 'dt-richTextEditorTiptap' },
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
sortOrder: 0,
|
||||
validation: {
|
||||
mandatory: false,
|
||||
mandatoryMessage: null,
|
||||
regEx: null,
|
||||
regExMessage: null,
|
||||
},
|
||||
appearance: {
|
||||
labelOnTop: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '2dd0d4d2-cda8-4ac2-affd-a69fc10382b1',
|
||||
container: { id: 'the-simplest-document-type-id-container' },
|
||||
alias: 'tinymce',
|
||||
name: 'TinyMCE',
|
||||
description: `
|
||||
This is to test the default configuration of the TinyMCE editor.
|
||||
|
||||
Search for **dt-richTextEditorTinyMce** in the codebase to find the configuration and add configuration values.
|
||||
|
||||
**NB!** If this throws an error in console, go to \`input-tiny-mce.defaults.ts\` and comment out the script append on line 126:
|
||||
|
||||
\`\`\`js
|
||||
script.text = \`import "@umbraco-cms/backoffice/extension-registry";\`;
|
||||
script.text = \`import "\${UMB_BLOCK_ENTRY_WEB_COMPONENTS_ABSOLUTE_PATH}";\`;
|
||||
//editor.dom.doc.head.appendChild(script);
|
||||
\`\`\``,
|
||||
dataType: { id: 'dt-richTextEditorTinyMce' },
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
sortOrder: 0,
|
||||
validation: {
|
||||
mandatory: false,
|
||||
mandatoryMessage: null,
|
||||
regEx: null,
|
||||
regExMessage: null,
|
||||
},
|
||||
appearance: {
|
||||
labelOnTop: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
containers: [
|
||||
{
|
||||
id: 'the-simplest-document-type-id-container',
|
||||
parent: null,
|
||||
name: 'Content',
|
||||
type: 'Group',
|
||||
sortOrder: 0,
|
||||
},
|
||||
],
|
||||
allowedDocumentTypes: [],
|
||||
compositions: [],
|
||||
cleanup: {
|
||||
preventCleanup: false,
|
||||
keepAllVersionsNewerThanDays: null,
|
||||
keepLatestVersionPerDayForDays: null,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -93,20 +93,20 @@ export const data: Array<UmbMockDocumentModel> = [
|
||||
<li>Aenean massa cum sociis natoque penatibus.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetuer adipiscing
|
||||
Lorem ipsum dolor sit amet, consectetuer adipiscing
|
||||
elit. Aenean commodo ligula eget dolor.
|
||||
</p>
|
||||
<p>
|
||||
<blockquote>
|
||||
Lorem ipsum dolor sit amet, consectetuer
|
||||
adipiscing elit. Aenean commodo ligula eget dolor.
|
||||
Aenean massa <strong>strong</strong>. Cum sociis
|
||||
natoque penatibus et magnis dis parturient montes,
|
||||
nascetur ridiculus mus. Donec quam felis, ultricies
|
||||
nec, pellentesque eu, pretium quis, sem. Nulla consequat
|
||||
massa quis enim. Donec pede justo, fringilla vel,
|
||||
aliquet nec, vulputate eget, arcu. In <em>em</em>
|
||||
enim justo, rhoncus ut, imperdiet a, venenatis vitae,
|
||||
Lorem ipsum dolor sit amet, consectetuer
|
||||
adipiscing elit. Aenean commodo ligula eget dolor.
|
||||
Aenean massa <strong>strong</strong>. Cum sociis
|
||||
natoque penatibus et magnis dis parturient montes,
|
||||
nascetur ridiculus mus. Donec quam felis, ultricies
|
||||
nec, pellentesque eu, pretium quis, sem. Nulla consequat
|
||||
massa quis enim. Donec pede justo, fringilla vel,
|
||||
aliquet nec, vulputate eget, arcu. In <em>em</em>
|
||||
enim justo, rhoncus ut, imperdiet a, venenatis vitae,
|
||||
justo. Nullam <a class="external ext" href="#">link</a>
|
||||
dictum felis eu pede mollis pretium.
|
||||
</blockquote>
|
||||
@@ -802,4 +802,68 @@ export const data: Array<UmbMockDocumentModel> = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
urls: [
|
||||
{
|
||||
culture: 'en-US',
|
||||
url: '/',
|
||||
},
|
||||
],
|
||||
template: null,
|
||||
id: 'all-rtes-id',
|
||||
parent: null,
|
||||
documentType: {
|
||||
id: 'all-rtes-document-type-id',
|
||||
icon: 'icon-document',
|
||||
},
|
||||
hasChildren: false,
|
||||
noAccess: false,
|
||||
isProtected: false,
|
||||
isTrashed: false,
|
||||
variants: [
|
||||
{
|
||||
state: DocumentVariantStateModel.PUBLISHED,
|
||||
publishDate: '2023-02-06T15:32:24.957009',
|
||||
culture: null,
|
||||
segment: null,
|
||||
name: 'All RTEs',
|
||||
createDate: '2023-02-06T15:32:05.350038',
|
||||
updateDate: '2023-02-06T15:32:24.957009',
|
||||
},
|
||||
],
|
||||
values: [
|
||||
{
|
||||
alias: 'tiptap',
|
||||
culture: null,
|
||||
segment: null,
|
||||
value: {
|
||||
blocks: undefined,
|
||||
markup: `
|
||||
<p>
|
||||
Some value for the RTE with an <a href="https://google.com">external link</a> and an <a type="document" href="/{localLink:c05da24d-7740-447b-9cdc-bd8ce2172e38}">internal link</a> foo foo
|
||||
</p>
|
||||
<p>
|
||||
<img alt src="/umbraco/backoffice/login.jpg" />
|
||||
</p>
|
||||
<p>End of test content</p>
|
||||
`,
|
||||
},
|
||||
},
|
||||
{
|
||||
alias: 'tinymce',
|
||||
culture: null,
|
||||
segment: null,
|
||||
value: {
|
||||
blocks: undefined,
|
||||
markup: `
|
||||
<p>
|
||||
Some value for the RTE with an <a href="https://google.com">external link</a> and an <a type="document" href="/{localLink:c05da24d-7740-447b-9cdc-bd8ce2172e38}">internal link</a> foo foo
|
||||
</p>
|
||||
<div class="umb-macro-holder TestMacro umb-macro-mce_1 mceNonEditable"><!-- <?UMBRACO_MACRO macroAlias="TestMacro" /> --><ins>Macro alias: <strong>TestMacro</strong></ins></div>
|
||||
<p>End of test content</p>
|
||||
`,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user