From ff36aeeac9c31e72ae06e60eb13f18b3fe04e187 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:32:04 +0100 Subject: [PATCH 01/10] add resource mixin this mixin follows the Lit lifecycle and understands how to store and cancel running cancelable promises --- .../src/core/resource-api/resource.mixin.ts | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 src/Umbraco.Web.UI.Client/src/core/resource-api/resource.mixin.ts diff --git a/src/Umbraco.Web.UI.Client/src/core/resource-api/resource.mixin.ts b/src/Umbraco.Web.UI.Client/src/core/resource-api/resource.mixin.ts new file mode 100644 index 0000000000..5f71d52bea --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/core/resource-api/resource.mixin.ts @@ -0,0 +1,107 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { ApiError, CancelablePromise, ProblemDetails } from '@umbraco-cms/backend-api'; +import type { HTMLElementConstructor } from '@umbraco-cms/models'; +import { UmbNotificationOptions, UmbNotificationService, UmbNotificationDefaultData } from '@umbraco-cms/services'; +import { UmbContextConsumerMixin } from '@umbraco-cms/context-api'; + +export declare class UmbResourceMixinInterface { + tryExecute(promise: CancelablePromise): Promise<[T | undefined, ProblemDetails | undefined]>; + executeAndNotify(promise: CancelablePromise, options?: UmbNotificationOptions): Promise; + addResource(promise: CancelablePromise): void; + cancelAllResources(): void; +} + +export const UmbResourceMixin = (superClass: T) => { + class UmbResourceMixinClass extends UmbContextConsumerMixin(superClass) implements UmbResourceMixinInterface { + #promises: CancelablePromise[] = []; + + private _notificationService?: UmbNotificationService; + + connectedCallback() { + super.connectedCallback?.(); + this.#promises.length = 0; + this.consumeContext('umbNotificationService', (notificationService) => { + this._notificationService = notificationService; + }); + } + + disconnectedCallback() { + super.disconnectedCallback?.(); + this.cancelAllResources(); + } + + addResource(promise: CancelablePromise): void { + this.#promises.push(promise); + } + + /** + * Execute a given function and get the result as a promise. + */ + execute(func: CancelablePromise): Promise { + this.addResource(func); + return func; + } + + /** + * Wrap the {execute} function in a try/catch block and return a tuple with the result and the error. + */ + async tryExecute(func: CancelablePromise): Promise<[T | undefined, ProblemDetails | undefined]> { + try { + return [await this.execute(func), undefined]; + } catch (e) { + return [undefined, this.#toProblemDetails(e)]; + } + } + + /** + * Wrap the {execute} function in a try/catch block and return the result. + * If the executor function throws an error, then show the details in a notification. + */ + async executeAndNotify( + func: CancelablePromise, + options?: UmbNotificationOptions + ): Promise { + try { + return await this.execute(func); + } catch (e) { + const error = this.#toProblemDetails(e); + if (error) { + const data: UmbNotificationDefaultData = { + headline: error.title ?? 'Server Error', + message: error.detail ?? 'Something went wrong', + }; + this._notificationService?.peek('danger', { data, ...options }); + } + } + + return undefined; + } + + /** + * Cancel all resources that are currently being executed. + */ + cancelAllResources() { + this.#promises.forEach((promise) => { + if (promise instanceof CancelablePromise) { + promise.cancel(); + } + }); + } + + /** + * Extract the ProblemDetails object from an ApiError. + * + * This assumes that all ApiErrors contain a ProblemDetails object in their body. + */ + #toProblemDetails(error: unknown): ProblemDetails | undefined { + if (error instanceof ApiError) { + const errorDetails = error.body as ProblemDetails; + return errorDetails; + } + + return undefined; + } + } + + return UmbResourceMixinClass as unknown as HTMLElementConstructor & T; +}; From 6fef04e2d55d49a998d031e65be0055c225fc3c7 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:32:19 +0100 Subject: [PATCH 02/10] add import paths --- src/Umbraco.Web.UI.Client/src/core/resource-api/index.ts | 1 + src/Umbraco.Web.UI.Client/tsconfig.json | 1 + src/Umbraco.Web.UI.Client/web-test-runner.config.mjs | 1 + 3 files changed, 3 insertions(+) create mode 100644 src/Umbraco.Web.UI.Client/src/core/resource-api/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/core/resource-api/index.ts b/src/Umbraco.Web.UI.Client/src/core/resource-api/index.ts new file mode 100644 index 0000000000..726e3e3ff0 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/core/resource-api/index.ts @@ -0,0 +1 @@ +export * from './resource.mixin'; diff --git a/src/Umbraco.Web.UI.Client/tsconfig.json b/src/Umbraco.Web.UI.Client/tsconfig.json index 7b360952af..393b77ad72 100644 --- a/src/Umbraco.Web.UI.Client/tsconfig.json +++ b/src/Umbraco.Web.UI.Client/tsconfig.json @@ -26,6 +26,7 @@ "@umbraco-cms/extensions-api": ["src/core/extensions-api"], "@umbraco-cms/extensions-registry": ["src/core/extensions-registry"], "@umbraco-cms/observable-api": ["src/core/observable-api"], + "@umbraco-cms/resource-api": ["src/core/resource-api"], "@umbraco-cms/utils": ["src/core/utils"], "@umbraco-cms/test-utils": ["src/core/test-utils"], "@umbraco-cms/services": ["src/core/services"], diff --git a/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs b/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs index 384fe2aa3f..165a904a63 100644 --- a/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs +++ b/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs @@ -16,6 +16,7 @@ export default { '@umbraco-cms/context-api': './src/core/context-api/index.ts', '@umbraco-cms/extensions-api': './src/core/extensions-api/index.ts', '@umbraco-cms/observable-api': './src/core/observable-api/index.ts', + '@umbraco-cms/resource-api': './src/core/resource-api', '@umbraco-cms/utils': './src/core/utils/index.ts', '@umbraco-cms/test-utils': './src/core/test-utils/index.ts', '@umbraco-cms/extensions-registry': './src/core/extensions-registry/index.ts', From 5c8fbff84dc6488e2d1c6d3f16e6a46849fbd09f Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:32:30 +0100 Subject: [PATCH 03/10] export options from services/notifications --- src/Umbraco.Web.UI.Client/src/core/services/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/core/services/index.ts b/src/Umbraco.Web.UI.Client/src/core/services/index.ts index 9a44d0ea7a..4aae52e06b 100644 --- a/src/Umbraco.Web.UI.Client/src/core/services/index.ts +++ b/src/Umbraco.Web.UI.Client/src/core/services/index.ts @@ -3,5 +3,5 @@ /* eslint-disable */ export * from './modal'; -export { UmbNotificationService } from './notification'; +export * from './notification'; export type { UmbNotificationDefaultData } from './notification/layouts/default'; From e65b7d681b59b32637385569d826113c83ae1901 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:32:52 +0100 Subject: [PATCH 04/10] use new resource mixin for profiling dashboard --- ...dashboard-performance-profiling.element.ts | 36 ++++++------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/performance-profiling/dashboard-performance-profiling.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/performance-profiling/dashboard-performance-profiling.element.ts index 78e8195064..afc692ae80 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/performance-profiling/dashboard-performance-profiling.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/performance-profiling/dashboard-performance-profiling.element.ts @@ -2,12 +2,11 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib'; import { css, html, LitElement } from 'lit'; import { customElement, state } from 'lit/decorators.js'; -import { ApiError, ProblemDetails, ProfilingResource } from '@umbraco-cms/backend-api'; -import { UmbContextConsumerMixin } from '@umbraco-cms/context-api'; -import { UmbNotificationDefaultData, UmbNotificationService } from '@umbraco-cms/services'; +import { ProfilingResource } from '@umbraco-cms/backend-api'; +import { UmbResourceMixin } from '@umbraco-cms/resource-api'; @customElement('umb-dashboard-performance-profiling') -export class UmbDashboardPerformanceProfilingElement extends UmbContextConsumerMixin(LitElement) { +export class UmbDashboardPerformanceProfilingElement extends UmbResourceMixin(LitElement) { static styles = [ UUITextStyles, css` @@ -31,34 +30,19 @@ export class UmbDashboardPerformanceProfilingElement extends UmbContextConsumerM @state() private _profilingPerfomance = false; - private _notificationService?: UmbNotificationService; - - private async _getProfilingStatus() { - try { - const status = await ProfilingResource.getProfilingStatus(); - this._profilingStatus = status.enabled; - } catch (e) { - if (e instanceof ApiError) { - const error = e as ProblemDetails; - const data: UmbNotificationDefaultData = { message: error.message ?? 'Something went wrong' }; - this._notificationService?.peek('danger', { data }); - } - } - } - - constructor() { - super(); - this.consumeAllContexts(['umbNotificationService'], (instances) => { - this._notificationService = instances['umbNotificationService']; - }); - } - connectedCallback(): void { super.connectedCallback(); this._getProfilingStatus(); this._profilingPerfomance = localStorage.getItem('profilingPerformance') === 'true'; } + private async _getProfilingStatus() { + const profilingStatus = await this.executeAndNotify(ProfilingResource.getProfilingStatus()); + if (profilingStatus) { + this._profilingStatus = profilingStatus.enabled; + } + } + private _changeProfilingPerformance() { this._profilingPerfomance = !this._profilingPerfomance; localStorage.setItem('profilingPerformance', this._profilingPerfomance.toString()); From 77cd8633c1b5cb568c6249caaad68a2b116aa05f Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 20 Dec 2022 07:44:30 +0100 Subject: [PATCH 05/10] add path for @umbraco-cms/controllers --- src/Umbraco.Web.UI.Client/tsconfig.json | 2 +- src/Umbraco.Web.UI.Client/web-test-runner.config.mjs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/tsconfig.json b/src/Umbraco.Web.UI.Client/tsconfig.json index 393b77ad72..6763dcdfee 100644 --- a/src/Umbraco.Web.UI.Client/tsconfig.json +++ b/src/Umbraco.Web.UI.Client/tsconfig.json @@ -26,9 +26,9 @@ "@umbraco-cms/extensions-api": ["src/core/extensions-api"], "@umbraco-cms/extensions-registry": ["src/core/extensions-registry"], "@umbraco-cms/observable-api": ["src/core/observable-api"], - "@umbraco-cms/resource-api": ["src/core/resource-api"], "@umbraco-cms/utils": ["src/core/utils"], "@umbraco-cms/test-utils": ["src/core/test-utils"], + "@umbraco-cms/controllers": ["src/core/controllers"], "@umbraco-cms/services": ["src/core/services"], "@umbraco-cms/components/*": ["src/backoffice/components/*"], "@umbraco-cms/stores/*": ["src/core/stores/*"], diff --git a/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs b/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs index 165a904a63..3ffba5215a 100644 --- a/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs +++ b/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs @@ -19,6 +19,8 @@ export default { '@umbraco-cms/resource-api': './src/core/resource-api', '@umbraco-cms/utils': './src/core/utils/index.ts', '@umbraco-cms/test-utils': './src/core/test-utils/index.ts', + '@umbraco-cms/controllers': './src/core/controllers', + '@umbraco-cms/services': './src/core/services', '@umbraco-cms/extensions-registry': './src/core/extensions-registry/index.ts', }, }, From 62a598118cd459a8c1b85d2520e3ae7303d20e8d Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 20 Dec 2022 07:44:45 +0100 Subject: [PATCH 06/10] convert resource mixin to controller --- .../src/core/controllers/index.ts | 1 + .../core/controllers/resource.controller.ts | 113 ++++++++++++++++++ .../src/core/resource-api/index.ts | 1 - .../src/core/resource-api/resource.mixin.ts | 107 ----------------- 4 files changed, 114 insertions(+), 108 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/core/controllers/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/core/controllers/resource.controller.ts delete mode 100644 src/Umbraco.Web.UI.Client/src/core/resource-api/index.ts delete mode 100644 src/Umbraco.Web.UI.Client/src/core/resource-api/resource.mixin.ts diff --git a/src/Umbraco.Web.UI.Client/src/core/controllers/index.ts b/src/Umbraco.Web.UI.Client/src/core/controllers/index.ts new file mode 100644 index 0000000000..b4dfcb2097 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/core/controllers/index.ts @@ -0,0 +1 @@ +export * from './resource.controller'; diff --git a/src/Umbraco.Web.UI.Client/src/core/controllers/resource.controller.ts b/src/Umbraco.Web.UI.Client/src/core/controllers/resource.controller.ts new file mode 100644 index 0000000000..ca9a34d44e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/core/controllers/resource.controller.ts @@ -0,0 +1,113 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { ReactiveController, ReactiveControllerHost } from 'lit'; +import { ApiError, CancelablePromise, ProblemDetails } from '@umbraco-cms/backend-api'; +import { UmbNotificationOptions, UmbNotificationDefaultData, UmbNotificationService } from '@umbraco-cms/services'; + +export class UmbResourceController implements ReactiveController { + host: ReactiveControllerHost; + + #promises: Promise[] = []; + + #notificationService?: UmbNotificationService; + + constructor(host: ReactiveControllerHost) { + (this.host = host).addController(this); + } + + hostConnected() { + this.#promises.length = 0; + } + + hostDisconnected() { + this.cancelAllResources(); + } + + addResource(promise: Promise): void { + this.#promises.push(promise); + } + + /** + * Execute a given function and get the result as a promise. + */ + execute(func: Promise): Promise { + this.addResource(func); + return func; + } + + /** + * Wrap the {execute} function in a try/catch block and return a tuple with the result and the error. + */ + async tryExecute(func: Promise): Promise<[T | undefined, ProblemDetails | undefined]> { + try { + return [await this.execute(func), undefined]; + } catch (e) { + return [undefined, this.#toProblemDetails(e)]; + } + } + + /** + * Wrap the {execute} function in a try/catch block and return the result. + * If the executor function throws an error, then show the details in a notification. + */ + async tryExecuteAndNotify( + func: Promise, + options?: UmbNotificationOptions + ): Promise<[T | undefined, ProblemDetails | undefined]> { + const [result, error] = await this.tryExecute(func); + + if (error) { + const data: UmbNotificationDefaultData = { + headline: error.title ?? 'Server Error', + message: error.detail ?? 'Something went wrong', + }; + + if (this.#notificationService) { + this.#notificationService?.peek('danger', { data, ...options }); + } else { + console.group('UmbResourceController'); + console.error(error); + console.groupEnd(); + } + } + + return [result, error]; + } + + /** + * Cancel all resources that are currently being executed by this controller if they are cancelable. + * + * This works by checking if the promise is a CancelablePromise and if so, it will call the cancel method. + * + * This is useful when the controller is being disconnected from the DOM. + * + * @see CancelablePromise + * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal + * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortController + */ + cancelAllResources() { + this.#promises.forEach((promise) => { + if (promise instanceof CancelablePromise) { + promise.cancel(); + } + }); + } + + /** + * Extract the ProblemDetails object from an ApiError. + * + * This assumes that all ApiErrors contain a ProblemDetails object in their body. + */ + #toProblemDetails(error: unknown): ProblemDetails | undefined { + if (error instanceof ApiError) { + const errorDetails = error.body as ProblemDetails; + return errorDetails; + } else if (error instanceof Error) { + return { + title: error.name, + detail: error.message, + }; + } + + return undefined; + } +} diff --git a/src/Umbraco.Web.UI.Client/src/core/resource-api/index.ts b/src/Umbraco.Web.UI.Client/src/core/resource-api/index.ts deleted file mode 100644 index 726e3e3ff0..0000000000 --- a/src/Umbraco.Web.UI.Client/src/core/resource-api/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './resource.mixin'; diff --git a/src/Umbraco.Web.UI.Client/src/core/resource-api/resource.mixin.ts b/src/Umbraco.Web.UI.Client/src/core/resource-api/resource.mixin.ts deleted file mode 100644 index 5f71d52bea..0000000000 --- a/src/Umbraco.Web.UI.Client/src/core/resource-api/resource.mixin.ts +++ /dev/null @@ -1,107 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { ApiError, CancelablePromise, ProblemDetails } from '@umbraco-cms/backend-api'; -import type { HTMLElementConstructor } from '@umbraco-cms/models'; -import { UmbNotificationOptions, UmbNotificationService, UmbNotificationDefaultData } from '@umbraco-cms/services'; -import { UmbContextConsumerMixin } from '@umbraco-cms/context-api'; - -export declare class UmbResourceMixinInterface { - tryExecute(promise: CancelablePromise): Promise<[T | undefined, ProblemDetails | undefined]>; - executeAndNotify(promise: CancelablePromise, options?: UmbNotificationOptions): Promise; - addResource(promise: CancelablePromise): void; - cancelAllResources(): void; -} - -export const UmbResourceMixin = (superClass: T) => { - class UmbResourceMixinClass extends UmbContextConsumerMixin(superClass) implements UmbResourceMixinInterface { - #promises: CancelablePromise[] = []; - - private _notificationService?: UmbNotificationService; - - connectedCallback() { - super.connectedCallback?.(); - this.#promises.length = 0; - this.consumeContext('umbNotificationService', (notificationService) => { - this._notificationService = notificationService; - }); - } - - disconnectedCallback() { - super.disconnectedCallback?.(); - this.cancelAllResources(); - } - - addResource(promise: CancelablePromise): void { - this.#promises.push(promise); - } - - /** - * Execute a given function and get the result as a promise. - */ - execute(func: CancelablePromise): Promise { - this.addResource(func); - return func; - } - - /** - * Wrap the {execute} function in a try/catch block and return a tuple with the result and the error. - */ - async tryExecute(func: CancelablePromise): Promise<[T | undefined, ProblemDetails | undefined]> { - try { - return [await this.execute(func), undefined]; - } catch (e) { - return [undefined, this.#toProblemDetails(e)]; - } - } - - /** - * Wrap the {execute} function in a try/catch block and return the result. - * If the executor function throws an error, then show the details in a notification. - */ - async executeAndNotify( - func: CancelablePromise, - options?: UmbNotificationOptions - ): Promise { - try { - return await this.execute(func); - } catch (e) { - const error = this.#toProblemDetails(e); - if (error) { - const data: UmbNotificationDefaultData = { - headline: error.title ?? 'Server Error', - message: error.detail ?? 'Something went wrong', - }; - this._notificationService?.peek('danger', { data, ...options }); - } - } - - return undefined; - } - - /** - * Cancel all resources that are currently being executed. - */ - cancelAllResources() { - this.#promises.forEach((promise) => { - if (promise instanceof CancelablePromise) { - promise.cancel(); - } - }); - } - - /** - * Extract the ProblemDetails object from an ApiError. - * - * This assumes that all ApiErrors contain a ProblemDetails object in their body. - */ - #toProblemDetails(error: unknown): ProblemDetails | undefined { - if (error instanceof ApiError) { - const errorDetails = error.body as ProblemDetails; - return errorDetails; - } - - return undefined; - } - } - - return UmbResourceMixinClass as unknown as HTMLElementConstructor & T; -}; From ccd58c8be9f9fe916cb3048a4a7749ca1bdf6eea Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 20 Dec 2022 07:45:35 +0100 Subject: [PATCH 07/10] use ResourceController --- .../dashboard-performance-profiling.element.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/performance-profiling/dashboard-performance-profiling.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/performance-profiling/dashboard-performance-profiling.element.ts index afc692ae80..fa4835f52b 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/performance-profiling/dashboard-performance-profiling.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/performance-profiling/dashboard-performance-profiling.element.ts @@ -2,11 +2,11 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib'; import { css, html, LitElement } from 'lit'; import { customElement, state } from 'lit/decorators.js'; +import { UmbResourceController } from '@umbraco-cms/controllers'; import { ProfilingResource } from '@umbraco-cms/backend-api'; -import { UmbResourceMixin } from '@umbraco-cms/resource-api'; @customElement('umb-dashboard-performance-profiling') -export class UmbDashboardPerformanceProfilingElement extends UmbResourceMixin(LitElement) { +export class UmbDashboardPerformanceProfilingElement extends LitElement { static styles = [ UUITextStyles, css` @@ -30,6 +30,8 @@ export class UmbDashboardPerformanceProfilingElement extends UmbResourceMixin(Li @state() private _profilingPerfomance = false; + private _resourceController = new UmbResourceController(this); + connectedCallback(): void { super.connectedCallback(); this._getProfilingStatus(); @@ -37,7 +39,9 @@ export class UmbDashboardPerformanceProfilingElement extends UmbResourceMixin(Li } private async _getProfilingStatus() { - const profilingStatus = await this.executeAndNotify(ProfilingResource.getProfilingStatus()); + const [profilingStatus] = await this._resourceController.tryExecuteAndNotify( + ProfilingResource.getProfilingStatus() + ); if (profilingStatus) { this._profilingStatus = profilingStatus.enabled; } From 8732dcf029c3767dcb56670e3644a41c0d8a0545 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 20 Dec 2022 14:27:44 +0100 Subject: [PATCH 08/10] add ContextConsumer to get instance of NotificationService --- .../src/core/controllers/resource.controller.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/core/controllers/resource.controller.ts b/src/Umbraco.Web.UI.Client/src/core/controllers/resource.controller.ts index ca9a34d44e..bff3e44b7b 100644 --- a/src/Umbraco.Web.UI.Client/src/core/controllers/resource.controller.ts +++ b/src/Umbraco.Web.UI.Client/src/core/controllers/resource.controller.ts @@ -2,24 +2,37 @@ import { ReactiveController, ReactiveControllerHost } from 'lit'; import { ApiError, CancelablePromise, ProblemDetails } from '@umbraco-cms/backend-api'; import { UmbNotificationOptions, UmbNotificationDefaultData, UmbNotificationService } from '@umbraco-cms/services'; +import { UmbContextConsumer } from '@umbraco-cms/context-api'; export class UmbResourceController implements ReactiveController { host: ReactiveControllerHost; #promises: Promise[] = []; + #notificationConsumer: UmbContextConsumer; + #notificationService?: UmbNotificationService; constructor(host: ReactiveControllerHost) { (this.host = host).addController(this); + + this.#notificationConsumer = new UmbContextConsumer( + host as unknown as EventTarget, + 'umbNotificationService', + (_instance: UmbNotificationService) => { + this.#notificationService = _instance; + } + ); } hostConnected() { this.#promises.length = 0; + this.#notificationConsumer.attach(); } hostDisconnected() { this.cancelAllResources(); + this.#notificationConsumer.detach(); } addResource(promise: Promise): void { From bdae219f7188d2e659ba58de5cc05037b7ec3d33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Dec 2022 18:09:31 +0000 Subject: [PATCH 09/10] Bump eslint from 8.29.0 to 8.30.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.29.0 to 8.30.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.29.0...v8.30.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/Umbraco.Web.UI.Client/package-lock.json | 78 ++++++++++----------- src/Umbraco.Web.UI.Client/package.json | 2 +- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/package-lock.json b/src/Umbraco.Web.UI.Client/package-lock.json index 7755f2ff02..f4520817df 100644 --- a/src/Umbraco.Web.UI.Client/package-lock.json +++ b/src/Umbraco.Web.UI.Client/package-lock.json @@ -48,7 +48,7 @@ "@web/test-runner": "^0.15.0", "@web/test-runner-playwright": "^0.9.0", "babel-loader": "^9.1.0", - "eslint": "^8.29.0", + "eslint": "^8.30.0", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.26.0", @@ -2053,15 +2053,15 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", - "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", + "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.15.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -2082,9 +2082,9 @@ "dev": true }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -2124,9 +2124,9 @@ "dev": true }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.7", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", - "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -15367,13 +15367,13 @@ } }, "node_modules/eslint": { - "version": "8.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", - "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", + "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", + "@eslint/eslintrc": "^1.4.0", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -15392,7 +15392,7 @@ "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.15.0", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", @@ -15831,9 +15831,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -32717,15 +32717,15 @@ "optional": true }, "@eslint/eslintrc": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", - "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", + "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.15.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -32740,9 +32740,9 @@ "dev": true }, "globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -32775,9 +32775,9 @@ "dev": true }, "@humanwhocodes/config-array": { - "version": "0.11.7", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", - "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -42924,13 +42924,13 @@ "dev": true }, "eslint": { - "version": "8.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", - "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", + "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", + "@eslint/eslintrc": "^1.4.0", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -42949,7 +42949,7 @@ "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.15.0", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", @@ -43036,9 +43036,9 @@ } }, "globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "requires": { "type-fest": "^0.20.2" diff --git a/src/Umbraco.Web.UI.Client/package.json b/src/Umbraco.Web.UI.Client/package.json index 2dfa0d6734..f6b8f66442 100644 --- a/src/Umbraco.Web.UI.Client/package.json +++ b/src/Umbraco.Web.UI.Client/package.json @@ -93,7 +93,7 @@ "@web/test-runner": "^0.15.0", "@web/test-runner-playwright": "^0.9.0", "babel-loader": "^9.1.0", - "eslint": "^8.29.0", + "eslint": "^8.30.0", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.26.0", From b8e3622ef079ab723768113e296e2602c547355f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Dec 2022 18:09:51 +0000 Subject: [PATCH 10/10] Bump @babel/core from 7.20.5 to 7.20.7 Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.20.5 to 7.20.7. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.20.7/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Umbraco.Web.UI.Client/package-lock.json | 240 +++++++++++--------- src/Umbraco.Web.UI.Client/package.json | 2 +- 2 files changed, 138 insertions(+), 104 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/package-lock.json b/src/Umbraco.Web.UI.Client/package-lock.json index 7755f2ff02..d526cd6fd7 100644 --- a/src/Umbraco.Web.UI.Client/package-lock.json +++ b/src/Umbraco.Web.UI.Client/package-lock.json @@ -26,7 +26,7 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@babel/core": "^7.20.5", + "@babel/core": "^7.20.7", "@mdx-js/react": "^2.2.1", "@open-wc/testing": "^3.1.7", "@playwright/test": "^1.29.0", @@ -131,30 +131,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.1.tgz", - "integrity": "sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.5.tgz", + "integrity": "sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.5.tgz", - "integrity": "sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.7.tgz", + "integrity": "sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.5", - "@babel/helper-compilation-targets": "^7.20.0", - "@babel/helper-module-transforms": "^7.20.2", - "@babel/helpers": "^7.20.5", - "@babel/parser": "^7.20.5", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5", + "@babel/generator": "^7.20.7", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-module-transforms": "^7.20.7", + "@babel/helpers": "^7.20.7", + "@babel/parser": "^7.20.7", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -170,12 +170,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.5.tgz", - "integrity": "sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.7.tgz", + "integrity": "sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw==", "dev": true, "dependencies": { - "@babel/types": "^7.20.5", + "@babel/types": "^7.20.7", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -223,14 +223,15 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz", - "integrity": "sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", + "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.20.0", + "@babel/compat-data": "^7.20.5", "@babel/helper-validator-option": "^7.18.6", "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", "semver": "^6.3.0" }, "engines": { @@ -240,6 +241,21 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, "node_modules/@babel/helper-create-class-features-plugin": { "version": "7.19.0", "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.19.0.tgz", @@ -365,9 +381,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz", - "integrity": "sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.7.tgz", + "integrity": "sha512-FNdu7r67fqMUSVuQpFQGE6BPdhJIhitoxhGzDbAXNcA07uoVG37fOiMk3OSV8rEICuyG6t8LGkd9EE64qIEoIA==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.18.9", @@ -375,9 +391,9 @@ "@babel/helper-simple-access": "^7.20.2", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" @@ -517,14 +533,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.20.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.6.tgz", - "integrity": "sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.7.tgz", + "integrity": "sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA==", "dev": true, "dependencies": { - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" @@ -545,9 +561,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", - "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.7.tgz", + "integrity": "sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1931,33 +1947,33 @@ } }, "node_modules/@babel/template": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", - "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.5.tgz", - "integrity": "sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ==", + "version": "7.20.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.8.tgz", + "integrity": "sha512-/RNkaYDeCy4MjyV70+QkSHhxbvj2JO/5Ft2Pa880qJOG8tWrqcT/wXUuCCv43yogfqPzHL77Xu101KQPf4clnQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.5", + "@babel/generator": "^7.20.7", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.5", - "@babel/types": "^7.20.5", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1966,9 +1982,9 @@ } }, "node_modules/@babel/types": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", - "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.19.4", @@ -31406,27 +31422,27 @@ } }, "@babel/compat-data": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.1.tgz", - "integrity": "sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.5.tgz", + "integrity": "sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==", "dev": true }, "@babel/core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.5.tgz", - "integrity": "sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.7.tgz", + "integrity": "sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw==", "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.5", - "@babel/helper-compilation-targets": "^7.20.0", - "@babel/helper-module-transforms": "^7.20.2", - "@babel/helpers": "^7.20.5", - "@babel/parser": "^7.20.5", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5", + "@babel/generator": "^7.20.7", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-module-transforms": "^7.20.7", + "@babel/helpers": "^7.20.7", + "@babel/parser": "^7.20.7", + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -31435,12 +31451,12 @@ } }, "@babel/generator": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.5.tgz", - "integrity": "sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.7.tgz", + "integrity": "sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw==", "dev": true, "requires": { - "@babel/types": "^7.20.5", + "@babel/types": "^7.20.7", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -31478,15 +31494,33 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz", - "integrity": "sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", + "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.20.0", + "@babel/compat-data": "^7.20.5", "@babel/helper-validator-option": "^7.18.6", "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", "semver": "^6.3.0" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } } }, "@babel/helper-create-class-features-plugin": { @@ -31581,9 +31615,9 @@ } }, "@babel/helper-module-transforms": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz", - "integrity": "sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.7.tgz", + "integrity": "sha512-FNdu7r67fqMUSVuQpFQGE6BPdhJIhitoxhGzDbAXNcA07uoVG37fOiMk3OSV8rEICuyG6t8LGkd9EE64qIEoIA==", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.18.9", @@ -31591,9 +31625,9 @@ "@babel/helper-simple-access": "^7.20.2", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7" } }, "@babel/helper-optimise-call-expression": { @@ -31694,14 +31728,14 @@ } }, "@babel/helpers": { - "version": "7.20.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.6.tgz", - "integrity": "sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.7.tgz", + "integrity": "sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA==", "dev": true, "requires": { - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5" + "@babel/template": "^7.20.7", + "@babel/traverse": "^7.20.7", + "@babel/types": "^7.20.7" } }, "@babel/highlight": { @@ -31716,9 +31750,9 @@ } }, "@babel/parser": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", - "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.7.tgz", + "integrity": "sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg==", "dev": true }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { @@ -32634,38 +32668,38 @@ } }, "@babel/template": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", - "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" } }, "@babel/traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.5.tgz", - "integrity": "sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ==", + "version": "7.20.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.8.tgz", + "integrity": "sha512-/RNkaYDeCy4MjyV70+QkSHhxbvj2JO/5Ft2Pa880qJOG8tWrqcT/wXUuCCv43yogfqPzHL77Xu101KQPf4clnQ==", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.5", + "@babel/generator": "^7.20.7", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.5", - "@babel/types": "^7.20.5", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", - "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.19.4", diff --git a/src/Umbraco.Web.UI.Client/package.json b/src/Umbraco.Web.UI.Client/package.json index 2dfa0d6734..72b1b3f454 100644 --- a/src/Umbraco.Web.UI.Client/package.json +++ b/src/Umbraco.Web.UI.Client/package.json @@ -71,7 +71,7 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@babel/core": "^7.20.5", + "@babel/core": "^7.20.7", "@mdx-js/react": "^2.2.1", "@open-wc/testing": "^3.1.7", "@playwright/test": "^1.29.0",