diff --git a/src/Umbraco.Web.UI.Client/src/libs/context-api/debug/context-data.function.ts b/src/Umbraco.Web.UI.Client/src/libs/context-api/debug/context-data.function.ts index c7757a2569..6e4768d6f2 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/context-api/debug/context-data.function.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/context-api/debug/context-data.function.ts @@ -5,8 +5,8 @@ * @param contexts This is a map of the collected contexts from umb-debug * @returns An array of simplified context data */ -export function contextData(contexts: Map): Array { - const contextData = new Array(); +export function contextData(contexts: Map): Array { + const contextData = new Array(); for (const [alias, instance] of contexts) { const data: DebugContextItemData = contextItemData(instance); contextData.push({ alias: alias, type: typeof instance, data }); @@ -20,8 +20,8 @@ export function contextData(contexts: Map): Array { * @param contextInstance The instance of the context * @returns A simplied object contain the properties and methods of the context */ -function contextItemData(contextInstance: any): DebugContextItemData { - let contextItemData: DebugContextItemData = { type: 'unknown' }; +function contextItemData(contextInstance: any): UmbDebugContextItemData { + let contextItemData: UmbDebugContextItemData = { type: 'unknown' }; if (typeof contextInstance === 'function') { contextItemData = { ...contextItemData, type: 'function' }; @@ -101,12 +101,12 @@ function getClassMethodNames(klass: any) { return allMethods.filter((name: any) => name !== 'constructor' && !name.startsWith('_')); } -export interface DebugContextData { +export interface UmbDebugContextData { /** * The alias of the context * * @type {string} - * @memberof DebugContextData + * @memberof UmbDebugContextData */ alias: string; @@ -114,32 +114,32 @@ export interface DebugContextData { * The type of the context such as object or string * * @type {("string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function")} - * @memberof DebugContextData + * @memberof UmbDebugContextData */ type: 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function'; /** * Data about the context that includes method and property names * - * @type {DebugContextItemData} - * @memberof DebugContextData + * @type {UmbDebugContextItemData} + * @memberof UmbDebugContextData */ - data: DebugContextItemData; + data: UmbDebugContextItemData; } -export interface DebugContextItemData { +export interface UmbDebugContextItemData { type: string; methods?: Array; - properties?: Array; + properties?: Array; value?: unknown; } -export interface DebugContextItemPropertyData { +export interface UmbDebugContextItemPropertyData { /** * The name of the property * * @type {string} - * @memberof DebugContextItemPropertyData + * @memberof UmbDebugContextItemPropertyData */ key: string; @@ -147,7 +147,7 @@ export interface DebugContextItemPropertyData { * The type of the property's value such as string or number * * @type {("string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function")} - * @memberof DebugContextItemPropertyData + * @memberof UmbDebugContextItemPropertyData */ type: 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function'; @@ -155,7 +155,7 @@ export interface DebugContextItemPropertyData { * Simple types such as string or number can have their value displayed stored inside the property * * @type {("string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function")} - * @memberof DebugContextItemPropertyData + * @memberof UmbDebugContextItemPropertyData */ value?: unknown; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/debug/debug.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/debug/debug.element.ts index 1059ecd908..20e1a75fbc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/debug/debug.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/debug/debug.element.ts @@ -2,11 +2,11 @@ import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import type { TemplateResult } from '@umbraco-cms/backoffice/external/lit'; import { css, html, nothing, customElement, property, state, repeat } from '@umbraco-cms/backoffice/external/lit'; -import type { DebugContextData, DebugContextItemData } from '@umbraco-cms/backoffice/context-api'; import { contextData, UmbContextDebugRequest } from '@umbraco-cms/backoffice/context-api'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import type { UmbModalManagerContext } from '@umbraco-cms/backoffice/modal'; import { UMB_CONTEXT_DEBUGGER_MODAL, UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; +import type { UmbDebugContextData, UmbDebugContextItemData } from '@umbraco-cms/backoffice/context-api'; @customElement('umb-debug') export class UmbDebugElement extends UmbLitElement { @@ -17,7 +17,7 @@ export class UmbDebugElement extends UmbLitElement { dialog = false; @state() - contextData = Array(); + private _contextData = Array(); @state() private _debugPaneOpen = false; @@ -50,9 +50,9 @@ export class UmbDebugElement extends UmbLitElement { // back to this property of the WebComponent // Massage the data into a simplier array of objects - // From a function in the context-api ' - this.contextData = contextData(contexts); - this.requestUpdate('contextData'); + // from a function in the context-api. + this._contextData = contextData(contexts); + this.requestUpdate('_contextData'); }), ); }