From 87799264e193b9be380f034a455d04a174b08331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 16:10:12 +0100 Subject: [PATCH 01/26] Moving module to subfolder, and moving test project up into the root, following what we do in other projects too --- .../Lombiq.TrainingDemo.Tests.csproj | 2 +- .../Readme.md | 0 .../Services/TestedServiceTests.cs | 0 .../create-jira-issues-for-community-activities.yml | 0 .../.github}/workflows/validate-pull-request.yml | 0 .../ManagePersonsPermissionCheckerTask.cs | 0 .../Assets}/Images/HarryPotter.jpg | Bin .../Assets}/Styles/trainingdemo-colorpicker.scss | 0 .../Assets}/Styles/trainingdemo-filtered.scss | 0 .../ContentTypes.cs | 0 .../Controllers}/AdminController.cs | 0 .../Controllers}/ApiController.cs | 0 .../Controllers}/AuthorizationController.cs | 0 .../Controllers}/CacheController.cs | 0 .../Controllers}/CrossTenantServicesController.cs | 0 .../Controllers}/DatabaseStorageController.cs | 0 .../Controllers}/DisplayManagementController.cs | 0 .../Controllers}/FileManagementController.cs | 0 .../Controllers}/PersonListController.cs | 0 .../Controllers}/SiteSettingsController.cs | 0 .../Controllers}/YourFirstOrchardCoreController.cs | 0 .../Drivers}/BookDisplayDriver.cs | 0 .../Drivers}/ColorFieldDisplayDriver.cs | 0 .../Drivers}/DemoSettingsDisplayDriver.cs | 0 ...nagePersonsPermissionCheckerTaskDisplayDriver.cs | 0 .../Drivers}/PersonPartDisplayDriver.cs | 0 .../Events}/LoginGreeting.cs | 0 .../Fields}/ColorField.cs | 0 .../Filters}/ResourceFromShapeInjectingFilter.cs | 0 .../Filters}/ResourceInjectionFilter.cs | 0 .../Filters}/ShapeInjectionFilter.cs | 0 .../Models/HandednessEnumerationGraphType.cs | 0 .../GraphQL}/Services/ContentItemTypeBuilder.cs | 0 .../GraphQL}/Services/PersonAgeGraphQLFilter.cs | 0 .../Services/PersonPartIndexAliasProvider.cs | 0 .../GraphQL}/Services/PersonPartObjectGraphType.cs | 0 .../Services/PersonPartWhereInputObjectGraphType.cs | 0 {GraphQL => Lombiq.TrainingDemo/GraphQL}/Startup.cs | 0 .../Handlers}/PersonPartHandler.cs | 0 .../Indexes}/BookIndex.cs | 0 .../Indexes}/PersonPartIndex.cs | 0 .../Indexing}/ColorFieldIndexHandler.cs | 0 .../Liquid}/ShortDateFilter.cs | 0 .../Lombiq.TrainingDemo.csproj | 10 +++++----- Manifest.cs => Lombiq.TrainingDemo/Manifest.cs | 0 Map.cs => Lombiq.TrainingDemo/Map.cs | 0 .../Middlewares}/RequestLoggingMiddleware.cs | 0 .../Migrations}/BookMigrations.cs | 0 .../Migrations}/PersonMigrations.cs | 0 {Models => Lombiq.TrainingDemo/Models}/Book.cs | 0 .../Models}/DemoSettings.cs | 0 .../Models}/PersonPart.cs | 0 .../Navigation}/DemoSettingsAdminMenu.cs | 0 .../Navigation}/PersonsAdminMenu.cs | 0 .../Navigation}/TrainingDemoNavigationProvider.cs | 0 .../Permissions}/DemoSettingsPermissions.cs | 0 .../Permissions}/PersonPermissions.cs | 0 .../TrainingDemo.Content.Sample.Person.recipe.json | 0 .../TrainingDemo.Workflows.Sample.recipe.json | 0 .../Recipes}/TrainingDemo.recipe.json | 0 .../ResourceManagementOptionsConfiguration.cs | 0 .../Services}/CustomFileStore.cs | 0 .../Services}/DateTimeCachingService.cs | 0 .../Services}/DemoBackgroundTask.cs | 0 .../Services}/DemoSettingsConfiguration.cs | 0 .../Services}/IDateTimeCachingService.cs | 0 .../Services}/ShapeHidingShapeTableProvider.cs | 0 .../Services}/TestedService.cs | 0 .../Settings}/ColorFieldSettings.cs | 0 .../Settings}/ColorFieldSettingsDriver.cs | 0 .../StartLearningHere.md | 0 Startup.cs => Lombiq.TrainingDemo/Startup.cs | 0 .../ViewModels}/CacheViewModel.cs | 0 .../ViewModels}/DemoSettingsViewModel.cs | 0 .../ViewModels}/DisplayColorFieldViewModel.cs | 0 .../ViewModels}/EditColorFieldViewModel.cs | 0 .../ManagePersonsPermissionCheckerTaskViewModel.cs | 0 .../ViewModels}/PersonPartViewModel.cs | 0 .../StaticallyTypedDerivedTestShapeViewModel.cs | 0 .../StaticallyTypedTestShapeViewModel.cs | 0 .../Views}/Admin/Index.cshtml | 0 .../Views}/Admin/PersonList.cshtml | 0 .../Views}/AlertScriptShape.cshtml | 0 .../Views}/Book.Description.cshtml | 0 {Views => Lombiq.TrainingDemo/Views}/Book.cshtml | 0 .../Views}/Cache/Index.cshtml | 0 .../Views}/Cache/Shape.cshtml | 0 .../Views}/CachedShape.cshtml | 0 .../Views}/ColorField-ColorPicker.Edit.cshtml | 0 .../Views}/ColorField-ColorPicker.Option.cshtml | 0 .../Views}/ColorField.Edit.cshtml | 0 .../Views}/ColorField.Option.cshtml | 0 .../Views}/ColorField.cshtml | 0 .../Views}/ColorFieldSettings.Edit.cshtml | 0 .../Views}/ComplexTestShape.cshtml | 0 .../Views}/DatabaseStorage/CreateBooks.cshtml | 0 .../Views}/DatabaseStorage/JKRosenzweigBooks.cshtml | 0 .../Views}/DemoSettings.Edit.cshtml | 0 .../Views}/DisplayManagement/AdHocShape.cshtml | 0 .../Views}/DisplayManagement/DisplayBook.cshtml | 0 .../DisplayManagement/DisplayBookDescription.cshtml | 0 .../Views}/FileManagement/UploadFileToMedia.cshtml | 0 .../Views}/InjectedShape.cshtml | 0 .../Views}/Items/Book.Display.Author.cshtml | 0 .../Views}/Items/Book.Display.Cover.cshtml | 0 .../Views}/Items/Book.Display.Description.cshtml | 0 .../Views}/Items/Book.Display.Title.cshtml | 0 ...ersonsPermissionCheckerTask.Fields.Design.cshtml | 0 ...ePersonsPermissionCheckerTask.Fields.Edit.cshtml | 0 ...onsPermissionCheckerTask.Fields.Thumbnail.cshtml | 0 .../Views}/NavigationItemText-persons.Id.cshtml | 0 .../Views}/PersonList/OlderThan30.cshtml | 0 .../Views}/PersonPart.Edit.cshtml | 0 .../Views}/PersonPart.Summary.cshtml | 0 .../Views}/PersonPart.SummaryAdmin.cshtml | 0 .../Views}/PersonPart.cshtml | 0 .../Views}/PersonPart.liquid | 0 .../Views}/StaticallyTypedDerivedTestShape.cshtml | 0 .../Views}/StaticallyTypedTestShape.cshtml | 0 .../Views}/TestShape.cshtml | 0 .../Views}/YourFirstOrchardCore/Index.cshtml | 0 .../Views}/YourFirstOrchardCore/NotifyMe.cshtml | 0 .../Views}/_ViewImports.cshtml | 0 .../package-lock.json | 0 package.json => Lombiq.TrainingDemo/package.json | 0 .../placement.json | 0 .../pnpm-lock.yaml | 0 Readme.md | 8 ++++---- 128 files changed, 10 insertions(+), 10 deletions(-) rename {Tests/Lombiq.TrainingDemo.Tests => Lombiq.TrainingDemo.Tests}/Lombiq.TrainingDemo.Tests.csproj (91%) rename {Tests/Lombiq.TrainingDemo.Tests => Lombiq.TrainingDemo.Tests}/Readme.md (100%) rename {Tests/Lombiq.TrainingDemo.Tests => Lombiq.TrainingDemo.Tests}/Services/TestedServiceTests.cs (100%) rename {.github => Lombiq.TrainingDemo/.github}/workflows/create-jira-issues-for-community-activities.yml (100%) rename {.github => Lombiq.TrainingDemo/.github}/workflows/validate-pull-request.yml (100%) rename {Activities => Lombiq.TrainingDemo/Activities}/ManagePersonsPermissionCheckerTask.cs (100%) rename {Assets => Lombiq.TrainingDemo/Assets}/Images/HarryPotter.jpg (100%) rename {Assets => Lombiq.TrainingDemo/Assets}/Styles/trainingdemo-colorpicker.scss (100%) rename {Assets => Lombiq.TrainingDemo/Assets}/Styles/trainingdemo-filtered.scss (100%) rename ContentTypes.cs => Lombiq.TrainingDemo/ContentTypes.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/AdminController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/ApiController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/AuthorizationController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/CacheController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/CrossTenantServicesController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/DatabaseStorageController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/DisplayManagementController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/FileManagementController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/PersonListController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/SiteSettingsController.cs (100%) rename {Controllers => Lombiq.TrainingDemo/Controllers}/YourFirstOrchardCoreController.cs (100%) rename {Drivers => Lombiq.TrainingDemo/Drivers}/BookDisplayDriver.cs (100%) rename {Drivers => Lombiq.TrainingDemo/Drivers}/ColorFieldDisplayDriver.cs (100%) rename {Drivers => Lombiq.TrainingDemo/Drivers}/DemoSettingsDisplayDriver.cs (100%) rename {Drivers => Lombiq.TrainingDemo/Drivers}/ManagePersonsPermissionCheckerTaskDisplayDriver.cs (100%) rename {Drivers => Lombiq.TrainingDemo/Drivers}/PersonPartDisplayDriver.cs (100%) rename {Events => Lombiq.TrainingDemo/Events}/LoginGreeting.cs (100%) rename {Fields => Lombiq.TrainingDemo/Fields}/ColorField.cs (100%) rename {Filters => Lombiq.TrainingDemo/Filters}/ResourceFromShapeInjectingFilter.cs (100%) rename {Filters => Lombiq.TrainingDemo/Filters}/ResourceInjectionFilter.cs (100%) rename {Filters => Lombiq.TrainingDemo/Filters}/ShapeInjectionFilter.cs (100%) rename {GraphQL => Lombiq.TrainingDemo/GraphQL}/Models/HandednessEnumerationGraphType.cs (100%) rename {GraphQL => Lombiq.TrainingDemo/GraphQL}/Services/ContentItemTypeBuilder.cs (100%) rename {GraphQL => Lombiq.TrainingDemo/GraphQL}/Services/PersonAgeGraphQLFilter.cs (100%) rename {GraphQL => Lombiq.TrainingDemo/GraphQL}/Services/PersonPartIndexAliasProvider.cs (100%) rename {GraphQL => Lombiq.TrainingDemo/GraphQL}/Services/PersonPartObjectGraphType.cs (100%) rename {GraphQL => Lombiq.TrainingDemo/GraphQL}/Services/PersonPartWhereInputObjectGraphType.cs (100%) rename {GraphQL => Lombiq.TrainingDemo/GraphQL}/Startup.cs (100%) rename {Handlers => Lombiq.TrainingDemo/Handlers}/PersonPartHandler.cs (100%) rename {Indexes => Lombiq.TrainingDemo/Indexes}/BookIndex.cs (100%) rename {Indexes => Lombiq.TrainingDemo/Indexes}/PersonPartIndex.cs (100%) rename {Indexing => Lombiq.TrainingDemo/Indexing}/ColorFieldIndexHandler.cs (100%) rename {Liquid => Lombiq.TrainingDemo/Liquid}/ShortDateFilter.cs (100%) rename Lombiq.TrainingDemo.csproj => Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj (82%) rename Manifest.cs => Lombiq.TrainingDemo/Manifest.cs (100%) rename Map.cs => Lombiq.TrainingDemo/Map.cs (100%) rename {Middlewares => Lombiq.TrainingDemo/Middlewares}/RequestLoggingMiddleware.cs (100%) rename {Migrations => Lombiq.TrainingDemo/Migrations}/BookMigrations.cs (100%) rename {Migrations => Lombiq.TrainingDemo/Migrations}/PersonMigrations.cs (100%) rename {Models => Lombiq.TrainingDemo/Models}/Book.cs (100%) rename {Models => Lombiq.TrainingDemo/Models}/DemoSettings.cs (100%) rename {Models => Lombiq.TrainingDemo/Models}/PersonPart.cs (100%) rename {Navigation => Lombiq.TrainingDemo/Navigation}/DemoSettingsAdminMenu.cs (100%) rename {Navigation => Lombiq.TrainingDemo/Navigation}/PersonsAdminMenu.cs (100%) rename {Navigation => Lombiq.TrainingDemo/Navigation}/TrainingDemoNavigationProvider.cs (100%) rename {Permissions => Lombiq.TrainingDemo/Permissions}/DemoSettingsPermissions.cs (100%) rename {Permissions => Lombiq.TrainingDemo/Permissions}/PersonPermissions.cs (100%) rename {Recipes => Lombiq.TrainingDemo/Recipes}/TrainingDemo.Content.Sample.Person.recipe.json (100%) rename {Recipes => Lombiq.TrainingDemo/Recipes}/TrainingDemo.Workflows.Sample.recipe.json (100%) rename {Recipes => Lombiq.TrainingDemo/Recipes}/TrainingDemo.recipe.json (100%) rename ResourceManagementOptionsConfiguration.cs => Lombiq.TrainingDemo/ResourceManagementOptionsConfiguration.cs (100%) rename {Services => Lombiq.TrainingDemo/Services}/CustomFileStore.cs (100%) rename {Services => Lombiq.TrainingDemo/Services}/DateTimeCachingService.cs (100%) rename {Services => Lombiq.TrainingDemo/Services}/DemoBackgroundTask.cs (100%) rename {Services => Lombiq.TrainingDemo/Services}/DemoSettingsConfiguration.cs (100%) rename {Services => Lombiq.TrainingDemo/Services}/IDateTimeCachingService.cs (100%) rename {Services => Lombiq.TrainingDemo/Services}/ShapeHidingShapeTableProvider.cs (100%) rename {Services => Lombiq.TrainingDemo/Services}/TestedService.cs (100%) rename {Settings => Lombiq.TrainingDemo/Settings}/ColorFieldSettings.cs (100%) rename {Settings => Lombiq.TrainingDemo/Settings}/ColorFieldSettingsDriver.cs (100%) rename StartLearningHere.md => Lombiq.TrainingDemo/StartLearningHere.md (100%) rename Startup.cs => Lombiq.TrainingDemo/Startup.cs (100%) rename {ViewModels => Lombiq.TrainingDemo/ViewModels}/CacheViewModel.cs (100%) rename {ViewModels => Lombiq.TrainingDemo/ViewModels}/DemoSettingsViewModel.cs (100%) rename {ViewModels => Lombiq.TrainingDemo/ViewModels}/DisplayColorFieldViewModel.cs (100%) rename {ViewModels => Lombiq.TrainingDemo/ViewModels}/EditColorFieldViewModel.cs (100%) rename {ViewModels => Lombiq.TrainingDemo/ViewModels}/ManagePersonsPermissionCheckerTaskViewModel.cs (100%) rename {ViewModels => Lombiq.TrainingDemo/ViewModels}/PersonPartViewModel.cs (100%) rename {ViewModels => Lombiq.TrainingDemo/ViewModels}/StaticallyTypedDerivedTestShapeViewModel.cs (100%) rename {ViewModels => Lombiq.TrainingDemo/ViewModels}/StaticallyTypedTestShapeViewModel.cs (100%) rename {Views => Lombiq.TrainingDemo/Views}/Admin/Index.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Admin/PersonList.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/AlertScriptShape.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Book.Description.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Book.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Cache/Index.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Cache/Shape.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/CachedShape.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/ColorField-ColorPicker.Edit.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/ColorField-ColorPicker.Option.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/ColorField.Edit.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/ColorField.Option.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/ColorField.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/ColorFieldSettings.Edit.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/ComplexTestShape.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/DatabaseStorage/CreateBooks.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/DatabaseStorage/JKRosenzweigBooks.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/DemoSettings.Edit.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/DisplayManagement/AdHocShape.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/DisplayManagement/DisplayBook.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/DisplayManagement/DisplayBookDescription.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/FileManagement/UploadFileToMedia.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/InjectedShape.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Items/Book.Display.Author.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Items/Book.Display.Cover.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Items/Book.Display.Description.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Items/Book.Display.Title.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Items/ManagePersonsPermissionCheckerTask.Fields.Design.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Items/ManagePersonsPermissionCheckerTask.Fields.Edit.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/Items/ManagePersonsPermissionCheckerTask.Fields.Thumbnail.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/NavigationItemText-persons.Id.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/PersonList/OlderThan30.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/PersonPart.Edit.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/PersonPart.Summary.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/PersonPart.SummaryAdmin.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/PersonPart.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/PersonPart.liquid (100%) rename {Views => Lombiq.TrainingDemo/Views}/StaticallyTypedDerivedTestShape.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/StaticallyTypedTestShape.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/TestShape.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/YourFirstOrchardCore/Index.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/YourFirstOrchardCore/NotifyMe.cshtml (100%) rename {Views => Lombiq.TrainingDemo/Views}/_ViewImports.cshtml (100%) rename package-lock.json => Lombiq.TrainingDemo/package-lock.json (100%) rename package.json => Lombiq.TrainingDemo/package.json (100%) rename placement.json => Lombiq.TrainingDemo/placement.json (100%) rename pnpm-lock.yaml => Lombiq.TrainingDemo/pnpm-lock.yaml (100%) diff --git a/Tests/Lombiq.TrainingDemo.Tests/Lombiq.TrainingDemo.Tests.csproj b/Lombiq.TrainingDemo.Tests/Lombiq.TrainingDemo.Tests.csproj similarity index 91% rename from Tests/Lombiq.TrainingDemo.Tests/Lombiq.TrainingDemo.Tests.csproj rename to Lombiq.TrainingDemo.Tests/Lombiq.TrainingDemo.Tests.csproj index b0c5696a..946d66d6 100644 --- a/Tests/Lombiq.TrainingDemo.Tests/Lombiq.TrainingDemo.Tests.csproj +++ b/Lombiq.TrainingDemo.Tests/Lombiq.TrainingDemo.Tests.csproj @@ -27,7 +27,7 @@ - + diff --git a/Tests/Lombiq.TrainingDemo.Tests/Readme.md b/Lombiq.TrainingDemo.Tests/Readme.md similarity index 100% rename from Tests/Lombiq.TrainingDemo.Tests/Readme.md rename to Lombiq.TrainingDemo.Tests/Readme.md diff --git a/Tests/Lombiq.TrainingDemo.Tests/Services/TestedServiceTests.cs b/Lombiq.TrainingDemo.Tests/Services/TestedServiceTests.cs similarity index 100% rename from Tests/Lombiq.TrainingDemo.Tests/Services/TestedServiceTests.cs rename to Lombiq.TrainingDemo.Tests/Services/TestedServiceTests.cs diff --git a/.github/workflows/create-jira-issues-for-community-activities.yml b/Lombiq.TrainingDemo/.github/workflows/create-jira-issues-for-community-activities.yml similarity index 100% rename from .github/workflows/create-jira-issues-for-community-activities.yml rename to Lombiq.TrainingDemo/.github/workflows/create-jira-issues-for-community-activities.yml diff --git a/.github/workflows/validate-pull-request.yml b/Lombiq.TrainingDemo/.github/workflows/validate-pull-request.yml similarity index 100% rename from .github/workflows/validate-pull-request.yml rename to Lombiq.TrainingDemo/.github/workflows/validate-pull-request.yml diff --git a/Activities/ManagePersonsPermissionCheckerTask.cs b/Lombiq.TrainingDemo/Activities/ManagePersonsPermissionCheckerTask.cs similarity index 100% rename from Activities/ManagePersonsPermissionCheckerTask.cs rename to Lombiq.TrainingDemo/Activities/ManagePersonsPermissionCheckerTask.cs diff --git a/Assets/Images/HarryPotter.jpg b/Lombiq.TrainingDemo/Assets/Images/HarryPotter.jpg similarity index 100% rename from Assets/Images/HarryPotter.jpg rename to Lombiq.TrainingDemo/Assets/Images/HarryPotter.jpg diff --git a/Assets/Styles/trainingdemo-colorpicker.scss b/Lombiq.TrainingDemo/Assets/Styles/trainingdemo-colorpicker.scss similarity index 100% rename from Assets/Styles/trainingdemo-colorpicker.scss rename to Lombiq.TrainingDemo/Assets/Styles/trainingdemo-colorpicker.scss diff --git a/Assets/Styles/trainingdemo-filtered.scss b/Lombiq.TrainingDemo/Assets/Styles/trainingdemo-filtered.scss similarity index 100% rename from Assets/Styles/trainingdemo-filtered.scss rename to Lombiq.TrainingDemo/Assets/Styles/trainingdemo-filtered.scss diff --git a/ContentTypes.cs b/Lombiq.TrainingDemo/ContentTypes.cs similarity index 100% rename from ContentTypes.cs rename to Lombiq.TrainingDemo/ContentTypes.cs diff --git a/Controllers/AdminController.cs b/Lombiq.TrainingDemo/Controllers/AdminController.cs similarity index 100% rename from Controllers/AdminController.cs rename to Lombiq.TrainingDemo/Controllers/AdminController.cs diff --git a/Controllers/ApiController.cs b/Lombiq.TrainingDemo/Controllers/ApiController.cs similarity index 100% rename from Controllers/ApiController.cs rename to Lombiq.TrainingDemo/Controllers/ApiController.cs diff --git a/Controllers/AuthorizationController.cs b/Lombiq.TrainingDemo/Controllers/AuthorizationController.cs similarity index 100% rename from Controllers/AuthorizationController.cs rename to Lombiq.TrainingDemo/Controllers/AuthorizationController.cs diff --git a/Controllers/CacheController.cs b/Lombiq.TrainingDemo/Controllers/CacheController.cs similarity index 100% rename from Controllers/CacheController.cs rename to Lombiq.TrainingDemo/Controllers/CacheController.cs diff --git a/Controllers/CrossTenantServicesController.cs b/Lombiq.TrainingDemo/Controllers/CrossTenantServicesController.cs similarity index 100% rename from Controllers/CrossTenantServicesController.cs rename to Lombiq.TrainingDemo/Controllers/CrossTenantServicesController.cs diff --git a/Controllers/DatabaseStorageController.cs b/Lombiq.TrainingDemo/Controllers/DatabaseStorageController.cs similarity index 100% rename from Controllers/DatabaseStorageController.cs rename to Lombiq.TrainingDemo/Controllers/DatabaseStorageController.cs diff --git a/Controllers/DisplayManagementController.cs b/Lombiq.TrainingDemo/Controllers/DisplayManagementController.cs similarity index 100% rename from Controllers/DisplayManagementController.cs rename to Lombiq.TrainingDemo/Controllers/DisplayManagementController.cs diff --git a/Controllers/FileManagementController.cs b/Lombiq.TrainingDemo/Controllers/FileManagementController.cs similarity index 100% rename from Controllers/FileManagementController.cs rename to Lombiq.TrainingDemo/Controllers/FileManagementController.cs diff --git a/Controllers/PersonListController.cs b/Lombiq.TrainingDemo/Controllers/PersonListController.cs similarity index 100% rename from Controllers/PersonListController.cs rename to Lombiq.TrainingDemo/Controllers/PersonListController.cs diff --git a/Controllers/SiteSettingsController.cs b/Lombiq.TrainingDemo/Controllers/SiteSettingsController.cs similarity index 100% rename from Controllers/SiteSettingsController.cs rename to Lombiq.TrainingDemo/Controllers/SiteSettingsController.cs diff --git a/Controllers/YourFirstOrchardCoreController.cs b/Lombiq.TrainingDemo/Controllers/YourFirstOrchardCoreController.cs similarity index 100% rename from Controllers/YourFirstOrchardCoreController.cs rename to Lombiq.TrainingDemo/Controllers/YourFirstOrchardCoreController.cs diff --git a/Drivers/BookDisplayDriver.cs b/Lombiq.TrainingDemo/Drivers/BookDisplayDriver.cs similarity index 100% rename from Drivers/BookDisplayDriver.cs rename to Lombiq.TrainingDemo/Drivers/BookDisplayDriver.cs diff --git a/Drivers/ColorFieldDisplayDriver.cs b/Lombiq.TrainingDemo/Drivers/ColorFieldDisplayDriver.cs similarity index 100% rename from Drivers/ColorFieldDisplayDriver.cs rename to Lombiq.TrainingDemo/Drivers/ColorFieldDisplayDriver.cs diff --git a/Drivers/DemoSettingsDisplayDriver.cs b/Lombiq.TrainingDemo/Drivers/DemoSettingsDisplayDriver.cs similarity index 100% rename from Drivers/DemoSettingsDisplayDriver.cs rename to Lombiq.TrainingDemo/Drivers/DemoSettingsDisplayDriver.cs diff --git a/Drivers/ManagePersonsPermissionCheckerTaskDisplayDriver.cs b/Lombiq.TrainingDemo/Drivers/ManagePersonsPermissionCheckerTaskDisplayDriver.cs similarity index 100% rename from Drivers/ManagePersonsPermissionCheckerTaskDisplayDriver.cs rename to Lombiq.TrainingDemo/Drivers/ManagePersonsPermissionCheckerTaskDisplayDriver.cs diff --git a/Drivers/PersonPartDisplayDriver.cs b/Lombiq.TrainingDemo/Drivers/PersonPartDisplayDriver.cs similarity index 100% rename from Drivers/PersonPartDisplayDriver.cs rename to Lombiq.TrainingDemo/Drivers/PersonPartDisplayDriver.cs diff --git a/Events/LoginGreeting.cs b/Lombiq.TrainingDemo/Events/LoginGreeting.cs similarity index 100% rename from Events/LoginGreeting.cs rename to Lombiq.TrainingDemo/Events/LoginGreeting.cs diff --git a/Fields/ColorField.cs b/Lombiq.TrainingDemo/Fields/ColorField.cs similarity index 100% rename from Fields/ColorField.cs rename to Lombiq.TrainingDemo/Fields/ColorField.cs diff --git a/Filters/ResourceFromShapeInjectingFilter.cs b/Lombiq.TrainingDemo/Filters/ResourceFromShapeInjectingFilter.cs similarity index 100% rename from Filters/ResourceFromShapeInjectingFilter.cs rename to Lombiq.TrainingDemo/Filters/ResourceFromShapeInjectingFilter.cs diff --git a/Filters/ResourceInjectionFilter.cs b/Lombiq.TrainingDemo/Filters/ResourceInjectionFilter.cs similarity index 100% rename from Filters/ResourceInjectionFilter.cs rename to Lombiq.TrainingDemo/Filters/ResourceInjectionFilter.cs diff --git a/Filters/ShapeInjectionFilter.cs b/Lombiq.TrainingDemo/Filters/ShapeInjectionFilter.cs similarity index 100% rename from Filters/ShapeInjectionFilter.cs rename to Lombiq.TrainingDemo/Filters/ShapeInjectionFilter.cs diff --git a/GraphQL/Models/HandednessEnumerationGraphType.cs b/Lombiq.TrainingDemo/GraphQL/Models/HandednessEnumerationGraphType.cs similarity index 100% rename from GraphQL/Models/HandednessEnumerationGraphType.cs rename to Lombiq.TrainingDemo/GraphQL/Models/HandednessEnumerationGraphType.cs diff --git a/GraphQL/Services/ContentItemTypeBuilder.cs b/Lombiq.TrainingDemo/GraphQL/Services/ContentItemTypeBuilder.cs similarity index 100% rename from GraphQL/Services/ContentItemTypeBuilder.cs rename to Lombiq.TrainingDemo/GraphQL/Services/ContentItemTypeBuilder.cs diff --git a/GraphQL/Services/PersonAgeGraphQLFilter.cs b/Lombiq.TrainingDemo/GraphQL/Services/PersonAgeGraphQLFilter.cs similarity index 100% rename from GraphQL/Services/PersonAgeGraphQLFilter.cs rename to Lombiq.TrainingDemo/GraphQL/Services/PersonAgeGraphQLFilter.cs diff --git a/GraphQL/Services/PersonPartIndexAliasProvider.cs b/Lombiq.TrainingDemo/GraphQL/Services/PersonPartIndexAliasProvider.cs similarity index 100% rename from GraphQL/Services/PersonPartIndexAliasProvider.cs rename to Lombiq.TrainingDemo/GraphQL/Services/PersonPartIndexAliasProvider.cs diff --git a/GraphQL/Services/PersonPartObjectGraphType.cs b/Lombiq.TrainingDemo/GraphQL/Services/PersonPartObjectGraphType.cs similarity index 100% rename from GraphQL/Services/PersonPartObjectGraphType.cs rename to Lombiq.TrainingDemo/GraphQL/Services/PersonPartObjectGraphType.cs diff --git a/GraphQL/Services/PersonPartWhereInputObjectGraphType.cs b/Lombiq.TrainingDemo/GraphQL/Services/PersonPartWhereInputObjectGraphType.cs similarity index 100% rename from GraphQL/Services/PersonPartWhereInputObjectGraphType.cs rename to Lombiq.TrainingDemo/GraphQL/Services/PersonPartWhereInputObjectGraphType.cs diff --git a/GraphQL/Startup.cs b/Lombiq.TrainingDemo/GraphQL/Startup.cs similarity index 100% rename from GraphQL/Startup.cs rename to Lombiq.TrainingDemo/GraphQL/Startup.cs diff --git a/Handlers/PersonPartHandler.cs b/Lombiq.TrainingDemo/Handlers/PersonPartHandler.cs similarity index 100% rename from Handlers/PersonPartHandler.cs rename to Lombiq.TrainingDemo/Handlers/PersonPartHandler.cs diff --git a/Indexes/BookIndex.cs b/Lombiq.TrainingDemo/Indexes/BookIndex.cs similarity index 100% rename from Indexes/BookIndex.cs rename to Lombiq.TrainingDemo/Indexes/BookIndex.cs diff --git a/Indexes/PersonPartIndex.cs b/Lombiq.TrainingDemo/Indexes/PersonPartIndex.cs similarity index 100% rename from Indexes/PersonPartIndex.cs rename to Lombiq.TrainingDemo/Indexes/PersonPartIndex.cs diff --git a/Indexing/ColorFieldIndexHandler.cs b/Lombiq.TrainingDemo/Indexing/ColorFieldIndexHandler.cs similarity index 100% rename from Indexing/ColorFieldIndexHandler.cs rename to Lombiq.TrainingDemo/Indexing/ColorFieldIndexHandler.cs diff --git a/Liquid/ShortDateFilter.cs b/Lombiq.TrainingDemo/Liquid/ShortDateFilter.cs similarity index 100% rename from Liquid/ShortDateFilter.cs rename to Lombiq.TrainingDemo/Liquid/ShortDateFilter.cs diff --git a/Lombiq.TrainingDemo.csproj b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj similarity index 82% rename from Lombiq.TrainingDemo.csproj rename to Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj index 7421e1d7..24011352 100644 --- a/Lombiq.TrainingDemo.csproj +++ b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj @@ -1,6 +1,6 @@ - + net8.0 @@ -10,7 +10,7 @@ https://github.com/Lombiq/Orchard-Training-Demo-Module/blob/dev/License.md https://github.com/Lombiq/Orchard-Training-Demo-Module Orchard Core, Orchard CMS, training - $(DefaultItemExcludes);.git*;node_modules\**;Tests\** + $(DefaultItemExcludes);.git*;node_modules\** @@ -49,10 +49,10 @@ - - + + - + diff --git a/Manifest.cs b/Lombiq.TrainingDemo/Manifest.cs similarity index 100% rename from Manifest.cs rename to Lombiq.TrainingDemo/Manifest.cs diff --git a/Map.cs b/Lombiq.TrainingDemo/Map.cs similarity index 100% rename from Map.cs rename to Lombiq.TrainingDemo/Map.cs diff --git a/Middlewares/RequestLoggingMiddleware.cs b/Lombiq.TrainingDemo/Middlewares/RequestLoggingMiddleware.cs similarity index 100% rename from Middlewares/RequestLoggingMiddleware.cs rename to Lombiq.TrainingDemo/Middlewares/RequestLoggingMiddleware.cs diff --git a/Migrations/BookMigrations.cs b/Lombiq.TrainingDemo/Migrations/BookMigrations.cs similarity index 100% rename from Migrations/BookMigrations.cs rename to Lombiq.TrainingDemo/Migrations/BookMigrations.cs diff --git a/Migrations/PersonMigrations.cs b/Lombiq.TrainingDemo/Migrations/PersonMigrations.cs similarity index 100% rename from Migrations/PersonMigrations.cs rename to Lombiq.TrainingDemo/Migrations/PersonMigrations.cs diff --git a/Models/Book.cs b/Lombiq.TrainingDemo/Models/Book.cs similarity index 100% rename from Models/Book.cs rename to Lombiq.TrainingDemo/Models/Book.cs diff --git a/Models/DemoSettings.cs b/Lombiq.TrainingDemo/Models/DemoSettings.cs similarity index 100% rename from Models/DemoSettings.cs rename to Lombiq.TrainingDemo/Models/DemoSettings.cs diff --git a/Models/PersonPart.cs b/Lombiq.TrainingDemo/Models/PersonPart.cs similarity index 100% rename from Models/PersonPart.cs rename to Lombiq.TrainingDemo/Models/PersonPart.cs diff --git a/Navigation/DemoSettingsAdminMenu.cs b/Lombiq.TrainingDemo/Navigation/DemoSettingsAdminMenu.cs similarity index 100% rename from Navigation/DemoSettingsAdminMenu.cs rename to Lombiq.TrainingDemo/Navigation/DemoSettingsAdminMenu.cs diff --git a/Navigation/PersonsAdminMenu.cs b/Lombiq.TrainingDemo/Navigation/PersonsAdminMenu.cs similarity index 100% rename from Navigation/PersonsAdminMenu.cs rename to Lombiq.TrainingDemo/Navigation/PersonsAdminMenu.cs diff --git a/Navigation/TrainingDemoNavigationProvider.cs b/Lombiq.TrainingDemo/Navigation/TrainingDemoNavigationProvider.cs similarity index 100% rename from Navigation/TrainingDemoNavigationProvider.cs rename to Lombiq.TrainingDemo/Navigation/TrainingDemoNavigationProvider.cs diff --git a/Permissions/DemoSettingsPermissions.cs b/Lombiq.TrainingDemo/Permissions/DemoSettingsPermissions.cs similarity index 100% rename from Permissions/DemoSettingsPermissions.cs rename to Lombiq.TrainingDemo/Permissions/DemoSettingsPermissions.cs diff --git a/Permissions/PersonPermissions.cs b/Lombiq.TrainingDemo/Permissions/PersonPermissions.cs similarity index 100% rename from Permissions/PersonPermissions.cs rename to Lombiq.TrainingDemo/Permissions/PersonPermissions.cs diff --git a/Recipes/TrainingDemo.Content.Sample.Person.recipe.json b/Lombiq.TrainingDemo/Recipes/TrainingDemo.Content.Sample.Person.recipe.json similarity index 100% rename from Recipes/TrainingDemo.Content.Sample.Person.recipe.json rename to Lombiq.TrainingDemo/Recipes/TrainingDemo.Content.Sample.Person.recipe.json diff --git a/Recipes/TrainingDemo.Workflows.Sample.recipe.json b/Lombiq.TrainingDemo/Recipes/TrainingDemo.Workflows.Sample.recipe.json similarity index 100% rename from Recipes/TrainingDemo.Workflows.Sample.recipe.json rename to Lombiq.TrainingDemo/Recipes/TrainingDemo.Workflows.Sample.recipe.json diff --git a/Recipes/TrainingDemo.recipe.json b/Lombiq.TrainingDemo/Recipes/TrainingDemo.recipe.json similarity index 100% rename from Recipes/TrainingDemo.recipe.json rename to Lombiq.TrainingDemo/Recipes/TrainingDemo.recipe.json diff --git a/ResourceManagementOptionsConfiguration.cs b/Lombiq.TrainingDemo/ResourceManagementOptionsConfiguration.cs similarity index 100% rename from ResourceManagementOptionsConfiguration.cs rename to Lombiq.TrainingDemo/ResourceManagementOptionsConfiguration.cs diff --git a/Services/CustomFileStore.cs b/Lombiq.TrainingDemo/Services/CustomFileStore.cs similarity index 100% rename from Services/CustomFileStore.cs rename to Lombiq.TrainingDemo/Services/CustomFileStore.cs diff --git a/Services/DateTimeCachingService.cs b/Lombiq.TrainingDemo/Services/DateTimeCachingService.cs similarity index 100% rename from Services/DateTimeCachingService.cs rename to Lombiq.TrainingDemo/Services/DateTimeCachingService.cs diff --git a/Services/DemoBackgroundTask.cs b/Lombiq.TrainingDemo/Services/DemoBackgroundTask.cs similarity index 100% rename from Services/DemoBackgroundTask.cs rename to Lombiq.TrainingDemo/Services/DemoBackgroundTask.cs diff --git a/Services/DemoSettingsConfiguration.cs b/Lombiq.TrainingDemo/Services/DemoSettingsConfiguration.cs similarity index 100% rename from Services/DemoSettingsConfiguration.cs rename to Lombiq.TrainingDemo/Services/DemoSettingsConfiguration.cs diff --git a/Services/IDateTimeCachingService.cs b/Lombiq.TrainingDemo/Services/IDateTimeCachingService.cs similarity index 100% rename from Services/IDateTimeCachingService.cs rename to Lombiq.TrainingDemo/Services/IDateTimeCachingService.cs diff --git a/Services/ShapeHidingShapeTableProvider.cs b/Lombiq.TrainingDemo/Services/ShapeHidingShapeTableProvider.cs similarity index 100% rename from Services/ShapeHidingShapeTableProvider.cs rename to Lombiq.TrainingDemo/Services/ShapeHidingShapeTableProvider.cs diff --git a/Services/TestedService.cs b/Lombiq.TrainingDemo/Services/TestedService.cs similarity index 100% rename from Services/TestedService.cs rename to Lombiq.TrainingDemo/Services/TestedService.cs diff --git a/Settings/ColorFieldSettings.cs b/Lombiq.TrainingDemo/Settings/ColorFieldSettings.cs similarity index 100% rename from Settings/ColorFieldSettings.cs rename to Lombiq.TrainingDemo/Settings/ColorFieldSettings.cs diff --git a/Settings/ColorFieldSettingsDriver.cs b/Lombiq.TrainingDemo/Settings/ColorFieldSettingsDriver.cs similarity index 100% rename from Settings/ColorFieldSettingsDriver.cs rename to Lombiq.TrainingDemo/Settings/ColorFieldSettingsDriver.cs diff --git a/StartLearningHere.md b/Lombiq.TrainingDemo/StartLearningHere.md similarity index 100% rename from StartLearningHere.md rename to Lombiq.TrainingDemo/StartLearningHere.md diff --git a/Startup.cs b/Lombiq.TrainingDemo/Startup.cs similarity index 100% rename from Startup.cs rename to Lombiq.TrainingDemo/Startup.cs diff --git a/ViewModels/CacheViewModel.cs b/Lombiq.TrainingDemo/ViewModels/CacheViewModel.cs similarity index 100% rename from ViewModels/CacheViewModel.cs rename to Lombiq.TrainingDemo/ViewModels/CacheViewModel.cs diff --git a/ViewModels/DemoSettingsViewModel.cs b/Lombiq.TrainingDemo/ViewModels/DemoSettingsViewModel.cs similarity index 100% rename from ViewModels/DemoSettingsViewModel.cs rename to Lombiq.TrainingDemo/ViewModels/DemoSettingsViewModel.cs diff --git a/ViewModels/DisplayColorFieldViewModel.cs b/Lombiq.TrainingDemo/ViewModels/DisplayColorFieldViewModel.cs similarity index 100% rename from ViewModels/DisplayColorFieldViewModel.cs rename to Lombiq.TrainingDemo/ViewModels/DisplayColorFieldViewModel.cs diff --git a/ViewModels/EditColorFieldViewModel.cs b/Lombiq.TrainingDemo/ViewModels/EditColorFieldViewModel.cs similarity index 100% rename from ViewModels/EditColorFieldViewModel.cs rename to Lombiq.TrainingDemo/ViewModels/EditColorFieldViewModel.cs diff --git a/ViewModels/ManagePersonsPermissionCheckerTaskViewModel.cs b/Lombiq.TrainingDemo/ViewModels/ManagePersonsPermissionCheckerTaskViewModel.cs similarity index 100% rename from ViewModels/ManagePersonsPermissionCheckerTaskViewModel.cs rename to Lombiq.TrainingDemo/ViewModels/ManagePersonsPermissionCheckerTaskViewModel.cs diff --git a/ViewModels/PersonPartViewModel.cs b/Lombiq.TrainingDemo/ViewModels/PersonPartViewModel.cs similarity index 100% rename from ViewModels/PersonPartViewModel.cs rename to Lombiq.TrainingDemo/ViewModels/PersonPartViewModel.cs diff --git a/ViewModels/StaticallyTypedDerivedTestShapeViewModel.cs b/Lombiq.TrainingDemo/ViewModels/StaticallyTypedDerivedTestShapeViewModel.cs similarity index 100% rename from ViewModels/StaticallyTypedDerivedTestShapeViewModel.cs rename to Lombiq.TrainingDemo/ViewModels/StaticallyTypedDerivedTestShapeViewModel.cs diff --git a/ViewModels/StaticallyTypedTestShapeViewModel.cs b/Lombiq.TrainingDemo/ViewModels/StaticallyTypedTestShapeViewModel.cs similarity index 100% rename from ViewModels/StaticallyTypedTestShapeViewModel.cs rename to Lombiq.TrainingDemo/ViewModels/StaticallyTypedTestShapeViewModel.cs diff --git a/Views/Admin/Index.cshtml b/Lombiq.TrainingDemo/Views/Admin/Index.cshtml similarity index 100% rename from Views/Admin/Index.cshtml rename to Lombiq.TrainingDemo/Views/Admin/Index.cshtml diff --git a/Views/Admin/PersonList.cshtml b/Lombiq.TrainingDemo/Views/Admin/PersonList.cshtml similarity index 100% rename from Views/Admin/PersonList.cshtml rename to Lombiq.TrainingDemo/Views/Admin/PersonList.cshtml diff --git a/Views/AlertScriptShape.cshtml b/Lombiq.TrainingDemo/Views/AlertScriptShape.cshtml similarity index 100% rename from Views/AlertScriptShape.cshtml rename to Lombiq.TrainingDemo/Views/AlertScriptShape.cshtml diff --git a/Views/Book.Description.cshtml b/Lombiq.TrainingDemo/Views/Book.Description.cshtml similarity index 100% rename from Views/Book.Description.cshtml rename to Lombiq.TrainingDemo/Views/Book.Description.cshtml diff --git a/Views/Book.cshtml b/Lombiq.TrainingDemo/Views/Book.cshtml similarity index 100% rename from Views/Book.cshtml rename to Lombiq.TrainingDemo/Views/Book.cshtml diff --git a/Views/Cache/Index.cshtml b/Lombiq.TrainingDemo/Views/Cache/Index.cshtml similarity index 100% rename from Views/Cache/Index.cshtml rename to Lombiq.TrainingDemo/Views/Cache/Index.cshtml diff --git a/Views/Cache/Shape.cshtml b/Lombiq.TrainingDemo/Views/Cache/Shape.cshtml similarity index 100% rename from Views/Cache/Shape.cshtml rename to Lombiq.TrainingDemo/Views/Cache/Shape.cshtml diff --git a/Views/CachedShape.cshtml b/Lombiq.TrainingDemo/Views/CachedShape.cshtml similarity index 100% rename from Views/CachedShape.cshtml rename to Lombiq.TrainingDemo/Views/CachedShape.cshtml diff --git a/Views/ColorField-ColorPicker.Edit.cshtml b/Lombiq.TrainingDemo/Views/ColorField-ColorPicker.Edit.cshtml similarity index 100% rename from Views/ColorField-ColorPicker.Edit.cshtml rename to Lombiq.TrainingDemo/Views/ColorField-ColorPicker.Edit.cshtml diff --git a/Views/ColorField-ColorPicker.Option.cshtml b/Lombiq.TrainingDemo/Views/ColorField-ColorPicker.Option.cshtml similarity index 100% rename from Views/ColorField-ColorPicker.Option.cshtml rename to Lombiq.TrainingDemo/Views/ColorField-ColorPicker.Option.cshtml diff --git a/Views/ColorField.Edit.cshtml b/Lombiq.TrainingDemo/Views/ColorField.Edit.cshtml similarity index 100% rename from Views/ColorField.Edit.cshtml rename to Lombiq.TrainingDemo/Views/ColorField.Edit.cshtml diff --git a/Views/ColorField.Option.cshtml b/Lombiq.TrainingDemo/Views/ColorField.Option.cshtml similarity index 100% rename from Views/ColorField.Option.cshtml rename to Lombiq.TrainingDemo/Views/ColorField.Option.cshtml diff --git a/Views/ColorField.cshtml b/Lombiq.TrainingDemo/Views/ColorField.cshtml similarity index 100% rename from Views/ColorField.cshtml rename to Lombiq.TrainingDemo/Views/ColorField.cshtml diff --git a/Views/ColorFieldSettings.Edit.cshtml b/Lombiq.TrainingDemo/Views/ColorFieldSettings.Edit.cshtml similarity index 100% rename from Views/ColorFieldSettings.Edit.cshtml rename to Lombiq.TrainingDemo/Views/ColorFieldSettings.Edit.cshtml diff --git a/Views/ComplexTestShape.cshtml b/Lombiq.TrainingDemo/Views/ComplexTestShape.cshtml similarity index 100% rename from Views/ComplexTestShape.cshtml rename to Lombiq.TrainingDemo/Views/ComplexTestShape.cshtml diff --git a/Views/DatabaseStorage/CreateBooks.cshtml b/Lombiq.TrainingDemo/Views/DatabaseStorage/CreateBooks.cshtml similarity index 100% rename from Views/DatabaseStorage/CreateBooks.cshtml rename to Lombiq.TrainingDemo/Views/DatabaseStorage/CreateBooks.cshtml diff --git a/Views/DatabaseStorage/JKRosenzweigBooks.cshtml b/Lombiq.TrainingDemo/Views/DatabaseStorage/JKRosenzweigBooks.cshtml similarity index 100% rename from Views/DatabaseStorage/JKRosenzweigBooks.cshtml rename to Lombiq.TrainingDemo/Views/DatabaseStorage/JKRosenzweigBooks.cshtml diff --git a/Views/DemoSettings.Edit.cshtml b/Lombiq.TrainingDemo/Views/DemoSettings.Edit.cshtml similarity index 100% rename from Views/DemoSettings.Edit.cshtml rename to Lombiq.TrainingDemo/Views/DemoSettings.Edit.cshtml diff --git a/Views/DisplayManagement/AdHocShape.cshtml b/Lombiq.TrainingDemo/Views/DisplayManagement/AdHocShape.cshtml similarity index 100% rename from Views/DisplayManagement/AdHocShape.cshtml rename to Lombiq.TrainingDemo/Views/DisplayManagement/AdHocShape.cshtml diff --git a/Views/DisplayManagement/DisplayBook.cshtml b/Lombiq.TrainingDemo/Views/DisplayManagement/DisplayBook.cshtml similarity index 100% rename from Views/DisplayManagement/DisplayBook.cshtml rename to Lombiq.TrainingDemo/Views/DisplayManagement/DisplayBook.cshtml diff --git a/Views/DisplayManagement/DisplayBookDescription.cshtml b/Lombiq.TrainingDemo/Views/DisplayManagement/DisplayBookDescription.cshtml similarity index 100% rename from Views/DisplayManagement/DisplayBookDescription.cshtml rename to Lombiq.TrainingDemo/Views/DisplayManagement/DisplayBookDescription.cshtml diff --git a/Views/FileManagement/UploadFileToMedia.cshtml b/Lombiq.TrainingDemo/Views/FileManagement/UploadFileToMedia.cshtml similarity index 100% rename from Views/FileManagement/UploadFileToMedia.cshtml rename to Lombiq.TrainingDemo/Views/FileManagement/UploadFileToMedia.cshtml diff --git a/Views/InjectedShape.cshtml b/Lombiq.TrainingDemo/Views/InjectedShape.cshtml similarity index 100% rename from Views/InjectedShape.cshtml rename to Lombiq.TrainingDemo/Views/InjectedShape.cshtml diff --git a/Views/Items/Book.Display.Author.cshtml b/Lombiq.TrainingDemo/Views/Items/Book.Display.Author.cshtml similarity index 100% rename from Views/Items/Book.Display.Author.cshtml rename to Lombiq.TrainingDemo/Views/Items/Book.Display.Author.cshtml diff --git a/Views/Items/Book.Display.Cover.cshtml b/Lombiq.TrainingDemo/Views/Items/Book.Display.Cover.cshtml similarity index 100% rename from Views/Items/Book.Display.Cover.cshtml rename to Lombiq.TrainingDemo/Views/Items/Book.Display.Cover.cshtml diff --git a/Views/Items/Book.Display.Description.cshtml b/Lombiq.TrainingDemo/Views/Items/Book.Display.Description.cshtml similarity index 100% rename from Views/Items/Book.Display.Description.cshtml rename to Lombiq.TrainingDemo/Views/Items/Book.Display.Description.cshtml diff --git a/Views/Items/Book.Display.Title.cshtml b/Lombiq.TrainingDemo/Views/Items/Book.Display.Title.cshtml similarity index 100% rename from Views/Items/Book.Display.Title.cshtml rename to Lombiq.TrainingDemo/Views/Items/Book.Display.Title.cshtml diff --git a/Views/Items/ManagePersonsPermissionCheckerTask.Fields.Design.cshtml b/Lombiq.TrainingDemo/Views/Items/ManagePersonsPermissionCheckerTask.Fields.Design.cshtml similarity index 100% rename from Views/Items/ManagePersonsPermissionCheckerTask.Fields.Design.cshtml rename to Lombiq.TrainingDemo/Views/Items/ManagePersonsPermissionCheckerTask.Fields.Design.cshtml diff --git a/Views/Items/ManagePersonsPermissionCheckerTask.Fields.Edit.cshtml b/Lombiq.TrainingDemo/Views/Items/ManagePersonsPermissionCheckerTask.Fields.Edit.cshtml similarity index 100% rename from Views/Items/ManagePersonsPermissionCheckerTask.Fields.Edit.cshtml rename to Lombiq.TrainingDemo/Views/Items/ManagePersonsPermissionCheckerTask.Fields.Edit.cshtml diff --git a/Views/Items/ManagePersonsPermissionCheckerTask.Fields.Thumbnail.cshtml b/Lombiq.TrainingDemo/Views/Items/ManagePersonsPermissionCheckerTask.Fields.Thumbnail.cshtml similarity index 100% rename from Views/Items/ManagePersonsPermissionCheckerTask.Fields.Thumbnail.cshtml rename to Lombiq.TrainingDemo/Views/Items/ManagePersonsPermissionCheckerTask.Fields.Thumbnail.cshtml diff --git a/Views/NavigationItemText-persons.Id.cshtml b/Lombiq.TrainingDemo/Views/NavigationItemText-persons.Id.cshtml similarity index 100% rename from Views/NavigationItemText-persons.Id.cshtml rename to Lombiq.TrainingDemo/Views/NavigationItemText-persons.Id.cshtml diff --git a/Views/PersonList/OlderThan30.cshtml b/Lombiq.TrainingDemo/Views/PersonList/OlderThan30.cshtml similarity index 100% rename from Views/PersonList/OlderThan30.cshtml rename to Lombiq.TrainingDemo/Views/PersonList/OlderThan30.cshtml diff --git a/Views/PersonPart.Edit.cshtml b/Lombiq.TrainingDemo/Views/PersonPart.Edit.cshtml similarity index 100% rename from Views/PersonPart.Edit.cshtml rename to Lombiq.TrainingDemo/Views/PersonPart.Edit.cshtml diff --git a/Views/PersonPart.Summary.cshtml b/Lombiq.TrainingDemo/Views/PersonPart.Summary.cshtml similarity index 100% rename from Views/PersonPart.Summary.cshtml rename to Lombiq.TrainingDemo/Views/PersonPart.Summary.cshtml diff --git a/Views/PersonPart.SummaryAdmin.cshtml b/Lombiq.TrainingDemo/Views/PersonPart.SummaryAdmin.cshtml similarity index 100% rename from Views/PersonPart.SummaryAdmin.cshtml rename to Lombiq.TrainingDemo/Views/PersonPart.SummaryAdmin.cshtml diff --git a/Views/PersonPart.cshtml b/Lombiq.TrainingDemo/Views/PersonPart.cshtml similarity index 100% rename from Views/PersonPart.cshtml rename to Lombiq.TrainingDemo/Views/PersonPart.cshtml diff --git a/Views/PersonPart.liquid b/Lombiq.TrainingDemo/Views/PersonPart.liquid similarity index 100% rename from Views/PersonPart.liquid rename to Lombiq.TrainingDemo/Views/PersonPart.liquid diff --git a/Views/StaticallyTypedDerivedTestShape.cshtml b/Lombiq.TrainingDemo/Views/StaticallyTypedDerivedTestShape.cshtml similarity index 100% rename from Views/StaticallyTypedDerivedTestShape.cshtml rename to Lombiq.TrainingDemo/Views/StaticallyTypedDerivedTestShape.cshtml diff --git a/Views/StaticallyTypedTestShape.cshtml b/Lombiq.TrainingDemo/Views/StaticallyTypedTestShape.cshtml similarity index 100% rename from Views/StaticallyTypedTestShape.cshtml rename to Lombiq.TrainingDemo/Views/StaticallyTypedTestShape.cshtml diff --git a/Views/TestShape.cshtml b/Lombiq.TrainingDemo/Views/TestShape.cshtml similarity index 100% rename from Views/TestShape.cshtml rename to Lombiq.TrainingDemo/Views/TestShape.cshtml diff --git a/Views/YourFirstOrchardCore/Index.cshtml b/Lombiq.TrainingDemo/Views/YourFirstOrchardCore/Index.cshtml similarity index 100% rename from Views/YourFirstOrchardCore/Index.cshtml rename to Lombiq.TrainingDemo/Views/YourFirstOrchardCore/Index.cshtml diff --git a/Views/YourFirstOrchardCore/NotifyMe.cshtml b/Lombiq.TrainingDemo/Views/YourFirstOrchardCore/NotifyMe.cshtml similarity index 100% rename from Views/YourFirstOrchardCore/NotifyMe.cshtml rename to Lombiq.TrainingDemo/Views/YourFirstOrchardCore/NotifyMe.cshtml diff --git a/Views/_ViewImports.cshtml b/Lombiq.TrainingDemo/Views/_ViewImports.cshtml similarity index 100% rename from Views/_ViewImports.cshtml rename to Lombiq.TrainingDemo/Views/_ViewImports.cshtml diff --git a/package-lock.json b/Lombiq.TrainingDemo/package-lock.json similarity index 100% rename from package-lock.json rename to Lombiq.TrainingDemo/package-lock.json diff --git a/package.json b/Lombiq.TrainingDemo/package.json similarity index 100% rename from package.json rename to Lombiq.TrainingDemo/package.json diff --git a/placement.json b/Lombiq.TrainingDemo/placement.json similarity index 100% rename from placement.json rename to Lombiq.TrainingDemo/placement.json diff --git a/pnpm-lock.yaml b/Lombiq.TrainingDemo/pnpm-lock.yaml similarity index 100% rename from pnpm-lock.yaml rename to Lombiq.TrainingDemo/pnpm-lock.yaml diff --git a/Readme.md b/Readme.md index 8f3e3c2e..b7567fc4 100644 --- a/Readme.md +++ b/Readme.md @@ -29,11 +29,11 @@ The [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source- ## Learning Orchard Core with this module -Once the app is running, head over to the **[StartLearningHere.md](StartLearningHere.md)** file (_see note *_) and start exploring all the great things you can do in Orchard Core. +Once the app is running, head over to the **[Lombiq.TrainingDemo/StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md)** file (_see note *_) and start exploring all the great things you can do in Orchard Core. -> _* Note:_ The "**StartLearningHere.md**" file introduces the Lombiq.TrainingDemo project. You can find the Lombiq.TrainingDemo folder inside the src > Modules directory of the "Open-Source-Orchard-Core-Extensions" (OSOCE) repository previously cloned (point number 1 of [How to start](#how-to-start) section). +> _* Note:_ The "**Lombiq.TrainingDemo/StartLearningHere.md**" file introduces the Lombiq.TrainingDemo project. You can find the Lombiq.TrainingDemo folder inside the src > Modules directory of the "Open-Source-Orchard-Core-Extensions" (OSOCE) repository previously cloned (point number 1 of [How to start](#how-to-start) section). -Also if you are brave enough to not follow any guide or you want to start the guide from somewhere else then go to the **Map.cs** file and jump to any class you are interested in. [StartLearningHere.md](StartLearningHere.md) also has training sections linked so you can go to a broader section. +Also if you are brave enough to not follow any guide or you want to start the guide from somewhere else then go to the **Map.cs** file and jump to any class you are interested in. [Lombiq.TrainingDemo/StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md) also has training sections linked so you can go to a broader section. Be sure to check out the [Orchard Dojo Library for Orchard Core](https://orcharddojo.net/orchard-resources/CoreLibrary/) for a wealth of Orchard Core guidelines, best practices, development utilities (like scripts and snippets), and more as well! @@ -61,7 +61,7 @@ Bug reports, feature requests, comments, questions, code contributions and love When adding new tutorials please keep in mind the following: - Insert tutorial steps into the existing flow, either at the end or between two existing ones. Use "NEXT STATION" comments to indicate the next file the reader should check out. -- If it's a new training section then indicate as such by an "END OF TRAINING SECTION" comment at the end and add it to the list under [StartLearningHere.md](StartLearningHere.md). +- If it's a new training section then indicate as such by an "END OF TRAINING SECTION" comment at the end and add it to the list under [Lombiq.TrainingDemo/StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md). - Add pointers to its classes/files in _Map.cs_. This project is developed by [Lombiq Technologies](https://lombiq.com/). Commercial-grade support is available through Lombiq. From d882d962ccee5ea1ba494cd94fd559a121222463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 16:22:55 +0100 Subject: [PATCH 02/26] Adding solution and web project generated by templates --- .gitignore | 194 +++++++++++++++++- .../Lombiq.TrainingDemo.Web.csproj | 29 +++ Lombiq.TrainingDemo.Web/NLog.config | 32 +++ Lombiq.TrainingDemo.Web/Program.cs | 30 +++ .../Properties/launchSettings.json | 27 +++ Lombiq.TrainingDemo.Web/appsettings.json | 9 + Lombiq.TrainingDemo.Web/wwwroot/.placeholder | 1 + Lombiq.TrainingDemo.sln | 45 ++++ 8 files changed, 358 insertions(+), 9 deletions(-) create mode 100644 Lombiq.TrainingDemo.Web/Lombiq.TrainingDemo.Web.csproj create mode 100644 Lombiq.TrainingDemo.Web/NLog.config create mode 100644 Lombiq.TrainingDemo.Web/Program.cs create mode 100644 Lombiq.TrainingDemo.Web/Properties/launchSettings.json create mode 100644 Lombiq.TrainingDemo.Web/appsettings.json create mode 100644 Lombiq.TrainingDemo.Web/wwwroot/.placeholder create mode 100644 Lombiq.TrainingDemo.sln diff --git a/.gitignore b/.gitignore index 403cc7f6..fe9d72e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,190 @@ -.vs/ -.idea/ -.vscode/ -obj/ -bin/ -artifacts/ -wwwroot/ -node_modules/ +## Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo *.user -.pnpm-debug.log +*.sln.docstates +*.sln.ide/ + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +app.publish/ +[Bb]in/ +[Oo]bj/ + +# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets +!packages/*/build/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc +project.lock.json + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +*.Cache +!OrchardCore.Environment.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + + +## Windows and MAC detritus + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ # Mac .DS_Store + +## ASP.NET Core and Orchard Core specifics + +App_Data/ +*.user +*.patch +*.hg +build/ +/buildazure +/buildtasks +/artifacts +site/ +*.sln.cache +log.xml +profiling/ +*.orig +.vs/ +#.vscode/ +.build/ +.testPublish/ + +nuget.exe +.nuget/ + +# Enable all /lib artifacts +!lib/*/*.* + +# Exclude node modules +node_modules/ + +# Exclude wwwroot and add exceptions +**/wwwroot/* +!**/wwwroot/favicon.ico +!**/wwwroot/.placeholder + +*.Web/Localization +/.editorconfig diff --git a/Lombiq.TrainingDemo.Web/Lombiq.TrainingDemo.Web.csproj b/Lombiq.TrainingDemo.Web/Lombiq.TrainingDemo.Web.csproj new file mode 100644 index 00000000..eb9294ec --- /dev/null +++ b/Lombiq.TrainingDemo.Web/Lombiq.TrainingDemo.Web.csproj @@ -0,0 +1,29 @@ + + + + net8.0 + InProcess + enable + enable + + + + + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.TrainingDemo.Web/NLog.config b/Lombiq.TrainingDemo.Web/NLog.config new file mode 100644 index 00000000..49797bb4 --- /dev/null +++ b/Lombiq.TrainingDemo.Web/NLog.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.TrainingDemo.Web/Program.cs b/Lombiq.TrainingDemo.Web/Program.cs new file mode 100644 index 00000000..15b2160e --- /dev/null +++ b/Lombiq.TrainingDemo.Web/Program.cs @@ -0,0 +1,30 @@ +using OrchardCore.Logging; + +var builder = WebApplication.CreateBuilder(args); + +builder.Host.UseNLogHost(); + +builder.Services + .AddOrchardCms() +// // Orchard Specific Pipeline +// .ConfigureServices( services => { +// }) +// .Configure( (app, routes, services) => { +// }) +; + +var app = builder.Build(); + +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} + +app.UseHttpsRedirection(); +app.UseStaticFiles(); + +app.UseOrchardCore(); + +app.Run(); diff --git a/Lombiq.TrainingDemo.Web/Properties/launchSettings.json b/Lombiq.TrainingDemo.Web/Properties/launchSettings.json new file mode 100644 index 00000000..fc2c26fd --- /dev/null +++ b/Lombiq.TrainingDemo.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:8080", + "sslPort": 44300 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Lombiq.TrainingDemo.Web": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/Lombiq.TrainingDemo.Web/appsettings.json b/Lombiq.TrainingDemo.Web/appsettings.json new file mode 100644 index 00000000..6d278895 --- /dev/null +++ b/Lombiq.TrainingDemo.Web/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, +} diff --git a/Lombiq.TrainingDemo.Web/wwwroot/.placeholder b/Lombiq.TrainingDemo.Web/wwwroot/.placeholder new file mode 100644 index 00000000..46b134b1 --- /dev/null +++ b/Lombiq.TrainingDemo.Web/wwwroot/.placeholder @@ -0,0 +1 @@ +˙ţ \ No newline at end of file diff --git a/Lombiq.TrainingDemo.sln b/Lombiq.TrainingDemo.sln new file mode 100644 index 00000000..b6c59c3a --- /dev/null +++ b/Lombiq.TrainingDemo.sln @@ -0,0 +1,45 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.TrainingDemo.Web", "Lombiq.TrainingDemo.Web\Lombiq.TrainingDemo.Web.csproj", "{B6A88DC8-1AC4-40A7-A059-2DB542D7F30F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.TrainingDemo", "Lombiq.TrainingDemo\Lombiq.TrainingDemo.csproj", "{7E07D978-9E9D-42DF-B723-30751AD0AE37}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.TrainingDemo.Tests", "Lombiq.TrainingDemo.Tests\Lombiq.TrainingDemo.Tests.csproj", "{67AD97B2-F18E-48E2-8DB6-9D6D16B1CCE7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{308DEE3A-FE61-4599-9954-0EE0BF9F7BFD}" + ProjectSection(SolutionItems) = preProject + .gitattributes = .gitattributes + .gitignore = .gitignore + License.md = License.md + Readme.md = Readme.md + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B6A88DC8-1AC4-40A7-A059-2DB542D7F30F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B6A88DC8-1AC4-40A7-A059-2DB542D7F30F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B6A88DC8-1AC4-40A7-A059-2DB542D7F30F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B6A88DC8-1AC4-40A7-A059-2DB542D7F30F}.Release|Any CPU.Build.0 = Release|Any CPU + {7E07D978-9E9D-42DF-B723-30751AD0AE37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E07D978-9E9D-42DF-B723-30751AD0AE37}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E07D978-9E9D-42DF-B723-30751AD0AE37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E07D978-9E9D-42DF-B723-30751AD0AE37}.Release|Any CPU.Build.0 = Release|Any CPU + {67AD97B2-F18E-48E2-8DB6-9D6D16B1CCE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67AD97B2-F18E-48E2-8DB6-9D6D16B1CCE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67AD97B2-F18E-48E2-8DB6-9D6D16B1CCE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67AD97B2-F18E-48E2-8DB6-9D6D16B1CCE7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {925CBCBE-6BFD-40C5-A1B6-5698683F0941} + EndGlobalSection +EndGlobal From 2e0a7fd165f4f66fd3ec526e159879828c475883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 16:23:28 +0100 Subject: [PATCH 03/26] Clean-up --- Lombiq.TrainingDemo.Web/Program.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Lombiq.TrainingDemo.Web/Program.cs b/Lombiq.TrainingDemo.Web/Program.cs index 15b2160e..e442d7af 100644 --- a/Lombiq.TrainingDemo.Web/Program.cs +++ b/Lombiq.TrainingDemo.Web/Program.cs @@ -4,21 +4,15 @@ builder.Host.UseNLogHost(); -builder.Services - .AddOrchardCms() -// // Orchard Specific Pipeline -// .ConfigureServices( services => { -// }) -// .Configure( (app, routes, services) => { -// }) -; +builder.Services.AddOrchardCms(); var app = builder.Build(); if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error"); - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + // The default HSTS value is 30 days. You may want to change this for production scenarios, see + // https://aka.ms/aspnetcore-hsts. app.UseHsts(); } From 7ceb350a767d0a9c1aa8190e2efeaae63963a85b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 16:25:43 +0100 Subject: [PATCH 04/26] Adding build workflow --- .github/workflows/build-and-test-orchard.yml | 15 +++++++++++++++ Lombiq.TrainingDemo.sln | 10 ++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/build-and-test-orchard.yml diff --git a/.github/workflows/build-and-test-orchard.yml b/.github/workflows/build-and-test-orchard.yml new file mode 100644 index 00000000..f5ddc0ab --- /dev/null +++ b/.github/workflows/build-and-test-orchard.yml @@ -0,0 +1,15 @@ +name: Build and Test + +# Runs for PRs opened for any branch, and pushes to the dev branch. +on: + pull_request: + push: + branches: + - dev + +jobs: + build-and-test: + name: Build and Test + uses: Lombiq/GitHub-Actions/.github/workflows/build-and-test-orchard-core.yml@dev + with: + timeout-minutes: 5 diff --git a/Lombiq.TrainingDemo.sln b/Lombiq.TrainingDemo.sln index b6c59c3a..a8d501f1 100644 --- a/Lombiq.TrainingDemo.sln +++ b/Lombiq.TrainingDemo.sln @@ -17,6 +17,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Readme.md = Readme.md EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{C209F02F-E88D-48DC-8645-BD859AA4521A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{1BED0174-67AC-4155-BA45-AF690BDA553B}" + ProjectSection(SolutionItems) = preProject + .github\workflows\build-and-test-orchard.yml = .github\workflows\build-and-test-orchard.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,6 +46,9 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {1BED0174-67AC-4155-BA45-AF690BDA553B} = {C209F02F-E88D-48DC-8645-BD859AA4521A} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {925CBCBE-6BFD-40C5-A1B6-5698683F0941} EndGlobalSection From 071a0bae28817008c6cc3a5505de88e1852d0cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 16:41:16 +0100 Subject: [PATCH 05/26] Removing the Node.js dependency --- .gitignore | 8 ++--- .../Services/TestedServiceTests.cs | 3 +- .../Styles/trainingdemo-colorpicker.scss | 5 --- .../Lombiq.TrainingDemo.csproj | 6 ---- .../ResourceManagementOptionsConfiguration.cs | 8 ++--- Lombiq.TrainingDemo/StartLearningHere.md | 1 - Lombiq.TrainingDemo/package-lock.json | 25 --------------- Lombiq.TrainingDemo/package.json | 29 ------------------ Lombiq.TrainingDemo/pnpm-lock.yaml | 17 ---------- .../wwwroot/css/trainingdemo-colorpicker.css | 3 ++ .../css/trainingdemo-filtered.css} | 0 .../Images => wwwroot/images}/HarryPotter.jpg | Bin Lombiq.TrainingDemo/wwwroot/pickr/Readme.md | 1 + .../wwwroot/pickr/pickr.es5.min.js | 2 ++ .../wwwroot/pickr/pickr.es5.min.js.map | 1 + .../wwwroot/pickr/pickr.min.css | 1 + .../wwwroot/pickr/pickr.min.js | 2 ++ .../wwwroot/pickr/pickr.min.js.map | 1 + Readme.md | 5 +-- 19 files changed, 20 insertions(+), 98 deletions(-) delete mode 100644 Lombiq.TrainingDemo/Assets/Styles/trainingdemo-colorpicker.scss delete mode 100644 Lombiq.TrainingDemo/package-lock.json delete mode 100644 Lombiq.TrainingDemo/package.json delete mode 100644 Lombiq.TrainingDemo/pnpm-lock.yaml create mode 100644 Lombiq.TrainingDemo/wwwroot/css/trainingdemo-colorpicker.css rename Lombiq.TrainingDemo/{Assets/Styles/trainingdemo-filtered.scss => wwwroot/css/trainingdemo-filtered.css} (100%) rename Lombiq.TrainingDemo/{Assets/Images => wwwroot/images}/HarryPotter.jpg (100%) create mode 100644 Lombiq.TrainingDemo/wwwroot/pickr/Readme.md create mode 100644 Lombiq.TrainingDemo/wwwroot/pickr/pickr.es5.min.js create mode 100644 Lombiq.TrainingDemo/wwwroot/pickr/pickr.es5.min.js.map create mode 100644 Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.css create mode 100644 Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.js create mode 100644 Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.js.map diff --git a/.gitignore b/.gitignore index fe9d72e2..33a2ede6 100644 --- a/.gitignore +++ b/.gitignore @@ -181,10 +181,10 @@ nuget.exe # Exclude node modules node_modules/ -# Exclude wwwroot and add exceptions -**/wwwroot/* -!**/wwwroot/favicon.ico -!**/wwwroot/.placeholder +# Exclude Web project wwwroot and add exceptions +Lombiq.TrainingDemo.Web/wwwroot/* +!Lombiq.TrainingDemo.Web/wwwroot/favicon.ico +!Lombiq.TrainingDemo.Web/wwwroot/.placeholder *.Web/Localization /.editorconfig diff --git a/Lombiq.TrainingDemo.Tests/Services/TestedServiceTests.cs b/Lombiq.TrainingDemo.Tests/Services/TestedServiceTests.cs index f8e98b2c..49ab16c1 100644 --- a/Lombiq.TrainingDemo.Tests/Services/TestedServiceTests.cs +++ b/Lombiq.TrainingDemo.Tests/Services/TestedServiceTests.cs @@ -80,4 +80,5 @@ private static TestedService CreateTestedService(out AutoMocker mocker) // END OF TRAINING SECTION: Unit and integration testing -// NEXT STATION: Head back to the module project and check out package.json. +// NEXT STATION: Head back to the module project and check out GraphQL/Startup.cs to learn about extending Orchard +// Core's GraphQL APIs! diff --git a/Lombiq.TrainingDemo/Assets/Styles/trainingdemo-colorpicker.scss b/Lombiq.TrainingDemo/Assets/Styles/trainingdemo-colorpicker.scss deleted file mode 100644 index 2f39840a..00000000 --- a/Lombiq.TrainingDemo/Assets/Styles/trainingdemo-colorpicker.scss +++ /dev/null @@ -1,5 +0,0 @@ -.colorField { - .pickr { - margin-top: 12px; - } -} diff --git a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj index 24011352..9ef79ab7 100644 --- a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj +++ b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj @@ -1,7 +1,5 @@ - - net8.0 true @@ -15,7 +13,6 @@ - @@ -50,9 +47,6 @@ - - - diff --git a/Lombiq.TrainingDemo/ResourceManagementOptionsConfiguration.cs b/Lombiq.TrainingDemo/ResourceManagementOptionsConfiguration.cs index aab212b7..e466be66 100644 --- a/Lombiq.TrainingDemo/ResourceManagementOptionsConfiguration.cs +++ b/Lombiq.TrainingDemo/ResourceManagementOptionsConfiguration.cs @@ -59,9 +59,7 @@ static ResourceManagementOptionsConfiguration() // Finally let's see an example for defining a resource for our custom code. You can see the naming is more // specific and contains our namespace. .DefineStyle("Lombiq.TrainingDemo.ColorPicker") - .SetUrl( - "~/Lombiq.TrainingDemo/css/trainingdemo-colorpicker.min.css", - "~/Lombiq.TrainingDemo/css/trainingdemo-colorpicker.css") + .SetUrl("~/Lombiq.TrainingDemo/css/trainingdemo-colorpicker.css") // You can give a list of resource names to SetDependencies to force the loading of other resources when a // given resource is used. Here Pickr is a dependency. .SetDependencies("Pickr"); @@ -71,9 +69,7 @@ static ResourceManagementOptionsConfiguration() _manifest .DefineStyle("Lombiq.TrainingDemo.Filtered") - .SetUrl( - "~/Lombiq.TrainingDemo/css/trainingdemo-filtered.min.css", - "~/Lombiq.TrainingDemo/css/trainingdemo-filtered.css"); + .SetUrl("~/Lombiq.TrainingDemo/css/trainingdemo-filtered.css"); } public void Configure(ResourceManagementOptions options) => options.ResourceManifests.Add(_manifest); diff --git a/Lombiq.TrainingDemo/StartLearningHere.md b/Lombiq.TrainingDemo/StartLearningHere.md index cc67d289..d29c73d9 100644 --- a/Lombiq.TrainingDemo/StartLearningHere.md +++ b/Lombiq.TrainingDemo/StartLearningHere.md @@ -53,6 +53,5 @@ This demo is heavily inspired by [Sipke Schoorstra's Orchard Harvest session](ht - [Middlewares](Middlewares/RequestLoggingMiddleware.cs) - [Accessing services from other tenants](Controllers/CrossTenantServicesController.cs) - [Unit and integration testing](Services/TestedService.cs) -- [Processing frontend assets using `npm scripts`](package.json) - [GraphQL](GraphQL/Startup.cs) - [Workflows](Activities/ManagePersonsPermissionCheckerTask.cs) diff --git a/Lombiq.TrainingDemo/package-lock.json b/Lombiq.TrainingDemo/package-lock.json deleted file mode 100644 index 04da2ff9..00000000 --- a/Lombiq.TrainingDemo/package-lock.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "Lombiq.TrainingDemo", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "dependencies": { - "pickr-widget": "0.3.6" - } - }, - "node_modules/pickr-widget": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/pickr-widget/-/pickr-widget-0.3.6.tgz", - "integrity": "sha512-aSvMgVICjTaGzODVOp/B0xHqL3tMRMsGvVHkXmnn7vPWSNUwMsPY3a6+Y4YkTsGzzu+OPSmXmnMdPCUBv63vVA==", - "deprecated": "Module has been moved to organization, use npm i @simonwep/pickr" - } - }, - "dependencies": { - "pickr-widget": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/pickr-widget/-/pickr-widget-0.3.6.tgz", - "integrity": "sha512-aSvMgVICjTaGzODVOp/B0xHqL3tMRMsGvVHkXmnn7vPWSNUwMsPY3a6+Y4YkTsGzzu+OPSmXmnMdPCUBv63vVA==" - } - } -} diff --git a/Lombiq.TrainingDemo/package.json b/Lombiq.TrainingDemo/package.json deleted file mode 100644 index 8528ca6b..00000000 --- a/Lombiq.TrainingDemo/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "description": "All frontend asset processing is done by Lombiq's Node.js Extensions (https://github.com/Lombiq/NodeJs-Extensions).", - "dependencies": { - "pickr-widget": "0.3.6" - }, - "private": true, - "scripts": { - "build": "npm explore nodejs-extensions -- pnpm build", - "clean": "npm explore nodejs-extensions -- pnpm clean", - "watch": "npm explore nodejs-extensions -- pnpm watch:styles" - }, - "nodejsExtensions": { - "assetsToCopy": [ - { - "sources": [ "Assets/Images" ], - "target": "wwwroot/images" - }, - { - "sources": [ "node_modules/pickr-widget/dist" ], - "pattern": "*", - "target": "wwwroot/pickr" - } - ] - }, - - "END OF TRAINING SECTION": "Processing frontend assets using npm scripts", - - "NEXT STATION": "GraphQL/Startup.cs" -} diff --git a/Lombiq.TrainingDemo/pnpm-lock.yaml b/Lombiq.TrainingDemo/pnpm-lock.yaml deleted file mode 100644 index b7f1f59d..00000000 --- a/Lombiq.TrainingDemo/pnpm-lock.yaml +++ /dev/null @@ -1,17 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -dependencies: - pickr-widget: - specifier: 0.3.6 - version: 0.3.6 - -packages: - - /pickr-widget@0.3.6: - resolution: {integrity: sha512-aSvMgVICjTaGzODVOp/B0xHqL3tMRMsGvVHkXmnn7vPWSNUwMsPY3a6+Y4YkTsGzzu+OPSmXmnMdPCUBv63vVA==} - deprecated: Module has been moved to organization, use npm i @simonwep/pickr - dev: false diff --git a/Lombiq.TrainingDemo/wwwroot/css/trainingdemo-colorpicker.css b/Lombiq.TrainingDemo/wwwroot/css/trainingdemo-colorpicker.css new file mode 100644 index 00000000..464d162b --- /dev/null +++ b/Lombiq.TrainingDemo/wwwroot/css/trainingdemo-colorpicker.css @@ -0,0 +1,3 @@ +.colorField .pickr { + margin-top: 12px; +} diff --git a/Lombiq.TrainingDemo/Assets/Styles/trainingdemo-filtered.scss b/Lombiq.TrainingDemo/wwwroot/css/trainingdemo-filtered.css similarity index 100% rename from Lombiq.TrainingDemo/Assets/Styles/trainingdemo-filtered.scss rename to Lombiq.TrainingDemo/wwwroot/css/trainingdemo-filtered.css diff --git a/Lombiq.TrainingDemo/Assets/Images/HarryPotter.jpg b/Lombiq.TrainingDemo/wwwroot/images/HarryPotter.jpg similarity index 100% rename from Lombiq.TrainingDemo/Assets/Images/HarryPotter.jpg rename to Lombiq.TrainingDemo/wwwroot/images/HarryPotter.jpg diff --git a/Lombiq.TrainingDemo/wwwroot/pickr/Readme.md b/Lombiq.TrainingDemo/wwwroot/pickr/Readme.md new file mode 100644 index 00000000..7c205bda --- /dev/null +++ b/Lombiq.TrainingDemo/wwwroot/pickr/Readme.md @@ -0,0 +1 @@ +Pickr is added here directly, not from NPM, to avoid having to set up Node.js. If this needs to be updated, download the latest package from . diff --git a/Lombiq.TrainingDemo/wwwroot/pickr/pickr.es5.min.js b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.es5.min.js new file mode 100644 index 00000000..e03f2aad --- /dev/null +++ b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.es5.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Pickr=e():t.Pickr=e()}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="dist/",n(n.s=1)}([function(t,e,n){},function(t,e,n){"use strict";n.r(e);var o={};n.r(o),n.d(o,"once",function(){return a}),n.d(o,"on",function(){return c}),n.d(o,"off",function(){return s}),n.d(o,"createElementFromString",function(){return l}),n.d(o,"removeAttribute",function(){return p}),n.d(o,"createFromTemplate",function(){return d}),n.d(o,"eventPath",function(){return h}),n.d(o,"adjustableInputNumbers",function(){return f});var r={};n.r(r),n.d(r,"hsvToRgb",function(){return b}),n.d(r,"hsvToHex",function(){return w}),n.d(r,"hsvToCmyk",function(){return _}),n.d(r,"hsvToHsl",function(){return k}),n.d(r,"parseToHSV",function(){return O});n(0);function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=function(t,e,n,o){return c(t,e,function t(){n.apply(this,arguments),this.removeEventListener(e,t)},o)},c=u.bind(null,"addEventListener"),s=u.bind(null,"removeEventListener");function u(t,e,n,o){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(n)||(n=[n]),e.forEach(function(e){return n.forEach(function(n){return e[t](n,o,function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o=p(e,"data-con"),r=p(e,"data-key");r&&(n[r]=e);for(var i=Array.from(e.children),a=o?n[o]={}:n,c=0;c1&&void 0!==arguments[1])||arguments[1],n=function(t){return t>="0"&&t<="9"||"-"===t||"."===t};function o(o){for(var r=t.value,i=t.selectionStart,a=i,c="",s=i-1;s>0&&n(r[s]);s--)c=r[s]+c,a--;for(var u=i,l=r.length;u0&&!isNaN(c)&&isFinite(c)){var p=o.deltaY<0?1:-1,d=o.ctrlKey?5*p:p,h=Number(c)+d;!e&&h<0&&(h=0);var f=r.substr(0,a)+h+r.substring(a+c.length,r.length),v=a+String(h).length;t.value=f,t.focus(),t.setSelectionRange(v,v)}o.preventDefault(),t.dispatchEvent(new Event("input"))}c(t,"focus",function(){return c(window,"wheel",o)}),c(t,"blur",function(){return s(window,"wheel",o)})}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],o=!0,r=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(o=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);o=!0);}catch(t){r=!0,i=t}finally{try{o||null==c.return||c.return()}finally{if(r)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function y(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&(o-=1)}return[360*o,100*r,100*a]}function C(t,e,n,o){return e/=100,n/=100,y(A(255*(1-g(1,(t/=100)*(1-(o/=100))+o)),255*(1-g(1,e*(1-o)+o)),255*(1-g(1,n*(1-o)+o))))}function S(t,e,n){return e/=100,[t,2*(e*=(n/=100)<.5?n:1-n)/(n+e)*100,100*(n+e)]}function x(t){return A.apply(void 0,y(t.match(/.{2}/g).map(function(t){return parseInt(t,16)})))}function O(t){var e,n={cmyk:/^cmyk[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)/i,rgba:/^(rgb|rgba)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsla:/^(hsl|hsla)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsva:/^(hsv|hsva)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hex:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=function(t){return t.map(function(t){return/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0})};for(var r in n)if(e=n[r].exec(t))switch(r){case"cmyk":var i=v(o(e),5),a=i[1],c=i[2],s=i[3],u=i[4];if(a>100||c>100||s>100||u>100)break;return{values:[].concat(y(C(a,c,s,u)),[1]),type:r};case"rgba":var l=v(o(e),6),p=l[2],d=l[3],h=l[4],f=l[5],g=void 0===f?1:f;if(p>255||d>255||h>255||g<0||g>1)break;return{values:[].concat(y(A(p,d,h)),[g]),type:r};case"hex":var m=function(t,e){return[t.substring(0,e),t.substring(e,t.length)]},b=v(e,2)[1];3===b.length?b+="F":6===b.length&&(b+="FF");var w=void 0;if(4===b.length){var _=v(m(b,3).map(function(t){return t+t}),2);b=_[0],w=_[1]}else if(8===b.length){var k=v(m(b,6),2);b=k[0],w=k[1]}return w=parseInt(w,16)/255,{values:[].concat(y(x(b)),[w]),type:r};case"hsla":var O=v(o(e),6),j=O[2],R=O[3],E=O[4],H=O[5],P=void 0===H?1:H;if(j>360||R>100||E>100||P<0||P>1)break;return{values:[].concat(y(S(j,R,E)),[P]),type:r};case"hsva":var B=v(o(e),6),L=B[2],D=B[3],F=B[4],T=B[5],M=void 0===T?1:T;if(L>360||D>100||F>100||M<0||M>1)break;return{values:[L,D,F,M],type:r}}return{values:null,type:null}}function j(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=Math.ceil,a={h:t,s:e,v:n,a:o,toHSVA:function(){var t=[a.h,a.s,a.v],e=t.map(i);return t.push(a.a),t.toString=function(){return"hsva(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%, ").concat(a.a.toFixed(1),")")},t},toHSLA:function(){var t=k(a.h,a.s,a.v),e=t.map(i);return t.push(a.a),t.toString=function(){return"hsla(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%, ").concat(a.a.toFixed(1),")")},t},toRGBA:function(){var t=b(a.h,a.s,a.v),e=t.map(i);return t.push(a.a),t.toString=function(){return"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(a.a.toFixed(1),")")},t},toCMYK:function(){var t=_(a.h,a.s,a.v),e=t.map(i);return t.toString=function(){return"cmyk(".concat(e[0],"%, ").concat(e[1],"%, ").concat(e[2],"%, ").concat(e[3],"%)")},t},toHEX:function(){var t=w.apply(r,[a.h,a.s,a.v]);return t.toString=function(){var e=a.a>=1?"":Number((255*a.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return"#".concat(t.join("").toUpperCase()+e)},t},clone:function(){return j(a.h,a.s,a.v,a.a)}};return a}function R(t){var e={options:Object.assign({lockX:!1,lockY:!1,onchange:function(){return 0}},t),_tapstart:function(t){c(document,["mouseup","touchend","touchcancel"],e._tapstop),c(document,["mousemove","touchmove"],e._tapmove),t.preventDefault(),e.wrapperRect=e.options.wrapper.getBoundingClientRect(),e._tapmove(t)},_tapmove:function(t){var n=e.options,o=e.cache,r=n.element,i=e.wrapperRect,a=0,c=0;if(t){var s=t&&t.touches&&t.touches[0];a=t?(s||t).clientX:0,c=t?(s||t).clientY:0,ai.left+i.width&&(a=i.left+i.width),ci.top+i.height&&(c=i.top+i.height),a-=i.left,c-=i.top}else o&&(a=o.x,c=o.y);n.lockX||(r.style.left=a-r.offsetWidth/2+"px"),n.lockY||(r.style.top=c-r.offsetHeight/2+"px"),e.cache={x:a,y:c},n.onchange(a,c)},_tapstop:function(){s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove)},trigger:function(){e.wrapperRect=e.options.wrapper.getBoundingClientRect(),e._tapmove()},update:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.wrapperRect=e.options.wrapper.getBoundingClientRect(),e._tapmove({clientX:e.wrapperRect.left+t,clientY:e.wrapperRect.top+n})},destroy:function(){var t=e.options,n=e._tapstart;s([t.wrapper,t.element],"mousedown",n),s([t.wrapper,t.element],"touchstart",n,{passive:!1})}};e.wrapperRect=e.options.wrapper.getBoundingClientRect();var n=e.options,o=e._tapstart;return c([n.wrapper,n.element],"mousedown",o),c([n.wrapper,n.element],"touchstart",o,{passive:!1}),e}function E(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={options:Object.assign({onchange:function(){return 0},className:"",elements:[]},t),_ontap:function(t){var n=e.options;n.elements.forEach(function(e){return e.classList[t.target===e?"add":"remove"](n.className)}),n.onchange(t)},destroy:function(){s(e.options.elements,"click",this._ontap)}};return c(e.options.elements,"click",e._ontap),e}function H(t,e,n){return(H=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var o=[null];o.push.apply(o,e);var r=new(Function.bind.apply(t,o));return n&&P(r,n.prototype),r}).apply(null,arguments)}function P(t,e){return(P=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function B(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n \n '.concat(o?"":'
','\n\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n \n ').concat(r&&r.length?'\n
\n '.concat(r.map(function(t,e){return'
')}).join(""),"\n
\n "):"",'\n\n
\n \n\n \n \n \n \n \n\n \n \n
\n
\n \n ")),(c=a.interaction).options.find(function(t){return!t.hidden&&!t.classList.add("active")}),c.type=function(){return c.options.find(function(t){return t.classList.contains("active")})},a),s.useAsButton&&(s.parent||(s.parent="body"),this._root.button=s.el),document.body.appendChild(this._root.root)}},{key:"_finalBuild",value:function(){var t=this.options,e=this._root;document.body.removeChild(e.root),t.parent&&("string"==typeof t.parent&&(t.parent=document.querySelector(t.parent)),t.parent.appendChild(e.app)),t.useAsButton||t.el.parentElement.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),t.showAlways?e.app.classList.add("visible"):this.hide()}},{key:"_buildComponents",value:function(){var t=this,e=this.options.components,n={palette:R({element:t._root.palette.picker,wrapper:t._root.palette.palette,onchange:function(e,n){var o=t._color,r=t._root,i=t.options;o.s=e/this.wrapper.offsetWidth*100,o.v=100-n/this.wrapper.offsetHeight*100,o.v<0&&(o.v=0);var a=o.toRGBA().toString();this.element.style.background=a,this.wrapper.style.background="\n linear-gradient(to top, rgba(0, 0, 0, ".concat(o.a,"), transparent), \n linear-gradient(to left, hsla(").concat(o.h,", 100%, 50%, ").concat(o.a,"), rgba(255, 255, 255, ").concat(o.a,"))\n "),i.comparison||(r.button.style.background=a,i.useAsButton||(r.preview.lastColor.style.background=a)),r.preview.currentColor.style.background=a,t._recalc&&t._updateOutput(),r.button.classList.remove("clear")}}),hue:R({lockX:!0,element:t._root.hue.picker,wrapper:t._root.hue.slider,onchange:function(o,r){e.hue&&(t._color.h=r/this.wrapper.offsetHeight*360,this.element.style.backgroundColor="hsl(".concat(t._color.h,", 100%, 50%)"),n.palette.trigger())}}),opacity:R({lockX:!0,element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onchange:function(n,o){e.opacity&&(t._color.a=Math.round(o/this.wrapper.offsetHeight*100)/100,this.element.style.background="rgba(0, 0, 0, ".concat(t._color.a,")"),t.components.palette.trigger())}}),selectable:E({elements:t._root.interaction.options,className:"active",onchange:function(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._updateOutput()}})};this.components=n}},{key:"_bindEvents",value:function(){var t=this,e=this._root,n=this.options,o=[c(e.interaction.clear,"click",function(){return t._clearColor()}),c(e.preview.lastColor,"click",function(){return t.setHSVA.apply(t,B(t._lastColor.toHSVA()))}),c(e.interaction.save,"click",function(){!t.applyColor()&&!n.showAlways&&t.hide()}),c(e.interaction.result,["keyup","input"],function(e){t._recalc=!1,t.setColor(e.target.value,!0)&&!t._initializingActive&&t.options.onChange(t._color,t),e.stopImmediatePropagation()}),c([e.palette.palette,e.palette.picker,e.hue.slider,e.hue.picker,e.opacity.slider,e.opacity.picker],["mousedown","touchstart"],function(){return t._recalc=!0}),c(window,"resize",function(){return t._rePositioningPicker})];if(e.swatches&&o.push(c(e.swatches,"click",function(e){var o=e.target,r=n.swatches[Number(o.getAttribute("data-color-index"))];r&&(t.setHSVA.apply(t,B(r.toHSVA()).concat([!0])),n.onSwatchSelect(r,t))})),!n.showAlways){var r=n.closeWithKey;o.push(c(e.button,"click",function(){return t.isOpen()?t.hide():t.show()}),c(document,"keyup",function(e){return t.isOpen()&&(e.key===r||e.code===r)&&t.hide()}),c(document,["touchstart","mousedown"],function(n){t.isOpen()&&!h(n).some(function(t){return t===e.app||t===e.button})&&t.hide()},{capture:!0}))}n.adjustableNumbers&&f(e.interaction.result,!1),this._eventBindings=o}},{key:"_rePositioningPicker",value:function(){var t=this._root,e=this._root.app;if(this.options.parent){var n=t.button.getBoundingClientRect();e.style.position="fixed",e.style.marginLeft="".concat(n.left,"px"),e.style.marginTop="".concat(n.top,"px")}var o=t.button.getBoundingClientRect(),r=e.getBoundingClientRect(),i=e.style;r.bottom>window.innerHeight?i.top="".concat(-r.height-5,"px"):o.bottom+r.heightwindow.innerWidth&&l-window.innerWidthwindow.innerWidth&&(s=a.left),i.left="".concat(s,"px")}},{key:"_updateOutput",value:function(){var t,e=this;this._root.interaction.type()&&(this._root.interaction.result.value=(t="to"+e._root.interaction.type().getAttribute("data-type"),"function"==typeof e._color[t]?e._color[t]().toString():"")),this._initializingActive||this.options.onChange(this._color,this)}},{key:"applyColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._root,n=e.preview,o=e.button,r=this._color.toRGBA().toString();n.lastColor.style.background=r,this.options.useAsButton||(o.style.background=r),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this.options.onSave(this._color,this)}},{key:"_clearColor",value:function(){var t=this._root,e=this.options;e.useAsButton||(t.button.style.background="rgba(255, 255, 255, 0.4)"),t.button.classList.add("clear"),e.showAlways||this.hide(),e.onChange(null,this)}},{key:"destroy",value:function(){var t=this;this._eventBindings.forEach(function(t){return s.apply(o,B(t))}),Object.keys(this.components).forEach(function(e){return t.components[e].destroy()})}},{key:"destroyAndRemove",value:function(){this.destroy();var t=this._root.root;t.parentElement.removeChild(t)}},{key:"hide",value:function(){return this._root.app.classList.remove("visible"),this}},{key:"show",value:function(){if(!this.options.disabled)return this._root.app.classList.add("visible"),this._rePositioningPicker(),this}},{key:"isOpen",value:function(){return this._root.app.classList.contains("visible")}},{key:"setHSVA",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:360,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||n<0||n>100||o<0||o>1)return!1;var a=this.components,c=a.hue,s=a.opacity,u=a.palette,l=c.options.wrapper.offsetHeight*(t/360);c.update(0,l);var p=s.options.wrapper.offsetHeight*o;s.update(0,p);var d=u.options.wrapper,h=d.offsetWidth*(e/100),f=d.offsetHeight*(1-n/100);return u.update(h,f),this._color=new j(t,e,n,o),this._recalc=i,this._recalc&&this._updateOutput(),r||this.applyColor(),!0}},{key:"setColor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(),!0;var n=O(t),o=n.values,r=n.type;if(o){var i=r.toUpperCase(),a=this._root.interaction.options,c=a.find(function(t){return t.getAttribute("data-type")===i});if(!c.hidden){var s=!0,u=!1,l=void 0;try{for(var p,d=a[Symbol.iterator]();!(s=(p=d.next()).done);s=!0){var h=p.value;h.classList[h===c?"add":"remove"]("active")}}catch(t){u=!0,l=t}finally{try{s||null==d.return||d.return()}finally{if(u)throw l}}}return this.setHSVA.apply(this,B(o).concat([e]))}}},{key:"setColorRepresentation",value:function(t){return t=t.toUpperCase(),!!this._root.interaction.options.find(function(e){return e.getAttribute("data-type")===t&&!e.click()})}},{key:"getColorRepresentation",value:function(){return this._representation}},{key:"getColor",value:function(){return this._color}},{key:"getRoot",value:function(){return this._root}},{key:"disable",value:function(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}},{key:"enable",value:function(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}])&&L(e.prototype,n),r&&L(e,r),t}();D.utils={once:a,on:c,off:s,eventPath:h,createElementFromString:l,adjustableInputNumbers:f,removeAttribute:p,createFromTemplate:d},D.create=function(t){return new D(t)},D.version="0.3.6";e.default=D}]).default}); +//# sourceMappingURL=pickr.es5.min.js.map \ No newline at end of file diff --git a/Lombiq.TrainingDemo/wwwroot/pickr/pickr.es5.min.js.map b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.es5.min.js.map new file mode 100644 index 00000000..adbe315e --- /dev/null +++ b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.es5.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./src/js/lib/utils.js","webpack:///./src/js/lib/color.js","webpack:///./src/js/lib/hsvacolor.js","webpack:///./src/js/helper/moveable.js","webpack:///./src/js/helper/selectable.js","webpack:///./src/js/pickr.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","once","element","event","fn","options","on","helper","apply","this","arguments","removeEventListener","eventListener","off","method","elements","events","length","undefined","HTMLCollection","NodeList","Array","from","isArray","forEach","el","ev","_objectSpread","capture","slice","createElementFromString","html","div","document","createElement","innerHTML","trim","firstElementChild","removeAttribute","getAttribute","createFromTemplate","str","resolve","base","con","children","subtree","_i","child","arr","push","eventPath","evt","path","composedPath","target","parentElement","adjustableInputNumbers","negative","isNumChar","handleScroll","e","val","selectionStart","numStart","num","isNaN","isFinite","mul","deltaY","inc","ctrlKey","newNum","Number","newStr","substr","substring","curPos","String","focus","setSelectionRange","preventDefault","dispatchEvent","Event","min","Math","max","hsvToRgb","h","v","floor","f","q","mod","hsvToHex","map","round","toString","padStart","hsvToCmyk","k","rgb","g","b","hsvToHsl","rgbToHsv","minVal","maxVal","delta","dr","dg","db","cmykToHsv","y","_toConsumableArray","hslToHsv","hexToHsv","hex","match","parseInt","parseToHSV","regex","cmyk","rgba","hsla","hsva","numarize","array","test","type","exec","_numarize2","_slicedToArray","values","concat","_numarize4","_numarize4$","a","splitAt","alpha","_splitAt$map2","_splitAt2","_numarize6","_numarize6$","_numarize8","_numarize8$","HSVaColor","ceil","that","toHSVA","rhsva","toFixed","toHSLA","Color","rhsla","toRGBA","rrgba","toCMYK","rcmyk","toHEX","toUpperCase","join","clone","Moveable","opt","assign","lockX","lockY","onchange","_tapstart","_","_tapstop","_tapmove","wrapperRect","wrapper","getBoundingClientRect","cache","x","touch","touches","clientX","clientY","left","width","top","height","style","offsetWidth","offsetHeight","trigger","update","destroy","passive","Selectable","className","_ontap","classList","Pickr","_classCallCheck","useAsButton","disabled","comparison","components","interaction","strings","swatches","default","defaultRepresentation","position","adjustableNumbers","showAlways","parent","closeWithKey","onChange","onSave","onSwatchSelect","_initializingActive","_recalc","_color","_lastColor","_construct","pickr_toConsumableArray","filter","_preBuild","_buildComponents","_bindEvents","_representation","setColorRepresentation","_finalBuild","_rePositioningPicker","requestAnimationFrame","cb","_root","app","offsetParent","setColor","hidden","int","querySelector","preview","hue","opacity","keys","input","save","clear","find","add","contains","button","body","appendChild","removeChild","replaceChild","disable","transition","lastColor","hide","inst","comp","palette","picker","cssRGBaString","background","currentColor","_updateOutput","remove","slider","backgroundColor","selectable","_this","eventBindings","_clearColor","setHSVA","applyColor","result","stopImmediatePropagation","_ref","color","ck","isOpen","show","code","some","_eventBindings","relative","marginLeft","marginTop","bb","ab","as","bottom","innerHeight","pos","middle","right","cl","getComputedStyle","newLeft","leftClip","rightClip","innerWidth","_this2","silent","_this$_root","_this3","args","recalc","_this$components","hueY","opacityY","pickerWrapper","pickerX","pickerY","string","_Color$parseToHSV2","utype","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","next","done","err","return","click","utils","version"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAA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,IAAIgM,EAAMhM,IAGtCgM,EAAMoI,QAAU,QACDpI","file":"pickr.es5.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Pickr\"] = factory();\n\telse\n\t\troot[\"Pickr\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","/**\r\n * Add an eventlistener which will be fired only once.\r\n *\r\n * @param element Target element\r\n * @param event Event name\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const once = (element, event, fn, options) => on(element, event, function helper() {\r\n fn.apply(this, arguments);\r\n this.removeEventListener(event, helper);\r\n}, options);\r\n\r\n/**\r\n * Add event(s) to element(s).\r\n * @param elements DOM-Elements\r\n * @param events Event names\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const on = eventListener.bind(null, 'addEventListener');\r\n\r\n/**\r\n * Remove event(s) from element(s).\r\n * @param elements DOM-Elements\r\n * @param events Event names\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const off = eventListener.bind(null, 'removeEventListener');\r\n\r\nfunction eventListener(method, elements, events, fn, options = {}) {\r\n\r\n // Normalize array\r\n if (elements instanceof HTMLCollection || elements instanceof NodeList) {\r\n elements = Array.from(elements);\r\n } else if (!Array.isArray(elements)) {\r\n elements = [elements];\r\n }\r\n\r\n if (!Array.isArray(events)) {\r\n events = [events];\r\n }\r\n\r\n elements.forEach(el =>\r\n events.forEach(ev =>\r\n el[method](ev, fn, {capture: false, ...options})\r\n )\r\n );\r\n\r\n return Array.prototype.slice.call(arguments, 1);\r\n}\r\n\r\n/**\r\n * Creates an DOM-Element out of a string (Single element).\r\n * @param html HTML representing a single element\r\n * @returns {Element | null} The element.\r\n */\r\nexport function createElementFromString(html) {\r\n const div = document.createElement('div');\r\n div.innerHTML = html.trim();\r\n return div.firstElementChild;\r\n}\r\n\r\n/**\r\n * Removes an attribute from a HTMLElement and returns the value.\r\n * @param el\r\n * @param name\r\n * @return {string}\r\n */\r\nexport function removeAttribute(el, name) {\r\n const value = el.getAttribute(name);\r\n el.removeAttribute(name);\r\n return value;\r\n}\r\n\r\n/**\r\n * Creates a new html element, every element which has\r\n * a 'data-key' attribute will be saved in a object (which will be returned)\r\n * where the value of 'data-key' ist the object-key and the value the HTMLElement.\r\n *\r\n * It's possible to create a hierarchy if you add a 'data-con' attribute. Every\r\n * sibling will be added to the object which will get the name from the 'data-con' attribute.\r\n *\r\n * If you want to create an Array out of multiple elements, you can use the 'data-arr' attribute,\r\n * the value defines the key and all elements, which has the same parent and the same 'data-arr' attribute,\r\n * would be added to it.\r\n *\r\n * @param str - The HTML String.\r\n */\r\nexport function createFromTemplate(str) {\r\n\r\n // Recursive function to resolve template\r\n function resolve(element, base = {}) {\r\n\r\n // Check key and container attribute\r\n const con = removeAttribute(element, 'data-con');\r\n const key = removeAttribute(element, 'data-key');\r\n\r\n // Check and save element\r\n if (key) {\r\n base[key] = element;\r\n }\r\n\r\n // Check all children\r\n const children = Array.from(element.children);\r\n const subtree = con ? (base[con] = {}) : base;\r\n for (let child of children) {\r\n\r\n // Check if element should be saved as array\r\n const arr = removeAttribute(child, 'data-arr');\r\n if (arr) {\r\n\r\n // Check if there is already an array and add element\r\n (subtree[arr] || (subtree[arr] = [])).push(child);\r\n } else {\r\n resolve(child, subtree);\r\n }\r\n }\r\n\r\n return base;\r\n }\r\n\r\n return resolve(createElementFromString(str));\r\n}\r\n\r\n/**\r\n * Polyfill for safari & firefox for the eventPath event property.\r\n * @param evt The event object.\r\n * @return [String] event path.\r\n */\r\nexport function eventPath(evt) {\r\n let path = evt.path || (evt.composedPath && evt.composedPath());\r\n if (path) return path;\r\n\r\n let el = evt.target.parentElement;\r\n path = [evt.target, el];\r\n while (el = el.parentElement) path.push(el);\r\n\r\n path.push(document, window);\r\n return path;\r\n}\r\n\r\n/**\r\n * Creates the ability to change numbers in an input field with the scroll-wheel.\r\n * @param el\r\n * @param negative\r\n */\r\nexport function adjustableInputNumbers(el, negative = true) {\r\n\r\n // Check if a char represents a number\r\n const isNumChar = c => (c >= '0' && c <= '9') || c === '-' || c === '.';\r\n\r\n function handleScroll(e) {\r\n const val = el.value;\r\n const off = el.selectionStart;\r\n let numStart = off;\r\n let num = ''; // Will be the number as string\r\n\r\n // Look back\r\n for (let i = off - 1; i > 0 && isNumChar(val[i]); i--) {\r\n num = val[i] + num;\r\n numStart--; // Find start of number\r\n }\r\n\r\n // Look forward\r\n for (let i = off, n = val.length; i < n && isNumChar(val[i]); i++) {\r\n num += val[i];\r\n }\r\n\r\n // Check if number is valid\r\n if (num.length > 0 && !isNaN(num) && isFinite(num)) {\r\n\r\n const mul = e.deltaY < 0 ? 1 : -1;\r\n const inc = e.ctrlKey ? mul * 5 : mul;\r\n let newNum = Number(num) + inc;\r\n\r\n if (!negative && newNum < 0) {\r\n newNum = 0;\r\n }\r\n\r\n const newStr = val.substr(0, numStart) + newNum + val.substring(numStart + num.length, val.length);\r\n const curPos = numStart + String(newNum).length;\r\n\r\n // Update value and set cursor\r\n el.value = newStr;\r\n el.focus();\r\n el.setSelectionRange(curPos, curPos);\r\n }\r\n\r\n // Prevent default\r\n e.preventDefault();\r\n\r\n // Trigger input event\r\n el.dispatchEvent(new Event('input'));\r\n }\r\n\r\n // Bind events\r\n on(el, 'focus', () => on(window, 'wheel', handleScroll));\r\n on(el, 'blur', () => off(window, 'wheel', handleScroll));\r\n}","// Shorthands\r\nconst min = Math.min,\r\n max = Math.max;\r\n\r\n/**\r\n * Convert HSV spectrum to RGB.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} Array with rgb values.\r\n */\r\nexport function hsvToRgb(h, s, v) {\r\n h = (h / 360) * 6;\r\n s /= 100;\r\n v /= 100;\r\n\r\n let i = Math.floor(h);\r\n\r\n let f = h - i;\r\n let p = v * (1 - s);\r\n let q = v * (1 - f * s);\r\n let t = v * (1 - (1 - f) * s);\r\n\r\n let mod = i % 6;\r\n let r = [v, q, p, p, t, v][mod];\r\n let g = [t, v, v, q, p, p][mod];\r\n let b = [p, p, t, v, v, q][mod];\r\n\r\n return [\r\n r * 255,\r\n g * 255,\r\n b * 255\r\n ];\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to Hex.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {string[]} Hex values\r\n */\r\nexport function hsvToHex(h, s, v) {\r\n return hsvToRgb(h, s, v).map(v => Math.round(v).toString(16).padStart(2, '0'));\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to CMYK.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} CMYK values\r\n */\r\nexport function hsvToCmyk(h, s, v) {\r\n const rgb = hsvToRgb(h, s, v);\r\n const r = rgb[0] / 255;\r\n const g = rgb[1] / 255;\r\n const b = rgb[2] / 255;\r\n\r\n let k, c, m, y;\r\n\r\n k = min(1 - r, 1 - g, 1 - b);\r\n\r\n c = k === 1 ? 0 : (1 - r - k) / (1 - k);\r\n m = k === 1 ? 0 : (1 - g - k) / (1 - k);\r\n y = k === 1 ? 0 : (1 - b - k) / (1 - k);\r\n\r\n return [\r\n c * 100,\r\n m * 100,\r\n y * 100,\r\n k * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to HSL.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} HSL values\r\n */\r\nexport function hsvToHsl(h, s, v) {\r\n s /= 100, v /= 100;\r\n\r\n let l = (2 - s) * v / 2;\r\n\r\n if (l !== 0) {\r\n if (l === 1) {\r\n s = 0;\r\n } else if (l < 0.5) {\r\n s = s * v / (l * 2);\r\n } else {\r\n s = s * v / (2 - l * 2);\r\n }\r\n }\r\n\r\n return [\r\n h,\r\n s * 100,\r\n l * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert RGB to HSV.\r\n * @param r Red\r\n * @param g Green\r\n * @param b Blue\r\n * @return {number[]} HSV values.\r\n */\r\nfunction rgbToHsv(r, g, b) {\r\n r /= 255, g /= 255, b /= 255;\r\n\r\n let h, s, v;\r\n const minVal = min(r, g, b);\r\n const maxVal = max(r, g, b);\r\n const delta = maxVal - minVal;\r\n\r\n v = maxVal;\r\n if (delta === 0) {\r\n h = s = 0;\r\n } else {\r\n s = delta / maxVal;\r\n let dr = (((maxVal - r) / 6) + (delta / 2)) / delta;\r\n let dg = (((maxVal - g) / 6) + (delta / 2)) / delta;\r\n let db = (((maxVal - b) / 6) + (delta / 2)) / delta;\r\n\r\n if (r === maxVal) {\r\n h = db - dg;\r\n } else if (g === maxVal) {\r\n h = (1 / 3) + dr - db;\r\n } else if (b === maxVal) {\r\n h = (2 / 3) + dg - dr;\r\n }\r\n\r\n if (h < 0) {\r\n h += 1;\r\n } else if (h > 1) {\r\n h -= 1;\r\n }\r\n }\r\n\r\n return [\r\n h * 360,\r\n s * 100,\r\n v * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert CMYK to HSV.\r\n * @param c Cyan\r\n * @param m Magenta\r\n * @param y Yellow\r\n * @param k Key (Black)\r\n * @return {number[]} HSV values.\r\n */\r\nfunction cmykToHsv(c, m, y, k) {\r\n c /= 100, m /= 100, y /= 100, k /= 100;\r\n\r\n const r = (1 - min(1, c * (1 - k) + k)) * 255;\r\n const g = (1 - min(1, m * (1 - k) + k)) * 255;\r\n const b = (1 - min(1, y * (1 - k) + k)) * 255;\r\n\r\n return [...rgbToHsv(r, g, b)];\r\n}\r\n\r\n/**\r\n * Convert HSL to HSV.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param l Lightness\r\n * @return {number[]} HSV values.\r\n */\r\nfunction hslToHsv(h, s, l) {\r\n s /= 100, l /= 100;\r\n s *= l < 0.5 ? l : 1 - l;\r\n\r\n let ns = (2 * s / (l + s)) * 100;\r\n let v = (l + s) * 100;\r\n return [h, ns, v];\r\n}\r\n\r\n/**\r\n * Convert HEX to HSV.\r\n * @param hex Hexadecimal string of rgb colors, can have length 3 or 6.\r\n * @return {number[]} HSV values.\r\n */\r\nfunction hexToHsv(hex) {\r\n return rgbToHsv(...hex.match(/.{2}/g).map(v => parseInt(v, 16)));\r\n}\r\n\r\n/**\r\n * Try's to parse a string which represents a color to a HSV array.\r\n * Current supported types are cmyk, rgba, hsla and hexadecimal.\r\n * @param str\r\n * @return {*}\r\n */\r\nexport function parseToHSV(str) {\r\n\r\n // Regular expressions to match different types of color represention\r\n const regex = {\r\n cmyk: /^cmyk[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)/i,\r\n rgba: /^(rgb|rgba)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hsla: /^(hsl|hsla)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hsva: /^(hsv|hsva)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hex: /^#?(([\\dA-Fa-f]{3,4})|([\\dA-Fa-f]{6})|([\\dA-Fa-f]{8}))$/i\r\n };\r\n\r\n /**\r\n * Takes an Array of any type, convert strings which represents\r\n * a number to a number an anything else to undefined.\r\n * @param array\r\n * @return {*}\r\n */\r\n const numarize = array => array.map(v => /^(|\\d+)\\.\\d+|\\d+$/.test(v) ? Number(v) : undefined);\r\n\r\n let match;\r\n for (let type in regex) {\r\n\r\n // Check if current scheme passed\r\n if (!(match = regex[type].exec(str)))\r\n continue;\r\n\r\n // Try to convert\r\n switch (type) {\r\n case 'cmyk': {\r\n let [, c, m, y, k] = numarize(match);\r\n\r\n if (c > 100 || m > 100 || y > 100 || k > 100)\r\n break;\r\n\r\n return {values: [...cmykToHsv(c, m, y, k), 1], type};\r\n }\r\n case 'rgba': {\r\n let [, , r, g, b, a = 1] = numarize(match);\r\n\r\n if (r > 255 || g > 255 || b > 255 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [...rgbToHsv(r, g, b), a], type};\r\n }\r\n case 'hex': {\r\n const splitAt = (s, i) => [s.substring(0, i), s.substring(i, s.length)];\r\n let [, hex] = match;\r\n\r\n // Fill up opacity if not declared\r\n if (hex.length === 3) {\r\n hex += 'F';\r\n } else if (hex.length === 6) {\r\n hex += 'FF';\r\n }\r\n\r\n let alpha;\r\n if (hex.length === 4) {\r\n [hex, alpha] = splitAt(hex, 3).map(v => v + v);\r\n } else if (hex.length === 8) {\r\n [hex, alpha] = splitAt(hex, 6);\r\n }\r\n\r\n // Convert 0 - 255 to 0 - 1 for opacity\r\n alpha = parseInt(alpha, 16) / 255;\r\n return {values: [...hexToHsv(hex), alpha], type};\r\n }\r\n case 'hsla': {\r\n let [, , h, s, l, a = 1] = numarize(match);\r\n\r\n if (h > 360 || s > 100 || l > 100 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [...hslToHsv(h, s, l), a], type};\r\n }\r\n case 'hsva': {\r\n let [, , h, s, v, a = 1] = numarize(match);\r\n\r\n if (h > 360 || s > 100 || v > 100 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [h, s, v, a], type};\r\n }\r\n }\r\n }\r\n\r\n return {values: null, type: null};\r\n}","import * as Color from './color';\r\n\r\n/**\r\n * Simple class which holds the properties\r\n * of the color represention model hsla (hue saturation lightness alpha)\r\n */\r\nexport function HSVaColor(h = 0, s = 0, v = 0, a = 1) {\r\n\r\n const ceil = Math.ceil;\r\n const that = {\r\n h, s, v, a,\r\n\r\n toHSVA() {\r\n const hsva = [that.h, that.s, that.v];\r\n const rhsva = hsva.map(ceil);\r\n\r\n hsva.push(that.a);\r\n hsva.toString = () => `hsva(${rhsva[0]}, ${rhsva[1]}%, ${rhsva[2]}%, ${that.a.toFixed(1)})`;\r\n return hsva;\r\n },\r\n\r\n toHSLA() {\r\n const hsla = Color.hsvToHsl(that.h, that.s, that.v);\r\n const rhsla = hsla.map(ceil);\r\n\r\n hsla.push(that.a);\r\n hsla.toString = () => `hsla(${rhsla[0]}, ${rhsla[1]}%, ${rhsla[2]}%, ${that.a.toFixed(1)})`;\r\n return hsla;\r\n },\r\n\r\n toRGBA() {\r\n const rgba = Color.hsvToRgb(that.h, that.s, that.v);\r\n const rrgba = rgba.map(ceil);\r\n\r\n rgba.push(that.a);\r\n rgba.toString = () => `rgba(${rrgba[0]}, ${rrgba[1]}, ${rrgba[2]}, ${that.a.toFixed(1)})`;\r\n return rgba;\r\n },\r\n\r\n toCMYK() {\r\n const cmyk = Color.hsvToCmyk(that.h, that.s, that.v);\r\n const rcmyk = cmyk.map(ceil);\r\n\r\n cmyk.toString = () => `cmyk(${rcmyk[0]}%, ${rcmyk[1]}%, ${rcmyk[2]}%, ${rcmyk[3]}%)`;\r\n return cmyk;\r\n },\r\n\r\n toHEX() {\r\n const hex = Color.hsvToHex(...[that.h, that.s, that.v]);\r\n\r\n hex.toString = () => {\r\n\r\n // Check if alpha channel make sense, convert it to 255 number space, convert\r\n // to hex and pad it with zeros if needet.\r\n const alpha = that.a >= 1 ? '' : Number((that.a * 255).toFixed(0))\r\n .toString(16)\r\n .toUpperCase()\r\n .padStart(2, '0');\r\n\r\n return `#${hex.join('').toUpperCase() + alpha}`;\r\n };\r\n\r\n return hex;\r\n },\r\n\r\n clone() {\r\n return HSVaColor(that.h, that.s, that.v, that.a);\r\n }\r\n };\r\n\r\n return that;\r\n}\r\n","import * as _ from './../lib/utils';\r\n\r\nexport default function Moveable(opt) {\r\n\r\n const that = {\r\n\r\n // Assign default values\r\n options: Object.assign({\r\n lockX: false,\r\n lockY: false,\r\n onchange: () => 0\r\n }, opt),\r\n\r\n _tapstart(evt) {\r\n _.on(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.on(document, ['mousemove', 'touchmove'], that._tapmove);\r\n\r\n // Prevent default touch event\r\n evt.preventDefault();\r\n that.wrapperRect = that.options.wrapper.getBoundingClientRect();\r\n\r\n // Trigger\r\n that._tapmove(evt);\r\n },\r\n\r\n _tapmove(evt) {\r\n const {options, cache} = that;\r\n const {element} = options;\r\n const b = that.wrapperRect;\r\n\r\n let x = 0, y = 0;\r\n if (evt) {\r\n const touch = evt && evt.touches && evt.touches[0];\r\n x = evt ? (touch || evt).clientX : 0;\r\n y = evt ? (touch || evt).clientY : 0;\r\n\r\n // Reset to bounds\r\n if (x < b.left) x = b.left;\r\n else if (x > b.left + b.width) x = b.left + b.width;\r\n if (y < b.top) y = b.top;\r\n else if (y > b.top + b.height) y = b.top + b.height;\r\n\r\n // Normalize\r\n x -= b.left;\r\n y -= b.top;\r\n } else if (cache) {\r\n x = cache.x;\r\n y = cache.y;\r\n }\r\n\r\n if (!options.lockX)\r\n element.style.left = (x - element.offsetWidth / 2) + 'px';\r\n\r\n if (!options.lockY)\r\n element.style.top = (y - element.offsetHeight / 2) + 'px';\r\n\r\n that.cache = {x, y};\r\n options.onchange(x, y);\r\n },\r\n\r\n _tapstop() {\r\n _.off(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.off(document, ['mousemove', 'touchmove'], that._tapmove);\r\n },\r\n\r\n trigger() {\r\n that.wrapperRect = that.options.wrapper.getBoundingClientRect();\r\n that._tapmove();\r\n },\r\n\r\n update(x = 0, y = 0) {\r\n that.wrapperRect = that.options.wrapper.getBoundingClientRect();\r\n that._tapmove({\r\n clientX: that.wrapperRect.left + x,\r\n clientY: that.wrapperRect.top + y\r\n });\r\n },\r\n\r\n destroy() {\r\n const {options, _tapstart} = that;\r\n _.off([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.off([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n }\r\n };\r\n\r\n // Instance var\r\n that.wrapperRect = that.options.wrapper.getBoundingClientRect();\r\n\r\n // Initilize\r\n const {options, _tapstart} = that;\r\n _.on([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.on([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n\r\n return that;\r\n}","import * as _ from './../lib/utils';\r\n\r\nexport default function Selectable(opt = {}) {\r\n const that = {\r\n\r\n // Assign default values\r\n options: Object.assign({\r\n onchange: () => 0,\r\n className: '',\r\n elements: []\r\n }, opt),\r\n\r\n _ontap(evt) {\r\n const opt = that.options;\r\n opt.elements.forEach(e =>\r\n e.classList[evt.target === e ? 'add' : 'remove'](opt.className)\r\n );\r\n\r\n opt.onchange(evt);\r\n },\r\n\r\n destroy() {\r\n _.off(that.options.elements, 'click', this._ontap);\r\n }\r\n };\r\n\r\n _.on(that.options.elements, 'click', that._ontap);\r\n return that;\r\n}","// Import styles\nimport '../scss/pickr.scss';\n\n// Import utils\nimport * as _ from './lib/utils';\nimport * as Color from './lib/color';\n\n// Import classes\nimport {HSVaColor} from './lib/hsvacolor';\nimport Moveable from './helper/moveable';\nimport Selectable from './helper/selectable';\n\nclass Pickr {\n\n constructor(opt) {\n\n // Assign default values\n this.options = Object.assign({\n useAsButton: false,\n disabled: false,\n comparison: true,\n\n components: {interaction: {}},\n strings: {},\n\n swatches: null,\n\n default: 'fff',\n defaultRepresentation: 'HEX',\n position: 'middle',\n adjustableNumbers: true,\n showAlways: false,\n parent: undefined,\n\n closeWithKey: 'Escape',\n onChange: () => 0,\n onSave: () => 0,\n onSwatchSelect: () => 0\n }, opt);\n\n // Check interaction section\n if (!this.options.components.interaction) {\n this.options.components.interaction = {};\n }\n\n // Will be used to prevent specific actions during initilization\n this._initializingActive = true;\n\n // Replace element with color picker\n this._recalc = true;\n\n // Current and last color for comparison\n this._color = new HSVaColor();\n this._lastColor = new HSVaColor();\n\n // Parse swatch colors\n this.options.swatches = this.options.swatches || [];\n if (this.options.swatches) {\n this.options.swatches = this.options.swatches.map(str => {\n const {values} = Color.parseToHSV(str);\n return values && new HSVaColor(...values);\n }).filter(v => v);\n }\n\n // Initialize picker\n this._preBuild();\n this._buildComponents();\n this._bindEvents();\n\n // Initialize color _epresentation\n this._representation = this.options.defaultRepresentation;\n this.setColorRepresentation(this._representation);\n\n // Finalize build\n this._finalBuild();\n this._rePositioningPicker();\n\n // Initilization is finish, pickr is visible and ready for usage\n requestAnimationFrame((function cb() {\n if (!this._root.app.offsetParent) {\n return requestAnimationFrame(cb.bind(this));\n }\n\n this._initializingActive = false;\n this.setColor(this.options.default);\n }).bind(this));\n }\n\n // Does only the absolutly basic thing to initialize the components\n _preBuild() {\n const opt = this.options;\n\n // Check if element is selector\n if (typeof opt.el === 'string') {\n opt.el = document.querySelector(opt.el);\n }\n\n // Create element and append it to body to\n // prevent initialization errors\n this._root = create(opt);\n\n // Check if a custom button is used\n if (opt.useAsButton) {\n\n // Check if the user has an alternative location defined, used body as fallback\n if (!opt.parent) {\n opt.parent = 'body';\n }\n\n this._root.button = opt.el; // Replace button with customized button\n }\n\n document.body.appendChild(this._root.root);\n }\n\n _finalBuild() {\n const opt = this.options;\n const root = this._root;\n\n // Remove from body\n document.body.removeChild(root.root);\n\n // Check parent option\n if (opt.parent) {\n\n // Check if element is selector\n if (typeof opt.parent === 'string') {\n opt.parent = document.querySelector(opt.parent);\n }\n\n opt.parent.appendChild(root.app);\n }\n\n // Don't replace the the element if a custom button is used\n if (!opt.useAsButton) {\n\n // Replace element with actual color-picker\n opt.el.parentElement.replaceChild(root.root, opt.el);\n }\n\n // Call disable to also add the disabled class\n if (opt.disabled) {\n this.disable();\n }\n\n // Check if color comparison is disabled, if yes - remove transitions so everything keeps smoothly\n if (!opt.comparison) {\n root.button.style.transition = 'none';\n if (!opt.useAsButton) {\n root.preview.lastColor.style.transition = 'none';\n }\n }\n\n // Check showAlways option\n opt.showAlways ? root.app.classList.add('visible') : this.hide();\n }\n\n _buildComponents() {\n\n // Instance reference\n const inst = this;\n const comp = this.options.components;\n\n const components = {\n\n palette: Moveable({\n element: inst._root.palette.picker,\n wrapper: inst._root.palette.palette,\n\n onchange(x, y) {\n const {_color, _root, options} = inst;\n\n // Calculate saturation based on the position\n _color.s = (x / this.wrapper.offsetWidth) * 100;\n\n // Calculate the value\n _color.v = 100 - (y / this.wrapper.offsetHeight) * 100;\n\n // Prevent falling under zero\n _color.v < 0 ? _color.v = 0 : 0;\n\n // Set picker and gradient color\n const cssRGBaString = _color.toRGBA().toString();\n this.element.style.background = cssRGBaString;\n this.wrapper.style.background = `\n linear-gradient(to top, rgba(0, 0, 0, ${_color.a}), transparent), \n linear-gradient(to left, hsla(${_color.h}, 100%, 50%, ${_color.a}), rgba(255, 255, 255, ${_color.a}))\n `;\n\n // Check if color is locked\n if (!options.comparison) {\n _root.button.style.background = cssRGBaString;\n\n if (!options.useAsButton) {\n _root.preview.lastColor.style.background = cssRGBaString;\n }\n }\n\n // Change current color\n _root.preview.currentColor.style.background = cssRGBaString;\n\n // Update the input field only if the user is currently not typing\n if (inst._recalc) {\n inst._updateOutput();\n }\n\n // If the user changes the color, remove the cleared icon\n _root.button.classList.remove('clear');\n }\n }),\n\n hue: Moveable({\n lockX: true,\n element: inst._root.hue.picker,\n wrapper: inst._root.hue.slider,\n\n onchange(x, y) {\n if (!comp.hue) return;\n\n // Calculate hue\n inst._color.h = (y / this.wrapper.offsetHeight) * 360;\n\n // Update color\n this.element.style.backgroundColor = `hsl(${inst._color.h}, 100%, 50%)`;\n components.palette.trigger();\n }\n }),\n\n opacity: Moveable({\n lockX: true,\n element: inst._root.opacity.picker,\n wrapper: inst._root.opacity.slider,\n\n onchange(x, y) {\n if (!comp.opacity) return;\n\n // Calculate opacity\n inst._color.a = Math.round(((y / this.wrapper.offsetHeight)) * 1e2) / 100;\n\n // Update color\n this.element.style.background = `rgba(0, 0, 0, ${inst._color.a})`;\n inst.components.palette.trigger();\n }\n }),\n\n selectable: Selectable({\n elements: inst._root.interaction.options,\n className: 'active',\n onchange(e) {\n inst._representation = e.target.getAttribute('data-type').toUpperCase();\n inst._updateOutput();\n }\n })\n };\n\n this.components = components;\n }\n\n _bindEvents() {\n const {_root, options} = this;\n\n const eventBindings = [\n\n // Clear color\n _.on(_root.interaction.clear, 'click', () => this._clearColor()),\n\n // Select last color on click\n _.on(_root.preview.lastColor, 'click', () => this.setHSVA(...this._lastColor.toHSVA())),\n\n // Save color\n _.on(_root.interaction.save, 'click', () => {\n !this.applyColor() && !options.showAlways && this.hide();\n }),\n\n // Detect user input and disable auto-recalculation\n _.on(_root.interaction.result, ['keyup', 'input'], e => {\n this._recalc = false;\n\n // Fire listener if initialization is finish and changed color was valid\n if (this.setColor(e.target.value, true) && !this._initializingActive) {\n this.options.onChange(this._color, this);\n }\n\n e.stopImmediatePropagation();\n }),\n\n // Cancel input detection on color change\n _.on([\n _root.palette.palette,\n _root.palette.picker,\n _root.hue.slider,\n _root.hue.picker,\n _root.opacity.slider,\n _root.opacity.picker\n ], ['mousedown', 'touchstart'], () => this._recalc = true),\n\n // Repositioning on resize\n _.on(window, 'resize', () => this._rePositioningPicker)\n ];\n\n // Color swatches\n if (_root.swatches) {\n eventBindings.push(\n _.on(_root.swatches, 'click', ({target}) => {\n const color = options.swatches[Number(target.getAttribute('data-color-index'))];\n\n if (color) {\n this.setHSVA(...color.toHSVA(), true);\n\n // Fire event\n options.onSwatchSelect(color, this);\n }\n })\n );\n }\n\n // Provide hiding / showing abilities only if showAlways is false\n if (!options.showAlways) {\n const ck = options.closeWithKey;\n\n eventBindings.push(\n // Save and hide / show picker\n _.on(_root.button, 'click', () => this.isOpen() ? this.hide() : this.show()),\n\n // Close with escape key\n _.on(document, 'keyup', e => this.isOpen() && (e.key === ck || e.code === ck) && this.hide()),\n\n // Cancel selecting if the user taps behind the color picker\n _.on(document, ['touchstart', 'mousedown'], e => {\n if (this.isOpen() && !_.eventPath(e).some(el => el === _root.app || el === _root.button)) {\n this.hide();\n }\n }, {capture: true})\n );\n }\n\n // Make input adjustable if enabled\n if (options.adjustableNumbers) {\n _.adjustableInputNumbers(_root.interaction.result, false);\n }\n\n // Save bindings\n this._eventBindings = eventBindings;\n }\n\n _rePositioningPicker() {\n const root = this._root;\n const app = this._root.app;\n\n // Check if user has defined a parent\n if (this.options.parent) {\n const relative = root.button.getBoundingClientRect();\n app.style.position = 'fixed';\n app.style.marginLeft = `${relative.left}px`;\n app.style.marginTop = `${relative.top}px`;\n }\n\n const bb = root.button.getBoundingClientRect();\n const ab = app.getBoundingClientRect();\n const as = app.style;\n\n // Check if picker is cuttet of from the top & bottom\n if (ab.bottom > window.innerHeight) {\n as.top = `${-(ab.height) - 5}px`;\n } else if (bb.bottom + ab.height < window.innerHeight) {\n as.top = `${bb.height + 5}px`;\n }\n\n // Positioning picker on the x-axis\n const pos = {\n left: -(ab.width) + bb.width,\n middle: -(ab.width / 2) + bb.width / 2,\n right: 0\n };\n\n const cl = parseInt(getComputedStyle(app).left, 10);\n let newLeft = pos[this.options.position];\n const leftClip = (ab.left - cl) + newLeft;\n const rightClip = (ab.left - cl) + newLeft + ab.width;\n\n /**\n * First check if position is left or right but\n * pickr-app cannot set to left AND right because it would\n * be clipped by the browser width. If so, wrap it and position\n * pickr below button via the pos[middle] value.\n * The current selected posiotion should'nt be the middle.di\n */\n if (this.options.position !== 'middle' && (\n (leftClip < 0 && -leftClip < ab.width / 2) ||\n (rightClip > window.innerWidth && rightClip - window.innerWidth < ab.width / 2))) {\n newLeft = pos['middle'];\n\n /**\n * Even if set to middle pickr is getting clipped, so\n * set it to left / right.\n */\n } else if (leftClip < 0) {\n newLeft = pos['right'];\n } else if (rightClip > window.innerWidth) {\n newLeft = pos['left'];\n }\n\n as.left = `${newLeft}px`;\n }\n\n _updateOutput() {\n\n // Check if component is present\n if (this._root.interaction.type()) {\n\n this._root.interaction.result.value = (() => {\n\n // Construct function name and call if present\n const method = 'to' + this._root.interaction.type().getAttribute('data-type');\n return typeof this._color[method] === 'function' ? this._color[method]().toString() : '';\n })();\n }\n\n // Fire listener if initialization is finish\n if (!this._initializingActive) {\n this.options.onChange(this._color, this);\n }\n }\n\n applyColor(silent = false) {\n const {preview, button} = this._root;\n\n // Change preview and current color\n const cssRGBaString = this._color.toRGBA().toString();\n preview.lastColor.style.background = cssRGBaString;\n\n // Change only the button color if it isn't customized\n if (!this.options.useAsButton) {\n button.style.background = cssRGBaString;\n }\n\n // User changed the color so remove the clear clas\n button.classList.remove('clear');\n\n // Save last color\n this._lastColor = this._color.clone();\n\n // Fire listener\n if (!this._initializingActive && !silent) {\n this.options.onSave(this._color, this);\n }\n }\n\n _clearColor() {\n const {_root, options} = this;\n\n // Change only the button color if it isn't customized\n if (!options.useAsButton) {\n _root.button.style.background = 'rgba(255, 255, 255, 0.4)';\n }\n\n _root.button.classList.add('clear');\n\n if (!options.showAlways) {\n this.hide();\n }\n\n // Fire listener\n options.onChange(null, this);\n }\n\n /**\n * Destroy's all functionalitys\n */\n destroy() {\n this._eventBindings.forEach(args => _.off(...args));\n Object.keys(this.components).forEach(key => this.components[key].destroy());\n }\n\n /**\n * Destroy's all functionalitys and removes\n * the pickr element.\n */\n destroyAndRemove() {\n this.destroy();\n\n // Remove element\n const root = this._root.root;\n root.parentElement.removeChild(root);\n }\n\n /**\n * Hides the color-picker ui.\n */\n hide() {\n this._root.app.classList.remove('visible');\n return this;\n }\n\n /**\n * Shows the color-picker ui.\n */\n show() {\n if (this.options.disabled) return;\n this._root.app.classList.add('visible');\n this._rePositioningPicker();\n return this;\n }\n\n /**\n * @return {boolean} If the color picker is currently open\n */\n isOpen() {\n return this._root.app.classList.contains('visible');\n }\n\n /**\n * Set a specific color.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @param a Alpha channel (0 - 1)\n * @param silent If the button should not change the color\n * @return true if the color has been accepted\n */\n setHSVA(h = 360, s = 0, v = 0, a = 1, silent = false) {\n\n // Deactivate color calculation\n const recalc = this._recalc; // Save state\n this._recalc = false;\n\n // Validate input\n if (h < 0 || h > 360 || s < 0 || s > 100 || v < 0 || v > 100 || a < 0 || a > 1) {\n return false;\n }\n\n // Short names\n const {hue, opacity, palette} = this.components;\n\n // Calculate y position of hue slider\n const hueWrapper = hue.options.wrapper;\n const hueY = hueWrapper.offsetHeight * (h / 360);\n hue.update(0, hueY);\n\n // Calculate y position of opacity slider\n const opacityWrapper = opacity.options.wrapper;\n const opacityY = opacityWrapper.offsetHeight * a;\n opacity.update(0, opacityY);\n\n // Calculate y and x position of color palette\n const pickerWrapper = palette.options.wrapper;\n const pickerX = pickerWrapper.offsetWidth * (s / 100);\n const pickerY = pickerWrapper.offsetHeight * (1 - (v / 100));\n palette.update(pickerX, pickerY);\n\n // Override current color and re-active color calculation\n this._color = new HSVaColor(h, s, v, a);\n this._recalc = recalc; // Restore old state\n\n // Update output if recalculation is enabled\n if (this._recalc) {\n this._updateOutput();\n }\n\n // Check if call is silent\n if (!silent) {\n this.applyColor();\n }\n\n return true;\n }\n\n /**\n * Tries to parse a string which represents a color.\n * Examples: #fff\n * rgb 10 10 200\n * hsva 10 20 5 0.5\n * @param string\n * @param silent\n */\n setColor(string, silent = false) {\n\n // Check if null\n if (string === null) {\n this._clearColor();\n return true;\n }\n\n const {values, type} = Color.parseToHSV(string);\n\n // Check if color is ok\n if (values) {\n\n // Change selected color format\n const utype = type.toUpperCase();\n const {options} = this._root.interaction;\n const target = options.find(el => el.getAttribute('data-type') === utype);\n\n // Auto select only if not hidden\n if (!target.hidden) {\n for (const el of options) {\n el.classList[el === target ? 'add' : 'remove']('active');\n }\n }\n\n return this.setHSVA(...values, silent);\n }\n }\n\n /**\n * Changes the color _representation.\n * Allowed values are HEX, RGBA, HSVA, HSLA and CMYK\n * @param type\n * @returns {boolean} if the selected type was valid.\n */\n setColorRepresentation(type) {\n\n // Force uppercase to allow a case-sensitiv comparison\n type = type.toUpperCase();\n\n // Find button with given type and trigger click event\n return !!this._root.interaction.options.find(v => v.getAttribute('data-type') === type && !v.click());\n }\n\n /**\n * Returns the current color representaion. See setColorRepresentation\n * @returns {*}\n */\n getColorRepresentation() {\n return this._representation;\n }\n\n /**\n * @returns HSVaColor Current HSVaColor object.\n */\n getColor() {\n return this._color;\n }\n\n /**\n * @returns The root HTMLElement with all his components.\n */\n getRoot() {\n return this._root;\n }\n\n /**\n * Disable pickr\n */\n disable() {\n this.hide();\n this.options.disabled = true;\n this._root.button.classList.add('disabled');\n return this;\n }\n\n /**\n * Enable pickr\n */\n enable() {\n this.options.disabled = false;\n this._root.button.classList.remove('disabled');\n return this;\n }\n}\n\nfunction create(options) {\n const {components, strings, useAsButton, swatches} = options;\n const hidden = con => con ? '' : 'style=\"display:none\" hidden';\n\n const root = _.createFromTemplate(`\n
\n \n ${useAsButton ? '' : '
'}\n\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n \n ${swatches && swatches.length ? `\n
\n ${swatches.map((v, i) => `
`).join('')}\n
\n ` : ''}\n\n
\n \n\n \n \n \n \n \n\n \n \n
\n
\n
\n `);\n\n const int = root.interaction;\n\n // Select option which is not hidden\n int.options.find(o => !o.hidden && !o.classList.add('active'));\n\n // Create method to find currenlty active option\n int.type = () => int.options.find(e => e.classList.contains('active'));\n return root;\n}\n\n// Static methods\nPickr.utils = {\n once: _.once,\n on: _.on,\n off: _.off,\n eventPath: _.eventPath,\n createElementFromString: _.createElementFromString,\n adjustableInputNumbers: _.adjustableInputNumbers,\n removeAttribute: _.removeAttribute,\n createFromTemplate: _.createFromTemplate\n};\n\n// Create instance via method\nPickr.create = (options) => new Pickr(options);\n\n// Export\nPickr.version = '0.3.6';\nexport default Pickr;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.css b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.css new file mode 100644 index 00000000..9f1d3ffd --- /dev/null +++ b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.css @@ -0,0 +1 @@ +.pickr{position:relative;overflow:visible;z-index:1}.pickr *{box-sizing:border-box}.pickr .pcr-button{position:relative;height:2em;width:2em;padding:.5em;border-radius:.15em;cursor:pointer;background:transparent;transition:background-color .3s;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.pickr .pcr-button:before{background:url('data:image/svg+xml;utf8, ');background-size:.5em;border-radius:.15em;z-index:-1}.pickr .pcr-button:after,.pickr .pcr-button:before{position:absolute;content:"";top:0;left:0;width:100%;height:100%}.pickr .pcr-button:after{background:url('data:image/svg+xml;utf8, ') no-repeat 50%;background-size:70%;opacity:0}.pickr .pcr-button.clear:after{opacity:1}.pickr .pcr-button.disabled{cursor:not-allowed}.pcr-app{position:absolute;display:flex;flex-direction:column;z-index:10000;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03);top:5px;height:15em;width:28em;max-width:95vw;padding:.8em;border-radius:.1em;background:#fff;opacity:0;visibility:hidden;transition:opacity .3s}.pcr-app.visible{visibility:visible;opacity:1}.pcr-app .swatches{display:flex;flex-wrap:wrap;display:grid;grid-template-columns:repeat(auto-fit,minmax(1.6em,1fr));margin-top:.75em}.pcr-app .swatches>div{position:relative;width:1.5em;height:1.5em;border-radius:.15em;cursor:pointer;margin:0 2px 2px 0;flex-shrink:0;justify-self:center;transition:all .3s;overflow:hidden}.pcr-app .swatches>div:before{background:url('data:image/svg+xml;utf8, ');background-size:6px;border-radius:.15em;z-index:-1}.pcr-app .swatches>div:after,.pcr-app .swatches>div:before{position:absolute;content:"";top:0;left:0;width:100%;height:100%}.pcr-app .swatches>div:after{background:currentColor;border:1px solid rgba(0,0,0,.05);border-radius:.15em;box-sizing:border-box}.pcr-app .swatches>div:hover{filter:brightness(1.1)}.pcr-app .pcr-interaction{display:flex;align-items:center;margin:.75em -.2em 0}.pcr-app .pcr-interaction>*{margin:0 .2em}.pcr-app .pcr-interaction input{border:none;outline:none;letter-spacing:.07em;font-size:.75em;text-align:center;cursor:pointer;color:#75797e;background:#f1f3f4;border-radius:.15em;transition:all .15s;box-shadow:0 0 0 2px transparent;padding:.45em .5em}.pcr-app .pcr-interaction input:hover{filter:brightness(.975)}.pcr-app .pcr-interaction input:focus{box-shadow:0 0 0 2px rgba(66,133,244,.8)}.pcr-app .pcr-interaction .pcr-result{color:#75797e;text-align:left;flex-grow:1;min-width:1em;transition:all .2s;border-radius:.15em;background:#f1f3f4;cursor:text}.pcr-app .pcr-interaction .pcr-result::selection{background:#4285f4;color:#fff}.pcr-app .pcr-interaction .pcr-type.active{color:#fff;background:#4285f4}.pcr-app .pcr-interaction .pcr-clear,.pcr-app .pcr-interaction .pcr-save{width:auto;color:#fff}.pcr-app .pcr-interaction .pcr-clear:hover,.pcr-app .pcr-interaction .pcr-save:hover{filter:brightness(.925)}.pcr-app .pcr-interaction .pcr-save{background:#4285f4}.pcr-app .pcr-interaction .pcr-clear{background:#f44250}.pcr-app .pcr-selection{display:flex;justify-content:space-between;flex-grow:1}.pcr-app .pcr-selection .pcr-picker{position:absolute;height:18px;width:18px;border:2px solid #fff;border-radius:100%;user-select:none;cursor:-moz-grab;cursor:-webkit-grabbing}.pcr-app .pcr-selection .pcr-color-preview{position:relative;z-index:1;width:2em;display:flex;flex-direction:column;justify-content:space-between;margin-right:.75em}.pcr-app .pcr-selection .pcr-color-preview:before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, ');background-size:.5em;border-radius:.15em;z-index:-1}.pcr-app .pcr-selection .pcr-color-preview .pcr-last-color{cursor:pointer;transition:background-color .3s;border-radius:.15em .15em 0 0}.pcr-app .pcr-selection .pcr-color-preview .pcr-current-color{border-radius:0 0 .15em .15em}.pcr-app .pcr-selection .pcr-color-preview .pcr-current-color,.pcr-app .pcr-selection .pcr-color-preview .pcr-last-color{background:transparent;width:100%;height:50%}.pcr-app .pcr-selection .pcr-color-chooser,.pcr-app .pcr-selection .pcr-color-opacity,.pcr-app .pcr-selection .pcr-color-palette{position:relative;user-select:none;display:flex;flex-direction:column}.pcr-app .pcr-selection .pcr-color-palette{width:100%;z-index:1}.pcr-app .pcr-selection .pcr-color-palette .pcr-palette{height:100%;border-radius:.15em}.pcr-app .pcr-selection .pcr-color-palette .pcr-palette:before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, ');background-size:.5em;border-radius:.15em;z-index:-1}.pcr-app .pcr-selection .pcr-color-chooser,.pcr-app .pcr-selection .pcr-color-opacity{margin-left:.75em}.pcr-app .pcr-selection .pcr-color-chooser .pcr-picker,.pcr-app .pcr-selection .pcr-color-opacity .pcr-picker{left:50%;transform:translateX(-50%)}.pcr-app .pcr-selection .pcr-color-chooser .pcr-slider,.pcr-app .pcr-selection .pcr-color-opacity .pcr-slider{width:8px;height:100%;border-radius:50em}.pcr-app .pcr-selection .pcr-color-chooser .pcr-slider{background:linear-gradient(180deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.pcr-app .pcr-selection .pcr-color-opacity .pcr-slider{background:linear-gradient(180deg,transparent,#000),url('data:image/svg+xml;utf8, ');background-size:100%,50%} \ No newline at end of file diff --git a/Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.js b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.js new file mode 100644 index 00000000..84508daf --- /dev/null +++ b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Pickr=e():t.Pickr=e()}(window,function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="dist/",o(o.s=1)}([function(t,e,o){},function(t,e,o){"use strict";o.r(e);o(0);function n(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}const i=s.bind(null,"addEventListener"),r=s.bind(null,"removeEventListener");function s(t,e,o,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]),e.forEach(e=>o.forEach(o=>e[t](o,i,function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};const n=c(e,"data-con"),i=c(e,"data-key");i&&(o[i]=e);const r=Array.from(e.children),s=n?o[n]={}:o;for(let e of r){const o=c(e,"data-arr");o?(s[o]||(s[o]=[])).push(e):t(e,s)}return o}(a(t))}function p(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function u(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const o=t=>t>="0"&&t<="9"||"-"===t||"."===t;function n(n){const i=t.value,r=t.selectionStart;let s=r,a="";for(let t=r-1;t>0&&o(i[t]);t--)a=i[t]+a,s--;for(let t=r,e=i.length;t0&&!isNaN(a)&&isFinite(a)){const o=n.deltaY<0?1:-1,r=n.ctrlKey?5*o:o;let c=Number(a)+r;!e&&c<0&&(c=0);const l=i.substr(0,s)+c+i.substring(s+a.length,i.length),p=s+String(c).length;t.value=l,t.focus(),t.setSelectionRange(p,p)}n.preventDefault(),t.dispatchEvent(new Event("input"))}i(t,"focus",()=>i(window,"wheel",n)),i(t,"blur",()=>r(window,"wheel",n))}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var o=[],n=!0,i=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(o.push(s.value),!e||o.length!==e);n=!0);}catch(t){i=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}return o}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const h=Math.min,f=Math.max;function v(t,e,o){t=t/360*6,e/=100,o/=100;let n=Math.floor(t),i=t-n,r=o*(1-e),s=o*(1-i*e),a=o*(1-(1-i)*e),c=n%6;return[255*[o,s,r,r,a,o][c],255*[a,o,o,s,r,r][c],255*[r,r,a,o,o,s][c]]}function g(t,e,o){let n,i,r;const s=h(t/=255,e/=255,o/=255),a=f(t,e,o),c=a-s;if(0===c)n=i=0;else{i=c/a;let r=((a-t)/6+c/2)/c,s=((a-e)/6+c/2)/c,l=((a-o)/6+c/2)/c;t===a?n=l-s:e===a?n=1/3+r-l:o===a&&(n=2/3+s-r),n<0?n+=1:n>1&&(n-=1)}return[360*n,100*i,100*(r=a)]}function y(t,e,o,n){return e/=100,o/=100,[...g(255*(1-h(1,(t/=100)*(1-(n/=100))+n)),255*(1-h(1,e*(1-n)+n)),255*(1-h(1,o*(1-n)+n)))]}function m(t,e,o){return e/=100,[t,2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,100*(o+e)]}function b(t){return g(...t.match(/.{2}/g).map(t=>parseInt(t,16)))}function w(t){const e={cmyk:/^cmyk[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)/i,rgba:/^(rgb|rgba)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsla:/^(hsl|hsla)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsva:/^(hsv|hsva)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hex:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map(t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0);let n;for(let s in e)if(n=e[s].exec(t))switch(s){case"cmyk":{let t=d(o(n),5),e=t[1],i=t[2],r=t[3],a=t[4];if(e>100||i>100||r>100||a>100)break;return{values:[...y(e,i,r,a),1],type:s}}case"rgba":{let t=d(o(n),6),e=t[2],i=t[3],r=t[4],a=t[5],c=void 0===a?1:a;if(e>255||i>255||r>255||c<0||c>1)break;return{values:[...g(e,i,r),c],type:s}}case"hex":{const t=(t,e)=>[t.substring(0,e),t.substring(e,t.length)];let e,o=d(n,2)[1];if(3===o.length?o+="F":6===o.length&&(o+="FF"),4===o.length){var i=d(t(o,3).map(t=>t+t),2);o=i[0],e=i[1]}else if(8===o.length){var r=d(t(o,6),2);o=r[0],e=r[1]}return e=parseInt(e,16)/255,{values:[...b(o),e],type:s}}case"hsla":{let t=d(o(n),6),e=t[2],i=t[3],r=t[4],a=t[5],c=void 0===a?1:a;if(e>360||i>100||r>100||c<0||c>1)break;return{values:[...m(e,i,r),c],type:s}}case"hsva":{let t=d(o(n),6),e=t[2],i=t[3],r=t[4],a=t[5],c=void 0===a?1:a;if(e>360||i>100||r>100||c<0||c>1)break;return{values:[e,i,r,c],type:s}}}return{values:null,type:null}}function _(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const i=Math.ceil,r={h:t,s:e,v:o,a:n,toHSVA(){const t=[r.h,r.s,r.v],e=t.map(i);return t.push(r.a),t.toString=(()=>`hsva(${e[0]}, ${e[1]}%, ${e[2]}%, ${r.a.toFixed(1)})`),t},toHSLA(){const t=function(t,e,o){let n=(2-(e/=100))*(o/=100)/2;return 0!==n&&(e=1===n?0:n<.5?e*o/(2*n):e*o/(2-2*n)),[t,100*e,100*n]}(r.h,r.s,r.v),e=t.map(i);return t.push(r.a),t.toString=(()=>`hsla(${e[0]}, ${e[1]}%, ${e[2]}%, ${r.a.toFixed(1)})`),t},toRGBA(){const t=v(r.h,r.s,r.v),e=t.map(i);return t.push(r.a),t.toString=(()=>`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${r.a.toFixed(1)})`),t},toCMYK(){const t=function(t,e,o){const n=v(t,e,o),i=n[0]/255,r=n[1]/255,s=n[2]/255;let a,c,l,p;return[100*(c=1===(a=h(1-i,1-r,1-s))?0:(1-i-a)/(1-a)),100*(l=1===a?0:(1-r-a)/(1-a)),100*(p=1===a?0:(1-s-a)/(1-a)),100*a]}(r.h,r.s,r.v),e=t.map(i);return t.toString=(()=>`cmyk(${e[0]}%, ${e[1]}%, ${e[2]}%, ${e[3]}%)`),t},toHEX(){const t=function(t,e,o){return v(t,e,o).map(t=>Math.round(t).toString(16).padStart(2,"0"))}(...[r.h,r.s,r.v]);return t.toString=(()=>{const e=r.a>=1?"":Number((255*r.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return`#${t.join("").toUpperCase()+e}`}),t},clone:()=>_(r.h,r.s,r.v,r.a)};return r}function k(t){const e={options:Object.assign({lockX:!1,lockY:!1,onchange:()=>0},t),_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.preventDefault(),e.wrapperRect=e.options.wrapper.getBoundingClientRect(),e._tapmove(t)},_tapmove(t){const o=e.options,n=e.cache,i=o.element,r=e.wrapperRect;let s=0,a=0;if(t){const e=t&&t.touches&&t.touches[0];s=t?(e||t).clientX:0,a=t?(e||t).clientY:0,sr.left+r.width&&(s=r.left+r.width),ar.top+r.height&&(a=r.top+r.height),s-=r.left,a-=r.top}else n&&(s=n.x,a=n.y);o.lockX||(i.style.left=s-i.offsetWidth/2+"px"),o.lockY||(i.style.top=a-i.offsetHeight/2+"px"),e.cache={x:s,y:a},o.onchange(s,a)},_tapstop(){r(document,["mouseup","touchend","touchcancel"],e._tapstop),r(document,["mousemove","touchmove"],e._tapmove)},trigger(){e.wrapperRect=e.options.wrapper.getBoundingClientRect(),e._tapmove()},update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.wrapperRect=e.options.wrapper.getBoundingClientRect(),e._tapmove({clientX:e.wrapperRect.left+t,clientY:e.wrapperRect.top+o})},destroy(){const t=e.options,o=e._tapstart;r([t.wrapper,t.element],"mousedown",o),r([t.wrapper,t.element],"touchstart",o,{passive:!1})}};e.wrapperRect=e.options.wrapper.getBoundingClientRect();const o=e.options,n=e._tapstart;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),e}function A(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={options:Object.assign({onchange:()=>0,className:"",elements:[]},t),_ontap(t){const o=e.options;o.elements.forEach(e=>e.classList[t.target===e?"add":"remove"](o.className)),o.onchange(t)},destroy(){r(e.options.elements,"click",this._ontap)}};return i(e.options.elements,"click",e._ontap),e}class C{constructor(t){this.options=Object.assign({useAsButton:!1,disabled:!1,comparison:!0,components:{interaction:{}},strings:{},swatches:null,default:"fff",defaultRepresentation:"HEX",position:"middle",adjustableNumbers:!0,showAlways:!1,parent:void 0,closeWithKey:"Escape",onChange:()=>0,onSave:()=>0,onSwatchSelect:()=>0},t),this.options.components.interaction||(this.options.components.interaction={}),this._initializingActive=!0,this._recalc=!0,this._color=new _,this._lastColor=new _,this.options.swatches=this.options.swatches||[],this.options.swatches&&(this.options.swatches=this.options.swatches.map(t=>{const e=w(t).values;return e&&new _(...e)}).filter(t=>t)),this._preBuild(),this._buildComponents(),this._bindEvents(),this._representation=this.options.defaultRepresentation,this.setColorRepresentation(this._representation),this._finalBuild(),this._rePositioningPicker(),requestAnimationFrame(function t(){if(!this._root.app.offsetParent)return requestAnimationFrame(t.bind(this));this._initializingActive=!1,this.setColor(this.options.default)}.bind(this))}_preBuild(){const t=this.options;"string"==typeof t.el&&(t.el=document.querySelector(t.el)),this._root=function(t){const e=t.components,o=t.strings,n=t.useAsButton,i=t.swatches,r=t=>t?"":'style="display:none" hidden',s=l(`\n
\n \n ${n?"":'
'}\n\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n \n ${i&&i.length?`\n
\n ${i.map((t,e)=>`
`).join("")}\n
\n `:""}\n\n
\n \n\n \n \n \n \n \n\n \n \n
\n
\n
\n `),a=s.interaction;return a.options.find(t=>!t.hidden&&!t.classList.add("active")),a.type=(()=>a.options.find(t=>t.classList.contains("active"))),s}(t),t.useAsButton&&(t.parent||(t.parent="body"),this._root.button=t.el),document.body.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;document.body.removeChild(e.root),t.parent&&("string"==typeof t.parent&&(t.parent=document.querySelector(t.parent)),t.parent.appendChild(e.app)),t.useAsButton||t.el.parentElement.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),t.showAlways?e.app.classList.add("visible"):this.hide()}_buildComponents(){const t=this,e=this.options.components,o={palette:k({element:t._root.palette.picker,wrapper:t._root.palette.palette,onchange(e,o){const n=t._color,i=t._root,r=t.options;n.s=e/this.wrapper.offsetWidth*100,n.v=100-o/this.wrapper.offsetHeight*100,n.v<0&&(n.v=0);const s=n.toRGBA().toString();this.element.style.background=s,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${n.a}), transparent), \n linear-gradient(to left, hsla(${n.h}, 100%, 50%, ${n.a}), rgba(255, 255, 255, ${n.a}))\n `,r.comparison||(i.button.style.background=s,r.useAsButton||(i.preview.lastColor.style.background=s)),i.preview.currentColor.style.background=s,t._recalc&&t._updateOutput(),i.button.classList.remove("clear")}}),hue:k({lockX:!0,element:t._root.hue.picker,wrapper:t._root.hue.slider,onchange(n,i){e.hue&&(t._color.h=i/this.wrapper.offsetHeight*360,this.element.style.backgroundColor=`hsl(${t._color.h}, 100%, 50%)`,o.palette.trigger())}}),opacity:k({lockX:!0,element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onchange(o,n){e.opacity&&(t._color.a=Math.round(n/this.wrapper.offsetHeight*100)/100,this.element.style.background=`rgba(0, 0, 0, ${t._color.a})`,t.components.palette.trigger())}}),selectable:A({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._updateOutput()}})};this.components=o}_bindEvents(){const t=this._root,e=this.options,o=[i(t.interaction.clear,"click",()=>this._clearColor()),i(t.preview.lastColor,"click",()=>this.setHSVA(...this._lastColor.toHSVA())),i(t.interaction.save,"click",()=>{!this.applyColor()&&!e.showAlways&&this.hide()}),i(t.interaction.result,["keyup","input"],t=>{this._recalc=!1,this.setColor(t.target.value,!0)&&!this._initializingActive&&this.options.onChange(this._color,this),t.stopImmediatePropagation()}),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],()=>this._recalc=!0),i(window,"resize",()=>this._rePositioningPicker)];if(t.swatches&&o.push(i(t.swatches,"click",t=>{let o=t.target;const n=e.swatches[Number(o.getAttribute("data-color-index"))];n&&(this.setHSVA(...n.toHSVA(),!0),e.onSwatchSelect(n,this))})),!e.showAlways){const n=e.closeWithKey;o.push(i(t.button,"click",()=>this.isOpen()?this.hide():this.show()),i(document,"keyup",t=>this.isOpen()&&(t.key===n||t.code===n)&&this.hide()),i(document,["touchstart","mousedown"],e=>{this.isOpen()&&!p(e).some(e=>e===t.app||e===t.button)&&this.hide()},{capture:!0}))}e.adjustableNumbers&&u(t.interaction.result,!1),this._eventBindings=o}_rePositioningPicker(){const t=this._root,e=this._root.app;if(this.options.parent){const o=t.button.getBoundingClientRect();e.style.position="fixed",e.style.marginLeft=`${o.left}px`,e.style.marginTop=`${o.top}px`}const o=t.button.getBoundingClientRect(),n=e.getBoundingClientRect(),i=e.style;n.bottom>window.innerHeight?i.top=`${-n.height-5}px`:o.bottom+n.heightwindow.innerWidth&&l-window.innerWidthwindow.innerWidth&&(a=r.left),i.left=`${a}px`}_updateOutput(){this._root.interaction.type()&&(this._root.interaction.result.value=(()=>{const t="to"+this._root.interaction.type().getAttribute("data-type");return"function"==typeof this._color[t]?this._color[t]().toString():""})()),this._initializingActive||this.options.onChange(this._color,this)}applyColor(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=this._root,o=e.preview,n=e.button,i=this._color.toRGBA().toString();o.lastColor.style.background=i,this.options.useAsButton||(n.style.background=i),n.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this.options.onSave(this._color,this)}_clearColor(){const t=this._root,e=this.options;e.useAsButton||(t.button.style.background="rgba(255, 255, 255, 0.4)"),t.button.classList.add("clear"),e.showAlways||this.hide(),e.onChange(null,this)}destroy(){this._eventBindings.forEach(t=>r(...t)),Object.keys(this.components).forEach(t=>this.components[t].destroy())}destroyAndRemove(){this.destroy();const t=this._root.root;t.parentElement.removeChild(t)}hide(){return this._root.app.classList.remove("visible"),this}show(){if(!this.options.disabled)return this._root.app.classList.add("visible"),this._rePositioningPicker(),this}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:360,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||o<0||o>100||n<0||n>1)return!1;const s=this.components,a=s.hue,c=s.opacity,l=s.palette,p=a.options.wrapper.offsetHeight*(t/360);a.update(0,p);const u=c.options.wrapper.offsetHeight*n;c.update(0,u);const d=l.options.wrapper,h=d.offsetWidth*(e/100),f=d.offsetHeight*(1-o/100);return l.update(h,f),this._color=new _(t,e,o,n),this._recalc=r,this._recalc&&this._updateOutput(),i||this.applyColor(),!0}setColor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(),!0;const o=w(t),n=o.values,i=o.type;if(n){const t=i.toUpperCase(),o=this._root.interaction.options,r=o.find(e=>e.getAttribute("data-type")===t);if(!r.hidden)for(const t of o)t.classList[t===r?"add":"remove"]("active");return this.setHSVA(...n,e)}}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find(e=>e.getAttribute("data-type")===t&&!e.click())}getColorRepresentation(){return this._representation}getColor(){return this._color}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}C.utils={once:(t,e,o,n)=>i(t,e,function t(){o.apply(this,arguments),this.removeEventListener(e,t)},n),on:i,off:r,eventPath:p,createElementFromString:a,adjustableInputNumbers:u,removeAttribute:c,createFromTemplate:l},C.create=(t=>new C(t)),C.version="0.3.6";e.default=C}]).default}); +//# sourceMappingURL=pickr.min.js.map \ No newline at end of file diff --git a/Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.js.map b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.js.map new file mode 100644 index 00000000..8997efe8 --- /dev/null +++ b/Lombiq.TrainingDemo/wwwroot/pickr/pickr.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./src/js/lib/utils.js","webpack:///./src/js/lib/color.js","webpack:///./src/js/lib/hsvacolor.js","webpack:///./src/js/helper/moveable.js","webpack:///./src/js/helper/selectable.js","webpack:///./src/js/pickr.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","on","eventListener","off","method","elements","events","fn","options","arguments","length","undefined","HTMLCollection","NodeList","Array","from","isArray","forEach","el","ev","_objectSpread","capture","slice","createElementFromString","html","div","document","createElement","innerHTML","trim","firstElementChild","removeAttribute","getAttribute","createFromTemplate","str","resolve","element","base","con","children","subtree","child","arr","push","eventPath","evt","path","composedPath","target","parentElement","adjustableInputNumbers","negative","isNumChar","handleScroll","e","val","selectionStart","numStart","num","isNaN","isFinite","mul","deltaY","inc","ctrlKey","newNum","Number","newStr","substr","substring","curPos","String","focus","setSelectionRange","preventDefault","dispatchEvent","Event","min","Math","max","hsvToRgb","h","v","floor","f","q","mod","rgbToHsv","g","b","minVal","maxVal","delta","dr","dg","db","cmykToHsv","y","k","hslToHsv","hexToHsv","hex","match","map","parseInt","parseToHSV","regex","cmyk","rgba","hsla","hsva","numarize","array","test","type","exec","_numarize2","_slicedToArray","values","_numarize4","_numarize4$","a","splitAt","alpha","_splitAt$map2","_splitAt2","_numarize6","_numarize6$","_numarize8","_numarize8$","HSVaColor","ceil","that","toHSVA","rhsva","toString","toFixed","toHSLA","Color","rhsla","toRGBA","rrgba","toCMYK","rgb","rcmyk","toHEX","round","padStart","toUpperCase","join","clone","Moveable","opt","assign","lockX","lockY","onchange","_tapstart","_","_tapstop","_tapmove","wrapperRect","wrapper","getBoundingClientRect","cache","x","touch","touches","clientX","clientY","left","width","top","height","style","offsetWidth","offsetHeight","trigger","update","destroy","passive","Selectable","className","_ontap","classList","this","Pickr","constructor","useAsButton","disabled","comparison","components","interaction","strings","swatches","default","defaultRepresentation","position","adjustableNumbers","showAlways","parent","closeWithKey","onChange","onSave","onSwatchSelect","_initializingActive","_recalc","_color","_lastColor","filter","_preBuild","_buildComponents","_bindEvents","_representation","setColorRepresentation","_finalBuild","_rePositioningPicker","requestAnimationFrame","cb","_root","app","offsetParent","setColor","querySelector","hidden","preview","hue","opacity","keys","input","save","clear","int","find","add","contains","button","body","appendChild","removeChild","replaceChild","disable","transition","lastColor","hide","inst","comp","palette","picker","cssRGBaString","background","currentColor","_updateOutput","remove","slider","backgroundColor","selectable","eventBindings","_clearColor","setHSVA","applyColor","result","stopImmediatePropagation","_ref","color","ck","isOpen","show","code","some","_eventBindings","relative","marginLeft","marginTop","bb","ab","as","bottom","innerHeight","pos","middle","right","cl","getComputedStyle","newLeft","leftClip","rightClip","innerWidth","silent","_this$_root","args","destroyAndRemove","recalc","_this$components","hueY","opacityY","pickerWrapper","pickerX","pickerY","string","_Color$parseToHSV2","utype","click","getColorRepresentation","getColor","getRoot","enable","utils","once","event","helper","apply","removeEventListener","version"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IA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B,YAAtBxL,QACDwC,EAASxC,EAAQiO,KAAKvN,GAAMA,EAAGc,aAAa,eAAiB6Q,GAGnE,IAAK7P,EAAOgL,OACR,IAAK,MAAM9M,KAAMV,EACbU,EAAGsK,UAAUtK,IAAO8B,EAAS,MAAQ,UAAU,UAIvD,OAAOyI,KAAK0E,WAAW7I,EAAQ0K,IAUvC1E,uBAAuBpG,GAMnB,OAHAA,EAAOA,EAAKkC,gBAGHqC,KAAKkC,MAAM3B,YAAYxL,QAAQiO,KAAKvJ,GAAKA,EAAElD,aAAa,eAAiBkF,IAAShC,EAAE4N,SAOjGC,yBACI,OAAOtH,KAAK4B,gBAMhB2F,WACI,OAAOvH,KAAKsB,OAMhBkG,UACI,OAAOxH,KAAKkC,MAMhBsB,UAII,OAHAxD,KAAK2D,OACL3D,KAAKjL,QAAQqL,UAAW,EACxBJ,KAAKkC,MAAMiB,OAAOpD,UAAUkD,IAAI,YACzBjD,KAMXyH,SAGI,OAFAzH,KAAKjL,QAAQqL,UAAW,EACxBJ,KAAKkC,MAAMiB,OAAOpD,UAAUqE,OAAO,YAC5BpE,MAqEfC,EAAMyH,MAAQ,CACVC,KL9sBgB,CAAChR,EAASiR,EAAO9S,EAAIC,IAAYP,EAAGmC,EAASiR,EAAO,SAASC,IAC7E/S,EAAGgT,MAAM9H,KAAMhL,WACfgL,KAAK+H,oBAAoBH,EAAOC,IACjC9S,GK4sBCP,GAAI6J,EACJ3J,IAAK2J,EACLlH,UAAWkH,EACXvI,wBAAyBuI,EACzB5G,uBAAwB4G,EACxB/H,gBAAiB+H,EACjB7H,mBAAoB6H,GAIxB4B,EAAMnM,OAAUiB,IAAY,IAAIkL,EAAMlL,IAGtCkL,EAAM+H,QAAU,QACD/H","file":"pickr.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Pickr\"] = factory();\n\telse\n\t\troot[\"Pickr\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","/**\r\n * Add an eventlistener which will be fired only once.\r\n *\r\n * @param element Target element\r\n * @param event Event name\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const once = (element, event, fn, options) => on(element, event, function helper() {\r\n fn.apply(this, arguments);\r\n this.removeEventListener(event, helper);\r\n}, options);\r\n\r\n/**\r\n * Add event(s) to element(s).\r\n * @param elements DOM-Elements\r\n * @param events Event names\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const on = eventListener.bind(null, 'addEventListener');\r\n\r\n/**\r\n * Remove event(s) from element(s).\r\n * @param elements DOM-Elements\r\n * @param events Event names\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const off = eventListener.bind(null, 'removeEventListener');\r\n\r\nfunction eventListener(method, elements, events, fn, options = {}) {\r\n\r\n // Normalize array\r\n if (elements instanceof HTMLCollection || elements instanceof NodeList) {\r\n elements = Array.from(elements);\r\n } else if (!Array.isArray(elements)) {\r\n elements = [elements];\r\n }\r\n\r\n if (!Array.isArray(events)) {\r\n events = [events];\r\n }\r\n\r\n elements.forEach(el =>\r\n events.forEach(ev =>\r\n el[method](ev, fn, {capture: false, ...options})\r\n )\r\n );\r\n\r\n return Array.prototype.slice.call(arguments, 1);\r\n}\r\n\r\n/**\r\n * Creates an DOM-Element out of a string (Single element).\r\n * @param html HTML representing a single element\r\n * @returns {Element | null} The element.\r\n */\r\nexport function createElementFromString(html) {\r\n const div = document.createElement('div');\r\n div.innerHTML = html.trim();\r\n return div.firstElementChild;\r\n}\r\n\r\n/**\r\n * Removes an attribute from a HTMLElement and returns the value.\r\n * @param el\r\n * @param name\r\n * @return {string}\r\n */\r\nexport function removeAttribute(el, name) {\r\n const value = el.getAttribute(name);\r\n el.removeAttribute(name);\r\n return value;\r\n}\r\n\r\n/**\r\n * Creates a new html element, every element which has\r\n * a 'data-key' attribute will be saved in a object (which will be returned)\r\n * where the value of 'data-key' ist the object-key and the value the HTMLElement.\r\n *\r\n * It's possible to create a hierarchy if you add a 'data-con' attribute. Every\r\n * sibling will be added to the object which will get the name from the 'data-con' attribute.\r\n *\r\n * If you want to create an Array out of multiple elements, you can use the 'data-arr' attribute,\r\n * the value defines the key and all elements, which has the same parent and the same 'data-arr' attribute,\r\n * would be added to it.\r\n *\r\n * @param str - The HTML String.\r\n */\r\nexport function createFromTemplate(str) {\r\n\r\n // Recursive function to resolve template\r\n function resolve(element, base = {}) {\r\n\r\n // Check key and container attribute\r\n const con = removeAttribute(element, 'data-con');\r\n const key = removeAttribute(element, 'data-key');\r\n\r\n // Check and save element\r\n if (key) {\r\n base[key] = element;\r\n }\r\n\r\n // Check all children\r\n const children = Array.from(element.children);\r\n const subtree = con ? (base[con] = {}) : base;\r\n for (let child of children) {\r\n\r\n // Check if element should be saved as array\r\n const arr = removeAttribute(child, 'data-arr');\r\n if (arr) {\r\n\r\n // Check if there is already an array and add element\r\n (subtree[arr] || (subtree[arr] = [])).push(child);\r\n } else {\r\n resolve(child, subtree);\r\n }\r\n }\r\n\r\n return base;\r\n }\r\n\r\n return resolve(createElementFromString(str));\r\n}\r\n\r\n/**\r\n * Polyfill for safari & firefox for the eventPath event property.\r\n * @param evt The event object.\r\n * @return [String] event path.\r\n */\r\nexport function eventPath(evt) {\r\n let path = evt.path || (evt.composedPath && evt.composedPath());\r\n if (path) return path;\r\n\r\n let el = evt.target.parentElement;\r\n path = [evt.target, el];\r\n while (el = el.parentElement) path.push(el);\r\n\r\n path.push(document, window);\r\n return path;\r\n}\r\n\r\n/**\r\n * Creates the ability to change numbers in an input field with the scroll-wheel.\r\n * @param el\r\n * @param negative\r\n */\r\nexport function adjustableInputNumbers(el, negative = true) {\r\n\r\n // Check if a char represents a number\r\n const isNumChar = c => (c >= '0' && c <= '9') || c === '-' || c === '.';\r\n\r\n function handleScroll(e) {\r\n const val = el.value;\r\n const off = el.selectionStart;\r\n let numStart = off;\r\n let num = ''; // Will be the number as string\r\n\r\n // Look back\r\n for (let i = off - 1; i > 0 && isNumChar(val[i]); i--) {\r\n num = val[i] + num;\r\n numStart--; // Find start of number\r\n }\r\n\r\n // Look forward\r\n for (let i = off, n = val.length; i < n && isNumChar(val[i]); i++) {\r\n num += val[i];\r\n }\r\n\r\n // Check if number is valid\r\n if (num.length > 0 && !isNaN(num) && isFinite(num)) {\r\n\r\n const mul = e.deltaY < 0 ? 1 : -1;\r\n const inc = e.ctrlKey ? mul * 5 : mul;\r\n let newNum = Number(num) + inc;\r\n\r\n if (!negative && newNum < 0) {\r\n newNum = 0;\r\n }\r\n\r\n const newStr = val.substr(0, numStart) + newNum + val.substring(numStart + num.length, val.length);\r\n const curPos = numStart + String(newNum).length;\r\n\r\n // Update value and set cursor\r\n el.value = newStr;\r\n el.focus();\r\n el.setSelectionRange(curPos, curPos);\r\n }\r\n\r\n // Prevent default\r\n e.preventDefault();\r\n\r\n // Trigger input event\r\n el.dispatchEvent(new Event('input'));\r\n }\r\n\r\n // Bind events\r\n on(el, 'focus', () => on(window, 'wheel', handleScroll));\r\n on(el, 'blur', () => off(window, 'wheel', handleScroll));\r\n}","// Shorthands\r\nconst min = Math.min,\r\n max = Math.max;\r\n\r\n/**\r\n * Convert HSV spectrum to RGB.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} Array with rgb values.\r\n */\r\nexport function hsvToRgb(h, s, v) {\r\n h = (h / 360) * 6;\r\n s /= 100;\r\n v /= 100;\r\n\r\n let i = Math.floor(h);\r\n\r\n let f = h - i;\r\n let p = v * (1 - s);\r\n let q = v * (1 - f * s);\r\n let t = v * (1 - (1 - f) * s);\r\n\r\n let mod = i % 6;\r\n let r = [v, q, p, p, t, v][mod];\r\n let g = [t, v, v, q, p, p][mod];\r\n let b = [p, p, t, v, v, q][mod];\r\n\r\n return [\r\n r * 255,\r\n g * 255,\r\n b * 255\r\n ];\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to Hex.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {string[]} Hex values\r\n */\r\nexport function hsvToHex(h, s, v) {\r\n return hsvToRgb(h, s, v).map(v => Math.round(v).toString(16).padStart(2, '0'));\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to CMYK.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} CMYK values\r\n */\r\nexport function hsvToCmyk(h, s, v) {\r\n const rgb = hsvToRgb(h, s, v);\r\n const r = rgb[0] / 255;\r\n const g = rgb[1] / 255;\r\n const b = rgb[2] / 255;\r\n\r\n let k, c, m, y;\r\n\r\n k = min(1 - r, 1 - g, 1 - b);\r\n\r\n c = k === 1 ? 0 : (1 - r - k) / (1 - k);\r\n m = k === 1 ? 0 : (1 - g - k) / (1 - k);\r\n y = k === 1 ? 0 : (1 - b - k) / (1 - k);\r\n\r\n return [\r\n c * 100,\r\n m * 100,\r\n y * 100,\r\n k * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to HSL.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} HSL values\r\n */\r\nexport function hsvToHsl(h, s, v) {\r\n s /= 100, v /= 100;\r\n\r\n let l = (2 - s) * v / 2;\r\n\r\n if (l !== 0) {\r\n if (l === 1) {\r\n s = 0;\r\n } else if (l < 0.5) {\r\n s = s * v / (l * 2);\r\n } else {\r\n s = s * v / (2 - l * 2);\r\n }\r\n }\r\n\r\n return [\r\n h,\r\n s * 100,\r\n l * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert RGB to HSV.\r\n * @param r Red\r\n * @param g Green\r\n * @param b Blue\r\n * @return {number[]} HSV values.\r\n */\r\nfunction rgbToHsv(r, g, b) {\r\n r /= 255, g /= 255, b /= 255;\r\n\r\n let h, s, v;\r\n const minVal = min(r, g, b);\r\n const maxVal = max(r, g, b);\r\n const delta = maxVal - minVal;\r\n\r\n v = maxVal;\r\n if (delta === 0) {\r\n h = s = 0;\r\n } else {\r\n s = delta / maxVal;\r\n let dr = (((maxVal - r) / 6) + (delta / 2)) / delta;\r\n let dg = (((maxVal - g) / 6) + (delta / 2)) / delta;\r\n let db = (((maxVal - b) / 6) + (delta / 2)) / delta;\r\n\r\n if (r === maxVal) {\r\n h = db - dg;\r\n } else if (g === maxVal) {\r\n h = (1 / 3) + dr - db;\r\n } else if (b === maxVal) {\r\n h = (2 / 3) + dg - dr;\r\n }\r\n\r\n if (h < 0) {\r\n h += 1;\r\n } else if (h > 1) {\r\n h -= 1;\r\n }\r\n }\r\n\r\n return [\r\n h * 360,\r\n s * 100,\r\n v * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert CMYK to HSV.\r\n * @param c Cyan\r\n * @param m Magenta\r\n * @param y Yellow\r\n * @param k Key (Black)\r\n * @return {number[]} HSV values.\r\n */\r\nfunction cmykToHsv(c, m, y, k) {\r\n c /= 100, m /= 100, y /= 100, k /= 100;\r\n\r\n const r = (1 - min(1, c * (1 - k) + k)) * 255;\r\n const g = (1 - min(1, m * (1 - k) + k)) * 255;\r\n const b = (1 - min(1, y * (1 - k) + k)) * 255;\r\n\r\n return [...rgbToHsv(r, g, b)];\r\n}\r\n\r\n/**\r\n * Convert HSL to HSV.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param l Lightness\r\n * @return {number[]} HSV values.\r\n */\r\nfunction hslToHsv(h, s, l) {\r\n s /= 100, l /= 100;\r\n s *= l < 0.5 ? l : 1 - l;\r\n\r\n let ns = (2 * s / (l + s)) * 100;\r\n let v = (l + s) * 100;\r\n return [h, ns, v];\r\n}\r\n\r\n/**\r\n * Convert HEX to HSV.\r\n * @param hex Hexadecimal string of rgb colors, can have length 3 or 6.\r\n * @return {number[]} HSV values.\r\n */\r\nfunction hexToHsv(hex) {\r\n return rgbToHsv(...hex.match(/.{2}/g).map(v => parseInt(v, 16)));\r\n}\r\n\r\n/**\r\n * Try's to parse a string which represents a color to a HSV array.\r\n * Current supported types are cmyk, rgba, hsla and hexadecimal.\r\n * @param str\r\n * @return {*}\r\n */\r\nexport function parseToHSV(str) {\r\n\r\n // Regular expressions to match different types of color represention\r\n const regex = {\r\n cmyk: /^cmyk[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)/i,\r\n rgba: /^(rgb|rgba)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hsla: /^(hsl|hsla)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hsva: /^(hsv|hsva)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hex: /^#?(([\\dA-Fa-f]{3,4})|([\\dA-Fa-f]{6})|([\\dA-Fa-f]{8}))$/i\r\n };\r\n\r\n /**\r\n * Takes an Array of any type, convert strings which represents\r\n * a number to a number an anything else to undefined.\r\n * @param array\r\n * @return {*}\r\n */\r\n const numarize = array => array.map(v => /^(|\\d+)\\.\\d+|\\d+$/.test(v) ? Number(v) : undefined);\r\n\r\n let match;\r\n for (let type in regex) {\r\n\r\n // Check if current scheme passed\r\n if (!(match = regex[type].exec(str)))\r\n continue;\r\n\r\n // Try to convert\r\n switch (type) {\r\n case 'cmyk': {\r\n let [, c, m, y, k] = numarize(match);\r\n\r\n if (c > 100 || m > 100 || y > 100 || k > 100)\r\n break;\r\n\r\n return {values: [...cmykToHsv(c, m, y, k), 1], type};\r\n }\r\n case 'rgba': {\r\n let [, , r, g, b, a = 1] = numarize(match);\r\n\r\n if (r > 255 || g > 255 || b > 255 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [...rgbToHsv(r, g, b), a], type};\r\n }\r\n case 'hex': {\r\n const splitAt = (s, i) => [s.substring(0, i), s.substring(i, s.length)];\r\n let [, hex] = match;\r\n\r\n // Fill up opacity if not declared\r\n if (hex.length === 3) {\r\n hex += 'F';\r\n } else if (hex.length === 6) {\r\n hex += 'FF';\r\n }\r\n\r\n let alpha;\r\n if (hex.length === 4) {\r\n [hex, alpha] = splitAt(hex, 3).map(v => v + v);\r\n } else if (hex.length === 8) {\r\n [hex, alpha] = splitAt(hex, 6);\r\n }\r\n\r\n // Convert 0 - 255 to 0 - 1 for opacity\r\n alpha = parseInt(alpha, 16) / 255;\r\n return {values: [...hexToHsv(hex), alpha], type};\r\n }\r\n case 'hsla': {\r\n let [, , h, s, l, a = 1] = numarize(match);\r\n\r\n if (h > 360 || s > 100 || l > 100 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [...hslToHsv(h, s, l), a], type};\r\n }\r\n case 'hsva': {\r\n let [, , h, s, v, a = 1] = numarize(match);\r\n\r\n if (h > 360 || s > 100 || v > 100 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [h, s, v, a], type};\r\n }\r\n }\r\n }\r\n\r\n return {values: null, type: null};\r\n}","import * as Color from './color';\r\n\r\n/**\r\n * Simple class which holds the properties\r\n * of the color represention model hsla (hue saturation lightness alpha)\r\n */\r\nexport function HSVaColor(h = 0, s = 0, v = 0, a = 1) {\r\n\r\n const ceil = Math.ceil;\r\n const that = {\r\n h, s, v, a,\r\n\r\n toHSVA() {\r\n const hsva = [that.h, that.s, that.v];\r\n const rhsva = hsva.map(ceil);\r\n\r\n hsva.push(that.a);\r\n hsva.toString = () => `hsva(${rhsva[0]}, ${rhsva[1]}%, ${rhsva[2]}%, ${that.a.toFixed(1)})`;\r\n return hsva;\r\n },\r\n\r\n toHSLA() {\r\n const hsla = Color.hsvToHsl(that.h, that.s, that.v);\r\n const rhsla = hsla.map(ceil);\r\n\r\n hsla.push(that.a);\r\n hsla.toString = () => `hsla(${rhsla[0]}, ${rhsla[1]}%, ${rhsla[2]}%, ${that.a.toFixed(1)})`;\r\n return hsla;\r\n },\r\n\r\n toRGBA() {\r\n const rgba = Color.hsvToRgb(that.h, that.s, that.v);\r\n const rrgba = rgba.map(ceil);\r\n\r\n rgba.push(that.a);\r\n rgba.toString = () => `rgba(${rrgba[0]}, ${rrgba[1]}, ${rrgba[2]}, ${that.a.toFixed(1)})`;\r\n return rgba;\r\n },\r\n\r\n toCMYK() {\r\n const cmyk = Color.hsvToCmyk(that.h, that.s, that.v);\r\n const rcmyk = cmyk.map(ceil);\r\n\r\n cmyk.toString = () => `cmyk(${rcmyk[0]}%, ${rcmyk[1]}%, ${rcmyk[2]}%, ${rcmyk[3]}%)`;\r\n return cmyk;\r\n },\r\n\r\n toHEX() {\r\n const hex = Color.hsvToHex(...[that.h, that.s, that.v]);\r\n\r\n hex.toString = () => {\r\n\r\n // Check if alpha channel make sense, convert it to 255 number space, convert\r\n // to hex and pad it with zeros if needet.\r\n const alpha = that.a >= 1 ? '' : Number((that.a * 255).toFixed(0))\r\n .toString(16)\r\n .toUpperCase()\r\n .padStart(2, '0');\r\n\r\n return `#${hex.join('').toUpperCase() + alpha}`;\r\n };\r\n\r\n return hex;\r\n },\r\n\r\n clone() {\r\n return HSVaColor(that.h, that.s, that.v, that.a);\r\n }\r\n };\r\n\r\n return that;\r\n}\r\n","import * as _ from './../lib/utils';\r\n\r\nexport default function Moveable(opt) {\r\n\r\n const that = {\r\n\r\n // Assign default values\r\n options: Object.assign({\r\n lockX: false,\r\n lockY: false,\r\n onchange: () => 0\r\n }, opt),\r\n\r\n _tapstart(evt) {\r\n _.on(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.on(document, ['mousemove', 'touchmove'], that._tapmove);\r\n\r\n // Prevent default touch event\r\n evt.preventDefault();\r\n that.wrapperRect = that.options.wrapper.getBoundingClientRect();\r\n\r\n // Trigger\r\n that._tapmove(evt);\r\n },\r\n\r\n _tapmove(evt) {\r\n const {options, cache} = that;\r\n const {element} = options;\r\n const b = that.wrapperRect;\r\n\r\n let x = 0, y = 0;\r\n if (evt) {\r\n const touch = evt && evt.touches && evt.touches[0];\r\n x = evt ? (touch || evt).clientX : 0;\r\n y = evt ? (touch || evt).clientY : 0;\r\n\r\n // Reset to bounds\r\n if (x < b.left) x = b.left;\r\n else if (x > b.left + b.width) x = b.left + b.width;\r\n if (y < b.top) y = b.top;\r\n else if (y > b.top + b.height) y = b.top + b.height;\r\n\r\n // Normalize\r\n x -= b.left;\r\n y -= b.top;\r\n } else if (cache) {\r\n x = cache.x;\r\n y = cache.y;\r\n }\r\n\r\n if (!options.lockX)\r\n element.style.left = (x - element.offsetWidth / 2) + 'px';\r\n\r\n if (!options.lockY)\r\n element.style.top = (y - element.offsetHeight / 2) + 'px';\r\n\r\n that.cache = {x, y};\r\n options.onchange(x, y);\r\n },\r\n\r\n _tapstop() {\r\n _.off(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.off(document, ['mousemove', 'touchmove'], that._tapmove);\r\n },\r\n\r\n trigger() {\r\n that.wrapperRect = that.options.wrapper.getBoundingClientRect();\r\n that._tapmove();\r\n },\r\n\r\n update(x = 0, y = 0) {\r\n that.wrapperRect = that.options.wrapper.getBoundingClientRect();\r\n that._tapmove({\r\n clientX: that.wrapperRect.left + x,\r\n clientY: that.wrapperRect.top + y\r\n });\r\n },\r\n\r\n destroy() {\r\n const {options, _tapstart} = that;\r\n _.off([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.off([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n }\r\n };\r\n\r\n // Instance var\r\n that.wrapperRect = that.options.wrapper.getBoundingClientRect();\r\n\r\n // Initilize\r\n const {options, _tapstart} = that;\r\n _.on([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.on([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n\r\n return that;\r\n}","import * as _ from './../lib/utils';\r\n\r\nexport default function Selectable(opt = {}) {\r\n const that = {\r\n\r\n // Assign default values\r\n options: Object.assign({\r\n onchange: () => 0,\r\n className: '',\r\n elements: []\r\n }, opt),\r\n\r\n _ontap(evt) {\r\n const opt = that.options;\r\n opt.elements.forEach(e =>\r\n e.classList[evt.target === e ? 'add' : 'remove'](opt.className)\r\n );\r\n\r\n opt.onchange(evt);\r\n },\r\n\r\n destroy() {\r\n _.off(that.options.elements, 'click', this._ontap);\r\n }\r\n };\r\n\r\n _.on(that.options.elements, 'click', that._ontap);\r\n return that;\r\n}","// Import styles\nimport '../scss/pickr.scss';\n\n// Import utils\nimport * as _ from './lib/utils';\nimport * as Color from './lib/color';\n\n// Import classes\nimport {HSVaColor} from './lib/hsvacolor';\nimport Moveable from './helper/moveable';\nimport Selectable from './helper/selectable';\n\nclass Pickr {\n\n constructor(opt) {\n\n // Assign default values\n this.options = Object.assign({\n useAsButton: false,\n disabled: false,\n comparison: true,\n\n components: {interaction: {}},\n strings: {},\n\n swatches: null,\n\n default: 'fff',\n defaultRepresentation: 'HEX',\n position: 'middle',\n adjustableNumbers: true,\n showAlways: false,\n parent: undefined,\n\n closeWithKey: 'Escape',\n onChange: () => 0,\n onSave: () => 0,\n onSwatchSelect: () => 0\n }, opt);\n\n // Check interaction section\n if (!this.options.components.interaction) {\n this.options.components.interaction = {};\n }\n\n // Will be used to prevent specific actions during initilization\n this._initializingActive = true;\n\n // Replace element with color picker\n this._recalc = true;\n\n // Current and last color for comparison\n this._color = new HSVaColor();\n this._lastColor = new HSVaColor();\n\n // Parse swatch colors\n this.options.swatches = this.options.swatches || [];\n if (this.options.swatches) {\n this.options.swatches = this.options.swatches.map(str => {\n const {values} = Color.parseToHSV(str);\n return values && new HSVaColor(...values);\n }).filter(v => v);\n }\n\n // Initialize picker\n this._preBuild();\n this._buildComponents();\n this._bindEvents();\n\n // Initialize color _epresentation\n this._representation = this.options.defaultRepresentation;\n this.setColorRepresentation(this._representation);\n\n // Finalize build\n this._finalBuild();\n this._rePositioningPicker();\n\n // Initilization is finish, pickr is visible and ready for usage\n requestAnimationFrame((function cb() {\n if (!this._root.app.offsetParent) {\n return requestAnimationFrame(cb.bind(this));\n }\n\n this._initializingActive = false;\n this.setColor(this.options.default);\n }).bind(this));\n }\n\n // Does only the absolutly basic thing to initialize the components\n _preBuild() {\n const opt = this.options;\n\n // Check if element is selector\n if (typeof opt.el === 'string') {\n opt.el = document.querySelector(opt.el);\n }\n\n // Create element and append it to body to\n // prevent initialization errors\n this._root = create(opt);\n\n // Check if a custom button is used\n if (opt.useAsButton) {\n\n // Check if the user has an alternative location defined, used body as fallback\n if (!opt.parent) {\n opt.parent = 'body';\n }\n\n this._root.button = opt.el; // Replace button with customized button\n }\n\n document.body.appendChild(this._root.root);\n }\n\n _finalBuild() {\n const opt = this.options;\n const root = this._root;\n\n // Remove from body\n document.body.removeChild(root.root);\n\n // Check parent option\n if (opt.parent) {\n\n // Check if element is selector\n if (typeof opt.parent === 'string') {\n opt.parent = document.querySelector(opt.parent);\n }\n\n opt.parent.appendChild(root.app);\n }\n\n // Don't replace the the element if a custom button is used\n if (!opt.useAsButton) {\n\n // Replace element with actual color-picker\n opt.el.parentElement.replaceChild(root.root, opt.el);\n }\n\n // Call disable to also add the disabled class\n if (opt.disabled) {\n this.disable();\n }\n\n // Check if color comparison is disabled, if yes - remove transitions so everything keeps smoothly\n if (!opt.comparison) {\n root.button.style.transition = 'none';\n if (!opt.useAsButton) {\n root.preview.lastColor.style.transition = 'none';\n }\n }\n\n // Check showAlways option\n opt.showAlways ? root.app.classList.add('visible') : this.hide();\n }\n\n _buildComponents() {\n\n // Instance reference\n const inst = this;\n const comp = this.options.components;\n\n const components = {\n\n palette: Moveable({\n element: inst._root.palette.picker,\n wrapper: inst._root.palette.palette,\n\n onchange(x, y) {\n const {_color, _root, options} = inst;\n\n // Calculate saturation based on the position\n _color.s = (x / this.wrapper.offsetWidth) * 100;\n\n // Calculate the value\n _color.v = 100 - (y / this.wrapper.offsetHeight) * 100;\n\n // Prevent falling under zero\n _color.v < 0 ? _color.v = 0 : 0;\n\n // Set picker and gradient color\n const cssRGBaString = _color.toRGBA().toString();\n this.element.style.background = cssRGBaString;\n this.wrapper.style.background = `\n linear-gradient(to top, rgba(0, 0, 0, ${_color.a}), transparent), \n linear-gradient(to left, hsla(${_color.h}, 100%, 50%, ${_color.a}), rgba(255, 255, 255, ${_color.a}))\n `;\n\n // Check if color is locked\n if (!options.comparison) {\n _root.button.style.background = cssRGBaString;\n\n if (!options.useAsButton) {\n _root.preview.lastColor.style.background = cssRGBaString;\n }\n }\n\n // Change current color\n _root.preview.currentColor.style.background = cssRGBaString;\n\n // Update the input field only if the user is currently not typing\n if (inst._recalc) {\n inst._updateOutput();\n }\n\n // If the user changes the color, remove the cleared icon\n _root.button.classList.remove('clear');\n }\n }),\n\n hue: Moveable({\n lockX: true,\n element: inst._root.hue.picker,\n wrapper: inst._root.hue.slider,\n\n onchange(x, y) {\n if (!comp.hue) return;\n\n // Calculate hue\n inst._color.h = (y / this.wrapper.offsetHeight) * 360;\n\n // Update color\n this.element.style.backgroundColor = `hsl(${inst._color.h}, 100%, 50%)`;\n components.palette.trigger();\n }\n }),\n\n opacity: Moveable({\n lockX: true,\n element: inst._root.opacity.picker,\n wrapper: inst._root.opacity.slider,\n\n onchange(x, y) {\n if (!comp.opacity) return;\n\n // Calculate opacity\n inst._color.a = Math.round(((y / this.wrapper.offsetHeight)) * 1e2) / 100;\n\n // Update color\n this.element.style.background = `rgba(0, 0, 0, ${inst._color.a})`;\n inst.components.palette.trigger();\n }\n }),\n\n selectable: Selectable({\n elements: inst._root.interaction.options,\n className: 'active',\n onchange(e) {\n inst._representation = e.target.getAttribute('data-type').toUpperCase();\n inst._updateOutput();\n }\n })\n };\n\n this.components = components;\n }\n\n _bindEvents() {\n const {_root, options} = this;\n\n const eventBindings = [\n\n // Clear color\n _.on(_root.interaction.clear, 'click', () => this._clearColor()),\n\n // Select last color on click\n _.on(_root.preview.lastColor, 'click', () => this.setHSVA(...this._lastColor.toHSVA())),\n\n // Save color\n _.on(_root.interaction.save, 'click', () => {\n !this.applyColor() && !options.showAlways && this.hide();\n }),\n\n // Detect user input and disable auto-recalculation\n _.on(_root.interaction.result, ['keyup', 'input'], e => {\n this._recalc = false;\n\n // Fire listener if initialization is finish and changed color was valid\n if (this.setColor(e.target.value, true) && !this._initializingActive) {\n this.options.onChange(this._color, this);\n }\n\n e.stopImmediatePropagation();\n }),\n\n // Cancel input detection on color change\n _.on([\n _root.palette.palette,\n _root.palette.picker,\n _root.hue.slider,\n _root.hue.picker,\n _root.opacity.slider,\n _root.opacity.picker\n ], ['mousedown', 'touchstart'], () => this._recalc = true),\n\n // Repositioning on resize\n _.on(window, 'resize', () => this._rePositioningPicker)\n ];\n\n // Color swatches\n if (_root.swatches) {\n eventBindings.push(\n _.on(_root.swatches, 'click', ({target}) => {\n const color = options.swatches[Number(target.getAttribute('data-color-index'))];\n\n if (color) {\n this.setHSVA(...color.toHSVA(), true);\n\n // Fire event\n options.onSwatchSelect(color, this);\n }\n })\n );\n }\n\n // Provide hiding / showing abilities only if showAlways is false\n if (!options.showAlways) {\n const ck = options.closeWithKey;\n\n eventBindings.push(\n // Save and hide / show picker\n _.on(_root.button, 'click', () => this.isOpen() ? this.hide() : this.show()),\n\n // Close with escape key\n _.on(document, 'keyup', e => this.isOpen() && (e.key === ck || e.code === ck) && this.hide()),\n\n // Cancel selecting if the user taps behind the color picker\n _.on(document, ['touchstart', 'mousedown'], e => {\n if (this.isOpen() && !_.eventPath(e).some(el => el === _root.app || el === _root.button)) {\n this.hide();\n }\n }, {capture: true})\n );\n }\n\n // Make input adjustable if enabled\n if (options.adjustableNumbers) {\n _.adjustableInputNumbers(_root.interaction.result, false);\n }\n\n // Save bindings\n this._eventBindings = eventBindings;\n }\n\n _rePositioningPicker() {\n const root = this._root;\n const app = this._root.app;\n\n // Check if user has defined a parent\n if (this.options.parent) {\n const relative = root.button.getBoundingClientRect();\n app.style.position = 'fixed';\n app.style.marginLeft = `${relative.left}px`;\n app.style.marginTop = `${relative.top}px`;\n }\n\n const bb = root.button.getBoundingClientRect();\n const ab = app.getBoundingClientRect();\n const as = app.style;\n\n // Check if picker is cuttet of from the top & bottom\n if (ab.bottom > window.innerHeight) {\n as.top = `${-(ab.height) - 5}px`;\n } else if (bb.bottom + ab.height < window.innerHeight) {\n as.top = `${bb.height + 5}px`;\n }\n\n // Positioning picker on the x-axis\n const pos = {\n left: -(ab.width) + bb.width,\n middle: -(ab.width / 2) + bb.width / 2,\n right: 0\n };\n\n const cl = parseInt(getComputedStyle(app).left, 10);\n let newLeft = pos[this.options.position];\n const leftClip = (ab.left - cl) + newLeft;\n const rightClip = (ab.left - cl) + newLeft + ab.width;\n\n /**\n * First check if position is left or right but\n * pickr-app cannot set to left AND right because it would\n * be clipped by the browser width. If so, wrap it and position\n * pickr below button via the pos[middle] value.\n * The current selected posiotion should'nt be the middle.di\n */\n if (this.options.position !== 'middle' && (\n (leftClip < 0 && -leftClip < ab.width / 2) ||\n (rightClip > window.innerWidth && rightClip - window.innerWidth < ab.width / 2))) {\n newLeft = pos['middle'];\n\n /**\n * Even if set to middle pickr is getting clipped, so\n * set it to left / right.\n */\n } else if (leftClip < 0) {\n newLeft = pos['right'];\n } else if (rightClip > window.innerWidth) {\n newLeft = pos['left'];\n }\n\n as.left = `${newLeft}px`;\n }\n\n _updateOutput() {\n\n // Check if component is present\n if (this._root.interaction.type()) {\n\n this._root.interaction.result.value = (() => {\n\n // Construct function name and call if present\n const method = 'to' + this._root.interaction.type().getAttribute('data-type');\n return typeof this._color[method] === 'function' ? this._color[method]().toString() : '';\n })();\n }\n\n // Fire listener if initialization is finish\n if (!this._initializingActive) {\n this.options.onChange(this._color, this);\n }\n }\n\n applyColor(silent = false) {\n const {preview, button} = this._root;\n\n // Change preview and current color\n const cssRGBaString = this._color.toRGBA().toString();\n preview.lastColor.style.background = cssRGBaString;\n\n // Change only the button color if it isn't customized\n if (!this.options.useAsButton) {\n button.style.background = cssRGBaString;\n }\n\n // User changed the color so remove the clear clas\n button.classList.remove('clear');\n\n // Save last color\n this._lastColor = this._color.clone();\n\n // Fire listener\n if (!this._initializingActive && !silent) {\n this.options.onSave(this._color, this);\n }\n }\n\n _clearColor() {\n const {_root, options} = this;\n\n // Change only the button color if it isn't customized\n if (!options.useAsButton) {\n _root.button.style.background = 'rgba(255, 255, 255, 0.4)';\n }\n\n _root.button.classList.add('clear');\n\n if (!options.showAlways) {\n this.hide();\n }\n\n // Fire listener\n options.onChange(null, this);\n }\n\n /**\n * Destroy's all functionalitys\n */\n destroy() {\n this._eventBindings.forEach(args => _.off(...args));\n Object.keys(this.components).forEach(key => this.components[key].destroy());\n }\n\n /**\n * Destroy's all functionalitys and removes\n * the pickr element.\n */\n destroyAndRemove() {\n this.destroy();\n\n // Remove element\n const root = this._root.root;\n root.parentElement.removeChild(root);\n }\n\n /**\n * Hides the color-picker ui.\n */\n hide() {\n this._root.app.classList.remove('visible');\n return this;\n }\n\n /**\n * Shows the color-picker ui.\n */\n show() {\n if (this.options.disabled) return;\n this._root.app.classList.add('visible');\n this._rePositioningPicker();\n return this;\n }\n\n /**\n * @return {boolean} If the color picker is currently open\n */\n isOpen() {\n return this._root.app.classList.contains('visible');\n }\n\n /**\n * Set a specific color.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @param a Alpha channel (0 - 1)\n * @param silent If the button should not change the color\n * @return true if the color has been accepted\n */\n setHSVA(h = 360, s = 0, v = 0, a = 1, silent = false) {\n\n // Deactivate color calculation\n const recalc = this._recalc; // Save state\n this._recalc = false;\n\n // Validate input\n if (h < 0 || h > 360 || s < 0 || s > 100 || v < 0 || v > 100 || a < 0 || a > 1) {\n return false;\n }\n\n // Short names\n const {hue, opacity, palette} = this.components;\n\n // Calculate y position of hue slider\n const hueWrapper = hue.options.wrapper;\n const hueY = hueWrapper.offsetHeight * (h / 360);\n hue.update(0, hueY);\n\n // Calculate y position of opacity slider\n const opacityWrapper = opacity.options.wrapper;\n const opacityY = opacityWrapper.offsetHeight * a;\n opacity.update(0, opacityY);\n\n // Calculate y and x position of color palette\n const pickerWrapper = palette.options.wrapper;\n const pickerX = pickerWrapper.offsetWidth * (s / 100);\n const pickerY = pickerWrapper.offsetHeight * (1 - (v / 100));\n palette.update(pickerX, pickerY);\n\n // Override current color and re-active color calculation\n this._color = new HSVaColor(h, s, v, a);\n this._recalc = recalc; // Restore old state\n\n // Update output if recalculation is enabled\n if (this._recalc) {\n this._updateOutput();\n }\n\n // Check if call is silent\n if (!silent) {\n this.applyColor();\n }\n\n return true;\n }\n\n /**\n * Tries to parse a string which represents a color.\n * Examples: #fff\n * rgb 10 10 200\n * hsva 10 20 5 0.5\n * @param string\n * @param silent\n */\n setColor(string, silent = false) {\n\n // Check if null\n if (string === null) {\n this._clearColor();\n return true;\n }\n\n const {values, type} = Color.parseToHSV(string);\n\n // Check if color is ok\n if (values) {\n\n // Change selected color format\n const utype = type.toUpperCase();\n const {options} = this._root.interaction;\n const target = options.find(el => el.getAttribute('data-type') === utype);\n\n // Auto select only if not hidden\n if (!target.hidden) {\n for (const el of options) {\n el.classList[el === target ? 'add' : 'remove']('active');\n }\n }\n\n return this.setHSVA(...values, silent);\n }\n }\n\n /**\n * Changes the color _representation.\n * Allowed values are HEX, RGBA, HSVA, HSLA and CMYK\n * @param type\n * @returns {boolean} if the selected type was valid.\n */\n setColorRepresentation(type) {\n\n // Force uppercase to allow a case-sensitiv comparison\n type = type.toUpperCase();\n\n // Find button with given type and trigger click event\n return !!this._root.interaction.options.find(v => v.getAttribute('data-type') === type && !v.click());\n }\n\n /**\n * Returns the current color representaion. See setColorRepresentation\n * @returns {*}\n */\n getColorRepresentation() {\n return this._representation;\n }\n\n /**\n * @returns HSVaColor Current HSVaColor object.\n */\n getColor() {\n return this._color;\n }\n\n /**\n * @returns The root HTMLElement with all his components.\n */\n getRoot() {\n return this._root;\n }\n\n /**\n * Disable pickr\n */\n disable() {\n this.hide();\n this.options.disabled = true;\n this._root.button.classList.add('disabled');\n return this;\n }\n\n /**\n * Enable pickr\n */\n enable() {\n this.options.disabled = false;\n this._root.button.classList.remove('disabled');\n return this;\n }\n}\n\nfunction create(options) {\n const {components, strings, useAsButton, swatches} = options;\n const hidden = con => con ? '' : 'style=\"display:none\" hidden';\n\n const root = _.createFromTemplate(`\n
\n \n ${useAsButton ? '' : '
'}\n\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n \n ${swatches && swatches.length ? `\n
\n ${swatches.map((v, i) => `
`).join('')}\n
\n ` : ''}\n\n
\n \n\n \n \n \n \n \n\n \n \n
\n
\n
\n `);\n\n const int = root.interaction;\n\n // Select option which is not hidden\n int.options.find(o => !o.hidden && !o.classList.add('active'));\n\n // Create method to find currenlty active option\n int.type = () => int.options.find(e => e.classList.contains('active'));\n return root;\n}\n\n// Static methods\nPickr.utils = {\n once: _.once,\n on: _.on,\n off: _.off,\n eventPath: _.eventPath,\n createElementFromString: _.createElementFromString,\n adjustableInputNumbers: _.adjustableInputNumbers,\n removeAttribute: _.removeAttribute,\n createFromTemplate: _.createFromTemplate\n};\n\n// Create instance via method\nPickr.create = (options) => new Pickr(options);\n\n// Export\nPickr.version = '0.3.6';\nexport default Pickr;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/Readme.md b/Readme.md index b7567fc4..75893366 100644 --- a/Readme.md +++ b/Readme.md @@ -49,10 +49,7 @@ You can also take a look at our [Walkthroughs](https://github.com/Lombiq/Orchard ## Dependencies -This module has the following dependencies: - -- [Lombiq Helpful Libraries for Orchard Core](https://github.com/Lombiq/Helpful-Libraries) -- [Lombiq Node.js Extensions](https://gihub.com/Lombiq/NodeJs-Extensions) +This module uses [Lombiq Helpful Libraries for Orchard Core](https://github.com/Lombiq/Helpful-Libraries) to make a few things simpler. But don't worry, we'll explain it. ## Contributing and support From e6674d94ec499aeea0f78425312f9a0d40038af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 16:46:14 +0100 Subject: [PATCH 06/26] Adding alternative Helpful Libraries dependency --- Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj index 9ef79ab7..9237685b 100644 --- a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj +++ b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj @@ -45,8 +45,15 @@ - + + + + + + + From cfaed368750bdee2f6245d0e0872c2d4f96ea11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 16:54:16 +0100 Subject: [PATCH 07/26] Testing package consolidation validation --- .../Lombiq.TrainingDemo.csproj | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj index 9237685b..9386a9cd 100644 --- a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj +++ b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj @@ -22,27 +22,27 @@ - - + + - - - - - - - - - - + + + + + + + + + + - - + + - - + + + From f5c280b1eb202b6789d1d45635050fa02099f881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 18:40:55 +0100 Subject: [PATCH 18/26] Configuring Auto Setup --- Lombiq.TrainingDemo.Web/Program.cs | 4 +++- Lombiq.TrainingDemo.Web/appsettings.json | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Lombiq.TrainingDemo.Web/Program.cs b/Lombiq.TrainingDemo.Web/Program.cs index 9e53a3f7..6ec7912d 100644 --- a/Lombiq.TrainingDemo.Web/Program.cs +++ b/Lombiq.TrainingDemo.Web/Program.cs @@ -4,7 +4,9 @@ builder.Host.UseNLogHost(); -builder.Services.AddOrchardCms(); +builder.Services + .AddOrchardCms() + .AddSetupFeatures("OrchardCore.AutoSetup"); var app = builder.Build(); diff --git a/Lombiq.TrainingDemo.Web/appsettings.json b/Lombiq.TrainingDemo.Web/appsettings.json index 6d278895..7e5dd832 100644 --- a/Lombiq.TrainingDemo.Web/appsettings.json +++ b/Lombiq.TrainingDemo.Web/appsettings.json @@ -6,4 +6,23 @@ "Microsoft.Hosting.Lifetime": "Information" } }, + "OrchardCore": { + "OrchardCore_AutoSetup": { + "AutoSetupPath": "", + "Tenants": [ + { + "ShellName": "Default", + "SiteName": "Lombiq Training Demo for Orchard Core", + "SiteTimeZone": "Europe/Budapest", + "AdminUsername": "admin", + "AdminEmail": "admin@example.com", + "AdminPassword": "Password1!", + "DatabaseProvider": "Sqlite", + "DatabaseConnectionString": "", + "DatabaseTablePrefix": "", + "RecipeName": "Lombiq.TrainingDemo" + } + ] + } + } } From 6c18936663bf6e66fd65c57fc4accb69f7dd3dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 18:55:54 +0100 Subject: [PATCH 19/26] Docs --- Readme.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Readme.md b/Readme.md index 75893366..cd9f8b77 100644 --- a/Readme.md +++ b/Readme.md @@ -15,37 +15,34 @@ The module assumes that you have a good understanding of basic Orchard concepts, Before you dive deep into this module it'd be best if you make sure that you have done the following: - You know how ASP.NET Core MVC works. It's important that you understand how ASP.NET Core MVC works or generally what MVC is about. If you are not familiar with the topic take a look at the tutorials at . -- You've read through the documentation under (at least the "About Orchard Core" section, but it would be great if you'd skim the whole documentation). +- You've read through the documentation under (at least the "About Orchard Core" section, but it would be great if you'd skim the whole documentation). - You know Orchard Core from a user's perspective and understand the fundamental concepts underlying the system. (The [Dojo Course 3 tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial) may help you with that.) -The [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions) repository showcases a web app using Orchard Core from NuGet packages, and it includes this module too. Furthermore, it also contains all of Lombiq's open-source Orchard themes and modules as a bonus! (Check them out for what we have already solved for you.) So, just use that to work with this module: +The module comes together with its own standalone solution and web app. So, to run it, simply do the following: -1. Complete [the repository's prerequisites](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions#prerequisites-and-getting-started) and clone the latest `dev` "[Open-Source-Orchard-Core-Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions)" branch. -2. Make sure the `Lombiq.OSOCE.Web` project is the startup project (it should be). -3. Start the app with Ctrl + F5 (_see note *_). -4. Set up the website using the "Training Demo" recipe. - -> _* Note:_ to avoid build errors, the first run of Lombiq.OSOCE.Web must be done with Ctrl + F5. **Do not use** the Visual Studio "IIS Express" (play) button or compile with Ctrl + B initially. After the initial "setup", once you have created the admin user, you can then run it using the Visual Studio "IIS Express" (play button). +1. Clone this repository to the latest `dev` branch or download the source. +2. Open the solution in your favorite IDE, like Visual Studio. +3. Make sure the `Lombiq.TrainingDemo.Web` project is the startup project (it should be). +4. Start the app. In Visual Studio, you can do this with Ctrl + F5. From the .NET CLI, run `dotnet run` in the _Lombiq.TrainingDemo.Web_ folder and then open in a browser. +5. The site will be automatically set up with "Training Demo" recipe (since we use Orchard Core's [Auto Setup feature](https://docs.orchardcore.net/en/latest/docs/reference/modules/AutoSetup/)). You'll be able to log in with the username "admin" and password "Password1!". ## Learning Orchard Core with this module -Once the app is running, head over to the **[Lombiq.TrainingDemo/StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md)** file (_see note *_) and start exploring all the great things you can do in Orchard Core. - -> _* Note:_ The "**Lombiq.TrainingDemo/StartLearningHere.md**" file introduces the Lombiq.TrainingDemo project. You can find the Lombiq.TrainingDemo folder inside the src > Modules directory of the "Open-Source-Orchard-Core-Extensions" (OSOCE) repository previously cloned (point number 1 of [How to start](#how-to-start) section). +Once the app is running, head over to the **[StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md)** file (_see note *_) and start exploring all the great things you can do in Orchard Core. -Also if you are brave enough to not follow any guide or you want to start the guide from somewhere else then go to the **Map.cs** file and jump to any class you are interested in. [Lombiq.TrainingDemo/StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md) also has training sections linked so you can go to a broader section. +Also if you are brave enough to not follow any guide or you want to start the guide from somewhere else then go to the **Map.cs** file and jump to any class you are interested in. [StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md) also has training sections linked so you can go to a broader section. Be sure to check out the [Orchard Dojo Library for Orchard Core](https://orcharddojo.net/orchard-resources/CoreLibrary/) for a wealth of Orchard Core guidelines, best practices, development utilities (like scripts and snippets), and more as well! You can also follow the [Dojo Course 3 tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial) if you like to learn from videos. -Keep in mind that your best living reference of how to do something in Orchard is [the official repo](https://github.com/OrchardCMS/OrchardCore) and our Open-Source Orchard Core Extensions solution. Clone both and keep the solutions open when you’re working on something so you can quickly look up anything. +Keep in mind that your best living reference of how to do something in Orchard is [the official repo](https://github.com/OrchardCMS/OrchardCore) and our [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions) (OSOCE) solution. Clone both and keep the solutions open when you’re working on something so you can quickly look up anything. As a bonus, OSOCE also contains all of Lombiq's open-source Orchard themes and modules! Check it out for what we've already solved for you. If you'd like to clean out comments from code files so you can just see the essence, then use the [Comment Remover VS extension](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CommentRemover) to quickly do it. Take a look at the Recipes menu in the Admin screen to load in additional sample content. This is not included by default to reduce clutter. -You can also take a look at our [Walkthroughs](https://github.com/Lombiq/Orchard-Walkthroughs) module, for step-by-step walkthroughs, which are guided by pop-up windows. +You can also take a look at our [Walkthroughs](https://github.com/Lombiq/Orchard-Walkthroughs) module, for step-by-step walkthroughs, which are guided by pop-up windows right there in the UI. ## Dependencies @@ -58,7 +55,7 @@ Bug reports, feature requests, comments, questions, code contributions and love When adding new tutorials please keep in mind the following: - Insert tutorial steps into the existing flow, either at the end or between two existing ones. Use "NEXT STATION" comments to indicate the next file the reader should check out. -- If it's a new training section then indicate as such by an "END OF TRAINING SECTION" comment at the end and add it to the list under [Lombiq.TrainingDemo/StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md). +- If it's a new training section then indicate as such by an "END OF TRAINING SECTION" comment at the end and add it to the list under [StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md). - Add pointers to its classes/files in _Map.cs_. This project is developed by [Lombiq Technologies](https://lombiq.com/). Commercial-grade support is available through Lombiq. From 8bbec423e6ebc3a1bd280922c617a123c05dbb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 19:09:17 +0100 Subject: [PATCH 20/26] Moving previous workflows where they should be --- .../workflows/create-jira-issues-for-community-activities.yml | 0 .../.github => .github}/workflows/validate-pull-request.yml | 0 Lombiq.TrainingDemo.sln | 2 ++ 3 files changed, 2 insertions(+) rename {Lombiq.TrainingDemo/.github => .github}/workflows/create-jira-issues-for-community-activities.yml (100%) rename {Lombiq.TrainingDemo/.github => .github}/workflows/validate-pull-request.yml (100%) diff --git a/Lombiq.TrainingDemo/.github/workflows/create-jira-issues-for-community-activities.yml b/.github/workflows/create-jira-issues-for-community-activities.yml similarity index 100% rename from Lombiq.TrainingDemo/.github/workflows/create-jira-issues-for-community-activities.yml rename to .github/workflows/create-jira-issues-for-community-activities.yml diff --git a/Lombiq.TrainingDemo/.github/workflows/validate-pull-request.yml b/.github/workflows/validate-pull-request.yml similarity index 100% rename from Lombiq.TrainingDemo/.github/workflows/validate-pull-request.yml rename to .github/workflows/validate-pull-request.yml diff --git a/Lombiq.TrainingDemo.sln b/Lombiq.TrainingDemo.sln index a8d501f1..1ba05a78 100644 --- a/Lombiq.TrainingDemo.sln +++ b/Lombiq.TrainingDemo.sln @@ -22,6 +22,8 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{1BED0174-67AC-4155-BA45-AF690BDA553B}" ProjectSection(SolutionItems) = preProject .github\workflows\build-and-test-orchard.yml = .github\workflows\build-and-test-orchard.yml + .github\workflows\create-jira-issues-for-community-activities.yml = .github\workflows\create-jira-issues-for-community-activities.yml + .github\workflows\validate-pull-request.yml = .github\workflows\validate-pull-request.yml EndProjectSection EndProject Global From 5799b639a073410071a88551eb95521c0ea8a20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 19:12:37 +0100 Subject: [PATCH 21/26] More docs --- Readme.md | 53 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/Readme.md b/Readme.md index cd9f8b77..c87b02f1 100644 --- a/Readme.md +++ b/Readme.md @@ -8,7 +8,7 @@ If you prefer tutorial videos more then check out the [Dojo Course 3, the comple **If you are interested in training materials and personalized Orchard trainings please visit [Orchard Dojo](https://orcharddojo.net/).** -## How to start +## Prerequisites The module assumes that you have a good understanding of basic Orchard concepts, and that you can get around the Orchard admin area (the [official documentation](https://docs.orchardcore.net/) and the [Dojo Course 3 tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial) may help you with that). You should also be familiar with how to use Visual Studio (or any other C# IDE) and write C#, as well as the concepts of ASP.NET Core MVC. @@ -18,7 +18,9 @@ Before you dive deep into this module it'd be best if you make sure that you hav - You've read through the documentation under (at least the "About Orchard Core" section, but it would be great if you'd skim the whole documentation). - You know Orchard Core from a user's perspective and understand the fundamental concepts underlying the system. (The [Dojo Course 3 tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial) may help you with that.) -The module comes together with its own standalone solution and web app. So, to run it, simply do the following: +## How to start learning Orchard Core with this module + +The module comes with its own standalone solution and web app. So, to run it, simply do the following: 1. Clone this repository to the latest `dev` branch or download the source. 2. Open the solution in your favorite IDE, like Visual Studio. @@ -26,27 +28,32 @@ The module comes together with its own standalone solution and web app. So, to r 4. Start the app. In Visual Studio, you can do this with Ctrl + F5. From the .NET CLI, run `dotnet run` in the _Lombiq.TrainingDemo.Web_ folder and then open in a browser. 5. The site will be automatically set up with "Training Demo" recipe (since we use Orchard Core's [Auto Setup feature](https://docs.orchardcore.net/en/latest/docs/reference/modules/AutoSetup/)). You'll be able to log in with the username "admin" and password "Password1!". -## Learning Orchard Core with this module - -Once the app is running, head over to the **[StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md)** file (_see note *_) and start exploring all the great things you can do in Orchard Core. - -Also if you are brave enough to not follow any guide or you want to start the guide from somewhere else then go to the **Map.cs** file and jump to any class you are interested in. [StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md) also has training sections linked so you can go to a broader section. - -Be sure to check out the [Orchard Dojo Library for Orchard Core](https://orcharddojo.net/orchard-resources/CoreLibrary/) for a wealth of Orchard Core guidelines, best practices, development utilities (like scripts and snippets), and more as well! - -You can also follow the [Dojo Course 3 tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial) if you like to learn from videos. - -Keep in mind that your best living reference of how to do something in Orchard is [the official repo](https://github.com/OrchardCMS/OrchardCore) and our [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions) (OSOCE) solution. Clone both and keep the solutions open when you’re working on something so you can quickly look up anything. As a bonus, OSOCE also contains all of Lombiq's open-source Orchard themes and modules! Check it out for what we've already solved for you. - -If you'd like to clean out comments from code files so you can just see the essence, then use the [Comment Remover VS extension](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CommentRemover) to quickly do it. - -Take a look at the Recipes menu in the Admin screen to load in additional sample content. This is not included by default to reduce clutter. - -You can also take a look at our [Walkthroughs](https://github.com/Lombiq/Orchard-Walkthroughs) module, for step-by-step walkthroughs, which are guided by pop-up windows right there in the UI. - -## Dependencies - -This module uses [Lombiq Helpful Libraries for Orchard Core](https://github.com/Lombiq/Helpful-Libraries) to make a few things simpler. But don't worry, we'll explain it. +Once the app is running: + +- Head over to the **[StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md)** file (_see note *_) and start exploring all the great things you can do in Orchard Core. +- If you are brave enough to not follow any guide or you want to start the guide from somewhere else then go to the **[Map.cs](Lombiq.TrainingDemo/Map.cs)** file and jump to any class you are interested in. [StartLearningHere.md](Lombiq.TrainingDemo/StartLearningHere.md) also has training sections linked so you can go to a broader section. +- If you'd like to clean out comments from code files so you can just see the essence, then use the [Comment Remover VS extension](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CommentRemover) to quickly do it. +- Take a look at the Recipes menu in the Admin screen to load in additional sample content. This is not included by default to reduce clutter. +- This module uses [Lombiq Helpful Libraries for Orchard Core](https://github.com/Lombiq/Helpful-Libraries) to make a few things simpler. But don't worry, we'll explain it. + +## Further resources + +Some further reading if you're hungry for more knowledge. + +- You can also follow the [Dojo Course 3 tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial) if you like to learn from videos. +- This module is not about showing you how to create an Orchard Core application from scratch. For that, we recommend you use the `Initialize-OrchardCoreSolution` script from ouf [Utility Scripts project](https://github.com/Lombiq/Utility-Scripts). +- Keep in mind that your best living reference of how to do something in Orchard is [the official repo](https://github.com/OrchardCMS/OrchardCore) and our [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions) (OSOCE) solution. Clone both and keep the solutions open when you’re working on something so you can quickly look up anything. As a bonus, OSOCE also contains all of Lombiq's open-source Orchard themes and modules! Check it out for what we've already solved for you. +- You can also take a look at our [Walkthroughs](https://github.com/Lombiq/Orchard-Walkthroughs) module, for step-by-step walkthroughs, which are guided by pop-up windows right there in the UI. +- Be sure to check out the [Orchard Dojo Library for Orchard Core](https://orcharddojo.net/orchard-resources/CoreLibrary/) for a wealth of Orchard Core guidelines, best practices, development utilities (like scripts and snippets), and more as well! +- This project utilizes several [GitHub Actions](https://docs.github.com/en/actions) workflows, like [Build and Test Orchard Core solution](https://github.com/Lombiq/GitHub-Actions/blob/dev/Docs/Workflows/BuildDotNetCoreOrchardCore/BuildAndTestOrchardCoreSolution.md) to provide CI builds. We recommend using such workflows form our [Lombiq GitHub Actions project](https://github.com/Lombiq/GitHub-Actions) for automation. +- If you're ready to make a jump to fully automated Quality Assurance beyond unit testing as demonstrated here, check out the following projects: + - [Lombiq .NET Analyzers](https://github.com/Lombiq/.NET-Analyzers): Orchard Core-optimized static code analysis of all C# code during editing and build. + - [Lombiq Node.js Extensions](https://github.com/Lombiq/NodeJs-Extensions): Linting, build, and minification of SCSS, JS, and Markdown files, integrated into the .NET build. + - [Lombiq Testing Toolbox for Orchard Core](https://github.com/Lombiq/Testing-Toolbox): Helps you write unit tests for Orchard Core projects. + - [Lombiq UI Testing Toolbox for Orchard Core](https://github.com/Lombiq/UI-Testing-Toolbox): Web UI testing toolbox for Orchard Core applications. Everything you need to do UI testing with Selenium for an Orchard app is there, including accessibility checks and security scanning. + - [Lombiq GitHub Actions](https://github.com/Lombiq/GitHub-Actions): Ready-to-use, developer-friendly GitHub Actions CI/CD workflows that build Orchard Core projects, run static code analysis, execute unit/UI tests, and provide reports and artifacts. Automation for deploying and operating Azure-hosted apps is also included, as well as YAML linting. + - [Lombiq PowerShell Analyzers](https://github.com/Lombiq/PowerShell-Analyzers): Static code analysis for PowerShell scripts, even if the scripts are part of an Orchard Core solution. + - [Lombiq Hosting - Azure Application Insights for Orchard Core](https://github.com/Lombiq/Orchard-Azure-Application-Insights): Orchard Core module that enables easy integration of Azure Application Insights into Orchard. Detailed telemetry is collected about the app, enriched with Orchard-specific data points. ## Contributing and support From 5abdf0fff4aeb8121c7fa2e27ba29c221651bff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 22 Feb 2024 19:23:18 +0100 Subject: [PATCH 22/26] Typos --- .../Properties/launchSettings.json | 6 +++--- Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj | 2 +- Readme.md | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Lombiq.TrainingDemo.Web/Properties/launchSettings.json b/Lombiq.TrainingDemo.Web/Properties/launchSettings.json index fc2c26fd..2a67eba0 100644 --- a/Lombiq.TrainingDemo.Web/Properties/launchSettings.json +++ b/Lombiq.TrainingDemo.Web/Properties/launchSettings.json @@ -1,7 +1,7 @@ { "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, + "windowsAuthentication": false, + "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:8080", "sslPort": 44300 @@ -24,4 +24,4 @@ } } } -} \ No newline at end of file +} diff --git a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj index e39fc1c4..ef0c9342 100644 --- a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj +++ b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj @@ -43,7 +43,7 @@ + as well as from https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions. --> diff --git a/Readme.md b/Readme.md index c87b02f1..3dc548c3 100644 --- a/Readme.md +++ b/Readme.md @@ -6,7 +6,7 @@ Demo [Orchard Core](https://orchardcore.net/) module for training purposes guidi If you prefer tutorial videos more then check out the [Dojo Course 3, the complete Orchard Core tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial). -**If you are interested in training materials and personalized Orchard trainings please visit [Orchard Dojo](https://orcharddojo.net/).** +**If you are interested in training materials and personalized Orchard training please visit [Orchard Dojo](https://orcharddojo.net/).** ## Prerequisites @@ -26,7 +26,7 @@ The module comes with its own standalone solution and web app. So, to run it, si 2. Open the solution in your favorite IDE, like Visual Studio. 3. Make sure the `Lombiq.TrainingDemo.Web` project is the startup project (it should be). 4. Start the app. In Visual Studio, you can do this with Ctrl + F5. From the .NET CLI, run `dotnet run` in the _Lombiq.TrainingDemo.Web_ folder and then open in a browser. -5. The site will be automatically set up with "Training Demo" recipe (since we use Orchard Core's [Auto Setup feature](https://docs.orchardcore.net/en/latest/docs/reference/modules/AutoSetup/)). You'll be able to log in with the username "admin" and password "Password1!". +5. The site will be automatically set up with the "Training Demo" recipe (since we use Orchard Core's [Auto Setup feature](https://docs.orchardcore.net/en/latest/docs/reference/modules/AutoSetup/)). You'll be able to log in with the username "admin" and password "Password1!". Once the app is running: @@ -42,18 +42,18 @@ Some further reading if you're hungry for more knowledge. - You can also follow the [Dojo Course 3 tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial) if you like to learn from videos. - This module is not about showing you how to create an Orchard Core application from scratch. For that, we recommend you use the `Initialize-OrchardCoreSolution` script from ouf [Utility Scripts project](https://github.com/Lombiq/Utility-Scripts). -- Keep in mind that your best living reference of how to do something in Orchard is [the official repo](https://github.com/OrchardCMS/OrchardCore) and our [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions) (OSOCE) solution. Clone both and keep the solutions open when you’re working on something so you can quickly look up anything. As a bonus, OSOCE also contains all of Lombiq's open-source Orchard themes and modules! Check it out for what we've already solved for you. +- Keep in mind that your best living reference for how to do something in Orchard is [the official repo](https://github.com/OrchardCMS/OrchardCore) and our [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions) (OSOCE) solution. Clone both and keep the solutions open when you’re working on something so you can quickly look up anything. As a bonus, OSOCE also contains all of Lombiq's open-source Orchard themes and modules! Check it out for what we've already solved for you. - You can also take a look at our [Walkthroughs](https://github.com/Lombiq/Orchard-Walkthroughs) module, for step-by-step walkthroughs, which are guided by pop-up windows right there in the UI. - Be sure to check out the [Orchard Dojo Library for Orchard Core](https://orcharddojo.net/orchard-resources/CoreLibrary/) for a wealth of Orchard Core guidelines, best practices, development utilities (like scripts and snippets), and more as well! -- This project utilizes several [GitHub Actions](https://docs.github.com/en/actions) workflows, like [Build and Test Orchard Core solution](https://github.com/Lombiq/GitHub-Actions/blob/dev/Docs/Workflows/BuildDotNetCoreOrchardCore/BuildAndTestOrchardCoreSolution.md) to provide CI builds. We recommend using such workflows form our [Lombiq GitHub Actions project](https://github.com/Lombiq/GitHub-Actions) for automation. +- This project utilizes several [GitHub Actions](https://docs.github.com/en/actions) workflows, like [Build and Test Orchard Core solution](https://github.com/Lombiq/GitHub-Actions/blob/dev/Docs/Workflows/BuildDotNetCoreOrchardCore/BuildAndTestOrchardCoreSolution.md) to provide CI builds. We recommend using such workflows from our [Lombiq GitHub Actions project](https://github.com/Lombiq/GitHub-Actions) for automation. - If you're ready to make a jump to fully automated Quality Assurance beyond unit testing as demonstrated here, check out the following projects: - [Lombiq .NET Analyzers](https://github.com/Lombiq/.NET-Analyzers): Orchard Core-optimized static code analysis of all C# code during editing and build. - - [Lombiq Node.js Extensions](https://github.com/Lombiq/NodeJs-Extensions): Linting, build, and minification of SCSS, JS, and Markdown files, integrated into the .NET build. + - [Lombiq Node.js Extensions](https://github.com/Lombiq/NodeJs-Extensions): Linting, build, and minification of SCSS/JS/Markdown files, integrated into the .NET build. - [Lombiq Testing Toolbox for Orchard Core](https://github.com/Lombiq/Testing-Toolbox): Helps you write unit tests for Orchard Core projects. - [Lombiq UI Testing Toolbox for Orchard Core](https://github.com/Lombiq/UI-Testing-Toolbox): Web UI testing toolbox for Orchard Core applications. Everything you need to do UI testing with Selenium for an Orchard app is there, including accessibility checks and security scanning. - [Lombiq GitHub Actions](https://github.com/Lombiq/GitHub-Actions): Ready-to-use, developer-friendly GitHub Actions CI/CD workflows that build Orchard Core projects, run static code analysis, execute unit/UI tests, and provide reports and artifacts. Automation for deploying and operating Azure-hosted apps is also included, as well as YAML linting. - [Lombiq PowerShell Analyzers](https://github.com/Lombiq/PowerShell-Analyzers): Static code analysis for PowerShell scripts, even if the scripts are part of an Orchard Core solution. - - [Lombiq Hosting - Azure Application Insights for Orchard Core](https://github.com/Lombiq/Orchard-Azure-Application-Insights): Orchard Core module that enables easy integration of Azure Application Insights into Orchard. Detailed telemetry is collected about the app, enriched with Orchard-specific data points. + - [Lombiq Hosting - Azure Application Insights for Orchard Core](https://github.com/Lombiq/Orchard-Azure-Application-Insights): Orchard Core module that enables easy integration of Azure Application Insights into Orchard. Detailed telemetry is collected about the app, enriched with Orchard-specific data points. ## Contributing and support From 8f840398599bc6f7ab20d18ca79535b5d4f4cd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 25 Feb 2024 23:35:50 +0100 Subject: [PATCH 23/26] Docs clarification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sára El-Saig --- Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj index ef0c9342..a7bd09d6 100644 --- a/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj +++ b/Lombiq.TrainingDemo/Lombiq.TrainingDemo.csproj @@ -42,8 +42,9 @@ - + From 0e137c40f8092c45d3087509b107c0e2e6ac0449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 25 Feb 2024 23:38:48 +0100 Subject: [PATCH 24/26] Grammar --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 3dc548c3..03a11e7d 100644 --- a/Readme.md +++ b/Readme.md @@ -6,7 +6,7 @@ Demo [Orchard Core](https://orchardcore.net/) module for training purposes guidi If you prefer tutorial videos more then check out the [Dojo Course 3, the complete Orchard Core tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial). -**If you are interested in training materials and personalized Orchard training please visit [Orchard Dojo](https://orcharddojo.net/).** +**If you are interested in training resources and personalized Orchard training please visit [Orchard Dojo](https://orcharddojo.net/).** ## Prerequisites From 18398421c8fbce478d1e11492d04640b3d4a2330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 25 Feb 2024 23:43:42 +0100 Subject: [PATCH 25/26] Removing strange characters from placeholder --- Lombiq.TrainingDemo.Web/wwwroot/.placeholder | 1 - 1 file changed, 1 deletion(-) diff --git a/Lombiq.TrainingDemo.Web/wwwroot/.placeholder b/Lombiq.TrainingDemo.Web/wwwroot/.placeholder index 46b134b1..e69de29b 100644 --- a/Lombiq.TrainingDemo.Web/wwwroot/.placeholder +++ b/Lombiq.TrainingDemo.Web/wwwroot/.placeholder @@ -1 +0,0 @@ -˙ţ \ No newline at end of file From d6544fa4e91c9e7987795d4e40c01561e941c062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 25 Feb 2024 23:51:02 +0100 Subject: [PATCH 26/26] Adding reset script --- Lombiq.TrainingDemo.sln | 1 + Reset-Local.ps1 | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 Reset-Local.ps1 diff --git a/Lombiq.TrainingDemo.sln b/Lombiq.TrainingDemo.sln index 1ba05a78..97feab90 100644 --- a/Lombiq.TrainingDemo.sln +++ b/Lombiq.TrainingDemo.sln @@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .gitignore = .gitignore License.md = License.md Readme.md = Readme.md + Reset-Local.ps1 = Reset-Local.ps1 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{C209F02F-E88D-48DC-8645-BD859AA4521A}" diff --git a/Reset-Local.ps1 b/Reset-Local.ps1 new file mode 100644 index 00000000..66244fea --- /dev/null +++ b/Reset-Local.ps1 @@ -0,0 +1,4 @@ +# You can use this script to reset the app, i.e., it'll run the setup on the next launch again. Execute it only when the +# app is not running. + +Remove-Item '.\Lombiq.TrainingDemo.Web\App_Data' -Recurse && Write-Output 'Successfully reset website.'