diff --git a/debug.bat b/debug.bat index 7c879d9..c91ac6e 100644 --- a/debug.bat +++ b/debug.bat @@ -1,2 +1,2 @@ @echo off -dotnet build src/Limbo.Umbraco.BlockList --configuration Debug /t:rebuild /t:pack -p:PackageOutputPath=c:\nuget\Umbraco10 \ No newline at end of file +dotnet build src/Limbo.Umbraco.BlockList --configuration Debug /t:rebuild /t:pack -p:PackageOutputPath=c:\nuget\Umbraco13 \ No newline at end of file diff --git a/src/Limbo.Umbraco.BlockList/Limbo.Umbraco.BlockList.csproj b/src/Limbo.Umbraco.BlockList/Limbo.Umbraco.BlockList.csproj index 2576b71..67c0758 100644 --- a/src/Limbo.Umbraco.BlockList/Limbo.Umbraco.BlockList.csproj +++ b/src/Limbo.Umbraco.BlockList/Limbo.Umbraco.BlockList.csproj @@ -3,20 +3,19 @@ - 10.0 - net6.0 + net8 App_Plugins/$(AssemblyName) enable - 3.0.6 + 13.0.0-alpha000 build$([System.DateTime]::UtcNow.ToString(`yyyyMMddHHmm`)) Limbo Anders Bjerner Copyright © $([System.DateTime]::UtcNow.ToString(`yyyy`)) Limbo Block List - Extended block list editor for Umbraco 10+. + Extended block list editor for Umbraco 13. @@ -24,7 +23,7 @@ Limbo.Umbraco.BlockList Skybrud, Limbo, Umbraco, Block, List, Umbraco-Marketplace MIT - https://packages.limbo.works/limbo.umbraco.blocklist/v3/ + https://packages.limbo.works/limbo.umbraco.blocklist/v13/ Limbo.png NUGET.md git @@ -34,9 +33,9 @@ - - - + + + diff --git a/src/Limbo.Umbraco.BlockList/Manifests/BlockListManifestFilter.cs b/src/Limbo.Umbraco.BlockList/Manifests/BlockListManifestFilter.cs index fad01ff..dd3f63d 100644 --- a/src/Limbo.Umbraco.BlockList/Manifests/BlockListManifestFilter.cs +++ b/src/Limbo.Umbraco.BlockList/Manifests/BlockListManifestFilter.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Reflection; using Umbraco.Cms.Core.Manifest; namespace Limbo.Umbraco.BlockList.Manifests; @@ -13,6 +12,7 @@ public void Filter(List manifests) { // Initialize a new manifest filter for this package PackageManifest manifest = new() { AllowPackageTelemetry = true, + PackageId = BlockListPackage.Alias, PackageName = BlockListPackage.Name, Version = BlockListPackage.InformationalVersion, BundleOptions = BundleOptions.Independent, @@ -24,16 +24,6 @@ public void Filter(List manifests) { Stylesheets = new[] { $"/App_Plugins/{BlockListPackage.Alias}/Styles.css" } }; - // The "PackageId" property isn't available prior to Umbraco 12, and since the package is build against - // Umbraco 10, we need to use reflection for setting the property value for Umbraco 12+. Ideally this - // shouldn't fail, but we might at least add a try/catch to be sure - try { - PropertyInfo? property = manifest.GetType().GetProperty("PackageId"); - property?.SetValue(manifest, BlockListPackage.Alias); - } catch { - // We don't really care about the exception - } - // Append the manifest manifests.Add(manifest); diff --git a/src/Limbo.Umbraco.BlockList/PropertyEditors/LimboBlockListPropertyEditor.cs b/src/Limbo.Umbraco.BlockList/PropertyEditors/LimboBlockListPropertyEditor.cs index c4313c3..99328f2 100644 --- a/src/Limbo.Umbraco.BlockList/PropertyEditors/LimboBlockListPropertyEditor.cs +++ b/src/Limbo.Umbraco.BlockList/PropertyEditors/LimboBlockListPropertyEditor.cs @@ -10,7 +10,7 @@ namespace Limbo.Umbraco.BlockList.PropertyEditors; /// Represents a block list property editor. /// [DataEditor(EditorAlias, EditorName, EditorView, ValueType = ValueTypes.Json, Group = "Limbo", Icon = EditorIcon)] -public class LimboBlockListPropertyEditor : BlockEditorPropertyEditor { +public class LimboBlockListPropertyEditor : BlockListPropertyEditorBase { private readonly IIOHelper _ioHelper; private readonly IEditorConfigurationParser _editorConfigurationParser; @@ -29,7 +29,7 @@ public class LimboBlockListPropertyEditor : BlockEditorPropertyEditor { #region Constructors - public LimboBlockListPropertyEditor(IDataValueEditorFactory dataValueEditorFactory, PropertyEditorCollection propertyEditors, IIOHelper ioHelper, IEditorConfigurationParser editorConfigurationParser) : base(dataValueEditorFactory, propertyEditors) { + public LimboBlockListPropertyEditor(IDataValueEditorFactory dataValueEditorFactory, IBlockValuePropertyIndexValueFactory blockValuePropertyIndexValueFactory, IIOHelper ioHelper, IEditorConfigurationParser editorConfigurationParser) : base(dataValueEditorFactory, blockValuePropertyIndexValueFactory) { _ioHelper = ioHelper; _editorConfigurationParser = editorConfigurationParser; } diff --git a/src/Limbo.Umbraco.BlockList/PropertyEditors/LimboBlockListPropertyValueConverter.cs b/src/Limbo.Umbraco.BlockList/PropertyEditors/LimboBlockListPropertyValueConverter.cs index 6f12851..b340b2e 100644 --- a/src/Limbo.Umbraco.BlockList/PropertyEditors/LimboBlockListPropertyValueConverter.cs +++ b/src/Limbo.Umbraco.BlockList/PropertyEditors/LimboBlockListPropertyValueConverter.cs @@ -1,11 +1,13 @@ using Limbo.Umbraco.BlockList.Converters; using System; using System.Diagnostics.CodeAnalysis; +using Umbraco.Cms.Core.DeliveryApi; using Umbraco.Cms.Core.Logging; using Umbraco.Cms.Core.Models.Blocks; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.PropertyEditors.ValueConverters; +using Umbraco.Cms.Core.Services; using Umbraco.Extensions; #pragma warning disable 1591 @@ -19,7 +21,10 @@ public class LimboBlockListPropertyValueConverter : BlockListPropertyValueConver #region Constructors public LimboBlockListPropertyValueConverter(IProfilingLogger proflog, BlockEditorConverter blockConverter, - BlockListTypeConverterCollection converterCollection) : base(proflog, blockConverter) { + BlockListTypeConverterCollection converterCollection, + IContentTypeService contentTypeService, IApiElementBuilder apiElementBuilder, BlockListPropertyValueConstructorCache constructorCache) + : base(proflog, blockConverter, contentTypeService, apiElementBuilder, constructorCache) + { _converterCollection = converterCollection; }