diff --git a/src/Umbraco.Core/Models/Blocks/BlockEditorModel.cs b/src/Umbraco.Core/Models/Blocks/BlockEditorModel.cs new file mode 100644 index 0000000000..7d00623ccf --- /dev/null +++ b/src/Umbraco.Core/Models/Blocks/BlockEditorModel.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using Umbraco.Core.Models.PublishedContent; + +namespace Umbraco.Core.Models.Blocks +{ + /// + /// The base class for any strongly typed model for a Block editor implementation + /// + public abstract class BlockEditorModel + { + /// + /// The data items of the Block List editor + /// + public IEnumerable Data { get; } + } +} diff --git a/src/Umbraco.Core/Models/Blocks/BlockListLayoutReference.cs b/src/Umbraco.Core/Models/Blocks/BlockListLayoutReference.cs new file mode 100644 index 0000000000..444bb7249f --- /dev/null +++ b/src/Umbraco.Core/Models/Blocks/BlockListLayoutReference.cs @@ -0,0 +1,20 @@ +using System; +using Umbraco.Core.Models.PublishedContent; + +namespace Umbraco.Core.Models.Blocks +{ + /// + /// Represents a layout item for the Block List editor + /// + public class BlockListLayoutReference : IBlockElement + { + public BlockListLayoutReference(Udi udi, IPublishedElement settings) + { + Udi = udi ?? throw new ArgumentNullException(nameof(udi)); + Settings = settings ?? throw new ArgumentNullException(nameof(settings)); + } + + public Udi Udi { get; } + public IPublishedElement Settings { get; } + } +} diff --git a/src/Umbraco.Core/Models/Blocks/BlockListModel.cs b/src/Umbraco.Core/Models/Blocks/BlockListModel.cs new file mode 100644 index 0000000000..5331ca3891 --- /dev/null +++ b/src/Umbraco.Core/Models/Blocks/BlockListModel.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; + +namespace Umbraco.Core.Models.Blocks +{ + /// + /// The strongly typed model for the Block List editor + /// + public class BlockListModel : BlockEditorModel + { + /// + /// The layout items of the Block List editor + /// + public IEnumerable Layout { get; } + + + } +} diff --git a/src/Umbraco.Core/Models/Blocks/IBlockElement.cs b/src/Umbraco.Core/Models/Blocks/IBlockElement.cs new file mode 100644 index 0000000000..eeb5a73e2c --- /dev/null +++ b/src/Umbraco.Core/Models/Blocks/IBlockElement.cs @@ -0,0 +1,18 @@ +namespace Umbraco.Core.Models.Blocks +{ + // TODO: IBlockElement doesn't make sense, this is a reference to an actual element with some settings + // and always has to do with the "Layout", should possibly be called IBlockReference or IBlockLayout or IBlockLayoutReference + + /// + /// Represents a data item for a Block editor implementation + /// + /// + /// + /// see: https://github.com/umbraco/rfcs/blob/907f3758cf59a7b6781296a60d57d537b3b60b8c/cms/0011-block-data-structure.md#strongly-typed + /// + public interface IBlockElement + { + Udi Udi { get; } + TSettings Settings { get; } + } +} diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index a8e3fc2988..8bf0b9105f 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -129,6 +129,10 @@ --> + + + +