Skip to content

Commit

Permalink
Merge pull request #34 from ProWorksCorporation/feature/update-to-v13…
Browse files Browse the repository at this point in the history
…-debug-blocks

Feature/update to v13 debug blocks
  • Loading branch information
protherj authored Apr 2, 2024
2 parents 3060cf2 + 8be381d commit b46c532
Show file tree
Hide file tree
Showing 27 changed files with 513 additions and 44 deletions.
12 changes: 6 additions & 6 deletions src/TinyMCE.Umbraco.Premium.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33829.357
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TinyMCE.Umbraco.Premium", "TinyMCE.Umbraco.Premium\TinyMCE.Umbraco.Premium.csproj", "{1A802507-42E9-4EBA-90B1-31BBE31E6943}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Cms.Demo", "Umbraco.Cms.Demo\Umbraco.Cms.Demo.csproj", "{B691DAD4-0160-4E52-B632-31E1316FAFB9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TinyMCE.Umbraco.Premium", "TinyMCE.Umbraco.Premium\TinyMCE.Umbraco.Premium.csproj", "{21281601-1EA1-4DC3-86E3-37E572957011}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1A802507-42E9-4EBA-90B1-31BBE31E6943}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A802507-42E9-4EBA-90B1-31BBE31E6943}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A802507-42E9-4EBA-90B1-31BBE31E6943}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A802507-42E9-4EBA-90B1-31BBE31E6943}.Release|Any CPU.Build.0 = Release|Any CPU
{B691DAD4-0160-4E52-B632-31E1316FAFB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B691DAD4-0160-4E52-B632-31E1316FAFB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B691DAD4-0160-4E52-B632-31E1316FAFB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B691DAD4-0160-4E52-B632-31E1316FAFB9}.Release|Any CPU.Build.0 = Release|Any CPU
{21281601-1EA1-4DC3-86E3-37E572957011}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21281601-1EA1-4DC3-86E3-37E572957011}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21281601-1EA1-4DC3-86E3-37E572957011}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21281601-1EA1-4DC3-86E3-37E572957011}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions src/TinyMCE.Umbraco.Premium/Composers/TinyMceComposer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Dynamic;
using System.Text.Json;
using System.Text.Json.Nodes;
using TinyMCE.UmbracoCms.Premium.Options;
using TinyMCE.Umbraco.Premium.Options;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
Expand All @@ -19,7 +19,7 @@
using Umbraco.Cms.Core.Notifications;
using static Umbraco.Cms.Core.Constants;

