diff --git a/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-grid-preview.custom-view.element.ts b/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-grid-preview.custom-view.element.ts index 49bdb90..5dbe399 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-grid-preview.custom-view.element.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-grid-preview.custom-view.element.ts @@ -332,6 +332,13 @@ export class BlockGridPreviewCustomView if (data) { this._htmlMarkup = data ?? ''; this._isLoading = false; + + document.body.dispatchEvent(new CustomEvent('umb-block-preview-rendered', { + detail: { + host: this, + html: this._htmlMarkup + } + })); } else if (UmbApiError.isUmbApiError(error)) { this._error = error.message; diff --git a/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-list-preview.custom-view.element.ts b/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-list-preview.custom-view.element.ts index 6306a56..962eae1 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-list-preview.custom-view.element.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-list-preview.custom-view.element.ts @@ -300,6 +300,12 @@ export class BlockListPreviewCustomView if (data) { this._htmlMarkup = data ?? ''; this._isLoading = false; + document.body.dispatchEvent(new CustomEvent('umb-block-list-preview-rendered', { + detail: { + host: this, + html: this._htmlMarkup + } + })); } else if (UmbApiError.isUmbApiError(error)) { this._error = error.message; diff --git a/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/rich-text-preview.custom-view.element.ts b/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/rich-text-preview.custom-view.element.ts index 737b6bf..2c4ba89 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/rich-text-preview.custom-view.element.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/rich-text-preview.custom-view.element.ts @@ -255,6 +255,12 @@ export class RichTextPreviewCustomView if (data) { this._htmlMarkup = data ?? ''; this._isLoading = false; + document.body.dispatchEvent(new CustomEvent('umb-block-rte-preview-rendered', { + detail: { + host: this, + html: this._htmlMarkup + } + })); } else if (UmbApiError.isUmbApiError(error)) { this._error = error.message;