1
- import { UMB_DATA_CONTENT_UDI , type UmbBlockRteLayoutModel } from '../types.js' ;
1
+ import { UMB_DATA_CONTENT_KEY , type UmbBlockRteLayoutModel } from '../types.js' ;
2
2
import { UMB_BLOCK_RTE_MANAGER_CONTEXT } from '../context/index.js' ;
3
3
import { UmbTiptapExtensionApiBase } from '@umbraco-cms/backoffice/tiptap' ;
4
4
import { Node } from '@umbraco-cms/backoffice/external/tiptap' ;
@@ -28,7 +28,7 @@ const umbRteBlock = Node.create({
28
28
29
29
addAttributes ( ) {
30
30
return {
31
- [ UMB_DATA_CONTENT_UDI ] : {
31
+ [ UMB_DATA_CONTENT_KEY ] : {
32
32
isRequired : true ,
33
33
} ,
34
34
} ;
@@ -47,7 +47,7 @@ const umbRteBlock = Node.create({
47
47
setBlock :
48
48
( options ) =>
49
49
( { commands } ) => {
50
- const attrs = { [ UMB_DATA_CONTENT_UDI ] : options . contentUdi } ;
50
+ const attrs = { [ UMB_DATA_CONTENT_KEY ] : options . contentUdi } ;
51
51
return commands . insertContent ( {
52
52
type : this . name ,
53
53
attrs,
@@ -75,7 +75,7 @@ const umbRteBlockInline = umbRteBlock.extend({
75
75
setBlockInline :
76
76
( options ) =>
77
77
( { commands } ) => {
78
- const attrs = { [ UMB_DATA_CONTENT_UDI ] : options . contentUdi } ;
78
+ const attrs = { [ UMB_DATA_CONTENT_KEY ] : options . contentUdi } ;
79
79
return commands . insertContent ( {
80
80
type : this . name ,
81
81
attrs,
@@ -111,7 +111,7 @@ export default class UmbTiptapBlockElementApi extends UmbTiptapExtensionApiBase
111
111
if ( ! editor ) return ;
112
112
113
113
const existingBlocks = Array . from ( editor . view . dom . querySelectorAll ( 'umb-rte-block, umb-rte-block-inline' ) ) . map (
114
- ( x ) => x . getAttribute ( UMB_DATA_CONTENT_UDI ) ,
114
+ ( x ) => x . getAttribute ( UMB_DATA_CONTENT_KEY ) ,
115
115
) ;
116
116
const newBlocks = blocks . filter ( ( x ) => ! existingBlocks . find ( ( contentUdi ) => contentUdi === x . udi ) ) ;
117
117
0 commit comments