Skip to content

Commit 1b5734d

Browse files
authored
Tiptap RTE: Capabilities Tidy-up (#20078)
* Updates RTE mock data * UFM: Adds fallback for "monospace" font-family * Removes the Font Family/Sizes Menu extension This feature is not ready yet. * Tighten up Tiptap config buttons style * Fixes bug with Collections context-token Unrelated to Tiptap, but causes data-types to throw an error. Bug introduced in PR #20033 * Deprecations for v17
1 parent 91ce518 commit 1b5734d

File tree

11 files changed

+29
-33
lines changed

11 files changed

+29
-33
lines changed

src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export {
127127
Underline,
128128
} from '@tiptap/extension-underline';
129129

130-
/** @deprecated No longer used internally. This will be removed in Umbraco 18. [LK] */
130+
/** @deprecated No longer used internally. This will be removed in Umbraco 17. [LK] */
131131
export { StarterKit } from '@tiptap/starter-kit';
132132

133133
// CUSTOM EXTENSIONS

src/Umbraco.Web.UI.Client/src/mocks/data/data-type/data-type.data.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,17 +1070,35 @@ export const data: Array<UmbMockDataTypeModel> = [
10701070
alias: 'extensions',
10711071
value: [
10721072
'Umb.Tiptap.RichTextEssentials',
1073+
'Umb.Tiptap.Anchor',
1074+
'Umb.Tiptap.Block',
1075+
'Umb.Tiptap.Blockquote',
1076+
'Umb.Tiptap.Bold',
1077+
'Umb.Tiptap.BulletList',
1078+
'Umb.Tiptap.CodeBlock',
10731079
'Umb.Tiptap.Embed',
10741080
'Umb.Tiptap.Figure',
1081+
'Umb.Tiptap.Heading',
1082+
'Umb.Tiptap.HorizontalRule',
1083+
'Umb.Tiptap.HtmlAttributeClass',
1084+
'Umb.Tiptap.HtmlAttributeDataset',
1085+
'Umb.Tiptap.HtmlAttributeId',
1086+
'Umb.Tiptap.HtmlAttributeStyle',
1087+
'Umb.Tiptap.HtmlTagDiv',
1088+
'Umb.Tiptap.HtmlTagSpan',
10751089
'Umb.Tiptap.Image',
1090+
'Umb.Tiptap.Italic',
10761091
'Umb.Tiptap.Link',
10771092
'Umb.Tiptap.MediaUpload',
1093+
'Umb.Tiptap.OrderedList',
1094+
'Umb.Tiptap.Strike',
10781095
'Umb.Tiptap.Subscript',
10791096
'Umb.Tiptap.Superscript',
10801097
'Umb.Tiptap.Table',
10811098
'Umb.Tiptap.TextAlign',
10821099
'Umb.Tiptap.TextDirection',
10831100
'Umb.Tiptap.TextIndent',
1101+
'Umb.Tiptap.TrailingNode',
10841102
'Umb.Tiptap.Underline',
10851103
'Umb.Tiptap.WordCount',
10861104
],

src/Umbraco.Web.UI.Client/src/mocks/data/document/document.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ export const data: Array<UmbMockDocumentModel> = [
968968
<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>
969969
970970
<p>The following tests the embed plugin:</p>
971-
<p><div class="umb-embed-holder" data-embed-height="240" data-embed-width="360" data-embed-constrain="false" data-embed-url="https://www.youtube.com/watch?v=QRIWz9SotY4"><iframe width="360" height="240" src="https://www.youtube.com/embed/QRIWz9SotY4?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" title="Deep dive into Rich Text Editor"></iframe></div></p>
971+
<p><span class="umb-embed-holder" data-embed-height="240" data-embed-width="360" data-embed-constrain="false" data-embed-url="https://www.youtube.com/watch?v=QRIWz9SotY4"><iframe width="360" height="240" src="https://www.youtube.com/embed/QRIWz9SotY4?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" title="Deep dive into Rich Text Editor"></iframe></span></p>
972972
973973
<p><span id="foo">Some</span> value for the RTE with an <a target="" data-router-slot="disabled" href="https://google.com" type="external">external link</a> and an <a target="" data-router-slot="disabled" href="/{localLink:c05da24d-7740-447b-9cdc-bd8ce2172e38}" type="document">internal link</a>.</p>
974974

src/Umbraco.Web.UI.Client/src/packages/content/content/collection/content-collection-workspace.context-token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export const UMB_CONTENT_COLLECTION_WORKSPACE_CONTEXT = new UmbContextToken<
1010
'UmbWorkspaceContext',
1111
undefined,
1212
(context): context is UmbContentCollectionWorkspaceContext<UmbContentTypeModel> =>
13-
(context as UmbContentCollectionWorkspaceContext<UmbContentTypeModel>).collection.hasCollection !== undefined,
13+
(context as UmbContentCollectionWorkspaceContext<UmbContentTypeModel>).collection?.hasCollection !== undefined,
1414
);
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
const UMB_MENU_TIPTAP_FONT_FAMILY_ALIAS = 'Umb.Menu.Tiptap.FontFamily';
2-
3-
const menu: Array<UmbExtensionManifest> = [
4-
{
5-
type: 'menu',
6-
alias: UMB_MENU_TIPTAP_FONT_FAMILY_ALIAS,
7-
name: 'Tiptap Font Family Menu',
8-
},
9-
];
10-
11-
const toolbarExtensions: Array<UmbExtensionManifest> = [
1+
export const manifests: Array<UmbExtensionManifest> = [
122
{
133
type: 'tiptapToolbarExtension',
144
kind: 'menu',
@@ -23,13 +13,10 @@ const toolbarExtensions: Array<UmbExtensionManifest> = [
2313
{ label: 'Cursive', appearance: { style: 'font-family: cursive;' }, data: 'cursive' },
2414
{ label: 'Fantasy', appearance: { style: 'font-family: fantasy;' }, data: 'fantasy' },
2515
],
26-
menu: UMB_MENU_TIPTAP_FONT_FAMILY_ALIAS,
2716
meta: {
2817
alias: 'umbFontFamily',
2918
icon: 'icon-ruler-alt',
3019
label: 'Font family',
3120
},
3221
},
3322
];
34-
35-
export const manifests: Array<UmbExtensionManifest> = [...menu, ...toolbarExtensions];
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
const UMB_MENU_TIPTAP_FONT_SIZE_ALIAS = 'Umb.Menu.Tiptap.FontSize';
2-
3-
const menu: Array<UmbExtensionManifest> = [
4-
{
5-
type: 'menu',
6-
alias: UMB_MENU_TIPTAP_FONT_SIZE_ALIAS,
7-
name: 'Tiptap Font Size Menu',
8-
},
9-
];
10-
11-
const toolbarExtensions: Array<UmbExtensionManifest> = [
1+
export const manifests: Array<UmbExtensionManifest> = [
122
{
133
type: 'tiptapToolbarExtension',
144
kind: 'menu',
@@ -27,13 +17,10 @@ const toolbarExtensions: Array<UmbExtensionManifest> = [
2717
{ label: '26pt', data: '26pt' },
2818
{ label: '48pt', data: '48pt' },
2919
],
30-
menu: UMB_MENU_TIPTAP_FONT_SIZE_ALIAS,
3120
meta: {
3221
alias: 'umbFontSize',
3322
icon: 'icon-ruler',
3423
label: 'Font size',
3524
},
3625
},
3726
];
38-
39-
export const manifests: Array<UmbExtensionManifest> = [...menu, ...toolbarExtensions];

src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/statusbar-configuration/property-editor-ui-tiptap-statusbar-configuration.element.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ export class UmbPropertyEditorUiTiptapStatusbarConfigurationElement
310310
div {
311311
display: flex;
312312
gap: var(--uui-size-1);
313+
align-items: flex-end;
313314
}
314315
}
315316
}
@@ -369,6 +370,7 @@ export class UmbPropertyEditorUiTiptapStatusbarConfigurationElement
369370
div {
370371
display: flex;
371372
gap: var(--uui-size-1);
373+
align-items: flex-end;
372374
}
373375
}
374376
}

src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/toolbar-configuration/property-editor-ui-tiptap-toolbar-configuration.element.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement
364364
div {
365365
display: flex;
366366
gap: var(--uui-size-1);
367+
align-items: flex-end;
367368
}
368369
}
369370
}

src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/toolbar-configuration/tiptap-toolbar-group-configuration.element.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export class UmbTiptapToolbarGroupConfigurationElement<
153153
div {
154154
display: flex;
155155
gap: var(--uui-size-1);
156+
align-items: flex-end;
156157
}
157158
158159
uui-symbol-expand {

src/Umbraco.Web.UI.Client/src/packages/tiptap/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { UmbBlockRteLayoutModel } from '@umbraco-cms/backoffice/block-rte';
33

44
export type * from './extensions/types.js';
55

6-
// TODO: Rename this type:
6+
/** @deprecated No longer used internally. This will be removed in Umbraco 17. [LK] */
77
export interface UmbPropertyEditorUiValueType {
88
markup: string;
99
blocks: UmbBlockValueType<UmbBlockRteLayoutModel>;

0 commit comments

Comments
 (0)