Skip to content

Commit bf5db33

Browse files
committed
Merge remote-tracking branch 'origin/v15/feature/tiptap' into v15/feature/tiptap
2 parents 29bbf8e + 4e681cb commit bf5db33

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/packages/block/block-rte/context/block-rte-manager.context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ export class UmbBlockRteManagerContext<
4343
* @internal
4444
*/
4545
public deleteLayoutElement(contentKey: string) {
46-
this.removeBlockUdi(contentKey);
46+
this.removeBlockKey(contentKey);
4747
}
4848
}

src/packages/block/block/context/block-manager.context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export abstract class UmbBlockManagerContext<
307307
}
308308
}
309309

310-
protected removeBlockUdi(contentUdi: string) {
311-
this.#contents.removeOne(contentUdi);
310+
protected removeBlockKey(contentKey: string) {
311+
this.#contents.removeOne(contentKey);
312312
}
313313
}

src/packages/rte/components/rte-base.element.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ export abstract class UmbRteBaseElement extends UmbLitElement implements UmbProp
127127
this.#managerContext.exposes,
128128
]).pipe(debounceTime(20)),
129129
([layouts, contents, settings, exposes]) => {
130-
console.log('new blocks', layouts, contents, exposes);
131130
this._value = {
132131
...this._value,
133132
blocks: {
@@ -137,7 +136,7 @@ export abstract class UmbRteBaseElement extends UmbLitElement implements UmbProp
137136
expose: exposes,
138137
},
139138
};
140-
//context.setValue(this._value);
139+
141140
this._fireChangeEvent();
142141
},
143142
'motherObserver',

src/packages/rte/tiptap/property-editors/tiptap/property-editor-ui-tiptap.element.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ const elementName = 'umb-property-editor-ui-tiptap';
1313
export class UmbPropertyEditorUiTiptapElement extends UmbRteBaseElement {
1414
#onChange(event: CustomEvent & { target: UmbInputTiptapElement }) {
1515
const value = event.target.value;
16-
this._latestMarkup = value;
17-
18-
this._value = {
19-
...this._value,
20-
markup: this._latestMarkup,
21-
};
2216

2317
// Remove unused Blocks of Blocks Layout. Leaving only the Blocks that are present in Markup.
2418
const usedContentKeys: string[] = [];
@@ -28,14 +22,21 @@ export class UmbPropertyEditorUiTiptapElement extends UmbRteBaseElement {
2822
/<umb-rte-block(?:-inline)?(?: class="(?:.[^"]*)")? data-content-key="(?<key>.[^"]*)">(?:<!--Umbraco-Block-->)?<\/umb-rte-block(?:-inline)?>/gi,
2923
);
3024
let blockElement: RegExpExecArray | null;
31-
while ((blockElement = regex.exec(this._latestMarkup)) !== null) {
25+
while ((blockElement = regex.exec(value)) !== null) {
3226
if (blockElement.groups?.key) {
3327
usedContentKeys.push(blockElement.groups.key);
3428
}
3529
}
3630

3731
this._filterUnusedBlocks(usedContentKeys);
3832

33+
this._latestMarkup = value;
34+
35+
this._value = {
36+
...this._value,
37+
markup: this._latestMarkup,
38+
};
39+
3940
this._fireChangeEvent();
4041
}
4142

0 commit comments

Comments
 (0)