From 9ee31367dfa66ae113c1364dae507f45ae5621ff Mon Sep 17 00:00:00 2001 From: Lee Kelleher Date: Fri, 21 Mar 2025 17:56:52 +0000 Subject: [PATCH] V16: Removed deprecated client-side code (#18662) * Removed duplicated "document-is-not-trashed.condition" code * Removed deprecated code, marked for removal in Umbraco 15 (that we forgot about) * Removed deprecated code, marked for removal in Umbraco 16 * Regenerated constants * Reverted deletion --- src/Umbraco.Web.UI.Client/package.json | 1 - .../formatting-api/formatting.controller.ts | 36 -- .../src/libs/formatting-api/index.ts | 2 - .../localizeAndTransform.function.ts | 11 - .../src/packages/code-editor/index.ts | 8 - .../property-editor-ui-picker-modal.token.ts | 5 +- .../input-section/input-section.context.ts | 3 - .../core/workspace/conditions/const.ts | 12 - .../data-type-input.context.ts | 3 - .../data-type-picker-flow-modal.token.ts | 5 +- .../input-dictionary.context.ts | 3 - .../input-document-type.context.ts | 3 - .../input-document/input-document.context.ts | 3 - .../input-language/input-language.context.ts | 3 - .../input-media-type.context.ts | 3 - .../input-member-group.context.ts | 3 - .../input-member-type.context.ts | 3 - .../input-member/input-member.context.ts | 3 - .../input-content/input-content.element.ts | 10 - .../input-static-file.context.ts | 3 - .../input-partial-view.context.ts | 3 - .../input-script/input-script.context.ts | 3 - .../stylesheet-input.context.ts | 3 - .../input-template/input-template.context.ts | 3 - .../user-group-input.context.ts | 3 - .../user-input/user-input.context.ts | 3 - src/Umbraco.Web.UI.Client/tsconfig.json | 1 - .../utils/all-umb-consts/imports.ts | 393 +++++++++--------- 28 files changed, 196 insertions(+), 339 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/libs/formatting-api/formatting.controller.ts delete mode 100644 src/Umbraco.Web.UI.Client/src/libs/formatting-api/index.ts delete mode 100644 src/Umbraco.Web.UI.Client/src/libs/formatting-api/localizeAndTransform.function.ts diff --git a/src/Umbraco.Web.UI.Client/package.json b/src/Umbraco.Web.UI.Client/package.json index 07330c3f66..baf47f635b 100644 --- a/src/Umbraco.Web.UI.Client/package.json +++ b/src/Umbraco.Web.UI.Client/package.json @@ -13,7 +13,6 @@ "./embedded-media": "./dist-cms/packages/embedded-media/index.js", "./extension-api": "./dist-cms/libs/extension-api/index.js", "./extension-types": "./dist-cms/packages/extension-types/index.d.ts", - "./formatting-api": "./dist-cms/libs/formatting-api/index.js", "./localization-api": "./dist-cms/libs/localization-api/index.js", "./observable-api": "./dist-cms/libs/observable-api/index.js", "./action": "./dist-cms/packages/core/action/index.js", diff --git a/src/Umbraco.Web.UI.Client/src/libs/formatting-api/formatting.controller.ts b/src/Umbraco.Web.UI.Client/src/libs/formatting-api/formatting.controller.ts deleted file mode 100644 index 828f9d5712..0000000000 --- a/src/Umbraco.Web.UI.Client/src/libs/formatting-api/formatting.controller.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { DOMPurify, type Config } from '@umbraco-cms/backoffice/external/dompurify'; -import { Marked } from '@umbraco-cms/backoffice/external/marked'; -import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api'; -import { UmbLocalizationController } from '@umbraco-cms/backoffice/localization-api'; - -const UmbMarked = new Marked({ gfm: true, breaks: true }); -const UmbDomPurify = DOMPurify(window); -const UmbDomPurifyConfig: Config = { USE_PROFILES: { html: true } }; - -UmbDomPurify.addHook('afterSanitizeAttributes', function (node) { - // set all elements owning target to target=_blank - if ('target' in node && node instanceof HTMLElement) { - node.setAttribute('target', '_blank'); - } -}); - -/** - * @description - Controller for formatting text. - * @deprecated - Use the `` component instead. This method will be removed in Umbraco 15. - */ -export class UmbFormattingController extends UmbControllerBase { - #localize = new UmbLocalizationController(this._host); - - /** - * A method to localize the string input then transform any markdown to santized HTML. - * @param input - * @deprecated - Use the `` component instead. This method will be removed in Umbraco 15. - */ - public transform(input?: string): string { - if (!input) return ''; - const translated = this.#localize.string(input); - const markup = UmbMarked.parse(translated) as string; - const sanitized = UmbDomPurify.sanitize(markup, UmbDomPurifyConfig) as string; - return sanitized; - } -} diff --git a/src/Umbraco.Web.UI.Client/src/libs/formatting-api/index.ts b/src/Umbraco.Web.UI.Client/src/libs/formatting-api/index.ts deleted file mode 100644 index a11870de1f..0000000000 --- a/src/Umbraco.Web.UI.Client/src/libs/formatting-api/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './formatting.controller.js'; -export * from './localizeAndTransform.function.js'; diff --git a/src/Umbraco.Web.UI.Client/src/libs/formatting-api/localizeAndTransform.function.ts b/src/Umbraco.Web.UI.Client/src/libs/formatting-api/localizeAndTransform.function.ts deleted file mode 100644 index 157b6f3e30..0000000000 --- a/src/Umbraco.Web.UI.Client/src/libs/formatting-api/localizeAndTransform.function.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { UmbFormattingController } from './formatting.controller.js'; -import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; - -/** - * @param host - * @param input - * @deprecated - Use the `` component instead. This method will be removed in Umbraco 15. - */ -export function localizeAndTransform(host: UmbControllerHost, input: string): string { - return new UmbFormattingController(host).transform(input); -} diff --git a/src/Umbraco.Web.UI.Client/src/packages/code-editor/index.ts b/src/Umbraco.Web.UI.Client/src/packages/code-editor/index.ts index e3fb6a2f7c..313325dddd 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/code-editor/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/code-editor/index.ts @@ -3,11 +3,3 @@ export * from './models/index.js'; export * from './code-editor-modal/index.js'; export type { UmbCodeEditorController } from './code-editor.controller.js'; - -/** - * @deprecated Use `import from '@umbraco-cms/backoffice/code-editor';` directly. - * This function will be removed in Umbraco 15. - */ -export function loadCodeEditor() { - return import('@umbraco-cms/backoffice/code-editor'); -} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/ui-picker-modal/property-editor-ui-picker-modal.token.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/ui-picker-modal/property-editor-ui-picker-modal.token.ts index d6aacdea4b..9ffc832a14 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/ui-picker-modal/property-editor-ui-picker-modal.token.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/ui-picker-modal/property-editor-ui-picker-modal.token.ts @@ -1,9 +1,6 @@ import { UmbModalToken } from '@umbraco-cms/backoffice/modal'; -export interface UmbPropertyEditorUIPickerModalData { - /** @deprecated This property will be removed in Umbraco 15. */ - submitLabel?: string; -} +export type UmbPropertyEditorUIPickerModalData = object; export type UmbPropertyEditorUIPickerModalValue = { selection: Array; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/section/components/input-section/input-section.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/section/components/input-section/input-section.context.ts index 269af4d7f4..adc42d14d7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/section/components/input-section/input-section.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/section/components/input-section/input-section.context.ts @@ -9,6 +9,3 @@ export class UmbSectionPickerInputContext extends UmbPickerInputContext; diff --git a/src/Umbraco.Web.UI.Client/src/packages/dictionary/components/input-dictionary/input-dictionary.context.ts b/src/Umbraco.Web.UI.Client/src/packages/dictionary/components/input-dictionary/input-dictionary.context.ts index 0dfd2bf9d1..23653d4142 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/dictionary/components/input-dictionary/input-dictionary.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/dictionary/components/input-dictionary/input-dictionary.context.ts @@ -19,6 +19,3 @@ export class UmbDictionaryPickerInputContext extends UmbPickerInputContext< super(host, UMB_DICTIONARY_ITEM_REPOSITORY_ALIAS, UMB_DICTIONARY_PICKER_MODAL); } } - -/** @deprecated Use `UmbDictionaryPickerInputContext` instead. This method will be removed in Umbraco 15. */ -export { UmbDictionaryPickerInputContext as UmbDictionaryPickerContext }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/components/input-document-type/input-document-type.context.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/components/input-document-type/input-document-type.context.ts index 0d6b3ec2da..48d5473bce 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/components/input-document-type/input-document-type.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/components/input-document-type/input-document-type.context.ts @@ -16,6 +16,3 @@ export class UmbDocumentTypePickerInputContext extends UmbPickerInputContext< super(host, UMB_DOCUMENT_TYPE_ITEM_REPOSITORY_ALIAS, UMB_DOCUMENT_TYPE_PICKER_MODAL); } } - -/** @deprecated Use `UmbDocumentTypePickerInputContext` instead. This method will be removed in Umbraco 15. */ -export { UmbDocumentTypePickerInputContext as UmbDocumentTypePickerContext }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/components/input-document/input-document.context.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/components/input-document/input-document.context.ts index e7fa6ad2f7..d66945c00e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/components/input-document/input-document.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/components/input-document/input-document.context.ts @@ -61,6 +61,3 @@ export class UmbDocumentPickerInputContext extends UmbPickerInputContext< return true; }; } - -/** @deprecated Use `UmbDocumentPickerInputContext` instead. This method will be removed in Umbraco 15. */ -export { UmbDocumentPickerInputContext as UmbDocumentPickerContext }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/language/components/input-language/input-language.context.ts b/src/Umbraco.Web.UI.Client/src/packages/language/components/input-language/input-language.context.ts index 5ec78941c0..caf52fdb90 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/language/components/input-language/input-language.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/language/components/input-language/input-language.context.ts @@ -9,6 +9,3 @@ export class UmbLanguagePickerInputContext extends UmbPickerInputContext ({ type: this.#entityTypeLookup[this.#type], unique: id })); } - /** @deprecated Please use `selection` instead. This property will be removed in Umbraco 15. */ - @property({ type: Array }) - public set items(items: Array) { - this.selection = items; - } - /** @deprecated Please use `selection` instead. This property will be removed in Umbraco 15. */ - public get items(): Array { - return this.selection; - } - @property({ type: String }) public override set value(selectionString: string | undefined) { this.#selection = splitStringToArray(selectionString); diff --git a/src/Umbraco.Web.UI.Client/src/packages/static-file/components/input-static-file/input-static-file.context.ts b/src/Umbraco.Web.UI.Client/src/packages/static-file/components/input-static-file/input-static-file.context.ts index ddc063b136..7a6bc3826a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/static-file/components/input-static-file/input-static-file.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/static-file/components/input-static-file/input-static-file.context.ts @@ -15,6 +15,3 @@ export class UmbStaticFilePickerInputContext extends UmbPickerInputContext< super(host, UMB_STATIC_FILE_ITEM_REPOSITORY_ALIAS, UMB_STATIC_FILE_PICKER_MODAL); } } - -/** @deprecated Use `UmbStaticFilePickerInputContext` instead. This method will be removed in Umbraco 15. */ -export { UmbStaticFilePickerInputContext as UmbStaticFilePickerContext }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/input-partial-view/input-partial-view.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/input-partial-view/input-partial-view.context.ts index 651225cede..37ca2c9b34 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/input-partial-view/input-partial-view.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/input-partial-view/input-partial-view.context.ts @@ -13,6 +13,3 @@ export class UmbPartialViewPickerInputContext extends UmbPickerInputContext< super(host, UMB_PARTIAL_VIEW_ITEM_REPOSITORY_ALIAS, UMB_PARTIAL_VIEW_PICKER_MODAL); } } - -/** @deprecated Use `UmbPartialViewPickerInputContext` instead. This method will be removed in Umbraco 15. */ -export { UmbPartialViewPickerInputContext as UmbPartialViewPickerContext }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/input-script/input-script.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/input-script/input-script.context.ts index c5029b9845..a0890e6065 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/input-script/input-script.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/input-script/input-script.context.ts @@ -9,6 +9,3 @@ export class UmbScriptPickerInputContext extends UmbPickerInputContext