namespace TinyMCE.UmbracoCms.Premium.Composers
namespace TinyMCE.Umbraco.Premium.Composers
{
internal class TinyMceComposer : IComposer
{
Expand Down
2 changes: 1 addition & 1 deletion src/TinyMCE.Umbraco.Premium/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


namespace TinyMCE.UmbracoCms.Premium
namespace TinyMCE.Umbraco.Premium
{
public static partial class Constants
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Umbraco.Cms.Infrastructure.Migrations;
using Umbraco.Cms.Infrastructure.Packaging;

namespace TinyMCE.UmbracoCms.Premium.Migrations
namespace TinyMCE.Umbraco.Premium.Migrations
{
public class TinyMceMigrationPlan : PackageMigrationPlan
{
Expand Down
2 changes: 1 addition & 1 deletion src/TinyMCE.Umbraco.Premium/Options/TinyMceConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading.Tasks;
using System.Text.Json;

namespace TinyMCE.UmbracoCms.Premium.Options
namespace TinyMCE.Umbraco.Premium.Options
{
public class TinyMceConfig
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Umbraco.Cms.Core.PropertyEditors;


namespace TinyMCE.UmbracoCms.Premium.PropertyEditors;
namespace TinyMCE.Umbraco.Premium.PropertyEditors;

internal abstract class TinyBlockEditorValidatorBase : ComplexEditorValidator
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;

namespace TinyMCE.UmbracoCms.Premium.PropertyEditors;
namespace TinyMCE.Umbraco.Premium.PropertyEditors;

/// <summary>
/// Used to deserialize json values and clean up any values based on the existence of element types and layout structure
/// </summary>
internal class TinyBlockEditorValues
{
private readonly BlockEditorDataConverter _dataConverter;
private readonly TinyRichTextEditorBlockDataConverter _dataConverter;
private readonly IContentTypeService _contentTypeService;
private readonly ILogger _logger;

public TinyBlockEditorValues(BlockEditorDataConverter dataConverter, IContentTypeService contentTypeService, ILogger logger)
public TinyBlockEditorValues(TinyRichTextEditorBlockDataConverter dataConverter, IContentTypeService contentTypeService, ILogger logger)
{
_dataConverter = dataConverter;
_contentTypeService = contentTypeService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;

namespace TinyMCE.UmbracoCms.Premium.PropertyEditors
namespace TinyMCE.Umbraco.Premium.PropertyEditors
{
internal abstract class TinyBlockValuePropertyValueEditorBase : DataValueEditor, IDataValueReference, IDataValueTags
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using static Umbraco.Cms.Core.PropertyEditors.RichTextConfiguration;
using Umbraco.Cms.Core.PropertyEditors;

namespace Umbraco.Cms.Core.PropertyEditors;
namespace TinyMCE.Umbraco.Premium.PropertyEditors;

/// <summary>
/// Represents the configuration for the rich text value editor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.PropertyEditors;

namespace Umbraco.Cms.Core.PropertyEditors;
namespace TinyMCE.Umbraco.Premium.PropertyEditors;

/// <summary>
/// Represents the configuration editor for the rich text value editor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using Umbraco.Cms.Infrastructure.Templates;
using Umbraco.Extensions;

namespace TinyMCE.UmbracoCms.Premium.PropertyEditors
namespace TinyMCE.Umbraco.Premium.PropertyEditors
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Newtonsoft.Json.Linq;
using Umbraco.Cms.Core.Models.Blocks;
using Umbraco.Cms.Core.Models.PublishedContent;

namespace TinyMCE.UmbracoCms.Premium.PropertyEditors;
namespace TinyMCE.Umbraco.Premium.PropertyEditors;

/// <summary>
/// Data converter for blocks in the richtext property editor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Microsoft.Extensions.Logging;
using TinyMCE.UmbracoCms.Premium.PropertyEditors;
using TinyMCE.Umbraco.Premium.PropertyEditors;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models.Blocks;
using Umbraco.Cms.Core.Serialization;
Expand All @@ -8,7 +8,7 @@

using static Umbraco.Cms.Core.PropertyEditors.ComplexEditorValidator;

namespace TinyMCE.UmbracoCms.Premium.PropertyEditors;
namespace TinyMCE.Umbraco.Premium.PropertyEditors;

internal class TinyRichTextEditorBlockValidator : TinyBlockEditorValidatorBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Core;

namespace TinyMCE.UmbracoCms.Premium.PropertyEditors;
namespace TinyMCE.Umbraco.Premium.PropertyEditors;

public sealed class TinyRichTextEditorPastedImages
{
Expand Down Expand Up @@ -96,7 +96,7 @@ public TinyRichTextEditorPastedImages(
_imageUrlGenerator = imageUrlGenerator;
_contentSettings = contentSettings.Value;

_tempFolderAbsolutePath = _hostingEnvironment.MapPathContentRoot(Umbraco.Cms.Core.Constants.SystemDirectories.TempImageUploads);
_tempFolderAbsolutePath = _hostingEnvironment.MapPathContentRoot(global::Umbraco.Cms.Core.Constants.SystemDirectories.TempImageUploads);
}

/// <summary>
Expand Down Expand Up @@ -167,7 +167,7 @@ internal string FindAndPersistEmbeddedImages(string html, Guid mediaParentFolder

// Create an unique folder path to help with concurrent users to avoid filename clash
var imageTempPath =
_hostingEnvironment.MapPathContentRoot(Umbraco.Cms.Core.Constants.SystemDirectories.TempImageUploads + Path.DirectorySeparatorChar + Guid.NewGuid());
_hostingEnvironment.MapPathContentRoot(global::Umbraco.Cms.Core.Constants.SystemDirectories.TempImageUploads + Path.DirectorySeparatorChar + Guid.NewGuid());

// Ensure image temp path exists
if (Directory.Exists(imageTempPath) is false)
Expand Down Expand Up @@ -268,11 +268,11 @@ private void PersistMediaItem(Guid mediaParentFolder, int userId, HtmlNode img,
{
var isSvg = qualifiedTmpImgPath.EndsWith(".svg");
var mediaType = isSvg
? Umbraco.Cms.Core.Constants.Conventions.MediaTypes.VectorGraphicsAlias
: Umbraco.Cms.Core.Constants.Conventions.MediaTypes.Image;
? global::Umbraco.Cms.Core.Constants.Conventions.MediaTypes.VectorGraphicsAlias
: global::Umbraco.Cms.Core.Constants.Conventions.MediaTypes.Image;

IMedia mediaFile = mediaParentFolder == Guid.Empty
? _mediaService.CreateMedia(mediaItemName, Umbraco.Cms.Core.Constants.System.Root, mediaType, userId)
? _mediaService.CreateMedia(mediaItemName, global::Umbraco.Cms.Core.Constants.System.Root, mediaType, userId)
: _mediaService.CreateMedia(mediaItemName, mediaParentFolder, mediaType, userId);

var fileInfo = new FileInfo(absoluteTempImagePath);
Expand All @@ -286,7 +286,7 @@ private void PersistMediaItem(Guid mediaParentFolder, int userId, HtmlNode img,
using (fileStream)
{
mediaFile.SetValue(_mediaFileManager, _mediaUrlGenerators, _shortStringHelper,
_contentTypeBaseServiceProvider, Umbraco.Cms.Core.Constants.Conventions.Media.File, safeFileName, fileStream);
_contentTypeBaseServiceProvider, global::Umbraco.Cms.Core.Constants.Conventions.Media.File, safeFileName, fileStream);
}

_mediaService.Save(mediaFile, userId);
Expand Down
Loading

0 comments on commit b46c532

Please sign in to comment.