From ec43c6e5adfdd2fdfa71312f723a0fdff99ea950 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 23 Apr 2024 19:18:10 +0200 Subject: [PATCH] move textarea and text box schemas --- .../core/property-editor/schemas/manifests.ts | 6 -- .../packages/property-editors/manifests.ts | 20 ++--- .../text-box}/Umbraco.EmailAddress.ts | 0 .../text-box}/Umbraco.TextBox.ts | 0 .../property-editors/text-box/manifests.ts | 8 +- .../textarea}/Umbraco.TextArea.ts | 0 .../property-editors/textarea/manifests.ts | 82 ++++++++++--------- 7 files changed, 59 insertions(+), 57 deletions(-) rename src/Umbraco.Web.UI.Client/src/packages/{core/property-editor/schemas => property-editors/text-box}/Umbraco.EmailAddress.ts (100%) rename src/Umbraco.Web.UI.Client/src/packages/{core/property-editor/schemas => property-editors/text-box}/Umbraco.TextBox.ts (100%) rename src/Umbraco.Web.UI.Client/src/packages/{core/property-editor/schemas => property-editors/textarea}/Umbraco.TextArea.ts (100%) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/manifests.ts index d84a5c1f08..9a104fece9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/manifests.ts @@ -1,6 +1,5 @@ import { manifest as blockGrid } from './Umbraco.BlockGrid.js'; import { manifest as blockList } from './Umbraco.BlockList.js'; -import { manifest as emailAddress } from './Umbraco.EmailAddress.js'; import { manifest as iconPicker } from './Umbraco.IconPicker.js'; import { manifest as imageCropper } from './Umbraco.ImageCropper.js'; import { manifest as label } from './Umbraco.Label.js'; @@ -14,8 +13,6 @@ import { manifest as multiUrlPicker } from './Umbraco.MultiUrlPicker.js'; import { manifest as radioButtonList } from './Umbraco.RadioButtonList.js'; import { manifest as slider } from './Umbraco.Slider.js'; import { manifest as tags } from './Umbraco.Tags.js'; -import { manifest as textArea } from './Umbraco.TextArea.js'; -import { manifest as textBox } from './Umbraco.TextBox.js'; import { manifest as richText } from './Umbraco.RichText.js'; import { manifest as trueFalse } from './Umbraco.TrueFalse.js'; import { manifest as uploadField } from './Umbraco.UploadField.js'; @@ -26,7 +23,6 @@ import type { ManifestPropertyEditorSchema } from '@umbraco-cms/backoffice/exten export const manifests: Array = [ blockGrid, blockList, - emailAddress, iconPicker, imageCropper, label, @@ -40,8 +36,6 @@ export const manifests: Array = [ radioButtonList, slider, tags, - textArea, - textBox, richText, trueFalse, uploadField, diff --git a/src/Umbraco.Web.UI.Client/src/packages/property-editors/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/manifests.ts index 1e53ce7bb9..789a55d536 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/property-editors/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/property-editors/manifests.ts @@ -1,12 +1,6 @@ -import { manifests as checkboxListManifests } from './checkbox-list/manifests.js'; import { manifest as colorEditor } from './color-swatches-editor/manifests.js'; -import { manifests as colorPickerManifests } from './color-picker/manifests.js'; -import { manifests as datePickerManifests } from './date-picker/manifests.js'; -import { manifests as dropdownManifests } from './dropdown/manifests.js'; -import { manifests as eyeDropperManifests } from './eye-dropper/manifests.js'; import { manifest as iconPicker } from './icon-picker/manifests.js'; import { manifest as label } from './label/manifests.js'; -import { manifests as multipleTextStringManifests } from './multiple-text-string/manifests.js'; import { manifest as multiUrlPicker } from './multi-url-picker/manifests.js'; import { manifest as numberRange } from './number-range/manifests.js'; import { manifest as orderDirection } from './order-direction/manifests.js'; @@ -14,13 +8,19 @@ import { manifest as overlaySize } from './overlay-size/manifests.js'; import { manifest as radioButtonList } from './radio-button-list/manifests.js'; import { manifest as select } from './select/manifests.js'; import { manifest as slider } from './slider/manifests.js'; -import { manifest as textArea } from './textarea/manifests.js'; import { manifest as toggle } from './toggle/manifests.js'; import { manifest as uploadField } from './upload-field/manifests.js'; import { manifest as valueType } from './value-type/manifests.js'; +import { manifests as checkboxListManifests } from './checkbox-list/manifests.js'; import { manifests as collectionView } from './collection-view/manifests.js'; +import { manifests as colorPickerManifests } from './color-picker/manifests.js'; +import { manifests as datePickerManifests } from './date-picker/manifests.js'; +import { manifests as dropdownManifests } from './dropdown/manifests.js'; +import { manifests as eyeDropperManifests } from './eye-dropper/manifests.js'; +import { manifests as multipleTextStringManifests } from './multiple-text-string/manifests.js'; import { manifests as numbers } from './number/manifests.js'; -import { manifests as textBoxes } from './text-box/manifests.js'; +import { manifests as textareaManifests } from './textarea/manifests.js'; +import { manifests as textBoxManifests } from './text-box/manifests.js'; import { manifests as treePicker } from './tree-picker/manifests.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; @@ -33,7 +33,8 @@ export const manifests: Array = [ ...eyeDropperManifests, ...multipleTextStringManifests, ...numbers, - ...textBoxes, + ...textareaManifests, + ...textBoxManifests, ...treePicker, colorEditor, iconPicker, @@ -45,7 +46,6 @@ export const manifests: Array = [ radioButtonList, select, slider, - textArea, toggle, uploadField, valueType, diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.EmailAddress.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/text-box/Umbraco.EmailAddress.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.EmailAddress.ts rename to src/Umbraco.Web.UI.Client/src/packages/property-editors/text-box/Umbraco.EmailAddress.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.TextBox.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/text-box/Umbraco.TextBox.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.TextBox.ts rename to src/Umbraco.Web.UI.Client/src/packages/property-editors/text-box/Umbraco.TextBox.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/property-editors/text-box/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/text-box/manifests.ts index 4d0b531f32..bcfdc4786e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/property-editors/text-box/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/property-editors/text-box/manifests.ts @@ -1,4 +1,6 @@ -import type { ManifestPropertyEditorUi } from '@umbraco-cms/backoffice/extension-registry'; +import { manifest as textBoxSchemaManifest } from './Umbraco.TextBox.js'; +import { manifest as emailSchemaManifest } from './Umbraco.EmailAddress.js'; +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; // TODO: we don't really want this config value to be changed from the UI. We need a way to handle hidden config properties. const inputTypeConfig = { @@ -8,7 +10,7 @@ const inputTypeConfig = { propertyEditorUiAlias: 'Umb.PropertyEditorUi.Label', }; -export const manifests: Array = [ +export const manifests: Array = [ { type: 'propertyEditorUi', alias: 'Umb.PropertyEditorUi.TextBox', @@ -51,4 +53,6 @@ export const manifests: Array = [ }, }, }, + textBoxSchemaManifest, + emailSchemaManifest, ]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.TextArea.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/textarea/Umbraco.TextArea.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/core/property-editor/schemas/Umbraco.TextArea.ts rename to src/Umbraco.Web.UI.Client/src/packages/property-editors/textarea/Umbraco.TextArea.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/property-editors/textarea/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/textarea/manifests.ts index 25e5da053c..7673bd0a51 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/property-editors/textarea/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/property-editors/textarea/manifests.ts @@ -1,42 +1,46 @@ -import type { ManifestPropertyEditorUi } from '@umbraco-cms/backoffice/extension-registry'; +import { manifest as schemaManifest } from './Umbraco.TextArea.js'; +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const manifest: ManifestPropertyEditorUi = { - type: 'propertyEditorUi', - alias: 'Umb.PropertyEditorUi.TextArea', - name: 'Text Area Property Editor UI', - element: () => import('./property-editor-ui-textarea.element.js'), - meta: { - label: 'Text Area', - propertyEditorSchemaAlias: 'Umbraco.TextArea', - icon: 'icon-edit', - group: 'common', - settings: { - properties: [ - { - alias: 'rows', - label: 'Number of rows', - description: 'If empty or zero, the textarea is set to auto-height', - propertyEditorUiAlias: 'Umb.PropertyEditorUi.Number', - }, - { - alias: 'minHeight', - label: 'Min height (pixels)', - description: 'Sets the minimum height of the textarea', - propertyEditorUiAlias: 'Umb.PropertyEditorUi.Number', - }, - { - alias: 'maxHeight', - label: 'Max height (pixels)', - description: 'Sets the maximum height of the textarea', - propertyEditorUiAlias: 'Umb.PropertyEditorUi.Number', - }, - ], - defaultData: [ - { - alias: 'rows', - value: 10, - }, - ], +export const manifests: Array = [ + { + type: 'propertyEditorUi', + alias: 'Umb.PropertyEditorUi.TextArea', + name: 'Text Area Property Editor UI', + element: () => import('./property-editor-ui-textarea.element.js'), + meta: { + label: 'Text Area', + propertyEditorSchemaAlias: 'Umbraco.TextArea', + icon: 'icon-edit', + group: 'common', + settings: { + properties: [ + { + alias: 'rows', + label: 'Number of rows', + description: 'If empty or zero, the textarea is set to auto-height', + propertyEditorUiAlias: 'Umb.PropertyEditorUi.Number', + }, + { + alias: 'minHeight', + label: 'Min height (pixels)', + description: 'Sets the minimum height of the textarea', + propertyEditorUiAlias: 'Umb.PropertyEditorUi.Number', + }, + { + alias: 'maxHeight', + label: 'Max height (pixels)', + description: 'Sets the maximum height of the textarea', + propertyEditorUiAlias: 'Umb.PropertyEditorUi.Number', + }, + ], + defaultData: [ + { + alias: 'rows', + value: 10, + }, + ], + }, }, }, -}; + schemaManifest, +];