diff --git a/.github/workflows/image-compression.yml b/.github/workflows/image-compression.yml new file mode 100644 index 0000000000..9cbaa00d90 --- /dev/null +++ b/.github/workflows/image-compression.yml @@ -0,0 +1,21 @@ +name: Compress Images +on: + pull_request: + paths: + - '**.jpg' + - '**.jpeg' + - '**.png' + - '**.webp' +jobs: + build: + if: github.event.pull_request.head.repo.full_name == github.repository + name: calibreapp/image-actions + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Compress Images + uses: calibreapp/image-actions@main + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/docs/en/Authorization.md b/docs/en/Authorization.md index fbb71bb3d4..2fdc59c36b 100644 --- a/docs/en/Authorization.md +++ b/docs/en/Authorization.md @@ -393,6 +393,32 @@ public override void ConfigureServices(ServiceConfigurationContext context) This is already done for the startup template integration tests. +### Claims Principal Factory + +Claims are important elements of authentication and authorization. ABP uses the `IAbpClaimsPrincipalFactory` service to create claims on authentication. This service was designed as extensible. If you need to add your custom claims to the authentication ticket, you can implement the `IAbpClaimsPrincipalContributor` in your application. + +**Example: Add a `SocialSecurityNumber` claim:** + +```csharp +public class SocialSecurityNumberClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency +{ + public async Task ContributeAsync(AbpClaimsPrincipalContributorContext context) + { + var identity = context.ClaimsPrincipal.Identities.FirstOrDefault(); + var userId = identity?.FindUserId(); + if (userId.HasValue) + { + var userService = context.ServiceProvider.GetRequiredService(); //Your custom service + var socialSecurityNumber = await userService.GetSocialSecurityNumberAsync(userId.Value); + if (socialSecurityNumber != null) + { + identity.AddOrReplace(new Claim("SocialSecurityNumber", socialSecurityNumber)); + } + } + } +} +``` + ## See Also * [Permission Management Module](Modules/Permission-Management.md) diff --git a/docs/en/Blog-Posts/2021-04-26 v4_3_Release_Stable/POST.md b/docs/en/Blog-Posts/2021-04-26 v4_3_Release_Stable/POST.md new file mode 100644 index 0000000000..d06e2370e0 --- /dev/null +++ b/docs/en/Blog-Posts/2021-04-26 v4_3_Release_Stable/POST.md @@ -0,0 +1,53 @@ +# ABP.IO Platform 4.3 Final Has Been Released! + +[ABP Framework](https://abp.io/) and [ABP Commercial](https://commercial.abp.io/) 4.3 versions have been released today. + +## What's New With 4.3? + +Since all the new features are already explained in details with the 4.3 RC announcement posts, I will not repeat all the details again. See the related blog posts for all the features and enhancements; + +* [What's New with the ABP Framework 4.3](https://blog.abp.io/abp/ABP-Framework-4.3-RC-Has-Been-Published) +* [What's new with the ABP Commercial 4.3](https://blog.abp.io/abp/ABP-Commercial-4.3-RC-Has-Been-Published) + +## The Quick Start Tutorial + +With this version, we've created a minimalist [quick start tutorial](https://docs.abp.io/en/abp/latest/Tutorials/Todo/Index) for developers who are new to the ABP Framework. + +## How to Upgrade an Existing Solution + +### Install/Update the ABP CLI + +First of all, install the ABP CLI or upgrade to the latest version. + +If you haven't installed yet: + +```bash +dotnet tool install -g Volo.Abp.Cli +``` + +To update an existing installation: + +```bash +dotnet tool update -g Volo.Abp.Cli +``` + +### ABP UPDATE Command + +[ABP CLI](https://docs.abp.io/en/abp/latest/CLI) provides a handy command to update all the ABP related NuGet and NPM packages in your solution with a single command: + +```bash +abp update +``` + +Run this command in the root folder of your solution. + +## Migration Guides + +**Check the migration guides ([for ABP Framework](https://docs.abp.io/en/abp/latest/Migration-Guides/Abp-4_3) & for [ABP Commercial](https://docs.abp.io/en/commercial/latest/migration-guides/v4_3)) for the applications with the version 4.2.x upgrading to the version 4.3.0.** + +## The Road Map + +The next feature version will be 4.4. It is planned to release the 4.4 RC (Release Candidate) at the end of Quarter 2, 2021. See the updated road maps; + +* [ABP Framework Road Map](https://docs.abp.io/en/abp/latest/Road-Map) +* [ABP Commercial Road Map](https://docs.abp.io/en/commercial/latest/road-map) \ No newline at end of file diff --git a/docs/en/CLI.md b/docs/en/CLI.md index ebf27952b3..f2e7df219b 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -41,7 +41,6 @@ Here, the list of all available commands before explaining their details: * **`translate`**: Simplifies to translate localization files when you have multiple JSON [localization](Localization.md) files in a source control repository. * **`login`**: Authenticates on your computer with your [abp.io](https://abp.io/) username and password. * **`logout`**: Logouts from your computer if you've authenticated before. -* **`build`**: Builds a GIT repository and depending repositories or a single .NET solution. * **`bundle`**: Generates script and style references for an ABP Blazor project. ### help @@ -113,6 +112,7 @@ For more samples, go to [ABP CLI Create Solution Samples](CLI-New-Command-Sample * `SqlServer` * `MySQL` * `SQLite` + * `Oracle` * `Oracle-Devart` * `PostgreSQL` * `--local-framework-ref --abp-path`: Uses local projects references to the ABP framework instead of using the NuGet packages. This can be useful if you download the ABP Framework source code and have a local reference to the framework from your application. @@ -406,25 +406,6 @@ Logs you out by removing the session token from your computer. abp logout ``` -### build - -This command builds a GIT repository and it's depending repositories or a single .NET solution File. In order ```build``` command to work, its **executing directory** or passed ```--working-directory``` parameter's directory must contain one of; - -* A .NET solution file (*.sln) -* abp-build-config.json (suggested to add this to .gitignore) - -Usage: - -````bash -abp build [options] -```` - -Example: - -``` -abp build --build-name "prod" --dotnet-build-arguments "\"--no-dependencies\"" -``` - #### Options * ```--working-directory``` or ```-wd```: Specifies the working directory. This option is useful when the command is executed outside of a GIT repository or when executing directory doesn't contain a .NET solution file. @@ -435,9 +416,9 @@ abp build --build-name "prod" --dotnet-build-arguments "\"--no-dependencies\"" For more details, see [build command documentation](CLI-BuildCommand.md). -#### bundle +### bundle -This command generates script and style references for an ABP Blazor project and updates the **index.html** file. It helps developers to manage dependencies required by ABP modules easily. In order ```bundle``` command to work, its **executing directory** or passed ```--working-directory``` parameter's directory must contain a Blazor project file(*.csproj). +This command generates script and style references for an ABP Blazor WebAssembly project and updates the **index.html** file. It helps developers to manage dependencies required by ABP modules easily. In order ```bundle``` command to work, its **executing directory** or passed ```--working-directory``` parameter's directory must contain a Blazor project file(*.csproj). Usage: diff --git a/docs/en/Index.md b/docs/en/Index.md index cdd0908821..de88e2f2f8 100644 --- a/docs/en/Index.md +++ b/docs/en/Index.md @@ -10,10 +10,14 @@ ABP Framework is a complete **infrastructure** based on the **ASP.NET Core** to ### UI Framework Options +ABP Framework can work with any UI framework, while the following frameworks are supported out of the box: + ### Database Provider Options +ABP Framework can work with any database provider, while the following providers are supported out of the box: + ## Exploring the Documentation diff --git a/docs/en/Modules/Docs.md b/docs/en/Modules/Docs.md index 35478d9ce0..90c0699dfa 100644 --- a/docs/en/Modules/Docs.md +++ b/docs/en/Modules/Docs.md @@ -320,7 +320,7 @@ Open `DocsProjects` in your database, and insert a new record with the following * **ShortName**: A short and URL friendly name that will be used in your docs URL. * **Format**: The format of the document (for Markdown: `md`, for HTML: `html`) * **DefaultDocumentName**: The document for the initial page. -* **NavigationDocumentName**: The document to be used for the navigation menu (index). +* **NavigationDocumentName**: The document to be used for the navigation menu (Index). * **MinimumVersion**: The minimum version to show the docs. Below version will not be listed. * **DocumentStoreType**: The source of the documents (for GitHub:`GitHub`, for file system`FileSystem`) * **ExtraProperties**: A serialized `JSON` that stores special configuration for the selected `DocumentStoreType`. @@ -625,4 +625,4 @@ If your `IElasticClient` needs additional configuration, please use override `IE ## Next -Docs Module is also available as a standalone application. Check out [VoloDocs](../Apps/VoloDocs). \ No newline at end of file +Docs Module is also available as a standalone application. Check out [VoloDocs](../Apps/VoloDocs). diff --git a/docs/en/Multi-Tenancy.md b/docs/en/Multi-Tenancy.md index 8cdda55af2..5db646b7a7 100644 --- a/docs/en/Multi-Tenancy.md +++ b/docs/en/Multi-Tenancy.md @@ -315,6 +315,8 @@ Configure(options => * Add this code to the `ConfigureServices` method of your [module](Module-Development-Basics.md). * This should be done in the *Web/API Layer* since the URL is a web related stuff. +> There is an [example](https://github.com/abpframework/abp-samples/tree/master/DomainTenantResolver) that uses the subdomain to determining the current tenant. + ##### Custom Tenant Resolvers You can add implement your custom tenant resolver and configure the `AbpTenantResolveOptions` in your module's `ConfigureServices` method as like below: @@ -407,4 +409,4 @@ The [Tenant Management module](Modules/Tenant-Management.md) provides a basic UI ## See Also -* [Features](Features.md) \ No newline at end of file +* [Features](Features.md) diff --git a/docs/en/Repositories.md b/docs/en/Repositories.md index 3d0ea84821..7ed10b9bb8 100644 --- a/docs/en/Repositories.md +++ b/docs/en/Repositories.md @@ -70,8 +70,8 @@ Generic Repositories provides some standard CRUD features out of the box: There are overloads of these methods. -* Provides `Update` and `Delete` methods to update or delete an entity by entity object or it's id. -* Provides `Delete` method to delete multiple entities by a filter. +* Provides `UpdateAsync` and `DeleteAsync` methods to update or delete an entity by entity object or it's id. +* Provides `DeleteAsync` method to delete multiple entities by a filter. ### Querying / LINQ over the Repositories diff --git a/docs/en/Tutorials/Part-3.md b/docs/en/Tutorials/Part-3.md index 03daab1843..e724fa2c9f 100644 --- a/docs/en/Tutorials/Part-3.md +++ b/docs/en/Tutorials/Part-3.md @@ -1408,6 +1408,7 @@ Here the complete code to create the book management CRUD page, that has been de @using Acme.BookStore.Books @using Acme.BookStore.Localization @using Microsoft.Extensions.Localization +@using Volo.Abp.AspNetCore.Components.Web @inject IStringLocalizer L @inject AbpBlazorMessageLocalizerHelper LH @inherits AbpCrudPageBase diff --git a/docs/en/Tutorials/Part-9.md b/docs/en/Tutorials/Part-9.md index 1fb4d0e703..1ea6e5507d 100644 --- a/docs/en/Tutorials/Part-9.md +++ b/docs/en/Tutorials/Part-9.md @@ -844,6 +844,7 @@ Create a new Razor Component Page, `/Pages/Authors.razor`, in the `Acme.BookStor @page "/authors" @using Acme.BookStore.Authors @using Acme.BookStore.Localization +@using Volo.Abp.AspNetCore.Components.Web @inherits BookStoreComponentBase @inject IAuthorAppService AuthorAppService @inject AbpBlazorMessageLocalizerHelper LH diff --git a/docs/en/Tutorials/Todo/Index.md b/docs/en/Tutorials/Todo/Index.md index 5bbf4c8eaf..e71749544e 100644 --- a/docs/en/Tutorials/Todo/Index.md +++ b/docs/en/Tutorials/Todo/Index.md @@ -428,7 +428,7 @@ Open the `Index.cshtml` file in the `Pages` folder of the *TodoApp.Web* project ```` -We are using ABP's [card tag helper](../../UI/AspNetCore/Tag-Helpers/Cards.md) to create a simple card view. You could directly use the standard bootstrap HTML structure, however the ABP [tag helpers]() make it much easier and type safe. +We are using ABP's [card tag helper](../../UI/AspNetCore/Tag-Helpers/Cards.md) to create a simple card view. You could directly use the standard bootstrap HTML structure, however the ABP [tag helpers](../../UI/AspNetCore/Tag-Helpers/Index.md) make it much easier and type safe. This page imports a CSS and a JavaScript file, so we should also create them. diff --git a/docs/zh-Hans/Tutorials/todo/Index.md b/docs/zh-Hans/Tutorials/todo/Index.md new file mode 100644 index 0000000000..0676a6d894 --- /dev/null +++ b/docs/zh-Hans/Tutorials/todo/Index.md @@ -0,0 +1,822 @@ +# 快速入门 + +````json +//[doc-params] +{ + "UI": ["MVC", "Blazor", "BlazorServer", "NG"], + "DB": ["EF", "Mongo"] +} +```` + +这是一个单独的部分,使用ABP框架构建简单待办事项应用程序的快速入门教程.这是一个最终应用的截图: + +![todo-list](todo-list.png) + +你可以在[这里](https://github.com/abpframework/abp-samples/tree/master/TodoApp)找到已完成的项目源代码. + +## 先决条件 + +* 一个集成开发环境 (比如: [Visual Studio](https://visualstudio.microsoft.com/vs/)) 它需要支持 [.NET 5.0+](https://dotnet.microsoft.com/download/dotnet) 的开发. + +{{if DB=="Mongo"}} + +* [MongoDB Server 4.0+](https://docs.mongodb.com/manual/administration/install-community/) + +{{end}} + +{{if UI=="NG"}} + +* [Node v14.x](https://nodejs.org/) + +{{end}} + +## 创建新的解决方案 + +我们将使用[ABP CLI](../../CLI.md) 创建带有ABP框架的新解决方案. 你可以在命令行终端中运行以下命令来安装它: + +````bash +dotnet tool install -g Volo.Abp.Cli +```` + +然后创建一个空文件夹,打开命令行终端并以打开的文件夹为路径在终端中执行以下命令: + +````bash +abp new TodoApp{{if UI=="Blazor"}} -u blazor{{else if UI=="BlazorServer"}} -u blazor-server{{else if UI=="NG"}} -u angular{{end}}{{if DB=="Mongo"}} -d mongodb{{end}} +```` + +{{if UI=="NG"}} + +这将创建一个名为*TodoApp*的新解决方案,其中包含`angular`和`aspnet core`文件夹.解决方案就绪后,在你的IDE中打开ASP.NET Core 解决方案. + +{{else}} + +这将创建一个名为*TodoApp*的新解决方案.解决方案准备好后,在你的IDE中打开它. + +{{end}} + +### 创建数据库 + +如果你使用的是visual studio,请右键单击`TodoApp.DbMigrator`项目,选择*设置为启动项目*,然后按*Ctrl+F5*运行它而不进行调试.它将创建初始数据库并播种初始数据. + +{{if DB=="EF"}} + +> 由于*DbMigrator*添加初始迁移并重新编译项目,一些ide(例如Rider)在第一次运行时可能会出现问题.在这种情况下,请打开`.DbMigrator`项目文件夹中的命令行终端,然后执行`dotnet run`命令. + +{{end}} + +### 运行应用程序 + +{{if UI=="MVC" || UI=="BlazorServer"}} + +最好在开始开发之前运行一下应用程序.确保 {{if UI=="BlazorServer"}}`TodoApp.Blazor`{{else}}`TodoApp.Web`{{end}} 是启动项目,然后运行应用程序(Visual Studio中是Ctrl+F5)以查看查看初始UI: + +{{else if UI=="Blazor"}} + +最好在开始开发之前运行一下应用程序.该解决方案有两个主要应用: + +* `TodoApp.HttpApi.Host` 托管服务器端的 HTTP API. +* `TodoApp.Blazor` 客户端托管的 Blazor WebAssembly 应用. + +确保 `TodoApp.HttpApi.Host` 是启动项目,然后运行应用程序(Visual Studio中的Ctrl+F5)以查看[Swagger UI](https://swagger.io/tools/swagger-ui/)上server-side 的 HTTP API: + +![todo-swagger-ui-initial](todo-swagger-ui-initial.png) + +你可以使用此UI查看和测试你的HTTP API.现在,我们可以将 `TodoApp.Blazor` 设置为启动项目,并运行它来打开实际的Blazor应用程序UI: + +{{else if UI=="NG"}} + +最好在开始开发之前运行应用程序.该解决方案有两个主要应用: + +* `TodoApp.HttpApi.Host` (在.NET解决方案中)承载服务器端HTTP API. +* `angular` 文件夹包含 Angular 应用程序. + +确保`TodoApp.HttpApi.Host`project是启动项目,然后运行应用程序(visual studio中是Ctrl+F5)以查看[Swagger UI](https://swagger.io/tools/swagger-ui/)上server-side HTTP API: + +![todo-swagger-ui-initial](todo-swagger-ui-initial.png) + +你可以使用这个UI查看和测试你的HTTP API.如果可以的话,我们可以运行Angular客户端应用程序. + +首先,运行以下命令来还原NPM包: + +````bash +npm install +```` + +安装所有软件包需要一些时间.然后可以使用以下命令运行应用程序: + +````bash +npm start +```` + +此命令需要一点时间,但最终会在默认浏览器中运行并打开应用程序: + +{{end}} + +![todo-ui-initial](todo-ui-initial.png) + +你可以单击 *登录* 按钮,以`admin`作为用户名,`1q2w3E*` 作为密码登录到应用程序. + +一切就绪.我们可以开始编码了! + +## 领域层 + +此应用程序只有一个 [实体](../../Entities.md) 我们开始创建它. 在*TodoApp.Domain*项目中创建一个新的 `TodoItem` 类: + +````csharp +using System; +using Volo.Abp.Domain.Entities; + +namespace TodoApp +{ + public class TodoItem : BasicAggregateRoot + { + public string Text { get; set; } + } +} +```` + +`BasicAggregateRoot` 是创建根实体的最简单的基类之一,`Guid` 是这里实体的主键 (`Id`). + +## Database Integration 数据库集成 + +{{if DB=="EF"}} + +下一步是配置 [Entity Framework Core](../../Entity-Framework-Core.md). + +### Mapping Configuration 映射配置 + +在 *TodoApp.EntityFrameworkCore* 项目的 `EntityFrameworkCore` 文件夹中打开 `TodoAppDbContext` 类,并向该类添加一个新的 `DbSet` 属性: + +````csharp +public DbSet TodoItems { get; set; } +```` + +然后在同一文件夹中打开 `TodoAppDbContextModelCreatingExtensions` 类,并为 `TodoItem` 类添加映射配置,如下所示: + +````csharp +public static void ConfigureTodoApp(this ModelBuilder builder) +{ + Check.NotNull(builder, nameof(builder)); + + builder.Entity(b => + { + b.ToTable("TodoItems"); + }); +} +```` + +我们已经将 `TodoItem` 实体映射到数据库中的 `TodoItems` 表. + +### 代码优先迁移 + +解决方案启动模版已经配置为使用Entity Framework Core [Code First 迁移](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations).由于我们已经更改了数据库映射配置,因此我们应该创建一个新的迁移并将更改应用于数据库. + +在 *TodoApp.EntityFrameworkCore.DbMigrations* 项目的目录中打开一个命令行终端,然后键入以下命令: + +````bash +dotnet ef migrations add Added_TodoItem +```` + +这将向项目添加一个新的迁移类: + +![todo-efcore-migration](todo-efcore-migration.png) + +你可以在同一命令行终端中使用以下命令将更改应用于数据库: + +````bash +dotnet ef database update +```` + +> 如果你使用的是Visual Studio,*则可能希望在包管理器控制台 (PMC)* 中使用 `Add-Migration Added_TodoItem` 和 `Update-Database` 命令.在这种情况下,请确保 {{if UI=="MVC"}}`TodoApp.Web`{{else if UI=="BlazorServer"}}`TodoApp.Blazor`{{else if UI=="Blazor" || UI=="NG"}}`TodoApp.HttpApi.Host`{{end}} 是启动项目,并且 `TodoApp.EntityFrameworkCore.DbMigrations` 是PMC中的 *默认项目*. +{{else if DB=="Mongo"}} + +下一步是设置 [MongoDB](../MongoDB.md) 配置.在 *TodoApp.MongoDB* 项目的 `MongoDb` 文件夹中打开 `TodoAppMongoDbContext` 类,并进行以下更改; + +1. 向类添加新属性: + +````csharp +public IMongoCollection TodoItems => Collection(); +```` + +2. 在 `CreateModel` 方法中添加以下代码: + +````csharp +modelBuilder.Entity(b => +{ + b.CollectionName = "TodoItems"; +}); +```` + +{{end}} + +现在,我们可以使用ABP仓储来保存和检索待办事项列表项了,就像我们将在下一节中做的那样. + +## 应用层 + +[应用服务](../../Application-Services.md) 用于执行应用程序的用例.我们需要执行以下用例; + +* 获取待办事项列表 +* 创建新的待办事项 +* 删除现有的待办事项 + +### 应用服务接口 + +我们可以从为应用程序服务定义一个接口开始.在 *TodoApp.Application.Contracts* 项目中创建一个新的 `ITodoAppService` 接口,如下所示: + +````csharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace TodoApp +{ + public interface ITodoAppService : IApplicationService + { + Task> GetListAsync(); + Task CreateAsync(string text); + Task DeleteAsync(Guid id); + } +} +```` + +### 数据传输对象 + +`GetListAsync` 和 `CreateAsync` 方法返回 `TodoItemDto`. 通常应用服务获取或返回的是 DTO ([数据传输对象](../../Data-Transfer-Objects.md)) 而不是直接获取或返回实体对象. 所以,我们应该在此定义 DTO(数据传输对象) 类. 在 *TodoApp.Application.Contracts* 项目中创建一个名为 `TodoItemDto` 的类: + +````csharp +using System; + +namespace TodoApp +{ + public class TodoItemDto + { + public Guid Id { get; set; } + public string Text { get; set; } + } +} +```` + +这是一个非常简单的DTO类,与我们的 `TodoItem` 实体相对应.我们接下来实现 `ITodoAppService` 接口. + +### 应用服务实现 + +在 *TodoApp.Application* 项目内部创建一个 `TodoAppService` 类,如下所示: + +````csharp +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; + +namespace TodoApp +{ + public class TodoAppService : ApplicationService, ITodoAppService + { + private readonly IRepository _todoItemRepository; + + public TodoAppService(IRepository todoItemRepository) + { + _todoItemRepository = todoItemRepository; + } + + // TODO: Implement the methods here... + } +} +```` + +该类继承自ABP框架的 `ApplicationService` 类,并实现了之前定义的 `ITodoAppService`接口.ABP为实体提供默认的通用的 [仓储](../repositories.md).我们可以使用它们来执行基本的数据库操作. 这个类 [注入](../Dependency-Injection.md) `IRepository` 它是 `TodoItem` 实体的默认存储库.我们将使用它来实现之前描述的用例. + +#### 获取所有待办事项列表 + +让我们开始实现 `GetListAsync` 方法: + +````csharp +public async Task> GetListAsync() +{ + var items = await _todoItemRepository.GetListAsync(); + return items + .Select(item => new TodoItemDto + { + Id = item.Id, + Text = item.Text + }).ToList(); +} +```` + +我们只是简单的从数据库中获取完整的 `TodoItem` 列表,将它们映射到 `TodoItemDto` 对象并作为结果返回. + +#### 创建一个新的待办事项 + +下一个方法是 `CreateAsync`,我们可以像如下所示来实现: + +````csharp +public async Task CreateAsync(string text) +{ + var todoItem = await _todoItemRepository.InsertAsync( + new TodoItem {Text = text} + ); + + return new TodoItemDto + { + Id = todoItem.Id, + Text = todoItem.Text + }; +} +```` + +仓储的 `InsertAsync` 方法将给定的 `TodoItem` 插入数据库,并返回相同的 `TodoItem` 对象.它还设置了 `Id`,因此我们可以在返回对象上使用它.我们只是通过从新的 `TodoItem` 实体创建和返回 `TodoItemDto`. + +#### 删除待办事项 + +最后,我们可以将 `DeleteAsync` 实现为以下代码块: + +````csharp +public async Task DeleteAsync(Guid id) +{ + await _todoItemRepository.DeleteAsync(id); +} +```` + +至此,应用程序服务已准备好了让UI层来使用. + +## 用户界面层 + +是时候在UI上显示待办事项了!在开始编写代码之前,最好记住我们正在尝试构建的内容.这是最终UI的示例屏幕截图: + +![todo-list](todo-list.png) + +> **我们将在本教程中保持最简洁轻量的UI端,以使本教程简单且重点突出.请参阅[web应用程序开发教程](../Part-1.md) 以构建包含各个方面的真实页面.** + +{{if UI=="MVC"}} + +### Index.cshtml.cs + +在 *TodoApp.Web* 项目的 `Pages` 文件夹中打开 `Index.cshtml.cs` 文件,并用以下代码块替换它的默认内容: + +````csharp +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace TodoApp.Web.Pages +{ + public class IndexModel : TodoAppPageModel + { + public List TodoItems { get; set; } + + private readonly ITodoAppService _todoAppService; + + public IndexModel(ITodoAppService todoAppService) + { + _todoAppService = todoAppService; + } + + public async Task OnGetAsync() + { + TodoItems = await _todoAppService.GetListAsync(); + } + } +} +```` + +此类使用 `ITodoAppService` 获取待办事项目列表并将它赋值给 `TodoItems` 属性.我们将用它来渲染razor页面上的待办事项目列表. + +### Index.cshtml + +在 *TodoApp.Web* 项目的 `Pages` 文件夹中打开 `Index.cshtml` 文件,并替换为以下内容: + +````xml +@page +@model TodoApp.Web.Pages.IndexModel +@section styles { + +} +@section scripts { + +} +
+ + + + TODO LIST + + + + +
+ + +
+ + +
    + @foreach (var todoItem in Model.TodoItems) + { +
  • + @todoItem.Text +
  • + } +
+
+
+
+```` + +我们使用ABP的 [卡片标签助手](../../UI/AspNetCore/Tag-Helpers/Cards.md) 创建一个简单的卡片视图.你可以直接使用标准的bootstrap HTML, 不过ABP的[标签助手](../../UI/AspNetCore/Tag-Helpers/Index.md) 使它更简单并且类型安全. + +这个页面要导入一个CSS和一个JavaScript文件,所以我们也应该创建它们. + +### Index.js + +在 *TodoApp.Web* 项目的 `Pages` 文件夹中打开 `Index.js` 文件,并替换为以下内容: + +````js +$(function () { + + // DELETING ITEMS ///////////////////////////////////////// + $('#TodoList').on('click', 'li i', function(){ + var $li = $(this).parent(); + var id = $li.attr('data-id'); + + todoApp.todo.delete(id).then(function(){ + $li.remove(); + abp.notify.info('Deleted the todo item.'); + }); + }); + + // CREATING NEW ITEMS ///////////////////////////////////// + $('#NewItemForm').submit(function(e){ + e.preventDefault(); + + var todoText = $('#NewItemText').val(); + todoApp.todo.create(todoText).then(function(result){ + $('
  • ') + .html(' ' + result.text) + .appendTo($('#TodoList')); + $('#NewItemText').val(''); + }); + }); +}); +```` + +在第一部分中,我们在待办事项目附近注册点击删除图标所要触发的事件,删除服务器上的相关待办事项并在UI上显示通知.另外,我们从DOM中删除已删除的项,因此我们不需要刷新页面. + +在第二部分中,我们在服务器上创建一个新的待办事项.如果成功,我们将操纵DOM以将新的 `
  • ` 元素插入todo列表.这样,创建新的待办事项后就不用刷新整个页面了. + +这里有趣的部分是我们如何与服务器通信.请参阅 *动态JavaScript代理和自动API控制器* 部分,以了解其工作原理.但是现在让我们继续并完成这个应用程序. + +### Index.css + +来到最后要做的工作,请打开 *TodoApp.Web* 项目的 `Pages` 文件夹中的 `Index.css` 文件,并替换为以下内容: + +````css +#TodoList{ + list-style: none; + margin: 0; + padding: 0; +} + +#TodoList li { + padding: 5px; + margin: 5px 0px; + border: 1px solid #cccccc; + background-color: #f5f5f5; +} + +#TodoList li i +{ + opacity: 0.5; +} + +#TodoList li i:hover +{ + opacity: 1; + color: #ff0000; + cursor: pointer; +} +```` + +这是待办事项页面的简单样式.我们相信你可以做得更好 :) + +现在,你可以再次运行应用程序以查看结果. + +### Dynamic JavaScript Proxies & Auto API Controllers 动态JavaScript代理和自动应用编程接口控制器 + +在 `Index.js` 文件中,我们使用了 `todoApp.todo.delete(...)` 和 `todoApp.todo.create(...)` 函数与服务器通信.这些函数是由ABP框架动态创建的,这要归功于 [动态JavaScript客户端代理](../UI/AspNetCore/Dynamic-JavaScript-Proxies.md) 系统.他们对服务器执行HTTP API调用并返回承诺,因此你可以像上面所做的那样注册对 `then` 函数的回调. + +但是,你可能会问我们还没有创建任何API控制器,那么服务器如何处理这些请求呢? 这个问题为我们引出了ABP框架的 [自动API控制器](../API/Auto-API-Controllers.md) 功能.它通过约定自动将应用程序服务转换为API Controllers(API控制器). + +如果通过在应用程序中输入 `/swagger` URL来打开 [swagger UI](https://swagger.io/tools/ Swagger-ui/),则可以看到Todo API: + +![todo-api](todo-api.png) + +{{else if UI=="Blazor" || UI=="BlazorServer"}} + +### Index.razor.cs + +在 *TodoApp.Blazor* 项目的 `Pages` 文件夹中打开 `Index.razor.cs` 文件,并用以下代码块替换内容: + +````csharp +using Microsoft.AspNetCore.Components; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace TodoApp.Blazor.Pages +{ + public partial class Index + { + [Inject] + private ITodoAppService TodoAppService { get; set; } + + private List TodoItems { get; set; } = new List(); + private string NewTodoText { get; set; } + + protected async override Task OnInitializedAsync() + { + TodoItems = await TodoAppService.GetListAsync(); + } + + private async Task Create() + { + var result = await TodoAppService.CreateAsync(NewTodoText); + TodoItems.Add(result); + NewTodoText = null; + } + + private async Task Delete(TodoItemDto todoItem) + { + await TodoAppService.DeleteAsync(todoItem.Id); + await Notify.Info("Deleted the todo item."); + TodoItems.Remove(todoItem); + } + } +} +```` + +这个类使用 `ITodoAppService` 对待办事项执行操作.它在创建和删除操作后操纵 `TodoItems` 列表.这样,我们不需要从服务器刷新整个todo列表. + +{{if UI=="Blazor"}} + +请参阅下面的 *动态C # 代理和自动API控制器* 部分,了解如何从浏览器上运行的Blazor应用程序注入和使用应用程序服务接口!但是现在,让我们继续并完成这个应用. + +{{end # Blazor}} + +### Index.razor + +在 *TodoApp.Blazor* 项目的 `Pages` 文件夹中打开 `Index.razor` 文件,并用以下代码块替换内容: + +````xml +@page "/" +@inherits TodoAppComponentBase +
    + + + + TODO LIST + + + + +
    + + +
    + + +
      + @foreach (var todoItem in TodoItems) + { +
    • + @todoItem.Text +
    • + } +
    +
    +
    +
    +```` + +### Index.razor.css + +最后,请在 *TodoApp.Web* 项目的 `Pages` 文件夹中打开 `Index.razor.css` 文件,并替换为以下内容: + +````css +#TodoList{ + list-style: none; + margin: 0; + padding: 0; +} + +#TodoList li { + padding: 5px; + margin: 5px 0px; + border: 1px solid #cccccc; + background-color: #f5f5f5; +} + +#TodoList li i +{ + opacity: 0.5; +} + +#TodoList li i:hover +{ + opacity: 1; + color: #ff0000; + cursor: pointer; +} +```` + +这是待办事项页面的简单样式.我们相信你可以做得更好 :) + +现在,你可以再次运行应用程序以查看结果. + +{{if UI=="Blazor"}} + +### Dynamic C# Proxies & Auto API Controllers 动态C#代理和自动应用编程接口控制器 + +在 `Index.razor.cs` 文件中,我们已经注入(使用 `[Inject]` 特性)并像使用本地服务一样使用 `ITodoAppService`.请记住,当此应用程序服务的实例在服务器上运行的同时,Blazor应用程序正在浏览器上运行. + +这个神奇的过程是由ABP框架的 [动态C#客户端代理](../API/Dynamic-CSharp-API-Clients.md) 系统完成的.它使用标准的 `HttpClient` 并向远程服务器执行HTTP API请求.它还为我们处理所有标准任务,包括授权,JSON序列化和异常处理. + +但是,你可能会问我们还没有创建任何API控制器,那么服务器如何处理这些请求呢? 这个问题为我们引出了ABP框架的 [自动API控制器](../API/Auto-API-Controllers.md) 功能.它通过约定自动将应用程序服务转换为API控制器. + +如果你运行 `TodoApp.HttpApi.Host` 应用程序,你可以看到Todo API: + +![todo-api](todo-api.png) + +{{end # Blazor}} + +{{else if UI=="NG"}} + +### 服务代理生成 + +ABP提供了一个方便的功能,可以自动创建客户端服务,轻松使用服务器提供的HTTP APIs. + +你首先需要运行 `TodoApp.HttpApi.Host` 项目,因为代理生成器从服务器应用程序读取API定义. + +> **请注意**: IIS Express有问题; 它不允许从另一个进程连接到应用程序.如果你使用的是Visual Studio,请在 “运行” 按钮下拉列表中选择 `TodoApp.HttpApi.Host` 而不是IIS Express,如下图所示: +![run-without-iisexpress](run-without-iisexpress.png) + +运行 `TodoApp.HttpApi.Host` 项目后,在 `angular` 文件夹中打开命令行终端,然后键入以下命令: + +````bash +abp generate-proxy +```` + +如果一切顺利,应该生成如下所示的输出: + +````bash +CREATE src/app/proxy/generate-proxy.json (170978 bytes) +CREATE src/app/proxy/README.md (1000 bytes) +CREATE src/app/proxy/todo.service.ts (794 bytes) +CREATE src/app/proxy/models.ts (66 bytes) +CREATE src/app/proxy/index.ts (58 bytes) +```` + +然后,我们可以使用 `todoService` 来使用服务器端HTTP APIs,就像我们将在下一节中做的那样. + +### home.component.ts + +打开 `/angular/src/app/home/home.component.ts` 文件,并用以下代码块替换其内容: + +````js +import { ToasterService } from '@abp/ng.theme.shared'; +import { Component, OnInit } from '@angular/core'; +import { TodoItemDto, TodoService } from '@proxy'; + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.scss'] +}) +export class HomeComponent implements OnInit { + + todoItems: TodoItemDto[]; + newTodoText: string; + + constructor( + private todoService: TodoService, + private toasterService: ToasterService) + { } + + ngOnInit(): void { + this.todoService.getList().subscribe(response => { + this.todoItems = response; + }); + } + + create(): void{ + this.todoService.create(this.newTodoText).subscribe((result) => { + this.todoItems = this.todoItems.concat(result); + this.newTodoText = null; + }); + } + + delete(id: string): void { + this.todoService.delete(id).subscribe(() => { + this.todoItems = this.todoItems.filter(item => item.id !== id); + this.toasterService.info('Deleted the todo item.'); + }); + } +} + +```` + +我们已经实现了使用 `todoService` 来获取待办事项目列表,并将返回值赋值给 `todoItems` 数组.我们还添加了 `create`和 `delete` 方法.这些方法将在视图端使用. + +### home.component.html + +打开 `/angular/src/app/home/home.component.html` 文件,并用以下代码块替换其内容: + +````html +
    +
    +
    +
    TODO LIST
    +
    +
    + +
    + + +
    + + +
      +
    • + {%{{{ todoItem.text }}}%} +
    • +
    +
    +
    +
    +```` + +### home.component.scss + +最后的最后,打开 `/angular/src/app/home/home.component.scss` 文件,并用以下代码块替换其内容: + +````css +#TodoList{ + list-style: none; + margin: 0; + padding: 0; +} + +#TodoList li { + padding: 5px; + margin: 5px 0px; + border: 1px solid #cccccc; + background-color: #f5f5f5; +} + +#TodoList li i +{ + opacity: 0.5; +} + +#TodoList li i:hover +{ + opacity: 1; + color: #ff0000; + cursor: pointer; +} +```` + +这是待办事项页面的简单样式.我们相信你可以做得更好 :) + +现在,你可以再次运行应用程序以查看结果. + +{{end}} + +## 总结 + +在本教程中,我们构建了一个非常简单的应用程序来抢先探究ABP框架的新特性.如果你想构建一个实际场景的应用程序,请查看 [应用程序开发教程](../Part-1.md),其中涵盖了实际web应用程序开发的所有方面. + +## 源代码 + +你可以在[这里](https://github.com/abpframework/abp-samples/tree/master/TodoApp)获取到完整的应用程序源代码. + +## 另请参见 + +* [Web应用程序开发教程](../Part-1.md) diff --git a/docs/zh-Hans/Tutorials/todo/run-without-iisexpress.png b/docs/zh-Hans/Tutorials/todo/run-without-iisexpress.png new file mode 100644 index 0000000000..41898e6c00 Binary files /dev/null and b/docs/zh-Hans/Tutorials/todo/run-without-iisexpress.png differ diff --git a/docs/zh-Hans/Tutorials/todo/todo-api.png b/docs/zh-Hans/Tutorials/todo/todo-api.png new file mode 100644 index 0000000000..f9a25f57b5 Binary files /dev/null and b/docs/zh-Hans/Tutorials/todo/todo-api.png differ diff --git a/docs/zh-Hans/Tutorials/todo/todo-efcore-migration.png b/docs/zh-Hans/Tutorials/todo/todo-efcore-migration.png new file mode 100644 index 0000000000..df370aebcf Binary files /dev/null and b/docs/zh-Hans/Tutorials/todo/todo-efcore-migration.png differ diff --git a/docs/zh-Hans/Tutorials/todo/todo-list.png b/docs/zh-Hans/Tutorials/todo/todo-list.png new file mode 100644 index 0000000000..e2eaf8bc46 Binary files /dev/null and b/docs/zh-Hans/Tutorials/todo/todo-list.png differ diff --git a/docs/zh-Hans/Tutorials/todo/todo-swagger-ui-initial.png b/docs/zh-Hans/Tutorials/todo/todo-swagger-ui-initial.png new file mode 100644 index 0000000000..1d3ed405c7 Binary files /dev/null and b/docs/zh-Hans/Tutorials/todo/todo-swagger-ui-initial.png differ diff --git a/docs/zh-Hans/Tutorials/todo/todo-ui-initial.png b/docs/zh-Hans/Tutorials/todo/todo-ui-initial.png new file mode 100644 index 0000000000..44be4ceaf6 Binary files /dev/null and b/docs/zh-Hans/Tutorials/todo/todo-ui-initial.png differ diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/AbpComponentsClaimsCache.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/AbpComponentsClaimsCache.cs index 3e3cf26e5b..281b2f7ded 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/AbpComponentsClaimsCache.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/AbpComponentsClaimsCache.cs @@ -1,6 +1,7 @@ using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.DependencyInjection; namespace Volo.Abp.AspNetCore.Components.Web.Security @@ -9,15 +10,19 @@ namespace Volo.Abp.AspNetCore.Components.Web.Security typeof(AbpComponentsClaimsCache), typeof(IAsyncInitialize) )] - public class AbpComponentsClaimsCache : ISingletonDependency, IAsyncInitialize + public class AbpComponentsClaimsCache : IScopedDependency, IAsyncInitialize { public ClaimsPrincipal Principal { get; private set; } private readonly AuthenticationStateProvider _authenticationStateProvider; - public AbpComponentsClaimsCache(AuthenticationStateProvider authenticationStateProvider) + public AbpComponentsClaimsCache(IClientScopeServiceProviderAccessor clientScopeServiceProviderAccessor) { - _authenticationStateProvider = authenticationStateProvider; + _authenticationStateProvider = clientScopeServiceProviderAccessor.ServiceProvider.GetRequiredService(); + _authenticationStateProvider.AuthenticationStateChanged += async (task) => + { + Principal = (await task).User; + }; } public virtual async Task InitializeAsync() diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs index fc7b6ef930..addef3dc80 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs @@ -1,6 +1,7 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Routing; using Volo.Abp.UI.Navigation; @@ -10,6 +11,9 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic { [Inject] protected IMenuManager MenuManager { get; set; } + + [Inject] + protected AuthenticationStateProvider AuthenticationStateProvider { get; set; } protected ApplicationMenu Menu { get; set; } @@ -18,6 +22,12 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic Menu = await MenuManager.GetAsync(StandardMenus.User); Navigation.LocationChanged += OnLocationChanged; + + AuthenticationStateProvider.AuthenticationStateChanged += async (task) => + { + Menu = await MenuManager.GetAsync(StandardMenus.User); + await InvokeAsync(StateHasChanged); + }; } protected virtual void OnLocationChanged(object sender, LocationChangedEventArgs e) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpWebAssemblyHostBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpWebAssemblyHostBuilderExtensions.cs index c2d433f8f9..f05feacae8 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpWebAssemblyHostBuilderExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/AspNetCore/Components/WebAssembly/Hosting/AbpWebAssemblyHostBuilderExtensions.cs @@ -48,17 +48,12 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Hosting Check.NotNull(application, nameof(application)); Check.NotNull(serviceProvider, nameof(serviceProvider)); - var serviceProviderAccessor = (ComponentsClientScopeServiceProviderAccessor) - serviceProvider.GetRequiredService(); - serviceProviderAccessor.ServiceProvider = serviceProvider; + ((ComponentsClientScopeServiceProviderAccessor) serviceProvider + .GetRequiredService()).ServiceProvider = serviceProvider; application.Initialize(serviceProvider); - - using (var scope = serviceProvider.CreateScope()) - { - await InitializeModulesAsync(scope.ServiceProvider); - await SetCurrentLanguageAsync(scope); - } + await InitializeModulesAsync(serviceProvider); + await SetCurrentLanguageAsync(serviceProvider); } private static async Task InitializeModulesAsync(IServiceProvider serviceProvider) @@ -69,11 +64,11 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Hosting } } - private static async Task SetCurrentLanguageAsync(IServiceScope scope) + private static async Task SetCurrentLanguageAsync(IServiceProvider serviceProvider) { - var configurationClient = scope.ServiceProvider.GetRequiredService(); - var utilsService = scope.ServiceProvider.GetRequiredService(); - var configuration = configurationClient.Get(); + var configurationClient = serviceProvider.GetRequiredService(); + var utilsService = serviceProvider.GetRequiredService(); + var configuration = await configurationClient.GetAsync(); var cultureName = configuration.Localization?.CurrentCulture?.CultureName; if (!cultureName.IsNullOrEmpty()) { diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCurrentPrincipalAccessor.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCurrentPrincipalAccessor.cs index e38cb9258b..36438871c1 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCurrentPrincipalAccessor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCurrentPrincipalAccessor.cs @@ -1,4 +1,5 @@ using System.Security.Claims; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Components.Web.Security; using Volo.Abp.DependencyInjection; using Volo.Abp.Security.Claims; @@ -10,9 +11,9 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly protected AbpComponentsClaimsCache ClaimsCache { get; } public WebAssemblyCurrentPrincipalAccessor( - AbpComponentsClaimsCache claimsCache) + IClientScopeServiceProviderAccessor clientScopeServiceProviderAccessor) { - ClaimsCache = claimsCache; + ClaimsCache = clientScopeServiceProviderAccessor.ServiceProvider.GetRequiredService(); } protected override ClaimsPrincipal GetClaimsPrincipal() diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs index 6afb918704..1a94e3f536 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpAccordionItemTagHelperService.cs @@ -13,9 +13,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Collapse { SetRandomIdIfNotProvided(); - var innerContent = (await output.GetChildContentAsync()).GetContent(); + var childContent = await output.GetChildContentAsync(); - var html = GetAccordionHeaderItem(context, output) + GetAccordionContentItem(context, output, innerContent); + var html = GetAccordionHeaderItem(context, output) + GetAccordionContentItem(context, output, childContent); var tabHeaderItems = context.GetValue>(AccordionItems); tabHeaderItems.Add(html); @@ -46,7 +46,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Collapse return header.ToHtmlString(); } - protected virtual string GetAccordionContentItem(TagHelperContext context, TagHelperOutput output, string content) + protected virtual string GetAccordionContentItem(TagHelperContext context, TagHelperOutput output, TagHelperContent content) { var show = (TagHelper.Active ?? false) ? " show" : ""; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs index 3c429b32ef..843efae0f4 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Collapse/AbpCollapseBodyTagHelperService.cs @@ -22,9 +22,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Collapse output.Attributes.AddClass("multi-collapse"); } - var innerContent = (await output.GetChildContentAsync()).GetContent(); + var childContent = await output.GetChildContentAsync(); - output.Content.SetHtmlContent(innerContent); + output.Content.SetHtmlContent(childContent); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs index c6a0307d2d..6b18f8ee90 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Dropdown/AbpDropdownButtonTagHelperService.cs @@ -70,7 +70,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown var buttonTag = await abpButtonTagHelper.ProcessAndGetOutputAsync(attributes, context, "button", TagMode.StartTagAndEndTag); - buttonTag.PreContent.SetHtmlContent(content.GetContent()); + buttonTag.PreContent.SetHtmlContent(content); if ((TagHelper.NavLink ?? false) || (TagHelper.Link ?? false)) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs index 7d2f0804b7..410a3d1454 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs @@ -42,7 +42,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form NormalizeTagMode(context, output); - var childContent = (await output.GetChildContentAsync()).GetContent(); + var childContent = await output.GetChildContentAsync(); await ConvertToMvcForm(context, output); @@ -78,8 +78,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form await formTagOutput.GetChildContentAsync(); - output.PostContent.SetHtmlContent(output.PostContent.GetContent() + formTagOutput.PostContent.GetContent()); - output.PreContent.SetHtmlContent(output.PreContent.GetContent() + formTagOutput.PreContent.GetContent()); + output.PostContent.AppendHtml(formTagOutput.PostContent); + output.PreContent.AppendHtml(formTagOutput.PreContent); } protected virtual void NormalizeTagMode(TagHelperContext context, TagHelperOutput output) @@ -93,7 +93,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form output.Attributes.AddIfNotContains("method", "post"); } - protected virtual void SetContent(TagHelperContext context, TagHelperOutput output, List items, string childContent) + protected virtual void SetContent(TagHelperContext context, TagHelperOutput output, List items, TagHelperContent childContent) { var contentBuilder = new StringBuilder(""); @@ -102,16 +102,17 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form contentBuilder.AppendLine(item.HtmlContent); } - if (childContent.Contains(AbpFormContentPlaceHolder)) + var content = childContent.GetContent(); + if (content.Contains(AbpFormContentPlaceHolder)) { - childContent = childContent.Replace(AbpFormContentPlaceHolder, contentBuilder.ToString()); + content = content.Replace(AbpFormContentPlaceHolder, contentBuilder.ToString()); } else { - childContent = contentBuilder + childContent; + content = contentBuilder + content; } - output.Content.SetHtmlContent(childContent); + output.Content.SetHtmlContent(content); } protected virtual async Task SetSubmitButton(TagHelperContext context, TagHelperOutput output) @@ -123,7 +124,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form var buttonHtml = await ProcessSubmitButtonAndGetContentAsync(context, output); - output.PostContent.SetHtmlContent(output.PostContent.GetContent() + buttonHtml); + output.PostContent.AppendHtml(buttonHtml); } protected virtual List InitilizeFormGroupContentsContext(TagHelperContext context, TagHelperOutput output) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs index 48abbd93e9..8d49977df0 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs @@ -52,7 +52,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form output.Attributes.AddClass(isCheckBox ? "custom-checkbox" : "form-group"); output.Attributes.AddClass(isCheckBox ? "custom-control" : ""); output.Attributes.AddClass(isCheckBox ? "mb-2" : ""); - output.Content.SetHtmlContent(output.Content.GetContent() + innerHtml); + output.Content.AppendHtml(innerHtml); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelper.cs index 2f4440b904..8c4c9465d0 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelper.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Razor.TagHelpers; namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form { + [OutputElementHint("select")] public class AbpSelectTagHelper : AbpTagHelper { public ModelExpression AspFor { get; set; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs index 6050fb91d6..24290487d5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs @@ -38,7 +38,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { - var innerHtml = await GetFormInputGroupAsHtmlAsync(context, output); + var childContent = await output.GetChildContentAsync(); + + var innerHtml = await GetFormInputGroupAsHtmlAsync(context, output, childContent); var order = TagHelper.AspFor.ModelExplorer.GetDisplayOrder(); @@ -58,9 +60,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form } } - protected virtual async Task GetFormInputGroupAsHtmlAsync(TagHelperContext context, TagHelperOutput output) + protected virtual async Task GetFormInputGroupAsHtmlAsync(TagHelperContext context, TagHelperOutput output, TagHelperContent childContent) { - var selectTag = await GetSelectTagAsync(context, output); + var selectTag = await GetSelectTagAsync(context, output, childContent); var selectAsHtml = selectTag.Render(_encoder); var label = await GetLabelAsHtmlAsync(context, output, selectTag); var validation = await GetValidationAsHtmlAsync(context, output, selectTag); @@ -74,7 +76,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form return "
    " + Environment.NewLine + innerHtml + Environment.NewLine + "
    "; } - protected virtual async Task GetSelectTagAsync(TagHelperContext context, TagHelperOutput output) + protected virtual async Task GetSelectTagAsync(TagHelperContext context, TagHelperOutput output, TagHelperContent childContent) { var selectTagHelper = new SelectTagHelper(_generator) { @@ -97,6 +99,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag); + selectTagHelperOutput.Content.SetHtmlContent(childContent); selectTagHelperOutput.Attributes.AddClass("form-control"); selectTagHelperOutput.Attributes.AddClass(GetSize(context, output)); AddDisabledAttribute(selectTagHelperOutput); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs index a9a134ceba..c17c7c5f3d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabTagHelperService.cs @@ -13,9 +13,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab { SetPlaceholderForNameIfNotProvided(); - var innerContent = await output.GetChildContentAsync(); + var childContent = await output.GetChildContentAsync(); var tabHeader = GetTabHeaderItem(context, output); - var tabContent = GetTabContentItem(context, output, innerContent.GetContent()); + var tabContent = GetTabContentItem(context, output, childContent); var tabHeaderItems = context.GetValue>(TabItems); @@ -83,7 +83,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab } } - protected virtual string GetTabContentItem(TagHelperContext context, TagHelperOutput output, string content) + protected virtual string GetTabContentItem(TagHelperContext context, TagHelperOutput output, TagHelperContent content) { var headerId = TagHelper.Name + "-tab"; var id = TagHelper.Name; diff --git a/framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj b/framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj index e042047563..2e4c93e8df 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj +++ b/framework/src/Volo.Abp.BlazoriseUI/Volo.Abp.BlazoriseUI.csproj @@ -14,10 +14,10 @@ - - - - + + + + diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs index cc8d9c0bf5..74be59e014 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs @@ -77,17 +77,25 @@ namespace Volo.Abp.Cli.Bundling BundleName = bundleConfig.Name.IsNullOrEmpty() ? "global" : bundleConfig.Name, Minify = bundleConfig.Mode == BundlingMode.BundleAndMinify }; - + + Logger.LogInformation("Generating style bundle..."); styleDefinitions = StyleBundler.Bundle(options, styleContext); + Logger.LogInformation($"Style bundle has been generated successfully."); + + Logger.LogInformation("Generating script bundle..."); scriptDefinitions = ScriptBundler.Bundle(options, scriptContext); + Logger.LogInformation($"Script bundle has been generated successfully."); } else { + Logger.LogInformation("Generating style references..."); styleDefinitions = GenerateStyleDefinitions(styleContext); + Logger.LogInformation("Generating script references..."); scriptDefinitions = GenerateScriptDefinitions(scriptContext); } - + await UpdateDependenciesInHtmlFileAsync(directory, styleDefinitions, scriptDefinitions); + Logger.LogInformation("Script and style references in the index.html file have been updated."); } private BundleContext GetScriptContext(List bundleDefinitions, diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs index 088cadb707..56e5c0a03b 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs @@ -203,30 +203,7 @@ namespace Volo.Abp.Cli.Commands.Services return false; } - if (zipEntryName.Contains(Path.Combine("angular/e2e"))) - { - return true; - } - if (zipEntryName.Contains(Path.Combine("angular/src"))) - { - return true; - } - if (zipEntryName.Contains(Path.Combine("angular/node_modules"))) - { - return true; - } - if (zipEntryName.Contains(Path.Combine("angular/scripts"))) - { - return true; - } - if (zipEntryName.Contains(Path.Combine("angular/source-code-requirements"))) - { - return true; - } - - var fileName = Path.GetFileName(zipEntryName); - - if (!string.IsNullOrEmpty(fileName) && zipEntryName.Equals("angular/" + fileName)) + if (zipEntryName.StartsWith("angular/") && !zipEntryName.StartsWith("angular/projects")) { return true; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs index 612f3b7234..34cde45265 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs @@ -275,6 +275,7 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(" abp suite"); sb.AppendLine(" abp suite install"); sb.AppendLine(" abp suite install --preview"); + sb.AppendLine(" abp suite install --version 4.2.2"); sb.AppendLine(" abp suite update"); sb.AppendLine(" abp suite update --preview"); sb.AppendLine(" abp suite remove"); @@ -303,4 +304,4 @@ namespace Volo.Abp.Cli.Commands } } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs index 52a06f7117..d515253659 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs @@ -169,7 +169,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App steps.Add(new ChangePublicAuthPortStep()); } - if (!context.BuildArgs.ExtraProperties.ContainsKey("without-cms-kit") && IsCmsKitSupportedForTargetVersion(context)) + if (context.BuildArgs.PublicWebSite && !context.BuildArgs.ExtraProperties.ContainsKey("without-cms-kit") && IsCmsKitSupportedForTargetVersion(context)) { context.Symbols.Add("CMS-KIT"); } @@ -210,10 +210,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App { if (string.IsNullOrWhiteSpace(context.BuildArgs.Version)) { - // We'll return true after 4.3.0 stable release. see https://github.com/abpframework/abp/issues/8394 - // return true; - - return context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.Preview.Long); + return true; } return SemanticVersion.Parse(context.BuildArgs.Version) > SemanticVersion.Parse("4.2.9"); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateSwitchEntityFrameworkCoreToMongoDbStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateSwitchEntityFrameworkCoreToMongoDbStep.cs index 8f56902ab7..309d0a1552 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateSwitchEntityFrameworkCoreToMongoDbStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateSwitchEntityFrameworkCoreToMongoDbStep.cs @@ -227,7 +227,12 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App string oldReference, string newReference) { - var file = context.GetFile(targetProjectFilePath); + var file = context.FindFile(targetProjectFilePath); + + if (file == null) + { + return; + } file.NormalizeLineEndings(); @@ -253,7 +258,12 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App string oldKeyword, string newKeyword) { - var file = context.GetFile(targetModuleFilePath); + var file = context.FindFile(targetModuleFilePath); + + if (file == null) + { + return; + } file.NormalizeLineEndings(); @@ -278,7 +288,12 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App ProjectBuildContext context, string appsettingFilePath) { - var file = context.GetFile(appsettingFilePath); + var file = context.FindFile(appsettingFilePath); + + if (file == null) + { + return; + } file.NormalizeLineEndings(); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs index 9d95f818d1..93626d682d 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs @@ -246,6 +246,12 @@ namespace Volo.Abp.Cli.ProjectModification var foldersUnderProject = Directory.GetDirectories(Path.Combine(folder, "projects")); foreach (var folderUnderProject in foldersUnderProject) { + if (Path.GetFileName(folderUnderProject) == "dev-app") + { + Directory.Delete(folderUnderProject, true); + continue; + } + if (Directory.Exists(Path.Combine(folder, Path.GetFileName(folderUnderProject)))) { continue; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs index d369a9af43..3586f66956 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Linq; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Volo.Abp.DependencyInjection; @@ -22,26 +23,34 @@ namespace Volo.Abp.Cli.ProjectModification { var file = File.ReadAllText(path); - file = UsingStatementAdder.Add(file, GetNamespace(moduleConfiguration)); + var parsedModuleConfiguration = moduleConfiguration.Split(", "); - var stringToAdd = GetLineToAdd(moduleConfiguration); - if (!file.Contains(stringToAdd)) + var namespaces = parsedModuleConfiguration.Select(GetNamespace); + var configurationLines = parsedModuleConfiguration.Select(GetLineToAdd); + + var indexToInsert = FindIndexToInsert(file); + + if (indexToInsert <= 0 || indexToInsert >= file.Length) { - var indexToInsert = FindIndexToInsert(file); + Logger.LogWarning($"\"OnModelCreating(ModelBuilder builder)\" method couldn't be found in {path}"); + return false; + } - if (indexToInsert <= 0 || indexToInsert >= file.Length) + foreach (var configurationLine in configurationLines) + { + if (file.Contains(configurationLine)) { - Logger.LogWarning($"\"OnModelCreating(ModelBuilder builder)\" method couldn't be found in {path}"); - return false; + continue; } - file = file.Insert(indexToInsert, " " + stringToAdd + Environment.NewLine + " "); + + file = file.Insert(indexToInsert, " " + configurationLine + Environment.NewLine + " "); } - else + + foreach (var namespaceOfConfiguration in namespaces) { - return false; + file = UsingStatementAdder.Add(file, namespaceOfConfiguration); } - File.WriteAllText(path, file); return true; } @@ -49,7 +58,8 @@ namespace Volo.Abp.Cli.ProjectModification protected int FindIndexToInsert(string file) { var indexOfMethodDeclaration = file.IndexOf("OnModelCreating(", StringComparison.Ordinal); - var indexOfOpeningBracket = indexOfMethodDeclaration + file.Substring(indexOfMethodDeclaration).IndexOf('{'); + var indexOfOpeningBracket = + indexOfMethodDeclaration + file.Substring(indexOfMethodDeclaration).IndexOf('{'); var stack = 1; var index = indexOfOpeningBracket; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackageInfo.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackageInfo.cs index 47f0f1092d..dc86a720cf 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackageInfo.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackageInfo.cs @@ -5,5 +5,9 @@ public string Name { get; set; } public NpmApplicationType ApplicationType { get; set; } + + public string MinVersion { get; set; } + + public string MaxVersion { get; set; } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs index 3b5e695203..2d59392dcd 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs @@ -135,24 +135,25 @@ namespace Volo.Abp.Cli.ProjectModification private ModuleWithMastersInfo RemoveIncompatiblePackages(ModuleWithMastersInfo module, string version) { - module.NugetPackages.RemoveAll(np => IsPackageInCompatible(np, version)); + module.NugetPackages.RemoveAll(np => IsPackageInCompatible(np.MinVersion, np.MaxVersion, version)); + module.NpmPackages.RemoveAll(np => IsPackageInCompatible(np.MinVersion, np.MaxVersion, version)); return module; } - private bool IsPackageInCompatible(NugetPackageInfo package, string version) + private bool IsPackageInCompatible(string minVersion, string maxVersion, string version) { try { - if (!string.IsNullOrWhiteSpace(package.MinVersion)) + if (!string.IsNullOrWhiteSpace(minVersion)) { - if (SemanticVersion.Parse(package.MinVersion) > SemanticVersion.Parse(version)) + if (SemanticVersion.Parse(minVersion) > SemanticVersion.Parse(version)) { return true; } } - if (!string.IsNullOrWhiteSpace(package.MaxVersion)) + if (!string.IsNullOrWhiteSpace(maxVersion)) { - if (SemanticVersion.Parse(package.MaxVersion) < SemanticVersion.Parse(version)) + if (SemanticVersion.Parse(maxVersion) < SemanticVersion.Parse(version)) { return true; } @@ -186,6 +187,7 @@ namespace Volo.Abp.Cli.ProjectModification private async Task RemoveUnnecessaryProjectsAsync(string solutionDirectory, ModuleWithMastersInfo module, string[] projectFiles) { + var projectsToRemove = new List(); var moduleDirectory = Path.Combine(solutionDirectory, "modules", module.Name); var moduleSolutionFile = Directory.GetFiles(moduleDirectory, "*.sln", SearchOption.TopDirectoryOnly).First(); var isProjectTiered = await IsProjectTiered(projectFiles); @@ -194,10 +196,10 @@ namespace Volo.Abp.Cli.ProjectModification var blazorProject = projectFiles.FirstOrDefault(p => p.EndsWith(".Blazor.csproj")); if (blazorProject == null) { - await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.Blazor, isProjectTiered); - await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.BlazorServer, isProjectTiered); - await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.BlazorWebAssembly, isProjectTiered); - await RemoveProjectByPostFix(module, moduleSolutionFile, "src", ".Blazor"); + projectsToRemove.AddRange(await FindProjectsToRemoveByTarget(module, NuGetPackageTarget.Blazor, isProjectTiered)); + projectsToRemove.AddRange(await FindProjectsToRemoveByTarget(module, NuGetPackageTarget.BlazorServer, isProjectTiered)); + projectsToRemove.AddRange(await FindProjectsToRemoveByTarget(module, NuGetPackageTarget.BlazorWebAssembly, isProjectTiered)); + projectsToRemove.AddRange(await FindProjectsToRemoveByPostFix(moduleDirectory, "src", ".Blazor")); } else { @@ -205,39 +207,58 @@ namespace Volo.Abp.Cli.ProjectModification if (isBlazorServer) { - await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.BlazorWebAssembly, isProjectTiered); + projectsToRemove.AddRange(await FindProjectsToRemoveByTarget(module, NuGetPackageTarget.BlazorWebAssembly, isProjectTiered)); webPackagesWillBeAddedToBlazorServerProject = module.NugetPackages.All(np=> np.Target != NuGetPackageTarget.BlazorServer && np.TieredTarget != NuGetPackageTarget.BlazorServer); } else { - await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.BlazorServer, isProjectTiered); + projectsToRemove.AddRange(await FindProjectsToRemoveByTarget(module, NuGetPackageTarget.BlazorServer, isProjectTiered)); } } if (!projectFiles.Any(p => p.EndsWith(".Web.csproj")) && !webPackagesWillBeAddedToBlazorServerProject) { - await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.Web, isProjectTiered); + projectsToRemove.AddRange(await FindProjectsToRemoveByTarget(module, NuGetPackageTarget.Web, isProjectTiered)); } if (!projectFiles.Any(p => p.EndsWith(".MongoDB.csproj"))) { - await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.MongoDB, isProjectTiered); - await RemoveProjectByPostFix(module, moduleSolutionFile, "test", ".MongoDB.Tests"); + projectsToRemove.AddRange(await FindProjectsToRemoveByTarget(module, NuGetPackageTarget.MongoDB, isProjectTiered)); + projectsToRemove.AddRange(await FindProjectsToRemoveByPostFix(moduleDirectory, "test", ".MongoDB.Tests")); } if (!projectFiles.Any(p => p.EndsWith(".EntityFrameworkCore.csproj"))) { - await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.EntityFrameworkCore, isProjectTiered); - await RemoveProjectByPostFix(module, moduleSolutionFile, "test", ".EntityFrameworkCore.Tests"); - await RemoveProjectByPostFix(module, moduleSolutionFile, "test", ".Application.Tests"); + projectsToRemove.AddRange(await FindProjectsToRemoveByTarget(module, NuGetPackageTarget.EntityFrameworkCore, isProjectTiered)); + projectsToRemove.AddRange(await FindProjectsToRemoveByPostFix(moduleDirectory, "test", ".EntityFrameworkCore.Tests")); + projectsToRemove.AddRange(await FindProjectsToRemoveByPostFix(moduleDirectory, "test", ".Application.Tests")); ChangeDomainTestReferenceToMongoDB(module, moduleSolutionFile); } + + foreach (var projectToRemove in projectsToRemove) + { + if (IsReferencedByAnotherModuleProject(moduleDirectory, projectsToRemove, projectToRemove)) + { + continue; + } + + RemoveProjectFromSolutionAsync(moduleSolutionFile, projectToRemove); + } } - private async Task RemoveProjectByTarget(ModuleWithMastersInfo module, string moduleSolutionFile, + private bool IsReferencedByAnotherModuleProject(string moduleDirectory, List projectsToRemove, string projectToRemove) + { + var moduleProjects = Directory.GetFiles(moduleDirectory, "*.csproj", SearchOption.AllDirectories); + var projectsToKeep = moduleProjects.Where(mp=> !projectsToRemove.Contains(Path.GetFileName(mp).RemovePostFix(".csproj"))).ToList(); + return projectsToKeep.Select(File.ReadAllText).Any(content => content.Contains($"\"{projectToRemove}\"")); + } + + private async Task> FindProjectsToRemoveByTarget(ModuleWithMastersInfo module, NuGetPackageTarget target, bool isTieredProject) { + var projectsToRemove = new List(); + var packages = module.NugetPackages.Where(n => (isTieredProject && n.TieredTarget != NuGetPackageTarget.Undefined ? n.TieredTarget @@ -251,37 +272,42 @@ namespace Volo.Abp.Cli.ProjectModification continue; } - await SolutionFileModifier.RemoveProjectFromSolutionFileAsync(moduleSolutionFile, package.Name); - - var projectPath = Path.Combine(Path.GetDirectoryName(moduleSolutionFile), "src", package.Name); - if (Directory.Exists(projectPath)) - { - Directory.Delete(projectPath, true); - } + projectsToRemove.Add(package.Name); } + + return projectsToRemove; } - private async Task RemoveProjectByPostFix(ModuleWithMastersInfo module, string moduleSolutionFile, string targetFolder, + private async Task> FindProjectsToRemoveByPostFix(string moduleDirectory, string targetFolder, string postFix) { - var srcPath = Path.Combine(Path.GetDirectoryName(moduleSolutionFile), targetFolder); + var projectsToRemove = new List(); + var srcPath = Path.Combine(moduleDirectory, targetFolder); if (!Directory.Exists(srcPath)) { - return; + return projectsToRemove; } var projectFolderPaths = Directory.GetDirectories(srcPath).Where(d => d.EndsWith(postFix)).ToList(); foreach (var projectFolderPath in projectFolderPaths) { - await SolutionFileModifier.RemoveProjectFromSolutionFileAsync(moduleSolutionFile, new DirectoryInfo(projectFolderPath).Name); + projectsToRemove.Add(new DirectoryInfo(projectFolderPath).Name); + } + return projectsToRemove; + } + + private async Task RemoveProjectFromSolutionAsync(string moduleSolutionFile, string projectName) + { + await SolutionFileModifier.RemoveProjectFromSolutionFileAsync(moduleSolutionFile, projectName); + + var projectFolderPath = Path.Combine(Path.GetDirectoryName(moduleSolutionFile), "src", projectName); if (Directory.Exists(projectFolderPath)) { Directory.Delete(projectFolderPath, true); } - } } private void ChangeDomainTestReferenceToMongoDB(ModuleWithMastersInfo module, string moduleSolutionFile) @@ -500,7 +526,7 @@ namespace Volo.Abp.Cli.ProjectModification { foreach (var npmPackage in mvcNpmPackages) { - await ProjectNpmPackageAdder.AddMvcPackageAsync(Path.GetDirectoryName(targetProject), npmPackage, null, true); + await ProjectNpmPackageAdder.AddMvcPackageAsync(Path.GetDirectoryName(targetProject), npmPackage); } } } diff --git a/framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Program.cs b/framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Program.cs index 886520e95c..e3222fdb84 100644 --- a/framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Program.cs +++ b/framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Program.cs @@ -40,8 +40,10 @@ namespace Volo.Abp.Cli await application.ServiceProvider .GetRequiredService() .RunAsync(args); - + application.Shutdown(); + + Log.CloseAndFlush(); } } } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/IHasConcurrencyStamp.cs b/framework/src/Volo.Abp.Data/Volo/Abp/Domain/Entities/IHasConcurrencyStamp.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/IHasConcurrencyStamp.cs rename to framework/src/Volo.Abp.Data/Volo/Abp/Domain/Entities/IHasConcurrencyStamp.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs index ebe49718b2..34e74d90cd 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs @@ -9,43 +9,42 @@ namespace Volo.Abp.DependencyInjection IServiceCollection Services { get; } /// - /// Registers default repositories for this DbContext. + /// Registers default repositories for all the entities in this DbContext. /// /// /// Registers repositories only for aggregate root entities by default. - /// set to true to include all entities. + /// Set to true to include all entities. /// IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepositories(bool includeAllEntities = false); /// - /// Registers default repositories for this DbContext. + /// Registers default repositories for all the entities in this DbContext. /// Default repositories will use given . /// /// DbContext type that will be used by default repositories /// /// Registers repositories only for aggregate root entities by default. - /// set to true to include all entities. + /// Set to true to include all entities. /// IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepositories(bool includeAllEntities = false); /// - /// Registers default repositories for this DbContext. + /// Registers default repositories for all the entities in this DbContext. /// Default repositories will use given . /// /// DbContext type that will be used by default repositories /// /// Registers repositories only for aggregate root entities by default. - /// set to true to include all entities. + /// Set to true to include all entities. /// IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepositories(Type defaultRepositoryDbContextType, bool includeAllEntities = false); /// - /// Registers custom repository for a specific entity. + /// Registers default repository for a specific entity. /// /// Entity type IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepository(); - /// /// Registers default repository for a specific entity. /// diff --git a/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureDefinitionExtensions.cs b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureDefinitionExtensions.cs index 200f002e07..299994e695 100644 --- a/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureDefinitionExtensions.cs +++ b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureDefinitionExtensions.cs @@ -1,4 +1,5 @@ -using JetBrains.Annotations; +using System; +using JetBrains.Annotations; using Volo.Abp.Authorization.Permissions; namespace Volo.Abp.GlobalFeatures @@ -6,12 +7,12 @@ namespace Volo.Abp.GlobalFeatures public static class GlobalFeatureDefinitionExtensions { public static PermissionDefinition RequireGlobalFeatures( - this PermissionDefinition permissionDefinition, + this PermissionDefinition permissionDefinition, params string[] globalFeatures) { return permissionDefinition.RequireGlobalFeatures(true, globalFeatures); } - + public static PermissionDefinition RequireGlobalFeatures( [NotNull] this PermissionDefinition permissionDefinition, bool requiresAll, @@ -25,5 +26,25 @@ namespace Volo.Abp.GlobalFeatures ); } + public static PermissionDefinition RequireGlobalFeatures( + this PermissionDefinition permissionDefinition, + params Type[] globalFeatures) + { + return permissionDefinition.RequireGlobalFeatures(true, globalFeatures); + } + + public static PermissionDefinition RequireGlobalFeatures( + [NotNull] this PermissionDefinition permissionDefinition, + bool requiresAll, + params Type[] globalFeatures) + { + Check.NotNull(permissionDefinition, nameof(permissionDefinition)); + Check.NotNullOrEmpty(globalFeatures, nameof(globalFeatures)); + + return permissionDefinition.AddStateProviders( + new RequireGlobalFeaturesPermissionStateProvider(requiresAll, globalFeatures) + ); + } + } } diff --git a/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/nl.json b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/nl.json new file mode 100644 index 0000000000..449c09efd6 --- /dev/null +++ b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/nl.json @@ -0,0 +1,6 @@ +{ + "culture": "nl", + "texts": { + "Volo.GlobalFeature:010001": "De service '{ServiceName}' moet de functie '{GlobalFeatureName}' inschakelen." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/RequireGlobalFeaturesPermissionStateProvider.cs b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/RequireGlobalFeaturesPermissionStateProvider.cs index 40df2a14b3..c96e652e8c 100644 --- a/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/RequireGlobalFeaturesPermissionStateProvider.cs +++ b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/RequireGlobalFeaturesPermissionStateProvider.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System; +using System.Linq; using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; @@ -13,7 +14,7 @@ namespace Volo.Abp.GlobalFeatures : this(true, globalFeatureNames) { } - + public RequireGlobalFeaturesPermissionStateProvider(bool requiresAll, params string[] globalFeatureNames) { Check.NotNullOrEmpty(globalFeatureNames, nameof(globalFeatureNames)); @@ -22,12 +23,20 @@ namespace Volo.Abp.GlobalFeatures _globalFeatureNames = globalFeatureNames; } + public RequireGlobalFeaturesPermissionStateProvider(bool requiresAll, params Type[] globalFeatureNames) + { + Check.NotNullOrEmpty(globalFeatureNames, nameof(globalFeatureNames)); + + _requiresAll = requiresAll; + _globalFeatureNames = globalFeatureNames.Select(GlobalFeatureNameAttribute.GetName).ToArray(); + } + public Task IsEnabledAsync(PermissionStateContext context) { bool isEnabled = _requiresAll ? _globalFeatureNames.All(x => GlobalFeatureManager.Instance.IsEnabled(x)) : _globalFeatureNames.Any(x => GlobalFeatureManager.Instance.IsEnabled(x)); - + return Task.FromResult(isEnabled); } } diff --git a/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj b/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj index c7fa0a1d11..0fa70fb6dd 100644 --- a/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj +++ b/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs index c722529eca..8570ae9f6e 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using JetBrains.Annotations; using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; @@ -42,36 +43,24 @@ namespace Volo.Abp.UI.Navigation.Urls return Options.RedirectAllowedUrls.Any(url.StartsWith); } - protected virtual Task GetConfiguredUrl(string appName, string urlName) + protected virtual async Task GetConfiguredUrl(string appName, string urlName) { - var app = Options.Applications[appName]; - - if (urlName.IsNullOrEmpty()) + var url = await GetUrlOrNullAsync(appName, urlName); + if (!url.IsNullOrEmpty()) { - if (app.RootUrl.IsNullOrEmpty()) - { - throw new AbpException( - $"RootUrl for the application '{appName}' was not configured. Use {nameof(AppUrlOptions)} to configure it!" - ); - } - - return Task.FromResult(app.RootUrl); + return url; } - var url = app.Urls.GetOrDefault(urlName); - if (url.IsNullOrEmpty()) + if (!urlName.IsNullOrEmpty()) { throw new AbpException( $"Url, named '{urlName}', for the application '{appName}' was not configured. Use {nameof(AppUrlOptions)} to configure it!" ); } - if (app.RootUrl == null) - { - return Task.FromResult(url); - } - - return Task.FromResult(app.RootUrl.EnsureEndsWith('/') + url); + throw new AbpException( + $"RootUrl for the application '{appName}' was not configured. Use {nameof(AppUrlOptions)} to configure it!" + ); } protected virtual async Task ReplacePlaceHoldersAsync(string url) @@ -118,5 +107,24 @@ namespace Volo.Abp.UI.Navigation.Urls return CurrentTenant.Name; } + + public Task GetUrlOrNullAsync([NotNull] string appName, [CanBeNull] string urlName = null) + { + var app = Options.Applications[appName]; + + if (urlName.IsNullOrEmpty()) + { + return Task.FromResult(app.RootUrl); + } + + var url = app.Urls.GetOrDefault(urlName); + + if (app.RootUrl == null) + { + return Task.FromResult(url); + } + + return Task.FromResult(app.RootUrl.EnsureEndsWith('/') + url); + } } } diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/IAppUrlProvider.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/IAppUrlProvider.cs index 61b6fc2bac..3a67da538b 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/IAppUrlProvider.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/IAppUrlProvider.cs @@ -7,6 +7,8 @@ namespace Volo.Abp.UI.Navigation.Urls { Task GetUrlAsync([NotNull] string appName, [CanBeNull] string urlName = null); + Task GetUrlOrNullAsync([NotNull] string appName, [CanBeNull] string urlName = null); + bool IsRedirectAllowedUrl(string url); } } diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/nl.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/nl.json index 69ad662be1..a85e443bdf 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/nl.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/nl.json @@ -7,7 +7,7 @@ "Clear": "Wissen", "Yes": "Ja", "No": "Nee", - "Ok": "Ok", + "Ok": "Oké", "Close": "Sluiten", "Save": "Opslaan", "SavingWithThreeDot": "Opslaan...", diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json index 59a680bb81..96c49401ea 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json @@ -4,7 +4,7 @@ "Languages": "语言", "AreYouSure": "你确定吗?", "Cancel": "取消", - "Clear": "清楚", + "Clear": "清除", "Yes": "是", "No": "否", "Ok": "Ok", @@ -49,4 +49,4 @@ "ItemWillBeDeletedMessage": "此项将被删除!", "ManageYourAccount": "管理你的账户" } -} \ No newline at end of file +} diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml index 6fa9cabb37..4d60a98ea0 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml @@ -97,7 +97,9 @@
    - + + +
    @@ -140,7 +142,9 @@
    
     <abp-input asp-for="@@Model.MyModel.EmailAddress" label="Email Address" placeholder="name@example.com" />
    -<abp-select asp-for="@@Model.MyModel.City" asp-items="@@Model.CityList" label="City" />
    +<abp-select asp-for="@@Model.MyModel.City" asp-items="@@Model.CityList" label="City">
    +    <option value="">Choose a city</option>
    +</abp-select>
     <abp-select asp-for="@@Model.MyModel.Cities" asp-items="@@Model.CityList" label="Cities" />
     <abp-input asp-for="@@Model.MyModel.Description" label="Description" />
     
    @@ -155,6 +159,7 @@ <div class="form-group"> <label for="MyModel_City">City</label> <select id="MyModel_City" name="MyModel.City" class="form-control"> + <option value="">Choose a city</option> <option value="NY">New York</option> <option value="LDN">London</option> <option value="IST">Istanbul</option> diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/package.json b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/package.json index a4704ecfd3..a68d0dfe01 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/package.json +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/package.json @@ -3,7 +3,7 @@ "name": "asp.net", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.shared": "^4.3.0-rc.2", + "@abp/aspnetcore.mvc.ui.theme.shared": "^4.3.0", "highlight.js": "^9.13.1" }, "devDependencies": {} diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/yarn.lock b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/yarn.lock index d529fabaca..ea929c6072 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/yarn.lock +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/yarn.lock @@ -2,30 +2,30 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.shared@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0-rc.2.tgz#d3bf79929c55c5380d7ca7b913a23031d7a6bd12" - integrity sha512-pz86bIV4wNeG7/UPYzNCXlJ/MdOdIygc+Com7C9Ld7gzsyER7VD9h5U/hkytvL4FBFLJn4DU+xuZNECjv0HS0A== - dependencies: - "@abp/aspnetcore.mvc.ui" "~4.3.0-rc.2" - "@abp/bootstrap" "~4.3.0-rc.2" - "@abp/bootstrap-datepicker" "~4.3.0-rc.2" - "@abp/datatables.net-bs4" "~4.3.0-rc.2" - "@abp/font-awesome" "~4.3.0-rc.2" - "@abp/jquery-form" "~4.3.0-rc.2" - "@abp/jquery-validation-unobtrusive" "~4.3.0-rc.2" - "@abp/lodash" "~4.3.0-rc.2" - "@abp/luxon" "~4.3.0-rc.2" - "@abp/malihu-custom-scrollbar-plugin" "~4.3.0-rc.2" - "@abp/select2" "~4.3.0-rc.2" - "@abp/sweetalert" "~4.3.0-rc.2" - "@abp/timeago" "~4.3.0-rc.2" - "@abp/toastr" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0-rc.2.tgz#6ff41be179c8d1089778a51ffa54a1f3d7614278" - integrity sha512-2L5zvuqUwPwNPcMauiiJZD1ft0QycqINz+bXEQ8t0EwbB+dzcsukL/rpOQfpeRHWWYy4nIN4C2bTvXhNgQbPqQ== +"@abp/aspnetcore.mvc.ui.theme.shared@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0.tgz#6150c87f848e3cee36c217b01304b76aaa7991bb" + integrity sha512-urL7zQZu3jceXoSDBHQpzP/uhFYGZtreW22ohVINw2QTonCCd/ojRIVOZvf+GtMSRBqeecBqtdOjr9aoah+z9Q== + dependencies: + "@abp/aspnetcore.mvc.ui" "~4.3.0" + "@abp/bootstrap" "~4.3.0" + "@abp/bootstrap-datepicker" "~4.3.0" + "@abp/datatables.net-bs4" "~4.3.0" + "@abp/font-awesome" "~4.3.0" + "@abp/jquery-form" "~4.3.0" + "@abp/jquery-validation-unobtrusive" "~4.3.0" + "@abp/lodash" "~4.3.0" + "@abp/luxon" "~4.3.0" + "@abp/malihu-custom-scrollbar-plugin" "~4.3.0" + "@abp/select2" "~4.3.0" + "@abp/sweetalert" "~4.3.0" + "@abp/timeago" "~4.3.0" + "@abp/toastr" "~4.3.0" + +"@abp/aspnetcore.mvc.ui@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0.tgz#0098e528a929eb87da5c661cf3edf062bf2cb8c7" + integrity sha512-k0cXjDk33wDhr0tqjCG7UYJU5y2UJW+uCAp5cQTFqK9HqeYW1huGfRydECh3m8jqPGRmZRx4aJGQo6Te92bjcw== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -36,145 +36,145 @@ micromatch "^4.0.2" path "^0.12.7" -"@abp/bootstrap-datepicker@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0-rc.2.tgz#29a686c3d2bce356967f646d7334cd83c4257b4c" - integrity sha512-3+B7SJRi7DQJe0aNgv0H0zu1BfvMZcwgt06N3ALR9+o3TSJcOqcYrEMed3aG+ASH++CltnohTYnLkVXaxshioA== +"@abp/bootstrap-datepicker@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0.tgz#a4246b06d41ad39bf8a84b310227b0b44c2ca4f4" + integrity sha512-f/M7rpr87BPyk47RDUobWBbkMUwRlY+riRnWaoHkSAOwwSMBkkXsAxyEAkbRlIiYFBfNkrVl1OpTOliinhvWjQ== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0-rc.2.tgz#1416fe639c88b7d958435e45fe19692268a7f932" - integrity sha512-E6svmDhNQlT5nd65VgshexyedRWhbvi9o1oYo/dLTUpJDzR7M9ptDqxFLVB9vVDva3HgxUoEvgRJgb9fXvq4zw== +"@abp/bootstrap@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0.tgz#9dc88066bbb19ee50eb27460ab06f1593fae76cd" + integrity sha512-tV/K6nNl7Rt4BEQFlbPUtXMSTC+Usc1ArP6JMNL++1xOOT2Kyye172WEWnTcT7RRnveq7kid090Dxk9g3IyprA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" bootstrap "^4.6.0" bootstrap-v4-rtl "4.6.0-1" -"@abp/core@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0-rc.2.tgz#3c9ea339624ae3b6cbee13e048268d48269ea6a9" - integrity sha512-/89xH+IVSmTOLWeUO4yVB7Hg64uHTbR7bHjgl+b94cFdtITH9Nvr2EGdXUJbHGUK7L6lSDziqiMcG/ic0061+Q== +"@abp/core@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0.tgz#77945a62daae70b5f9f348036ab7c5a308d95a94" + integrity sha512-k+6BemPsencQasN+8W9sVYXdSOjea61ng2MIaPVTuCCjLWnReg4pQQ4QoJWsja+W36C8bratzT5ePwP6ZrCnMg== dependencies: - "@abp/utils" "^4.3.0-rc.2" + "@abp/utils" "^4.3.0" -"@abp/datatables.net-bs4@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0-rc.2.tgz#bbfc0d9d0ed86cdb14b38849fb78b2b1911c4a35" - integrity sha512-PRKYi2NU41KpckJ/d0buHoFbyKVuW5NCQNpUdYzDsPS2riyeXccCsLFJM1bT01TdR4Idla3vx9Fkb+HoJOiDeQ== +"@abp/datatables.net-bs4@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0.tgz#49470ef1f1a7b57cb9cfd1b47095d2e865ce74ce" + integrity sha512-tJ49688P8hjlxKYxqP2a6PUYrYX7qhm8jIc6MZrKWQyZbRbAwF0glUYa7MO73Us9Z3HRyPczedGQ3qK9pCu0Mg== dependencies: - "@abp/datatables.net" "~4.3.0-rc.2" + "@abp/datatables.net" "~4.3.0" datatables.net-bs4 "^1.10.21" -"@abp/datatables.net@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0-rc.2.tgz#1923e60db261366a7d2f284b0274d13e253567ca" - integrity sha512-rp53+5Xj1jhjpCj7UBA9+nSNbaTQ4Vc1NWCg1e5aI5tWiyZprUS44dRszIQIDV86XKorfFhog5ihOZyzl1HDyg== +"@abp/datatables.net@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0.tgz#fa5f01eb32b60176f5bef669abd898c0778ebb2c" + integrity sha512-ZRDIeAMc9buIGuMSO8WkMm16qYS8xYljj6NxDpGTdqP/+BOnhtw3/fbH1LOLj+If38rP+Q6ANbnZp7MXzqNlig== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" datatables.net "^1.10.21" -"@abp/font-awesome@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0-rc.2.tgz#437d3d6bbd8f52e5091251932d6a494d0164694b" - integrity sha512-FeHHtEQwrJBwD5PkFYqjKouCLwNjjRqTNseaN+s/r7gNjv0PgKytfRoqEb+O/BkZg/DwEuMz9jFX/RXCCNa2xA== +"@abp/font-awesome@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0.tgz#4a372ed9294df32d477a3b08aa080b39d9b44d6a" + integrity sha512-Ny9bFIN9EZGWU2DGQeURlJmH9iYo9N7GYBluNFunmftN+K2G+2739otg06qGoLmoxF8hGzyYvKmwhykjxY9pYw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" "@fortawesome/fontawesome-free" "^5.13.0" -"@abp/jquery-form@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0-rc.2.tgz#999910deaf46330477b6ed487a771a2123d69f92" - integrity sha512-+fdEIOTlxDOdYXMtc/ujhYeuP2qiI4bmL3TQQWQxSTlW8q5jB6dHLBnHiXXltO8HxX9+7ZsjN3tsV7+Div5joA== +"@abp/jquery-form@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0.tgz#98b9937bb258abbe306f03d5ac4e0b2b60022c4d" + integrity sha512-f4IPJnSA5v2DBEmf/XAqCqsZJR9AKzOsCCBH3GEct1VzJd4GYr9CL4qMc5jDjfCZ4PWN4SgqBd3mHQRB+yo0pA== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-form "^4.3.0" -"@abp/jquery-validation-unobtrusive@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0-rc.2.tgz#0635e0c77da269e8367c3d7c388613249ce9221d" - integrity sha512-ubmPjVJatAW3AJWjWtT+ZbNLhu+HHNgcxYkFGVNusNuboTGsoBs5G45Cjzp/q5FnggWoPvkllpf8CGuaYUbpUQ== +"@abp/jquery-validation-unobtrusive@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0.tgz#e6dc6cc94780c7db9b556f2f991d2d992dbfee38" + integrity sha512-AmvI9kOJQ9f+fTwqDMvODMSvkMgMN3XvBF0v/EbZpF86tMtQTWfCHf+gofmq9WjM96QJjhCjLRl0hirQfSBfbg== dependencies: - "@abp/jquery-validation" "~4.3.0-rc.2" + "@abp/jquery-validation" "~4.3.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0-rc.2.tgz#ee145f8c4a633218ccfa50cca0bed503a0ca8dc6" - integrity sha512-SLWzN6jxVqKaHYs/d6Mku8CfhB1vWgfMbFma14upiJ+/VDkTF4Rh27iMCWKYVOS3bukh2ltBp6kPFplrjCAGSg== +"@abp/jquery-validation@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0.tgz#89a8bc2196dfabed57ef6a754c9da4b77b0cc44f" + integrity sha512-gwvRR6117JJTRGEk1zxdR0toVsfRLekaW/YDw4DsE3iwdhBTS05DyoEpl+4kUflWrjmRSKsVhWeoyndCDMi8Qw== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-validation "^1.19.2" -"@abp/jquery@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0-rc.2.tgz#f620628ea0739888cbcb360c058d09bff10d553b" - integrity sha512-+rfyLVJn7E8wJ1oQ9GiCR63Yk6wah1Hqnj4XpsRDMkIaOXKaqrnVHAZd4W2DUunQSe95wqHfkNH/wkvTyNEwUg== +"@abp/jquery@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0.tgz#8c6dab7b0a657a7d89faee18157d6111c55d3df3" + integrity sha512-+3SCUjQjT6WQ9pYJCu3PUhgCrFPgTOD3Q/cTNbzTL5a6J3bpp+U26L5qwFhoQ0j+FH+VNAZGDsL/UtT9/Lwa1A== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" jquery "~3.5.1" -"@abp/lodash@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0-rc.2.tgz#9b5429d3976b34022aaf8cab4afef57479b66821" - integrity sha512-sE2dyofYbiIy4xhL85diZWkfqBcQl1q61T0DbYDOHgaejZAJxk4bVyFpEuMiC2HwWAZ656IN1bzyQIyE1RKzQA== +"@abp/lodash@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0.tgz#44c194c07031e162d7d8f90d7225ef4b3834c068" + integrity sha512-p+wG99Ze0+Kqee588mFkYGYbyVtdWk49eVujjHA1KdPXNC+rEco0pH1943pbSqni5VzJCIkY9PvG40If5CZykQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" lodash "^4.17.15" -"@abp/luxon@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0-rc.2.tgz#6fdbf1624462615dcb1f5ce85c07fc3bc4065e3f" - integrity sha512-C4aT0aN3/TVtTE3m0AZyhFSeeg+RxXpUO+nffAZoM/cH5NL8tir+O1hd+dhtCb7AELaqQNx5+qgXoJLYdWMYVg== +"@abp/luxon@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0.tgz#930ed60b19c2ad1e86e817fe10861f042b2eb08a" + integrity sha512-gusXqRmHMOqmlHRe4N9CQL4Ncr3qazwWvi8QUdEity4a2mofgVPvn7F/E7uBVFjRL1EBp+nAUfohBPwQJECy5w== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" luxon "^1.24.1" -"@abp/malihu-custom-scrollbar-plugin@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0-rc.2.tgz#28fc1f216c1d84b20acaf8c8c5cf5c3b33e1aeb1" - integrity sha512-LYMXKkPVyBLWV4Qnom2MW8JJ/rZmVg1CyOFxM6JiL+dpsN1Ogw0hRG33CCHQveqUmf2cr3vf96qk5Et5DyDDIg== +"@abp/malihu-custom-scrollbar-plugin@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0.tgz#a6ce99cf29c36985b3268fa6309aad38438d7d2d" + integrity sha512-swip33gDRAWGIdyJmD+SrNBv2uyq6PJwG9RKnpFLaUiqbU8NhtnTl+bGCkO2BTTjBrP6dOPe7bmu3B8EO/zrMQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0-rc.2.tgz#42d62daff9e50b1fe211a1560794625ba3f52107" - integrity sha512-okiIXmFaqx0uy/UMcpMKWKjrwop1JINyzN4FS5tafUpWhx6KcYYHudLWJvnPbsdsOeBQx91kw8jjERRJIqfEOA== +"@abp/select2@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0.tgz#0a63ab0f740f36644017024865a4f1f4038a7bc9" + integrity sha512-uRNdTTOx5US4bOWcSDrHJt3WgWT5mroxXWooPOBirqhPVx7gvqVYDoGhXpyyoE80Hs+a/ISW/vJUIp8gsOKwEw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" select2 "^4.0.13" -"@abp/sweetalert@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0-rc.2.tgz#dfb20dfca8449ed3c3f6599d99b51746019eb664" - integrity sha512-NRKOgT80JVQrwI1FRqpbCzALvnLAFKdPwKKNDgm0L7r/5DL0+JbkKCI1AIPl/yiM8MBrCaQqNms+9JES5mjiUQ== +"@abp/sweetalert@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0.tgz#080b1133b5b6a67593bf7ebda8e9f6042ac2f24e" + integrity sha512-hkWvmqPk0foRA44k+2VjVoyRwwaPQMBayyRocc66+XwwGU5xSwR4VosLd8xxXW8la69rhDvQdoECguXKnHPYRA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" sweetalert "^2.1.2" -"@abp/timeago@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0-rc.2.tgz#22943e219facd7fa0efddb63017198474b5cef89" - integrity sha512-TjKyuli+SpVjTgVJmraBpqJK112I+1DYHPJfso7QAH48Ra4gceGj9EVS0i/420YyLZyJSMtZOruxzYkyJeR/6w== +"@abp/timeago@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0.tgz#79a75895781248cf7e5035204d19de7f55cbf685" + integrity sha512-R219V16eRhp4BjcmNzHHK078LF/QHr219hG7dmVtRIooNt4J8nEGDj3C5Ll1S0NjO5sM/78PhC6gLD1FQGMkaQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" timeago "^1.6.7" -"@abp/toastr@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0-rc.2.tgz#143a344b00bbfaa858fe267fb6d627952bf7b3c0" - integrity sha512-cQV9UFWb9zarkb/CbrqkF9RXqn1Fc/TFKKM5mxpUEcYjx52NuM0d+KawdEMoN2y3y2U4ciY44kbTP2W1y+NlBg== +"@abp/toastr@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0.tgz#3e14e461bdaf5c43548b86799062bac150e9d1bc" + integrity sha512-9g1A4U3Svp4oesB5UGmfVGb8BmXZ9PPka3OWxYh0g9UNUvBsOqfxz1MH9Ho20Gz7wQ+dTce2XWPA6VbAMfwwvQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" toastr "^2.1.4" -"@abp/utils@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0-rc.2.tgz#6d051f98772e5642c2e3bc2f68e73d6f24f4694c" - integrity sha512-9qYo8OMTxIUG+qQBWXEpkURS6FUrx+J5s3SwC/eerp46hYr72GQ8L38Wq566a+xiLCn7Duxt6oJ/BxhTfQQxdw== +"@abp/utils@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0.tgz#5fe44ae9a76ba8760bfd54dc6cfc64c96acc4b67" + integrity sha512-FFPSn/cL+b7/wYoRjvQLNJ3KrTiqng2gKPGf+jtMZer92fcVZtsF21ew/z+yxgj+9DRYtWbvn5iu9/ZPKL5hiw== dependencies: just-compare "^1.3.0" diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/package.json b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/package.json index 438f9df375..5652a2dd08 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/package.json +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/package.json @@ -3,8 +3,8 @@ "name": "asp.net", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0-rc.2", - "@abp/prismjs": "^4.3.0-rc.2" + "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0", + "@abp/prismjs": "^4.3.0" }, "devDependencies": {} } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/wwwroot/libs/prismjs/components/prism-n4js.js b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/wwwroot/libs/prismjs/components/prism-n4js.js old mode 100644 new mode 100755 diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/wwwroot/libs/prismjs/components/prism-n4js.min.js b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/wwwroot/libs/prismjs/components/prism-n4js.min.js old mode 100644 new mode 100755 diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/wwwroot/libs/prismjs/package.json b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/wwwroot/libs/prismjs/package.json old mode 100644 new mode 100755 diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/yarn.lock b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/yarn.lock index 910082d2cc..c7159e6796 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/yarn.lock +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0-rc.2.tgz#4ebafbaade6610e3d405877a148d72d57569c3e3" - integrity sha512-Q3QqxKDFC04gaaj30Rk+9zGNfNxC8FX0jciARATceFV6pdA3F3PgT5EMDSlo6NoGniFVjHPRgay9N09zT6Htyw== - dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0-rc.2.tgz#d3bf79929c55c5380d7ca7b913a23031d7a6bd12" - integrity sha512-pz86bIV4wNeG7/UPYzNCXlJ/MdOdIygc+Com7C9Ld7gzsyER7VD9h5U/hkytvL4FBFLJn4DU+xuZNECjv0HS0A== - dependencies: - "@abp/aspnetcore.mvc.ui" "~4.3.0-rc.2" - "@abp/bootstrap" "~4.3.0-rc.2" - "@abp/bootstrap-datepicker" "~4.3.0-rc.2" - "@abp/datatables.net-bs4" "~4.3.0-rc.2" - "@abp/font-awesome" "~4.3.0-rc.2" - "@abp/jquery-form" "~4.3.0-rc.2" - "@abp/jquery-validation-unobtrusive" "~4.3.0-rc.2" - "@abp/lodash" "~4.3.0-rc.2" - "@abp/luxon" "~4.3.0-rc.2" - "@abp/malihu-custom-scrollbar-plugin" "~4.3.0-rc.2" - "@abp/select2" "~4.3.0-rc.2" - "@abp/sweetalert" "~4.3.0-rc.2" - "@abp/timeago" "~4.3.0-rc.2" - "@abp/toastr" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0-rc.2.tgz#6ff41be179c8d1089778a51ffa54a1f3d7614278" - integrity sha512-2L5zvuqUwPwNPcMauiiJZD1ft0QycqINz+bXEQ8t0EwbB+dzcsukL/rpOQfpeRHWWYy4nIN4C2bTvXhNgQbPqQ== +"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0.tgz#33d6f72b698e5b8f399fb648817ed1fce070d482" + integrity sha512-jZNRm+R207KGs+0KvbLSGjvjm0i7y6ktHqH0tJ5nJ51B4xwOSxC64xmZXMQyazyqeGTKxpWVzIhqiFPb+q41Vg== + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0" + +"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0.tgz#6150c87f848e3cee36c217b01304b76aaa7991bb" + integrity sha512-urL7zQZu3jceXoSDBHQpzP/uhFYGZtreW22ohVINw2QTonCCd/ojRIVOZvf+GtMSRBqeecBqtdOjr9aoah+z9Q== + dependencies: + "@abp/aspnetcore.mvc.ui" "~4.3.0" + "@abp/bootstrap" "~4.3.0" + "@abp/bootstrap-datepicker" "~4.3.0" + "@abp/datatables.net-bs4" "~4.3.0" + "@abp/font-awesome" "~4.3.0" + "@abp/jquery-form" "~4.3.0" + "@abp/jquery-validation-unobtrusive" "~4.3.0" + "@abp/lodash" "~4.3.0" + "@abp/luxon" "~4.3.0" + "@abp/malihu-custom-scrollbar-plugin" "~4.3.0" + "@abp/select2" "~4.3.0" + "@abp/sweetalert" "~4.3.0" + "@abp/timeago" "~4.3.0" + "@abp/toastr" "~4.3.0" + +"@abp/aspnetcore.mvc.ui@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0.tgz#0098e528a929eb87da5c661cf3edf062bf2cb8c7" + integrity sha512-k0cXjDk33wDhr0tqjCG7UYJU5y2UJW+uCAp5cQTFqK9HqeYW1huGfRydECh3m8jqPGRmZRx4aJGQo6Te92bjcw== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -43,162 +43,162 @@ micromatch "^4.0.2" path "^0.12.7" -"@abp/bootstrap-datepicker@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0-rc.2.tgz#29a686c3d2bce356967f646d7334cd83c4257b4c" - integrity sha512-3+B7SJRi7DQJe0aNgv0H0zu1BfvMZcwgt06N3ALR9+o3TSJcOqcYrEMed3aG+ASH++CltnohTYnLkVXaxshioA== +"@abp/bootstrap-datepicker@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0.tgz#a4246b06d41ad39bf8a84b310227b0b44c2ca4f4" + integrity sha512-f/M7rpr87BPyk47RDUobWBbkMUwRlY+riRnWaoHkSAOwwSMBkkXsAxyEAkbRlIiYFBfNkrVl1OpTOliinhvWjQ== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0-rc.2.tgz#1416fe639c88b7d958435e45fe19692268a7f932" - integrity sha512-E6svmDhNQlT5nd65VgshexyedRWhbvi9o1oYo/dLTUpJDzR7M9ptDqxFLVB9vVDva3HgxUoEvgRJgb9fXvq4zw== +"@abp/bootstrap@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0.tgz#9dc88066bbb19ee50eb27460ab06f1593fae76cd" + integrity sha512-tV/K6nNl7Rt4BEQFlbPUtXMSTC+Usc1ArP6JMNL++1xOOT2Kyye172WEWnTcT7RRnveq7kid090Dxk9g3IyprA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" bootstrap "^4.6.0" bootstrap-v4-rtl "4.6.0-1" -"@abp/clipboard@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/clipboard/-/clipboard-4.3.0-rc.2.tgz#63670e869b09f9e10ec9a2e7f8ffcc097ce1efc7" - integrity sha512-jTHzum4h5TQqAKJKEHwJ88NLFmby92hJ8byOBl/HAjOHb8LhWuw/ktTwl2knd0/63KpiCKYZGQPV3kk5JXVQ6w== +"@abp/clipboard@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/clipboard/-/clipboard-4.3.0.tgz#71ddeda84a4977c19aaeec94cbc6410d5142ab68" + integrity sha512-S2QX+Yk6f1k+X0ghEbzDI8/l6nJkeLACPVfSg0TAxbF6LES7i9YOLdfKYRvacfLheN0nQQJeWalCNsjaQXwuwA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" clipboard "^2.0.6" -"@abp/core@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0-rc.2.tgz#3c9ea339624ae3b6cbee13e048268d48269ea6a9" - integrity sha512-/89xH+IVSmTOLWeUO4yVB7Hg64uHTbR7bHjgl+b94cFdtITH9Nvr2EGdXUJbHGUK7L6lSDziqiMcG/ic0061+Q== +"@abp/core@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0.tgz#77945a62daae70b5f9f348036ab7c5a308d95a94" + integrity sha512-k+6BemPsencQasN+8W9sVYXdSOjea61ng2MIaPVTuCCjLWnReg4pQQ4QoJWsja+W36C8bratzT5ePwP6ZrCnMg== dependencies: - "@abp/utils" "^4.3.0-rc.2" + "@abp/utils" "^4.3.0" -"@abp/datatables.net-bs4@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0-rc.2.tgz#bbfc0d9d0ed86cdb14b38849fb78b2b1911c4a35" - integrity sha512-PRKYi2NU41KpckJ/d0buHoFbyKVuW5NCQNpUdYzDsPS2riyeXccCsLFJM1bT01TdR4Idla3vx9Fkb+HoJOiDeQ== +"@abp/datatables.net-bs4@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0.tgz#49470ef1f1a7b57cb9cfd1b47095d2e865ce74ce" + integrity sha512-tJ49688P8hjlxKYxqP2a6PUYrYX7qhm8jIc6MZrKWQyZbRbAwF0glUYa7MO73Us9Z3HRyPczedGQ3qK9pCu0Mg== dependencies: - "@abp/datatables.net" "~4.3.0-rc.2" + "@abp/datatables.net" "~4.3.0" datatables.net-bs4 "^1.10.21" -"@abp/datatables.net@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0-rc.2.tgz#1923e60db261366a7d2f284b0274d13e253567ca" - integrity sha512-rp53+5Xj1jhjpCj7UBA9+nSNbaTQ4Vc1NWCg1e5aI5tWiyZprUS44dRszIQIDV86XKorfFhog5ihOZyzl1HDyg== +"@abp/datatables.net@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0.tgz#fa5f01eb32b60176f5bef669abd898c0778ebb2c" + integrity sha512-ZRDIeAMc9buIGuMSO8WkMm16qYS8xYljj6NxDpGTdqP/+BOnhtw3/fbH1LOLj+If38rP+Q6ANbnZp7MXzqNlig== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" datatables.net "^1.10.21" -"@abp/font-awesome@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0-rc.2.tgz#437d3d6bbd8f52e5091251932d6a494d0164694b" - integrity sha512-FeHHtEQwrJBwD5PkFYqjKouCLwNjjRqTNseaN+s/r7gNjv0PgKytfRoqEb+O/BkZg/DwEuMz9jFX/RXCCNa2xA== +"@abp/font-awesome@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0.tgz#4a372ed9294df32d477a3b08aa080b39d9b44d6a" + integrity sha512-Ny9bFIN9EZGWU2DGQeURlJmH9iYo9N7GYBluNFunmftN+K2G+2739otg06qGoLmoxF8hGzyYvKmwhykjxY9pYw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" "@fortawesome/fontawesome-free" "^5.13.0" -"@abp/jquery-form@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0-rc.2.tgz#999910deaf46330477b6ed487a771a2123d69f92" - integrity sha512-+fdEIOTlxDOdYXMtc/ujhYeuP2qiI4bmL3TQQWQxSTlW8q5jB6dHLBnHiXXltO8HxX9+7ZsjN3tsV7+Div5joA== +"@abp/jquery-form@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0.tgz#98b9937bb258abbe306f03d5ac4e0b2b60022c4d" + integrity sha512-f4IPJnSA5v2DBEmf/XAqCqsZJR9AKzOsCCBH3GEct1VzJd4GYr9CL4qMc5jDjfCZ4PWN4SgqBd3mHQRB+yo0pA== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-form "^4.3.0" -"@abp/jquery-validation-unobtrusive@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0-rc.2.tgz#0635e0c77da269e8367c3d7c388613249ce9221d" - integrity sha512-ubmPjVJatAW3AJWjWtT+ZbNLhu+HHNgcxYkFGVNusNuboTGsoBs5G45Cjzp/q5FnggWoPvkllpf8CGuaYUbpUQ== +"@abp/jquery-validation-unobtrusive@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0.tgz#e6dc6cc94780c7db9b556f2f991d2d992dbfee38" + integrity sha512-AmvI9kOJQ9f+fTwqDMvODMSvkMgMN3XvBF0v/EbZpF86tMtQTWfCHf+gofmq9WjM96QJjhCjLRl0hirQfSBfbg== dependencies: - "@abp/jquery-validation" "~4.3.0-rc.2" + "@abp/jquery-validation" "~4.3.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0-rc.2.tgz#ee145f8c4a633218ccfa50cca0bed503a0ca8dc6" - integrity sha512-SLWzN6jxVqKaHYs/d6Mku8CfhB1vWgfMbFma14upiJ+/VDkTF4Rh27iMCWKYVOS3bukh2ltBp6kPFplrjCAGSg== +"@abp/jquery-validation@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0.tgz#89a8bc2196dfabed57ef6a754c9da4b77b0cc44f" + integrity sha512-gwvRR6117JJTRGEk1zxdR0toVsfRLekaW/YDw4DsE3iwdhBTS05DyoEpl+4kUflWrjmRSKsVhWeoyndCDMi8Qw== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-validation "^1.19.2" -"@abp/jquery@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0-rc.2.tgz#f620628ea0739888cbcb360c058d09bff10d553b" - integrity sha512-+rfyLVJn7E8wJ1oQ9GiCR63Yk6wah1Hqnj4XpsRDMkIaOXKaqrnVHAZd4W2DUunQSe95wqHfkNH/wkvTyNEwUg== +"@abp/jquery@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0.tgz#8c6dab7b0a657a7d89faee18157d6111c55d3df3" + integrity sha512-+3SCUjQjT6WQ9pYJCu3PUhgCrFPgTOD3Q/cTNbzTL5a6J3bpp+U26L5qwFhoQ0j+FH+VNAZGDsL/UtT9/Lwa1A== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" jquery "~3.5.1" -"@abp/lodash@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0-rc.2.tgz#9b5429d3976b34022aaf8cab4afef57479b66821" - integrity sha512-sE2dyofYbiIy4xhL85diZWkfqBcQl1q61T0DbYDOHgaejZAJxk4bVyFpEuMiC2HwWAZ656IN1bzyQIyE1RKzQA== +"@abp/lodash@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0.tgz#44c194c07031e162d7d8f90d7225ef4b3834c068" + integrity sha512-p+wG99Ze0+Kqee588mFkYGYbyVtdWk49eVujjHA1KdPXNC+rEco0pH1943pbSqni5VzJCIkY9PvG40If5CZykQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" lodash "^4.17.15" -"@abp/luxon@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0-rc.2.tgz#6fdbf1624462615dcb1f5ce85c07fc3bc4065e3f" - integrity sha512-C4aT0aN3/TVtTE3m0AZyhFSeeg+RxXpUO+nffAZoM/cH5NL8tir+O1hd+dhtCb7AELaqQNx5+qgXoJLYdWMYVg== +"@abp/luxon@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0.tgz#930ed60b19c2ad1e86e817fe10861f042b2eb08a" + integrity sha512-gusXqRmHMOqmlHRe4N9CQL4Ncr3qazwWvi8QUdEity4a2mofgVPvn7F/E7uBVFjRL1EBp+nAUfohBPwQJECy5w== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" luxon "^1.24.1" -"@abp/malihu-custom-scrollbar-plugin@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0-rc.2.tgz#28fc1f216c1d84b20acaf8c8c5cf5c3b33e1aeb1" - integrity sha512-LYMXKkPVyBLWV4Qnom2MW8JJ/rZmVg1CyOFxM6JiL+dpsN1Ogw0hRG33CCHQveqUmf2cr3vf96qk5Et5DyDDIg== +"@abp/malihu-custom-scrollbar-plugin@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0.tgz#a6ce99cf29c36985b3268fa6309aad38438d7d2d" + integrity sha512-swip33gDRAWGIdyJmD+SrNBv2uyq6PJwG9RKnpFLaUiqbU8NhtnTl+bGCkO2BTTjBrP6dOPe7bmu3B8EO/zrMQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/prismjs@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/prismjs/-/prismjs-4.3.0-rc.2.tgz#ecb98291898ba0c2fd4317be022d1a3e281c8bea" - integrity sha512-LA2pmTDhB3NwM4hEkZSW1xBXsixIXY2FVnEHS7ATkyRr36W/Gqb5fchv0ILBD7Gce40pAiPO2dMs4SUWT8qk0Q== +"@abp/prismjs@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/prismjs/-/prismjs-4.3.0.tgz#b970bdbe5a799dad62c91dab2232e0f68c0bc1fa" + integrity sha512-/WCbvEXxbwA/PrgakaJQz+i/7BfTuvAN6ncHmRv25KtqZrGEtlEcbbrBTyZ3/FjGWiT0RZmFk9tP7bafs0y7sg== dependencies: - "@abp/clipboard" "~4.3.0-rc.2" - "@abp/core" "~4.3.0-rc.2" + "@abp/clipboard" "~4.3.0" + "@abp/core" "~4.3.0" prismjs "^1.20.0" -"@abp/select2@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0-rc.2.tgz#42d62daff9e50b1fe211a1560794625ba3f52107" - integrity sha512-okiIXmFaqx0uy/UMcpMKWKjrwop1JINyzN4FS5tafUpWhx6KcYYHudLWJvnPbsdsOeBQx91kw8jjERRJIqfEOA== +"@abp/select2@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0.tgz#0a63ab0f740f36644017024865a4f1f4038a7bc9" + integrity sha512-uRNdTTOx5US4bOWcSDrHJt3WgWT5mroxXWooPOBirqhPVx7gvqVYDoGhXpyyoE80Hs+a/ISW/vJUIp8gsOKwEw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" select2 "^4.0.13" -"@abp/sweetalert@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0-rc.2.tgz#dfb20dfca8449ed3c3f6599d99b51746019eb664" - integrity sha512-NRKOgT80JVQrwI1FRqpbCzALvnLAFKdPwKKNDgm0L7r/5DL0+JbkKCI1AIPl/yiM8MBrCaQqNms+9JES5mjiUQ== +"@abp/sweetalert@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0.tgz#080b1133b5b6a67593bf7ebda8e9f6042ac2f24e" + integrity sha512-hkWvmqPk0foRA44k+2VjVoyRwwaPQMBayyRocc66+XwwGU5xSwR4VosLd8xxXW8la69rhDvQdoECguXKnHPYRA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" sweetalert "^2.1.2" -"@abp/timeago@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0-rc.2.tgz#22943e219facd7fa0efddb63017198474b5cef89" - integrity sha512-TjKyuli+SpVjTgVJmraBpqJK112I+1DYHPJfso7QAH48Ra4gceGj9EVS0i/420YyLZyJSMtZOruxzYkyJeR/6w== +"@abp/timeago@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0.tgz#79a75895781248cf7e5035204d19de7f55cbf685" + integrity sha512-R219V16eRhp4BjcmNzHHK078LF/QHr219hG7dmVtRIooNt4J8nEGDj3C5Ll1S0NjO5sM/78PhC6gLD1FQGMkaQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" timeago "^1.6.7" -"@abp/toastr@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0-rc.2.tgz#143a344b00bbfaa858fe267fb6d627952bf7b3c0" - integrity sha512-cQV9UFWb9zarkb/CbrqkF9RXqn1Fc/TFKKM5mxpUEcYjx52NuM0d+KawdEMoN2y3y2U4ciY44kbTP2W1y+NlBg== +"@abp/toastr@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0.tgz#3e14e461bdaf5c43548b86799062bac150e9d1bc" + integrity sha512-9g1A4U3Svp4oesB5UGmfVGb8BmXZ9PPka3OWxYh0g9UNUvBsOqfxz1MH9Ho20Gz7wQ+dTce2XWPA6VbAMfwwvQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" toastr "^2.1.4" -"@abp/utils@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0-rc.2.tgz#6d051f98772e5642c2e3bc2f68e73d6f24f4694c" - integrity sha512-9qYo8OMTxIUG+qQBWXEpkURS6FUrx+J5s3SwC/eerp46hYr72GQ8L38Wq566a+xiLCn7Duxt6oJ/BxhTfQQxdw== +"@abp/utils@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0.tgz#5fe44ae9a76ba8760bfd54dc6cfc64c96acc4b67" + integrity sha512-FFPSn/cL+b7/wYoRjvQLNJ3KrTiqng2gKPGf+jtMZer92fcVZtsF21ew/z+yxgj+9DRYtWbvn5iu9/ZPKL5hiw== dependencies: just-compare "^1.3.0" diff --git a/modules/account/Volo.Abp.Account.abpmdl.json b/modules/account/Volo.Abp.Account.abpmdl.json new file mode 100644 index 0000000000..c6135f99c5 --- /dev/null +++ b/modules/account/Volo.Abp.Account.abpmdl.json @@ -0,0 +1,65 @@ +{ + "folders": { + "src": {}, + "test": {} + }, + "imports": { + "Volo.Abp.Identity": { + "path": "../identity/Volo.Abp.Identity.abpmdl.json" + }, + "Volo.Abp.PermissionManagement": { + "path": "../permission-management/Volo.Abp.PermissionManagement.abpmdl.json" + } + }, + "packages": { + "Volo.Abp.Account.Application.Contracts": { + "path": "src/Volo.Abp.Account.Application.Contracts/Volo.Abp.Account.Application.Contracts.csproj", + "folder": "src", + "includes": { + "lib.application.contracts": {} + } + }, + "Volo.Abp.Account.Application": { + "path": "src/Volo.Abp.Account.Application/Volo.Abp.Account.Application.csproj", + "folder": "src", + "includes": { + "lib.application": {} + } + }, + "Volo.Abp.Account.HttpApi": { + "path": "src/Volo.Abp.Account.HttpApi/Volo.Abp.Account.HttpApi.csproj", + "folder": "src", + "includes": { + "lib.http-api": {} + } + }, + "Volo.Abp.Account.HttpApi.Client": { + "path": "src/Volo.Abp.Account.HttpApi.Client/Volo.Abp.Account.HttpApi.Client.csproj", + "folder": "src", + "includes": { + "lib.http-api-client": {} + } + }, + "Volo.Abp.Account.Web": { + "path": "src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj", + "folder": "src", + "includes": { + "lib.ui.mvc": {} + } + }, + "Volo.Abp.Account.Web.IdentityServer": { + "path": "src/Volo.Abp.Account.IdentityServer/Volo.Abp.Account.IdentityServer.csproj", + "folder": "src", + "includes": { + "lib.ui.mvc": {} + } + }, + "Volo.Abp.Account.Application.Tests": { + "path": "test/Volo.Abp.Account.Application.Tests/Volo.Abp.Account.Application.Tests.csproj", + "folder": "test", + "includes": { + "lib.test": {} + } + } + } +} \ No newline at end of file diff --git a/modules/account/Volo.Abp.Account.abpsln.json b/modules/account/Volo.Abp.Account.abpsln.json new file mode 100644 index 0000000000..7a1b7818a9 --- /dev/null +++ b/modules/account/Volo.Abp.Account.abpsln.json @@ -0,0 +1,7 @@ +{ + "modules": { + "Volo.Abp.Account": { + "path": "Volo.Abp.Account.abpmdl.json" + } + } +} \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/nl.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/nl.json index efd751859e..7b17f1076b 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/nl.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/nl.json @@ -60,6 +60,8 @@ "Volo.Account:InvalidEmailAddress": "Kan het opgegeven e-mailadres '{0}' niet vinden", "PasswordReset": "Wachtwoord opnieuw instellen", "PasswordResetInfoInEmail": "We hebben een verzoek ontvangen om uw wachtwoord opnieuw in te stellen. Als u dit verzoek heeft ingediend, klikt u op de volgende link om een nieuw wachtwoord in te stellen.", - "ResetMyPassword": "Reset mijn wachtwoord" + "ResetMyPassword": "Reset mijn wachtwoord", + "AccessDenied": "Toegang geweigerd!", + "AccessDeniedMessage": "U heeft geen toegang tot deze bron." } } \ No newline at end of file diff --git a/modules/blogging/app/Volo.BloggingTestApp/package.json b/modules/blogging/app/Volo.BloggingTestApp/package.json index 9570a265db..f179cbb3b2 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/package.json +++ b/modules/blogging/app/Volo.BloggingTestApp/package.json @@ -3,7 +3,7 @@ "name": "volo.blogtestapp", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0-rc.2", - "@abp/blogging": "^4.3.0-rc.2" + "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0", + "@abp/blogging": "^4.3.0" } } \ No newline at end of file diff --git a/modules/blogging/app/Volo.BloggingTestApp/yarn.lock b/modules/blogging/app/Volo.BloggingTestApp/yarn.lock index ea7d837a0b..4e9a58ca1b 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/yarn.lock +++ b/modules/blogging/app/Volo.BloggingTestApp/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0-rc.2.tgz#4ebafbaade6610e3d405877a148d72d57569c3e3" - integrity sha512-Q3QqxKDFC04gaaj30Rk+9zGNfNxC8FX0jciARATceFV6pdA3F3PgT5EMDSlo6NoGniFVjHPRgay9N09zT6Htyw== - dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0-rc.2.tgz#d3bf79929c55c5380d7ca7b913a23031d7a6bd12" - integrity sha512-pz86bIV4wNeG7/UPYzNCXlJ/MdOdIygc+Com7C9Ld7gzsyER7VD9h5U/hkytvL4FBFLJn4DU+xuZNECjv0HS0A== - dependencies: - "@abp/aspnetcore.mvc.ui" "~4.3.0-rc.2" - "@abp/bootstrap" "~4.3.0-rc.2" - "@abp/bootstrap-datepicker" "~4.3.0-rc.2" - "@abp/datatables.net-bs4" "~4.3.0-rc.2" - "@abp/font-awesome" "~4.3.0-rc.2" - "@abp/jquery-form" "~4.3.0-rc.2" - "@abp/jquery-validation-unobtrusive" "~4.3.0-rc.2" - "@abp/lodash" "~4.3.0-rc.2" - "@abp/luxon" "~4.3.0-rc.2" - "@abp/malihu-custom-scrollbar-plugin" "~4.3.0-rc.2" - "@abp/select2" "~4.3.0-rc.2" - "@abp/sweetalert" "~4.3.0-rc.2" - "@abp/timeago" "~4.3.0-rc.2" - "@abp/toastr" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0-rc.2.tgz#6ff41be179c8d1089778a51ffa54a1f3d7614278" - integrity sha512-2L5zvuqUwPwNPcMauiiJZD1ft0QycqINz+bXEQ8t0EwbB+dzcsukL/rpOQfpeRHWWYy4nIN4C2bTvXhNgQbPqQ== +"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0.tgz#33d6f72b698e5b8f399fb648817ed1fce070d482" + integrity sha512-jZNRm+R207KGs+0KvbLSGjvjm0i7y6ktHqH0tJ5nJ51B4xwOSxC64xmZXMQyazyqeGTKxpWVzIhqiFPb+q41Vg== + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0" + +"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0.tgz#6150c87f848e3cee36c217b01304b76aaa7991bb" + integrity sha512-urL7zQZu3jceXoSDBHQpzP/uhFYGZtreW22ohVINw2QTonCCd/ojRIVOZvf+GtMSRBqeecBqtdOjr9aoah+z9Q== + dependencies: + "@abp/aspnetcore.mvc.ui" "~4.3.0" + "@abp/bootstrap" "~4.3.0" + "@abp/bootstrap-datepicker" "~4.3.0" + "@abp/datatables.net-bs4" "~4.3.0" + "@abp/font-awesome" "~4.3.0" + "@abp/jquery-form" "~4.3.0" + "@abp/jquery-validation-unobtrusive" "~4.3.0" + "@abp/lodash" "~4.3.0" + "@abp/luxon" "~4.3.0" + "@abp/malihu-custom-scrollbar-plugin" "~4.3.0" + "@abp/select2" "~4.3.0" + "@abp/sweetalert" "~4.3.0" + "@abp/timeago" "~4.3.0" + "@abp/toastr" "~4.3.0" + +"@abp/aspnetcore.mvc.ui@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0.tgz#0098e528a929eb87da5c661cf3edf062bf2cb8c7" + integrity sha512-k0cXjDk33wDhr0tqjCG7UYJU5y2UJW+uCAp5cQTFqK9HqeYW1huGfRydECh3m8jqPGRmZRx4aJGQo6Te92bjcw== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -43,215 +43,215 @@ micromatch "^4.0.2" path "^0.12.7" -"@abp/blogging@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/blogging/-/blogging-4.3.0-rc.2.tgz#4123557055737297c83970bfa4d5ddeb7d8ab8e7" - integrity sha512-yMaMYet5Y7Rfpm84zzhTNL3b8pU3CHoxRuWFGYveMz03v4lqzmHxi39GLa8Tciimth2r/6SROVpPClcLGuuNLw== +"@abp/blogging@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/blogging/-/blogging-4.3.0.tgz#3a0041c2e01017b9fd88eb0a7ccdac57df22a586" + integrity sha512-Syy4Y/YJTLhPJtHGvToLf+kMycu50+fkaGONKV8bAC3x+4h9z046/uWa4MHRQA6y8W3QP0fXaUa+pNzjsnL2MQ== dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0-rc.2" - "@abp/owl.carousel" "~4.3.0-rc.2" - "@abp/prismjs" "~4.3.0-rc.2" - "@abp/tui-editor" "~4.3.0-rc.2" + "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0" + "@abp/owl.carousel" "~4.3.0" + "@abp/prismjs" "~4.3.0" + "@abp/tui-editor" "~4.3.0" -"@abp/bootstrap-datepicker@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0-rc.2.tgz#29a686c3d2bce356967f646d7334cd83c4257b4c" - integrity sha512-3+B7SJRi7DQJe0aNgv0H0zu1BfvMZcwgt06N3ALR9+o3TSJcOqcYrEMed3aG+ASH++CltnohTYnLkVXaxshioA== +"@abp/bootstrap-datepicker@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0.tgz#a4246b06d41ad39bf8a84b310227b0b44c2ca4f4" + integrity sha512-f/M7rpr87BPyk47RDUobWBbkMUwRlY+riRnWaoHkSAOwwSMBkkXsAxyEAkbRlIiYFBfNkrVl1OpTOliinhvWjQ== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0-rc.2.tgz#1416fe639c88b7d958435e45fe19692268a7f932" - integrity sha512-E6svmDhNQlT5nd65VgshexyedRWhbvi9o1oYo/dLTUpJDzR7M9ptDqxFLVB9vVDva3HgxUoEvgRJgb9fXvq4zw== +"@abp/bootstrap@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0.tgz#9dc88066bbb19ee50eb27460ab06f1593fae76cd" + integrity sha512-tV/K6nNl7Rt4BEQFlbPUtXMSTC+Usc1ArP6JMNL++1xOOT2Kyye172WEWnTcT7RRnveq7kid090Dxk9g3IyprA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" bootstrap "^4.6.0" bootstrap-v4-rtl "4.6.0-1" -"@abp/clipboard@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/clipboard/-/clipboard-4.3.0-rc.2.tgz#63670e869b09f9e10ec9a2e7f8ffcc097ce1efc7" - integrity sha512-jTHzum4h5TQqAKJKEHwJ88NLFmby92hJ8byOBl/HAjOHb8LhWuw/ktTwl2knd0/63KpiCKYZGQPV3kk5JXVQ6w== +"@abp/clipboard@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/clipboard/-/clipboard-4.3.0.tgz#71ddeda84a4977c19aaeec94cbc6410d5142ab68" + integrity sha512-S2QX+Yk6f1k+X0ghEbzDI8/l6nJkeLACPVfSg0TAxbF6LES7i9YOLdfKYRvacfLheN0nQQJeWalCNsjaQXwuwA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" clipboard "^2.0.6" -"@abp/codemirror@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/codemirror/-/codemirror-4.3.0-rc.2.tgz#672d43fe99b74ed5b4e85a0ba79ba70e261a8e31" - integrity sha512-ZGGg8wkxRF9ZypEfmXFHTAg+dNn7uklfsBH4PJBB7CRpI5m3qth5ZQeIoUFbdoJHFWXl/UevmM9yzI1P05jZFA== +"@abp/codemirror@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/codemirror/-/codemirror-4.3.0.tgz#d41c999b696b5db9eedc3b71f52e23b85dc26808" + integrity sha512-9uvUSRsm7vj1Qu0RxQMcMaOLo5LrUC+hFOOkNyg0Pt+PeT+tO6Jm5A2DtcVMB7s+dpP3c56LhGwMnbXkC+4ExQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" codemirror "^5.54.0" -"@abp/core@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0-rc.2.tgz#3c9ea339624ae3b6cbee13e048268d48269ea6a9" - integrity sha512-/89xH+IVSmTOLWeUO4yVB7Hg64uHTbR7bHjgl+b94cFdtITH9Nvr2EGdXUJbHGUK7L6lSDziqiMcG/ic0061+Q== +"@abp/core@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0.tgz#77945a62daae70b5f9f348036ab7c5a308d95a94" + integrity sha512-k+6BemPsencQasN+8W9sVYXdSOjea61ng2MIaPVTuCCjLWnReg4pQQ4QoJWsja+W36C8bratzT5ePwP6ZrCnMg== dependencies: - "@abp/utils" "^4.3.0-rc.2" + "@abp/utils" "^4.3.0" -"@abp/datatables.net-bs4@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0-rc.2.tgz#bbfc0d9d0ed86cdb14b38849fb78b2b1911c4a35" - integrity sha512-PRKYi2NU41KpckJ/d0buHoFbyKVuW5NCQNpUdYzDsPS2riyeXccCsLFJM1bT01TdR4Idla3vx9Fkb+HoJOiDeQ== +"@abp/datatables.net-bs4@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0.tgz#49470ef1f1a7b57cb9cfd1b47095d2e865ce74ce" + integrity sha512-tJ49688P8hjlxKYxqP2a6PUYrYX7qhm8jIc6MZrKWQyZbRbAwF0glUYa7MO73Us9Z3HRyPczedGQ3qK9pCu0Mg== dependencies: - "@abp/datatables.net" "~4.3.0-rc.2" + "@abp/datatables.net" "~4.3.0" datatables.net-bs4 "^1.10.21" -"@abp/datatables.net@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0-rc.2.tgz#1923e60db261366a7d2f284b0274d13e253567ca" - integrity sha512-rp53+5Xj1jhjpCj7UBA9+nSNbaTQ4Vc1NWCg1e5aI5tWiyZprUS44dRszIQIDV86XKorfFhog5ihOZyzl1HDyg== +"@abp/datatables.net@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0.tgz#fa5f01eb32b60176f5bef669abd898c0778ebb2c" + integrity sha512-ZRDIeAMc9buIGuMSO8WkMm16qYS8xYljj6NxDpGTdqP/+BOnhtw3/fbH1LOLj+If38rP+Q6ANbnZp7MXzqNlig== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" datatables.net "^1.10.21" -"@abp/font-awesome@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0-rc.2.tgz#437d3d6bbd8f52e5091251932d6a494d0164694b" - integrity sha512-FeHHtEQwrJBwD5PkFYqjKouCLwNjjRqTNseaN+s/r7gNjv0PgKytfRoqEb+O/BkZg/DwEuMz9jFX/RXCCNa2xA== +"@abp/font-awesome@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0.tgz#4a372ed9294df32d477a3b08aa080b39d9b44d6a" + integrity sha512-Ny9bFIN9EZGWU2DGQeURlJmH9iYo9N7GYBluNFunmftN+K2G+2739otg06qGoLmoxF8hGzyYvKmwhykjxY9pYw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" "@fortawesome/fontawesome-free" "^5.13.0" -"@abp/highlight.js@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/highlight.js/-/highlight.js-4.3.0-rc.2.tgz#a7c51e826b2a7e25c84af7ecbb38c5abe1d35dfb" - integrity sha512-oIGSsyAxdYm3ow/LbUwyYqtRvIOLQbsLQgP2+8FatnUdgFTKJRqG1RJXyPINDb3ldJlyQMFlgGlxlUV8cyqNzw== +"@abp/highlight.js@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/highlight.js/-/highlight.js-4.3.0.tgz#b55bde899dd042b279e3998c09364c77e729467a" + integrity sha512-GLy/P1STt2/DjgUStyyw8THJ89Iap4lPfHu2h/nrzZT9Qi4Gg+KbA7DWMgOEnX0ZnAS1Sk6SUnWB5UPm2CyP1A== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" -"@abp/jquery-form@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0-rc.2.tgz#999910deaf46330477b6ed487a771a2123d69f92" - integrity sha512-+fdEIOTlxDOdYXMtc/ujhYeuP2qiI4bmL3TQQWQxSTlW8q5jB6dHLBnHiXXltO8HxX9+7ZsjN3tsV7+Div5joA== +"@abp/jquery-form@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0.tgz#98b9937bb258abbe306f03d5ac4e0b2b60022c4d" + integrity sha512-f4IPJnSA5v2DBEmf/XAqCqsZJR9AKzOsCCBH3GEct1VzJd4GYr9CL4qMc5jDjfCZ4PWN4SgqBd3mHQRB+yo0pA== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-form "^4.3.0" -"@abp/jquery-validation-unobtrusive@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0-rc.2.tgz#0635e0c77da269e8367c3d7c388613249ce9221d" - integrity sha512-ubmPjVJatAW3AJWjWtT+ZbNLhu+HHNgcxYkFGVNusNuboTGsoBs5G45Cjzp/q5FnggWoPvkllpf8CGuaYUbpUQ== +"@abp/jquery-validation-unobtrusive@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0.tgz#e6dc6cc94780c7db9b556f2f991d2d992dbfee38" + integrity sha512-AmvI9kOJQ9f+fTwqDMvODMSvkMgMN3XvBF0v/EbZpF86tMtQTWfCHf+gofmq9WjM96QJjhCjLRl0hirQfSBfbg== dependencies: - "@abp/jquery-validation" "~4.3.0-rc.2" + "@abp/jquery-validation" "~4.3.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0-rc.2.tgz#ee145f8c4a633218ccfa50cca0bed503a0ca8dc6" - integrity sha512-SLWzN6jxVqKaHYs/d6Mku8CfhB1vWgfMbFma14upiJ+/VDkTF4Rh27iMCWKYVOS3bukh2ltBp6kPFplrjCAGSg== +"@abp/jquery-validation@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0.tgz#89a8bc2196dfabed57ef6a754c9da4b77b0cc44f" + integrity sha512-gwvRR6117JJTRGEk1zxdR0toVsfRLekaW/YDw4DsE3iwdhBTS05DyoEpl+4kUflWrjmRSKsVhWeoyndCDMi8Qw== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-validation "^1.19.2" -"@abp/jquery@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0-rc.2.tgz#f620628ea0739888cbcb360c058d09bff10d553b" - integrity sha512-+rfyLVJn7E8wJ1oQ9GiCR63Yk6wah1Hqnj4XpsRDMkIaOXKaqrnVHAZd4W2DUunQSe95wqHfkNH/wkvTyNEwUg== +"@abp/jquery@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0.tgz#8c6dab7b0a657a7d89faee18157d6111c55d3df3" + integrity sha512-+3SCUjQjT6WQ9pYJCu3PUhgCrFPgTOD3Q/cTNbzTL5a6J3bpp+U26L5qwFhoQ0j+FH+VNAZGDsL/UtT9/Lwa1A== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" jquery "~3.5.1" -"@abp/lodash@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0-rc.2.tgz#9b5429d3976b34022aaf8cab4afef57479b66821" - integrity sha512-sE2dyofYbiIy4xhL85diZWkfqBcQl1q61T0DbYDOHgaejZAJxk4bVyFpEuMiC2HwWAZ656IN1bzyQIyE1RKzQA== +"@abp/lodash@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0.tgz#44c194c07031e162d7d8f90d7225ef4b3834c068" + integrity sha512-p+wG99Ze0+Kqee588mFkYGYbyVtdWk49eVujjHA1KdPXNC+rEco0pH1943pbSqni5VzJCIkY9PvG40If5CZykQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" lodash "^4.17.15" -"@abp/luxon@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0-rc.2.tgz#6fdbf1624462615dcb1f5ce85c07fc3bc4065e3f" - integrity sha512-C4aT0aN3/TVtTE3m0AZyhFSeeg+RxXpUO+nffAZoM/cH5NL8tir+O1hd+dhtCb7AELaqQNx5+qgXoJLYdWMYVg== +"@abp/luxon@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0.tgz#930ed60b19c2ad1e86e817fe10861f042b2eb08a" + integrity sha512-gusXqRmHMOqmlHRe4N9CQL4Ncr3qazwWvi8QUdEity4a2mofgVPvn7F/E7uBVFjRL1EBp+nAUfohBPwQJECy5w== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" luxon "^1.24.1" -"@abp/malihu-custom-scrollbar-plugin@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0-rc.2.tgz#28fc1f216c1d84b20acaf8c8c5cf5c3b33e1aeb1" - integrity sha512-LYMXKkPVyBLWV4Qnom2MW8JJ/rZmVg1CyOFxM6JiL+dpsN1Ogw0hRG33CCHQveqUmf2cr3vf96qk5Et5DyDDIg== +"@abp/malihu-custom-scrollbar-plugin@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0.tgz#a6ce99cf29c36985b3268fa6309aad38438d7d2d" + integrity sha512-swip33gDRAWGIdyJmD+SrNBv2uyq6PJwG9RKnpFLaUiqbU8NhtnTl+bGCkO2BTTjBrP6dOPe7bmu3B8EO/zrMQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/markdown-it@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/markdown-it/-/markdown-it-4.3.0-rc.2.tgz#4f1d039812e7efc8032b8542cd9d48dad136bf0d" - integrity sha512-fTMj0FFjMZcBevFWWrfnyxV5XZZYrD5Guq+cICMBYtKVqfbsy/ILpnznApXMuLxNukqIvGa8I3SdWaWO6CVhgQ== +"@abp/markdown-it@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/markdown-it/-/markdown-it-4.3.0.tgz#a75074d3f17e8dc049f77e95cdd7f22ef04b6f50" + integrity sha512-7Un4z98gZewp/ZuX4QXHFW6Wnid0sXKGl2HUHEOxGlqo4BuNWgGGVv0jG0JQ4+3jPY6A9YpUMck5eox2TrZWvQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" markdown-it "^11.0.0" -"@abp/owl.carousel@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/owl.carousel/-/owl.carousel-4.3.0-rc.2.tgz#e13a568575a3d1c0b1f9c03c215792dd5320fb2a" - integrity sha512-pu87oxJjU0wA7bcxeTd0XUPYBqXV/0/9br79nhqeK4Qz8tsI1mC4mF4LW1GmTgNDKNrNydAEAenErFzG0GOwvA== +"@abp/owl.carousel@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/owl.carousel/-/owl.carousel-4.3.0.tgz#826da153b30c2ad2588128fd0f75dd0f3f75f55a" + integrity sha512-s2c2e6y+LkkY6Y93LqLgKuUMhTez699vJboS+BFuH1D0Olnlw+b6dCWjO7jiBTWJZcuA//HiQR67vQ0HbufmHA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" owl.carousel "^2.3.4" -"@abp/prismjs@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/prismjs/-/prismjs-4.3.0-rc.2.tgz#ecb98291898ba0c2fd4317be022d1a3e281c8bea" - integrity sha512-LA2pmTDhB3NwM4hEkZSW1xBXsixIXY2FVnEHS7ATkyRr36W/Gqb5fchv0ILBD7Gce40pAiPO2dMs4SUWT8qk0Q== +"@abp/prismjs@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/prismjs/-/prismjs-4.3.0.tgz#b970bdbe5a799dad62c91dab2232e0f68c0bc1fa" + integrity sha512-/WCbvEXxbwA/PrgakaJQz+i/7BfTuvAN6ncHmRv25KtqZrGEtlEcbbrBTyZ3/FjGWiT0RZmFk9tP7bafs0y7sg== dependencies: - "@abp/clipboard" "~4.3.0-rc.2" - "@abp/core" "~4.3.0-rc.2" + "@abp/clipboard" "~4.3.0" + "@abp/core" "~4.3.0" prismjs "^1.20.0" -"@abp/select2@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0-rc.2.tgz#42d62daff9e50b1fe211a1560794625ba3f52107" - integrity sha512-okiIXmFaqx0uy/UMcpMKWKjrwop1JINyzN4FS5tafUpWhx6KcYYHudLWJvnPbsdsOeBQx91kw8jjERRJIqfEOA== +"@abp/select2@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0.tgz#0a63ab0f740f36644017024865a4f1f4038a7bc9" + integrity sha512-uRNdTTOx5US4bOWcSDrHJt3WgWT5mroxXWooPOBirqhPVx7gvqVYDoGhXpyyoE80Hs+a/ISW/vJUIp8gsOKwEw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" select2 "^4.0.13" -"@abp/sweetalert@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0-rc.2.tgz#dfb20dfca8449ed3c3f6599d99b51746019eb664" - integrity sha512-NRKOgT80JVQrwI1FRqpbCzALvnLAFKdPwKKNDgm0L7r/5DL0+JbkKCI1AIPl/yiM8MBrCaQqNms+9JES5mjiUQ== +"@abp/sweetalert@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0.tgz#080b1133b5b6a67593bf7ebda8e9f6042ac2f24e" + integrity sha512-hkWvmqPk0foRA44k+2VjVoyRwwaPQMBayyRocc66+XwwGU5xSwR4VosLd8xxXW8la69rhDvQdoECguXKnHPYRA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" sweetalert "^2.1.2" -"@abp/timeago@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0-rc.2.tgz#22943e219facd7fa0efddb63017198474b5cef89" - integrity sha512-TjKyuli+SpVjTgVJmraBpqJK112I+1DYHPJfso7QAH48Ra4gceGj9EVS0i/420YyLZyJSMtZOruxzYkyJeR/6w== +"@abp/timeago@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0.tgz#79a75895781248cf7e5035204d19de7f55cbf685" + integrity sha512-R219V16eRhp4BjcmNzHHK078LF/QHr219hG7dmVtRIooNt4J8nEGDj3C5Ll1S0NjO5sM/78PhC6gLD1FQGMkaQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" timeago "^1.6.7" -"@abp/toastr@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0-rc.2.tgz#143a344b00bbfaa858fe267fb6d627952bf7b3c0" - integrity sha512-cQV9UFWb9zarkb/CbrqkF9RXqn1Fc/TFKKM5mxpUEcYjx52NuM0d+KawdEMoN2y3y2U4ciY44kbTP2W1y+NlBg== +"@abp/toastr@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0.tgz#3e14e461bdaf5c43548b86799062bac150e9d1bc" + integrity sha512-9g1A4U3Svp4oesB5UGmfVGb8BmXZ9PPka3OWxYh0g9UNUvBsOqfxz1MH9Ho20Gz7wQ+dTce2XWPA6VbAMfwwvQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" toastr "^2.1.4" -"@abp/tui-editor@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/tui-editor/-/tui-editor-4.3.0-rc.2.tgz#4d4de602faa2f1093752aa148df3fa3f5523d918" - integrity sha512-NuuQTiqYue+gJosVNzVTdx1HvuyfjoTzk1ih1uo8hkUWxcDuaK7LK/p4ZId8q10ZPeek5rhi2W9LgEj3EHkMBw== +"@abp/tui-editor@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/tui-editor/-/tui-editor-4.3.0.tgz#352e6277293b805aebdb52879f9952c37180c7ed" + integrity sha512-wYaoWP3rsK3GqGDQnXi2LimGGzbgUdfOKjuRr3R/VrLw3ZRSzfRwav/lo7vL3G0d/kjqMzdVTvYaB1xEfidVJA== dependencies: - "@abp/codemirror" "~4.3.0-rc.2" - "@abp/highlight.js" "~4.3.0-rc.2" - "@abp/jquery" "~4.3.0-rc.2" - "@abp/markdown-it" "~4.3.0-rc.2" + "@abp/codemirror" "~4.3.0" + "@abp/highlight.js" "~4.3.0" + "@abp/jquery" "~4.3.0" + "@abp/markdown-it" "~4.3.0" tui-code-snippet "1.5.2" tui-editor "^1.4.10" -"@abp/utils@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0-rc.2.tgz#6d051f98772e5642c2e3bc2f68e73d6f24f4694c" - integrity sha512-9qYo8OMTxIUG+qQBWXEpkURS6FUrx+J5s3SwC/eerp46hYr72GQ8L38Wq566a+xiLCn7Duxt6oJ/BxhTfQQxdw== +"@abp/utils@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0.tgz#5fe44ae9a76ba8760bfd54dc6cfc64c96acc4b67" + integrity sha512-FFPSn/cL+b7/wYoRjvQLNJ3KrTiqng2gKPGf+jtMZer92fcVZtsF21ew/z+yxgj+9DRYtWbvn5iu9/ZPKL5hiw== dependencies: just-compare "^1.3.0" diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj index cf5354adb9..4db4a03862 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj @@ -16,5 +16,6 @@ + diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationModule.cs b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationModule.cs index 2de8b3af07..c9fcbbaf0a 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationModule.cs +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationModule.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Application; using Volo.Abp.AutoMapper; using Volo.Abp.Caching; using Volo.Abp.Modularity; @@ -12,7 +13,9 @@ namespace Volo.Blogging.Admin typeof(BloggingDomainModule), typeof(BloggingAdminApplicationContractsModule), typeof(AbpCachingModule), - typeof(AbpAutoMapperModule))] + typeof(AbpAutoMapperModule), + typeof(AbpDddApplicationModule) + )] public class BloggingAdminApplicationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml index 466c6b9578..10244260ca 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml @@ -9,7 +9,6 @@ Layout = null; } - diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo.Blogging.Application.Contracts.Shared.csproj b/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo.Blogging.Application.Contracts.Shared.csproj index 70f0218a37..83c53a8d5d 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo.Blogging.Application.Contracts.Shared.csproj +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo.Blogging.Application.Contracts.Shared.csproj @@ -12,7 +12,8 @@ - + + diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo/Blogging/BloggingApplicationContractsSharedModule.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo/Blogging/BloggingApplicationContractsSharedModule.cs index f90c504c0e..eedaa71603 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo/Blogging/BloggingApplicationContractsSharedModule.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts.Shared/Volo/Blogging/BloggingApplicationContractsSharedModule.cs @@ -1,10 +1,14 @@ using Volo.Abp.Application; +using Volo.Abp.Authorization; using Volo.Abp.Modularity; namespace Volo.Blogging { - [DependsOn(typeof(BloggingDomainSharedModule), - typeof(AbpDddApplicationModule))] + [DependsOn( + typeof(BloggingDomainSharedModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationAbstractionsModule) + )] public class BloggingApplicationContractsSharedModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj index 308a0b8c31..cde97b1091 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj +++ b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj @@ -17,6 +17,7 @@ + diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs index e33ab7f282..aee53fe9b0 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Application; using Volo.Abp.AutoMapper; using Volo.Abp.BlobStoring; using Volo.Abp.Caching; @@ -14,7 +15,9 @@ namespace Volo.Blogging typeof(BloggingApplicationContractsModule), typeof(AbpCachingModule), typeof(AbpAutoMapperModule), - typeof(AbpBlobStoringModule))] + typeof(AbpBlobStoringModule), + typeof(AbpDddApplicationModule) + )] public class BloggingApplicationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/nl.json b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/nl.json index a1c0b72de8..145d97e8f4 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/nl.json +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/nl.json @@ -2,16 +2,17 @@ "culture": "nl", "texts": { "Menu:Blogs": "Blogs", - "Menu:BlogManagement": "Blog Beheer", + "Menu:BlogManagement": "Blogbeheer", "Permission:Management": "Beheer", - "Permission:Edit": "Bewerk", - "Permission:Create": "Maak aan", - "Permission:Delete": "Verwijder", + "Permission:Edit": "Wijzigen", + "Permission:Create": "Toevoegen", + "Permission:Delete": "Verwijderen", "Permission:Blogging": "Blog", "Permission:Blogs": "Blogs", - "Permission:Posts": "Posts", + "Permission:Posts": "Berichten", "Permission:Tags": "Tags", - "Permission:Comments": "Kommentaar", + "Permission:Comments": "Opmerkingen", + "Permission:ClearCache": "Cache wissen", "Title": "Titel", "Delete": "Verwijder", "Reply": "Antwoord", @@ -30,17 +31,17 @@ "PopularTags": "Populaire tags", "WiewsWithCount": "{0} keer bekeken", "LastPosts": "Laatste berichten", - "LeaveComment": "Laat commentaar achter", + "LeaveComment": "Laat opmerking achter", "TagsInThisArticle": "Tags in dit artikel", "Posts": "Berichten", - "Edit": "Bewerk", + "Edit": "Wijzigen", "BLOG": "BLOG", - "CommentDeletionWarningMessage": "Reactie wordt verwijderd.", - "PostDeletionWarningMessage": "Berich wordt verwijderd.", + "CommentDeletionWarningMessage": "Opmerking wordt verwijderd.", + "PostDeletionWarningMessage": "Bericht wordt verwijderd.", "BlogDeletionWarningMessage": "Blog wordt verwijderd.", "AreYouSure": "Weet u het zeker?", - "CommentWithCount": "{0} reacties", - "Comment": "Reactie", + "CommentWithCount": "{0} opmerkingen", + "Comment": "Opmerking", "ShareOnTwitter": "Delen op Twitter", "CoverImage": "Omslagfoto", "CreateANewPost": "Maak een nieuw bericht", @@ -48,11 +49,13 @@ "WhatIsNew": "Wat is nieuw?", "Name": "Naam", "ShortName": "Korte naam", - "CreationTime": "Creatie tijd", + "CreationTime": "aanmaak tijd", "Description": "Beschrijving", "Blogs": "Blogs", "Tags": "Tags", "ShareOn": "Delen op", - "TitleLengthWarning": "Houd uw titel kleiner dan 60 tekens om SEO-vriendelijk te zijn!" + "TitleLengthWarning": "Houd uw titel kleiner dan 60 tekens om SEO-vriendelijk te zijn!", + "ClearCache": "Cache wissen", + "ClearCacheConfirmationMessage": "Weet u zeker dat u de cache wilt wissen?" } -} +} \ No newline at end of file diff --git a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/package.json b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/package.json index 391b299fdc..b3211cc509 100644 --- a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/package.json +++ b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/package.json @@ -3,6 +3,6 @@ "name": "client-simulation-web", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0-rc.2" + "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0" } } \ No newline at end of file diff --git a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/yarn.lock b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/yarn.lock index 25d1eb8717..06898bb093 100644 --- a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/yarn.lock +++ b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0-rc.2.tgz#4ebafbaade6610e3d405877a148d72d57569c3e3" - integrity sha512-Q3QqxKDFC04gaaj30Rk+9zGNfNxC8FX0jciARATceFV6pdA3F3PgT5EMDSlo6NoGniFVjHPRgay9N09zT6Htyw== - dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0-rc.2.tgz#d3bf79929c55c5380d7ca7b913a23031d7a6bd12" - integrity sha512-pz86bIV4wNeG7/UPYzNCXlJ/MdOdIygc+Com7C9Ld7gzsyER7VD9h5U/hkytvL4FBFLJn4DU+xuZNECjv0HS0A== - dependencies: - "@abp/aspnetcore.mvc.ui" "~4.3.0-rc.2" - "@abp/bootstrap" "~4.3.0-rc.2" - "@abp/bootstrap-datepicker" "~4.3.0-rc.2" - "@abp/datatables.net-bs4" "~4.3.0-rc.2" - "@abp/font-awesome" "~4.3.0-rc.2" - "@abp/jquery-form" "~4.3.0-rc.2" - "@abp/jquery-validation-unobtrusive" "~4.3.0-rc.2" - "@abp/lodash" "~4.3.0-rc.2" - "@abp/luxon" "~4.3.0-rc.2" - "@abp/malihu-custom-scrollbar-plugin" "~4.3.0-rc.2" - "@abp/select2" "~4.3.0-rc.2" - "@abp/sweetalert" "~4.3.0-rc.2" - "@abp/timeago" "~4.3.0-rc.2" - "@abp/toastr" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0-rc.2.tgz#6ff41be179c8d1089778a51ffa54a1f3d7614278" - integrity sha512-2L5zvuqUwPwNPcMauiiJZD1ft0QycqINz+bXEQ8t0EwbB+dzcsukL/rpOQfpeRHWWYy4nIN4C2bTvXhNgQbPqQ== +"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0.tgz#33d6f72b698e5b8f399fb648817ed1fce070d482" + integrity sha512-jZNRm+R207KGs+0KvbLSGjvjm0i7y6ktHqH0tJ5nJ51B4xwOSxC64xmZXMQyazyqeGTKxpWVzIhqiFPb+q41Vg== + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0" + +"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0.tgz#6150c87f848e3cee36c217b01304b76aaa7991bb" + integrity sha512-urL7zQZu3jceXoSDBHQpzP/uhFYGZtreW22ohVINw2QTonCCd/ojRIVOZvf+GtMSRBqeecBqtdOjr9aoah+z9Q== + dependencies: + "@abp/aspnetcore.mvc.ui" "~4.3.0" + "@abp/bootstrap" "~4.3.0" + "@abp/bootstrap-datepicker" "~4.3.0" + "@abp/datatables.net-bs4" "~4.3.0" + "@abp/font-awesome" "~4.3.0" + "@abp/jquery-form" "~4.3.0" + "@abp/jquery-validation-unobtrusive" "~4.3.0" + "@abp/lodash" "~4.3.0" + "@abp/luxon" "~4.3.0" + "@abp/malihu-custom-scrollbar-plugin" "~4.3.0" + "@abp/select2" "~4.3.0" + "@abp/sweetalert" "~4.3.0" + "@abp/timeago" "~4.3.0" + "@abp/toastr" "~4.3.0" + +"@abp/aspnetcore.mvc.ui@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0.tgz#0098e528a929eb87da5c661cf3edf062bf2cb8c7" + integrity sha512-k0cXjDk33wDhr0tqjCG7UYJU5y2UJW+uCAp5cQTFqK9HqeYW1huGfRydECh3m8jqPGRmZRx4aJGQo6Te92bjcw== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -43,145 +43,145 @@ micromatch "^4.0.2" path "^0.12.7" -"@abp/bootstrap-datepicker@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0-rc.2.tgz#29a686c3d2bce356967f646d7334cd83c4257b4c" - integrity sha512-3+B7SJRi7DQJe0aNgv0H0zu1BfvMZcwgt06N3ALR9+o3TSJcOqcYrEMed3aG+ASH++CltnohTYnLkVXaxshioA== +"@abp/bootstrap-datepicker@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0.tgz#a4246b06d41ad39bf8a84b310227b0b44c2ca4f4" + integrity sha512-f/M7rpr87BPyk47RDUobWBbkMUwRlY+riRnWaoHkSAOwwSMBkkXsAxyEAkbRlIiYFBfNkrVl1OpTOliinhvWjQ== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0-rc.2.tgz#1416fe639c88b7d958435e45fe19692268a7f932" - integrity sha512-E6svmDhNQlT5nd65VgshexyedRWhbvi9o1oYo/dLTUpJDzR7M9ptDqxFLVB9vVDva3HgxUoEvgRJgb9fXvq4zw== +"@abp/bootstrap@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0.tgz#9dc88066bbb19ee50eb27460ab06f1593fae76cd" + integrity sha512-tV/K6nNl7Rt4BEQFlbPUtXMSTC+Usc1ArP6JMNL++1xOOT2Kyye172WEWnTcT7RRnveq7kid090Dxk9g3IyprA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" bootstrap "^4.6.0" bootstrap-v4-rtl "4.6.0-1" -"@abp/core@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0-rc.2.tgz#3c9ea339624ae3b6cbee13e048268d48269ea6a9" - integrity sha512-/89xH+IVSmTOLWeUO4yVB7Hg64uHTbR7bHjgl+b94cFdtITH9Nvr2EGdXUJbHGUK7L6lSDziqiMcG/ic0061+Q== +"@abp/core@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0.tgz#77945a62daae70b5f9f348036ab7c5a308d95a94" + integrity sha512-k+6BemPsencQasN+8W9sVYXdSOjea61ng2MIaPVTuCCjLWnReg4pQQ4QoJWsja+W36C8bratzT5ePwP6ZrCnMg== dependencies: - "@abp/utils" "^4.3.0-rc.2" + "@abp/utils" "^4.3.0" -"@abp/datatables.net-bs4@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0-rc.2.tgz#bbfc0d9d0ed86cdb14b38849fb78b2b1911c4a35" - integrity sha512-PRKYi2NU41KpckJ/d0buHoFbyKVuW5NCQNpUdYzDsPS2riyeXccCsLFJM1bT01TdR4Idla3vx9Fkb+HoJOiDeQ== +"@abp/datatables.net-bs4@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0.tgz#49470ef1f1a7b57cb9cfd1b47095d2e865ce74ce" + integrity sha512-tJ49688P8hjlxKYxqP2a6PUYrYX7qhm8jIc6MZrKWQyZbRbAwF0glUYa7MO73Us9Z3HRyPczedGQ3qK9pCu0Mg== dependencies: - "@abp/datatables.net" "~4.3.0-rc.2" + "@abp/datatables.net" "~4.3.0" datatables.net-bs4 "^1.10.21" -"@abp/datatables.net@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0-rc.2.tgz#1923e60db261366a7d2f284b0274d13e253567ca" - integrity sha512-rp53+5Xj1jhjpCj7UBA9+nSNbaTQ4Vc1NWCg1e5aI5tWiyZprUS44dRszIQIDV86XKorfFhog5ihOZyzl1HDyg== +"@abp/datatables.net@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0.tgz#fa5f01eb32b60176f5bef669abd898c0778ebb2c" + integrity sha512-ZRDIeAMc9buIGuMSO8WkMm16qYS8xYljj6NxDpGTdqP/+BOnhtw3/fbH1LOLj+If38rP+Q6ANbnZp7MXzqNlig== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" datatables.net "^1.10.21" -"@abp/font-awesome@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0-rc.2.tgz#437d3d6bbd8f52e5091251932d6a494d0164694b" - integrity sha512-FeHHtEQwrJBwD5PkFYqjKouCLwNjjRqTNseaN+s/r7gNjv0PgKytfRoqEb+O/BkZg/DwEuMz9jFX/RXCCNa2xA== +"@abp/font-awesome@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0.tgz#4a372ed9294df32d477a3b08aa080b39d9b44d6a" + integrity sha512-Ny9bFIN9EZGWU2DGQeURlJmH9iYo9N7GYBluNFunmftN+K2G+2739otg06qGoLmoxF8hGzyYvKmwhykjxY9pYw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" "@fortawesome/fontawesome-free" "^5.13.0" -"@abp/jquery-form@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0-rc.2.tgz#999910deaf46330477b6ed487a771a2123d69f92" - integrity sha512-+fdEIOTlxDOdYXMtc/ujhYeuP2qiI4bmL3TQQWQxSTlW8q5jB6dHLBnHiXXltO8HxX9+7ZsjN3tsV7+Div5joA== +"@abp/jquery-form@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0.tgz#98b9937bb258abbe306f03d5ac4e0b2b60022c4d" + integrity sha512-f4IPJnSA5v2DBEmf/XAqCqsZJR9AKzOsCCBH3GEct1VzJd4GYr9CL4qMc5jDjfCZ4PWN4SgqBd3mHQRB+yo0pA== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-form "^4.3.0" -"@abp/jquery-validation-unobtrusive@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0-rc.2.tgz#0635e0c77da269e8367c3d7c388613249ce9221d" - integrity sha512-ubmPjVJatAW3AJWjWtT+ZbNLhu+HHNgcxYkFGVNusNuboTGsoBs5G45Cjzp/q5FnggWoPvkllpf8CGuaYUbpUQ== +"@abp/jquery-validation-unobtrusive@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0.tgz#e6dc6cc94780c7db9b556f2f991d2d992dbfee38" + integrity sha512-AmvI9kOJQ9f+fTwqDMvODMSvkMgMN3XvBF0v/EbZpF86tMtQTWfCHf+gofmq9WjM96QJjhCjLRl0hirQfSBfbg== dependencies: - "@abp/jquery-validation" "~4.3.0-rc.2" + "@abp/jquery-validation" "~4.3.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0-rc.2.tgz#ee145f8c4a633218ccfa50cca0bed503a0ca8dc6" - integrity sha512-SLWzN6jxVqKaHYs/d6Mku8CfhB1vWgfMbFma14upiJ+/VDkTF4Rh27iMCWKYVOS3bukh2ltBp6kPFplrjCAGSg== +"@abp/jquery-validation@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0.tgz#89a8bc2196dfabed57ef6a754c9da4b77b0cc44f" + integrity sha512-gwvRR6117JJTRGEk1zxdR0toVsfRLekaW/YDw4DsE3iwdhBTS05DyoEpl+4kUflWrjmRSKsVhWeoyndCDMi8Qw== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-validation "^1.19.2" -"@abp/jquery@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0-rc.2.tgz#f620628ea0739888cbcb360c058d09bff10d553b" - integrity sha512-+rfyLVJn7E8wJ1oQ9GiCR63Yk6wah1Hqnj4XpsRDMkIaOXKaqrnVHAZd4W2DUunQSe95wqHfkNH/wkvTyNEwUg== +"@abp/jquery@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0.tgz#8c6dab7b0a657a7d89faee18157d6111c55d3df3" + integrity sha512-+3SCUjQjT6WQ9pYJCu3PUhgCrFPgTOD3Q/cTNbzTL5a6J3bpp+U26L5qwFhoQ0j+FH+VNAZGDsL/UtT9/Lwa1A== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" jquery "~3.5.1" -"@abp/lodash@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0-rc.2.tgz#9b5429d3976b34022aaf8cab4afef57479b66821" - integrity sha512-sE2dyofYbiIy4xhL85diZWkfqBcQl1q61T0DbYDOHgaejZAJxk4bVyFpEuMiC2HwWAZ656IN1bzyQIyE1RKzQA== +"@abp/lodash@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0.tgz#44c194c07031e162d7d8f90d7225ef4b3834c068" + integrity sha512-p+wG99Ze0+Kqee588mFkYGYbyVtdWk49eVujjHA1KdPXNC+rEco0pH1943pbSqni5VzJCIkY9PvG40If5CZykQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" lodash "^4.17.15" -"@abp/luxon@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0-rc.2.tgz#6fdbf1624462615dcb1f5ce85c07fc3bc4065e3f" - integrity sha512-C4aT0aN3/TVtTE3m0AZyhFSeeg+RxXpUO+nffAZoM/cH5NL8tir+O1hd+dhtCb7AELaqQNx5+qgXoJLYdWMYVg== +"@abp/luxon@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0.tgz#930ed60b19c2ad1e86e817fe10861f042b2eb08a" + integrity sha512-gusXqRmHMOqmlHRe4N9CQL4Ncr3qazwWvi8QUdEity4a2mofgVPvn7F/E7uBVFjRL1EBp+nAUfohBPwQJECy5w== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" luxon "^1.24.1" -"@abp/malihu-custom-scrollbar-plugin@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0-rc.2.tgz#28fc1f216c1d84b20acaf8c8c5cf5c3b33e1aeb1" - integrity sha512-LYMXKkPVyBLWV4Qnom2MW8JJ/rZmVg1CyOFxM6JiL+dpsN1Ogw0hRG33CCHQveqUmf2cr3vf96qk5Et5DyDDIg== +"@abp/malihu-custom-scrollbar-plugin@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0.tgz#a6ce99cf29c36985b3268fa6309aad38438d7d2d" + integrity sha512-swip33gDRAWGIdyJmD+SrNBv2uyq6PJwG9RKnpFLaUiqbU8NhtnTl+bGCkO2BTTjBrP6dOPe7bmu3B8EO/zrMQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0-rc.2.tgz#42d62daff9e50b1fe211a1560794625ba3f52107" - integrity sha512-okiIXmFaqx0uy/UMcpMKWKjrwop1JINyzN4FS5tafUpWhx6KcYYHudLWJvnPbsdsOeBQx91kw8jjERRJIqfEOA== +"@abp/select2@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0.tgz#0a63ab0f740f36644017024865a4f1f4038a7bc9" + integrity sha512-uRNdTTOx5US4bOWcSDrHJt3WgWT5mroxXWooPOBirqhPVx7gvqVYDoGhXpyyoE80Hs+a/ISW/vJUIp8gsOKwEw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" select2 "^4.0.13" -"@abp/sweetalert@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0-rc.2.tgz#dfb20dfca8449ed3c3f6599d99b51746019eb664" - integrity sha512-NRKOgT80JVQrwI1FRqpbCzALvnLAFKdPwKKNDgm0L7r/5DL0+JbkKCI1AIPl/yiM8MBrCaQqNms+9JES5mjiUQ== +"@abp/sweetalert@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0.tgz#080b1133b5b6a67593bf7ebda8e9f6042ac2f24e" + integrity sha512-hkWvmqPk0foRA44k+2VjVoyRwwaPQMBayyRocc66+XwwGU5xSwR4VosLd8xxXW8la69rhDvQdoECguXKnHPYRA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" sweetalert "^2.1.2" -"@abp/timeago@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0-rc.2.tgz#22943e219facd7fa0efddb63017198474b5cef89" - integrity sha512-TjKyuli+SpVjTgVJmraBpqJK112I+1DYHPJfso7QAH48Ra4gceGj9EVS0i/420YyLZyJSMtZOruxzYkyJeR/6w== +"@abp/timeago@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0.tgz#79a75895781248cf7e5035204d19de7f55cbf685" + integrity sha512-R219V16eRhp4BjcmNzHHK078LF/QHr219hG7dmVtRIooNt4J8nEGDj3C5Ll1S0NjO5sM/78PhC6gLD1FQGMkaQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" timeago "^1.6.7" -"@abp/toastr@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0-rc.2.tgz#143a344b00bbfaa858fe267fb6d627952bf7b3c0" - integrity sha512-cQV9UFWb9zarkb/CbrqkF9RXqn1Fc/TFKKM5mxpUEcYjx52NuM0d+KawdEMoN2y3y2U4ciY44kbTP2W1y+NlBg== +"@abp/toastr@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0.tgz#3e14e461bdaf5c43548b86799062bac150e9d1bc" + integrity sha512-9g1A4U3Svp4oesB5UGmfVGb8BmXZ9PPka3OWxYh0g9UNUvBsOqfxz1MH9Ho20Gz7wQ+dTce2XWPA6VbAMfwwvQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" toastr "^2.1.4" -"@abp/utils@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0-rc.2.tgz#6d051f98772e5642c2e3bc2f68e73d6f24f4694c" - integrity sha512-9qYo8OMTxIUG+qQBWXEpkURS6FUrx+J5s3SwC/eerp46hYr72GQ8L38Wq566a+xiLCn7Duxt6oJ/BxhTfQQxdw== +"@abp/utils@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0.tgz#5fe44ae9a76ba8760bfd54dc6cfc64c96acc4b67" + integrity sha512-FFPSn/cL+b7/wYoRjvQLNJ3KrTiqng2gKPGf+jtMZer92fcVZtsF21ew/z+yxgj+9DRYtWbvn5iu9/ZPKL5hiw== dependencies: just-compare "^1.3.0" diff --git a/modules/cms-kit/angular/package.json b/modules/cms-kit/angular/package.json index 2dff40a63e..c44780b78d 100644 --- a/modules/cms-kit/angular/package.json +++ b/modules/cms-kit/angular/package.json @@ -15,11 +15,11 @@ }, "private": true, "dependencies": { - "@abp/ng.account": "~4.3.0-rc.2", - "@abp/ng.identity": "~4.3.0-rc.2", - "@abp/ng.setting-management": "~4.3.0-rc.2", - "@abp/ng.tenant-management": "~4.3.0-rc.2", - "@abp/ng.theme.basic": "~4.3.0-rc.2", + "@abp/ng.account": "~4.3.0", + "@abp/ng.identity": "~4.3.0", + "@abp/ng.setting-management": "~4.3.0", + "@abp/ng.tenant-management": "~4.3.0", + "@abp/ng.theme.basic": "~4.3.0", "@angular/animations": "~10.0.0", "@angular/common": "~10.0.0", "@angular/compiler": "~10.0.0", diff --git a/modules/cms-kit/angular/projects/cms-kit/package.json b/modules/cms-kit/angular/projects/cms-kit/package.json index f6d7c9fa47..17d5d19c06 100644 --- a/modules/cms-kit/angular/projects/cms-kit/package.json +++ b/modules/cms-kit/angular/projects/cms-kit/package.json @@ -4,8 +4,8 @@ "peerDependencies": { "@angular/common": "^9.1.11", "@angular/core": "^9.1.11", - "@abp/ng.core": ">=4.3.0-rc.2", - "@abp/ng.theme.shared": ">=4.3.0-rc.2" + "@abp/ng.core": ">=4.3.0", + "@abp/ng.theme.shared": ">=4.3.0" }, "dependencies": { "tslib": "^2.0.0" diff --git a/modules/cms-kit/host/Volo.CmsKit.IdentityServer/package.json b/modules/cms-kit/host/Volo.CmsKit.IdentityServer/package.json index 00e47b60e7..cc2622ff07 100644 --- a/modules/cms-kit/host/Volo.CmsKit.IdentityServer/package.json +++ b/modules/cms-kit/host/Volo.CmsKit.IdentityServer/package.json @@ -3,6 +3,6 @@ "name": "my-app-identityserver", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0-rc.2" + "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0" } } \ No newline at end of file diff --git a/modules/cms-kit/host/Volo.CmsKit.IdentityServer/yarn.lock b/modules/cms-kit/host/Volo.CmsKit.IdentityServer/yarn.lock index 429ce75f04..de8e1b4bce 100644 --- a/modules/cms-kit/host/Volo.CmsKit.IdentityServer/yarn.lock +++ b/modules/cms-kit/host/Volo.CmsKit.IdentityServer/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0-rc.2.tgz#4ebafbaade6610e3d405877a148d72d57569c3e3" - integrity sha512-Q3QqxKDFC04gaaj30Rk+9zGNfNxC8FX0jciARATceFV6pdA3F3PgT5EMDSlo6NoGniFVjHPRgay9N09zT6Htyw== - dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0-rc.2.tgz#d3bf79929c55c5380d7ca7b913a23031d7a6bd12" - integrity sha512-pz86bIV4wNeG7/UPYzNCXlJ/MdOdIygc+Com7C9Ld7gzsyER7VD9h5U/hkytvL4FBFLJn4DU+xuZNECjv0HS0A== - dependencies: - "@abp/aspnetcore.mvc.ui" "~4.3.0-rc.2" - "@abp/bootstrap" "~4.3.0-rc.2" - "@abp/bootstrap-datepicker" "~4.3.0-rc.2" - "@abp/datatables.net-bs4" "~4.3.0-rc.2" - "@abp/font-awesome" "~4.3.0-rc.2" - "@abp/jquery-form" "~4.3.0-rc.2" - "@abp/jquery-validation-unobtrusive" "~4.3.0-rc.2" - "@abp/lodash" "~4.3.0-rc.2" - "@abp/luxon" "~4.3.0-rc.2" - "@abp/malihu-custom-scrollbar-plugin" "~4.3.0-rc.2" - "@abp/select2" "~4.3.0-rc.2" - "@abp/sweetalert" "~4.3.0-rc.2" - "@abp/timeago" "~4.3.0-rc.2" - "@abp/toastr" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0-rc.2.tgz#6ff41be179c8d1089778a51ffa54a1f3d7614278" - integrity sha512-2L5zvuqUwPwNPcMauiiJZD1ft0QycqINz+bXEQ8t0EwbB+dzcsukL/rpOQfpeRHWWYy4nIN4C2bTvXhNgQbPqQ== +"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0.tgz#33d6f72b698e5b8f399fb648817ed1fce070d482" + integrity sha512-jZNRm+R207KGs+0KvbLSGjvjm0i7y6ktHqH0tJ5nJ51B4xwOSxC64xmZXMQyazyqeGTKxpWVzIhqiFPb+q41Vg== + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0" + +"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0.tgz#6150c87f848e3cee36c217b01304b76aaa7991bb" + integrity sha512-urL7zQZu3jceXoSDBHQpzP/uhFYGZtreW22ohVINw2QTonCCd/ojRIVOZvf+GtMSRBqeecBqtdOjr9aoah+z9Q== + dependencies: + "@abp/aspnetcore.mvc.ui" "~4.3.0" + "@abp/bootstrap" "~4.3.0" + "@abp/bootstrap-datepicker" "~4.3.0" + "@abp/datatables.net-bs4" "~4.3.0" + "@abp/font-awesome" "~4.3.0" + "@abp/jquery-form" "~4.3.0" + "@abp/jquery-validation-unobtrusive" "~4.3.0" + "@abp/lodash" "~4.3.0" + "@abp/luxon" "~4.3.0" + "@abp/malihu-custom-scrollbar-plugin" "~4.3.0" + "@abp/select2" "~4.3.0" + "@abp/sweetalert" "~4.3.0" + "@abp/timeago" "~4.3.0" + "@abp/toastr" "~4.3.0" + +"@abp/aspnetcore.mvc.ui@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0.tgz#0098e528a929eb87da5c661cf3edf062bf2cb8c7" + integrity sha512-k0cXjDk33wDhr0tqjCG7UYJU5y2UJW+uCAp5cQTFqK9HqeYW1huGfRydECh3m8jqPGRmZRx4aJGQo6Te92bjcw== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -43,145 +43,145 @@ micromatch "^4.0.2" path "^0.12.7" -"@abp/bootstrap-datepicker@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0-rc.2.tgz#29a686c3d2bce356967f646d7334cd83c4257b4c" - integrity sha512-3+B7SJRi7DQJe0aNgv0H0zu1BfvMZcwgt06N3ALR9+o3TSJcOqcYrEMed3aG+ASH++CltnohTYnLkVXaxshioA== +"@abp/bootstrap-datepicker@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0.tgz#a4246b06d41ad39bf8a84b310227b0b44c2ca4f4" + integrity sha512-f/M7rpr87BPyk47RDUobWBbkMUwRlY+riRnWaoHkSAOwwSMBkkXsAxyEAkbRlIiYFBfNkrVl1OpTOliinhvWjQ== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0-rc.2.tgz#1416fe639c88b7d958435e45fe19692268a7f932" - integrity sha512-E6svmDhNQlT5nd65VgshexyedRWhbvi9o1oYo/dLTUpJDzR7M9ptDqxFLVB9vVDva3HgxUoEvgRJgb9fXvq4zw== +"@abp/bootstrap@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0.tgz#9dc88066bbb19ee50eb27460ab06f1593fae76cd" + integrity sha512-tV/K6nNl7Rt4BEQFlbPUtXMSTC+Usc1ArP6JMNL++1xOOT2Kyye172WEWnTcT7RRnveq7kid090Dxk9g3IyprA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" bootstrap "^4.6.0" bootstrap-v4-rtl "4.6.0-1" -"@abp/core@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0-rc.2.tgz#3c9ea339624ae3b6cbee13e048268d48269ea6a9" - integrity sha512-/89xH+IVSmTOLWeUO4yVB7Hg64uHTbR7bHjgl+b94cFdtITH9Nvr2EGdXUJbHGUK7L6lSDziqiMcG/ic0061+Q== +"@abp/core@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0.tgz#77945a62daae70b5f9f348036ab7c5a308d95a94" + integrity sha512-k+6BemPsencQasN+8W9sVYXdSOjea61ng2MIaPVTuCCjLWnReg4pQQ4QoJWsja+W36C8bratzT5ePwP6ZrCnMg== dependencies: - "@abp/utils" "^4.3.0-rc.2" + "@abp/utils" "^4.3.0" -"@abp/datatables.net-bs4@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0-rc.2.tgz#bbfc0d9d0ed86cdb14b38849fb78b2b1911c4a35" - integrity sha512-PRKYi2NU41KpckJ/d0buHoFbyKVuW5NCQNpUdYzDsPS2riyeXccCsLFJM1bT01TdR4Idla3vx9Fkb+HoJOiDeQ== +"@abp/datatables.net-bs4@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0.tgz#49470ef1f1a7b57cb9cfd1b47095d2e865ce74ce" + integrity sha512-tJ49688P8hjlxKYxqP2a6PUYrYX7qhm8jIc6MZrKWQyZbRbAwF0glUYa7MO73Us9Z3HRyPczedGQ3qK9pCu0Mg== dependencies: - "@abp/datatables.net" "~4.3.0-rc.2" + "@abp/datatables.net" "~4.3.0" datatables.net-bs4 "^1.10.21" -"@abp/datatables.net@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0-rc.2.tgz#1923e60db261366a7d2f284b0274d13e253567ca" - integrity sha512-rp53+5Xj1jhjpCj7UBA9+nSNbaTQ4Vc1NWCg1e5aI5tWiyZprUS44dRszIQIDV86XKorfFhog5ihOZyzl1HDyg== +"@abp/datatables.net@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0.tgz#fa5f01eb32b60176f5bef669abd898c0778ebb2c" + integrity sha512-ZRDIeAMc9buIGuMSO8WkMm16qYS8xYljj6NxDpGTdqP/+BOnhtw3/fbH1LOLj+If38rP+Q6ANbnZp7MXzqNlig== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" datatables.net "^1.10.21" -"@abp/font-awesome@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0-rc.2.tgz#437d3d6bbd8f52e5091251932d6a494d0164694b" - integrity sha512-FeHHtEQwrJBwD5PkFYqjKouCLwNjjRqTNseaN+s/r7gNjv0PgKytfRoqEb+O/BkZg/DwEuMz9jFX/RXCCNa2xA== +"@abp/font-awesome@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0.tgz#4a372ed9294df32d477a3b08aa080b39d9b44d6a" + integrity sha512-Ny9bFIN9EZGWU2DGQeURlJmH9iYo9N7GYBluNFunmftN+K2G+2739otg06qGoLmoxF8hGzyYvKmwhykjxY9pYw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" "@fortawesome/fontawesome-free" "^5.13.0" -"@abp/jquery-form@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0-rc.2.tgz#999910deaf46330477b6ed487a771a2123d69f92" - integrity sha512-+fdEIOTlxDOdYXMtc/ujhYeuP2qiI4bmL3TQQWQxSTlW8q5jB6dHLBnHiXXltO8HxX9+7ZsjN3tsV7+Div5joA== +"@abp/jquery-form@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0.tgz#98b9937bb258abbe306f03d5ac4e0b2b60022c4d" + integrity sha512-f4IPJnSA5v2DBEmf/XAqCqsZJR9AKzOsCCBH3GEct1VzJd4GYr9CL4qMc5jDjfCZ4PWN4SgqBd3mHQRB+yo0pA== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-form "^4.3.0" -"@abp/jquery-validation-unobtrusive@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0-rc.2.tgz#0635e0c77da269e8367c3d7c388613249ce9221d" - integrity sha512-ubmPjVJatAW3AJWjWtT+ZbNLhu+HHNgcxYkFGVNusNuboTGsoBs5G45Cjzp/q5FnggWoPvkllpf8CGuaYUbpUQ== +"@abp/jquery-validation-unobtrusive@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0.tgz#e6dc6cc94780c7db9b556f2f991d2d992dbfee38" + integrity sha512-AmvI9kOJQ9f+fTwqDMvODMSvkMgMN3XvBF0v/EbZpF86tMtQTWfCHf+gofmq9WjM96QJjhCjLRl0hirQfSBfbg== dependencies: - "@abp/jquery-validation" "~4.3.0-rc.2" + "@abp/jquery-validation" "~4.3.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0-rc.2.tgz#ee145f8c4a633218ccfa50cca0bed503a0ca8dc6" - integrity sha512-SLWzN6jxVqKaHYs/d6Mku8CfhB1vWgfMbFma14upiJ+/VDkTF4Rh27iMCWKYVOS3bukh2ltBp6kPFplrjCAGSg== +"@abp/jquery-validation@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0.tgz#89a8bc2196dfabed57ef6a754c9da4b77b0cc44f" + integrity sha512-gwvRR6117JJTRGEk1zxdR0toVsfRLekaW/YDw4DsE3iwdhBTS05DyoEpl+4kUflWrjmRSKsVhWeoyndCDMi8Qw== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-validation "^1.19.2" -"@abp/jquery@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0-rc.2.tgz#f620628ea0739888cbcb360c058d09bff10d553b" - integrity sha512-+rfyLVJn7E8wJ1oQ9GiCR63Yk6wah1Hqnj4XpsRDMkIaOXKaqrnVHAZd4W2DUunQSe95wqHfkNH/wkvTyNEwUg== +"@abp/jquery@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0.tgz#8c6dab7b0a657a7d89faee18157d6111c55d3df3" + integrity sha512-+3SCUjQjT6WQ9pYJCu3PUhgCrFPgTOD3Q/cTNbzTL5a6J3bpp+U26L5qwFhoQ0j+FH+VNAZGDsL/UtT9/Lwa1A== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" jquery "~3.5.1" -"@abp/lodash@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0-rc.2.tgz#9b5429d3976b34022aaf8cab4afef57479b66821" - integrity sha512-sE2dyofYbiIy4xhL85diZWkfqBcQl1q61T0DbYDOHgaejZAJxk4bVyFpEuMiC2HwWAZ656IN1bzyQIyE1RKzQA== +"@abp/lodash@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0.tgz#44c194c07031e162d7d8f90d7225ef4b3834c068" + integrity sha512-p+wG99Ze0+Kqee588mFkYGYbyVtdWk49eVujjHA1KdPXNC+rEco0pH1943pbSqni5VzJCIkY9PvG40If5CZykQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" lodash "^4.17.15" -"@abp/luxon@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0-rc.2.tgz#6fdbf1624462615dcb1f5ce85c07fc3bc4065e3f" - integrity sha512-C4aT0aN3/TVtTE3m0AZyhFSeeg+RxXpUO+nffAZoM/cH5NL8tir+O1hd+dhtCb7AELaqQNx5+qgXoJLYdWMYVg== +"@abp/luxon@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0.tgz#930ed60b19c2ad1e86e817fe10861f042b2eb08a" + integrity sha512-gusXqRmHMOqmlHRe4N9CQL4Ncr3qazwWvi8QUdEity4a2mofgVPvn7F/E7uBVFjRL1EBp+nAUfohBPwQJECy5w== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" luxon "^1.24.1" -"@abp/malihu-custom-scrollbar-plugin@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0-rc.2.tgz#28fc1f216c1d84b20acaf8c8c5cf5c3b33e1aeb1" - integrity sha512-LYMXKkPVyBLWV4Qnom2MW8JJ/rZmVg1CyOFxM6JiL+dpsN1Ogw0hRG33CCHQveqUmf2cr3vf96qk5Et5DyDDIg== +"@abp/malihu-custom-scrollbar-plugin@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0.tgz#a6ce99cf29c36985b3268fa6309aad38438d7d2d" + integrity sha512-swip33gDRAWGIdyJmD+SrNBv2uyq6PJwG9RKnpFLaUiqbU8NhtnTl+bGCkO2BTTjBrP6dOPe7bmu3B8EO/zrMQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0-rc.2.tgz#42d62daff9e50b1fe211a1560794625ba3f52107" - integrity sha512-okiIXmFaqx0uy/UMcpMKWKjrwop1JINyzN4FS5tafUpWhx6KcYYHudLWJvnPbsdsOeBQx91kw8jjERRJIqfEOA== +"@abp/select2@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0.tgz#0a63ab0f740f36644017024865a4f1f4038a7bc9" + integrity sha512-uRNdTTOx5US4bOWcSDrHJt3WgWT5mroxXWooPOBirqhPVx7gvqVYDoGhXpyyoE80Hs+a/ISW/vJUIp8gsOKwEw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" select2 "^4.0.13" -"@abp/sweetalert@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0-rc.2.tgz#dfb20dfca8449ed3c3f6599d99b51746019eb664" - integrity sha512-NRKOgT80JVQrwI1FRqpbCzALvnLAFKdPwKKNDgm0L7r/5DL0+JbkKCI1AIPl/yiM8MBrCaQqNms+9JES5mjiUQ== +"@abp/sweetalert@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0.tgz#080b1133b5b6a67593bf7ebda8e9f6042ac2f24e" + integrity sha512-hkWvmqPk0foRA44k+2VjVoyRwwaPQMBayyRocc66+XwwGU5xSwR4VosLd8xxXW8la69rhDvQdoECguXKnHPYRA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" sweetalert "^2.1.2" -"@abp/timeago@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0-rc.2.tgz#22943e219facd7fa0efddb63017198474b5cef89" - integrity sha512-TjKyuli+SpVjTgVJmraBpqJK112I+1DYHPJfso7QAH48Ra4gceGj9EVS0i/420YyLZyJSMtZOruxzYkyJeR/6w== +"@abp/timeago@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0.tgz#79a75895781248cf7e5035204d19de7f55cbf685" + integrity sha512-R219V16eRhp4BjcmNzHHK078LF/QHr219hG7dmVtRIooNt4J8nEGDj3C5Ll1S0NjO5sM/78PhC6gLD1FQGMkaQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" timeago "^1.6.7" -"@abp/toastr@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0-rc.2.tgz#143a344b00bbfaa858fe267fb6d627952bf7b3c0" - integrity sha512-cQV9UFWb9zarkb/CbrqkF9RXqn1Fc/TFKKM5mxpUEcYjx52NuM0d+KawdEMoN2y3y2U4ciY44kbTP2W1y+NlBg== +"@abp/toastr@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0.tgz#3e14e461bdaf5c43548b86799062bac150e9d1bc" + integrity sha512-9g1A4U3Svp4oesB5UGmfVGb8BmXZ9PPka3OWxYh0g9UNUvBsOqfxz1MH9Ho20Gz7wQ+dTce2XWPA6VbAMfwwvQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" toastr "^2.1.4" -"@abp/utils@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0-rc.2.tgz#6d051f98772e5642c2e3bc2f68e73d6f24f4694c" - integrity sha512-9qYo8OMTxIUG+qQBWXEpkURS6FUrx+J5s3SwC/eerp46hYr72GQ8L38Wq566a+xiLCn7Duxt6oJ/BxhTfQQxdw== +"@abp/utils@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0.tgz#5fe44ae9a76ba8760bfd54dc6cfc64c96acc4b67" + integrity sha512-FFPSn/cL+b7/wYoRjvQLNJ3KrTiqng2gKPGf+jtMZer92fcVZtsF21ew/z+yxgj+9DRYtWbvn5iu9/ZPKL5hiw== dependencies: just-compare "^1.3.0" diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Host/package.json b/modules/cms-kit/host/Volo.CmsKit.Web.Host/package.json index 4bc77c8984..e25af764ed 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Host/package.json +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Host/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0-rc.2" + "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0" } } \ No newline at end of file diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Host/yarn.lock b/modules/cms-kit/host/Volo.CmsKit.Web.Host/yarn.lock index 75cec285e5..b01b56b683 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Host/yarn.lock +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Host/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0-rc.2.tgz#4ebafbaade6610e3d405877a148d72d57569c3e3" - integrity sha512-Q3QqxKDFC04gaaj30Rk+9zGNfNxC8FX0jciARATceFV6pdA3F3PgT5EMDSlo6NoGniFVjHPRgay9N09zT6Htyw== - dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0-rc.2.tgz#d3bf79929c55c5380d7ca7b913a23031d7a6bd12" - integrity sha512-pz86bIV4wNeG7/UPYzNCXlJ/MdOdIygc+Com7C9Ld7gzsyER7VD9h5U/hkytvL4FBFLJn4DU+xuZNECjv0HS0A== - dependencies: - "@abp/aspnetcore.mvc.ui" "~4.3.0-rc.2" - "@abp/bootstrap" "~4.3.0-rc.2" - "@abp/bootstrap-datepicker" "~4.3.0-rc.2" - "@abp/datatables.net-bs4" "~4.3.0-rc.2" - "@abp/font-awesome" "~4.3.0-rc.2" - "@abp/jquery-form" "~4.3.0-rc.2" - "@abp/jquery-validation-unobtrusive" "~4.3.0-rc.2" - "@abp/lodash" "~4.3.0-rc.2" - "@abp/luxon" "~4.3.0-rc.2" - "@abp/malihu-custom-scrollbar-plugin" "~4.3.0-rc.2" - "@abp/select2" "~4.3.0-rc.2" - "@abp/sweetalert" "~4.3.0-rc.2" - "@abp/timeago" "~4.3.0-rc.2" - "@abp/toastr" "~4.3.0-rc.2" - -"@abp/aspnetcore.mvc.ui@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0-rc.2.tgz#6ff41be179c8d1089778a51ffa54a1f3d7614278" - integrity sha512-2L5zvuqUwPwNPcMauiiJZD1ft0QycqINz+bXEQ8t0EwbB+dzcsukL/rpOQfpeRHWWYy4nIN4C2bTvXhNgQbPqQ== +"@abp/aspnetcore.mvc.ui.theme.basic@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-4.3.0.tgz#33d6f72b698e5b8f399fb648817ed1fce070d482" + integrity sha512-jZNRm+R207KGs+0KvbLSGjvjm0i7y6ktHqH0tJ5nJ51B4xwOSxC64xmZXMQyazyqeGTKxpWVzIhqiFPb+q41Vg== + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~4.3.0" + +"@abp/aspnetcore.mvc.ui.theme.shared@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-4.3.0.tgz#6150c87f848e3cee36c217b01304b76aaa7991bb" + integrity sha512-urL7zQZu3jceXoSDBHQpzP/uhFYGZtreW22ohVINw2QTonCCd/ojRIVOZvf+GtMSRBqeecBqtdOjr9aoah+z9Q== + dependencies: + "@abp/aspnetcore.mvc.ui" "~4.3.0" + "@abp/bootstrap" "~4.3.0" + "@abp/bootstrap-datepicker" "~4.3.0" + "@abp/datatables.net-bs4" "~4.3.0" + "@abp/font-awesome" "~4.3.0" + "@abp/jquery-form" "~4.3.0" + "@abp/jquery-validation-unobtrusive" "~4.3.0" + "@abp/lodash" "~4.3.0" + "@abp/luxon" "~4.3.0" + "@abp/malihu-custom-scrollbar-plugin" "~4.3.0" + "@abp/select2" "~4.3.0" + "@abp/sweetalert" "~4.3.0" + "@abp/timeago" "~4.3.0" + "@abp/toastr" "~4.3.0" + +"@abp/aspnetcore.mvc.ui@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-4.3.0.tgz#0098e528a929eb87da5c661cf3edf062bf2cb8c7" + integrity sha512-k0cXjDk33wDhr0tqjCG7UYJU5y2UJW+uCAp5cQTFqK9HqeYW1huGfRydECh3m8jqPGRmZRx4aJGQo6Te92bjcw== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -43,145 +43,145 @@ micromatch "^4.0.2" path "^0.12.7" -"@abp/bootstrap-datepicker@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0-rc.2.tgz#29a686c3d2bce356967f646d7334cd83c4257b4c" - integrity sha512-3+B7SJRi7DQJe0aNgv0H0zu1BfvMZcwgt06N3ALR9+o3TSJcOqcYrEMed3aG+ASH++CltnohTYnLkVXaxshioA== +"@abp/bootstrap-datepicker@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-4.3.0.tgz#a4246b06d41ad39bf8a84b310227b0b44c2ca4f4" + integrity sha512-f/M7rpr87BPyk47RDUobWBbkMUwRlY+riRnWaoHkSAOwwSMBkkXsAxyEAkbRlIiYFBfNkrVl1OpTOliinhvWjQ== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0-rc.2.tgz#1416fe639c88b7d958435e45fe19692268a7f932" - integrity sha512-E6svmDhNQlT5nd65VgshexyedRWhbvi9o1oYo/dLTUpJDzR7M9ptDqxFLVB9vVDva3HgxUoEvgRJgb9fXvq4zw== +"@abp/bootstrap@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-4.3.0.tgz#9dc88066bbb19ee50eb27460ab06f1593fae76cd" + integrity sha512-tV/K6nNl7Rt4BEQFlbPUtXMSTC+Usc1ArP6JMNL++1xOOT2Kyye172WEWnTcT7RRnveq7kid090Dxk9g3IyprA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" bootstrap "^4.6.0" bootstrap-v4-rtl "4.6.0-1" -"@abp/core@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0-rc.2.tgz#3c9ea339624ae3b6cbee13e048268d48269ea6a9" - integrity sha512-/89xH+IVSmTOLWeUO4yVB7Hg64uHTbR7bHjgl+b94cFdtITH9Nvr2EGdXUJbHGUK7L6lSDziqiMcG/ic0061+Q== +"@abp/core@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-4.3.0.tgz#77945a62daae70b5f9f348036ab7c5a308d95a94" + integrity sha512-k+6BemPsencQasN+8W9sVYXdSOjea61ng2MIaPVTuCCjLWnReg4pQQ4QoJWsja+W36C8bratzT5ePwP6ZrCnMg== dependencies: - "@abp/utils" "^4.3.0-rc.2" + "@abp/utils" "^4.3.0" -"@abp/datatables.net-bs4@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0-rc.2.tgz#bbfc0d9d0ed86cdb14b38849fb78b2b1911c4a35" - integrity sha512-PRKYi2NU41KpckJ/d0buHoFbyKVuW5NCQNpUdYzDsPS2riyeXccCsLFJM1bT01TdR4Idla3vx9Fkb+HoJOiDeQ== +"@abp/datatables.net-bs4@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-4.3.0.tgz#49470ef1f1a7b57cb9cfd1b47095d2e865ce74ce" + integrity sha512-tJ49688P8hjlxKYxqP2a6PUYrYX7qhm8jIc6MZrKWQyZbRbAwF0glUYa7MO73Us9Z3HRyPczedGQ3qK9pCu0Mg== dependencies: - "@abp/datatables.net" "~4.3.0-rc.2" + "@abp/datatables.net" "~4.3.0" datatables.net-bs4 "^1.10.21" -"@abp/datatables.net@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0-rc.2.tgz#1923e60db261366a7d2f284b0274d13e253567ca" - integrity sha512-rp53+5Xj1jhjpCj7UBA9+nSNbaTQ4Vc1NWCg1e5aI5tWiyZprUS44dRszIQIDV86XKorfFhog5ihOZyzl1HDyg== +"@abp/datatables.net@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-4.3.0.tgz#fa5f01eb32b60176f5bef669abd898c0778ebb2c" + integrity sha512-ZRDIeAMc9buIGuMSO8WkMm16qYS8xYljj6NxDpGTdqP/+BOnhtw3/fbH1LOLj+If38rP+Q6ANbnZp7MXzqNlig== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" datatables.net "^1.10.21" -"@abp/font-awesome@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0-rc.2.tgz#437d3d6bbd8f52e5091251932d6a494d0164694b" - integrity sha512-FeHHtEQwrJBwD5PkFYqjKouCLwNjjRqTNseaN+s/r7gNjv0PgKytfRoqEb+O/BkZg/DwEuMz9jFX/RXCCNa2xA== +"@abp/font-awesome@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-4.3.0.tgz#4a372ed9294df32d477a3b08aa080b39d9b44d6a" + integrity sha512-Ny9bFIN9EZGWU2DGQeURlJmH9iYo9N7GYBluNFunmftN+K2G+2739otg06qGoLmoxF8hGzyYvKmwhykjxY9pYw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" "@fortawesome/fontawesome-free" "^5.13.0" -"@abp/jquery-form@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0-rc.2.tgz#999910deaf46330477b6ed487a771a2123d69f92" - integrity sha512-+fdEIOTlxDOdYXMtc/ujhYeuP2qiI4bmL3TQQWQxSTlW8q5jB6dHLBnHiXXltO8HxX9+7ZsjN3tsV7+Div5joA== +"@abp/jquery-form@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-4.3.0.tgz#98b9937bb258abbe306f03d5ac4e0b2b60022c4d" + integrity sha512-f4IPJnSA5v2DBEmf/XAqCqsZJR9AKzOsCCBH3GEct1VzJd4GYr9CL4qMc5jDjfCZ4PWN4SgqBd3mHQRB+yo0pA== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-form "^4.3.0" -"@abp/jquery-validation-unobtrusive@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0-rc.2.tgz#0635e0c77da269e8367c3d7c388613249ce9221d" - integrity sha512-ubmPjVJatAW3AJWjWtT+ZbNLhu+HHNgcxYkFGVNusNuboTGsoBs5G45Cjzp/q5FnggWoPvkllpf8CGuaYUbpUQ== +"@abp/jquery-validation-unobtrusive@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.3.0.tgz#e6dc6cc94780c7db9b556f2f991d2d992dbfee38" + integrity sha512-AmvI9kOJQ9f+fTwqDMvODMSvkMgMN3XvBF0v/EbZpF86tMtQTWfCHf+gofmq9WjM96QJjhCjLRl0hirQfSBfbg== dependencies: - "@abp/jquery-validation" "~4.3.0-rc.2" + "@abp/jquery-validation" "~4.3.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0-rc.2.tgz#ee145f8c4a633218ccfa50cca0bed503a0ca8dc6" - integrity sha512-SLWzN6jxVqKaHYs/d6Mku8CfhB1vWgfMbFma14upiJ+/VDkTF4Rh27iMCWKYVOS3bukh2ltBp6kPFplrjCAGSg== +"@abp/jquery-validation@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-4.3.0.tgz#89a8bc2196dfabed57ef6a754c9da4b77b0cc44f" + integrity sha512-gwvRR6117JJTRGEk1zxdR0toVsfRLekaW/YDw4DsE3iwdhBTS05DyoEpl+4kUflWrjmRSKsVhWeoyndCDMi8Qw== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" jquery-validation "^1.19.2" -"@abp/jquery@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0-rc.2.tgz#f620628ea0739888cbcb360c058d09bff10d553b" - integrity sha512-+rfyLVJn7E8wJ1oQ9GiCR63Yk6wah1Hqnj4XpsRDMkIaOXKaqrnVHAZd4W2DUunQSe95wqHfkNH/wkvTyNEwUg== +"@abp/jquery@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-4.3.0.tgz#8c6dab7b0a657a7d89faee18157d6111c55d3df3" + integrity sha512-+3SCUjQjT6WQ9pYJCu3PUhgCrFPgTOD3Q/cTNbzTL5a6J3bpp+U26L5qwFhoQ0j+FH+VNAZGDsL/UtT9/Lwa1A== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" jquery "~3.5.1" -"@abp/lodash@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0-rc.2.tgz#9b5429d3976b34022aaf8cab4afef57479b66821" - integrity sha512-sE2dyofYbiIy4xhL85diZWkfqBcQl1q61T0DbYDOHgaejZAJxk4bVyFpEuMiC2HwWAZ656IN1bzyQIyE1RKzQA== +"@abp/lodash@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-4.3.0.tgz#44c194c07031e162d7d8f90d7225ef4b3834c068" + integrity sha512-p+wG99Ze0+Kqee588mFkYGYbyVtdWk49eVujjHA1KdPXNC+rEco0pH1943pbSqni5VzJCIkY9PvG40If5CZykQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" lodash "^4.17.15" -"@abp/luxon@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0-rc.2.tgz#6fdbf1624462615dcb1f5ce85c07fc3bc4065e3f" - integrity sha512-C4aT0aN3/TVtTE3m0AZyhFSeeg+RxXpUO+nffAZoM/cH5NL8tir+O1hd+dhtCb7AELaqQNx5+qgXoJLYdWMYVg== +"@abp/luxon@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-4.3.0.tgz#930ed60b19c2ad1e86e817fe10861f042b2eb08a" + integrity sha512-gusXqRmHMOqmlHRe4N9CQL4Ncr3qazwWvi8QUdEity4a2mofgVPvn7F/E7uBVFjRL1EBp+nAUfohBPwQJECy5w== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" luxon "^1.24.1" -"@abp/malihu-custom-scrollbar-plugin@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0-rc.2.tgz#28fc1f216c1d84b20acaf8c8c5cf5c3b33e1aeb1" - integrity sha512-LYMXKkPVyBLWV4Qnom2MW8JJ/rZmVg1CyOFxM6JiL+dpsN1Ogw0hRG33CCHQveqUmf2cr3vf96qk5Et5DyDDIg== +"@abp/malihu-custom-scrollbar-plugin@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-4.3.0.tgz#a6ce99cf29c36985b3268fa6309aad38438d7d2d" + integrity sha512-swip33gDRAWGIdyJmD+SrNBv2uyq6PJwG9RKnpFLaUiqbU8NhtnTl+bGCkO2BTTjBrP6dOPe7bmu3B8EO/zrMQ== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0-rc.2.tgz#42d62daff9e50b1fe211a1560794625ba3f52107" - integrity sha512-okiIXmFaqx0uy/UMcpMKWKjrwop1JINyzN4FS5tafUpWhx6KcYYHudLWJvnPbsdsOeBQx91kw8jjERRJIqfEOA== +"@abp/select2@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-4.3.0.tgz#0a63ab0f740f36644017024865a4f1f4038a7bc9" + integrity sha512-uRNdTTOx5US4bOWcSDrHJt3WgWT5mroxXWooPOBirqhPVx7gvqVYDoGhXpyyoE80Hs+a/ISW/vJUIp8gsOKwEw== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" select2 "^4.0.13" -"@abp/sweetalert@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0-rc.2.tgz#dfb20dfca8449ed3c3f6599d99b51746019eb664" - integrity sha512-NRKOgT80JVQrwI1FRqpbCzALvnLAFKdPwKKNDgm0L7r/5DL0+JbkKCI1AIPl/yiM8MBrCaQqNms+9JES5mjiUQ== +"@abp/sweetalert@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-4.3.0.tgz#080b1133b5b6a67593bf7ebda8e9f6042ac2f24e" + integrity sha512-hkWvmqPk0foRA44k+2VjVoyRwwaPQMBayyRocc66+XwwGU5xSwR4VosLd8xxXW8la69rhDvQdoECguXKnHPYRA== dependencies: - "@abp/core" "~4.3.0-rc.2" + "@abp/core" "~4.3.0" sweetalert "^2.1.2" -"@abp/timeago@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0-rc.2.tgz#22943e219facd7fa0efddb63017198474b5cef89" - integrity sha512-TjKyuli+SpVjTgVJmraBpqJK112I+1DYHPJfso7QAH48Ra4gceGj9EVS0i/420YyLZyJSMtZOruxzYkyJeR/6w== +"@abp/timeago@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-4.3.0.tgz#79a75895781248cf7e5035204d19de7f55cbf685" + integrity sha512-R219V16eRhp4BjcmNzHHK078LF/QHr219hG7dmVtRIooNt4J8nEGDj3C5Ll1S0NjO5sM/78PhC6gLD1FQGMkaQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" timeago "^1.6.7" -"@abp/toastr@~4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0-rc.2.tgz#143a344b00bbfaa858fe267fb6d627952bf7b3c0" - integrity sha512-cQV9UFWb9zarkb/CbrqkF9RXqn1Fc/TFKKM5mxpUEcYjx52NuM0d+KawdEMoN2y3y2U4ciY44kbTP2W1y+NlBg== +"@abp/toastr@~4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-4.3.0.tgz#3e14e461bdaf5c43548b86799062bac150e9d1bc" + integrity sha512-9g1A4U3Svp4oesB5UGmfVGb8BmXZ9PPka3OWxYh0g9UNUvBsOqfxz1MH9Ho20Gz7wQ+dTce2XWPA6VbAMfwwvQ== dependencies: - "@abp/jquery" "~4.3.0-rc.2" + "@abp/jquery" "~4.3.0" toastr "^2.1.4" -"@abp/utils@^4.3.0-rc.2": - version "4.3.0-rc.2" - resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0-rc.2.tgz#6d051f98772e5642c2e3bc2f68e73d6f24f4694c" - integrity sha512-9qYo8OMTxIUG+qQBWXEpkURS6FUrx+J5s3SwC/eerp46hYr72GQ8L38Wq566a+xiLCn7Duxt6oJ/BxhTfQQxdw== +"@abp/utils@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-4.3.0.tgz#5fe44ae9a76ba8760bfd54dc6cfc64c96acc4b67" + integrity sha512-FFPSn/cL+b7/wYoRjvQLNJ3KrTiqng2gKPGf+jtMZer92fcVZtsF21ew/z+yxgj+9DRYtWbvn5iu9/ZPKL5hiw== dependencies: just-compare "^1.3.0" diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/package.json b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/package.json index 4499332946..69098f687a 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/package.json +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/package.json @@ -3,11 +3,11 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0-rc.2", - "@abp/cms-kit": "4.3.0-rc.2", - "@abp/tui-editor": "^4.3.0-rc.2", + "@abp/aspnetcore.mvc.ui.theme.basic": "^4.3.0", + "@abp/cms-kit": "4.3.0", + "@abp/tui-editor": "^4.3.0", "tui-code-snippet": "1.5.2", - "@abp/uppy": "^4.3.0-rc.2", + "@abp/uppy": "^4.3.0", "slugify": "1.4.6" } } \ No newline at end of file diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/star-rating-svg/css/star-rating-svg.css b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/star-rating-svg/css/star-rating-svg.css index 2c0114687f..29e43c2b98 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/star-rating-svg/css/star-rating-svg.css +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/star-rating-svg/css/star-rating-svg.css @@ -1,37 +1,37 @@ -.jq-stars { - display: inline-block; -} - -.jq-rating-label { - font-size: 22px; - display: inline-block; - position: relative; - vertical-align: top; - font-family: helvetica, arial, verdana; -} - -.jq-star { - width: 100px; - height: 100px; - display: inline-block; - cursor: pointer; -} - -.jq-star-svg { - width: 100%; - height: 100% ; -} - -.jq-star:hover .fs-star-svg polygon { -} - -.jq-star-svg polygon { - stroke: #000; - stroke-linejoin: round; -} - -/* un-used */ -.jq-shadow { - -webkit-filter: drop-shadow( -2px -2px 2px #888 ); - filter: drop-shadow( -2px -2px 2px #888 ); -} +.jq-stars { + display: inline-block; +} + +.jq-rating-label { + font-size: 22px; + display: inline-block; + position: relative; + vertical-align: top; + font-family: helvetica, arial, verdana; +} + +.jq-star { + width: 100px; + height: 100px; + display: inline-block; + cursor: pointer; +} + +.jq-star-svg { + width: 100%; + height: 100% ; +} + +.jq-star:hover .fs-star-svg polygon { +} + +.jq-star-svg polygon { + stroke: #000; + stroke-linejoin: round; +} + +/* un-used */ +.jq-shadow { + -webkit-filter: drop-shadow( -2px -2px 2px #888 ); + filter: drop-shadow( -2px -2px 2px #888 ); +} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/tui-editor-Editor-all.js b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/tui-editor-Editor-all.js new file mode 100644 index 0000000000..ff66874a58 --- /dev/null +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/tui-editor/tui-editor-Editor-all.js @@ -0,0 +1,42211 @@ +/*! + * tui-editor + * @version 1.4.10 + * @author NHN FE Development Lab (https://nhn.github.io/tui.editor/) + * @license MIT + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("jquery"), require("tui-code-snippet"), require("codemirror"), require("to-mark"), require("tui-chart"), require("squire-rte"), require("markdown-it"), require("highlight.js"), require("tui-color-picker"), require("plantuml-encoder")); + else if(typeof define === 'function' && define.amd) + define(["jquery", "tui-code-snippet", "codemirror", "to-mark", "tui-chart", "squire-rte", "markdown-it", "highlight.js", "tui-color-picker", "plantuml-encoder"], factory); + else if(typeof exports === 'object') + exports["Editor"] = factory(require("jquery"), require("tui-code-snippet"), require("codemirror"), require("to-mark"), require("tui-chart"), require("squire-rte"), require("markdown-it"), require("highlight.js"), require("tui-color-picker"), require("plantuml-encoder")); + else + root["tui"] = root["tui"] || {}, root["tui"]["Editor"] = factory(root["$"], root["tui"]["util"], root["CodeMirror"], root["toMark"], root["tui"]["chart"], root["Squire"], root["markdownit"], root["hljs"], root["tui"]["colorPicker"], root["plantumlEncoder"]); +})(window, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__10__, __WEBPACK_EXTERNAL_MODULE__24__, __WEBPACK_EXTERNAL_MODULE__57__, __WEBPACK_EXTERNAL_MODULE__79__, __WEBPACK_EXTERNAL_MODULE__85__, __WEBPACK_EXTERNAL_MODULE__94__, __WEBPACK_EXTERNAL_MODULE__207__, __WEBPACK_EXTERNAL_MODULE__209__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/dist"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 55); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__0__; + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__1__; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements CommandManager + * @author NHN FE Development Lab + */ + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _command = __webpack_require__(84); + +var _command2 = _interopRequireDefault(_command); + +var _util = __webpack_require__(39); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var KEYMAP_OS_INDEX = _util.isMac ? 1 : 0; + +/** + * Class CommandManager + * @param {ToastUIEditor} base nedInstance + * @param {object} [options={}] - option object + * @param {boolean} [options.useCommandShortcut=true] - execute command with keyMap + * @ignore + */ + +var CommandManager = function () { + function CommandManager(base) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, CommandManager); + + this._command = new _tuiCodeSnippet2.default.Map(); + this._mdCommand = new _tuiCodeSnippet2.default.Map(); + this._wwCommand = new _tuiCodeSnippet2.default.Map(); + this._options = _jquery2.default.extend({ + 'useCommandShortcut': true + }, options); + + this.base = base; + + this.keyMapCommand = {}; + + this._initEvent(); + } + + /** + * You can change command before command addition by addCommandBefore event. + * @param {object} command - command + * @returns {object} + * @private + */ + + + _createClass(CommandManager, [{ + key: '_addCommandBefore', + value: function _addCommandBefore(command) { + var commandWrapper = { command: command }; + + this.base.eventManager.emit('addCommandBefore', commandWrapper); + + return commandWrapper.command || command; + } + + /** + * Add command + * @param {Command} command Command instance + * @returns {Command} Command + */ + + }, { + key: 'addCommand', + value: function addCommand(command) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + if (args.length) { + command = CommandManager.command.apply(CommandManager, [command].concat(args)); + } + + command = this._addCommandBefore(command); + + var name = command.getName(); + + var commandBase = void 0; + + if (command.isMDType()) { + commandBase = this._mdCommand; + } else if (command.isWWType()) { + commandBase = this._wwCommand; + } else if (command.isGlobalType()) { + commandBase = this._command; + } + + commandBase.set(name, command); + + if (command.keyMap) { + this.keyMapCommand[command.keyMap[KEYMAP_OS_INDEX]] = name; + } + + return command; + } + + /** + * _initEvent + * Bind event handler to eventManager + * @private + */ + + }, { + key: '_initEvent', + value: function _initEvent() { + var _this = this; + + this.base.eventManager.listen('command', function () { + _this.exec.apply(_this, arguments); + }); + + this.base.eventManager.listen('keyMap', function (ev) { + if (!_this._options.useCommandShortcut) { + return; + } + var command = _this.keyMapCommand[ev.keyMap]; + + if (command) { + ev.data.preventDefault(); + _this.exec(command); + } + }); + } + + /** + * Execute command + * @param {String} name Command name + * @param {*} ...args Command argument + * @returns {*} + */ + + }, { + key: 'exec', + value: function exec(name) { + var commandToRun = void 0, + result = void 0; + var context = this.base; + + commandToRun = this._command.get(name); + + if (!commandToRun) { + if (this.base.isMarkdownMode()) { + commandToRun = this._mdCommand.get(name); + context = this.base.mdEditor; + } else { + commandToRun = this._wwCommand.get(name); + context = this.base.wwEditor; + } + } + + if (commandToRun) { + var _commandToRun; + + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + args.unshift(context); + result = (_commandToRun = commandToRun).exec.apply(_commandToRun, args); + } + + return result; + } + }]); + + return CommandManager; +}(); + +/** + * Create command by given editor type and property object + * @param {string} type Command type + * @param {{name: string, keyMap: Array}} props Property + * @returns {*} + * @static + */ + + +CommandManager.command = function (type, props) { + var command = _command2.default.factory(type, props.name, props.keyMap); + + _tuiCodeSnippet2.default.extend(command, props); + + return command; +}; + +exports.default = CommandManager; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.I18n = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements i18n + * @author NHN FE Development Lab + */ + + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var sharedInstance = void 0; + +var DEFAULT_CODE = 'en_US'; + +/** + * Class I18n + */ + +var I18n = function () { + function I18n() { + _classCallCheck(this, I18n); + + this._code = DEFAULT_CODE; + this._langs = new _tuiCodeSnippet2.default.Map(); + } + + /** + * Set locale code + * @param {string} code locale code + */ + + + _createClass(I18n, [{ + key: 'setCode', + value: function setCode(code) { + this._code = code; + } + + /** + * Set language set + * @param {string|string[]} codes locale code + * @param {object} data language set + */ + + }, { + key: 'setLanguage', + value: function setLanguage(codes, data) { + var _this = this; + + codes = [].concat(codes); + + codes.forEach(function (code) { + if (!_this._langs.has(code)) { + _this._langs.set(code, data); + } else { + var langData = _this._langs.get(code); + _this._langs.set(code, _tuiCodeSnippet2.default.extend(langData, data)); + } + }); + } + + /** + * Get text of key + * @param {string} key key of text + * @param {string} code locale code + * @returns {string} + */ + + }, { + key: 'get', + value: function get(key, code) { + if (!code) { + code = this._code; + } + + var langSet = this._langs.get(code); + + if (!langSet) { + langSet = this._langs.get(DEFAULT_CODE); + } + + var text = langSet[key]; + + if (!text) { + throw new Error('There is no text key "' + key + '" in ' + code); + } + + return text; + } + }], [{ + key: 'getSharedInstance', + value: function getSharedInstance() { + if (!sharedInstance) { + sharedInstance = new I18n(); + } + + return sharedInstance; + } + }]); + + return I18n; +}(); + +exports.I18n = I18n; +exports.default = new I18n(); + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @fileoverview DOM Utils + * @author NHN FE Development Lab + */ +var FIND_ZWB = /\u200B/g; + +/** + * Check if node is text node + * @param {Node} node node to check + * @returns {boolean} result + * @ignore + */ +var isTextNode = function isTextNode(node) { + return node && node.nodeType === Node.TEXT_NODE; +}; + +/** + * Check if node is element node + * @param {Node} node node to check + * @returns {boolean} result + * @ignore + */ +var isElemNode = function isElemNode(node) { + return node && node.nodeType === Node.ELEMENT_NODE; +}; + +/** + * Check that the node is block node + * @param {Node} node node + * @returns {boolean} + * @ignore + */ +var isBlockNode = function isBlockNode(node) { + return (/^(ADDRESS|ARTICLE|ASIDE|BLOCKQUOTE|DETAILS|DIALOG|DD|DIV|DL|DT|FIELDSET|FIGCAPTION|FIGURE|FOOTER|FORM|H[\d]|HEADER|HGROUP|HR|LI|MAIN|NAV|OL|P|PRE|SECTION|UL)$/ig.test(this.getNodeName(node)) + ); +}; + +/** + * Get node name of node + * @param {Node} node node + * @returns {string} node name + * @ignore + */ +var getNodeName = function getNodeName(node) { + if (isElemNode(node)) { + return node.tagName; + } + + return 'TEXT'; +}; + +/** + * Get node offset length of node(for Range API) + * @param {Node} node node + * @returns {number} length + * @ignore + */ +var getTextLength = function getTextLength(node) { + var len = void 0; + + if (isElemNode(node)) { + len = node.textContent.replace(FIND_ZWB, '').length; + } else if (isTextNode(node)) { + len = node.nodeValue.replace(FIND_ZWB, '').length; + } + + return len; +}; + +/** + * Get node offset length of node(for Range API) + * @param {Node} node node + * @returns {number} length + * @ignore + */ +var getOffsetLength = function getOffsetLength(node) { + var len = void 0; + + if (isElemNode(node)) { + len = node.childNodes.length; + } else if (isTextNode(node)) { + len = node.nodeValue.replace(FIND_ZWB, '').length; + } + + return len; +}; + +/** + * get node offset between parent's childnodes + * @param {Node} node node + * @returns {number} offset(index) + * @ignore + */ +var getNodeOffsetOfParent = function getNodeOffsetOfParent(node) { + var childNodesOfParent = node.parentNode.childNodes; + var i = void 0, + t = void 0, + found = void 0; + + for (i = 0, t = childNodesOfParent.length; i < t; i += 1) { + if (childNodesOfParent[i] === node) { + found = i; + break; + } + } + + return found; +}; + +/** + * get child node by offset + * @param {Node} node node + * @param {number} index offset index + * @returns {Node} foudned node + * @ignore + */ +var getChildNodeByOffset = function getChildNodeByOffset(node, index) { + var currentNode = void 0; + + if (isTextNode(node)) { + currentNode = node; + } else if (node.childNodes.length && index >= 0) { + currentNode = node.childNodes[index]; + } + + return currentNode; +}; + +/** + * find next node from passed node + * @param {strong} direction previous or next + * @param {Node} node node + * @param {string} untilNodeName parent node name to limit + * @returns {Node} founded node + * @ignore + */ +var getNodeWithDirectionUntil = function getNodeWithDirectionUntil(direction, node, untilNodeName) { + var directionKey = direction + 'Sibling'; + var nodeName = void 0, + foundedNode = void 0; + + while (node && !node[directionKey]) { + nodeName = getNodeName(node.parentNode); + + if (nodeName === untilNodeName || nodeName === 'BODY') { + break; + } + + node = node.parentNode; + } + + if (node[directionKey]) { + foundedNode = node[directionKey]; + } + + return foundedNode; +}; + +/** + * get prev node of childnode pointed with index + * @param {Node} node node + * @param {number} index offset index + * @param {string} untilNodeName parent node name to limit + * @returns {Node} founded node + * @ignore + */ +var getPrevOffsetNodeUntil = function getPrevOffsetNodeUntil(node, index, untilNodeName) { + var prevNode = void 0; + + if (index > 0) { + prevNode = getChildNodeByOffset(node, index - 1); + } else { + prevNode = getNodeWithDirectionUntil('previous', node, untilNodeName); + } + + return prevNode; +}; + +var getParentUntilBy = function getParentUntilBy(node, matchCondition, stopCondition) { + var foundedNode = void 0; + + while (node.parentNode && !matchCondition(node.parentNode)) { + node = node.parentNode; + + if (stopCondition && stopCondition(node.parentNode)) { + break; + } + } + + if (matchCondition(node.parentNode)) { + foundedNode = node; + } + + return foundedNode; +}; + +/** + * get parent node until paseed node name + * @param {Node} node node + * @param {string|HTMLNode} untilNode node name or node to limit + * @returns {Node} founded node + * @ignore + */ +var getParentUntil = function getParentUntil(node, untilNode) { + var foundedNode = void 0; + + if (_tuiCodeSnippet2.default.isString(untilNode)) { + foundedNode = getParentUntilBy(node, function (targetNode) { + return untilNode === getNodeName(targetNode); + }); + } else { + foundedNode = getParentUntilBy(node, function (targetNode) { + return untilNode === targetNode; + }); + } + + return foundedNode; +}; + +/** + * get node on the given direction under given parent + * @param {strong} direction previous or next + * @param {Node} node node + * @param {string|Node} underNode parent node name to limit + * @returns {Node} founded node + * @ignore + */ +var getNodeWithDirectionUnderParent = function getNodeWithDirectionUnderParent(direction, node, underNode) { + var directionKey = direction + 'Sibling'; + var foundedNode = void 0; + + node = getParentUntil(node, underNode); + + if (node && node[directionKey]) { + foundedNode = node[directionKey]; + } + + return foundedNode; +}; + +/** + * get top previous top level node under given node + * @param {Node} node node + * @param {Node} underNode underNode + * @returns {Node} founded node + * @ignore + */ +var getTopPrevNodeUnder = function getTopPrevNodeUnder(node, underNode) { + return getNodeWithDirectionUnderParent('previous', node, underNode); +}; + +/** + * get next top level block node + * @param {Node} node node + * @param {Node} underNode underNode + * @returns {Node} founded node + * @ignore + */ +var getTopNextNodeUnder = function getTopNextNodeUnder(node, underNode) { + return getNodeWithDirectionUnderParent('next', node, underNode); +}; + +/** + * Get parent element the body element + * @param {Node} node Node for start searching + * @returns {Node} + * @ignore + */ +var getTopBlockNode = function getTopBlockNode(node) { + return getParentUntil(node, 'BODY'); +}; + +/** + * Get previous text node + * @param {Node} node Node for start searching + * @returns {Node} + * @ignore + */ +var getPrevTextNode = function getPrevTextNode(node) { + node = node.previousSibling || node.parentNode; + + while (!isTextNode(node) && getNodeName(node) !== 'BODY') { + if (node.previousSibling) { + node = node.previousSibling; + + while (node.lastChild) { + node = node.lastChild; + } + } else { + node = node.parentNode; + } + } + + if (getNodeName(node) === 'BODY') { + node = null; + } + + return node; +}; + +/** + * test whether root contains the given node + * @param {HTMLNode} root - root node + * @param {HTMLNode} node - node to test + * @returns {Boolean} true if root contains node + * @ignore + */ +var containsNode = function containsNode(root, node) { + var walker = document.createTreeWalker(root, 4, null, false); + var found = root === node; + + while (!found && walker.nextNode()) { + found = walker.currentNode === node; + } + + return found; +}; + +/** + * find node by offset + * @param {HTMLElement} root Root element + * @param {Array.} offsetList offset list + * @param {function} textNodeFilter Text node filter + * @returns {Array} + * @ignore + */ +var findOffsetNode = function findOffsetNode(root, offsetList, textNodeFilter) { + var result = []; + var text = ''; + var walkerOffset = 0; + var newWalkerOffset = void 0; + + if (!offsetList.length) { + return result; + } + + var offset = offsetList.shift(); + var walker = document.createTreeWalker(root, 4, null, false); + + while (walker.nextNode()) { + text = walker.currentNode.nodeValue || ''; + + if (textNodeFilter) { + text = textNodeFilter(text); + } + + newWalkerOffset = walkerOffset + text.length; + + while (newWalkerOffset >= offset) { + result.push({ + container: walker.currentNode, + offsetInContainer: offset - walkerOffset, + offset: offset + }); + + if (!offsetList.length) { + return result; + } + offset = offsetList.shift(); + } + walkerOffset = newWalkerOffset; + } + + // there should be offset left + do { + result.push({ + container: walker.currentNode, + offsetInContainer: text.length, + offset: offset + }); + offset = offsetList.shift(); + } while (!_tuiCodeSnippet2.default.isUndefined(offset)); + + return result; +}; + +var getNodeInfo = function getNodeInfo(node) { + var path = {}; + + path.tagName = node.nodeName; + + if (node.id) { + path.id = node.id; + } + + var className = node.className.trim(); + + if (className) { + path.className = className; + } + + return path; +}; + +var getPath = function getPath(node, root) { + var paths = []; + + while (node && node !== root) { + if (isElemNode(node)) { + paths.unshift(getNodeInfo(node)); + } + + node = node.parentNode; + } + + return paths; +}; + +/** + * Find next, previous TD or TH element by given TE element + * @param {HTMLElement} node TD element + * @param {string} direction 'next' or 'previous' + * @returns {HTMLElement|null} + * @ignore + */ +var getTableCellByDirection = function getTableCellByDirection(node, direction) { + var targetElement = null; + + if (!_tuiCodeSnippet2.default.isUndefined(direction) && (direction === 'next' || direction === 'previous')) { + if (direction === 'next') { + targetElement = node.nextElementSibling; + } else { + targetElement = node.previousElementSibling; + } + } + + return targetElement; +}; + +/** + * Find sibling TR's TD element by given TD and direction + * @param {HTMLElement} node TD element + * @param {string} direction Boolean value for find first TD in next line + * @param {boolean} [needEdgeCell=false] Boolean value for find first TD in next line + * @returns {HTMLElement|null} + * @ignore + */ +var getSiblingRowCellByDirection = function getSiblingRowCellByDirection(node, direction, needEdgeCell) { + var tableCellElement = null; + var $node = void 0, + index = void 0, + $targetRowElement = void 0, + $currentContainer = void 0, + $siblingContainer = void 0, + isSiblingContainerExists = void 0; + + if (!_tuiCodeSnippet2.default.isUndefined(direction) && (direction === 'next' || direction === 'previous')) { + if (node) { + $node = (0, _jquery2.default)(node); + + if (direction === 'next') { + $targetRowElement = $node.parent().next(); + $currentContainer = $node.parents('thead'); + $siblingContainer = $currentContainer[0] && $currentContainer.next(); + isSiblingContainerExists = $siblingContainer && getNodeName($siblingContainer[0]) === 'TBODY'; + + index = 0; + } else { + $targetRowElement = $node.parent().prev(); + $currentContainer = $node.parents('tbody'); + $siblingContainer = $currentContainer[0] && $currentContainer.prev(); + isSiblingContainerExists = $siblingContainer && getNodeName($siblingContainer[0]) === 'THEAD'; + + index = node.parentNode.childNodes.length - 1; + } + + if (_tuiCodeSnippet2.default.isUndefined(needEdgeCell) || !needEdgeCell) { + index = getNodeOffsetOfParent(node); + } + + if ($targetRowElement[0]) { + tableCellElement = $targetRowElement.children('td,th')[index]; + } else if ($currentContainer[0] && isSiblingContainerExists) { + tableCellElement = $siblingContainer.find('td,th')[index]; + } + } + } + + return tableCellElement; +}; + +/** + * Check that the inline node is supported by markdown + * @param {Node} node TD element + * @returns {boolean} + * @ignore + */ +var isMDSupportInlineNode = function isMDSupportInlineNode(node) { + return (/^(A|B|BR|CODE|DEL|EM|I|IMG|S|SPAN|STRONG)$/ig.test(node.nodeName) + ); +}; + +/** + * Check that node is styled node. + * Styled node is a node that has text and decorates text. + * @param {Node} node TD element + * @returns {boolean} + * @ignore + */ +var isStyledNode = function isStyledNode(node) { + return (/^(A|ABBR|ACRONYM|B|BDI|BDO|BIG|CITE|CODE|DEL|DFN|EM|I|INS|KBD|MARK|Q|S|SAMP|SMALL|SPAN|STRONG|SUB|SUP|U|VAR)$/ig.test(node.nodeName) + ); +}; + +/** + * remove node from 'start' node to 'end-1' node inside parent + * if 'end' node is null, remove all child nodes after 'start' node. + * @param {Node} parent - parent node + * @param {Node} start - start node to remove + * @param {Node} end - end node to remove + * @ignore + */ +var removeChildFromStartToEndNode = function removeChildFromStartToEndNode(parent, start, end) { + var child = start; + + if (!child || parent !== child.parentNode) { + return; + } + + while (child !== end) { + var next = child.nextSibling; + parent.removeChild(child); + child = next; + } +}; + +/** + * remove nodes along the direction from the node to reach targetParent node + * @param {Node} targetParent - stop removing when reach target parent node + * @param {Node} node - start node + * @param {boolean} isForward - direction + * @ignore + */ +var removeNodesByDirection = function removeNodesByDirection(targetParent, node, isForward) { + var parent = node; + + while (parent !== targetParent) { + var nextParent = parent.parentNode; + var _parent = parent, + nextSibling = _parent.nextSibling, + previousSibling = _parent.previousSibling; + + + if (!isForward && nextSibling) { + removeChildFromStartToEndNode(nextParent, nextSibling, null); + } else if (isForward && previousSibling) { + removeChildFromStartToEndNode(nextParent, nextParent.childNodes[0], parent); + } + + parent = nextParent; + } +}; + +var getLeafNode = function getLeafNode(node) { + var result = node; + while (result.childNodes && result.childNodes.length) { + var _result = result, + nextLeaf = _result.firstChild; + + // When inline tag have empty text node with other childnodes, ignore empty text node. + + if (isTextNode(nextLeaf) && !getTextLength(nextLeaf)) { + result = nextLeaf.nextSibling || nextLeaf; + } else { + result = nextLeaf; + } + } + + return result; +}; +/** + * check if a coordinates is inside a task box + * @param {object} style - computed style of task box + * @param {number} offsetX - event x offset + * @param {number} offsetY - event y offset + * @returns {boolean} + * @ignore + */ +var isInsideTaskBox = function isInsideTaskBox(style, offsetX, offsetY) { + var rect = { + left: parseInt(style.left, 10), + top: parseInt(style.top, 10), + width: parseInt(style.width, 10), + height: parseInt(style.height, 10) + }; + + return offsetX >= rect.left && offsetX <= rect.left + rect.width && offsetY >= rect.top && offsetY <= rect.top + rect.height; +}; + +/** + * Check whether node is OL or UL + * @param {node} node - node + * @returns {boolean} - whether node is OL or UL + * @ignore + */ +var isListNode = function isListNode(node) { + if (!node) { + return false; + } + + return node.nodeName === 'UL' || node.nodeName === 'OL'; +}; + +/** + * Check whether node is first list item + * @param {node} node - node + * @returns {boolean} whether node is first list item + * @ignore + */ +var isFirstListItem = function isFirstListItem(node) { + var nodeName = node.nodeName, + parentNode = node.parentNode; + + + return nodeName === 'LI' && node === parentNode.firstChild; +}; + +/** + * Check whether node is first level list item + * @param {node} node - node + * @returns {boolean} whether node is first level list item + * @ignore + */ +var isFirstLevelListItem = function isFirstLevelListItem(node) { + var nodeName = node.nodeName, + listNode = node.parentNode; + var listParentNode = listNode.parentNode; + + + return nodeName === 'LI' && !isListNode(listParentNode); +}; + +/** + * Merge node to target node and detach node + * @param {node} node - node + * @param {node} targetNode - target node + * @ignore + */ +var mergeNode = function mergeNode(node, targetNode) { + if (node.hasChildNodes()) { + _tuiCodeSnippet2.default.forEachArray(node.childNodes, function () { + targetNode.appendChild(node.firstChild); + }); + + targetNode.normalize(); + } + + if (node.parentNode) { + node.parentNode.removeChild(node); + } +}; + +/** + * Create hr that is not contenteditable + * @returns {node} hr is wraped div + * @ignore + */ +var createHorizontalRule = function createHorizontalRule() { + var div = document.createElement('div'); + var hr = document.createElement('hr'); + + div.setAttribute('contenteditable', false); + hr.setAttribute('contenteditable', false); + + div.appendChild(hr); + + return div; +}; + +/** + * Create Empty Line + * @returns {node}

    + * @private + */ +var createEmptyLine = function createEmptyLine() { + var div = document.createElement('div'); + div.appendChild(document.createElement('br')); + + return div; +}; + +/** + * Find same tagName child node and change wrapping order. + * For example, if below node need to optimize 'B' tag. + * test + * should be changed tag's order. + * test + * @param {node} node + * @param {string} tagName + * @returns {node} + * @private + */ +var changeTagOrder = function changeTagOrder(node, tagName) { + if (node.nodeName !== 'SPAN') { + var parentNode = node.parentNode; + + var tempNode = node; + + while (tempNode.childNodes && tempNode.childNodes.length === 1 && !isTextNode(tempNode.firstChild)) { + tempNode = tempNode.firstChild; + + if (tempNode.nodeName === 'SPAN') { + break; + } + + if (tempNode.nodeName === tagName) { + var wrapper = document.createElement(tagName); + + mergeNode(tempNode, tempNode.parentNode); + parentNode.replaceChild(wrapper, node); + wrapper.appendChild(node); + + return wrapper; + } + } + } + + return node; +}; + +/** + * Find same tagName nodes and merge from startNode to endNode. + * @param {node} startNode + * @param {node} endNode + * @param {string} tagName + * @returns {node} + * @private + */ +var mergeSameNodes = function mergeSameNodes(startNode, endNode, tagName) { + var startBlockNode = changeTagOrder(startNode, tagName); + + if (startBlockNode.nodeName === tagName) { + var endBlockNode = changeTagOrder(endNode, tagName); + var mergeTargetNode = startBlockNode; + var nextNode = startBlockNode.nextSibling; + + while (nextNode) { + var tempNext = nextNode.nextSibling; + + nextNode = changeTagOrder(nextNode, tagName); + + if (nextNode.nodeName === tagName) { + // eslint-disable-next-line max-depth + if (mergeTargetNode) { + mergeNode(nextNode, mergeTargetNode); + } else { + mergeTargetNode = nextNode; + } + } else { + mergeTargetNode = null; + } + + if (nextNode === endBlockNode) { + break; + } + + nextNode = tempNext; + } + } +}; + +/** + * Find same tagName nodes in range and merge nodes. + * For example range is like this + * AAABBB + * nodes is changed below + * AAABBB + * @param {range} range + * @param {string} tagName + * @private + */ +var optimizeRange = function optimizeRange(range, tagName) { + var collapsed = range.collapsed, + commonAncestorContainer = range.commonAncestorContainer, + startContainer = range.startContainer, + endContainer = range.endContainer; + + + if (!collapsed) { + var optimizedNode = null; + + if (startContainer !== endContainer) { + mergeSameNodes(getParentUntil(startContainer, commonAncestorContainer), getParentUntil(endContainer, commonAncestorContainer), tagName); + + optimizedNode = commonAncestorContainer; + } else if (isTextNode(startContainer)) { + optimizedNode = startContainer.parentNode; + } + + if (optimizedNode && optimizedNode.nodeName === tagName) { + var _optimizedNode = optimizedNode, + previousSibling = _optimizedNode.previousSibling; + + var tempNode = void 0; + + if (previousSibling) { + tempNode = changeTagOrder(previousSibling); + + if (tempNode.nodeName === tagName) { + mergeNode(optimizedNode, tempNode); + } + } + + var _optimizedNode2 = optimizedNode, + nextSibling = _optimizedNode2.nextSibling; + + + if (nextSibling) { + tempNode = changeTagOrder(nextSibling); + + if (tempNode.nodeName === tagName) { + mergeNode(tempNode, optimizedNode); + } + } + } + } +}; + +/** + * Gets all text node from root element. + * @param {HTMLElement} root Root element + * @returns {Array} list of text nodes + * @ignore + */ +var getAllTextNode = function getAllTextNode(root) { + var walker = document.createTreeWalker(root, 4, null, false); + var result = []; + + while (walker.nextNode()) { + var node = walker.currentNode; + + if (isTextNode(node)) { + result.push(node); + } + } + + return result; +}; + +/** + * Check whether the node is 'TD' or 'TH' + * @param {HTMLElement} node - the target node + * @returns {boolean} - whether the node is 'TD' or 'TH' + * @ignore + */ +var isCellNode = function isCellNode(node) { + if (!node) { + return false; + } + + return node.nodeName === 'TD' || node.nodeName === 'TH'; +}; + +/** + * Get the last node on the target node by the condition + * @param {HTMLElement} node - the target node + * @returns {function} - the condition to find the node + * @ignore + */ +var getLastNodeBy = function getLastNodeBy(node, condition) { + var lastNode = node && node.lastChild; + + while (lastNode && condition(lastNode)) { + lastNode = lastNode.lastChild; + } + + return lastNode; +}; + +/** + * Get the parent node on the target node by the condition + * @param {HTMLElement} node - the target node + * @returns {function} - the condition to find the node + * @ignore + */ +var getParentNodeBy = function getParentNodeBy(node, condition) { + while (node && condition(node.parentNode, node)) { + node = node.parentNode; + } + + return node; +}; + +/** + * Get the sibling node on the target node by the condition + * @param {HTMLElement} node - the target node + * @param {string} direction - the direction to find node ('previous', 'next') + * @returns {function} - the condition to find the node + * @ignore + */ +var getSiblingNodeBy = function getSiblingNodeBy(node, direction, condition) { + var directionKey = direction + 'Sibling'; + + while (node && condition(node[directionKey], node)) { + node = node[directionKey]; + } + + return node; +}; + +exports.default = { + getNodeName: getNodeName, + isTextNode: isTextNode, + isElemNode: isElemNode, + isBlockNode: isBlockNode, + getTextLength: getTextLength, + getOffsetLength: getOffsetLength, + getPrevOffsetNodeUntil: getPrevOffsetNodeUntil, + getNodeOffsetOfParent: getNodeOffsetOfParent, + getChildNodeByOffset: getChildNodeByOffset, + getNodeWithDirectionUntil: getNodeWithDirectionUntil, + containsNode: containsNode, + getTopPrevNodeUnder: getTopPrevNodeUnder, + getTopNextNodeUnder: getTopNextNodeUnder, + getParentUntilBy: getParentUntilBy, + getParentUntil: getParentUntil, + getTopBlockNode: getTopBlockNode, + getPrevTextNode: getPrevTextNode, + findOffsetNode: findOffsetNode, + getPath: getPath, + getNodeInfo: getNodeInfo, + getTableCellByDirection: getTableCellByDirection, + getSiblingRowCellByDirection: getSiblingRowCellByDirection, + isMDSupportInlineNode: isMDSupportInlineNode, + isStyledNode: isStyledNode, + removeChildFromStartToEndNode: removeChildFromStartToEndNode, + removeNodesByDirection: removeNodesByDirection, + getLeafNode: getLeafNode, + isInsideTaskBox: isInsideTaskBox, + isListNode: isListNode, + isFirstListItem: isFirstListItem, + isFirstLevelListItem: isFirstLevelListItem, + mergeNode: mergeNode, + createHorizontalRule: createHorizontalRule, + createEmptyLine: createEmptyLine, + changeTagOrder: changeTagOrder, + mergeSameNodes: mergeSameNodes, + optimizeRange: optimizeRange, + getAllTextNode: getAllTextNode, + isCellNode: isCellNode, + getLastNodeBy: getLastNodeBy, + getParentNodeBy: getParentNodeBy, + getSiblingNodeBy: getSiblingNodeBy +}; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** +* @fileoverview Editor/Viewer proxy for extensions +* @author NHN FE Development Lab +*/ +/* eslint global-require: 0 no-empty: 0 */ + +var Editor = void 0; +try { + Editor = __webpack_require__(30); +} catch (e) {} +if (!Editor) { + try { + Editor = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module '../viewer'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); + } catch (e) {} +} + +exports.default = Editor; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createTableData = createTableData; +exports.createCellIndexData = createCellIndexData; + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Parse cell like td or th. + * @param {HTMLElement} cell - cell element like td or th + * @param {number} rowIndex - row index + * @param {number} colIndex - column index + * @returns {{ + * nodeName: string, + * colspan: number, + * rowspan: number, + * content: string, + * align: ?string + * }} + * @private + */ +/** +* @fileoverview Implements tableDataHandler +* @author NHN FE Development Lab +*/ +function _parseCell(cell, rowIndex, colIndex) { + var $cell = (0, _jquery2.default)(cell); + var colspan = $cell.attr('colspan'); + var rowspan = $cell.attr('rowspan'); + var nodeName = cell.nodeName; + + + if (nodeName !== 'TH' && nodeName !== 'TD') { + return null; + } + + var cellData = { + nodeName: cell.nodeName, + colspan: colspan ? parseInt(colspan, 10) : 1, + rowspan: rowspan ? parseInt(rowspan, 10) : 1, + content: $cell.html(), + elementIndex: { + rowIndex: rowIndex, + colIndex: colIndex + } + }; + + if (cell.nodeName === 'TH' && cell.align) { + cellData.align = cell.align; + } + + return cellData; +} + +/** + * Add merged cell. + * @param {object} base - base table data + * @param {object} cellData - cell data + * @param {number} startRowIndex - start row index + * @param {number} startCellIndex - start cell index + * @private + */ +function _addMergedCell(base, cellData, startRowIndex, startCellIndex) { + var colspan = cellData.colspan, + rowspan = cellData.rowspan, + nodeName = cellData.nodeName; + + var colMerged = colspan > 1; + var rowMerged = rowspan > 1; + + if (!colMerged && !rowMerged) { + return; + } + + var limitRowIndex = startRowIndex + rowspan; + var limitCellIndex = startCellIndex + colspan; + + _tuiCodeSnippet2.default.range(startRowIndex, limitRowIndex).forEach(function (rowIndex) { + base[rowIndex] = base[rowIndex] || []; + + _tuiCodeSnippet2.default.range(startCellIndex, limitCellIndex).forEach(function (cellIndex) { + var mergedData = { + nodeName: nodeName + }; + + if (rowIndex === startRowIndex && cellIndex === startCellIndex) { + return; + } + + if (colMerged) { + mergedData.colMergeWith = startCellIndex; + } + + if (rowMerged) { + mergedData.rowMergeWith = startRowIndex; + } + + base[rowIndex][cellIndex] = mergedData; + }); + }); +} + +/** + * Create table data from jQuery table Element. + * @param {jQuery} $table - jQuery table element + * @returns {Array.>} + * @ignore + */ +function createTableData($table) { + var tableData = []; + + $table.find('tr').each(function (rowIndex, tr) { + var stackedColCount = 0; + + tableData[rowIndex] = tableData[rowIndex] || []; + + (0, _jquery2.default)(tr).children().each(function (colIndex, cell) { + var cellData = _parseCell(cell, rowIndex, colIndex); + + if (!cellData) { + return; + } + var dataColIndex = colIndex + stackedColCount; + + while (tableData[rowIndex][dataColIndex]) { + dataColIndex += 1; + stackedColCount += 1; + } + + tableData[rowIndex][dataColIndex] = cellData; + _addMergedCell(tableData, cellData, rowIndex, dataColIndex); + }); + }); + + if ($table[0].className) { + tableData.className = $table[0].className; + } + + return tableData; +} + +/** + * Create cell index data of table data. + * @param {Array.>} tableData - table data + * @returns {Array.>} + * @ignore + */ +function createCellIndexData(tableData) { + var mappingData = []; + + tableData.forEach(function (row, rowIndex) { + var mappingRow = []; + + row.forEach(function (cell, colIndex) { + if (_tuiCodeSnippet2.default.isUndefined(cell.colMergeWith) && _tuiCodeSnippet2.default.isUndefined(cell.rowMergeWith)) { + mappingRow.push({ + rowIndex: rowIndex, + colIndex: colIndex + }); + } + }); + mappingData.push(mappingRow); + }); + + return mappingData; +} + +/** + * Get header aligns. + * @param {Array.>} tableData - table data + * @returns {Array.} + * @private + */ +function _getHeaderAligns(tableData) { + var headRowData = tableData[0]; + + + return headRowData.map(function (cellData) { + var align = void 0; + + if (_tuiCodeSnippet2.default.isExisty(cellData.colMergeWith)) { + align = headRowData[cellData.colMergeWith].align; + } else { + align = cellData.align; + } + + return align; + }); +} + +/** + * Create render data. + * @param {Array.} tableData - table data + * @param {Array.} cellIndexData - cell index data + * @returns {Array.>} + * @ignore + */ +function createRenderData(tableData, cellIndexData) { + var headerAligns = _getHeaderAligns(tableData); + var renderData = cellIndexData.map(function (row) { + return row.map(function (_ref) { + var rowIndex = _ref.rowIndex, + colIndex = _ref.colIndex; + return _tuiCodeSnippet2.default.extend({ + align: headerAligns[colIndex] + }, tableData[rowIndex][colIndex]); + }); + }); + + if (tableData.className) { + renderData.className = tableData.className; + } + + return renderData; +} + +var BASIC_CELL_CONTENT = _tuiCodeSnippet2.default.browser.msie ? '' : '
    '; + +/** + * Create basic cell data. + * @param {number} rowIndex - row index + * @param {number} colIndex - column index + * @param {string} nodeName - node name + * @returns {{ + * nodeName: string, + * colspan: number, + * rowspan: number, + * content: string + * }} + * @ignore + */ +function createBasicCell(rowIndex, colIndex, nodeName) { + return { + nodeName: nodeName || 'TD', + colspan: 1, + rowspan: 1, + content: BASIC_CELL_CONTENT, + elementIndex: { + rowIndex: rowIndex, + colIndex: colIndex + } + }; +} + +/** + * Find element row index. + * @param {jQuery} $cell - cell jQuery element like td or th + * @returns {number} + * @ignore + */ +function findElementRowIndex($cell) { + var $tr = $cell.closest('tr'); + var rowIndex = $tr.prevAll().length; + + if ($tr.parent()[0].nodeName === 'TBODY') { + rowIndex += 1; + } + + return rowIndex; +} + +/** + * Find element col index. + * @param {jQuery} $cell - cell jQuery element like td or th + * @returns {number} + * @ignore + */ +function findElementColIndex($cell) { + return $cell.closest('td, th').prevAll().length; +} + +/** + * Find indexes of base table data from mappin data. + * @param {Array.>} cellIndexData - cell index data + * @param {jQuery} $cell - cell jQuery element like td or th + * @returns {{rowIndex: number, cellIndex: number}} + * @ignore + */ +function findCellIndex(cellIndexData, $cell) { + var elementRowIndex = findElementRowIndex($cell); + var elementColIndex = findElementColIndex($cell); + + return cellIndexData[elementRowIndex][elementColIndex]; +} + +/** + * Find last index of col merged cells. + * @param {Array.>} tableData - tableData data + * @param {number} rowIndex - row index of base data + * @param {number} colIndex - column index of tabld data + * @returns {number} + * @ignore + */ +function findRowMergedLastIndex(tableData, rowIndex, colIndex) { + var cellData = tableData[rowIndex][colIndex]; + var foundRowIndex = rowIndex; + + if (cellData.rowspan > 1) { + foundRowIndex += cellData.rowspan - 1; + } + + return foundRowIndex; +} + +/** + * Find last index of col merged cells. + * @param {Array.>} tableData - tableData data + * @param {number} rowIndex - row index of base data + * @param {number} colIndex - column index of tabld data + * @returns {number} + * @ignore + */ +function findColMergedLastIndex(tableData, rowIndex, colIndex) { + var cellData = tableData[rowIndex][colIndex]; + var foundColIndex = colIndex; + + if (cellData.colspan > 1) { + foundColIndex += cellData.colspan - 1; + } + + return foundColIndex; +} + +/** + * Find cell element index. + * @param {Array.>} tableData - tableData data + * @param {number} rowIndex - row index of base data + * @param {number} colIndex - col index of base data + * @returns {{rowIndex: number, colIndex: number}} + * @ignore + */ +function findElementIndex(tableData, rowIndex, colIndex) { + var cellData = tableData[rowIndex][colIndex]; + + rowIndex = _tuiCodeSnippet2.default.isExisty(cellData.rowMergeWith) ? cellData.rowMergeWith : rowIndex; + colIndex = _tuiCodeSnippet2.default.isExisty(cellData.colMergeWith) ? cellData.colMergeWith : colIndex; + + return tableData[rowIndex][colIndex].elementIndex; +} + +/** + * Stuff cells into incomplete row. + * @param {Array.>} tableData - table data + * @param {number} limitIndex - limit index + * @ignore + */ +function stuffCellsIntoIncompleteRow(tableData, limitIndex) { + tableData.forEach(function (rowData, rowIndex) { + var startIndex = rowData.length; + if (startIndex) { + var nodeName = rowData[0].nodeName; + + + _tuiCodeSnippet2.default.range(startIndex, limitIndex).forEach(function (colIndex) { + rowData.push(createBasicCell(rowIndex, colIndex, nodeName)); + }); + } + }); +} + +/** + * Add tbody or thead of table data if need. + * @param {Array.>} tableData - table data + * @returns {boolean} + * @ignore + */ +function addTbodyOrTheadIfNeed(tableData) { + var header = tableData[0]; + + var cellCount = header.length; + var added = true; + + if (!cellCount && tableData[1]) { + _tuiCodeSnippet2.default.range(0, tableData[1].length).forEach(function (colIndex) { + header.push(createBasicCell(0, colIndex, 'TH')); + }); + } else if (tableData[0][0].nodeName !== 'TH') { + var _ref2; + + var newHeader = _tuiCodeSnippet2.default.range(0, cellCount).map(function (colIndex) { + return createBasicCell(0, colIndex, 'TH'); + }); + + (_ref2 = []).concat.apply(_ref2, tableData).forEach(function (cellData) { + if (cellData.elementIndex) { + cellData.elementIndex.rowIndex += 1; + } + }); + + tableData.unshift(newHeader); + } else if (tableData.length === 1) { + var newRow = _tuiCodeSnippet2.default.range(0, cellCount).map(function (colIndex) { + return createBasicCell(1, colIndex, 'TD'); + }); + + tableData.push(newRow); + } else { + added = false; + } + + return added; +} + +exports.default = { + createTableData: createTableData, + createCellIndexData: createCellIndexData, + createRenderData: createRenderData, + findElementRowIndex: findElementRowIndex, + findElementColIndex: findElementColIndex, + findCellIndex: findCellIndex, + createBasicCell: createBasicCell, + findRowMergedLastIndex: findRowMergedLastIndex, + findColMergedLastIndex: findColMergedLastIndex, + findElementIndex: findElementIndex, + stuffCellsIntoIncompleteRow: stuffCellsIntoIncompleteRow, + addTbodyOrTheadIfNeed: addTbodyOrTheadIfNeed +}; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _uicontroller = __webpack_require__(14); + +var _uicontroller2 = _interopRequireDefault(_uicontroller); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements LayerPopup + * @author NHN FE Development Lab + */ + + +var CLASS_PREFIX = 'tui-popup-'; +var CLASS_FIT_WINDOW = 'fit-window'; + +var LAYOUT_TEMPLATE_MODELESS = '
    \n \n
    \n \n
    \n
    \n
    '; + +var LAYOUT_TEMPLATE_MODAL = '
    \n
    \n \n
    \n \n
    \n
    \n
    \n
    '; + +/** + * A number, or a string containing a number. + * @typedef {object} LayerPopupOption + * @property {string[]} [openerCssQuery] - Css Query list to bind clickevent that open popup + * @property {string[]} [closerCssQuery] - Css Query list to bind clickevent that close popup + * @property {jQuery} $el - popup root element + * @property {jQuery|string} [content] - popup content that html string or jQuery element + * @property {string} [textContent] - popup text content + * @property {string} title - popup title + * @property {boolean} [header] - whether to draw header + * @property {jQuery} [$target] - element to append popup + * @property {boolean} modal - true: modal, false: modeless + * @property {string} [headerButtons] - replace header(close) button + */ + +/** + * Class LayerPopup + * @param {LayerPopupOption} options - popup option + */ + +var LayerPopup = function (_UIController) { + _inherits(LayerPopup, _UIController); + + function LayerPopup(options) { + _classCallCheck(this, LayerPopup); + + options = _tuiCodeSnippet2.default.extend({ + header: true, + $target: (0, _jquery2.default)('body'), + textContent: '' + }, options); + + var _this = _possibleConstructorReturn(this, (LayerPopup.__proto__ || Object.getPrototypeOf(LayerPopup)).call(this, { + tagName: 'div', + className: options.modal ? CLASS_PREFIX + 'modal-background' : CLASS_PREFIX + 'wrapper', + rootElement: options.$el + })); + + _this._initInstance(options); + _this._initDOM(options); + _this._initDOMEvent(options); + _this._initEditorEvent(options); + return _this; + } + + /** + * init instance. + * store properties & prepare before initialize DOM + * @param {LayerPopupOption} options - layer popup options + * @private + */ + + + _createClass(LayerPopup, [{ + key: '_initInstance', + value: function _initInstance(options) { + this._$target = options.$target; + + if (options.$el) { + this.$el = options.$el; + this._isExternalHtmlUse = true; + } + + if (options.content) { + this.$content = (0, _jquery2.default)(options.content); + } else { + this.$content = options.textContent; + } + + this.options = options; + } + + /** + * initialize DOM, render popup + * @private + */ + + }, { + key: '_initDOM', + value: function _initDOM() { + this._initLayout(); + + if (!this._isExternalHtmlUse) { + if (_tuiCodeSnippet2.default.isExisty(this.options.title)) { + this.setTitle(this.options.title); + } + this.setContent(this.$content); + } + + var buttons = this.options.headerButtons; + if (buttons) { + this.$el.find('.' + CLASS_PREFIX + 'close-button').remove(); + + var $buttonWrapper = this.$el.find('.' + CLASS_PREFIX + 'header-buttons'); + $buttonWrapper.empty(); + $buttonWrapper.append((0, _jquery2.default)(buttons)); + } + + if (this.options.css) { + this.$el.css(this.options.css); + } + } + + /** + * bind DOM events + * @private + */ + + }, { + key: '_initDOMEvent', + value: function _initDOMEvent() { + var _this2 = this; + + var _options = this.options, + openerCssQuery = _options.openerCssQuery, + closerCssQuery = _options.closerCssQuery; + + if (openerCssQuery) { + (0, _jquery2.default)(openerCssQuery).on('click.' + this._id, function () { + return _this2.show(); + }); + } + if (closerCssQuery) { + (0, _jquery2.default)(closerCssQuery).on('click.' + this._id, function () { + return _this2.hide(); + }); + } + + this.on('click .' + CLASS_PREFIX + 'close-button', function () { + return _this2.hide(); + }); + } + + /** + * bind editor events + * @private + * @abstract + */ + + }, { + key: '_initEditorEvent', + value: function _initEditorEvent() {} + }, { + key: '_initLayout', + value: function _initLayout() { + var options = this.options; + + + if (!this._isExternalHtmlUse) { + var layout = options.modal ? LAYOUT_TEMPLATE_MODAL : LAYOUT_TEMPLATE_MODELESS; + this.$el.html(layout); + this.$el.addClass(options.className); + this.hide(); + this._$target.append(this.$el); + this.$body = this.$el.find('.' + CLASS_PREFIX + 'body'); + + if (!options.header) { + this.$el.find('.' + CLASS_PREFIX + 'header').remove(); + } + } else { + this.hide(); + this._$target.append(this.$el); + } + } + + /** + * set popup content + * @param {jQuery|HTMLElement|string} $content - content + */ + + }, { + key: 'setContent', + value: function setContent($content) { + this.$body.empty(); + this.$body.append($content); + } + + /** + * set title + * @param {string} title - title text + */ + + }, { + key: 'setTitle', + value: function setTitle(title) { + var $title = this.$el.find('.' + CLASS_PREFIX + 'title'); + + $title.empty(); + $title.append(title); + } + + /** + * get title element + * @returns {HTMLElement} - title html element + */ + + }, { + key: 'getTitleElement', + value: function getTitleElement() { + return this.$el.find('.' + CLASS_PREFIX + 'title').get(0); + } + + /** + * hide popup + */ + + }, { + key: 'hide', + value: function hide() { + this.$el.css('display', 'none'); + this._isShow = false; + this.trigger('hidden', this); + } + + /** + * show popup + */ + + }, { + key: 'show', + value: function show() { + this.$el.css('display', 'block'); + this._isShow = true; + this.trigger('shown', this); + } + + /** + * whether this popup is visible + * @returns {boolean} - true: shown, false: hidden + */ + + }, { + key: 'isShow', + value: function isShow() { + return this._isShow; + } + + /** + * remove popup content + */ + + }, { + key: 'remove', + value: function remove() { + var _options2 = this.options, + openerCssQuery = _options2.openerCssQuery, + closerCssQuery = _options2.closerCssQuery; + + + this.trigger('remove', this); + this.off(); + + if (openerCssQuery) { + (0, _jquery2.default)(openerCssQuery).off('.' + this._id); + } + if (closerCssQuery) { + (0, _jquery2.default)(closerCssQuery).off('.' + this._id); + } + + this.$el.remove(); + this.$el = null; + } + + /** + * make popup size fit to window + * @param {boolean} fit - true to make popup fit to window + * @protected + * @ignore + */ + + }, { + key: 'setFitToWindow', + value: function setFitToWindow(fit) { + this.$el.toggleClass(CLASS_FIT_WINDOW, fit); + } + + /** + * make popup size fit to window + * @returns {boolean} - true for fit to window + * @protected + * @ignore + */ + + }, { + key: 'isFitToWindow', + value: function isFitToWindow() { + return this.$el.hasClass(CLASS_FIT_WINDOW); + } + + /** + * toggle size fit to window + * @returns {boolean} - true for fit to window + * @protected + * @ignore + */ + + }, { + key: 'toggleFitToWindow', + value: function toggleFitToWindow() { + var fitToWindow = !this.isFitToWindow(); + this.setFitToWindow(fitToWindow); + + return fitToWindow; + } + }]); + + return LayerPopup; +}(_uicontroller2.default); + +exports.default = LayerPopup; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tableDataHandler = __webpack_require__(6); + +var _tableDataHandler2 = _interopRequireDefault(_tableDataHandler); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Create cell html. + * @param {object} cell - cell data of table base data + * @returns {string} + * @private + */ +/** +* @fileoverview Implements tableRenderer +* @author NHN FE Development Lab +*/ +function _createCellHtml(cell) { + var attrs = cell.colspan > 1 ? ' colspan="' + cell.colspan + '"' : ''; + attrs += cell.rowspan > 1 ? ' rowspan="' + cell.rowspan + '"' : ''; + attrs += cell.align ? ' align="' + cell.align + '"' : ''; + + return '<' + cell.nodeName + attrs + '>' + cell.content + ''; +} + +/** + * Create html for thead or tbody. + * @param {Array.>} trs - tr list + * @param {string} wrapperNodeName - wrapper node name like THEAD, TBODY + * @returns {string} + * @private + */ +function _createTheadOrTbodyHtml(trs, wrapperNodeName) { + var html = ''; + + if (trs.length) { + html = trs.map(function (tr) { + var tdHtml = tr.map(_createCellHtml).join(''); + + return '' + tdHtml + ''; + }).join(''); + html = '<' + wrapperNodeName + '>' + html + ''; + } + + return html; +} + +/** + * Create table html. + * @param {Array.>} renderData - table data for render + * @returns {string} + * @private + */ +function createTableHtml(renderData) { + var thead = renderData[0] ? [renderData[0]] : []; + var tbody = renderData.slice(1); + var theadHtml = _createTheadOrTbodyHtml(thead, 'THEAD'); + var tbodyHtml = _createTheadOrTbodyHtml(tbody, 'TBODY'); + var className = renderData.className ? ' class="' + renderData.className + '"' : ''; + + return '' + (theadHtml + tbodyHtml) + ''; +} + +/** + * Replace table. + * @param {jQuery} $table - table jQuery element + * @param {Array.>} tableData - table data + * @returns {jQuery} + * @ignore + */ +function replaceTable($table, tableData) { + var cellIndexData = _tableDataHandler2.default.createCellIndexData(tableData); + var renderData = _tableDataHandler2.default.createRenderData(tableData, cellIndexData); + var $newTable = (0, _jquery2.default)(createTableHtml(renderData)); + + $table.replaceWith($newTable); + + return $newTable; +} + +/** + * Focus to cell. + * @param {squireext} sq - squire instance + * @param {range} range - range object + * @param {HTMLElement} targetCell - cell element for focus + * @ignore + */ +function focusToCell(sq, range, targetCell) { + range.selectNodeContents(targetCell); + range.collapse(true); + sq.setSelection(range); +} + +exports.default = { + createTableHtml: createTableHtml, + replaceTable: replaceTable, + focusToCell: focusToCell +}; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _tableDataHandler = __webpack_require__(6); + +var _tableDataHandler2 = _interopRequireDefault(_tableDataHandler); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Find unmerged table range. + * @param {Array.>} tableData - table data + * @param {jQuery} $start - start talbe cell jQuery element + * @param {jQuery} $end - end table cell jQuery element + * @returns {{ + * start: {rowIndex: number, colIndex: number}, + * end: {rowIndex: number, colIndex: number} + * }} + * @private + */ +function _findUnmergedRange(tableData, $start, $end) { + var cellIndexData = _tableDataHandler2.default.createCellIndexData(tableData); + var startCellIndex = _tableDataHandler2.default.findCellIndex(cellIndexData, $start); + var endCellIndex = _tableDataHandler2.default.findCellIndex(cellIndexData, $end); + var startRowIndex = void 0, + endRowIndex = void 0, + startColIndex = void 0, + endColIndex = void 0; + + if (startCellIndex.rowIndex > endCellIndex.rowIndex) { + startRowIndex = endCellIndex.rowIndex; + endRowIndex = startCellIndex.rowIndex; + } else { + startRowIndex = startCellIndex.rowIndex; + endRowIndex = endCellIndex.rowIndex; + } + + if (startCellIndex.colIndex > endCellIndex.colIndex) { + startColIndex = endCellIndex.colIndex; + endColIndex = startCellIndex.colIndex; + } else { + startColIndex = startCellIndex.colIndex; + endColIndex = endCellIndex.colIndex; + } + + return { + start: { + rowIndex: startRowIndex, + colIndex: startColIndex + }, + end: { + rowIndex: endRowIndex, + colIndex: endColIndex + } + }; +} + +/** + * Expand table range by row merge properties like rowspan, rowMergeWith. + * @param {Array.>} tableData - table data + * @param {{ + * start: {rowIndex: number, colIndex: number}, + * end: {rowIndex: number, colIndex: number} + * }} tableRange - table range + * @param {string} rangeType - range type like start, end + * @private + */ +/** +* @fileoverview Implements tableRangeHandler +* @author NHN FE Development Lab +*/ +function _expandRowMergedRange(tableData, tableRange, rangeType) { + var rowIndex = tableRange[rangeType].rowIndex; + + var rowData = tableData[rowIndex]; + + _tuiCodeSnippet2.default.range(tableRange.start.colIndex, tableRange.end.colIndex + 1).forEach(function (colIndex) { + var cellData = rowData[colIndex]; + var rowMergeWith = cellData.rowMergeWith; + + var lastRowMergedIndex = -1; + + if (_tuiCodeSnippet2.default.isExisty(rowMergeWith)) { + if (rowMergeWith < tableRange.start.rowIndex) { + tableRange.start.rowIndex = rowMergeWith; + } + + lastRowMergedIndex = rowMergeWith + tableData[rowMergeWith][colIndex].rowspan - 1; + } else if (cellData.rowspan > 1) { + lastRowMergedIndex = rowIndex + cellData.rowspan - 1; + } + + if (lastRowMergedIndex > tableRange.end.rowIndex) { + tableRange.end.rowIndex = lastRowMergedIndex; + } + }); +} + +/** + * Expand table range by column merge properties like colspan, colMergeWith. + * @param {Array.>} tableData - table data + * @param {{ + * start: {rowIndex: number, colIndex: number}, + * end: {rowIndex: number, colIndex: number} + * }} tableRange - table range + * @param {number} rowIndex - row index + * @param {number} colIndex - column index + * @private + */ +function _expandColMergedRange(tableData, tableRange, rowIndex, colIndex) { + var rowData = tableData[rowIndex]; + var cellData = rowData[colIndex]; + var colMergeWith = cellData.colMergeWith; + + var lastColMergedIndex = -1; + + if (_tuiCodeSnippet2.default.isExisty(colMergeWith)) { + if (colMergeWith < tableRange.start.colIndex) { + tableRange.start.colIndex = colMergeWith; + } + + lastColMergedIndex = colMergeWith + rowData[colMergeWith].colspan - 1; + } else if (cellData.colspan > 1) { + lastColMergedIndex = colIndex + cellData.colspan - 1; + } + + if (lastColMergedIndex > tableRange.end.colIndex) { + tableRange.end.colIndex = lastColMergedIndex; + } +} + +/** + * Expand table range by merge properties like colspan, rowspan. + * @param {Array.>} tableData - table data + * @param {{ + * start: {rowIndex: number, colIndex: number}, + * end: {rowIndex: number, colIndex: number} + * }} tableRange - table range + * @returns {{ + * start: {rowIndex: number, colIndex: number}, + * end: {rowIndex: number, colIndex: number} + * }} + * @private + */ +function _expandMergedRange(tableData, tableRange) { + var rangeStr = ''; + + while (rangeStr !== JSON.stringify(tableRange)) { + rangeStr = JSON.stringify(tableRange); + + _expandRowMergedRange(tableData, tableRange, 'start'); + _expandRowMergedRange(tableData, tableRange, 'end'); + + _tuiCodeSnippet2.default.range(tableRange.start.rowIndex, tableRange.end.rowIndex + 1).forEach(function (rowIndex) { + _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.start.colIndex); + _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.end.colIndex); + }); + } + + return tableRange; +} + +/** + * Find table range for selection. + * @param {Array.>} tableData - table data + * @param {jQuery} $start - start jQuery element + * @param {jQuery} $end - end jQuery element + * @returns {{ + * start: {rowIndex: number, colIndex: number}, + * end: {rowIndex: number, colIndex: number} + * }} + * @ignore + */ +function findSelectionRange(tableData, $start, $end) { + var unmergedRange = _findUnmergedRange(tableData, $start, $end); + + return _expandMergedRange(tableData, unmergedRange); +} + +/** + * Get table selection range. + * @param {Array.>} tableData - table data + * @param {jQuery} $selectedCells - selected cells jQuery elements + * @param {jQuery} $startContainer - start container jQuery element of text range + * @returns {{ + * start: {rowIndex: number, colIndex: number}, + * end: {rowIndex: number, colIndex: number} + *}} + * @ignore + */ +function getTableSelectionRange(tableData, $selectedCells, $startContainer) { + var cellIndexData = _tableDataHandler2.default.createCellIndexData(tableData); + var tableRange = {}; + + if ($selectedCells.length) { + var startRange = _tableDataHandler2.default.findCellIndex(cellIndexData, $selectedCells.first()); + var endRange = _tuiCodeSnippet2.default.extend({}, startRange); + + $selectedCells.each(function (index, cell) { + var cellIndex = _tableDataHandler2.default.findCellIndex(cellIndexData, (0, _jquery2.default)(cell)); + var cellData = tableData[cellIndex.rowIndex][cellIndex.colIndex]; + var lastRowMergedIndex = cellIndex.rowIndex + cellData.rowspan - 1; + var lastColMergedIndex = cellIndex.colIndex + cellData.colspan - 1; + + endRange.rowIndex = Math.max(endRange.rowIndex, lastRowMergedIndex); + endRange.colIndex = Math.max(endRange.colIndex, lastColMergedIndex); + }); + + tableRange.start = startRange; + tableRange.end = endRange; + } else { + var cellIndex = _tableDataHandler2.default.findCellIndex(cellIndexData, $startContainer); + + tableRange.start = cellIndex; + tableRange.end = _tuiCodeSnippet2.default.extend({}, cellIndex); + } + + return tableRange; +} + +exports.default = { + findSelectionRange: findSelectionRange, + getTableSelectionRange: getTableSelectionRange +}; + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__10__; + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + + + +/**/ + +var pna = __webpack_require__(19); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = __webpack_require__(16); +util.inherits = __webpack_require__(13); +/**/ + +var Readable = __webpack_require__(48); +var Writable = __webpack_require__(29); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements ui controller + * @author NHN FE Development Lab + */ + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _uiInstanceId = -1; + +/** + * get ui instance id + * @returns {number} - new instance id + * @ignore + */ +function makeUIInstanceId() { + _uiInstanceId += 1; + + return _uiInstanceId; +} + +/** + * Class UIController + * @param {Object} [options] - options + * @param {jQuery} [options.rootElement] - root element + * @param {string} [options.tagName] - tag name + * @param {string} [options.className] - class name + */ + +var UIController = function () { + + /** + * UI jQuery element + * @type {Object} + */ + + /** + * tag name + * @type {string} + */ + function UIController() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, UIController); + + options = _tuiCodeSnippet2.default.extend({ + tagName: 'div' + }, options); + + this.tagName = options.tagName; + + this.className = options.className; + + this._id = makeUIInstanceId(); + + this._setRootElement(options.rootElement); + } + + /** + * @param {string|object} aType - event name and selector string + * @param {function} aFn - event handler + */ + + + /** + * UI Id + * @type {number} + * @private + */ + + + /** + * ui controller class name + * @type {string} + */ + + + _createClass(UIController, [{ + key: 'on', + value: function on(aType, aFn) { + var _this = this; + + if (_tuiCodeSnippet2.default.isObject(aType)) { + _tuiCodeSnippet2.default.forEach(aType, function (fn, type) { + _this._addEvent(type, fn); + }); + } else { + this._addEvent(aType, aFn); + } + } + + /** + * bind event + * @param {string} type - event name and selector + * @param {function} fn - handler function + * @private + */ + + }, { + key: '_addEvent', + value: function _addEvent(type, fn) { + var _parseEventType2 = this._parseEventType(type), + event = _parseEventType2.event, + selector = _parseEventType2.selector; + + if (selector) { + this.$el.on(event, selector, fn); + } else { + this.$el.on(event, fn); + } + } + + /** + * unbind event handler + * @param {string} type - event name and selector + * @param {function} fn - handler function + */ + + }, { + key: 'off', + value: function off(type, fn) { + if (type) { + var _parseEventType3 = this._parseEventType(type), + event = _parseEventType3.event, + selector = _parseEventType3.selector; + + if (selector) { + this.$el.off(event, selector, fn); + } else { + this.$el.off(event, fn); + } + } else { + this.$el.off(); + } + } + + /** + * parse string into event name & selector + * 'click td' => ['click', 'td] + * @param {string} type - string to be parsed + * @returns {Object} event, selector + * @private + */ + + }, { + key: '_parseEventType', + value: function _parseEventType(type) { + var splitType = type.split(' '); + var event = splitType.shift(); + var selector = splitType.join(' '); + + return { + event: event, + selector: selector + }; + } + + /** + * set root element + * @param {jQuery} $el - root jQuery element + * @private + */ + + }, { + key: '_setRootElement', + value: function _setRootElement($el) { + var tagName = this.tagName; + var className = this.className; + + + if (!$el) { + className = className || 'uic' + this._id; + $el = (0, _jquery2.default)('<' + tagName + ' class="' + className + '"/>'); + } + this.$el = $el; + } + + /** + * trigger event + * @param {...object} args - event name & extra params + */ + + }, { + key: 'trigger', + value: function trigger() { + var _$el; + + (_$el = this.$el).trigger.apply(_$el, arguments); + } + }, { + key: '_getEventNameWithNamespace', + value: function _getEventNameWithNamespace(event) { + var eventSplited = event.split(' '); + eventSplited[0] += '.uicEvent' + this._id; + + return eventSplited.join(' '); + } + + /** + * remove + */ + + }, { + key: 'remove', + value: function remove() { + if (this.$el) { + this.$el.remove(); + } + } + + /** + * destroy + */ + + }, { + key: 'destroy', + value: function destroy() { + var _this2 = this; + + this.remove(); + + _tuiCodeSnippet2.default.forEachOwnProperties(this, function (value, key) { + _this2[key] = null; + }); + } + }]); + + return UIController; +}(); + +exports.default = UIController; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implement Module for managing import external data such as image + * @author NHN FE Development Lab + */ + + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var URLRegex = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/g; + +/** + * Class ImportManager + * @param {EventManager} eventManager - eventManager + * @ignore + */ + +var ImportManager = function () { + function ImportManager(eventManager) { + _classCallCheck(this, ImportManager); + + this.eventManager = eventManager; + + this._initEvent(); + this._initDefaultImageImporter(); + } + + /** + * graceful decode uri component + * @param {string} originalURI - string to be decoded + * @returns {string} decoded string + * @static + */ + + + _createClass(ImportManager, [{ + key: '_initEvent', + + + /** + * Initialize event handler + * @private + */ + value: function _initEvent() { + var _this = this; + + this.eventManager.listen('drop', function (ev) { + var items = ev.data.dataTransfer && ev.data.dataTransfer.files; + _this._processBlobItems(items, ev.data); + }); + + this.eventManager.listen('willPaste', function (ev) { + // IE has no interface to handle clipboard image. #976 + var fragment = ev.data.fragment; + var descendant = fragment.querySelectorAll('*'); + // only if paste event data has one img element and the element has base64 encoded image + if (descendant.length !== 1 || descendant[0].tagName !== 'IMG' || !/^data:image/.test(descendant[0].src)) { + return; + } + ev.data.preventDefault(); + + var blob = dataURItoBlob(descendant[0].src); + _this._emitAddImageBlobHook(blob, 'paste'); + }); + + this.eventManager.listen('paste', function (ev) { + _this._processClipboard(ev.data); + }); + + this.eventManager.listen('pasteBefore', function (ev) { + _this._decodeURL(ev); + }); + } + + /** + * Initialize default image importer + * @private + */ + + }, { + key: '_initDefaultImageImporter', + value: function _initDefaultImageImporter() { + this.eventManager.listen('addImageBlobHook', function (blob, callback) { + var reader = new FileReader(); + + reader.onload = function (event) { + callback(event.target.result); + }; + + reader.readAsDataURL(blob); + }); + } + + /** + * Emit add image blob hook + * @param {object} blob - blob or file + * @param {string} type - type of an event the item belongs to. paste or drop + * @private + */ + + }, { + key: '_emitAddImageBlobHook', + value: function _emitAddImageBlobHook(blob, type) { + var _this2 = this; + + this.eventManager.emit('addImageBlobHook', blob, function (imageUrl, altText) { + _this2.eventManager.emit('command', 'AddImage', { + imageUrl: imageUrl, + altText: altText || blob.name || 'image' + }); + }, type); + } + + /** + * Decode url when paste link + * @param {object} ev - event object + * @private + */ + + }, { + key: '_decodeURL', + value: function _decodeURL(ev) { + var decodeURIGraceful = ImportManager.decodeURIGraceful, + encodeMarkdownCharacters = ImportManager.encodeMarkdownCharacters; + + + if (ev.source === 'markdown' && ev.data.text) { + var texts = ev.data.text; + var text = texts[0]; + if (texts.length === 1 && text.match(URLRegex)) { + text = decodeURIGraceful(text); + text = encodeMarkdownCharacters(text); + ev.data.update(null, null, [text]); + } + } else if (ev.source === 'wysiwyg') { + var container = ev.$clipboardContainer.get(0); + var firstChild = container.childNodes[0]; + var _text = firstChild.innerText; + if (container.childNodes.length === 1 && firstChild.tagName === 'A' && _text.match(URLRegex)) { + firstChild.innerText = decodeURIGraceful(_text); + firstChild.href = encodeMarkdownCharacters(firstChild.href); + } + } + } + + /** + * Get blob or excel data from clipboard + * @param {object} evData Clipboard data + * @private + */ + + }, { + key: '_processClipboard', + value: function _processClipboard(evData) { + var cbData = evData.clipboardData || window.clipboardData; + var blobItems = cbData && cbData.items; + var types = cbData.types; + + + if (blobItems && types && types.length === 1 && _tuiCodeSnippet2.default.inArray('Files', [].slice.call(types)) !== -1) { + this._processBlobItems(blobItems, evData); + } + } + + /** + * Process for blob item + * @param {Array.} items Item array + * @param {object} evData Event data + * @private + */ + + }, { + key: '_processBlobItems', + value: function _processBlobItems(items, evData) { + var _this3 = this; + + if (items) { + _tuiCodeSnippet2.default.forEachArray(items, function (item) { + if (item.type.indexOf('image') !== -1) { + evData.preventDefault(); + evData.stopPropagation(); + evData.codemirrorIgnore = true; + + var blob = item.name ? item : item.getAsFile(); // Blob or File + _this3._emitAddImageBlobHook(blob, evData.type); + + return false; + } + + return true; + }); + } + } + }], [{ + key: 'decodeURIGraceful', + value: function decodeURIGraceful(originalURI) { + var uris = originalURI.split(' '); + var decodedURIs = []; + var decodedURI = void 0; + + _tuiCodeSnippet2.default.forEachArray(uris, function (uri) { + try { + decodedURI = decodeURIComponent(uri); + decodedURI = decodedURI.replace(/ /g, '%20'); + } catch (e) { + decodedURI = uri; + } + + return decodedURIs.push(decodedURI); + }); + + return decodedURIs.join(' '); + } + + /** + * encode markdown critical characters + * @param {string} text - string to encode + * @returns {string} - markdown character encoded string + * @static + */ + + }, { + key: 'encodeMarkdownCharacters', + value: function encodeMarkdownCharacters(text) { + return text.replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\[/g, '%5B').replace(/\]/g, '%5D').replace(//g, '%3E'); + } + + /** + * escape markdown critical characters + * @param {string} text - string to escape + * @returns {string} - markdown character escaped string + * @static + */ + + }, { + key: 'escapeMarkdownCharacters', + value: function escapeMarkdownCharacters(text) { + return text.replace(/\(/g, '\\(').replace(/\)/g, '\\)').replace(/\[/g, '\\[').replace(/\]/g, '\\]').replace(//g, '\\>'); + } + }]); + + return ImportManager; +}(); + +/** + * data URI to Blob + * @param {string} dataURI - data URI string + * @returns {Blob} - blob data + * @ignore + */ + + +function dataURItoBlob(dataURI) { + var byteString = atob(dataURI.split(',')[1]); + var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; + var ab = new ArrayBuffer(byteString.length); + var ia = new Uint8Array(ab); + for (var i = 0; i < byteString.length; i += 1) { + ia[i] = byteString.charCodeAt(i); + } + var blob = new Blob([ab], { type: mimeString }); + + return blob; +} + +exports.default = ImportManager; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(51).Buffer)) + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _uicontroller = __webpack_require__(14); + +var _uicontroller2 = _interopRequireDefault(_uicontroller); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements Toolbar Item + * @author NHN FE Development Lab + */ + + +/** + * Class ToolbarItem + * @param {Object} [options={name: 'toolbar-item'}] [description] + */ +var ToolbarItem = function (_UIController) { + _inherits(ToolbarItem, _UIController); + + /** + * item name + * @type {String} + * @static + * @private + */ + function ToolbarItem() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + name: ToolbarItem.name + }; + + _classCallCheck(this, ToolbarItem); + + var _this = _possibleConstructorReturn(this, (ToolbarItem.__proto__ || Object.getPrototypeOf(ToolbarItem)).call(this, _tuiCodeSnippet2.default.extend({ + className: ToolbarItem.className + }, options))); + + _this._name = options.name; + return _this; + } + + /** + * get the name of the toolbar item + * @returns {string} - the name of the toolbar item + */ + + + /** + * toolbar item class name + * @type {String} + * @static + * @private + */ + + + _createClass(ToolbarItem, [{ + key: 'getName', + value: function getName() { + return this._name; + } + }]); + + return ToolbarItem; +}(_uicontroller2.default); + +Object.defineProperty(ToolbarItem, 'name', { + enumerable: true, + writable: true, + value: 'item' +}); +Object.defineProperty(ToolbarItem, 'className', { + enumerable: true, + writable: true, + value: 'tui-toolbar-item' +}); +exports.default = ToolbarItem; + +/***/ }), +/* 18 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +if (typeof process === 'undefined' || + !process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = process +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} + + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(18))) + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +/* eslint-disable node/no-deprecated-api */ +var buffer = __webpack_require__(51) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _toolbarItem = __webpack_require__(17); + +var _toolbarItem2 = _interopRequireDefault(_toolbarItem); + +var _tooltip = __webpack_require__(31); + +var _tooltip2 = _interopRequireDefault(_tooltip); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements UI Button + * @author NHN FE Development Lab + */ + + +/** + * Class Button UI + * @param {object} options - button options + * @param {string} options.className - button class name + * @param {string} options.command - command name to execute on click + * @param {string} options.event - event name to trigger on click + * @param {string} options.text - text on button + * @param {string} options.tooltip - text on tooltip + * @param {string} options.style - button style + * @param {string} options.state - button state + * @param {jquery} $el - button rootElement + * @deprecated + */ +var Button = function (_ToolbarItem) { + _inherits(Button, _ToolbarItem); + + /** + * item name + * @type {String} + * @static + */ + function Button() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + tagName: 'button', + name: Button.name + }; + + _classCallCheck(this, Button); + + var _this = _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, { + name: options.name, + tagName: 'button', + className: options.className + ' ' + Button.className, + rootElement: options.$el + })); + + _this._setOptions(options); + + _this._render(); + _this.on('click', _this._onClick.bind(_this)); + if (options.tooltip) { + _this.on('mouseover', _this._onOver.bind(_this)); + _this.on('mouseout', _this._onOut.bind(_this)); + } + return _this; + } + + /** + * set tooltip text + * @param {string} text - tooltip text to show + */ + + + /** + * ToolbarItem className + * @type {String} + * @static + */ + + + _createClass(Button, [{ + key: 'setTooltip', + value: function setTooltip(text) { + this._tooltip = text; + } + }, { + key: '_setOptions', + value: function _setOptions(options) { + this._command = options.command; + this._event = options.event; + this._text = options.text; + this._tooltip = options.tooltip; + this._style = options.style; + this._state = options.state; + } + }, { + key: '_render', + value: function _render() { + this.$el.text(this._text); + this.$el.attr('type', 'button'); + + if (this._style) { + this.$el.attr('style', this._style); + } + } + }, { + key: '_onClick', + value: function _onClick() { + if (!this.isEnabled()) { + return; + } + + if (this._command) { + this.trigger('command', this._command); + } else if (this._event) { + this.trigger('event', this._event); + } + + this.trigger('clicked'); + } + }, { + key: '_onOver', + value: function _onOver() { + if (!this.isEnabled()) { + return; + } + + _tooltip2.default.show(this.$el, this._tooltip); + } + }, { + key: '_onOut', + value: function _onOut() { + _tooltip2.default.hide(); + } + + /** + * enable button + */ + + }, { + key: 'enable', + value: function enable() { + this.$el.attr('disabled', false); + } + + /** + * disable button + */ + + }, { + key: 'disable', + value: function disable() { + this.$el.attr('disabled', true); + } + + /** + * check whether this button is enabled + * @returns {Boolean} - true for enabled + */ + + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.$el.attr('disabled'); + } + }]); + + return Button; +}(_toolbarItem2.default); + +Object.defineProperty(Button, 'name', { + enumerable: true, + writable: true, + value: 'button' +}); +Object.defineProperty(Button, 'className', { + enumerable: true, + writable: true, + value: 'tui-toolbar-icons' +}); +exports.default = Button; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * @fileoverview Implements KeyMapper + * @author NHN FE Development Lab + */ + +/** + * Constant of key mapping + * @type {string[]} + * @ignore + */ +var KEYBOARD_MAP = ['', // [0] +'', // [1] +'', // [2] +'CANCEL', // [3] +'', // [4] +'', // [5] +'HELP', // [6] +'', // [7] +'BACK_SPACE', // [8] +'TAB', // [9] +'', // [10] +'', // [11] +'CLEAR', // [12] +'ENTER', // [13] +'ENTER_SPECIAL', // [14] +'', // [15] +'', // [16] SHIFT +'', // [17] CONTROL +'', // [18] ALT +'PAUSE', // [19] +'CAPS_LOCK', // [20] +'KANA', // [21] +'EISU', // [22] +'JUNJA', // [23] +'FINAL', // [24] +'HANJA', // [25] +'', // [26] +'ESCAPE', // [27] +'CONVERT', // [28] +'NONCONVERT', // [29] +'ACCEPT', // [30] +'MODECHANGE', // [31] +'SPACE', // [32] +'PAGE_UP', // [33] +'PAGE_DOWN', // [34] +'END', // [35] +'HOME', // [36] +'LEFT', // [37] +'UP', // [38] +'RIGHT', // [39] +'DOWN', // [40] +'SELECT', // [41] +'PRINT', // [42] +'EXECUTE', // [43] +'PRINTSCREEN', // [44] +'INSERT', // [45] +'DELETE', // [46] +'', // [47] +'0', // [48] +'1', // [49] +'2', // [50] +'3', // [51] +'4', // [52] +'5', // [53] +'6', // [54] +'7', // [55] +'8', // [56] +'9', // [57] +':', // [58] +';', // [59] +'<', // [60] +'=', // [61] +'>', // [62] +'?', // [63] +'AT', // [64] +'A', // [65] +'B', // [66] +'C', // [67] +'D', // [68] +'E', // [69] +'F', // [70] +'G', // [71] +'H', // [72] +'I', // [73] +'J', // [74] +'K', // [75] +'L', // [76] +'M', // [77] +'N', // [78] +'O', // [79] +'P', // [80] +'Q', // [81] +'R', // [82] +'S', // [83] +'T', // [84] +'U', // [85] +'V', // [86] +'W', // [87] +'X', // [88] +'Y', // [89] +'Z', // [90] +'', // [91] META +'', // [92] +'CONTEXT_MENU', // [93] +'', // [94] +'SLEEP', // [95] +'NUMPAD0', // [96] +'NUMPAD1', // [97] +'NUMPAD2', // [98] +'NUMPAD3', // [99] +'NUMPAD4', // [100] +'NUMPAD5', // [101] +'NUMPAD6', // [102] +'NUMPAD7', // [103] +'NUMPAD8', // [104] +'NUMPAD9', // [105] +'MULTIPLY', // [106] +'ADD', // [107] +'SEPARATOR', // [108] +'SUBTRACT', // [109] +'DECIMAL', // [110] +'DIVIDE', // [111] +'F1', // [112] +'F2', // [113] +'F3', // [114] +'F4', // [115] +'F5', // [116] +'F6', // [117] +'F7', // [118] +'F8', // [119] +'F9', // [120] +'F10', // [121] +'F11', // [122] +'F12', // [123] +'F13', // [124] +'F14', // [125] +'F15', // [126] +'F16', // [127] +'F17', // [128] +'F18', // [129] +'F19', // [130] +'F20', // [131] +'F21', // [132] +'F22', // [133] +'F23', // [134] +'F24', // [135] +'', // [136] +'', // [137] +'', // [138] +'', // [139] +'', // [140] +'', // [141] +'', // [142] +'', // [143] +'NUM_LOCK', // [144] +'SCROLL_LOCK', // [145] +'WIN_OEM_FJ_JISHO', // [146] +'WIN_OEM_FJ_MASSHOU', // [147] +'WIN_OEM_FJ_TOUROKU', // [148] +'WIN_OEM_FJ_LOYA', // [149] +'WIN_OEM_FJ_ROYA', // [150] +'', // [151] +'', // [152] +'', // [153] +'', // [154] +'', // [155] +'', // [156] +'', // [157] +'', // [158] +'', // [159] +'@', // [160] +'!', // [161] +'"', // [162] +'#', // [163] +'$', // [164] +'%', // [165] +'&', // [166] +'_', // [167] +'(', // [168] +')', // [169] +'*', // [170] +'+', // [171] +'|', // [172] +'-', // [173] +'{', // [174] +'}', // [175] +'~', // [176] +'', // [177] +'', // [178] +'', // [179] +'', // [180] +'VOLUME_MUTE', // [181] +'VOLUME_DOWN', // [182] +'VOLUME_UP', // [183] +'', // [184] +'', // [185] +';', // [186] +'=', // [187] +',', // [188] +'-', // [189] +'.', // [190] +'/', // [191] +'`', // [192] +'', // [193] +'', // [194] +'', // [195] +'', // [196] +'', // [197] +'', // [198] +'', // [199] +'', // [200] +'', // [201] +'', // [202] +'', // [203] +'', // [204] +'', // [205] +'', // [206] +'', // [207] +'', // [208] +'', // [209] +'', // [210] +'', // [211] +'', // [212] +'', // [213] +'', // [214] +'', // [215] +'', // [216] +'', // [217] +'', // [218] +'[', // [219] +'\\', // [220] +']', // [221] +'\'', // [222] +'', // [223] +'META', // [224] +'ALTGR', // [225] +'', // [226] +'WIN_ICO_HELP', // [227] +'WIN_ICO_00', // [228] +'', // [229] +'WIN_ICO_CLEAR', // [230] +'', // [231] +'', // [232] +'WIN_OEM_RESET', // [233] +'WIN_OEM_JUMP', // [234] +'WIN_OEM_PA1', // [235] +'WIN_OEM_PA2', // [236] +'WIN_OEM_PA3', // [237] +'WIN_OEM_WSCTRL', // [238] +'WIN_OEM_CUSEL', // [239] +'WIN_OEM_ATTN', // [240] +'WIN_OEM_FINISH', // [241] +'WIN_OEM_COPY', // [242] +'WIN_OEM_AUTO', // [243] +'WIN_OEM_ENLW', // [244] +'WIN_OEM_BACKTAB', // [245] +'ATTN', // [246] +'CRSEL', // [247] +'EXSEL', // [248] +'EREOF', // [249] +'PLAY', // [250] +'ZOOM', // [251] +'', // [252] +'PA1', // [253] +'WIN_OEM_CLEAR', // [254] +'' // [255] +]; + +var sharedInstance = void 0; + +/** + * Class KeyMapper + * @param {object} [options] options + * @param {string} options.splitter splitter string default is + + * @ignore + */ + +var KeyMapper = function () { + function KeyMapper(options) { + _classCallCheck(this, KeyMapper); + + this._setSplitter(options); + } + + /** + * Set key splitter + * @param {object} options Option object + * @private + */ + + + _createClass(KeyMapper, [{ + key: '_setSplitter', + value: function _setSplitter(options) { + var splitter = options ? options.splitter : '+'; + this._splitter = splitter; + } + + /** + * Convert event to keyMap + * @param {event} event Event object + * @returns {string} + */ + + }, { + key: 'convert', + value: function convert(event) { + var keyMap = []; + + if (event.shiftKey) { + keyMap.push('SHIFT'); + } + + if (event.ctrlKey) { + keyMap.push('CTRL'); + } + + if (event.metaKey) { + keyMap.push('META'); + } + + if (event.altKey) { + keyMap.push('ALT'); + } + + var keyChar = this._getKeyCodeChar(event.keyCode); + + if (keyChar) { + keyMap.push(keyChar); + } + + return keyMap.join(this._splitter); + } + + /** + * Get character from key code + * @param {number} keyCode Key code + * @returns {string} + * @private + */ + + }, { + key: '_getKeyCodeChar', + value: function _getKeyCodeChar(keyCode) { + var keyCodeCharacter = KEYBOARD_MAP[keyCode]; + + return keyCodeCharacter; + } + + /** + * Get sharedInstance + * @returns {KeyMapper} + */ + + }], [{ + key: 'getSharedInstance', + value: function getSharedInstance() { + if (!sharedInstance) { + sharedInstance = new KeyMapper(); + } + + return sharedInstance; + } + + /** + * get key code for a character + * @param {string} char - a character to be converted + * @returns {number} key code for the char + * @static + */ + + }, { + key: 'keyCode', + value: function keyCode(char) { + return KEYBOARD_MAP.indexOf(char); + } + }]); + + return KeyMapper; +}(); + +exports.default = KeyMapper; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @fileoverview Implements htmlSanitizer + * @author NHN FE Development Lab + */ +var HTML_ATTR_LIST_RX = new RegExp('^(abbr|align|alt|axis|bgcolor|border|cellpadding|cellspacing|class|clear|' + 'color|cols|compact|coords|dir|face|headers|height|hreflang|hspace|' + 'ismap|lang|language|nohref|nowrap|rel|rev|rows|rules|' + 'scope|scrolling|shape|size|span|start|summary|tabindex|target|title|type|' + 'valign|value|vspace|width|checked|mathvariant|encoding|id|name|' + 'background|cite|href|longdesc|src|usemap|xlink:href|data-+|checked|style)', 'g'); + +var SVG_ATTR_LIST_RX = new RegExp('^(accent-height|accumulate|additive|alphabetic|arabic-form|ascent|' + 'baseProfile|bbox|begin|by|calcMode|cap-height|class|color|color-rendering|content|' + 'cx|cy|d|dx|dy|descent|display|dur|end|fill|fill-rule|font-family|font-size|font-stretch|' + 'font-style|font-variant|font-weight|from|fx|fy|g1|g2|glyph-name|gradientUnits|hanging|' + 'height|horiz-adv-x|horiz-origin-x|ideographic|k|keyPoints|keySplines|keyTimes|lang|' + 'marker-end|marker-mid|marker-start|markerHeight|markerUnits|markerWidth|mathematical|' + 'max|min|offset|opacity|orient|origin|overline-position|overline-thickness|panose-1|' + 'path|pathLength|points|preserveAspectRatio|r|refX|refY|repeatCount|repeatDur|' + 'requiredExtensions|requiredFeatures|restart|rotate|rx|ry|slope|stemh|stemv|stop-color|' + 'stop-opacity|strikethrough-position|strikethrough-thickness|stroke|stroke-dasharray|' + 'stroke-dashoffset|stroke-linecap|stroke-linejoin|stroke-miterlimit|stroke-opacity|' + 'stroke-width|systemLanguage|target|text-anchor|to|transform|type|u1|u2|underline-position|' + 'underline-thickness|unicode|unicode-range|units-per-em|values|version|viewBox|visibility|' + 'width|widths|x|x-height|x1|x2|xlink:actuate|xlink:arcrole|xlink:role|xlink:show|xlink:title|' + 'xlink:type|xml:base|xml:lang|xml:space|xmlns|xmlns:xlink|y|y1|y2|zoomAndPan)', 'g'); + +var ATTR_VALUE_BLACK_LIST_RX = { + 'href': /^(javascript:).*/g +}; + +/** + * htmlSanitizer + * @param {string|Node} html html or Node + * @param {boolean} [needHtmlText] pass true if need html text + * @returns {string|DocumentFragment} result + * @ignore + */ +function htmlSanitizer(html, needHtmlText) { + var $html = (0, _jquery2.default)('
    '); + + html = html.replace(//g, ''); + + $html.append(html); + + removeUnnecessaryTags($html); + leaveOnlyWhitelistAttribute($html); + removeInvalidAttributeValues($html); + + return finalizeHtml($html, needHtmlText); +} + +/** + * Remove unnecessary tags + * @private + * @param {jQuery} $html jQuery instance + */ +function removeUnnecessaryTags($html) { + $html.find('script, iframe, textarea, form, button, select, meta, style, link, title, embed, object, details, summary').remove(); +} + +/** + * Leave only white list attributes + * @private + * @param {jQuery} $html jQuery instance + */ +function leaveOnlyWhitelistAttribute($html) { + $html.find('*').each(function (index, node) { + var attrs = node.attributes; + var blacklist = _tuiCodeSnippet2.default.toArray(attrs).filter(function (attr) { + var isHTMLAttr = attr.name.match(HTML_ATTR_LIST_RX); + var isSVGAttr = attr.name.match(SVG_ATTR_LIST_RX); + + return !isHTMLAttr && !isSVGAttr; + }); + + _tuiCodeSnippet2.default.forEachArray(blacklist, function (attr) { + // Edge svg attribute name returns uppercase bug. error guard. + // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5579311/ + if (attrs.getNamedItem(attr.name)) { + attrs.removeNamedItem(attr.name); + } + }); + }); +} + +/** + * Remove invalid attribute values + * @private + * @param {jQuery} $html jQuery instance + */ +function removeInvalidAttributeValues($html) { + var _loop = function _loop(attr) { + if (ATTR_VALUE_BLACK_LIST_RX.hasOwnProperty(attr)) { + $html.find('[' + attr + ']').each(function (index, node) { + var attrs = node.attributes; + var valueBlackListRX = ATTR_VALUE_BLACK_LIST_RX[attr]; + var attrItem = attrs.getNamedItem(attr); + if (valueBlackListRX && attrItem && attrItem.value.toLowerCase().match(valueBlackListRX)) { + attrs.removeNamedItem(attr); + } + }); + } + }; + + for (var attr in ATTR_VALUE_BLACK_LIST_RX) { + _loop(attr); + } +} + +/** + * Finalize html result + * @private + * @param {jQuery} $html jQuery instance + * @param {boolean} needHtmlText pass true if need html text + * @returns {string|DocumentFragment} result + */ +function finalizeHtml($html, needHtmlText) { + var returnValue = void 0; + + if (needHtmlText) { + returnValue = $html[0].innerHTML; + } else { + var frag = document.createDocumentFragment(); + var childNodes = _tuiCodeSnippet2.default.toArray($html[0].childNodes); + var length = childNodes.length; + + + for (var i = 0; i < length; i += 1) { + frag.appendChild(childNodes[i]); + } + returnValue = frag; + } + + return returnValue; +} + +exports.default = htmlSanitizer; + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__24__; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.CodeBlockManager = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements CodeBlockManager + * @author NHN FE Development Lab + */ + + +var _highlight = __webpack_require__(94); + +var _highlight2 = _interopRequireDefault(_highlight); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Class Code Block Manager + */ +var CodeBlockManager = function () { + function CodeBlockManager() { + _classCallCheck(this, CodeBlockManager); + + this._replacers = {}; + } + + /** + * Set replacer for code block + * @param {string} language - code block language + * @param {function} replacer - replacer function to code block element + */ + + + _createClass(CodeBlockManager, [{ + key: 'setReplacer', + value: function setReplacer(language, replacer) { + this._replacers[language] = replacer; + } + + /** + * get replacer for code block + * @param {string} language - code block type + * @returns {function} - replacer function + */ + + }, { + key: 'getReplacer', + value: function getReplacer(language) { + return this._replacers[language]; + } + + /** + * Create code block html. + * @param {string} language - code block language + * @param {string} codeText - code text + * @returns {string} + */ + + }, { + key: 'createCodeBlockHtml', + value: function createCodeBlockHtml(language, codeText) { + var replacer = this.getReplacer(language); + var html = void 0; + + if (replacer) { + html = replacer(codeText, language); + } else { + html = _highlight2.default.getLanguage(language) ? _highlight2.default.highlight(language, codeText).value : escape(codeText, false); + } + + return html; + } + + /** + * get supported languages by highlight-js + * @returns {Array} - supported languages by highlight-js + */ + + }], [{ + key: 'getHighlightJSLanguages', + value: function getHighlightJSLanguages() { + return _highlight2.default.listLanguages(); + } + }]); + + return CodeBlockManager; +}(); + +/** + * escape code from markdown-it + * @param {string} html HTML string + * @param {string} encode Boolean value of whether encode or not + * @returns {string} + * @ignore + */ + + +function escape(html, encode) { + return html.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); +} + +exports.CodeBlockManager = CodeBlockManager; +exports.default = new CodeBlockManager(); + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * @fileoverview This file is common logic for italic, bold, strike makrdown commands. + * @author NHN FE Development Lab + */ + +/** + * range expand according to expendSize + * If can not expand, return null + * @param {range} range - range + * @param {number} expendSize - expendSize + * @returns {object} expanded range or null + * @ignore + */ +var getExpandedRange = function getExpandedRange(range, expendSize) { + var start = range.start, + end = range.end; + + var expendRange = void 0; + + if (start.ch >= expendSize) { + var from = { + line: start.line, + ch: start.ch - expendSize + }; + var to = { + line: end.line, + ch: end.ch + expendSize + }; + + expendRange = { + from: from, + to: to + }; + } + + return expendRange; +}; + +/** + * remove symbol in the front and back of text + * @param {string} text - text + * @param {string} symbol - text + * @returns {string} + * @ignore + */ +var removeSyntax = exports.removeSyntax = function removeSyntax(text, symbol) { + var symbolLength = symbol.length; + + return text.substr(symbolLength, text.length - symbolLength * 2); +}; + +/** + * append symbol in the front and back of text + * @param {string} text - text + * @param {string} symbol - text + * @returns {string} + * @ignore + */ +var appendSyntax = exports.appendSyntax = function appendSyntax(text, symbol) { + return '' + symbol + text + symbol; +}; + +/** + * check expanded text and replace text using replacer + * @param {CodeMirror.doc} doc - doc of codemirror + * @param {range} range - origin range + * @param {number} expandSize - expandSize + * @param {function} checker - sytax check function + * @param {function} replacer - text replace function + * @returns {boolean} - if replace text, return true. + * @ignore + */ +var expandReplace = exports.expandReplace = function expandReplace(doc, range, expandSize, checker, replacer) { + var expendRange = getExpandedRange(range, expandSize); + var result = false; + + if (expendRange) { + var from = expendRange.from, + to = expendRange.to; + + var expendRangeText = doc.getRange(from, to); + if (checker(expendRangeText)) { + doc.setSelection(from, to); + doc.replaceSelection(replacer(expendRangeText), 'around'); + result = true; + } + } + + return result; +}; + +/** + * check text and replace text using replacer + * @param {CodeMirror.doc} doc - doc of codemirror + * @param {string} text - text + * @param {function} checker - sytax check function + * @param {function} replacer - text replace function + * @returns {boolean} - if replace text, return true. + * @ignore + */ +var replace = exports.replace = function replace(doc, text, checker, replacer) { + var result = false; + + if (checker(text)) { + doc.replaceSelection(replacer(text), 'around'); + result = true; + } + + return result; +}; + +var changeSyntax = exports.changeSyntax = function changeSyntax(doc, range, symbol, syntaxRegex, contentRegex) { + var _doc$getCursor = doc.getCursor(), + line = _doc$getCursor.line, + ch = _doc$getCursor.ch; + + var selectionStr = doc.getSelection(); + var symbolLength = symbol.length; + var isSyntax = function isSyntax(t) { + return syntaxRegex.test(t); + }; + + // 1. expand text and check syntax => remove syntax + // 2. check text is syntax => remove syntax + // 3. If text does not match syntax, remove syntax inside text and then append syntax + if (!(expandReplace(doc, range, symbolLength, isSyntax, function (t) { + return removeSyntax(t, symbol); + }) || replace(doc, selectionStr, isSyntax, function (t) { + return removeSyntax(t, symbol); + }))) { + var removeSyntaxInsideText = selectionStr.replace(contentRegex, '$1'); + doc.replaceSelection(appendSyntax(removeSyntaxInsideText, symbol), 'around'); + } + + var afterSelectStr = doc.getSelection(); + var size = ch; + + if (!selectionStr) { + // If text was not selected, after replace text, move cursor + // For example **|** => | (move cusor -symbolLenth) + if (isSyntax(afterSelectStr)) { + size += symbolLength; + } else { + size -= symbolLength; + } + doc.setCursor(line, size); + } +}; + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +var R = typeof Reflect === 'object' ? Reflect : null +var ReflectApply = R && typeof R.apply === 'function' + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + } + +var ReflectOwnKeys +if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys +} else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target) + .concat(Object.getOwnPropertySymbols(target)); + }; +} else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; +} + +function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); +} + +var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { + return value !== value; +} + +function EventEmitter() { + EventEmitter.init.call(this); +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._eventsCount = 0; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +var defaultMaxListeners = 10; + +Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); + } + defaultMaxListeners = arg; + } +}); + +EventEmitter.init = function() { + + if (this._events === undefined || + this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; +}; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + } + this._maxListeners = n; + return this; +}; + +function $getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; +} + +EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return $getMaxListeners(this); +}; + +EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = (type === 'error'); + + var events = this._events; + if (events !== undefined) + doError = (doError && events.error === undefined); + else if (!doError) + return false; + + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; // Unhandled 'error' event + } + + var handler = events[type]; + + if (handler === undefined) + return false; + + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } + + return true; +}; + +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + // Check for listener leak + m = $getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' ' + String(type) + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + + return target; +} + +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + +function onceWrapper() { + var args = []; + for (var i = 0; i < arguments.length; i++) args.push(arguments[i]); + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + ReflectApply(this.listener, this.target, args); + } +} + +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} + +EventEmitter.prototype.once = function once(type, listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + this.on(type, _onceWrap(this, type, listener)); + return this; +}; + +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + + events = this._events; + if (events === undefined) + return this; + + list = events[type]; + if (list === undefined) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (events === undefined) + return this; + + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + +function _listeners(target, type, unwrap) { + var events = target._events; + + if (events === undefined) + return []; + + var evlistener = events[type]; + if (evlistener === undefined) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? + unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} + +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; + +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; + +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } +}; + +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; + + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } + + return 0; +} + +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +}; + +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} + +function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); +} + +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; +} + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(48); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = __webpack_require__(29); +exports.Duplex = __webpack_require__(12); +exports.Transform = __webpack_require__(54); +exports.PassThrough = __webpack_require__(182); + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + + + +/**/ + +var pna = __webpack_require__(19); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = __webpack_require__(16); +util.inherits = __webpack_require__(13); +/**/ + +/**/ +var internalUtil = { + deprecate: __webpack_require__(181) +}; +/**/ + +/**/ +var Stream = __webpack_require__(50); +/**/ + +/**/ + +var Buffer = __webpack_require__(20).Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = __webpack_require__(52); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || __webpack_require__(12); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || __webpack_require__(12); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(18), __webpack_require__(179).setImmediate, __webpack_require__(11))) + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements Editor + * @author NHN FE Development Lab + */ + + +// markdown commands + + +// wysiwyg Commands + + +// langs + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _button = __webpack_require__(21); + +var _button2 = _interopRequireDefault(_button); + +var _markdownEditor = __webpack_require__(58); + +var _markdownEditor2 = _interopRequireDefault(_markdownEditor); + +var _mdPreview = __webpack_require__(34); + +var _mdPreview2 = _interopRequireDefault(_mdPreview); + +var _wysiwygEditor = __webpack_require__(69); + +var _wysiwygEditor2 = _interopRequireDefault(_wysiwygEditor); + +var _layout = __webpack_require__(83); + +var _layout2 = _interopRequireDefault(_layout); + +var _eventManager = __webpack_require__(40); + +var _eventManager2 = _interopRequireDefault(_eventManager); + +var _commandManager2 = __webpack_require__(2); + +var _commandManager3 = _interopRequireDefault(_commandManager2); + +var _extManager = __webpack_require__(41); + +var _extManager2 = _interopRequireDefault(_extManager); + +var _importManager = __webpack_require__(15); + +var _importManager2 = _interopRequireDefault(_importManager); + +var _wwCodeBlockManager = __webpack_require__(38); + +var _wwCodeBlockManager2 = _interopRequireDefault(_wwCodeBlockManager); + +var _convertor = __webpack_require__(42); + +var _convertor2 = _interopRequireDefault(_convertor); + +var _viewer = __webpack_require__(95); + +var _viewer2 = _interopRequireDefault(_viewer); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +var _defaultUI = __webpack_require__(96); + +var _defaultUI2 = _interopRequireDefault(_defaultUI); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +var _wwTableManager = __webpack_require__(36); + +var _wwTableManager2 = _interopRequireDefault(_wwTableManager); + +var _wwTableSelectionManager = __webpack_require__(37); + +var _wwTableSelectionManager2 = _interopRequireDefault(_wwTableSelectionManager); + +var _codeBlockManager = __webpack_require__(25); + +var _codeBlockManager2 = _interopRequireDefault(_codeBlockManager); + +var _toMarkRenderer = __webpack_require__(113); + +var _toMarkRenderer2 = _interopRequireDefault(_toMarkRenderer); + +var _bold = __webpack_require__(114); + +var _bold2 = _interopRequireDefault(_bold); + +var _italic = __webpack_require__(115); + +var _italic2 = _interopRequireDefault(_italic); + +var _strike = __webpack_require__(116); + +var _strike2 = _interopRequireDefault(_strike); + +var _blockquote = __webpack_require__(117); + +var _blockquote2 = _interopRequireDefault(_blockquote); + +var _heading = __webpack_require__(118); + +var _heading2 = _interopRequireDefault(_heading); + +var _paragraph = __webpack_require__(119); + +var _paragraph2 = _interopRequireDefault(_paragraph); + +var _hr = __webpack_require__(120); + +var _hr2 = _interopRequireDefault(_hr); + +var _addLink = __webpack_require__(121); + +var _addLink2 = _interopRequireDefault(_addLink); + +var _addImage = __webpack_require__(122); + +var _addImage2 = _interopRequireDefault(_addImage); + +var _ul = __webpack_require__(123); + +var _ul2 = _interopRequireDefault(_ul); + +var _ol = __webpack_require__(124); + +var _ol2 = _interopRequireDefault(_ol); + +var _indent = __webpack_require__(125); + +var _indent2 = _interopRequireDefault(_indent); + +var _outdent = __webpack_require__(126); + +var _outdent2 = _interopRequireDefault(_outdent); + +var _table = __webpack_require__(127); + +var _table2 = _interopRequireDefault(_table); + +var _task = __webpack_require__(128); + +var _task2 = _interopRequireDefault(_task); + +var _code = __webpack_require__(129); + +var _code2 = _interopRequireDefault(_code); + +var _codeBlock = __webpack_require__(130); + +var _codeBlock2 = _interopRequireDefault(_codeBlock); + +var _bold3 = __webpack_require__(131); + +var _bold4 = _interopRequireDefault(_bold3); + +var _italic3 = __webpack_require__(132); + +var _italic4 = _interopRequireDefault(_italic3); + +var _strike3 = __webpack_require__(133); + +var _strike4 = _interopRequireDefault(_strike3); + +var _blockquote3 = __webpack_require__(134); + +var _blockquote4 = _interopRequireDefault(_blockquote3); + +var _addImage3 = __webpack_require__(135); + +var _addImage4 = _interopRequireDefault(_addImage3); + +var _addLink3 = __webpack_require__(136); + +var _addLink4 = _interopRequireDefault(_addLink3); + +var _hr3 = __webpack_require__(137); + +var _hr4 = _interopRequireDefault(_hr3); + +var _heading3 = __webpack_require__(138); + +var _heading4 = _interopRequireDefault(_heading3); + +var _paragraph3 = __webpack_require__(139); + +var _paragraph4 = _interopRequireDefault(_paragraph3); + +var _ul3 = __webpack_require__(140); + +var _ul4 = _interopRequireDefault(_ul3); + +var _ol3 = __webpack_require__(141); + +var _ol4 = _interopRequireDefault(_ol3); + +var _table3 = __webpack_require__(142); + +var _table4 = _interopRequireDefault(_table3); + +var _tableAddRow = __webpack_require__(143); + +var _tableAddRow2 = _interopRequireDefault(_tableAddRow); + +var _tableAddCol = __webpack_require__(144); + +var _tableAddCol2 = _interopRequireDefault(_tableAddCol); + +var _tableRemoveRow = __webpack_require__(145); + +var _tableRemoveRow2 = _interopRequireDefault(_tableRemoveRow); + +var _tableRemoveCol = __webpack_require__(146); + +var _tableRemoveCol2 = _interopRequireDefault(_tableRemoveCol); + +var _tableAlignCol = __webpack_require__(147); + +var _tableAlignCol2 = _interopRequireDefault(_tableAlignCol); + +var _tableRemove = __webpack_require__(148); + +var _tableRemove2 = _interopRequireDefault(_tableRemove); + +var _indent3 = __webpack_require__(149); + +var _indent4 = _interopRequireDefault(_indent3); + +var _outdent3 = __webpack_require__(150); + +var _outdent4 = _interopRequireDefault(_outdent3); + +var _task3 = __webpack_require__(151); + +var _task4 = _interopRequireDefault(_task3); + +var _code3 = __webpack_require__(152); + +var _code4 = _interopRequireDefault(_code3); + +var _codeBlock3 = __webpack_require__(153); + +var _codeBlock4 = _interopRequireDefault(_codeBlock3); + +__webpack_require__(154); + +__webpack_require__(155); + +__webpack_require__(156); + +__webpack_require__(157); + +__webpack_require__(158); + +__webpack_require__(159); + +__webpack_require__(160); + +__webpack_require__(161); + +__webpack_require__(162); + +__webpack_require__(163); + +__webpack_require__(164); + +__webpack_require__(165); + +__webpack_require__(166); + +__webpack_require__(167); + +__webpack_require__(168); + +__webpack_require__(169); + +__webpack_require__(170); + +__webpack_require__(171); + +__webpack_require__(172); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var __nedInstance = []; +var gaTrackingId = 'UA-129966929-1'; + +var availableLinkAttributes = ['rel', 'target', 'contenteditable', 'hreflang', 'type']; + +/** + * @callback addImageBlobHook + * @param {File|Blob} fileOrBlob - image blob + * @param {callback} callback - callback function to be called after + * @param {string} source - source of an event the item belongs to. 'paste', 'drop', 'ui' + */ + +/** + * ToastUI Editor + * @param {object} options Option object + * @param {HTMLElement} options.el - container element + * @param {string} [options.height='300px'] - Editor's height style value. Height is applied as border-box ex) '300px', '100%', 'auto' + * @param {string} [options.minHeight='200px'] - Editor's min-height style value in pixel ex) '300px' + * @param {string} [options.initialValue] - Editor's initial value + * @param {string} [options.previewStyle] - Markdown editor's preview style (tab, vertical) + * @param {string} [options.initialEditType] - Initial editor type (markdown, wysiwyg) + * @param {object[]} [options.events] - eventlist Event list + * @param {function} options.events.load - It would be emitted when editor fully load + * @param {function} options.events.change - It would be emitted when content changed + * @param {function} options.events.stateChange - It would be emitted when format change by cursor position + * @param {function} options.events.focus - It would be emitted when editor get focus + * @param {function} options.events.blur - It would be emitted when editor loose focus + * @param {object[]} [options.hooks] - Hook list + * @param {function} options.hooks.previewBeforeHook - Submit preview to hook URL before preview be shown + * @param {addImageBlobHook} options.hooks.addImageBlobHook - hook for image upload. + * @param {string} [options.language='en_US'] - language + * @param {boolean} [options.useCommandShortcut=true] - whether use keyboard shortcuts to perform commands + * @param {boolean} [options.useDefaultHTMLSanitizer=true] - use default htmlSanitizer + * @param {string[]} [options.codeBlockLanguages] - supported code block languages to be listed. default is what highlight.js supports + * @param {boolean} [options.usageStatistics=true] - send hostname to google analytics + * @param {string[]} [options.toolbarItems] - toolbar items. + * @param {boolean} [options.hideModeSwitch=false] - hide mode switch tab bar + * @param {string[]} [options.exts] - extensions + * @param {object} [options.customConvertor] - convertor extention + * @param {string} [options.placeholder] - The placeholder text of the editable element. + * @param {string} [options.previewDelayTime] - the delay time for rendering preview + * @param {object} [options.linkAttribute] - Attributes of anchor element that shold be rel, target, contenteditable, hreflang, type + */ + +var ToastUIEditor = function () { + function ToastUIEditor(options) { + var _this = this; + + _classCallCheck(this, ToastUIEditor); + + this.initialHtml = options.el.innerHTML; + options.el.innerHTML = ''; + + this.options = _jquery2.default.extend({ + previewStyle: 'tab', + initialEditType: 'markdown', + height: '300px', + minHeight: '200px', + language: 'en_US', + useDefaultHTMLSanitizer: true, + useCommandShortcut: true, + codeBlockLanguages: _codeBlockManager.CodeBlockManager.getHighlightJSLanguages(), + usageStatistics: true, + toolbarItems: ['heading', 'bold', 'italic', 'strike', 'divider', 'hr', 'quote', 'divider', 'ul', 'ol', 'task', 'indent', 'outdent', 'divider', 'table', 'image', 'link', 'divider', 'code', 'codeblock'], + hideModeSwitch: false, + customConvertor: null + }, options); + + this.eventManager = new _eventManager2.default(); + + this.importManager = new _importManager2.default(this.eventManager); + + this.commandManager = new _commandManager3.default(this, { + useCommandShortcut: this.options.useCommandShortcut + }); + + if (this.options.customConvertor) { + // eslint-disable-next-line new-cap + this.convertor = new this.options.customConvertor(this.eventManager); + } else { + this.convertor = new _convertor2.default(this.eventManager); + } + + if (this.options.useDefaultHTMLSanitizer) { + this.convertor.initHtmlSanitizer(); + } + + if (this.options.hooks) { + _tuiCodeSnippet2.default.forEach(this.options.hooks, function (fn, key) { + return _this.addHook(key, fn); + }); + } + + if (this.options.events) { + _tuiCodeSnippet2.default.forEach(this.options.events, function (fn, key) { + return _this.on(key, fn); + }); + } + + this.layout = new _layout2.default(options, this.eventManager); + + this.i18n = _i18n2.default; + this.i18n.setCode(this.options.language); + + this.setUI(this.options.UI || new _defaultUI2.default(this)); + + this.mdEditor = _markdownEditor2.default.factory(this.layout.getMdEditorContainerEl(), this.eventManager, this.options); + this.preview = new _mdPreview2.default(this.layout.getPreviewEl(), this.eventManager, this.convertor, false, this.options.previewDelayTime); + this.wwEditor = _wysiwygEditor2.default.factory(this.layout.getWwEditorContainerEl(), this.eventManager, { + useDefaultHTMLSanitizer: this.options.useDefaultHTMLSanitizer + }); + this.toMarkOptions = { + gfm: true, + renderer: _toMarkRenderer2.default + }; + + if (this.options.linkAttribute) { + var attribute = this._sanitizeLinkAttribute(this.options.linkAttribute); + + this.convertor.setLinkAttribute(attribute); + this.wwEditor.setLinkAttribute(attribute); + } + + this.changePreviewStyle(this.options.previewStyle); + + this.changeMode(this.options.initialEditType, true); + + this.minHeight(this.options.minHeight); + + this.height(this.options.height); + + this.setValue(this.options.initialValue, false); + + if (this.options.placeholder) { + this.setPlaceholder(this.options.placeholder); + } + + if (!this.options.initialValue) { + this.setHtml(this.initialHtml, false); + } + + _extManager2.default.applyExtension(this, this.options.exts); + + this.eventManager.emit('load', this); + + __nedInstance.push(this); + + this._addDefaultCommands(); + + if (this.options.usageStatistics) { + _tuiCodeSnippet2.default.sendHostname('editor', gaTrackingId); + } + } + + /** + * sanitize attribute for link + * @param {object} attribute - attribute for link + * @returns {object} sanitized attribute + * @private + */ + + + _createClass(ToastUIEditor, [{ + key: '_sanitizeLinkAttribute', + value: function _sanitizeLinkAttribute(attribute) { + var linkAttribute = {}; + + availableLinkAttributes.forEach(function (key) { + if (!_tuiCodeSnippet2.default.isUndefined(attribute[key])) { + linkAttribute[key] = attribute[key]; + } + }); + + return linkAttribute; + } + + /** + * change preview style + * @param {string} style - 'tab'|'vertical' + */ + + }, { + key: 'changePreviewStyle', + value: function changePreviewStyle(style) { + this.layout.changePreviewStyle(style); + this.mdPreviewStyle = style; + this.eventManager.emit('changePreviewStyle', style); + this.eventManager.emit('previewNeedsRefresh'); + } + + /** + * call commandManager's exec method + * @param {*} ...args Command argument + */ + + }, { + key: 'exec', + value: function exec() { + var _commandManager; + + (_commandManager = this.commandManager).exec.apply(_commandManager, arguments); + } + + /** + * add default commands + * @private + */ + + }, { + key: '_addDefaultCommands', + value: function _addDefaultCommands() { + this.addCommand(_bold2.default); + this.addCommand(_italic2.default); + this.addCommand(_blockquote2.default); + this.addCommand(_heading2.default); + this.addCommand(_paragraph2.default); + this.addCommand(_hr2.default); + this.addCommand(_addLink2.default); + this.addCommand(_addImage2.default); + this.addCommand(_ul2.default); + this.addCommand(_ol2.default); + this.addCommand(_indent2.default); + this.addCommand(_outdent2.default); + this.addCommand(_table2.default); + this.addCommand(_task2.default); + this.addCommand(_code2.default); + this.addCommand(_codeBlock2.default); + this.addCommand(_strike2.default); + + this.addCommand(_bold4.default); + this.addCommand(_italic4.default); + this.addCommand(_blockquote4.default); + this.addCommand(_ul4.default); + this.addCommand(_ol4.default); + this.addCommand(_addImage4.default); + this.addCommand(_addLink4.default); + this.addCommand(_hr4.default); + this.addCommand(_heading4.default); + this.addCommand(_paragraph4.default); + this.addCommand(_indent4.default); + this.addCommand(_outdent4.default); + this.addCommand(_task4.default); + this.addCommand(_table4.default); + this.addCommand(_tableAddRow2.default); + this.addCommand(_tableAddCol2.default); + this.addCommand(_tableRemoveRow2.default); + this.addCommand(_tableRemoveCol2.default); + this.addCommand(_tableAlignCol2.default); + this.addCommand(_tableRemove2.default); + this.addCommand(_code4.default); + this.addCommand(_codeBlock4.default); + this.addCommand(_strike4.default); + } + }, { + key: 'addCommand', + value: function addCommand(type, props) { + if (!props) { + this.commandManager.addCommand(type); + } else { + this.commandManager.addCommand(_commandManager3.default.command(type, props)); + } + } + + /** + * After added command. + */ + + }, { + key: 'afterAddedCommand', + value: function afterAddedCommand() { + this.eventManager.emit('afterAddedCommand', this); + } + + /** + * Bind eventHandler to event type + * @param {string} type Event type + * @param {function} handler Event handler + */ + + }, { + key: 'on', + value: function on(type, handler) { + this.eventManager.listen(type, handler); + } + + /** + * Unbind eventHandler from event type + * @param {string} type Event type + */ + + }, { + key: 'off', + value: function off(type) { + this.eventManager.removeEventHandler(type); + } + + /** + * Add hook to TUIEditor event + * @param {string} type Event type + * @param {function} handler Event handler + */ + + }, { + key: 'addHook', + value: function addHook(type, handler) { + this.eventManager.removeEventHandler(type); + this.eventManager.listen(type, handler); + } + + /** + * Remove hook from TUIEditor event + * @param {string} type Event type + */ + + }, { + key: 'removeHook', + value: function removeHook(type) { + this.eventManager.removeEventHandler(type); + } + + /** + * Get CodeMirror instance + * @returns {CodeMirror} + */ + + }, { + key: 'getCodeMirror', + value: function getCodeMirror() { + return this.mdEditor.getEditor(); + } + + /** + * Get SquireExt instance + * @returns {SquireExt} + */ + + }, { + key: 'getSquire', + value: function getSquire() { + return this.wwEditor.getEditor(); + } + + /** + * Set focus to current Editor + */ + + }, { + key: 'focus', + value: function focus() { + this.getCurrentModeEditor().focus(); + } + + /** + * Remove focus of current Editor + */ + + }, { + key: 'blur', + value: function blur() { + this.getCurrentModeEditor().blur(); + } + + /** + * Set cursor position to end + */ + + }, { + key: 'moveCursorToEnd', + value: function moveCursorToEnd() { + this.getCurrentModeEditor().moveCursorToEnd(); + } + + /** + * Set cursor position to start + */ + + }, { + key: 'moveCursorToStart', + value: function moveCursorToStart() { + this.getCurrentModeEditor().moveCursorToStart(); + } + + /** + * Set markdown syntax text. + * @param {string} markdown - markdown syntax text. + * @param {boolean} [cursorToEnd=true] - move cursor to contents end + */ + + }, { + key: 'setMarkdown', + value: function setMarkdown(markdown) { + var cursorToEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + markdown = markdown || ''; + + if (this.isMarkdownMode()) { + this.mdEditor.setValue(markdown, cursorToEnd); + } else { + this.wwEditor.setValue(this.convertor.toHTML(markdown), cursorToEnd); + } + + this.eventManager.emit('setMarkdownAfter', markdown); + } + + /** + * Set html value. + * @param {string} html - html syntax text + * @param {boolean} [cursorToEnd=true] - move cursor to contents end + */ + + }, { + key: 'setHtml', + value: function setHtml(html) { + var cursorToEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + html = html || ''; + this.wwEditor.setValue(html, cursorToEnd); + + if (this.isMarkdownMode()) { + var markdown = this.convertor.toMarkdown(this.wwEditor.getValue(), this.toMarkOptions); + this.mdEditor.setValue(markdown, cursorToEnd); + this.eventManager.emit('setMarkdownAfter', markdown); + } + } + + /** + * Set markdown syntax text. + * @param {string} value - markdown syntax text + * @param {boolean} [cursorToEnd=true] - move cursor to contents end + * @deprecated + */ + + }, { + key: 'setValue', + value: function setValue(value) { + var cursorToEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + this.setMarkdown(value, cursorToEnd); + } + + /** + * Get markdown syntax text. + * @returns {string} + */ + + }, { + key: 'getMarkdown', + value: function getMarkdown() { + var markdown = void 0; + + if (this.isMarkdownMode()) { + markdown = this.mdEditor.getValue(); + } else { + markdown = this.convertor.toMarkdown(this.wwEditor.getValue(), this.toMarkOptions); + } + + return markdown; + } + + /** + * Get html syntax text. + * @returns {string} + */ + + }, { + key: 'getHtml', + value: function getHtml() { + if (this.isWysiwygMode()) { + this.mdEditor.setValue(this.convertor.toMarkdown(this.wwEditor.getValue(), this.toMarkOptions)); + } + + return this.convertor.toHTML(this.mdEditor.getValue()); + } + + /** + * Get editor value. + * @returns {string} + * @deprecated + */ + + }, { + key: 'getValue', + value: function getValue() { + return this.getMarkdown(); + } + + /** + * Insert text + * @param {string} text - text string to insert + */ + + }, { + key: 'insertText', + value: function insertText(text) { + if (this.isMarkdownMode()) { + this.mdEditor.replaceSelection(text); + } else { + this.wwEditor.insertText(text); + } + } + + /** + * Add widget to selection + * @param {Range} selection Current selection + * @param {Node} node widget node + * @param {string} style Adding style "over" or "bottom" + * @param {number} [offset] Offset for adjust position + */ + + }, { + key: 'addWidget', + value: function addWidget(selection, node, style, offset) { + this.getCurrentModeEditor().addWidget(selection, node, style, offset); + } + + /** + * Set and return edithr height + * @param {string} height - editor height + * @returns {string} editor height + */ + + }, { + key: 'height', + value: function height(_height) { + if (_tuiCodeSnippet2.default.isExisty(_height)) { + if (_height === 'auto') { + (0, _jquery2.default)(this.options.el).addClass('auto-height'); + this.minHeight(this.minHeight()); + } else { + (0, _jquery2.default)(this.options.el).removeClass('auto-height'); + this.minHeight(_height); + } + if (_tuiCodeSnippet2.default.isNumber(_height)) { + _height = _height + 'px'; + } + + this.options.el.style.height = _height; + this._height = _height; + } + + return this._height; + } + + /** + * Set / Get min content height + * @param {string} minHeight - min content height in pixel + * @returns {string} - min height in pixel + */ + + }, { + key: 'minHeight', + value: function minHeight(_minHeight) { + if (_tuiCodeSnippet2.default.isExisty(_minHeight)) { + var editorHeight = this._ui.getEditorHeight(); + var editorSectionHeight = this._ui.getEditorSectionHeight(); + var diffHeight = editorHeight - editorSectionHeight; + this._minHeight = _minHeight; + + _minHeight = parseInt(_minHeight, 10); + _minHeight = Math.max(_minHeight - diffHeight, 0); + + this.wwEditor.setMinHeight(_minHeight); + this.mdEditor.setMinHeight(_minHeight); + this.preview.setMinHeight(_minHeight); + } + + return this._minHeight; + } + + /** + * Get current editor mode name + * @returns {Object} MarkdownEditor or WysiwygEditor + */ + + }, { + key: 'getCurrentModeEditor', + value: function getCurrentModeEditor() { + var editor = void 0; + + if (this.isMarkdownMode()) { + editor = this.mdEditor; + } else { + editor = this.wwEditor; + } + + return editor; + } + + /** + * Return true if current editor mode is Markdown + * @returns {boolean} + */ + + }, { + key: 'isMarkdownMode', + value: function isMarkdownMode() { + return this.currentMode === 'markdown'; + } + + /** + * Return true if current editor mode is WYSIWYG + * @returns {boolean} + */ + + }, { + key: 'isWysiwygMode', + value: function isWysiwygMode() { + return this.currentMode === 'wysiwyg'; + } + + /** + * Return false + * @returns {boolean} + */ + + }, { + key: 'isViewer', + value: function isViewer() { + return false; + } + + /** + * Get current Markdown editor's preview style + * @returns {string} + */ + + }, { + key: 'getCurrentPreviewStyle', + value: function getCurrentPreviewStyle() { + return this.mdPreviewStyle; + } + + /** + * Change editor's mode to given mode string + * @param {string} mode - Editor mode name of want to change + * @param {boolean} [isWithoutFocus] - Change mode without focus + */ + + }, { + key: 'changeMode', + value: function changeMode(mode, isWithoutFocus) { + if (this.currentMode === mode) { + return; + } + + this.eventManager.emit('changeModeBefore', this.currentMode); + + this.currentMode = mode; + + if (this.isWysiwygMode()) { + this.layout.switchToWYSIWYG(); + this.wwEditor.setValue(this.convertor.toHTML(this.mdEditor.getValue()), !isWithoutFocus); + this.eventManager.emit('changeModeToWysiwyg'); + } else { + this.layout.switchToMarkdown(); + this.mdEditor.resetState(); + this.mdEditor.setValue(this.convertor.toMarkdown(this.wwEditor.getValue(), this.toMarkOptions), !isWithoutFocus); + this.getCodeMirror().refresh(); + this.eventManager.emit('changeModeToMarkdown'); + } + + this.eventManager.emit('changeMode', mode); + + if (!isWithoutFocus) { + this.focus(); + } + } + + /** + * Remove TUIEditor from document + */ + + }, { + key: 'remove', + value: function remove() { + var self = this; + var i = __nedInstance.length - 1; + this.wwEditor.remove(); + this.mdEditor.remove(); + this.layout.remove(); + this.preview.remove(); + + if (this.getUI()) { + this.getUI().remove(); + } + + this.eventManager.emit('removeEditor'); + this.eventManager.events.forEach(function (value, key) { + self.off(key); + }); + this.eventManager = null; + + for (; i >= 0; i -= 1) { + if (__nedInstance[i] === this) { + __nedInstance.splice(i, 1); + } + } + } + + /** + * Hide TUIEditor + */ + + }, { + key: 'hide', + value: function hide() { + this.eventManager.emit('hide', this); + } + + /** + * Show TUIEditor + */ + + }, { + key: 'show', + value: function show() { + this.eventManager.emit('show', this); + this.getCodeMirror().refresh(); + } + + /** + * Scroll Editor content to Top + * @param {number} value Scroll amount + * @returns {number} + */ + + }, { + key: 'scrollTop', + value: function scrollTop(value) { + return this.getCurrentModeEditor().scrollTop(value); + } + + /** + * Set UI to private UI property + * @param {UI} UI UI instance + */ + + }, { + key: 'setUI', + value: function setUI(UI) { + this._ui = UI; + } + + /** + * Get _ui property + * @returns {DefaultUI|UI} + */ + + }, { + key: 'getUI', + value: function getUI() { + return this._ui; + } + + /** + * Reset TUIEditor + */ + + }, { + key: 'reset', + value: function reset() { + this.wwEditor.reset(); + this.mdEditor.reset(); + } + + /** + * Get current range + * @returns {{start, end}|Range} + */ + + }, { + key: 'getRange', + value: function getRange() { + return this.getCurrentModeEditor().getRange(); + } + + /** + * Get text object of current range + * @param {{start, end}|Range} range Range object of each editor + * @returns {MdTextObject|WwTextObject} TextObject class + */ + + }, { + key: 'getTextObject', + value: function getTextObject(range) { + return this.getCurrentModeEditor().getTextObject(range); + } + + /** + * get selected text + * @returns {string} - selected text + */ + + }, { + key: 'getSelectedText', + value: function getSelectedText() { + var range = this.getRange(); + var textObject = this.getTextObject(range); + + return textObject.getTextContent() || ''; + } + + /** + * Set the placeholder on all editors + * @param {string} placeholder - placeholder to set + */ + + }, { + key: 'setPlaceholder', + value: function setPlaceholder(placeholder) { + this.mdEditor.setPlaceholder(placeholder); + this.wwEditor.setPlaceholder(placeholder); + } + + /** + * Get instance of TUIEditor + * @returns {Array} + */ + + }], [{ + key: 'getInstances', + value: function getInstances() { + return __nedInstance; + } + + /** + * Define extension + * @param {string} name Extension name + * @param {function} ext extension + */ + + }, { + key: 'defineExtension', + value: function defineExtension(name, ext) { + _extManager2.default.defineExtension(name, ext); + } + + /** + * Factory method for Editor + * @param {object} options Option for initialize TUIEditor + * @returns {object} ToastUIEditor or ToastUIEditorViewer + */ + + }, { + key: 'factory', + value: function factory(options) { + var tuiEditor = void 0; + + if (options.viewer) { + tuiEditor = new _viewer2.default(options); + } else { + tuiEditor = new ToastUIEditor(options); + } + + return tuiEditor; + } + }]); + + return ToastUIEditor; +}(); + +/** + * check whther is viewer + * @type {boolean} + */ + + +ToastUIEditor.isViewer = false; + +/** + * I18n instance + * @type {I18n} + */ +ToastUIEditor.i18n = _i18n2.default; + +/** + * domUtil instance + * @type {DomUtil} + * @ignore + */ +ToastUIEditor.domUtils = _domUtils2.default; + +/** + * CodeBlockManager instance + * @type {CodeBlockManager} + */ +ToastUIEditor.codeBlockManager = _codeBlockManager2.default; + +/** + * Button class + * @type {Class.'); + this.$el.append(this._$buttonOpenModalEditor); + this._eventManager.emit('removeEditor', function () { + _this2._$buttonOpenModalEditor.off('click'); + _this2._$buttonOpenModalEditor = null; + }); + } + }, { + key: '_initDOMEvent', + value: function _initDOMEvent() { + var _this3 = this; + + this._$buttonOpenModalEditor.on('click', function () { + return _this3._openPopupCodeBlockEditor(); + }); + } + }, { + key: '_openPopupCodeBlockEditor', + value: function _openPopupCodeBlockEditor() { + this._eventManager.emit('openPopupCodeBlockEditor', this.getAttachedElement()); + } + }, { + key: '_updateLanguage', + value: function _updateLanguage() { + var attachedElement = this.getAttachedElement(); + var language = attachedElement ? attachedElement.getAttribute('data-language') : null; + + this._$languageLabel.text(language ? language : 'text'); + } + + /** + * update gadget position + * @protected + * @override + */ + + }, { + key: 'syncLayout', + value: function syncLayout() { + var $attachedElement = (0, _jquery2.default)(this.getAttachedElement()); + var offset = $attachedElement.offset(); + + offset.left = offset.left + ($attachedElement.outerWidth() - GADGET_WIDTH); + + this.$el.offset(offset); + this.$el.height(GADGET_HEIGHT); + this.$el.width(GADGET_WIDTH); + } + + /** + * on show + * @protected + * @override + */ + + }, { + key: 'onShow', + value: function onShow() { + var _this4 = this; + + _get(CodeBlockGadget.prototype.__proto__ || Object.getPrototypeOf(CodeBlockGadget.prototype), 'onShow', this).call(this); + + this._onAttachedElementChange = function () { + return _this4._updateLanguage(); + }; + (0, _jquery2.default)(this.getAttachedElement()).on(EVENT_LANGUAGE_CHANGED, this._onAttachedElementChange); + + this._updateLanguage(); + } + + /** + * on hide + * @protected + * @override + */ + + }, { + key: 'onHide', + value: function onHide() { + (0, _jquery2.default)(this.getAttachedElement()).off(EVENT_LANGUAGE_CHANGED, this._onAttachedElementChange); + + _get(CodeBlockGadget.prototype.__proto__ || Object.getPrototypeOf(CodeBlockGadget.prototype), 'onHide', this).call(this); + } + }]); + + return CodeBlockGadget; +}(_blockOverlay2.default); + +exports.default = CodeBlockGadget; + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements UI block overlay + * @author NHN FE Development Lab + */ + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Class BlockOverlay + * @param {Object} options - options + * @param {EventManager} options.eventManager - event manager instance + * @param {HTMLElement} options.container - container element + * @param {string} options.attachedSelector - selector string to find attached element + * @ignore + */ +var BlockOverlay = function () { + function BlockOverlay(_ref) { + var eventManager = _ref.eventManager, + container = _ref.container, + attachedSelector = _ref.attachedSelector; + + _classCallCheck(this, BlockOverlay); + + this._eventManager = eventManager; + this._attachedSelector = '[contenteditable=true] ' + attachedSelector; + this._$container = (0, _jquery2.default)(container); + this._$attachedElement = null; + + /** + * is activated. + * if this blockOverlay is active, It always be visible unconditionally. + * @type {boolean} + * @private + */ + this.active = false; + + this._createElement(); + this._initEvent(); + } + + _createClass(BlockOverlay, [{ + key: '_createElement', + value: function _createElement() { + this.$el = (0, _jquery2.default)('
    '); + this.$el.css({ + position: 'absolute', + display: 'none', + 'z-index': 1 + }); + this._$container.append(this.$el); + } + }, { + key: '_initEvent', + value: function _initEvent() { + var _this = this; + + this._eventManager.listen('change', this._onChange.bind(this)); + this._eventManager.listen('mouseover', this._onMouseOver.bind(this)); + this._eventManager.listen('focus', function () { + _this.setVisibility(false); + }); + this._eventManager.listen('mousedown', function () { + _this.setVisibility(false); + }); + } + }, { + key: '_onChange', + value: function _onChange() { + if (this._$attachedElement && _jquery2.default.contains(document, this._$attachedElement[0])) { + this.syncLayout(); + } else { + this.setVisibility(false); + } + } + }, { + key: '_onMouseOver', + value: function _onMouseOver(ev) { + var originalEvent = ev.data; + var $eventTarget = (0, _jquery2.default)(originalEvent.target); + var $attachedElement = $eventTarget.closest(this._attachedSelector); + + if ($attachedElement.length) { + this._$attachedElement = $attachedElement; + this.setVisibility(true); + } else if ($eventTarget.closest(this.$el).length) { + this.setVisibility(true); + } else if (!this.active) { + this.setVisibility(false); + } + } + + /** + * update blockOverlay position & size update to attached element + * you may want to override this to adjust position & size + * @protected + */ + + }, { + key: 'syncLayout', + value: function syncLayout() { + this.$el.offset(this._$attachedElement.offset()); + this.$el.width(this._$attachedElement.outerWidth()); + this.$el.height(this._$attachedElement.outerHeight()); + } + + /** + * attached element + * @protected + * @returns {HTMLElement} - attached element + */ + + }, { + key: 'getAttachedElement', + value: function getAttachedElement() { + return this._$attachedElement ? this._$attachedElement.get(0) : null; + } + + /** + * visibility + * @protected + * @returns {boolean} visibility + */ + + }, { + key: 'getVisibility', + value: function getVisibility() { + return this.$el.css('display') === 'block'; + } + + /** + * visibility + * @param {boolean} visibility - is visible + * @protected + */ + + }, { + key: 'setVisibility', + value: function setVisibility(visibility) { + if (visibility && this._$attachedElement) { + if (!this.getVisibility()) { + this.$el.css('display', 'block'); + this.syncLayout(); + this.onShow(); + } + } else if (!visibility) { + if (this.getVisibility()) { + this.$el.css('display', 'none'); + this.onHide(); + } + } + } + + /** + * called on show. you may want to override to get the event + * @protected + * @abstract + */ + + }, { + key: 'onShow', + value: function onShow() {} + + /** + * called on hide. you may want to override to get the event + * @protected + */ + + }, { + key: 'onHide', + value: function onHide() { + this.active = false; + this._$attachedElement = null; + } + }]); + + return BlockOverlay; +}(); + +exports.default = BlockOverlay; + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview editor layout + * @author NHN FE Development Lab + */ + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Editor container template + * @type {string} + * @ignore + */ +var containerTmpl = ['
    ', '
    ', '
    ', '
    ', '
    ', '
    ', '
    ', '
    ', '
    ', '
    '].join(''); + +/** + * Class Layout + * @param {object} options - Option object + * @param {EventManager} eventManager - Event manager instance + * @ignore + */ + +var Layout = function () { + function Layout(options, eventManager) { + _classCallCheck(this, Layout); + + this.$el = (0, _jquery2.default)(options.el); + this.height = options.height; + this.type = options.initialEditType; + this.eventManager = eventManager; + + this.init(); + this._initEvent(); + } + + /** + * Initializer + * @protected + */ + + + _createClass(Layout, [{ + key: 'init', + value: function init() { + this._renderLayout(); + + this._initMarkdownAndPreviewSection(); + this._initWysiwygSection(); + } + + /** + * Initialize show and hide event + * @private + */ + + }, { + key: '_initEvent', + value: function _initEvent() { + this.eventManager.listen('hide', this.hide.bind(this)); + this.eventManager.listen('show', this.show.bind(this)); + } + + /** + * Create editor container with template + * @private + */ + + }, { + key: '_renderLayout', + value: function _renderLayout() { + this.$el.css('box-sizing', 'border-box'); + this.$containerEl = (0, _jquery2.default)(containerTmpl).appendTo(this.$el); + } + + /** + * Switch editor mode to WYSIWYG + */ + + }, { + key: 'switchToWYSIWYG', + value: function switchToWYSIWYG() { + this.$containerEl.removeClass('te-md-mode'); + this.$containerEl.addClass('te-ww-mode'); + } + + /** + * Switch editor mode to Markdown + */ + + }, { + key: 'switchToMarkdown', + value: function switchToMarkdown() { + this.$containerEl.removeClass('te-ww-mode'); + this.$containerEl.addClass('te-md-mode'); + } + + /** + * Initialize editor to Markdown and set preview section + * @private + */ + + }, { + key: '_initMarkdownAndPreviewSection', + value: function _initMarkdownAndPreviewSection() { + this.$mdEditorContainerEl = this.$containerEl.find('.te-md-container .te-editor'); + this.$previewEl = this.$containerEl.find('.te-md-container .te-preview'); + } + + /** + * Initialize editor to WYSIWYG + * @private + */ + + }, { + key: '_initWysiwygSection', + value: function _initWysiwygSection() { + this.$wwEditorContainerEl = this.$containerEl.find('.te-ww-container .te-editor'); + } + + /** + * Set preview to vertical split style + * @private + */ + + }, { + key: '_verticalSplitStyle', + value: function _verticalSplitStyle() { + this.$containerEl.find('.te-md-container').removeClass('te-preview-style-tab'); + this.$containerEl.find('.te-md-container').addClass('te-preview-style-vertical'); + } + + /** + * Set tab style preview mode + * @private + */ + + }, { + key: '_tabStyle', + value: function _tabStyle() { + this.$containerEl.find('.te-md-container').removeClass('te-preview-style-vertical'); + this.$containerEl.find('.te-md-container').addClass('te-preview-style-tab'); + } + + /** + * Toggle preview style between tab and vertical split + * @param {string} style Preview style ('tab' or 'vertical') + */ + + }, { + key: 'changePreviewStyle', + value: function changePreviewStyle(style) { + if (style === 'tab') { + this._tabStyle(); + } else if (style === 'vertical') { + this._verticalSplitStyle(); + } + } + + /** + * Hide Editor + */ + + }, { + key: 'hide', + value: function hide() { + this.$el.find('.tui-editor').addClass('te-hide'); + } + + /** + * Show Editor + */ + + }, { + key: 'show', + value: function show() { + this.$el.find('.tui-editor').removeClass('te-hide'); + } + + /** + * Remove Editor + */ + + }, { + key: 'remove', + value: function remove() { + this.$el.find('.tui-editor').remove(); + } + + /** + * Get jQuery wrapped editor container element + * @returns {jQuery} + */ + + }, { + key: 'getEditorEl', + value: function getEditorEl() { + return this.$containerEl; + } + + /** + * Get jQuery wrapped preview element + * @returns {jQuery} + */ + + }, { + key: 'getPreviewEl', + value: function getPreviewEl() { + return this.$previewEl; + } + + /** + * Get jQuery wrapped Markdown editor element + * @returns {jQuery} + */ + + }, { + key: 'getMdEditorContainerEl', + value: function getMdEditorContainerEl() { + return this.$mdEditorContainerEl; + } + + /** + * Get jQuery wrapped WYSIWYG editor element + * @returns {jQuery} + */ + + }, { + key: 'getWwEditorContainerEl', + value: function getWwEditorContainerEl() { + return this.$wwEditorContainerEl; + } + }]); + + return Layout; +}(); + +exports.default = Layout; + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements Command + * @author NHN FE Development Lab + */ + + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Class Command + * @param {string} name Command name + * @param {number} type Command type (Command.TYPE) + * @param {Array.} [keyMap] keyMap + * @ignore + */ +var Command = function () { + function Command(name, type, keyMap) { + _classCallCheck(this, Command); + + this.name = name; + this.type = type; + + if (keyMap) { + this.setKeyMap(keyMap); + } + } + + /** + * returns Name of command + * @returns {string} Command Name + */ + + + _createClass(Command, [{ + key: 'getName', + value: function getName() { + return this.name; + } + + /** + * returns Type of command + * @returns {number} Command Command type number + */ + + }, { + key: 'getType', + value: function getType() { + return this.type; + } + + /** + * returns whether Command Type is Markdown or not + * @returns {boolean} result + */ + + }, { + key: 'isMDType', + value: function isMDType() { + return this.type === Command.TYPE.MD; + } + + /** + * returns whether Command Type is Wysiwyg or not + * @returns {boolean} result + */ + + }, { + key: 'isWWType', + value: function isWWType() { + return this.type === Command.TYPE.WW; + } + + /** + * returns whether Command Type is Global or not + * @returns {boolean} result + */ + + }, { + key: 'isGlobalType', + value: function isGlobalType() { + return this.type === Command.TYPE.GB; + } + + /** + * Set keymap value for each os + * @param {string} win Windows Key(and etc) + * @param {string} mac Mac osx key + */ + + }, { + key: 'setKeyMap', + value: function setKeyMap(win, mac) { + this.keyMap = [win, mac]; + } + }]); + + return Command; +}(); + +/** + * Command factory method + * @param {string} typeStr Editor type name + * @param {object} props Property + * @param {string} props.name Command name + * @param {number} props.type Command type number + * @returns {Command} + * @static + */ + + +Command.factory = function (typeStr, props) { + var type = void 0; + + if (typeStr === 'markdown') { + type = Command.TYPE.MD; + } else if (typeStr === 'wysiwyg') { + type = Command.TYPE.WW; + } else if (typeStr === 'global') { + type = Command.TYPE.GB; + } + + var command = new Command(props.name, type); + + _tuiCodeSnippet2.default.extend(command, props); + + return command; +}; + +/** + * Command Type Constant + * markdown : 0 + * wysiwyg : 1 + * global : 2 + * @type {object} + * @private + */ +Command.TYPE = { + MD: 0, + WW: 1, + GB: 2 +}; + +exports.default = Command; + +/***/ }), +/* 85 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__85__; + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Copyright (c) 2016, Revin Guillen. +// Distributed under an MIT license: https://github.com/revin/markdown-it-task-lists/ + +/** + * @fileoverview Implements markdownitTaskPlugin + * @modifier Sungho Kim(sungho-kim@nhn.com) FE Development Lab/NHN + * @modifier Junghwan Park(junghwan.park@nhn.com) FE Development Lab/NHN + */ +/* eslint-disable */ + +/** + * Task list renderer for Markdown-it + * @param {object} markdownit Markdown-it instance + * @ignore + */ +var MarkdownitTaskRenderer = function MarkdownitTaskRenderer(markdownit) { + markdownit.core.ruler.after('inline', 'tui-task-list', function (state) { + var TASK_LIST_ITEM_CLASS_NAME = 'task-list-item'; + var CHECKED_CLASS_NAME = 'checked'; + var tokens = state.tokens; + var className; + var tokenIndex; + + // tokenIndex=0 'ul', tokenIndex=1 'li', tokenIndex=2 'p_open' + for (tokenIndex = 2; tokenIndex < tokens.length; tokenIndex += 1) { + if (isTaskListItemToken(tokens, tokenIndex)) { + if (isChecked(tokens[tokenIndex])) { + className = TASK_LIST_ITEM_CLASS_NAME + ' ' + CHECKED_CLASS_NAME; + } else { + className = TASK_LIST_ITEM_CLASS_NAME; + } + + removeMarkdownTaskFormatText(tokens[tokenIndex]); + + setTokenAttribute(tokens[tokenIndex - 2], 'class', className); + setTokenAttribute(tokens[tokenIndex - 2], 'data-te-task', ''); + } + } + }); +}; + +/** + * Remove task format text for rendering + * @param {object} token Token object + * @ignore + */ +function removeMarkdownTaskFormatText(token) { + // '[X] ' length is 4 + // FIXED: we don't need first space + token.content = token.content.slice(4); + token.children[0].content = token.children[0].content.slice(4); +} + +/** + * Return boolean value whether task checked or not + * @param {object} token Token object + * @returns {boolean} + * @ignore + */ +function isChecked(token) { + var checked = false; + + if (token.content.indexOf('[x]') === 0 || token.content.indexOf('[X]') === 0) { + checked = true; + } + + return checked; +} + +/** + * Set attribute of passed token + * @param {object} token Token object + * @param {string} attributeName Attribute name for set + * @param {string} attributeValue Attribute value for set + * @ignore + */ +function setTokenAttribute(token, attributeName, attributeValue) { + var index = token.attrIndex(attributeName); + var attr = [attributeName, attributeValue]; + + if (index < 0) { + token.attrPush(attr); + } else { + token.attrs[index] = attr; + } +} + +/** + * Return boolean value whether task list item or not + * @param {array} tokens Token object + * @param {number} index Number of token index + * @returns {boolean} + * @ignore + */ +function isTaskListItemToken(tokens, index) { + return tokens[index].type === 'inline' && tokens[index - 1].type === 'paragraph_open' && tokens[index - 2].type === 'list_item_open' && (tokens[index].content.indexOf('[ ]') === 0 || tokens[index].content.indexOf('[x]') === 0 || tokens[index].content.indexOf('[X]') === 0); +} +/* eslint-enable */ + +module.exports = MarkdownitTaskRenderer; + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Copyright (c) 2016, Revin Guillen. +// Distributed under an MIT license: https://github.com/revin/markdown-it-task-lists/ +/* eslint-disable */ +/** + * @fileoverview Implements markdownitCodeBlockPlugin + * @modifier NHN FE Development Lab + */ + +/** + * Code block renderer for Markdown-it + * @param {object} markdownit Markdown-it instance + * @ignore + */ +var MarkdownitCodeBlockRenderer = function MarkdownitCodeBlockRenderer(markdownit) { + markdownit.core.ruler.after('block', 'tui-code-block', function (state) { + var DEFAULT_NUMBER_OF_BACKTICKS = 3; + var tokens = state.tokens; + var currentToken, tokenIndex, numberOfBackticks; + + for (tokenIndex = 0; tokenIndex < tokens.length; tokenIndex += 1) { + currentToken = tokens[tokenIndex]; + + if (isCodeFenceToken(currentToken)) { + numberOfBackticks = currentToken.markup.length; + if (numberOfBackticks > DEFAULT_NUMBER_OF_BACKTICKS) { + setTokenAttribute(currentToken, 'data-backticks', numberOfBackticks, true); + } + if (currentToken.info) { + setTokenAttribute(currentToken, 'data-language', escape(currentToken.info.replace(' ', ''), true)); + } + } + } + }); +}; + +/** + * Set attribute of passed token + * @param {object} token Token object + * @param {string} attributeName Attribute name for set + * @param {string} attributeValue Attribute value for set + * @ignore + */ +function setTokenAttribute(token, attributeName, attributeValue) { + var index = token.attrIndex(attributeName); + var attr = [attributeName, attributeValue]; + + if (index < 0) { + token.attrPush(attr); + } else { + token.attrs[index] = attr; + } +} +/** + * Return boolean value whether passed token is code fence or not + * @param {object} token Token object + * @returns {boolean} + * @ignore + */ +function isCodeFenceToken(token) { + return token.block === true && token.tag === 'code' && token.type === 'fence'; +} + +/** + * escape code from markdown-it + * @param {string} html HTML string + * @param {string} encode Boolean value of whether encode or not + * @returns {string} + * @ignore + */ +function escape(html, encode) { + return html.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); +} +/* eslint-enable */ + +module.exports = MarkdownitCodeBlockRenderer; + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin. +// Distributed under an ISC license: https://github.com/markdown-it/markdown-it/ +/** + * @fileoverview Implements MarkdownItCodeRenderer + * @modifier NHN FE Development Lab + */ + +/* eslint-disable */ +module.exports = function code(state, startLine, endLine /*, silent*/) { + // Added by Junghwan Park + var FIND_LIST_RX = / {0,3}(?:-|\*|\d\.) /; + var lines = state.src.split('\n'); + var currentLine = lines[startLine]; + // Added by Junghwan Park + + var nextLine, + last, + token, + emptyLines = 0; + + // Add condition by Junghwan Park + if (currentLine.match(FIND_LIST_RX) || state.sCount[startLine] - state.blkIndent < 4) { + // Add condition by Junghwan Park + return false; + } + + last = nextLine = startLine + 1; + + while (nextLine < endLine) { + if (state.isEmpty(nextLine)) { + emptyLines++; + + // workaround for lists: 2 blank lines should terminate indented + // code block, but not fenced code block + if (emptyLines >= 2 && state.parentType === 'list') { + break; + } + + nextLine++; + continue; + } + + emptyLines = 0; + + if (state.sCount[nextLine] - state.blkIndent >= 4) { + nextLine++; + last = nextLine; + continue; + } + break; + } + + state.line = last; + + token = state.push('code_block', 'code', 0); + token.content = state.getLines(startLine, last, 4 + state.blkIndent, true); + token.map = [startLine, state.line]; + + return true; +}; +/* eslint-enable */ + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin. +// Distributed under MIT license: https://github.com/markdown-it/markdown-it/ +/** + * @fileoverview Implements markdownitCodeBlockQuoteRenderer + * @modifier NHN FE Development Lab + */ + +/* eslint-disable */ + +// Block quotes + + + +// prevent quote, pre in list #811 +// ref: #989 +// #811 START +// var isSpace = require('../common/utils').isSpace; + +function isSpace(code) { + switch (code) { + case 0x09: + case 0x20: + return true; + } + return false; +} +// #811 END + +module.exports = function blockquote(state, startLine, endLine, silent) { + var adjustTab, + ch, + i, + initial, + l, + lastLineEmpty, + lines, + nextLine, + offset, + oldBMarks, + oldBSCount, + oldIndent, + oldParentType, + oldSCount, + oldTShift, + spaceAfterMarker, + terminate, + terminatorRules, + token, + wasOutdented, + oldLineMax = state.lineMax, + pos = state.bMarks[startLine] + state.tShift[startLine], + max = state.eMarks[startLine]; + + // #811 START + var FIND_LIST_RX = /(?:-|\*|\d+\.) {1,4}(?:> {0,3})[^>]*$/; + var sourceLines = state.src.split('\n'); + var currentLine = sourceLines[startLine]; + // #811 END + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + + // check the block quote marker + if (state.src.charCodeAt(pos++) !== 0x3E /* > */) { + return false; + } + // #811 START + // check block quote in list + if (currentLine.match(FIND_LIST_RX) /*&& !currentLine.match(/^ {0,6}>/)*/) { + return false; + } + // #811 END + + // we know that it's going to be a valid blockquote, + // so no point trying to find the end of it in silent mode + if (silent) { + return true; + } + + // skip spaces after ">" and re-calculate offset + initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]); + + // skip one optional space after '>' + if (state.src.charCodeAt(pos) === 0x20 /* space */) { + // ' > test ' + // ^ -- position start of line here: + pos++; + initial++; + offset++; + adjustTab = false; + spaceAfterMarker = true; + } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { + spaceAfterMarker = true; + + if ((state.bsCount[startLine] + offset) % 4 === 3) { + // ' >\t test ' + // ^ -- position start of line here (tab has width===1) + pos++; + initial++; + offset++; + adjustTab = false; + } else { + // ' >\t test ' + // ^ -- position start of line here + shift bsCount slightly + // to make extra space appear + adjustTab = true; + } + } else { + spaceAfterMarker = false; + } + + oldBMarks = [state.bMarks[startLine]]; + state.bMarks[startLine] = pos; + + while (pos < max) { + ch = state.src.charCodeAt(pos); + + if (isSpace(ch)) { + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4; + } else { + offset++; + } + } else { + break; + } + + pos++; + } + + oldBSCount = [state.bsCount[startLine]]; + state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0); + + lastLineEmpty = pos >= max; + + oldSCount = [state.sCount[startLine]]; + state.sCount[startLine] = offset - initial; + + oldTShift = [state.tShift[startLine]]; + state.tShift[startLine] = pos - state.bMarks[startLine]; + + terminatorRules = state.md.block.ruler.getRules('blockquote'); + + oldParentType = state.parentType; + state.parentType = 'blockquote'; + wasOutdented = false; + + // Search the end of the block + // + // Block ends with either: + // 1. an empty line outside: + // ``` + // > test + // + // ``` + // 2. an empty line inside: + // ``` + // > + // test + // ``` + // 3. another tag: + // ``` + // > test + // - - - + // ``` + for (nextLine = startLine + 1; nextLine < endLine; nextLine++) { + // check if it's outdented, i.e. it's inside list item and indented + // less than said list item: + // + // ``` + // 1. anything + // > current blockquote + // 2. checking this line + // ``` + if (state.sCount[nextLine] < state.blkIndent) wasOutdented = true; + + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + + if (pos >= max) { + // Case 1: line is not inside the blockquote, and this line is empty. + break; + } + + if (state.src.charCodeAt(pos++) === 0x3E /* > */ && !wasOutdented) { + // This line is inside the blockquote. + + // skip spaces after ">" and re-calculate offset + initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]); + + // skip one optional space after '>' + if (state.src.charCodeAt(pos) === 0x20 /* space */) { + // ' > test ' + // ^ -- position start of line here: + pos++; + initial++; + offset++; + adjustTab = false; + spaceAfterMarker = true; + } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { + spaceAfterMarker = true; + + if ((state.bsCount[nextLine] + offset) % 4 === 3) { + // ' >\t test ' + // ^ -- position start of line here (tab has width===1) + pos++; + initial++; + offset++; + adjustTab = false; + } else { + // ' >\t test ' + // ^ -- position start of line here + shift bsCount slightly + // to make extra space appear + adjustTab = true; + } + } else { + spaceAfterMarker = false; + } + + oldBMarks.push(state.bMarks[nextLine]); + state.bMarks[nextLine] = pos; + + while (pos < max) { + ch = state.src.charCodeAt(pos); + + if (isSpace(ch)) { + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4; + } else { + offset++; + } + } else { + break; + } + + pos++; + } + + lastLineEmpty = pos >= max; + + oldBSCount.push(state.bsCount[nextLine]); + state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0); + + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] = offset - initial; + + oldTShift.push(state.tShift[nextLine]); + state.tShift[nextLine] = pos - state.bMarks[nextLine]; + continue; + } + + // Case 2: line is not inside the blockquote, and the last line was empty. + if (lastLineEmpty) { + break; + } + + // Case 3: another tag found. + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + + if (terminate) { + // Quirk to enforce "hard termination mode" for paragraphs; + // normally if you call `tokenize(state, startLine, nextLine)`, + // paragraphs will look below nextLine for paragraph continuation, + // but if blockquote is terminated by another tag, they shouldn't + state.lineMax = nextLine; + + if (state.blkIndent !== 0) { + // state.blkIndent was non-zero, we now set it to zero, + // so we need to re-calculate all offsets to appear as + // if indent wasn't changed + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] -= state.blkIndent; + } + + break; + } + + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + + // A negative indentation means that this is a paragraph continuation + // + state.sCount[nextLine] = -1; + } + + oldIndent = state.blkIndent; + state.blkIndent = 0; + + token = state.push('blockquote_open', 'blockquote', 1); + token.markup = '>'; + token.map = lines = [startLine, 0]; + + state.md.block.tokenize(state, startLine, nextLine); + + token = state.push('blockquote_close', 'blockquote', -1); + token.markup = '>'; + + state.lineMax = oldLineMax; + state.parentType = oldParentType; + lines[1] = state.line; + + // Restore original tShift; this might not be necessary since the parser + // has already been here, but just to make sure we can do that. + for (i = 0; i < oldTShift.length; i++) { + state.bMarks[i + startLine] = oldBMarks[i]; + state.tShift[i + startLine] = oldTShift[i]; + state.sCount[i + startLine] = oldSCount[i]; + state.bsCount[i + startLine] = oldBSCount[i]; + } + state.blkIndent = oldIndent; + + return true; +}; + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin. +// Distributed under an ISC license: https://github.com/markdown-it/markdown-it/ + +/** + * @fileoverview Implements markdownitTableRenderer + * @modifier NHN FE Development Lab + */ + +/*eslint-disable */ +function getLine(state, line) { + var pos = state.bMarks[line] + state.blkIndent, + max = state.eMarks[line]; + + return state.src.substr(pos, max - pos); +} + +function escapedSplit(str) { + var result = [], + pos = 0, + max = str.length, + ch, + escapes = 0, + lastPos = 0, + backTicked = false, + lastBackTick = 0; + + ch = str.charCodeAt(pos); + + while (pos < max) { + if (ch === 0x60 /* ` */ && escapes % 2 === 0) { + backTicked = !backTicked; + lastBackTick = pos; + } else if (ch === 0x7c /* | */ && escapes % 2 === 0 && !backTicked) { + result.push(str.substring(lastPos, pos)); + lastPos = pos + 1; + } else if (ch === 0x5c /* \ */) { + escapes += 1; + } else { + escapes = 0; + } + + pos += 1; + + // If there was an un-closed backtick, go back to just after + // the last backtick, but as if it was a normal character + if (pos === max && backTicked) { + backTicked = false; + pos = lastBackTick + 1; + } + + ch = str.charCodeAt(pos); + } + + result.push(str.substring(lastPos)); + + return result; +} + +module.exports = function table(state, startLine, endLine, silent) { + var ch, lineText, pos, i, nextLine, columns, columnCount, token, aligns, alignCount, t, tableLines, tbodyLines; + + // should have at least three lines + if (startLine + 2 > endLine) { + return false; + } + + nextLine = startLine + 1; + + if (state.sCount[nextLine] < state.blkIndent) { + return false; + } + + // first character of the second line should be '|' or '-' + + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + if (pos >= state.eMarks[nextLine]) { + return false; + } + + ch = state.src.charCodeAt(pos); + if (ch !== 0x7C /* | */ && ch !== 0x2D /* - */ && ch !== 0x3A /* : */) { + return false; + } + + lineText = getLine(state, startLine + 1); + if (!/^[-:| ]+$/.test(lineText)) { + return false; + } + + columns = lineText.split('|'); + aligns = []; + for (i = 0; i < columns.length; i += 1) { + t = columns[i].trim(); + if (!t) { + // allow empty columns before and after table, but not in between columns; + // e.g. allow ` |---| `, disallow ` ---||--- ` + if (i === 0 || i === columns.length - 1) { + continue; + } else { + return false; + } + } + + if (!/^:?-+:?$/.test(t)) { + return false; + } + if (t.charCodeAt(t.length - 1) === 0x3A /* : */) { + aligns.push(t.charCodeAt(0) === 0x3A /* : */ ? 'center' : 'right'); + } else if (t.charCodeAt(0) === 0x3A /* : */) { + aligns.push('left'); + } else { + aligns.push(''); + } + } + alignCount = aligns.length; + + lineText = getLine(state, startLine).trim(); + if (lineText.indexOf('|') === -1) { + return false; + } + columns = escapedSplit(lineText.replace(/^\||\|$/g, '')); + + // header row will define an amount of columns in the entire table, + // and align row shouldn't be smaller than that (the rest of the rows can) + columnCount = columns.length; + if (columnCount > alignCount) { + return false; + } else if (columnCount < alignCount) { + for (i = 0; i < alignCount - columnCount; i += 1) { + columns.push(''); + } + columnCount = columns.length; + } + + if (silent) { + return true; + } + + token = state.push('table_open', 'table', 1); + token.map = tableLines = [startLine, 0]; + + token = state.push('thead_open', 'thead', 1); + token.map = [startLine, startLine + 1]; + + token = state.push('tr_open', 'tr', 1); + token.map = [startLine, startLine + 1]; + + for (i = 0; i < columnCount; i += 1) { + token = state.push('th_open', 'th', 1); + token.map = [startLine, startLine + 1]; + if (aligns[i]) { + // FIXED: change property style to align + token.attrs = [['align', aligns[i]]]; + } + + token = state.push('inline', '', 0); + token.content = columns[i].trim(); + token.map = [startLine, startLine + 1]; + token.children = []; + + token = state.push('th_close', 'th', -1); + } + + token = state.push('tr_close', 'tr', -1); + token = state.push('thead_close', 'thead', -1); + + token = state.push('tbody_open', 'tbody', 1); + token.map = tbodyLines = [startLine + 2, 0]; + + for (nextLine = startLine + 2; nextLine < endLine; nextLine += 1) { + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + + lineText = getLine(state, nextLine); + if (lineText.indexOf('|') === -1) { + break; + } + + // keep spaces at beginning of line to indicate an empty first cell, but + // strip trailing whitespace + columns = escapedSplit(lineText.replace(/^\||\|\s*$/g, '')); + + token = state.push('tr_open', 'tr', 1); + for (i = 0; i < columnCount; i += 1) { + token = state.push('td_open', 'td', 1); + if (aligns[i]) { + // FIXED: change property style to align + token.attrs = [['align', aligns[i]]]; + } + + token = state.push('inline', '', 0); + token.content = columns[i] ? columns[i].trim() : ''; + token.children = []; + + token = state.push('td_close', 'td', -1); + } + token = state.push('tr_close', 'tr', -1); + } + token = state.push('tbody_close', 'tbody', -1); + token = state.push('table_close', 'table', -1); + + tableLines[1] = tbodyLines[1] = nextLine; + state.line = nextLine; + return true; +}; + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin. +// Distributed under an ISC license: https://github.com/markdown-it/markdown-it/ + +/** + * @fileoverview Implements markdownitHtmlBlockRenderer + * @modifier NHN FE Development Lab + */ +/* eslint-disable */ +// HTML block + + + +// An array of opening and corresponding closing sequences for html tags, +// last argument defines whether it can terminate a paragraph or not +// + +// void tag names --- Added by Junghwan Park + +var voidTagNames = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']; +var HTML_SEQUENCES = [[/^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true], [/^/, true], [/^<\?/, /\?>/, true], [/^/, true], [/^/, true], [new RegExp('^<(' + voidTagNames.join('|') + ')', 'i'), /^\/?>$/, true], [new RegExp('^|$))', 'i'), /^$/, true], [/^(?:<[A-Za-z][A-Za-z0-9\-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\s*=\s*(?:[^"'=<>`\x00-\x20]+|'[^']*'|"[^"]*"))?)*\s*\/?>|<\/[A-Za-z][A-Za-z0-9\-]*\s*>)\s*$/, /^$/, false]]; + +module.exports = function html_block(state, startLine, endLine, silent) { + var i, + nextLine, + token, + lineText, + pos = state.bMarks[startLine] + state.tShift[startLine], + max = state.eMarks[startLine]; + + if (!state.md.options.html) { + return false; + } + + if (state.src.charCodeAt(pos) !== 0x3C /* < */) { + return false; + } + + lineText = state.src.slice(pos, max); + + for (i = 0; i < HTML_SEQUENCES.length; i++) { + if (HTML_SEQUENCES[i][0].test(lineText)) { + // add condition for return when meet void element --- Added by Junghwan Park + if (i === 5) { + return false; + } else { + break; + } + } + } + + if (i === HTML_SEQUENCES.length) { + return false; + } + + if (silent) { + // true if this sequence can be a terminator, false otherwise + return HTML_SEQUENCES[i][2]; + } + + nextLine = startLine + 1; + + // If we are here - we detected HTML block. + // Let's roll down till block end. + if (!HTML_SEQUENCES[i][1].test(lineText)) { + for (; nextLine < endLine; nextLine++) { + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + lineText = state.src.slice(pos, max); + + if (HTML_SEQUENCES[i][1].test(lineText)) { + if (lineText.length !== 0) { + nextLine++; + } + break; + } + } + } + + state.line = nextLine; + + token = state.push('html_block', '', 0); + token.map = [startLine, nextLine]; + token.content = state.getLines(startLine, nextLine, state.blkIndent, true); + + return true; +}; +/* eslint-enable */ + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin. +// Distributed under MIT license: https://github.com/markdown-it/markdown-it/ +/** + * @fileoverview Implements markdownitBackticksRenderer + * @modifier NHN FE Development Lab + */ +/* eslint-disable */ + +// Parse backticks +module.exports = function backtick(state, silent) { + var start, + max, + marker, + matchStart, + matchEnd, + token, + pos = state.pos, + ch = state.src.charCodeAt(pos); + + if (ch !== 0x60 /* ` */) { + return false; + } + + start = pos; + pos++; + max = state.posMax; + + while (pos < max && state.src.charCodeAt(pos) === 0x60 /* ` */) { + pos++; + } + + marker = state.src.slice(start, pos); + + matchStart = matchEnd = pos; + + while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) { + matchEnd = matchStart + 1; + + while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60 /* ` */) { + matchEnd++; + } + + if (matchEnd - matchStart === marker.length) { + if (!silent) { + token = state.push('code_inline', 'code', 0); + token.markup = marker; + token.content = state.src.slice(pos, matchStart).replace(/[ \n]+/g, ' ').trim(); + // TUI.EDITOR MODIFICATION START + // store number of backtick in data-backtick + // https://github.nhn.com/fe/tui.editor/pull/981 + token.attrSet('data-backticks', token.markup.length); + // TUI.EDITOR MODIFICATION END + } + state.pos = matchEnd; + return true; + } + } + + if (!silent) { + state.pending += marker; + } + state.pos += marker.length; + return true; +}; + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// Copyright (c) 2014, Vitaly Puzrin. +// Distributed under an MIT license: https://github.com/markdown-it/markdown-it-for-inline +/* eslint-disable */ + +/** + * @fileoverview Implements markdownItLinkPlugin + * @modifier NHN FE Development Lab + */ + +function for_inline_plugin(md, ruleName, tokenType, iteartor) { + + function scan(state) { + var i, blkIdx, inlineTokens; + + for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { + if (state.tokens[blkIdx].type !== 'inline') { + continue; + } + + inlineTokens = state.tokens[blkIdx].children; + + for (i = inlineTokens.length - 1; i >= 0; i--) { + if (inlineTokens[i].type !== tokenType) { + continue; + } + + iteartor(inlineTokens, i); + } + } + } + + md.core.ruler.push(ruleName, scan); +}; + +var linkAttribute = exports.linkAttribute = function linkAttribute(markdownit, iteartor) { + for_inline_plugin(markdownit, 'url_attribute', 'link_open', iteartor); +}; + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__94__; + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements editor preivew + * @author NHN FE Development Lab + */ + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _mdPreview = __webpack_require__(34); + +var _mdPreview2 = _interopRequireDefault(_mdPreview); + +var _eventManager = __webpack_require__(40); + +var _eventManager2 = _interopRequireDefault(_eventManager); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _extManager = __webpack_require__(41); + +var _extManager2 = _interopRequireDefault(_extManager); + +var _convertor = __webpack_require__(42); + +var _convertor2 = _interopRequireDefault(_convertor); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +var _codeBlockManager = __webpack_require__(25); + +var _codeBlockManager2 = _interopRequireDefault(_codeBlockManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var TASK_ATTR_NAME = 'data-te-task'; +var TASK_CHECKED_CLASS_NAME = 'checked'; + +/** + * Class ToastUIEditorViewer + * @param {object} options Option object + * @param {HTMLElement} options.el - container element + * @param {string} options.initialValue Editor's initial value + * @param {object} options.events eventlist Event list + * @param {function} options.events.load It would be emitted when editor fully load + * @param {function} options.events.change It would be emitted when content changed + * @param {function} options.events.stateChange It would be emitted when format change by cursor position + * @param {function} options.events.focus It would be emitted when editor get focus + * @param {function} options.events.blur It would be emitted when editor loose focus + * @param {object} options.hooks Hook list + * @param {function} options.hooks.previewBeforeHook Submit preview to hook URL before preview be shown + * @param {string[]} [options.exts] - extensions + */ + +var ToastUIEditorViewer = function () { + function ToastUIEditorViewer(options) { + var _this = this; + + _classCallCheck(this, ToastUIEditorViewer); + + this.options = _jquery2.default.extend({ + useDefaultHTMLSanitizer: true, + codeBlockLanguages: _codeBlockManager.CodeBlockManager.getHighlightJSLanguages(), + customConvertor: null + }, options); + + this.eventManager = new _eventManager2.default(); + this.commandManager = new _commandManager2.default(this); + if (this.options.customConvertor) { + // eslint-disable-next-line new-cap + this.convertor = new this.options.customConvertor(this.eventManager); + } else { + this.convertor = new _convertor2.default(this.eventManager); + } + + if (this.options.useDefaultHTMLSanitizer) { + this.convertor.initHtmlSanitizer(); + } + + if (this.options.hooks) { + _tuiCodeSnippet2.default.forEach(this.options.hooks, function (fn, key) { + _this.addHook(key, fn); + }); + } + + if (this.options.events) { + _tuiCodeSnippet2.default.forEach(this.options.events, function (fn, key) { + _this.on(key, fn); + }); + } + + var _options = this.options, + el = _options.el, + initialValue = _options.initialValue; + + var existingHTML = el.innerHTML; + el.innerHTML = ''; + + this.preview = new _mdPreview2.default((0, _jquery2.default)(el), this.eventManager, this.convertor, true); + + this.preview.$el.on('mousedown', _jquery2.default.proxy(this._toggleTask, this)); + + _extManager2.default.applyExtension(this, this.options.exts); + + if (initialValue) { + this.setValue(initialValue); + } else if (existingHTML) { + this.preview.setHTML(existingHTML); + } + + this.eventManager.emit('load', this); + } + + /** + * Toggle task by detecting mousedown event. + * @param {MouseEvent} ev - event + * @private + */ + + + _createClass(ToastUIEditorViewer, [{ + key: '_toggleTask', + value: function _toggleTask(ev) { + var style = getComputedStyle(ev.target, ':before'); + + if (ev.target.hasAttribute(TASK_ATTR_NAME) && _domUtils2.default.isInsideTaskBox(style, ev.offsetX, ev.offsetY)) { + (0, _jquery2.default)(ev.target).toggleClass(TASK_CHECKED_CLASS_NAME); + this.eventManager.emit('change', { + source: 'viewer', + data: ev + }); + } + } + + /** + * Set content for preview + * @param {string} markdown Markdown text + */ + + }, { + key: 'setMarkdown', + value: function setMarkdown(markdown) { + this.markdownValue = markdown = markdown || ''; + + this.preview.refresh(this.markdownValue); + this.eventManager.emit('setMarkdownAfter', this.markdownValue); + } + + /** + * Set content for preview + * @param {string} markdown Markdown text + * @deprecated + */ + + }, { + key: 'setValue', + value: function setValue(markdown) { + this.setMarkdown(markdown); + } + + /** + * Bind eventHandler to event type + * @param {string} type Event type + * @param {function} handler Event handler + */ + + }, { + key: 'on', + value: function on(type, handler) { + this.eventManager.listen(type, handler); + } + + /** + * Unbind eventHandler from event type + * @param {string} type Event type + */ + + }, { + key: 'off', + value: function off(type) { + this.eventManager.removeEventHandler(type); + } + + /** + * Remove Viewer preview from document + */ + + }, { + key: 'remove', + value: function remove() { + this.eventManager.emit('removeEditor'); + this.preview.$el.off('mousedown', _jquery2.default.proxy(this._toggleTask, this)); + this.preview.remove(); + this.options = null; + this.eventManager = null; + this.commandManager = null; + this.convertor = null; + this.preview = null; + } + + /** + * Add hook to Viewer preview's event + * @param {string} type Event type + * @param {function} handler Event handler + */ + + }, { + key: 'addHook', + value: function addHook(type, handler) { + this.eventManager.removeEventHandler(type); + this.eventManager.listen(type, handler); + } + + /** + * Return true + * @returns {boolean} + */ + + }, { + key: 'isViewer', + value: function isViewer() { + return true; + } + + /** + * Return false + * @returns {boolean} + */ + + }, { + key: 'isMarkdownMode', + value: function isMarkdownMode() { + return false; + } + + /** + * Return false + * @returns {boolean} + */ + + }, { + key: 'isWysiwygMode', + value: function isWysiwygMode() { + return false; + } + + /** + * Define extension + * @param {string} name Extension name + * @param {ExtManager~extension} ext extension + */ + + }], [{ + key: 'defineExtension', + value: function defineExtension(name, ext) { + _extManager2.default.defineExtension(name, ext); + } + }]); + + return ToastUIEditorViewer; +}(); + +/** + * check whther is viewer + * @type {boolean} + */ + + +ToastUIEditorViewer.isViewer = true; + +/** + * domUtil instance + * @type {DomUtil} + * @ignore + */ +ToastUIEditorViewer.domUtils = _domUtils2.default; + +/** + * CodeBlockManager instance + * @type {CodeBlockManager} + */ +ToastUIEditorViewer.codeBlockManager = _codeBlockManager2.default; + +/** + * MarkdownIt hightlight instance + * @type {MarkdownIt} + */ +ToastUIEditorViewer.markdownitHighlight = _convertor2.default.getMarkdownitHighlightRenderer(); + +/** + * MarkdownIt instance + * @type {MarkdownIt} + */ +ToastUIEditorViewer.markdownit = _convertor2.default.getMarkdownitRenderer(); + +/** + * @ignore + */ +ToastUIEditorViewer.i18n = null; + +/** + * @ignore + */ +ToastUIEditorViewer.Button = null; + +/** + * @ignore + */ +ToastUIEditorViewer.WwCodeBlockManager = null; + +/** + * @ignore + */ +ToastUIEditorViewer.WwTableManager = null; + +/** + * @ignore + */ +ToastUIEditorViewer.WwTableSelectionManager = null; + +module.exports = ToastUIEditorViewer; + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview default UI + * @author NHN FE Development Lab + */ + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _defaultToolbar = __webpack_require__(97); + +var _defaultToolbar2 = _interopRequireDefault(_defaultToolbar); + +var _tab = __webpack_require__(46); + +var _tab2 = _interopRequireDefault(_tab); + +var _layerpopup = __webpack_require__(7); + +var _layerpopup2 = _interopRequireDefault(_layerpopup); + +var _modeSwitch = __webpack_require__(101); + +var _modeSwitch2 = _interopRequireDefault(_modeSwitch); + +var _popupAddLink = __webpack_require__(102); + +var _popupAddLink2 = _interopRequireDefault(_popupAddLink); + +var _popupAddImage = __webpack_require__(103); + +var _popupAddImage2 = _interopRequireDefault(_popupAddImage); + +var _popupTableUtils = __webpack_require__(104); + +var _popupTableUtils2 = _interopRequireDefault(_popupTableUtils); + +var _popupAddTable = __webpack_require__(105); + +var _popupAddTable2 = _interopRequireDefault(_popupAddTable); + +var _popupAddHeading = __webpack_require__(106); + +var _popupAddHeading2 = _interopRequireDefault(_popupAddHeading); + +var _popupCodeBlockLanguages = __webpack_require__(107); + +var _popupCodeBlockLanguages2 = _interopRequireDefault(_popupCodeBlockLanguages); + +var _popupCodeBlockEditor = __webpack_require__(108); + +var _popupCodeBlockEditor2 = _interopRequireDefault(_popupCodeBlockEditor); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +var _tooltip = __webpack_require__(31); + +var _tooltip2 = _interopRequireDefault(_tooltip); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var CLASS_TOOLBAR = 'te-toolbar-section'; +var CLASS_MARKDOWN_TAB = 'te-markdown-tab-section'; +var CLASS_EDITOR = 'te-editor-section'; +var CLASS_MODE_SWITCH = 'te-mode-switch-section'; +var CONTAINER_TEMPLATE = '\n
    \n
    \n
    \n
    \n
    \n'; + +/** + * Class DefaultUI + * @param {ToastUIEditor} editor - editor instance + */ + +var DefaultUI = function () { + + /** + * mode switch instance + * @private + * @type {ModeSwitch} + */ + + + /** + * markdown tab section jQuery element + * @private + * @type {HTMLElement} + */ + + + /** + * editor type ww/md + * @private + * @type {string} + */ + + + /** + * @type {HTMLElement} + * @private + */ + + + /** + * DefaultToolbar wrapper element + * @type {jQuery} + */ + function DefaultUI(editor) { + _classCallCheck(this, DefaultUI); + + Object.defineProperty(this, 'name', { + enumerable: true, + writable: true, + value: 'default' + }); + Object.defineProperty(this, '_popups', { + enumerable: true, + writable: true, + value: [] + }); + + this._editor = editor; + this._initialEditType = editor.options.initialEditType; + + this._init(editor.options); + this._initEvent(); + } + + /** + * popup instances + * @private + * @type {Array} + */ + + + /** + * markdown tab + * @private + * @type {Tab} + */ + + + /** + * editor instance + * @private + * @type {ToastUIEditor} + */ + + + /** + * editor section element + * @private + * @type {HTMLElement} + */ + + + /** + * DefaultToolbar instance + * @type {DefaultToolbar} + * @private + */ + + /** + * UI name + * @type {string} + */ + + + _createClass(DefaultUI, [{ + key: '_init', + value: function _init(_ref) { + var container = _ref.el, + toolbarItems = _ref.toolbarItems, + hideModeSwitch = _ref.hideModeSwitch; + + this.$el = (0, _jquery2.default)(CONTAINER_TEMPLATE).appendTo(container); + this._container = container; + this._editorSection = this.$el.find('.' + CLASS_EDITOR).get(0); + this._editorSection.appendChild(this._editor.layout.getEditorEl().get(0)); + + this._initToolbar(this._editor.eventManager, toolbarItems); + this._initModeSwitch(hideModeSwitch); + + this._initPopupAddLink(); + this._initPopupAddImage(); + this._initPopupAddTable(); + this._initPopupAddHeading(); + this._initPopupTableUtils(); + this._initPopupCodeBlockLanguages(); + this._initPopupCodeBlockEditor(); + + this._initMarkdownTab(); + } + }, { + key: '_initEvent', + value: function _initEvent() { + this._editor.eventManager.listen('hide', this.hide.bind(this)); + this._editor.eventManager.listen('show', this.show.bind(this)); + this._editor.eventManager.listen('changeMode', this._markdownTabControl.bind(this)); + this._editor.eventManager.listen('changePreviewStyle', this._markdownTabControl.bind(this)); + } + }, { + key: '_initToolbar', + value: function _initToolbar(eventManager, toolbarItems) { + var toolbar = new _defaultToolbar2.default(eventManager, toolbarItems); + this._toolbar = toolbar; + this.$el.find('.' + CLASS_TOOLBAR).append(toolbar.$el); + } + }, { + key: '_initModeSwitch', + value: function _initModeSwitch(hideModeSwitch) { + var _this = this; + + var modeSwitchTabBar = this.$el.find('.' + CLASS_MODE_SWITCH); + var editType = this._initialEditType === 'markdown' ? _modeSwitch2.default.TYPE.MARKDOWN : _modeSwitch2.default.TYPE.WYSIWYG; + var modeSwitch = new _modeSwitch2.default(modeSwitchTabBar, editType); + this._modeSwitch = modeSwitch; + + if (hideModeSwitch) { + modeSwitch.hide(); + } + + modeSwitch.on('modeSwitched', function (ev, type) { + return _this._editor.changeMode(type); + }); + } + }, { + key: '_initMarkdownTab', + value: function _initMarkdownTab() { + var editor = this._editor; + + this._markdownTab = new _tab2.default({ + initName: _i18n2.default.get('Write'), + items: [_i18n2.default.get('Write'), _i18n2.default.get('Preview')], + sections: [editor.layout.getMdEditorContainerEl(), editor.layout.getPreviewEl()] + }); + this._$markdownTabSection = this.$el.find('.' + CLASS_MARKDOWN_TAB); + this._$markdownTabSection.append(this._markdownTab.$el); + + this._markdownTab.on('itemClick', function (ev, itemText) { + if (itemText === _i18n2.default.get('Preview')) { + editor.eventManager.emit('previewNeedsRefresh'); + editor.eventManager.emit('changePreviewTabPreview'); + editor.eventManager.emit('closeAllPopup'); + } else { + editor.getCodeMirror().focus(); + editor.eventManager.emit('changePreviewTabWrite'); + } + }); + } + }, { + key: '_markdownTabControl', + value: function _markdownTabControl() { + if (this._editor.isMarkdownMode() && this._editor.getCurrentPreviewStyle() === 'tab') { + this._$markdownTabSection.show(); + this._markdownTab.activate(_i18n2.default.get('Write')); + } else { + this._$markdownTabSection.hide(); + } + } + }, { + key: '_initPopupAddLink', + value: function _initPopupAddLink() { + this._popups.push(new _popupAddLink2.default({ + $target: this.$el, + editor: this._editor + })); + } + }, { + key: '_initPopupAddImage', + value: function _initPopupAddImage() { + this._popups.push(new _popupAddImage2.default({ + $target: this.$el, + eventManager: this._editor.eventManager + })); + } + }, { + key: '_initPopupAddTable', + value: function _initPopupAddTable() { + this._popups.push(new _popupAddTable2.default({ + $target: this._toolbar.$el, + eventManager: this._editor.eventManager, + $button: this.$el.find('button.tui-table'), + css: { + 'position': 'absolute' + } + })); + } + }, { + key: '_initPopupAddHeading', + value: function _initPopupAddHeading() { + this._popups.push(new _popupAddHeading2.default({ + $target: this._toolbar.$el, + eventManager: this._editor.eventManager, + $button: this.$el.find('button.tui-heading'), + css: { + 'position': 'absolute' + } + })); + } + }, { + key: '_initPopupTableUtils', + value: function _initPopupTableUtils() { + var _this2 = this; + + this._editor.eventManager.listen('contextmenu', function (ev) { + if ((0, _jquery2.default)(ev.data.target).parents('[contenteditable=true] table').length > 0) { + ev.data.preventDefault(); + _this2._editor.eventManager.emit('openPopupTableUtils', ev.data); + } + }); + + this._popups.push(new _popupTableUtils2.default({ + $target: this.$el, + eventManager: this._editor.eventManager + })); + } + }, { + key: '_initPopupCodeBlockLanguages', + value: function _initPopupCodeBlockLanguages() { + var editor = this._editor; + this._popups.push(new _popupCodeBlockLanguages2.default({ + $target: this.$el, + eventManager: editor.eventManager, + languages: editor.options.codeBlockLanguages + })); + } + }, { + key: '_initPopupCodeBlockEditor', + value: function _initPopupCodeBlockEditor() { + this._popups.push(new _popupCodeBlockEditor2.default({ + $target: this.$el, + eventManager: this._editor.eventManager, + convertor: this._editor.convertor + })); + } + + /** + * get toolbar instance + * @returns {Toolbar} - toolbar instance + */ + + }, { + key: 'getToolbar', + value: function getToolbar() { + return this._toolbar; + } + + /** + * set toolbar instance + * @param {Toolbar} toolbar - toolbar + */ + + }, { + key: 'setToolbar', + value: function setToolbar(toolbar) { + this._toolbar.destroy(); + this._toolbar = toolbar; + } + + /** + * get mode switch instance + * @returns {ModeSwitch} - mode switch instance + */ + + }, { + key: 'getModeSwitch', + value: function getModeSwitch() { + return this._modeSwitch; + } + + /** + * get editor section height + * @returns {Number} - height of editor section + */ + + }, { + key: 'getEditorSectionHeight', + value: function getEditorSectionHeight() { + var clientRect = this._editorSection.getBoundingClientRect(); + + return clientRect.bottom - clientRect.top; + } + + /** + * get editor height + * @returns {Number} - height of editor + */ + + }, { + key: 'getEditorHeight', + value: function getEditorHeight() { + var clientRect = this._container.getBoundingClientRect(); + + return clientRect.bottom - clientRect.top; + } + + /** + * get Table Popup + * @returns {PopupTableUtils} - PopupTableUtils + */ + + }, { + key: 'getPopupTableUtils', + value: function getPopupTableUtils() { + var tablePopup = void 0; + this._popups.forEach(function (popup) { + if (popup instanceof _popupTableUtils2.default) { + tablePopup = popup; + } + }); + + return tablePopup; + } + + /** + * hide + */ + + }, { + key: 'hide', + value: function hide() { + this.$el.addClass('te-hide'); + } + + /** + * show + */ + + }, { + key: 'show', + value: function show() { + this.$el.removeClass('te-hide'); + } + + /** + * remove + */ + + }, { + key: 'remove', + value: function remove() { + this.$el.remove(); + this._markdownTab.remove(); + this._modeSwitch.remove(); + this._toolbar.destroy(); + this._popups.forEach(function (popup) { + return popup.remove(); + }); + this._popups = []; + _tooltip2.default.hide(); + } + + /** + * creates popup + * @param {LayerPopupOption} options - layerPopup options + * @returns {LayerPopup} - crated layerPopup + */ + + }, { + key: 'createPopup', + value: function createPopup(options) { + return new _layerpopup2.default(options); + } + }]); + + return DefaultUI; +}(); + +exports.default = DefaultUI; + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _resizeObserverPolyfill = __webpack_require__(98); + +var _resizeObserverPolyfill2 = _interopRequireDefault(_resizeObserverPolyfill); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +var _toolbar = __webpack_require__(43); + +var _toolbar2 = _interopRequireDefault(_toolbar); + +var _popupDropdownToolbar = __webpack_require__(100); + +var _popupDropdownToolbar2 = _interopRequireDefault(_popupDropdownToolbar); + +var _toolbarItemFactory = __webpack_require__(45); + +var _toolbarItemFactory2 = _interopRequireDefault(_toolbarItemFactory); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview implements DefaultToolbar + * @author NHN FE Development Lab + */ + + +var MORE_BUTTON_NAME = 'more'; + +/** + * Class DefaultToolbar + */ + +var DefaultToolbar = function (_Toolbar) { + _inherits(DefaultToolbar, _Toolbar); + + /** + * popup dropdown toolbar + * @type {PopupDropdownToolbar} + * @private + */ + function DefaultToolbar(eventManager, options) { + _classCallCheck(this, DefaultToolbar); + + var _this = _possibleConstructorReturn(this, (DefaultToolbar.__proto__ || Object.getPrototypeOf(DefaultToolbar)).call(this, eventManager, options)); + + _this._init(eventManager); + _this._bindWidthChangedEvent(); + return _this; + } + + /** + * insert toolbar item + * @param {number} index - index at given item inserted + * @param {ToolbarItem|string|object} item - toolbar item + * @override + */ + + + /** + * resize observer + * @type {ResizeObserver} + * @private + */ + + /** + * more button + * @type {ToolbarButton} + * @private + */ + + + _createClass(DefaultToolbar, [{ + key: 'insertItem', + value: function insertItem(index, item) { + _get(DefaultToolbar.prototype.__proto__ || Object.getPrototypeOf(DefaultToolbar.prototype), 'insertItem', this).call(this, index, item); + this._arrangeMoreButton(); + } + }, { + key: '_init', + value: function _init(eventManager) { + var moreButton = _toolbarItemFactory2.default.create('button', { + name: MORE_BUTTON_NAME, + className: 'tui-more', + tooltip: _i18n2.default.get('More'), + event: _popupDropdownToolbar2.default.OPEN_EVENT + }); + this._moreButton = moreButton; + + this._popupDropdownToolbar = new _popupDropdownToolbar2.default({ + eventManager: eventManager, + $target: this.$el, + $button: moreButton.$el + }); + + this.addItem(moreButton); + } + }, { + key: '_bindWidthChangedEvent', + value: function _bindWidthChangedEvent() { + var _this2 = this; + + this._observer = new _resizeObserverPolyfill2.default(function () { + _this2._popupDropdownToolbar.hide(); + _this2._balanceButtons(); + }); + this._observer.observe(this.$el.get(0)); + } + }, { + key: '_balanceButtons', + value: function _balanceButtons() { + var _this3 = this; + + var dropDownToolbarItems = this._popupDropdownToolbar.getItems(); + dropDownToolbarItems.forEach(function (item) { + _this3._popupDropdownToolbar.removeItem(item, false); + + var itemLength = _this3.getItems().length; + _get(DefaultToolbar.prototype.__proto__ || Object.getPrototypeOf(DefaultToolbar.prototype), 'insertItem', _this3).call(_this3, itemLength, item); + }); + + this.removeItem(this._moreButton, false); + _get(DefaultToolbar.prototype.__proto__ || Object.getPrototypeOf(DefaultToolbar.prototype), 'insertItem', this).call(this, 0, this._moreButton); + + var toolbarHeight = this.$el.height(); + var defaultToolbarItems = this.getItems(); + var overflowItems = defaultToolbarItems.filter(function (item) { + return item.$el.position().top > toolbarHeight; + }); + + overflowItems.forEach(function (item) { + _this3.removeItem(item, false); + _this3._popupDropdownToolbar.addItem(item); + }); + + this._arrangeMoreButton(); + } + }, { + key: '_arrangeMoreButton', + value: function _arrangeMoreButton() { + if (!this._popupDropdownToolbar) { + return; + } + + this.removeItem(this._moreButton, false); + + var hasOverflow = this._popupDropdownToolbar.getItems().length > 0; + var itemLength = this.getItems().length; + if (hasOverflow) { + _get(DefaultToolbar.prototype.__proto__ || Object.getPrototypeOf(DefaultToolbar.prototype), 'insertItem', this).call(this, itemLength, this._moreButton); + } + } + + /** + * destroy + * @override + */ + + }, { + key: 'destroy', + value: function destroy() { + if (this._observer) { + this._observer.disconnect(); + this._observer = null; + } + } + }]); + + return DefaultToolbar; +}(_toolbar2.default); + +exports.default = DefaultToolbar; + +/***/ }), +/* 98 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(global) {/** + * A collection of shims that provide minimal functionality of the ES6 collections. + * + * These implementations are not meant to be used outside of the ResizeObserver + * modules as they cover only a limited range of use cases. + */ +/* eslint-disable require-jsdoc, valid-jsdoc */ +var MapShim = (function () { + if (typeof Map !== 'undefined') { + return Map; + } + /** + * Returns index in provided array that matches the specified key. + * + * @param {Array} arr + * @param {*} key + * @returns {number} + */ + function getIndex(arr, key) { + var result = -1; + arr.some(function (entry, index) { + if (entry[0] === key) { + result = index; + return true; + } + return false; + }); + return result; + } + return /** @class */ (function () { + function class_1() { + this.__entries__ = []; + } + Object.defineProperty(class_1.prototype, "size", { + /** + * @returns {boolean} + */ + get: function () { + return this.__entries__.length; + }, + enumerable: true, + configurable: true + }); + /** + * @param {*} key + * @returns {*} + */ + class_1.prototype.get = function (key) { + var index = getIndex(this.__entries__, key); + var entry = this.__entries__[index]; + return entry && entry[1]; + }; + /** + * @param {*} key + * @param {*} value + * @returns {void} + */ + class_1.prototype.set = function (key, value) { + var index = getIndex(this.__entries__, key); + if (~index) { + this.__entries__[index][1] = value; + } + else { + this.__entries__.push([key, value]); + } + }; + /** + * @param {*} key + * @returns {void} + */ + class_1.prototype.delete = function (key) { + var entries = this.__entries__; + var index = getIndex(entries, key); + if (~index) { + entries.splice(index, 1); + } + }; + /** + * @param {*} key + * @returns {void} + */ + class_1.prototype.has = function (key) { + return !!~getIndex(this.__entries__, key); + }; + /** + * @returns {void} + */ + class_1.prototype.clear = function () { + this.__entries__.splice(0); + }; + /** + * @param {Function} callback + * @param {*} [ctx=null] + * @returns {void} + */ + class_1.prototype.forEach = function (callback, ctx) { + if (ctx === void 0) { ctx = null; } + for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) { + var entry = _a[_i]; + callback.call(ctx, entry[1], entry[0]); + } + }; + return class_1; + }()); +})(); + +/** + * Detects whether window and document objects are available in current environment. + */ +var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document; + +// Returns global object of a current environment. +var global$1 = (function () { + if (typeof global !== 'undefined' && global.Math === Math) { + return global; + } + if (typeof self !== 'undefined' && self.Math === Math) { + return self; + } + if (typeof window !== 'undefined' && window.Math === Math) { + return window; + } + // eslint-disable-next-line no-new-func + return Function('return this')(); +})(); + +/** + * A shim for the requestAnimationFrame which falls back to the setTimeout if + * first one is not supported. + * + * @returns {number} Requests' identifier. + */ +var requestAnimationFrame$1 = (function () { + if (typeof requestAnimationFrame === 'function') { + // It's required to use a bounded function because IE sometimes throws + // an "Invalid calling object" error if rAF is invoked without the global + // object on the left hand side. + return requestAnimationFrame.bind(global$1); + } + return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); }; +})(); + +// Defines minimum timeout before adding a trailing call. +var trailingTimeout = 2; +/** + * Creates a wrapper function which ensures that provided callback will be + * invoked only once during the specified delay period. + * + * @param {Function} callback - Function to be invoked after the delay period. + * @param {number} delay - Delay after which to invoke callback. + * @returns {Function} + */ +function throttle (callback, delay) { + var leadingCall = false, trailingCall = false, lastCallTime = 0; + /** + * Invokes the original callback function and schedules new invocation if + * the "proxy" was called during current request. + * + * @returns {void} + */ + function resolvePending() { + if (leadingCall) { + leadingCall = false; + callback(); + } + if (trailingCall) { + proxy(); + } + } + /** + * Callback invoked after the specified delay. It will further postpone + * invocation of the original function delegating it to the + * requestAnimationFrame. + * + * @returns {void} + */ + function timeoutCallback() { + requestAnimationFrame$1(resolvePending); + } + /** + * Schedules invocation of the original function. + * + * @returns {void} + */ + function proxy() { + var timeStamp = Date.now(); + if (leadingCall) { + // Reject immediately following calls. + if (timeStamp - lastCallTime < trailingTimeout) { + return; + } + // Schedule new call to be in invoked when the pending one is resolved. + // This is important for "transitions" which never actually start + // immediately so there is a chance that we might miss one if change + // happens amids the pending invocation. + trailingCall = true; + } + else { + leadingCall = true; + trailingCall = false; + setTimeout(timeoutCallback, delay); + } + lastCallTime = timeStamp; + } + return proxy; +} + +// Minimum delay before invoking the update of observers. +var REFRESH_DELAY = 20; +// A list of substrings of CSS properties used to find transition events that +// might affect dimensions of observed elements. +var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight']; +// Check if MutationObserver is available. +var mutationObserverSupported = typeof MutationObserver !== 'undefined'; +/** + * Singleton controller class which handles updates of ResizeObserver instances. + */ +var ResizeObserverController = /** @class */ (function () { + /** + * Creates a new instance of ResizeObserverController. + * + * @private + */ + function ResizeObserverController() { + /** + * Indicates whether DOM listeners have been added. + * + * @private {boolean} + */ + this.connected_ = false; + /** + * Tells that controller has subscribed for Mutation Events. + * + * @private {boolean} + */ + this.mutationEventsAdded_ = false; + /** + * Keeps reference to the instance of MutationObserver. + * + * @private {MutationObserver} + */ + this.mutationsObserver_ = null; + /** + * A list of connected observers. + * + * @private {Array} + */ + this.observers_ = []; + this.onTransitionEnd_ = this.onTransitionEnd_.bind(this); + this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY); + } + /** + * Adds observer to observers list. + * + * @param {ResizeObserverSPI} observer - Observer to be added. + * @returns {void} + */ + ResizeObserverController.prototype.addObserver = function (observer) { + if (!~this.observers_.indexOf(observer)) { + this.observers_.push(observer); + } + // Add listeners if they haven't been added yet. + if (!this.connected_) { + this.connect_(); + } + }; + /** + * Removes observer from observers list. + * + * @param {ResizeObserverSPI} observer - Observer to be removed. + * @returns {void} + */ + ResizeObserverController.prototype.removeObserver = function (observer) { + var observers = this.observers_; + var index = observers.indexOf(observer); + // Remove observer if it's present in registry. + if (~index) { + observers.splice(index, 1); + } + // Remove listeners if controller has no connected observers. + if (!observers.length && this.connected_) { + this.disconnect_(); + } + }; + /** + * Invokes the update of observers. It will continue running updates insofar + * it detects changes. + * + * @returns {void} + */ + ResizeObserverController.prototype.refresh = function () { + var changesDetected = this.updateObservers_(); + // Continue running updates if changes have been detected as there might + // be future ones caused by CSS transitions. + if (changesDetected) { + this.refresh(); + } + }; + /** + * Updates every observer from observers list and notifies them of queued + * entries. + * + * @private + * @returns {boolean} Returns "true" if any observer has detected changes in + * dimensions of it's elements. + */ + ResizeObserverController.prototype.updateObservers_ = function () { + // Collect observers that have active observations. + var activeObservers = this.observers_.filter(function (observer) { + return observer.gatherActive(), observer.hasActive(); + }); + // Deliver notifications in a separate cycle in order to avoid any + // collisions between observers, e.g. when multiple instances of + // ResizeObserver are tracking the same element and the callback of one + // of them changes content dimensions of the observed target. Sometimes + // this may result in notifications being blocked for the rest of observers. + activeObservers.forEach(function (observer) { return observer.broadcastActive(); }); + return activeObservers.length > 0; + }; + /** + * Initializes DOM listeners. + * + * @private + * @returns {void} + */ + ResizeObserverController.prototype.connect_ = function () { + // Do nothing if running in a non-browser environment or if listeners + // have been already added. + if (!isBrowser || this.connected_) { + return; + } + // Subscription to the "Transitionend" event is used as a workaround for + // delayed transitions. This way it's possible to capture at least the + // final state of an element. + document.addEventListener('transitionend', this.onTransitionEnd_); + window.addEventListener('resize', this.refresh); + if (mutationObserverSupported) { + this.mutationsObserver_ = new MutationObserver(this.refresh); + this.mutationsObserver_.observe(document, { + attributes: true, + childList: true, + characterData: true, + subtree: true + }); + } + else { + document.addEventListener('DOMSubtreeModified', this.refresh); + this.mutationEventsAdded_ = true; + } + this.connected_ = true; + }; + /** + * Removes DOM listeners. + * + * @private + * @returns {void} + */ + ResizeObserverController.prototype.disconnect_ = function () { + // Do nothing if running in a non-browser environment or if listeners + // have been already removed. + if (!isBrowser || !this.connected_) { + return; + } + document.removeEventListener('transitionend', this.onTransitionEnd_); + window.removeEventListener('resize', this.refresh); + if (this.mutationsObserver_) { + this.mutationsObserver_.disconnect(); + } + if (this.mutationEventsAdded_) { + document.removeEventListener('DOMSubtreeModified', this.refresh); + } + this.mutationsObserver_ = null; + this.mutationEventsAdded_ = false; + this.connected_ = false; + }; + /** + * "Transitionend" event handler. + * + * @private + * @param {TransitionEvent} event + * @returns {void} + */ + ResizeObserverController.prototype.onTransitionEnd_ = function (_a) { + var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b; + // Detect whether transition may affect dimensions of an element. + var isReflowProperty = transitionKeys.some(function (key) { + return !!~propertyName.indexOf(key); + }); + if (isReflowProperty) { + this.refresh(); + } + }; + /** + * Returns instance of the ResizeObserverController. + * + * @returns {ResizeObserverController} + */ + ResizeObserverController.getInstance = function () { + if (!this.instance_) { + this.instance_ = new ResizeObserverController(); + } + return this.instance_; + }; + /** + * Holds reference to the controller's instance. + * + * @private {ResizeObserverController} + */ + ResizeObserverController.instance_ = null; + return ResizeObserverController; +}()); + +/** + * Defines non-writable/enumerable properties of the provided target object. + * + * @param {Object} target - Object for which to define properties. + * @param {Object} props - Properties to be defined. + * @returns {Object} Target object. + */ +var defineConfigurable = (function (target, props) { + for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) { + var key = _a[_i]; + Object.defineProperty(target, key, { + value: props[key], + enumerable: false, + writable: false, + configurable: true + }); + } + return target; +}); + +/** + * Returns the global object associated with provided element. + * + * @param {Object} target + * @returns {Object} + */ +var getWindowOf = (function (target) { + // Assume that the element is an instance of Node, which means that it + // has the "ownerDocument" property from which we can retrieve a + // corresponding global object. + var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; + // Return the local global object if it's not possible extract one from + // provided element. + return ownerGlobal || global$1; +}); + +// Placeholder of an empty content rectangle. +var emptyRect = createRectInit(0, 0, 0, 0); +/** + * Converts provided string to a number. + * + * @param {number|string} value + * @returns {number} + */ +function toFloat(value) { + return parseFloat(value) || 0; +} +/** + * Extracts borders size from provided styles. + * + * @param {CSSStyleDeclaration} styles + * @param {...string} positions - Borders positions (top, right, ...) + * @returns {number} + */ +function getBordersSize(styles) { + var positions = []; + for (var _i = 1; _i < arguments.length; _i++) { + positions[_i - 1] = arguments[_i]; + } + return positions.reduce(function (size, position) { + var value = styles['border-' + position + '-width']; + return size + toFloat(value); + }, 0); +} +/** + * Extracts paddings sizes from provided styles. + * + * @param {CSSStyleDeclaration} styles + * @returns {Object} Paddings box. + */ +function getPaddings(styles) { + var positions = ['top', 'right', 'bottom', 'left']; + var paddings = {}; + for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) { + var position = positions_1[_i]; + var value = styles['padding-' + position]; + paddings[position] = toFloat(value); + } + return paddings; +} +/** + * Calculates content rectangle of provided SVG element. + * + * @param {SVGGraphicsElement} target - Element content rectangle of which needs + * to be calculated. + * @returns {DOMRectInit} + */ +function getSVGContentRect(target) { + var bbox = target.getBBox(); + return createRectInit(0, 0, bbox.width, bbox.height); +} +/** + * Calculates content rectangle of provided HTMLElement. + * + * @param {HTMLElement} target - Element for which to calculate the content rectangle. + * @returns {DOMRectInit} + */ +function getHTMLElementContentRect(target) { + // Client width & height properties can't be + // used exclusively as they provide rounded values. + var clientWidth = target.clientWidth, clientHeight = target.clientHeight; + // By this condition we can catch all non-replaced inline, hidden and + // detached elements. Though elements with width & height properties less + // than 0.5 will be discarded as well. + // + // Without it we would need to implement separate methods for each of + // those cases and it's not possible to perform a precise and performance + // effective test for hidden elements. E.g. even jQuery's ':visible' filter + // gives wrong results for elements with width & height less than 0.5. + if (!clientWidth && !clientHeight) { + return emptyRect; + } + var styles = getWindowOf(target).getComputedStyle(target); + var paddings = getPaddings(styles); + var horizPad = paddings.left + paddings.right; + var vertPad = paddings.top + paddings.bottom; + // Computed styles of width & height are being used because they are the + // only dimensions available to JS that contain non-rounded values. It could + // be possible to utilize the getBoundingClientRect if only it's data wasn't + // affected by CSS transformations let alone paddings, borders and scroll bars. + var width = toFloat(styles.width), height = toFloat(styles.height); + // Width & height include paddings and borders when the 'border-box' box + // model is applied (except for IE). + if (styles.boxSizing === 'border-box') { + // Following conditions are required to handle Internet Explorer which + // doesn't include paddings and borders to computed CSS dimensions. + // + // We can say that if CSS dimensions + paddings are equal to the "client" + // properties then it's either IE, and thus we don't need to subtract + // anything, or an element merely doesn't have paddings/borders styles. + if (Math.round(width + horizPad) !== clientWidth) { + width -= getBordersSize(styles, 'left', 'right') + horizPad; + } + if (Math.round(height + vertPad) !== clientHeight) { + height -= getBordersSize(styles, 'top', 'bottom') + vertPad; + } + } + // Following steps can't be applied to the document's root element as its + // client[Width/Height] properties represent viewport area of the window. + // Besides, it's as well not necessary as the itself neither has + // rendered scroll bars nor it can be clipped. + if (!isDocumentElement(target)) { + // In some browsers (only in Firefox, actually) CSS width & height + // include scroll bars size which can be removed at this step as scroll + // bars are the only difference between rounded dimensions + paddings + // and "client" properties, though that is not always true in Chrome. + var vertScrollbar = Math.round(width + horizPad) - clientWidth; + var horizScrollbar = Math.round(height + vertPad) - clientHeight; + // Chrome has a rather weird rounding of "client" properties. + // E.g. for an element with content width of 314.2px it sometimes gives + // the client width of 315px and for the width of 314.7px it may give + // 314px. And it doesn't happen all the time. So just ignore this delta + // as a non-relevant. + if (Math.abs(vertScrollbar) !== 1) { + width -= vertScrollbar; + } + if (Math.abs(horizScrollbar) !== 1) { + height -= horizScrollbar; + } + } + return createRectInit(paddings.left, paddings.top, width, height); +} +/** + * Checks whether provided element is an instance of the SVGGraphicsElement. + * + * @param {Element} target - Element to be checked. + * @returns {boolean} + */ +var isSVGGraphicsElement = (function () { + // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement + // interface. + if (typeof SVGGraphicsElement !== 'undefined') { + return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; }; + } + // If it's so, then check that element is at least an instance of the + // SVGElement and that it has the "getBBox" method. + // eslint-disable-next-line no-extra-parens + return function (target) { return (target instanceof getWindowOf(target).SVGElement && + typeof target.getBBox === 'function'); }; +})(); +/** + * Checks whether provided element is a document element (). + * + * @param {Element} target - Element to be checked. + * @returns {boolean} + */ +function isDocumentElement(target) { + return target === getWindowOf(target).document.documentElement; +} +/** + * Calculates an appropriate content rectangle for provided html or svg element. + * + * @param {Element} target - Element content rectangle of which needs to be calculated. + * @returns {DOMRectInit} + */ +function getContentRect(target) { + if (!isBrowser) { + return emptyRect; + } + if (isSVGGraphicsElement(target)) { + return getSVGContentRect(target); + } + return getHTMLElementContentRect(target); +} +/** + * Creates rectangle with an interface of the DOMRectReadOnly. + * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly + * + * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions. + * @returns {DOMRectReadOnly} + */ +function createReadOnlyRect(_a) { + var x = _a.x, y = _a.y, width = _a.width, height = _a.height; + // If DOMRectReadOnly is available use it as a prototype for the rectangle. + var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object; + var rect = Object.create(Constr.prototype); + // Rectangle's properties are not writable and non-enumerable. + defineConfigurable(rect, { + x: x, y: y, width: width, height: height, + top: y, + right: x + width, + bottom: height + y, + left: x + }); + return rect; +} +/** + * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates. + * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit + * + * @param {number} x - X coordinate. + * @param {number} y - Y coordinate. + * @param {number} width - Rectangle's width. + * @param {number} height - Rectangle's height. + * @returns {DOMRectInit} + */ +function createRectInit(x, y, width, height) { + return { x: x, y: y, width: width, height: height }; +} + +/** + * Class that is responsible for computations of the content rectangle of + * provided DOM element and for keeping track of it's changes. + */ +var ResizeObservation = /** @class */ (function () { + /** + * Creates an instance of ResizeObservation. + * + * @param {Element} target - Element to be observed. + */ + function ResizeObservation(target) { + /** + * Broadcasted width of content rectangle. + * + * @type {number} + */ + this.broadcastWidth = 0; + /** + * Broadcasted height of content rectangle. + * + * @type {number} + */ + this.broadcastHeight = 0; + /** + * Reference to the last observed content rectangle. + * + * @private {DOMRectInit} + */ + this.contentRect_ = createRectInit(0, 0, 0, 0); + this.target = target; + } + /** + * Updates content rectangle and tells whether it's width or height properties + * have changed since the last broadcast. + * + * @returns {boolean} + */ + ResizeObservation.prototype.isActive = function () { + var rect = getContentRect(this.target); + this.contentRect_ = rect; + return (rect.width !== this.broadcastWidth || + rect.height !== this.broadcastHeight); + }; + /** + * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data + * from the corresponding properties of the last observed content rectangle. + * + * @returns {DOMRectInit} Last observed content rectangle. + */ + ResizeObservation.prototype.broadcastRect = function () { + var rect = this.contentRect_; + this.broadcastWidth = rect.width; + this.broadcastHeight = rect.height; + return rect; + }; + return ResizeObservation; +}()); + +var ResizeObserverEntry = /** @class */ (function () { + /** + * Creates an instance of ResizeObserverEntry. + * + * @param {Element} target - Element that is being observed. + * @param {DOMRectInit} rectInit - Data of the element's content rectangle. + */ + function ResizeObserverEntry(target, rectInit) { + var contentRect = createReadOnlyRect(rectInit); + // According to the specification following properties are not writable + // and are also not enumerable in the native implementation. + // + // Property accessors are not being used as they'd require to define a + // private WeakMap storage which may cause memory leaks in browsers that + // don't support this type of collections. + defineConfigurable(this, { target: target, contentRect: contentRect }); + } + return ResizeObserverEntry; +}()); + +var ResizeObserverSPI = /** @class */ (function () { + /** + * Creates a new instance of ResizeObserver. + * + * @param {ResizeObserverCallback} callback - Callback function that is invoked + * when one of the observed elements changes it's content dimensions. + * @param {ResizeObserverController} controller - Controller instance which + * is responsible for the updates of observer. + * @param {ResizeObserver} callbackCtx - Reference to the public + * ResizeObserver instance which will be passed to callback function. + */ + function ResizeObserverSPI(callback, controller, callbackCtx) { + /** + * Collection of resize observations that have detected changes in dimensions + * of elements. + * + * @private {Array} + */ + this.activeObservations_ = []; + /** + * Registry of the ResizeObservation instances. + * + * @private {Map} + */ + this.observations_ = new MapShim(); + if (typeof callback !== 'function') { + throw new TypeError('The callback provided as parameter 1 is not a function.'); + } + this.callback_ = callback; + this.controller_ = controller; + this.callbackCtx_ = callbackCtx; + } + /** + * Starts observing provided element. + * + * @param {Element} target - Element to be observed. + * @returns {void} + */ + ResizeObserverSPI.prototype.observe = function (target) { + if (!arguments.length) { + throw new TypeError('1 argument required, but only 0 present.'); + } + // Do nothing if current environment doesn't have the Element interface. + if (typeof Element === 'undefined' || !(Element instanceof Object)) { + return; + } + if (!(target instanceof getWindowOf(target).Element)) { + throw new TypeError('parameter 1 is not of type "Element".'); + } + var observations = this.observations_; + // Do nothing if element is already being observed. + if (observations.has(target)) { + return; + } + observations.set(target, new ResizeObservation(target)); + this.controller_.addObserver(this); + // Force the update of observations. + this.controller_.refresh(); + }; + /** + * Stops observing provided element. + * + * @param {Element} target - Element to stop observing. + * @returns {void} + */ + ResizeObserverSPI.prototype.unobserve = function (target) { + if (!arguments.length) { + throw new TypeError('1 argument required, but only 0 present.'); + } + // Do nothing if current environment doesn't have the Element interface. + if (typeof Element === 'undefined' || !(Element instanceof Object)) { + return; + } + if (!(target instanceof getWindowOf(target).Element)) { + throw new TypeError('parameter 1 is not of type "Element".'); + } + var observations = this.observations_; + // Do nothing if element is not being observed. + if (!observations.has(target)) { + return; + } + observations.delete(target); + if (!observations.size) { + this.controller_.removeObserver(this); + } + }; + /** + * Stops observing all elements. + * + * @returns {void} + */ + ResizeObserverSPI.prototype.disconnect = function () { + this.clearActive(); + this.observations_.clear(); + this.controller_.removeObserver(this); + }; + /** + * Collects observation instances the associated element of which has changed + * it's content rectangle. + * + * @returns {void} + */ + ResizeObserverSPI.prototype.gatherActive = function () { + var _this = this; + this.clearActive(); + this.observations_.forEach(function (observation) { + if (observation.isActive()) { + _this.activeObservations_.push(observation); + } + }); + }; + /** + * Invokes initial callback function with a list of ResizeObserverEntry + * instances collected from active resize observations. + * + * @returns {void} + */ + ResizeObserverSPI.prototype.broadcastActive = function () { + // Do nothing if observer doesn't have active observations. + if (!this.hasActive()) { + return; + } + var ctx = this.callbackCtx_; + // Create ResizeObserverEntry instance for every active observation. + var entries = this.activeObservations_.map(function (observation) { + return new ResizeObserverEntry(observation.target, observation.broadcastRect()); + }); + this.callback_.call(ctx, entries, ctx); + this.clearActive(); + }; + /** + * Clears the collection of active observations. + * + * @returns {void} + */ + ResizeObserverSPI.prototype.clearActive = function () { + this.activeObservations_.splice(0); + }; + /** + * Tells whether observer has active observations. + * + * @returns {boolean} + */ + ResizeObserverSPI.prototype.hasActive = function () { + return this.activeObservations_.length > 0; + }; + return ResizeObserverSPI; +}()); + +// Registry of internal observers. If WeakMap is not available use current shim +// for the Map collection as it has all required methods and because WeakMap +// can't be fully polyfilled anyway. +var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim(); +/** + * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation + * exposing only those methods and properties that are defined in the spec. + */ +var ResizeObserver = /** @class */ (function () { + /** + * Creates a new instance of ResizeObserver. + * + * @param {ResizeObserverCallback} callback - Callback that is invoked when + * dimensions of the observed elements change. + */ + function ResizeObserver(callback) { + if (!(this instanceof ResizeObserver)) { + throw new TypeError('Cannot call a class as a function.'); + } + if (!arguments.length) { + throw new TypeError('1 argument required, but only 0 present.'); + } + var controller = ResizeObserverController.getInstance(); + var observer = new ResizeObserverSPI(callback, controller, this); + observers.set(this, observer); + } + return ResizeObserver; +}()); +// Expose public methods of ResizeObserver. +[ + 'observe', + 'unobserve', + 'disconnect' +].forEach(function (method) { + ResizeObserver.prototype[method] = function () { + var _a; + return (_a = observers.get(this))[method].apply(_a, arguments); + }; +}); + +var index = (function () { + // Export existing implementation if available. + if (typeof global$1.ResizeObserver !== 'undefined') { + return global$1.ResizeObserver; + } + return ResizeObserver; +})(); + +/* harmony default export */ __webpack_exports__["default"] = (index); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(11))) + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _button = __webpack_require__(21); + +var _button2 = _interopRequireDefault(_button); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements UI Button + * @author NHN FE Development Lab + */ + + +/** + * Toolbar Button UI + * @ignore + */ +var ToolbarButton = function (_Button) { + _inherits(ToolbarButton, _Button); + + function ToolbarButton() { + _classCallCheck(this, ToolbarButton); + + return _possibleConstructorReturn(this, (ToolbarButton.__proto__ || Object.getPrototypeOf(ToolbarButton)).apply(this, arguments)); + } + + return ToolbarButton; +}(_button2.default); + +exports.default = ToolbarButton; + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _layerpopup = __webpack_require__(7); + +var _layerpopup2 = _interopRequireDefault(_layerpopup); + +var _toolbar = __webpack_require__(43); + +var _toolbar2 = _interopRequireDefault(_toolbar); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview implements DefaultToolbar + * @author NHN FE Development Lab + */ + + +/** + * Class PopupDropdownToolbar + * @param {LayerPopupOption} options - layer popup option + * @ignore + */ +var PopupDropdownToolbar = function (_LayerPopup) { + _inherits(PopupDropdownToolbar, _LayerPopup); + + function PopupDropdownToolbar(options) { + _classCallCheck(this, PopupDropdownToolbar); + + options = _tuiCodeSnippet2.default.extend({ + header: false, + className: 'te-dropdown-toolbar' + }, options); + return _possibleConstructorReturn(this, (PopupDropdownToolbar.__proto__ || Object.getPrototypeOf(PopupDropdownToolbar)).call(this, options)); + } + + /** + * get toolbar instance it contains + * @returns {Toolbar} - toolbar instance + */ + + /** + * open event string + * @type {string} + */ + + + _createClass(PopupDropdownToolbar, [{ + key: 'getToolbar', + value: function getToolbar() { + return this._toolbar; + } + + /** + * get toolbar items + * @returns {ToolbarItem[]} - toolbar items + */ + + }, { + key: 'getItems', + value: function getItems() { + return this.getToolbar().getItems(); + } + + /** + * get toolbar item at given index + * @param {number} index - item index + * @returns {ToolbarItem} - toolbar item at the index + */ + + }, { + key: 'getItem', + value: function getItem(index) { + return this.getToolbar().getItem(index); + } + + /** + * set toolbar items + * @param {ToolbarItem[]} items - toolbar items + */ + + }, { + key: 'setItems', + value: function setItems(items) { + this.getToolbar().setItems(items); + } + + /** + * add toolbar item + * @param {ToolbarItem|string|object} item - toolbar item + */ + + }, { + key: 'addItem', + value: function addItem(item) { + this.getToolbar().addItem(item); + } + + /** + * insert toolbar item + * @param {number} index - index at given item inserted + * @param {ToolbarItem|string|object} item - toolbar item + */ + + }, { + key: 'insertItem', + value: function insertItem(index, item) { + this.getToolbar().insertItem(index, item); + } + + /** + * get index of given item + * @param {ToolbarItem} item - toolbar item + * @returns {number} - index of given toolbar item + */ + + }, { + key: 'indexOfItem', + value: function indexOfItem(item) { + return this.getToolbar().indexOfItem(item); + } + + /** + * remove an item + * @param {number} index - item index to remove + * @param {boolean} destroy - destroy item or not + * @returns {ToolbarItem} - removed item + */ + + }, { + key: 'removeItem', + value: function removeItem(index, destroy) { + return this.getToolbar().removeItem(index, destroy); + } + + /** + * remove all toolbar items + */ + + }, { + key: 'removeAllItems', + value: function removeAllItems() { + this.getToolbar().removeAllItems(); + } + + /** + * init instance. + * store properties & prepare before initialize DOM + * @param {LayerPopupOption} options - layer popup options + * @private + * @override + */ + + }, { + key: '_initInstance', + value: function _initInstance(options) { + _get(PopupDropdownToolbar.prototype.__proto__ || Object.getPrototypeOf(PopupDropdownToolbar.prototype), '_initInstance', this).call(this, options); + + var $button = options.$button, + eventManager = options.eventManager; + + + this._$button = $button; + this._eventManager = eventManager; + this._toolbar = new _toolbar2.default(eventManager); + } + + /** + * initialize DOM, render popup + * @private + * @override + */ + + }, { + key: '_initDOM', + value: function _initDOM() { + _get(PopupDropdownToolbar.prototype.__proto__ || Object.getPrototypeOf(PopupDropdownToolbar.prototype), '_initDOM', this).call(this); + + this.setContent(this._toolbar.$el); + } + + /** + * bind editor events + * @private + * @override + */ + + }, { + key: '_initEditorEvent', + value: function _initEditorEvent() { + var _this2 = this; + + _get(PopupDropdownToolbar.prototype.__proto__ || Object.getPrototypeOf(PopupDropdownToolbar.prototype), '_initEditorEvent', this).call(this); + + this._eventManager.listen('focus', function () { + return _this2.hide(); + }); + this._eventManager.listen('closeAllPopup', function () { + return _this2.hide(); + }); + this._eventManager.listen(PopupDropdownToolbar.OPEN_EVENT, function () { + var isShown = _this2.isShow(); + _this2._eventManager.emit('closeAllPopup'); + if (!isShown) { + _this2.show(); + } + + // to give toolbar element enough width before the calculation + _this2.$el.css({ + left: '-1000px' + }); + var $button = _this2._$button; + var position = $button.position(); + var buttonOuterHeightWithMargin = $button.outerHeight(true); + var buttonMarginBottom = (buttonOuterHeightWithMargin - $button.outerHeight()) / 2; + var top = position.top + buttonOuterHeightWithMargin - buttonMarginBottom; + var left = position.left + $button.outerWidth(true) - _this2.$el.outerWidth(true); + + _this2.$el.css({ + top: top, + left: left + }); + }); + } + }]); + + return PopupDropdownToolbar; +}(_layerpopup2.default); + +Object.defineProperty(PopupDropdownToolbar, 'OPEN_EVENT', { + enumerable: true, + writable: true, + value: 'openDropdownToolbar' +}); +exports.default = PopupDropdownToolbar; + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _uicontroller = __webpack_require__(14); + +var _uicontroller2 = _interopRequireDefault(_uicontroller); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements ui mode switch + * @author NHN FE Development Lab + */ + + +var MARKDOWN = 'markdown'; +var WYSIWYG = 'wysiwyg'; + +/** + * Class ModeSwitch + * UI Control for switch between Markdown and WYSIWYG + * @param {jQuery} $rootElement - root jquery element + * @param {string} initialType - initial type of editor + */ + +var ModeSwitch = function (_UIController) { + _inherits(ModeSwitch, _UIController); + + /** + * current mode + * @type {String} + * @private + */ + + /** + * mode switch type + * @property {string} MARKDOWN - Markdown + * @property {string} WYSIWYG - WYSIWYG + * @static + * @ignore + */ + function ModeSwitch($rootElement, initialType) { + _classCallCheck(this, ModeSwitch); + + var _this = _possibleConstructorReturn(this, (ModeSwitch.__proto__ || Object.getPrototypeOf(ModeSwitch)).call(this, { + tagName: 'div', + className: 'te-mode-switch' + })); + + Object.defineProperty(_this, '_buttons', { + enumerable: true, + writable: true, + value: {} + }); + + + _this._render($rootElement); + _this._switchType(_tuiCodeSnippet2.default.isExisty(initialType) ? initialType : MARKDOWN); + return _this; + } + + /** + * is the switch tab bar shown + * @returns {Boolean} - showing status + */ + + + /** + * root element + * @type {jQuery} + * @private + */ + + + /** + * mode switch buttons + * @type {Object} + * @private + */ + + + _createClass(ModeSwitch, [{ + key: 'isShown', + value: function isShown() { + return this._$rootElement.css('display') === 'block'; + } + + /** + * show switch tab bar + */ + + }, { + key: 'show', + value: function show() { + this._$rootElement.css('display', 'block'); + } + + /** + * hide switch tab bar + */ + + }, { + key: 'hide', + value: function hide() { + this._$rootElement.css('display', 'none'); + } + }, { + key: '_render', + value: function _render($rootElement) { + this._buttons.$markdown = (0, _jquery2.default)(''); + this._buttons.$wysiwyg = (0, _jquery2.default)(''); + this.$el.append(this._buttons.$markdown); + this.$el.append(this._buttons.$wysiwyg); + + if ($rootElement) { + $rootElement.append(this.$el); + this._$rootElement = $rootElement; + } + + this.on('click .markdown', this._changeMarkdown.bind(this)); + this.on('click .wysiwyg', this._changeWysiwyg.bind(this)); + + this.show(); + } + }, { + key: '_changeMarkdown', + value: function _changeMarkdown() { + this._switchType(MARKDOWN); + } + }, { + key: '_changeWysiwyg', + value: function _changeWysiwyg() { + this._switchType(WYSIWYG); + } + }, { + key: '_setActiveButton', + value: function _setActiveButton(type) { + this._buttons.$markdown.removeClass('active'); + this._buttons.$wysiwyg.removeClass('active'); + this._buttons['$' + type].addClass('active'); + } + }, { + key: '_switchType', + value: function _switchType(type) { + if (this._type === type) { + return; + } + + this._type = type; + this._setActiveButton(type); + this.trigger('modeSwitched', this._type); + } + }]); + + return ModeSwitch; +}(_uicontroller2.default); + +Object.defineProperty(ModeSwitch, 'TYPE', { + enumerable: true, + writable: true, + value: { + MARKDOWN: MARKDOWN, + WYSIWYG: WYSIWYG + } +}); +exports.default = ModeSwitch; + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _layerpopup = __webpack_require__(7); + +var _layerpopup2 = _interopRequireDefault(_layerpopup); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements PopupAddLink + * @author NHN FE Development Lab + */ + + +var URL_REGEX = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/; + +/** + * Class PopupAddLink + * It implements a link Add Popup + * @param {LayerPopupOption} options - layer popup options + * @ignore + */ + +var PopupAddLink = function (_LayerPopup) { + _inherits(PopupAddLink, _LayerPopup); + + function PopupAddLink(options) { + _classCallCheck(this, PopupAddLink); + + var POPUP_CONTENT = '\n \n \n \n \n
    \n \n \n
    \n '; + options = _tuiCodeSnippet2.default.extend({ + header: true, + title: _i18n2.default.get('Insert link'), + className: 'te-popup-add-link tui-editor-popup', + content: POPUP_CONTENT + }, options); + return _possibleConstructorReturn(this, (PopupAddLink.__proto__ || Object.getPrototypeOf(PopupAddLink)).call(this, options)); + } + + /** + * init instance. + * store properties & prepare before initialize DOM + * @param {LayerPopupOption} options - layer popup options + * @private + * @override + */ + + + _createClass(PopupAddLink, [{ + key: '_initInstance', + value: function _initInstance(options) { + _get(PopupAddLink.prototype.__proto__ || Object.getPrototypeOf(PopupAddLink.prototype), '_initInstance', this).call(this, options); + + this._editor = options.editor; + this._eventManager = options.editor.eventManager; + } + + /** + * initialize DOM, render popup + * @private + * @override + */ + + }, { + key: '_initDOM', + value: function _initDOM() { + _get(PopupAddLink.prototype.__proto__ || Object.getPrototypeOf(PopupAddLink.prototype), '_initDOM', this).call(this); + + var el = this.$el.get(0); + this._inputText = el.querySelector('.te-link-text-input'); + this._inputURL = el.querySelector('.te-url-input'); + } + + /** + * bind DOM events + * @private + * @override + */ + + }, { + key: '_initDOMEvent', + value: function _initDOMEvent() { + var _this2 = this; + + _get(PopupAddLink.prototype.__proto__ || Object.getPrototypeOf(PopupAddLink.prototype), '_initDOMEvent', this).call(this); + + this.on('click .te-close-button', function () { + return _this2.hide(); + }); + this.on('click .te-ok-button', function () { + return _this2._addLink(); + }); + + this.on('shown', function () { + var inputText = _this2._inputText; + var inputURL = _this2._inputURL; + + var selectedText = _this2._editor.getSelectedText().trim(); + + inputText.value = selectedText; + if (URL_REGEX.exec(selectedText)) { + inputURL.value = selectedText; + } + + inputURL.focus(); + }); + + this.on('hidden', function () { + _this2._resetInputs(); + }); + } + + /** + * bind editor events + * @private + * @override + */ + + }, { + key: '_initEditorEvent', + value: function _initEditorEvent() { + var _this3 = this; + + _get(PopupAddLink.prototype.__proto__ || Object.getPrototypeOf(PopupAddLink.prototype), '_initEditorEvent', this).call(this); + + var eventManager = this._eventManager; + eventManager.listen('focus', function () { + return _this3.hide(); + }); + eventManager.listen('closeAllPopup', function () { + return _this3.hide(); + }); + eventManager.listen('openPopupAddLink', function () { + eventManager.emit('closeAllPopup'); + _this3.show(); + }); + } + }, { + key: '_addLink', + value: function _addLink() { + var _getValue2 = this._getValue(), + url = _getValue2.url, + linkText = _getValue2.linkText; + + this._clearValidationStyle(); + + if (linkText.length < 1) { + (0, _jquery2.default)(this._inputText).addClass('wrong'); + + return; + } + if (url.length < 1) { + (0, _jquery2.default)(this._inputURL).addClass('wrong'); + + return; + } + + this._eventManager.emit('command', 'AddLink', { + linkText: linkText, + url: url + }); + this.hide(); + } + }, { + key: '_getValue', + value: function _getValue() { + var url = this._inputURL.value; + var linkText = this._inputText.value; + + return { + url: url, + linkText: linkText + }; + } + }, { + key: '_clearValidationStyle', + value: function _clearValidationStyle() { + (0, _jquery2.default)(this._inputURL).removeClass('wrong'); + (0, _jquery2.default)(this._inputText).removeClass('wrong'); + } + }, { + key: '_resetInputs', + value: function _resetInputs() { + this._inputText.value = ''; + this._inputURL.value = ''; + this._clearValidationStyle(); + } + }]); + + return PopupAddLink; +}(_layerpopup2.default); + +exports.default = PopupAddLink; + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _layerpopup = __webpack_require__(7); + +var _layerpopup2 = _interopRequireDefault(_layerpopup); + +var _tab = __webpack_require__(46); + +var _tab2 = _interopRequireDefault(_tab); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements PopupAddImage + * @author NHN FE Development Lab + */ + + +var CLASS_IMAGE_URL_INPUT = 'te-image-url-input'; +var CLASS_IMAGE_FILE_INPUT = 'te-image-file-input'; +var CLASS_ALT_TEXT_INPUT = 'te-alt-text-input'; +var CLASS_OK_BUTTON = 'te-ok-button'; +var CLASS_CLOSE_BUTTON = 'te-close-button'; +var CLASS_FILE_TYPE = 'te-file-type'; +var CLASS_URL_TYPE = 'te-url-type'; +var CLASS_TAB_SECTION = 'te-tab-section'; +var TYPE_UI = 'ui'; + +/** + * Class PopupAddImage + * It implements a Image Add Popup + * @param {LayerPopupOption} options - layer popup option + * @ignore + */ + +var PopupAddImage = function (_LayerPopup) { + _inherits(PopupAddImage, _LayerPopup); + + function PopupAddImage(options) { + _classCallCheck(this, PopupAddImage); + + var POPUP_CONTENT = '\n
    \n
    \n \n \n
    \n
    \n \n \n
    \n \n \n
    \n \n \n
    \n '; + options = _tuiCodeSnippet2.default.extend({ + header: true, + title: _i18n2.default.get('Insert image'), + className: 'te-popup-add-image tui-editor-popup', + content: POPUP_CONTENT + }, options); + return _possibleConstructorReturn(this, (PopupAddImage.__proto__ || Object.getPrototypeOf(PopupAddImage)).call(this, options)); + } + + /** + * init instance. + * store properties & prepare before initialize DOM + * @param {LayerPopupOption} options - layer popup options + * @private + * @override + */ + + + _createClass(PopupAddImage, [{ + key: '_initInstance', + value: function _initInstance(options) { + _get(PopupAddImage.prototype.__proto__ || Object.getPrototypeOf(PopupAddImage.prototype), '_initInstance', this).call(this, options); + + this.eventManager = options.eventManager; + } + + /** + * initialize DOM, render popup + * @private + * @override + */ + + }, { + key: '_initDOM', + value: function _initDOM() { + _get(PopupAddImage.prototype.__proto__ || Object.getPrototypeOf(PopupAddImage.prototype), '_initDOM', this).call(this); + + var $popup = this.$el; + + this._$imageUrlInput = $popup.find('.' + CLASS_IMAGE_URL_INPUT); + this._$imageFileInput = $popup.find('.' + CLASS_IMAGE_FILE_INPUT); + this._$altTextInput = $popup.find('.' + CLASS_ALT_TEXT_INPUT); + + var $fileTypeSection = $popup.find('.' + CLASS_FILE_TYPE); + var $urlTypeSection = $popup.find('.' + CLASS_URL_TYPE); + var $tabSection = this.$body.find('.' + CLASS_TAB_SECTION); + this.tab = new _tab2.default({ + initName: _i18n2.default.get('File'), + items: [_i18n2.default.get('File'), _i18n2.default.get('URL')], + sections: [$fileTypeSection, $urlTypeSection] + }); + $tabSection.append(this.tab.$el); + } + + /** + * bind DOM events + * @private + * @override + */ + + }, { + key: '_initDOMEvent', + value: function _initDOMEvent() { + var _this2 = this; + + _get(PopupAddImage.prototype.__proto__ || Object.getPrototypeOf(PopupAddImage.prototype), '_initDOMEvent', this).call(this); + + this.on('shown', function () { + return _this2._$imageUrlInput.focus(); + }); + this.on('hidden', function () { + return _this2._resetInputs(); + }); + + this.on('change .' + CLASS_IMAGE_FILE_INPUT, function () { + var filename = _this2._$imageFileInput.val().split('\\').pop(); + _this2._$altTextInput.val(filename); + }); + + this.on('click .' + CLASS_CLOSE_BUTTON, function () { + return _this2.hide(); + }); + this.on('click .' + CLASS_OK_BUTTON, function () { + var imageUrl = _this2._$imageUrlInput.val(); + var altText = _this2._$altTextInput.val(); + + if (imageUrl) { + _this2._applyImage(imageUrl, altText); + } else { + var _$imageFileInput$get = _this2._$imageFileInput.get(0), + files = _$imageFileInput$get.files; + + if (files.length) { + var imageFile = files.item(0); + var hookCallback = function hookCallback(url, text) { + return _this2._applyImage(url, text || altText); + }; + + _this2.eventManager.emit('addImageBlobHook', imageFile, hookCallback, TYPE_UI); + } + } + + _this2.hide(); + }); + + this.tab.on('itemClick', function () { + return _this2._resetInputs(); + }); + } + + /** + * bind editor events + * @private + * @override + */ + + }, { + key: '_initEditorEvent', + value: function _initEditorEvent() { + var _this3 = this; + + _get(PopupAddImage.prototype.__proto__ || Object.getPrototypeOf(PopupAddImage.prototype), '_initEditorEvent', this).call(this); + + this.eventManager.listen('focus', function () { + return _this3.hide(); + }); + this.eventManager.listen('closeAllPopup', function () { + return _this3.hide(); + }); + + this.eventManager.listen('openPopupAddImage', function () { + _this3.eventManager.emit('closeAllPopup'); + _this3.show(); + }); + } + }, { + key: '_applyImage', + value: function _applyImage(imageUrl, altText) { + this.eventManager.emit('command', 'AddImage', { + imageUrl: imageUrl, + altText: altText || 'image' + }); + this.hide(); + } + }, { + key: '_resetInputs', + value: function _resetInputs() { + this.$el.find('input').val(''); + } + + /** + * Remove popup + * @override + */ + + }, { + key: 'remove', + value: function remove() { + this.tab.remove(); + _get(PopupAddImage.prototype.__proto__ || Object.getPrototypeOf(PopupAddImage.prototype), 'remove', this).call(this); + } + }]); + + return PopupAddImage; +}(_layerpopup2.default); + +exports.default = PopupAddImage; + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DISABLED_MENU_CLASS_NAME = exports.REMOVE_ROW_MENU_CLASS_NAME = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _layerpopup = __webpack_require__(7); + +var _layerpopup2 = _interopRequireDefault(_layerpopup); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements PopupTableUtils + * @author NHN FE Development Lab + */ + + +var REMOVE_ROW_MENU_CLASS_NAME = exports.REMOVE_ROW_MENU_CLASS_NAME = 'te-table-remove-row'; +var DISABLED_MENU_CLASS_NAME = exports.DISABLED_MENU_CLASS_NAME = 'te-context-menu-disabled'; + +/** + * PopupTableUtils + * It implements table utils popup + * @param {LayerPopupOption} options - layer popup options + */ + +var PopupTableUtils = function (_LayerPopup) { + _inherits(PopupTableUtils, _LayerPopup); + + function PopupTableUtils(options) { + _classCallCheck(this, PopupTableUtils); + + var POPUP_CONTENT = '\n \n \n \n \n
    \n \n \n \n
    \n \n '; + options = _tuiCodeSnippet2.default.extend({ + header: false, + className: 'te-popup-table-utils', + content: POPUP_CONTENT + }, options); + return _possibleConstructorReturn(this, (PopupTableUtils.__proto__ || Object.getPrototypeOf(PopupTableUtils)).call(this, options)); + } + + /** + * init instance. + * store properties & prepare before initialize DOM + * @param {LayerPopupOption} options - layer popup options + * @private + * @override + */ + + + _createClass(PopupTableUtils, [{ + key: '_initInstance', + value: function _initInstance(options) { + _get(PopupTableUtils.prototype.__proto__ || Object.getPrototypeOf(PopupTableUtils.prototype), '_initInstance', this).call(this, options); + this.eventManager = options.eventManager; + } + + /** + * bind DOM events + * @private + * @override + */ + + }, { + key: '_initDOMEvent', + value: function _initDOMEvent() { + var _this2 = this; + + _get(PopupTableUtils.prototype.__proto__ || Object.getPrototypeOf(PopupTableUtils.prototype), '_initDOMEvent', this).call(this); + + this.on('click .te-table-add-row', function () { + return _this2.eventManager.emit('command', 'AddRow'); + }); + this.on('click .te-table-add-col', function () { + return _this2.eventManager.emit('command', 'AddCol'); + }); + this.on('click .te-table-col-align-left', function () { + return _this2.eventManager.emit('command', 'AlignCol', 'left'); + }); + this.on('click .te-table-col-align-center', function () { + return _this2.eventManager.emit('command', 'AlignCol', 'center'); + }); + this.on('click .te-table-col-align-right', function () { + return _this2.eventManager.emit('command', 'AlignCol', 'right'); + }); + this.on('click .te-table-remove-col', function () { + return _this2.eventManager.emit('command', 'RemoveCol'); + }); + this.on('click .te-table-remove', function () { + return _this2.eventManager.emit('command', 'RemoveTable'); + }); + this._bindClickEventOnRemoveRowMenu(); + } + + /** + * bind editor events + * @private + * @override + */ + + }, { + key: '_initEditorEvent', + value: function _initEditorEvent() { + var _this3 = this; + + _get(PopupTableUtils.prototype.__proto__ || Object.getPrototypeOf(PopupTableUtils.prototype), '_initEditorEvent', this).call(this); + + this.eventManager.listen('focus', function () { + return _this3.hide(); + }); + this.eventManager.listen('mousedown', function () { + return _this3.hide(); + }); + this.eventManager.listen('closeAllPopup', function () { + return _this3.hide(); + }); + this.eventManager.listen('openPopupTableUtils', function (ev) { + var offset = _this3.$el.parent().offset(); + var x = ev.clientX - offset.left; + var y = ev.clientY - offset.top + (0, _jquery2.default)(window).scrollTop(); + + _this3._disableRemoveRowMenu(ev.target); + + _this3.$el.css({ + position: 'absolute', + top: y + 5, // beside mouse pointer + left: x + 10 + }); + _this3.eventManager.emit('closeAllPopup'); + _this3.show(); + }); + } + }, { + key: '_bindClickEventOnRemoveRowMenu', + value: function _bindClickEventOnRemoveRowMenu() { + var _this4 = this; + + this.on('click .' + REMOVE_ROW_MENU_CLASS_NAME, function (ev) { + var target = ev.target; + + + if ((0, _jquery2.default)(target).hasClass(DISABLED_MENU_CLASS_NAME)) { + ev.preventDefault(); + } else { + _this4.eventManager.emit('command', 'RemoveRow'); + } + }); + } + }, { + key: '_disableRemoveRowMenu', + value: function _disableRemoveRowMenu(target) { + var $menu = this.$el.find('.' + REMOVE_ROW_MENU_CLASS_NAME); + + if (target.nodeName === 'TH') { + $menu.addClass(DISABLED_MENU_CLASS_NAME); + } else { + $menu.removeClass(DISABLED_MENU_CLASS_NAME); + } + } + }]); + + return PopupTableUtils; +}(_layerpopup2.default); + +exports.default = PopupTableUtils; + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _layerpopup = __webpack_require__(7); + +var _layerpopup2 = _interopRequireDefault(_layerpopup); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements PopupAddTable + * @author NHN FE Development Lab + */ + + +var CLASS_TABLE_SELECTION = 'te-table-selection'; +var CLASS_TABLE_HEADER = 'te-table-header'; +var CLASS_TABLE_BODY = 'te-table-body'; +var CLASS_SELECTION_AREA = 'te-selection-area'; +var CLASS_DESCRIPTION = 'te-description'; + +var POPUP_CONTENT = '\n
    \n
    \n
    \n
    \n
    \n

    \n'; + +var CELL_WIDTH = 25; +var CELL_HEIGHT = 17; +var MIN_ROW_INDEX = 7; +var MAX_ROW_INDEX = 14; +var MIN_COL_INDEX = 5; +var MAX_COL_INDEX = 9; +var MIN_ROW_SELECTION_INDEX = 1; +var MIN_COL_SELECTION_INDEX = 1; +var HEADER_ROW_COUNT = 1; +var LAST_BORDER = 1; + +/** + * Class PopupAddTable + * It implements Popup to add a table + * @param {LayerPopupOption} options - layer popup option + * @ignore + */ + +var PopupAddTable = function (_LayerPopup) { + _inherits(PopupAddTable, _LayerPopup); + + /** + * Toolbar Button which the Popup is bound to. + * @type {jQuery} + * @private + */ + function PopupAddTable(options) { + _classCallCheck(this, PopupAddTable); + + options = _tuiCodeSnippet2.default.extend({ + header: false, + className: 'te-popup-add-table', + content: POPUP_CONTENT + }, options); + return _possibleConstructorReturn(this, (PopupAddTable.__proto__ || Object.getPrototypeOf(PopupAddTable)).call(this, options)); + } + + /** + * init instance. + * store properties & prepare before initialize DOM + * @param {LayerPopupOption} options - layer popup options + * @private + * @override + */ + + + /** + * EventManager instance + * @type {EventManager} + * @private + */ + + + _createClass(PopupAddTable, [{ + key: '_initInstance', + value: function _initInstance(options) { + _get(PopupAddTable.prototype.__proto__ || Object.getPrototypeOf(PopupAddTable.prototype), '_initInstance', this).call(this, options); + + this._selectedBound = {}; + this._tableBound = {}; + this._eventManager = options.eventManager; + this._$button = options.$button; + } + + /** + * initialize DOM, render popup + * @private + * @override + */ + + }, { + key: '_initDOM', + value: function _initDOM() { + _get(PopupAddTable.prototype.__proto__ || Object.getPrototypeOf(PopupAddTable.prototype), '_initDOM', this).call(this); + + this._cacheElements(); + this._setTableSizeByBound(MIN_COL_INDEX, MIN_ROW_INDEX); + } + + /** + * bind DOM events + * @private + * @override + */ + + }, { + key: '_initDOMEvent', + value: function _initDOMEvent(options) { + var _this2 = this; + + _get(PopupAddTable.prototype.__proto__ || Object.getPrototypeOf(PopupAddTable.prototype), '_initDOMEvent', this).call(this, options); + + this.on('mousemove .' + CLASS_TABLE_SELECTION, function (ev) { + var x = ev.pageX - _this2._selectionOffset.left; + var y = ev.pageY - _this2._selectionOffset.top; + var bound = _this2._getSelectionBoundByOffset(x, y); + + _this2._resizeTableBySelectionIfNeed(bound.col, bound.row); + + _this2._setSelectionAreaByBound(bound.col, bound.row); + _this2._setDisplayText(bound.col, bound.row); + _this2._setSelectedBound(bound.col, bound.row); + }); + + this.on('click .' + CLASS_TABLE_SELECTION, function () { + var tableSize = _this2._getSelectedTableSize(); + _this2._eventManager.emit('command', 'Table', tableSize.col, tableSize.row); + }); + } + + /** + * bind editor events + * @private + * @override + */ + + }, { + key: '_initEditorEvent', + value: function _initEditorEvent() { + var _this3 = this; + + _get(PopupAddTable.prototype.__proto__ || Object.getPrototypeOf(PopupAddTable.prototype), '_initEditorEvent', this).call(this); + + this._eventManager.listen('focus', function () { + return _this3.hide(); + }); + this._eventManager.listen('closeAllPopup', function () { + return _this3.hide(); + }); + + this._eventManager.listen('openPopupAddTable', function () { + var $button = _this3._$button; + + var _$button$get = $button.get(0), + offsetTop = _$button$get.offsetTop, + offsetLeft = _$button$get.offsetLeft; + + _this3.$el.css({ + top: offsetTop + $button.outerHeight(), + left: offsetLeft + }); + _this3._eventManager.emit('closeAllPopup'); + _this3.show(); + _this3._selectionOffset = _this3.$el.find('.' + CLASS_TABLE_SELECTION).offset(); + }); + } + + /** + * Cache elements for use + * @private + */ + + }, { + key: '_cacheElements', + value: function _cacheElements() { + this.$header = this.$el.find('.' + CLASS_TABLE_HEADER); + this.$body = this.$el.find('.' + CLASS_TABLE_BODY); + this.$selection = this.$el.find('.' + CLASS_SELECTION_AREA); + this.$desc = this.$el.find('.' + CLASS_DESCRIPTION); + } + + /** + * Resize table if need + * @param {number} col column index + * @param {number} row row index + * @private + */ + + }, { + key: '_resizeTableBySelectionIfNeed', + value: function _resizeTableBySelectionIfNeed(col, row) { + var resizedBound = this._getResizedTableBound(col, row); + + if (resizedBound) { + this._setTableSizeByBound(resizedBound.col, resizedBound.row); + } + } + + /** + * Get resized table bound if Need + * @param {number} col column index + * @param {number} row row index + * @returns {object} bound + * @private + */ + + }, { + key: '_getResizedTableBound', + value: function _getResizedTableBound(col, row) { + var resizedCol = void 0, + resizedRow = void 0, + resizedBound = void 0; + + if (col >= MIN_COL_INDEX && col < MAX_COL_INDEX) { + resizedCol = col + 1; + } else if (col < MIN_COL_INDEX) { + resizedCol = MIN_COL_INDEX; + } + + if (row >= MIN_ROW_INDEX && row < MAX_ROW_INDEX) { + resizedRow = row + 1; + } else if (row < MIN_ROW_INDEX) { + resizedRow = MIN_ROW_INDEX; + } + + if (this._isNeedResizeTable(resizedCol, resizedRow)) { + resizedBound = { + row: resizedRow || this._tableBound.row, + col: resizedCol || this._tableBound.col + }; + } + + return resizedBound; + } + + /** + * check if need resize table + * @param {number} col column index + * @param {number} row row index + * @returns {boolean} result + * @private + */ + + }, { + key: '_isNeedResizeTable', + value: function _isNeedResizeTable(col, row) { + return col && col !== this._tableBound.col || row && row !== this._tableBound.row; + } + + /** + * Get bound by offset + * @param {number} x offset + * @param {number} y offset + * @returns {object} bound + * @private + */ + + }, { + key: '_getBoundByOffset', + value: function _getBoundByOffset(x, y) { + var row = parseInt(y / CELL_HEIGHT, 10); + var col = parseInt(x / CELL_WIDTH, 10); + + return { + row: row, + col: col + }; + } + + /** + * Get offset by bound + * @param {number} col column index + * @param {number} row row index + * @returns {object} offset + * @private + */ + + }, { + key: '_getOffsetByBound', + value: function _getOffsetByBound(col, row) { + var x = col * CELL_WIDTH + CELL_WIDTH, + y = row * CELL_HEIGHT + CELL_HEIGHT; + + return { + x: x, + y: y + }; + } + + /** + * Set table size with bound + * @param {number} col column index + * @param {number} row row index + * @private + */ + + }, { + key: '_setTableSizeByBound', + value: function _setTableSizeByBound(col, row) { + var boundOffset = this._getOffsetByBound(col, row - HEADER_ROW_COUNT); + this._setTableSize(boundOffset.x, boundOffset.y); + this._tableBound.row = row; + this._tableBound.col = col; + } + + /** + * Get selection bound that process with range by offset + * @param {number} x offset + * @param {number} y offset + * @returns {object} bound + * @private + */ + + }, { + key: '_getSelectionBoundByOffset', + value: function _getSelectionBoundByOffset(x, y) { + var bound = this._getBoundByOffset(x, y); + + if (bound.row < MIN_ROW_SELECTION_INDEX) { + bound.row = MIN_ROW_SELECTION_INDEX; + } else if (bound.row > this._tableBound.row) { + bound.row = this._tableBound.row; + } + + if (bound.col < MIN_COL_SELECTION_INDEX) { + bound.col = MIN_COL_SELECTION_INDEX; + } else if (bound.col > this._tableBound.col) { + bound.col = this._tableBound.col; + } + + return bound; + } + + /** + * Set selection area with bound + * @param {number} col column index + * @param {number} row row index + * @private + */ + + }, { + key: '_setSelectionAreaByBound', + value: function _setSelectionAreaByBound(col, row) { + var boundOffset = this._getOffsetByBound(col, row); + this._setSelectionArea(boundOffset.x, boundOffset.y); + } + + /** + * Set selected bound + * @param {number} col column index + * @param {number} row row index + * @private + */ + + }, { + key: '_setSelectedBound', + value: function _setSelectedBound(col, row) { + this._selectedBound.col = col; + this._selectedBound.row = row; + } + + /** + * Get selected table size + * @returns {object} bound + * @private + */ + + }, { + key: '_getSelectedTableSize', + value: function _getSelectedTableSize() { + return { + row: this._selectedBound.row + 1, + col: this._selectedBound.col + 1 + }; + } + + /** + * Set selected table size text for display + * @param {number} col column index + * @param {number} row row index + * @private + */ + + }, { + key: '_setDisplayText', + value: function _setDisplayText(col, row) { + this.$desc.html(col + 1 + ' x ' + (row + 1)); + } + + /** + * Set table element size + * @param {number} x offset + * @param {number} y offset + * @private + */ + + }, { + key: '_setTableSize', + value: function _setTableSize(x, y) { + x += LAST_BORDER; + y += LAST_BORDER; + + this.$header.css({ + height: CELL_HEIGHT, + width: x + }); + + this.$body.css({ + height: y, + width: x + }); + + this.$el.css({ + width: x + 30 + }); + } + + /** + * Set selection element size + * @param {number} x offset + * @param {number} y offset + * @private + */ + + }, { + key: '_setSelectionArea', + value: function _setSelectionArea(x, y) { + x += LAST_BORDER; + y += LAST_BORDER; + + this.$selection.css({ + height: y, + width: x + }); + } + }]); + + return PopupAddTable; +}(_layerpopup2.default); + +PopupAddTable.CELL_WIDTH = CELL_WIDTH; +PopupAddTable.CELL_HEIGHT = CELL_HEIGHT; +PopupAddTable.MIN_ROW_SELECTION_INDEX = MIN_ROW_SELECTION_INDEX; +PopupAddTable.MIN_COL_SELECTION_INDEX = MIN_COL_SELECTION_INDEX; + +exports.default = PopupAddTable; + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _layerpopup = __webpack_require__(7); + +var _layerpopup2 = _interopRequireDefault(_layerpopup); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements PopupAddHeading + * @author NHN FE Development Lab + */ + + +/** + * Class PopupAddHeading + * It implements Popup to add headings + * @param {LayerPopupOption} options - layer popup option + * @ignore + */ +var PopupAddHeading = function (_LayerPopup) { + _inherits(PopupAddHeading, _LayerPopup); + + function PopupAddHeading(options) { + _classCallCheck(this, PopupAddHeading); + + var POPUP_CONTENT = '\n
      \n
    • ' + _i18n2.default.get('Heading') + ' 1

    • \n
    • ' + _i18n2.default.get('Heading') + ' 2

    • \n
    • ' + _i18n2.default.get('Heading') + ' 3

    • \n
    • ' + _i18n2.default.get('Heading') + ' 4

    • \n
    • ' + _i18n2.default.get('Heading') + ' 5
    • \n
    • ' + _i18n2.default.get('Heading') + ' 6
    • \n
    • ' + _i18n2.default.get('Paragraph') + '
    • \n
    \n '; + options = _tuiCodeSnippet2.default.extend({ + header: false, + className: 'te-heading-add', + content: POPUP_CONTENT + }, options); + return _possibleConstructorReturn(this, (PopupAddHeading.__proto__ || Object.getPrototypeOf(PopupAddHeading)).call(this, options)); + } + + /** + * init instance. + * store properties & prepare before initialize DOM + * @param {LayerPopupOption} options - layer popup options + * @private + * @override + */ + + + _createClass(PopupAddHeading, [{ + key: '_initInstance', + value: function _initInstance(options) { + _get(PopupAddHeading.prototype.__proto__ || Object.getPrototypeOf(PopupAddHeading.prototype), '_initInstance', this).call(this, options); + + this._eventManager = options.eventManager; + this._$button = options.$button; + } + + /** + * bind DOM events + * @private + * @override + */ + + }, { + key: '_initDOMEvent', + value: function _initDOMEvent() { + var _this2 = this; + + _get(PopupAddHeading.prototype.__proto__ || Object.getPrototypeOf(PopupAddHeading.prototype), '_initDOMEvent', this).call(this); + + this.on('click li', function (ev) { + var $li = (0, _jquery2.default)(ev.target).closest('li'); + _this2._eventManager.emit('command', $li.data('type'), $li.data('value')); + }); + } + + /** + * bind editor events + * @private + * @override + */ + + }, { + key: '_initEditorEvent', + value: function _initEditorEvent() { + var _this3 = this; + + _get(PopupAddHeading.prototype.__proto__ || Object.getPrototypeOf(PopupAddHeading.prototype), '_initEditorEvent', this).call(this); + + this._eventManager.listen('focus', this.hide.bind(this)); + this._eventManager.listen('closeAllPopup', this.hide.bind(this)); + this._eventManager.listen('openHeadingSelect', function () { + var $button = _this3._$button; + + var _$button$get = $button.get(0), + offsetTop = _$button$get.offsetTop, + offsetLeft = _$button$get.offsetLeft; + + _this3.$el.css({ + top: offsetTop + $button.outerHeight(), + left: offsetLeft + }); + + _this3._eventManager.emit('closeAllPopup'); + _this3.show(); + }); + } + }]); + + return PopupAddHeading; +}(_layerpopup2.default); + +exports.default = PopupAddHeading; + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _layerpopup = __webpack_require__(7); + +var _layerpopup2 = _interopRequireDefault(_layerpopup); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements popup code block languages + * @author NHN FE Development Lab + */ + + +var BUTTON_CLASS_PREFIX = 'te-popup-code-block-lang-'; + +/** + * Class Popup code block languages select list + * @param {LayerPopupOption} options - layer popup option + * @ignore + */ + +var PopupCodeBlockLanguages = function (_LayerPopup) { + _inherits(PopupCodeBlockLanguages, _LayerPopup); + + function PopupCodeBlockLanguages(options) { + _classCallCheck(this, PopupCodeBlockLanguages); + + var popupButtonsHTML = []; + var _options = options, + languages = _options.languages; + + languages.forEach(function (lang) { + return popupButtonsHTML.push(''); + }); + + options = _tuiCodeSnippet2.default.extend({ + header: false, + className: 'te-popup-code-block-languages', + content: popupButtonsHTML.join('') + }, options); + return _possibleConstructorReturn(this, (PopupCodeBlockLanguages.__proto__ || Object.getPrototypeOf(PopupCodeBlockLanguages)).call(this, options)); + } + + /** + * init instance. + * store properties & prepare before initialize DOM + * @param {LayerPopupOption} options - layer popup options + * @private + * @override + */ + + + _createClass(PopupCodeBlockLanguages, [{ + key: '_initInstance', + value: function _initInstance(options) { + _get(PopupCodeBlockLanguages.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockLanguages.prototype), '_initInstance', this).call(this, options); + + this._onSelectedLanguage = null; + this._onDismissed = null; + this._currentButton = null; + this._$buttons = null; + this._languages = options.languages; + + this.eventManager = options.eventManager; + } + + /** + * initialize DOM, render popup + * @private + * @override + */ + + }, { + key: '_initDOM', + value: function _initDOM(options) { + _get(PopupCodeBlockLanguages.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockLanguages.prototype), '_initDOM', this).call(this, options); + + this.$el.css('z-index', 10000); + + this._$buttons = this.$el.find('button'); + this._activateButtonByIndex(0); + } + + /** + * bind DOM events + * @private + * @override + */ + + }, { + key: '_initDOMEvent', + value: function _initDOMEvent() { + var _this2 = this; + + _get(PopupCodeBlockLanguages.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockLanguages.prototype), '_initDOMEvent', this).call(this); + + var handler = function handler(event) { + var language = (0, _jquery2.default)(event.target).data('lang'); + if (_this2._onSelectedLanguage) { + _this2._onSelectedLanguage(language); + } + _this2.hide(); + }; + this._languages.forEach(function (lang) { + return _this2.on('mousedown .' + BUTTON_CLASS_PREFIX + lang, handler); + }); + } + + /** + * bind editor events + * @private + * @override + */ + + }, { + key: '_initEditorEvent', + value: function _initEditorEvent() { + var _this3 = this; + + _get(PopupCodeBlockLanguages.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockLanguages.prototype), '_initEditorEvent', this).call(this); + + this.eventManager.listen('openPopupCodeBlockLanguages', function (data) { + _this3.show(data.callback); + var elementStyle = _this3.$el.get(0).style; + elementStyle.top = data.offset.top + 'px'; + elementStyle.left = data.offset.left + 'px'; + _this3.setCurrentLanguage(data.language); + + return _this3; + }); + this.eventManager.listen('focus', function () { + return _this3.hide(); + }); + this.eventManager.listen('mousedown', function () { + return _this3.hide(); + }); + this.eventManager.listen('closeAllPopup', function () { + return _this3.hide(); + }); + this.eventManager.listen('closePopupCodeBlockLanguages', function () { + return _this3.hide(); + }); + this.eventManager.listen('scroll', function () { + return _this3.hide(); + }); + } + + /** + * activate an item by index + * @param {number} index - item index + * @private + */ + + }, { + key: '_activateButtonByIndex', + value: function _activateButtonByIndex(index) { + if (this._currentButton) { + (0, _jquery2.default)(this._currentButton).removeClass('active'); + } + this._currentButton = this._$buttons.get(index); + (0, _jquery2.default)(this._currentButton).addClass('active'); + this._currentButton.scrollIntoView(); + } + + /** + * move to prev language + */ + + }, { + key: 'prev', + value: function prev() { + var index = this._$buttons.index(this._currentButton) - 1; + if (index < 0) { + index = this._$buttons.length - 1; + } + this._activateButtonByIndex(index); + } + + /** + * move to next language + */ + + }, { + key: 'next', + value: function next() { + var index = this._$buttons.index(this._currentButton) + 1; + if (index >= this._$buttons.length) { + index = 0; + } + this._activateButtonByIndex(index); + } + + /** + * current language + * @returns {string} language + */ + + }, { + key: 'getCurrentLanguage', + value: function getCurrentLanguage() { + var language = (0, _jquery2.default)(this._currentButton).data('lang'); + + return language; + } + + /** + * set current language + * @param {string} language - current language + */ + + }, { + key: 'setCurrentLanguage', + value: function setCurrentLanguage(language) { + var item = this._$buttons.filter('.' + BUTTON_CLASS_PREFIX + language); + if (item.length > 0) { + var index = this._$buttons.index(item); + this._activateButtonByIndex(index); + } + } + + /** + * show popup + * @param {object} callback - to be called on language selected & dismissed + * @override + */ + + }, { + key: 'show', + value: function show(callback) { + this._onSelectedLanguage = callback.selected; + this._onDismissed = callback.dismissed; + _get(PopupCodeBlockLanguages.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockLanguages.prototype), 'show', this).call(this); + } + + /** + * hide popup + * @override + */ + + }, { + key: 'hide', + value: function hide() { + if (this._onDismissed) { + this._onDismissed(); + } + this._onSelectedLanguage = null; + this._onDismissed = null; + _get(PopupCodeBlockLanguages.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockLanguages.prototype), 'hide', this).call(this); + } + }]); + + return PopupCodeBlockLanguages; +}(_layerpopup2.default); + +exports.default = PopupCodeBlockLanguages; + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _layerpopup = __webpack_require__(7); + +var _layerpopup2 = _interopRequireDefault(_layerpopup); + +var _scrollSyncSplit = __webpack_require__(109); + +var _scrollSyncSplit2 = _interopRequireDefault(_scrollSyncSplit); + +var _codeBlockEditor = __webpack_require__(110); + +var _codeBlockEditor2 = _interopRequireDefault(_codeBlockEditor); + +var _codeBlockPreview = __webpack_require__(111); + +var _codeBlockPreview2 = _interopRequireDefault(_codeBlockPreview); + +var _codeBlockLanguagesCombo = __webpack_require__(112); + +var _codeBlockLanguagesCombo2 = _interopRequireDefault(_codeBlockLanguagesCombo); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements popup code block editor + * @author NHN FE Development Lab + */ + + +var CLASS_PREFIX = 'popup-editor-'; +var CLASS_OK_BUTTON = 'te-ok-button'; +var CLASS_CLOSE_BUTTON = 'te-close-button'; +var CLASS_POPUP_CLOSE_BUTTON = 'tui-popup-close-button'; +var TEMPLATE_HEADER_BUTTONS = '\n \n \n \n \n'; + +/** + * Class popup code block editor + * @param {LayerPopupOption} options - layer popup option + * @ignore + */ + +var PopupCodeBlockEditor = function (_LayerPopup) { + _inherits(PopupCodeBlockEditor, _LayerPopup); + + function PopupCodeBlockEditor(options) { + _classCallCheck(this, PopupCodeBlockEditor); + + var TEMPLATE_CONTENT = '\n
    \n
    \n \n \n
    \n '; + options = _tuiCodeSnippet2.default.extend({ + header: true, + title: 'CodeBlock Editor', + content: TEMPLATE_CONTENT, + className: 'tui-popup-code-block-editor', + headerButtons: TEMPLATE_HEADER_BUTTONS, + modal: true + }, options); + return _possibleConstructorReturn(this, (PopupCodeBlockEditor.__proto__ || Object.getPrototypeOf(PopupCodeBlockEditor)).call(this, options)); + } + + /** + * init instance. + * store properties & prepare before initialize DOM + * @param {LayerPopupOption} options - layer popup options + * @private + * @override + */ + + + _createClass(PopupCodeBlockEditor, [{ + key: '_initInstance', + value: function _initInstance(options) { + _get(PopupCodeBlockEditor.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockEditor.prototype), '_initInstance', this).call(this, options); + + this.eventManager = options.eventManager; + this.convertor = options.convertor; + } + + /** + * initialize DOM, render popup + * @private + * @override + */ + + }, { + key: '_initDOM', + value: function _initDOM(options) { + _get(PopupCodeBlockEditor.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockEditor.prototype), '_initDOM', this).call(this, options); + + var el = this.$el.get(0); + this._body = el.querySelector('.' + CLASS_PREFIX + 'body'); + this._toggleFitButton = el.querySelector('.' + CLASS_PREFIX + 'toggle-fit'); + this._togglePreviewButton = el.querySelector('.' + CLASS_PREFIX + 'toggle-preview'); + this._toggleScrollButton = el.querySelector('.' + CLASS_PREFIX + 'toggle-scroll'); + this._okButton = el.querySelector('.' + CLASS_OK_BUTTON); + this._closeButton = el.querySelector('.' + CLASS_CLOSE_BUTTON); + + this._codeMirrorWrapper = this._createCodeBlockEditor(); + this._previewWrapper = this._createPreview(); + this._scrollSyncSplit = new _scrollSyncSplit2.default(this._body, this._codeMirrorWrapper, this._previewWrapper); + + this._updateFitWindowButton(); + this._updatePreviewButton(); + this._updateScrollButton(); + + this._codeBlockLanguagesCombo = this._createCodeBlockLanguagesCombo(); + } + + /** + * bind DOM events + * @private + * @override + */ + + }, { + key: '_initDOMEvent', + value: function _initDOMEvent() { + var _this2 = this; + + _get(PopupCodeBlockEditor.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockEditor.prototype), '_initDOMEvent', this).call(this); + + this.on('scroll', function (ev) { + return ev.preventDefault(); + }); + this.on('click .' + CLASS_PREFIX + 'toggle-fit', function () { + return _this2._toggleFitToWindow(); + }); + this.on('click .' + CLASS_PREFIX + 'toggle-preview', function () { + return _this2._togglePreview(); + }); + this.on('click .' + CLASS_PREFIX + 'toggle-scroll', function () { + return _this2._toggleScroll(); + }); + this.on('click .' + CLASS_OK_BUTTON, function () { + return _this2._save(); + }); + this.on('click .' + CLASS_CLOSE_BUTTON, function () { + return _this2.hide(); + }); + this.on('click .' + CLASS_PREFIX + 'close', function () { + return _this2.hide(); + }); + this.on('click .' + CLASS_PREFIX + 'editor-wrapper', function (ev) { + if (ev.target === _this2._codeMirrorWrapper) { + _this2._focusEditor(true); + } + }); + } + + /** + * bind editor events + * @private + * @override + */ + + }, { + key: '_initEditorEvent', + value: function _initEditorEvent() { + var _this3 = this; + + _get(PopupCodeBlockEditor.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockEditor.prototype), '_initEditorEvent', this).call(this); + + this.eventManager.listen('openPopupCodeBlockEditor', function (codeBlockElement) { + _this3.eventManager.emit('closeAllPopup'); + _this3.show(codeBlockElement); + + return _this3; + }); + this.eventManager.listen('closeAllPopup', this.hide.bind(this)); + this.eventManager.listen('closePopupCodeBlockEditor', this.hide.bind(this)); + } + }, { + key: '_createCodeBlockEditor', + value: function _createCodeBlockEditor() { + var codeMirrorWrapper = document.createElement('div'); + codeMirrorWrapper.className = CLASS_PREFIX + 'editor-wrapper'; + + this._codeBlockEditor = new _codeBlockEditor2.default(codeMirrorWrapper, this.eventManager); + + return codeMirrorWrapper; + } + }, { + key: '_createPreview', + value: function _createPreview() { + var previewWrapper = document.createElement('div'); + this._codeBlockPreview = new _codeBlockPreview2.default((0, _jquery2.default)(previewWrapper), this.eventManager, this.convertor, this._codeBlockEditor); + + return previewWrapper; + } + }, { + key: '_createCodeBlockLanguagesCombo', + value: function _createCodeBlockLanguagesCombo() { + var _this4 = this; + + var titleElement = this.getTitleElement(); + var codeBlockLanguagesCombo = new _codeBlockLanguagesCombo2.default(this.eventManager); + + codeBlockLanguagesCombo.setOnLanguageSelected(function (selectedLanguage) { + _this4._codeBlockEditor.setLanguage(selectedLanguage); + _this4._codeBlockEditor.refresh(); + _this4._focusEditor(); + }); + + titleElement.innerHTML = 'CodeBlock Editor'; + titleElement.appendChild(codeBlockLanguagesCombo.getElement()); + + return codeBlockLanguagesCombo; + } + }, { + key: '_updateFitWindowButton', + value: function _updateFitWindowButton() { + (0, _jquery2.default)(this._toggleFitButton).toggleClass('active', this.isFitToWindow()); + } + }, { + key: '_updatePreviewButton', + value: function _updatePreviewButton() { + (0, _jquery2.default)(this._togglePreviewButton).toggleClass('active', this._scrollSyncSplit.isSplitView()); + } + }, { + key: '_updateScrollButton', + value: function _updateScrollButton() { + if (this._scrollSyncSplit.isSplitView()) { + this._toggleScrollButton.style.display = 'inline-block'; + } else { + this._toggleScrollButton.style.display = 'none'; + } + (0, _jquery2.default)(this._toggleScrollButton).toggleClass('active', this._scrollSyncSplit.isScrollSynced()); + } + }, { + key: '_focusEditor', + value: function _focusEditor(cursorToEnd) { + this._codeBlockEditor.focus(); + if (cursorToEnd) { + this._codeBlockEditor.moveCursorToEnd(); + } else { + this._codeBlockEditor.moveCursorToStart(); + } + } + }, { + key: '_togglePreview', + value: function _togglePreview() { + this._scrollSyncSplit.toggleSplitView(); + this._updatePreviewButton(); + this._updateScrollButton(); + this._codeBlockEditor.refresh(); + } + }, { + key: '_toggleFitToWindow', + value: function _toggleFitToWindow() { + this.toggleFitToWindow(); + this._updateFitWindowButton(); + this._codeBlockEditor.refresh(); + } + }, { + key: '_toggleScroll', + value: function _toggleScroll() { + this._scrollSyncSplit.toggleScrollSync(); + this._updateScrollButton(); + } + + /** + * store code mirror text to wysiwyg code block + * @private + */ + + }, { + key: '_save', + value: function _save() { + this._codeBlockEditor.save(this._codeBlockElement); + this.hide(); + } + + /** + * load code mirror text from wysiwyg code block + * @param {HTMLElement} codeBlockElement - code block element instance to load code from + * @private + */ + + }, { + key: '_load', + value: function _load(codeBlockElement) { + this._codeBlockElement = codeBlockElement; + this._codeBlockEditor.load(codeBlockElement); + this._codeBlockLanguagesCombo.setLanguage(this._codeBlockEditor.getLanguage()); + this._focusEditor(); + this._codeBlockPreview.refresh(); + } + + /** + * show popup + * @param {HTMLElement} codeBlockElement - code block element + * @override + */ + + }, { + key: 'show', + value: function show(codeBlockElement) { + _get(PopupCodeBlockEditor.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockEditor.prototype), 'show', this).call(this); + + if (!codeBlockElement) { + throw new Error('should be called with codeBlockElement'); + } + this._load(codeBlockElement); + } + + /** + * hide popup + * @override + */ + + }, { + key: 'hide', + value: function hide() { + this.setFitToWindow(false); + + if (this._codeBlockEditor) { + this._codeBlockEditor.clear(); + } + if (this._codeBlockPreview) { + this._codeBlockPreview.clear(); + } + this._codeBlockElement = null; + + _get(PopupCodeBlockEditor.prototype.__proto__ || Object.getPrototypeOf(PopupCodeBlockEditor.prototype), 'hide', this).call(this); + } + }]); + + return PopupCodeBlockEditor; +}(_layerpopup2.default); + +exports.default = PopupCodeBlockEditor; + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements scroll sync split + * @author NHN FE Development Lab + */ + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var CLASS_SPLIT_SCROLL = 'tui-split-scroll'; +var CLASS_SINGLE_CONTENT = 'single-content'; +var CLASS_SCROLL_SYNC = 'scroll-sync'; +var CLASS_SCROLL_WRAPPER = 'tui-split-scroll-wrapper'; +var CLASS_SCROLL_CONTENT = 'tui-split-scroll-content'; +var CLASS_SPLITTER = 'tui-splitter'; +var EVENT_REQUIRE_SCROLL_SYNC = 'requireScrollSync'; +var EVENT_REQUIRE_SCROLL_INTO_VIEW = 'requireScrollIntoView'; +var CLASS_CONTENT_LEFT = 'tui-split-content-left'; +var CLASS_CONTENT_RIGHT = 'tui-split-content-right'; +var CLASS_CONTENT = { + 'left': CLASS_CONTENT_LEFT, + 'right': CLASS_CONTENT_RIGHT +}; + +/** + * Class ScrollSyncSplit + * @param {Element} baseElement - an element which attach a splitSyncSplit + * @param {Element} leftElement - an element to be on left side split view + * @param {Element} rightElement - an element to be on right side split view + * @param {object} options - options + * @param {boolean} [options.showScrollSyncButton=false] - show scroll sync button on top right corner + * @param {boolean} [options.scrollSync=true] - true for enable scroll sync + * @param {boolean} [options.splitView=true] - true for split, false for single view + * @ignore + */ + +var ScrollSyncSplit = function () { + function ScrollSyncSplit(baseElement, leftElement, rightElement) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + _classCallCheck(this, ScrollSyncSplit); + + options = _tuiCodeSnippet2.default.extend({ + showScrollSyncButton: false, + scrollSync: true, + splitView: true + }, options); + this._baseElement = baseElement; + + /** + * left, right side content elements + * @type {HTMLElement[]} + * @private + */ + this._contentElements = []; + + this._initDom(leftElement, rightElement, options); + this._initDomEvent(); + } + + _createClass(ScrollSyncSplit, [{ + key: '_initDom', + value: function _initDom(leftElement, rightElement, options) { + var el = document.createElement('div'); + el.className = CLASS_SPLIT_SCROLL; + this._el = el; + + var scrollWrapper = document.createElement('div'); + scrollWrapper.className = CLASS_SCROLL_WRAPPER; + this._scrollWrapper = scrollWrapper; + this._setScrollSync(options.scrollSync); + this.setSplitView(options.splitView); + + var contentWrapper = document.createElement('div'); + contentWrapper.className = CLASS_SCROLL_CONTENT; + this._contentWrapper = contentWrapper; + + var splitter = document.createElement('div'); + splitter.className = CLASS_SPLITTER; + + this._baseElement.appendChild(el); + el.appendChild(scrollWrapper); + scrollWrapper.appendChild(contentWrapper); + scrollWrapper.appendChild(splitter); + this._setLeft(leftElement); + this._setRight(rightElement); + } + }, { + key: '_initDomEvent', + value: function _initDomEvent() { + this._contentWrapper.addEventListener('scroll', this.sync.bind(this)); + } + }, { + key: '_requireScrollIntoView', + value: function _requireScrollIntoView(event) { + var element = event.target; + + var _element$getBoundingC = element.getBoundingClientRect(), + targetTop = _element$getBoundingC.top, + targetBottom = _element$getBoundingC.bottom; + + var wrapperTop = void 0, + wrapperBottom = void 0, + wrapperElement = void 0; + + if (this.isScrollSynced()) { + wrapperElement = this._contentWrapper; + } else if ((0, _jquery2.default)(element).parents(this._contentElements.left).length) { + wrapperElement = this._contentElements.left; + } else if ((0, _jquery2.default)(element).parents(this._contentElements.right).length) { + wrapperElement = this._contentElements.right; + } else { + return; + } + + var _wrapperElement$getBo = wrapperElement.getBoundingClientRect(); + + wrapperTop = _wrapperElement$getBo.top; + wrapperBottom = _wrapperElement$getBo.bottom; + + + if (targetTop < wrapperTop) { + wrapperElement.scrollTop = wrapperElement.scrollTop + targetTop - wrapperTop; + } else if (targetBottom > wrapperBottom) { + wrapperElement.scrollTop = wrapperElement.scrollTop + targetBottom - wrapperBottom; + } + + this.sync(); + } + + /** + * set content element for given side + * @param {Element} element - content element + * @param {string} side - 'left' | 'right' + * @private + */ + + }, { + key: '_setContentElement', + value: function _setContentElement(element, side) { + var _this = this; + + var contentElement = this._contentElements[side]; + + if (contentElement) { + (0, _jquery2.default)(contentElement).off(EVENT_REQUIRE_SCROLL_INTO_VIEW); + this._contentWrapper.removeChild(contentElement); + } + (0, _jquery2.default)(element).addClass(CLASS_CONTENT[side]); + this._contentWrapper.appendChild(element); + (0, _jquery2.default)(element).on(EVENT_REQUIRE_SCROLL_INTO_VIEW, function (ev) { + return _this._requireScrollIntoView(ev); + }); + (0, _jquery2.default)(element).on(EVENT_REQUIRE_SCROLL_SYNC, function () { + return _this.sync(); + }); + + this._contentElements[side] = element; + + this.sync(); + } + + /** + * set left side element + * @param {Element} element - an element to be on left side split view + * @private + */ + + }, { + key: '_setLeft', + value: function _setLeft(element) { + this._setContentElement(element, 'left'); + } + + /** + * set right side element + * @param {Element} element - an element to be on right side split view + * @private + */ + + }, { + key: '_setRight', + value: function _setRight(element) { + this._setContentElement(element, 'right'); + } + }, { + key: '_setScrollSync', + value: function _setScrollSync(activate) { + (0, _jquery2.default)(this._el).toggleClass(CLASS_SCROLL_SYNC, activate); + } + + /** + * toggle multi scroll + */ + + }, { + key: 'toggleScrollSync', + value: function toggleScrollSync() { + (0, _jquery2.default)(this._el).toggleClass(CLASS_SCROLL_SYNC); + } + }, { + key: 'setSplitView', + value: function setSplitView(activate) { + (0, _jquery2.default)(this._el).toggleClass(CLASS_SINGLE_CONTENT, !activate); + } + + /** + * toggle split + */ + + }, { + key: 'toggleSplitView', + value: function toggleSplitView() { + (0, _jquery2.default)(this._el).toggleClass(CLASS_SINGLE_CONTENT); + } + + /** + * is scroll synced + * @returns {boolean} - true for synced, false for each scroll + */ + + }, { + key: 'isScrollSynced', + value: function isScrollSynced() { + return (0, _jquery2.default)(this._el).hasClass(CLASS_SCROLL_SYNC); + } + + /** + * is split view + * @returns {boolean} - true for split view, false for single view + */ + + }, { + key: 'isSplitView', + value: function isSplitView() { + return !(0, _jquery2.default)(this._el).hasClass(CLASS_SINGLE_CONTENT); + } + + /** + * sync scroll + */ + + }, { + key: 'sync', + value: function sync() { + if (!this._contentElements.left || !this._contentElements.right) { + return; + } + + var wrapperHeight = this._contentWrapper.clientHeight; + var scrollTop = this._contentWrapper.scrollTop; + + var leftElement = this._contentElements.left; + var rightElement = this._contentElements.right; + + var scrollingElement = leftElement.offsetHeight - wrapperHeight > 0 ? leftElement : rightElement; + var followingElement = scrollingElement === leftElement ? rightElement : leftElement; + + var scrollingElementHeight = scrollingElement.offsetHeight; + var scrollingElementScrollMax = Math.max(scrollingElementHeight - wrapperHeight, 0); + var followingElementHeight = Math.max(followingElement.offsetHeight, wrapperHeight); + var followingElementTopMax = scrollingElementHeight - followingElementHeight; + + scrollingElement.style.top = '0px'; + followingElement.style.top = scrollTop / scrollingElementScrollMax * followingElementTopMax + 'px'; + } + + /** + * scroll top + * @param {number} top - scroll top in pixel + */ + + }, { + key: 'scrollTop', + value: function scrollTop(top) { + this._contentWrapper.scrollTop = top; + } + }]); + + return ScrollSyncSplit; +}(); + +exports.default = ScrollSyncSplit; + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _codeMirrorExt = __webpack_require__(32); + +var _codeMirrorExt2 = _interopRequireDefault(_codeMirrorExt); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements code block editor + * @author NHN FE Development Lab + */ + + +var EVENT_LANGUAGE_CHANGED = 'language-changed'; + +/** + * Class Code Block Editor + * @param {HTMLElement} el - code block editor container element + * @param {EventManager} eventManager - event manager + * @ignore + */ + +var CodeBlockEditor = function (_CodeMirrorExt) { + _inherits(CodeBlockEditor, _CodeMirrorExt); + + function CodeBlockEditor(el, eventManager) { + _classCallCheck(this, CodeBlockEditor); + + var _this = _possibleConstructorReturn(this, (CodeBlockEditor.__proto__ || Object.getPrototypeOf(CodeBlockEditor)).call(this, el, { + singleCursorHeightPerLine: false, + theme: 'none' + })); + + _this._language = ''; + _this._eventManager = eventManager; + + _this._initEvent(); + return _this; + } + + _createClass(CodeBlockEditor, [{ + key: '_initEvent', + value: function _initEvent() { + var _this2 = this; + + this.on('cursorActivity', this._onRequireScrollIntoView.bind(this)); + this.on('beforeChange', function (cm, ev) { + if (ev.origin === 'paste') { + _this2._eventManager.emit('pasteBefore', { + source: 'codeblock', + data: ev + }); + } + }); + } + }, { + key: '_onRequireScrollIntoView', + value: function _onRequireScrollIntoView() { + var cursor = this.getCursor(); + var wrapper = this.getWrapperElement(); + + // CodeMirror cursorActivity event fires before actually attach a new line element to DOM + // we should proceed at next tick + setTimeout(function () { + var lineElement = wrapper.querySelector('pre:nth-child(' + (cursor.line + 1) + ')'); + (0, _jquery2.default)(lineElement).trigger('requireScrollIntoView'); + }, 0); + } + + /** + * load code from code block element + * @param {HTMLElement} codeBlockElement - code block element + */ + + }, { + key: 'load', + value: function load(codeBlockElement) { + var el = codeBlockElement.cloneNode(true); + this.setLanguage(el.getAttribute('data-language') || ''); + this.setEditorCodeText(el.textContent); + } + + /** + * save code to code block element + * @param {HTMLElement} codeBlockElement - code block element + */ + + }, { + key: 'save', + value: function save(codeBlockElement) { + codeBlockElement.innerHTML = ''; + codeBlockElement.textContent = this.getEditorCodeText(); + codeBlockElement.setAttribute('data-language', this._language); + (0, _jquery2.default)(codeBlockElement).trigger(EVENT_LANGUAGE_CHANGED); + } + + /** + * clear code and language + */ + + }, { + key: 'clear', + value: function clear() { + this.setLanguage(''); + this.setEditorCodeText(''); + } + + /** + * get code language + * @returns {string} - code language + */ + + }, { + key: 'getLanguage', + value: function getLanguage() { + return this._language; + } + + /** + * set code language + * @param {string} [language=''] - code language + */ + + }, { + key: 'setLanguage', + value: function setLanguage() { + var language = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + + this._language = language; + } + + /** + * get code text + * @returns {string} - code text + */ + + }, { + key: 'getEditorCodeText', + value: function getEditorCodeText() { + return this.getValue(); + } + + /** + * set code text + * @param {string} [code=''] - code text + */ + + }, { + key: 'setEditorCodeText', + value: function setEditorCodeText() { + var code = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + + this.setValue(code); + } + + /** + * refresh. call if codemirror resized + */ + + }, { + key: 'refresh', + value: function refresh() { + this.cm.refresh(); + } + }]); + + return CodeBlockEditor; +}(_codeMirrorExt2.default); + +exports.default = CodeBlockEditor; + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _preview = __webpack_require__(35); + +var _preview2 = _interopRequireDefault(_preview); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @fileoverview Implements CodeBlockPreview + * @author NHN FE Development Lab + */ + + +var EVENT_REQUIRE_SCROLL_SYNC = 'requireScrollSync'; + +/** + * Class Code block preview + * @param {jQuery} $el - base element + * @param {EventManager} eventManager - event manager + * @param {Convertor} convertor - convertor + * @param {CodeBlockEditor} codeBlockEditor - code block editor + * @ignore + */ + +var CodeBlockPreview = function (_Preview) { + _inherits(CodeBlockPreview, _Preview); + + function CodeBlockPreview($el, eventManager, convertor, codeBlockEditor) { + _classCallCheck(this, CodeBlockPreview); + + var _this = _possibleConstructorReturn(this, (CodeBlockPreview.__proto__ || Object.getPrototypeOf(CodeBlockPreview)).call(this, $el, eventManager, convertor, true)); + + _this._codeBlockEditor = codeBlockEditor; + + _this._initEvent(); + return _this; + } + + _createClass(CodeBlockPreview, [{ + key: '_initEvent', + value: function _initEvent() { + var _this2 = this; + + this._codeBlockEditor.on('update', function () { + return _this2.lazyRunner.run('refresh'); + }); + } + + /** + * refresh preview + * @override + */ + + }, { + key: 'refresh', + value: function refresh() { + var language = this._codeBlockEditor.getLanguage(); + var codeText = this._codeBlockEditor.getEditorCodeText(); + + _get(CodeBlockPreview.prototype.__proto__ || Object.getPrototypeOf(CodeBlockPreview.prototype), 'refresh', this).call(this, '```' + language + '\n' + codeText + '\n```'); + this.$el.trigger(EVENT_REQUIRE_SCROLL_SYNC); + } + + /** + * clear preview + */ + + }, { + key: 'clear', + value: function clear() { + _get(CodeBlockPreview.prototype.__proto__ || Object.getPrototypeOf(CodeBlockPreview.prototype), 'render', this).call(this, ''); + } + }]); + + return CodeBlockPreview; +}(_preview2.default); + +exports.default = CodeBlockPreview; + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @fileoverview Implements UI code block languages combo + * @author NHN FE Development Lab + */ + + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +var _keyMapper = __webpack_require__(22); + +var _keyMapper2 = _interopRequireDefault(_keyMapper); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Class CodeBlockLanguagesCombo + * @param {EventManager} eventManager - event manager instance + * @ignore + */ +var CodeBlockLanguagesCombo = function () { + function CodeBlockLanguagesCombo(eventManager) { + _classCallCheck(this, CodeBlockLanguagesCombo); + + this._eventManager = eventManager; + + this._initDOM(); + this._initDOMEvent(); + } + + _createClass(CodeBlockLanguagesCombo, [{ + key: '_initDOM', + value: function _initDOM() { + this._inputLanguage = (0, _jquery2.default)('').get(0); + this._wrapper = (0, _jquery2.default)('').get(0); + this._wrapper.appendChild(this._inputLanguage); + } + }, { + key: '_initDOMEvent', + value: function _initDOMEvent() { + var _this = this; + + this._inputLanguage.addEventListener('keydown', function (event) { + return _this._onKeyEvent(event); + }); + this._inputLanguage.addEventListener('focus', function () { + return _this._showPopupCodeBlockLanguages(); + }); + this._inputLanguage.addEventListener('focusout', function () { + return _this._onFocusOut(); + }); + this._wrapper.addEventListener('mousedown', function (ev) { + if (ev.target !== _this._wrapper) { + return; + } + ev.preventDefault(); + _this._toggleFocus(); + }); + } + + /** + * show popup + * @private + */ + + }, { + key: '_showPopupCodeBlockLanguages', + value: function _showPopupCodeBlockLanguages() { + var _this2 = this; + + var clientRect = this._inputLanguage.getBoundingClientRect(); + (0, _jquery2.default)(this._wrapper).toggleClass('active', true); + this.active = true; + + this._popupCodeBlockLanguages = this._eventManager.emitReduce('openPopupCodeBlockLanguages', { + language: this._prevStoredLanguage, + offset: { + left: clientRect.left, + top: clientRect.bottom + }, + callback: { + selected: function selected(selectedLanguage) { + return _this2._onLanguageSelectedFromList(selectedLanguage); + }, + dismissed: function dismissed() { + _this2._popupCodeBlockLanguages = null; + } + } + }); + } + }, { + key: '_toggleFocus', + value: function _toggleFocus() { + var inputLanguage = this._inputLanguage; + if ((0, _jquery2.default)(this._wrapper).hasClass('active')) { + inputLanguage.blur(); + } else { + inputLanguage.focus(); + } + } + }, { + key: '_onFocusOut', + value: function _onFocusOut() { + (0, _jquery2.default)(this._wrapper).toggleClass('active', false); + this._inputLanguage.value = this._prevStoredLanguage; + this._hidePopupCodeBlockLanguages(); + } + }, { + key: '_onKeyEvent', + value: function _onKeyEvent(event) { + if (this._popupCodeBlockLanguages) { + switch (event.which) { + case _keyMapper2.default.keyCode('UP'): + this._popupCodeBlockLanguages.prev(); + event.preventDefault(); + break; + case _keyMapper2.default.keyCode('DOWN'): + this._popupCodeBlockLanguages.next(); + event.preventDefault(); + break; + case _keyMapper2.default.keyCode('ENTER'): + case _keyMapper2.default.keyCode('TAB'): + { + var language = this._popupCodeBlockLanguages.getCurrentLanguage(); + this._inputLanguage.value = language; + this._storeInputLanguage(); + event.preventDefault(); + break; + } + default: + this._popupCodeBlockLanguages.hide(); + } + } else if (event.which === _keyMapper2.default.keyCode('ENTER') || event.which === _keyMapper2.default.keyCode('TAB')) { + this._storeInputLanguage(); + event.preventDefault(); + } + } + }, { + key: '_onLanguageSelectedFromList', + value: function _onLanguageSelectedFromList(selectedLanguage) { + this._inputLanguage.value = selectedLanguage; + this._storeInputLanguage(); + } + + /** + * set a callback to be called on language selected + * @param {function} callback - callback function + * @protected + */ + + }, { + key: 'setOnLanguageSelected', + value: function setOnLanguageSelected(callback) { + this._onLanguageSelected = callback; + } + + /** + * hide popup + * @private + */ + + }, { + key: '_hidePopupCodeBlockLanguages', + value: function _hidePopupCodeBlockLanguages() { + this._eventManager.emit('closePopupCodeBlockLanguages'); + } + + /** + * set language + * @param {string} language - code block language + * @protected + */ + + }, { + key: 'setLanguage', + value: function setLanguage(language) { + this._prevStoredLanguage = language; + this._inputLanguage.value = language; + } + + /** + * store selection(typed) language & hide popup + * @private + */ + + }, { + key: '_storeInputLanguage', + value: function _storeInputLanguage() { + var selectedLanguage = this._inputLanguage.value; + + this.setLanguage(selectedLanguage); + if (this._onLanguageSelected) { + this._onLanguageSelected(selectedLanguage); + } + + this._hidePopupCodeBlockLanguages(); + } + + /** + * get element body + * @returns {HTMLElement} - CodeBlockLanguagesCombo body element + * @protected + */ + + }, { + key: 'getElement', + value: function getElement() { + return this._wrapper; + } + }]); + + return CodeBlockLanguagesCombo; +}(); + +exports.default = CodeBlockLanguagesCombo; + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _toMark = __webpack_require__(24); + +var _toMark2 = _interopRequireDefault(_toMark); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Check if given node is valid delimiter run. + * According to common-mark spec, following examples are not valid delimiter runs. + * 1. opening (*|**) preceded by an alphanumeric and followed by a punctuation. + * (ex: a**~~c~~b**) + * 2. closing (*|**) preceded by a punctuation and followed by an alphanumeric. + * (ex: **b~~c~~**a) + * @see {@link https://spec.commonmark.org/0.29/#delimiter-run} + * @see {@link https://github.com/commonmark/commonmark-spec/issues/611#issuecomment-533578503} + */ +function isValidDelimiterRun(node) { + var isElemNode = _domUtils2.default.isElemNode, + isTextNode = _domUtils2.default.isTextNode; + + var isInvalidOpener = isTextNode(node.previousSibling) && isElemNode(node.firstChild); + var isInvalidCloser = isTextNode(node.nextSibling) && isElemNode(node.lastChild); + + return !isInvalidOpener && !isInvalidCloser; +} + +function convertEmphasis(node, subContent, delimiter) { + var FIND_BEFORE_AND_AFTER_SPACES_RX = /^(\s*)((?:.|\n)*\S)(\s*)$/m; + + var _subContent$match = subContent.match(FIND_BEFORE_AND_AFTER_SPACES_RX), + beforeSpaces = _subContent$match[1], + trimmedContent = _subContent$match[2], + afterSpaces = _subContent$match[3]; + + var convertedContent = void 0; + + if (isValidDelimiterRun(node)) { + convertedContent = '' + delimiter + trimmedContent + delimiter; + } else { + var tagName = node.nodeName.toLowerCase(); + + convertedContent = '<' + tagName + '>' + trimmedContent + ''; + } + + return '' + beforeSpaces + convertedContent + afterSpaces; +} + +exports.default = _toMark2.default.Renderer.factory(_toMark2.default.gfmRenderer, { + 'EM, I': function EMI(node, subContent) { + if (this.isEmptyText(subContent)) { + return ''; + } + + return convertEmphasis(node, subContent, '*'); + }, + 'STRONG, B': function STRONGB(node, subContent) { + if (this.isEmptyText(subContent)) { + return ''; + } + + return convertEmphasis(node, subContent, '**'); + }, + 'DEL, S': function DELS(node, subContent) { + if (this.isEmptyText(subContent)) { + return ''; + } + + return convertEmphasis(node, subContent, '~~'); + } +}); + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _emphasisCommon = __webpack_require__(26); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** +* @fileoverview Implements Bold markdown command +* @author NHN FE Development Lab +*/ +var boldRangeRegex = /^(\*{2}|_{2}).*\1$/; +var boldContentRegex = /[*_]{2,}([^*_]*)[*_]{2,}/g; +var boldSymbol = '**'; + +/** + * Bold + * Add bold markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/Bold + * @ignore + */ +var Bold = _commandManager2.default.command('markdown', /** @lends Bold */{ + name: 'Bold', + keyMap: ['CTRL+B', 'META+B'], + /** + * Command Handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + var originRange = mde.getRange(); + + (0, _emphasisCommon.changeSyntax)(doc, originRange, boldSymbol, boldRangeRegex, boldContentRegex); + + cm.focus(); + } +}); + +exports.default = Bold; + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _emphasisCommon = __webpack_require__(26); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @fileoverview Implements Italic markdown command + * @author NHN FE Development Lab + */ +var boldItalicRangeRegex = /^(\*{3}|_{3}).*\1$/; +var boldRangeRegex = /^(\*{2}|_{2}).*\1$/; +var italicRangeRegex = /^(\*|_).*\1$/; +var italicContentRegex = /([^*_])[*_]([^*_]+)[*_]([^*_])/g; + +var isBoldItalic = function isBoldItalic(t) { + return boldItalicRangeRegex.test(t); +}; +var isBold = function isBold(t) { + return boldRangeRegex.test(t); +}; +var isItalic = function isItalic(t) { + return italicRangeRegex.test(t); +}; + +var italicSymbol = '*'; +var boldSymbol = '**'; +var boldItalicSymbol = '***'; +var italicLength = italicSymbol.length; +var boldLength = boldSymbol.length; +var boldItalicLength = boldItalicSymbol.length; + +/** + * remove italic syntax in the middle of given text + * @param {string} text - text selected + * @returns {string} - text eliminated all italic in the middle of it's content + * @ignore + */ +var removeItalicInsideText = function removeItalicInsideText(text) { + return text ? text.replace(italicContentRegex, '$1$2$3') : ''; +}; + +var replaceText = function replaceText(doc, text, range) { + // Check 3 cases when both text and expand text + // case 1 : bold & italic (when expand 3 both front and end) => remove italic + // case 2 : bold (when expand 2 both front and end) => append + // case 3 : italic (expand 1 both front and end) => remove + var expandReplaceBind = _emphasisCommon.expandReplace.bind(this, doc, range); + + return expandReplaceBind(boldItalicLength, isBoldItalic, function (t) { + return (0, _emphasisCommon.removeSyntax)(t, italicSymbol); + }) || expandReplaceBind(boldLength, isBold, function (t) { + return (0, _emphasisCommon.appendSyntax)(removeItalicInsideText(t), italicSymbol); + }) || expandReplaceBind(italicLength, isItalic, function (t) { + return (0, _emphasisCommon.removeSyntax)(t, italicSymbol); + }) || (0, _emphasisCommon.replace)(doc, text, isBoldItalic, function (t) { + return (0, _emphasisCommon.removeSyntax)(t, italicSymbol); + }) || (0, _emphasisCommon.replace)(doc, text, isBold, function (t) { + return (0, _emphasisCommon.appendSyntax)(removeItalicInsideText(t), italicSymbol); + }) || (0, _emphasisCommon.replace)(doc, text, isItalic, function (t) { + return (0, _emphasisCommon.removeSyntax)(t, italicSymbol); + }); +}; + +var replaceEmptyText = function replaceEmptyText(doc, range) { + // Check 3 cases when expand text + // case 1 : bold & italic => remove italic + // case 2 : bold => append + // case 3 : italic => remove + // if there is no match, make italic + return (0, _emphasisCommon.expandReplace)(doc, range, boldItalicLength, isBoldItalic, function (t) { + return (0, _emphasisCommon.removeSyntax)(t, italicSymbol); + }) || (0, _emphasisCommon.expandReplace)(doc, range, boldLength, isBold, function (t) { + return (0, _emphasisCommon.appendSyntax)(t, italicSymbol); + }) || (0, _emphasisCommon.expandReplace)(doc, range, italicLength, isItalic, function () { + return ''; + }) || doc.replaceSelection('' + italicSymbol + italicSymbol, 'around'); +}; + +/** + * Italic + * Add italic markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/Italic + * @ignore + */ +var Italic = _commandManager2.default.command('markdown', /** @lends Italic */{ + name: 'Italic', + keyMap: ['CTRL+I', 'META+I'], + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + + var _doc$getCursor = doc.getCursor(), + line = _doc$getCursor.line, + ch = _doc$getCursor.ch; + + var range = mde.getRange(); + var selectionStr = doc.getSelection(); + + if (selectionStr) { + // check selectionStr match bold & italic, bold, italic and then + // if there is no match, append italic + if (!replaceText(doc, selectionStr, range)) { + // Before append italic, remove italic inside text and then append italic + // Example: One*Two*Three => *OneTwoThree* + doc.replaceSelection((0, _emphasisCommon.appendSyntax)(removeItalicInsideText(selectionStr), italicSymbol), 'around'); + } + } else { + replaceEmptyText(doc, range); + + var afterSelectStr = doc.getSelection(); + var size = ch; + + // If text was not selected, after replace text, move cursor + if (isBoldItalic(afterSelectStr) || isItalic(afterSelectStr) && !isBold(afterSelectStr)) { + // For example **|** => ***|*** (move cusor +symbolLenth) + size += italicLength; + } else { + // For example *|* => | (move cusor -symbolLenth) + size -= italicLength; + } + + doc.setCursor(line, size); + } + + cm.focus(); + } +}); + +exports.default = Italic; + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _emphasisCommon = __webpack_require__(26); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @fileoverview Implements StrikeThrough markdown command + * @author NHN FE Development Lab + */ +var strikeRangeRegex = /^~~.*~~$/; +var strikeContentRegex = /~~([^~]*)~~/g; +var strikeSymbol = '~~'; + +/** + * Strike + * Add strike markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/Strike + * @ignore + */ +var Strike = _commandManager2.default.command('markdown', /** @lends Strike */{ + name: 'Strike', + keyMap: ['CTRL+S', 'META+S'], + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + var originRange = mde.getRange(); + + (0, _emphasisCommon.changeSyntax)(doc, originRange, strikeSymbol, strikeRangeRegex, strikeContentRegex); + + cm.focus(); + } +}); + +exports.default = Strike; + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BlockquoteRegex = /^> ?/; + +/** + * Blockquote + * Add blockquote markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/Blockquote + * @ignore + */ +/** +* @fileoverview Implements Blockquote markdown command +* @author NHN FE Development Lab +*/ +var Blockquote = _commandManager2.default.command('markdown', /** @lends Blockquote */{ + name: 'Blockquote', + keyMap: ['ALT+Q', 'ALT+Q'], + /** + * command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + + var range = mde.getCurrentRange(); + + var from = { + line: range.from.line, + ch: 0 + }; + + var to = { + line: range.to.line, + ch: doc.getLineHandle(range.to.line).text.length + }; + + var textToModify = doc.getRange(from, to); + var textLinesToModify = textToModify.split('\n'); + var isNeedToRemove = this._haveBlockquote(textLinesToModify); + var resultText = void 0; + + if (isNeedToRemove) { + resultText = this._removeBlockquote(textLinesToModify); + } else { + resultText = this._addBlockquote(textLinesToModify); + } + + doc.replaceRange(resultText.join('\n'), from, to); + + if (isNeedToRemove) { + var length = textLinesToModify.length; + if (this._isBlockquoteWithSpace(textLinesToModify[length - 1])) { + range.to.ch -= 2; + } else { + range.to.ch -= 1; + } + } else { + range.to.ch += 2; + } + + doc.setCursor(range.to); + + cm.focus(); + }, + + + /** + * check all text in textArr starts with '>' + * @param {Array} textArr - text array + * @returns {boolean} - true if all text in textArr starts with '>' + * @private + */ + _haveBlockquote: function _haveBlockquote(textArr) { + for (var i = 0; i < textArr.length; i += 1) { + if (!BlockquoteRegex.test(textArr[i])) { + return false; + } + } + + return true; + }, + + + /** + * add '> ' to all text in textArr + * @param {Array} textArr - text array + * @returns {Array} - new text array added '> ' + * @private + */ + _addBlockquote: function _addBlockquote(textArr) { + return textArr.map(function (text) { + return '> ' + text; + }); + }, + + + /** + * remove '> ' or '>' to all text in textArr + * @param {Array} textArr - text array + * @returns {Array} - new text array removed '> ' or '>' + * @private + */ + _removeBlockquote: function _removeBlockquote(textArr) { + return textArr.map(function (text) { + return text.replace(BlockquoteRegex, ''); + }); + }, + + + /** + * check text start '> ' + * @param {string} text - text + * @returns {boolean} - if text start '> ', true + * @private + */ + _isBlockquoteWithSpace: function _isBlockquoteWithSpace(text) { + return (/^> /.test(text) + ); + } +}); + +exports.default = Blockquote; + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @fileoverview Implements Heading markdown command + * @author NHN FE Development Lab + */ +var FIND_HEADING_RX = /^#+\s/g; + +/** + * Heading + * Add heading markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/Heading + * @ignore + */ +var Heading = _commandManager2.default.command('markdown', /** @lends Heading */{ + name: 'Heading', + /** + * Command Handler + * @param {MarkdownEditor} mde MarkdownEditor instance + * @param {number} size heading size + */ + exec: function exec(mde, size) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + + var range = mde.getCurrentRange(); + + var from = { + line: range.from.line, + ch: 0 + }; + + var to = { + line: range.to.line, + ch: doc.getLineHandle(range.to.line).text.length + }; + + var lengthOfCurrentLineBefore = doc.getLine(to.line).length; + var textToModify = doc.getRange(from, to); + var textLinesToModify = textToModify.split('\n'); + + _tuiCodeSnippet2.default.forEachArray(textLinesToModify, function (line, index) { + textLinesToModify[index] = getHeadingMarkdown(line, size); + }); + + doc.replaceRange(textLinesToModify.join('\n'), from, to); + + range.to.ch += doc.getLine(to.line).length - lengthOfCurrentLineBefore; + + doc.setSelection(from, range.to); + + cm.focus(); + } +}); + +/** + * Get heading markdown + * @param {string} text Source test + * @param {number} size size + * @returns {string} + */ +function getHeadingMarkdown(text, size) { + var foundedHeading = text.match(FIND_HEADING_RX); + var heading = ''; + + do { + heading += '#'; + size -= 1; + } while (size > 0); + + if (foundedHeading) { + var _text$split = text.split(foundedHeading[0]); + + text = _text$split[1]; + } + + return heading + ' ' + text; +} + +exports.default = Heading; + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Paragraph + * Convert selected lines to paragraph + * @extends Command + * @module markdownCommands/Paragraph + * @ignore + */ +/** + * @fileoverview Implements Paragraph markdown command + * @author NHN FE Development Lab + */ +var Paragraph = _commandManager2.default.command('markdown', /** @lends Paragraph */{ + name: 'Paragraph', + /** + * Command Handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + var range = mde.getCurrentRange(); + var from = { + line: range.from.line, + ch: 0 + }; + var to = { + line: range.to.line, + ch: doc.getLineHandle(range.to.line).text.length + }; + + var lengthOfCurrentLineBefore = doc.getLine(to.line).length; + var textToModify = doc.getRange(from, to); + var textLines = textToModify.split('\n'); + + _tuiCodeSnippet2.default.forEachArray(textLines, function (line, index) { + textLines[index] = getParagraphMarkdown(line); + }); + + doc.replaceRange(textLines.join('\n'), from, to); + + range.to.ch += doc.getLine(to.line).length - lengthOfCurrentLineBefore; + + doc.setSelection(from, to); + + cm.focus(); + } +}); +/** + * Get paragraph markdown lineText + * @param {string} lineText line lineText + * @returns {string} + */ +function getParagraphMarkdown(lineText) { + var headingRx = /^(#{1,6}| *((?:\*|-|\d\.)(?: \[[ xX]])?)) /; + + return lineText.replace(headingRx, ''); +} + +exports.default = Paragraph; + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * HR + * Add HR markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/HR + * @ignore + */ +var HR = _commandManager2.default.command('markdown', /** @lends HR */{ + name: 'HR', + keyMap: ['CTRL+L', 'META+L'], + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + var replaceText = ''; + + var range = mde.getCurrentRange(); + + var from = { + line: range.from.line, + ch: range.from.ch + }; + + var to = { + line: range.to.line, + ch: range.to.ch + }; + + if (range.collapsed) { + replaceText = doc.getLine(from.line); + from.ch = 0; + to.ch = doc.getLineHandle(range.to.line).text.length; + } + + if (doc.getLine(from.line).length) { + replaceText += '\n\n* * *\n\n'; + } else { + replaceText += '\n* * *\n'; + } + + doc.replaceRange(replaceText, from, to); + + cm.focus(); + } +}); /** + * @fileoverview Implements HR markdown command + * @author NHN FE Development Lab + */ + +exports.default = HR; + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _importManager = __webpack_require__(15); + +var _importManager2 = _interopRequireDefault(_importManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** +* @fileoverview Implements Addlink markdown command +* @author NHN FE Development Lab +*/ +var decodeURIGraceful = _importManager2.default.decodeURIGraceful, + encodeMarkdownCharacters = _importManager2.default.encodeMarkdownCharacters, + escapeMarkdownCharacters = _importManager2.default.escapeMarkdownCharacters; + +/** + * AddLink + * Add link markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/AddLink + * @ignore + */ + +var AddLink = _commandManager2.default.command('markdown', /** @lends AddLink */{ + name: 'AddLink', + /** + * command handler for AddLink + * @param {MarkdownEditor} mde - MarkdownEditor instance + * @param {object} data - data for image + */ + exec: function exec(mde, data) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + + var range = mde.getCurrentRange(); + + var from = { + line: range.from.line, + ch: range.from.ch + }; + + var to = { + line: range.to.line, + ch: range.to.ch + }; + + var linkText = data.linkText, + url = data.url; + + linkText = decodeURIGraceful(linkText); + linkText = escapeMarkdownCharacters(linkText); + url = encodeMarkdownCharacters(url); + + var replaceText = '[' + linkText + '](' + url + ')'; + + doc.replaceRange(replaceText, from, to); + + cm.focus(); + } +}); + +exports.default = AddLink; + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _importManager = __webpack_require__(15); + +var _importManager2 = _interopRequireDefault(_importManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** +* @fileoverview Implments AddImage markdown command +* @author NHN FE Development Lab +*/ +var decodeURIGraceful = _importManager2.default.decodeURIGraceful, + encodeMarkdownCharacters = _importManager2.default.encodeMarkdownCharacters, + escapeMarkdownCharacters = _importManager2.default.escapeMarkdownCharacters; + +/** + * AddImage + * Add Image markdown syntax to markdown Editor + * @extends Command + * @module markdownCommands/AddImage + * @ignore + */ + +var AddImage = _commandManager2.default.command('markdown', /** @lends AddImage */{ + name: 'AddImage', + /** + * Command Handler + * @param {MarkdownEditor} mde MarkdownEditor instance + * @param {object} data data for image + */ + exec: function exec(mde, data) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + + var range = mde.getCurrentRange(); + + var from = { + line: range.from.line, + ch: range.from.ch + }; + + var to = { + line: range.to.line, + ch: range.to.ch + }; + + var altText = data.altText, + imageUrl = data.imageUrl; + + altText = decodeURIGraceful(altText); + altText = escapeMarkdownCharacters(altText); + imageUrl = encodeMarkdownCharacters(imageUrl); + var replaceText = '![' + altText + '](' + imageUrl + ')'; + + doc.replaceRange(replaceText, from, to, '+addImage'); + + cm.focus(); + } +}); + +exports.default = AddImage; + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * UL + * Add unordered list markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/UL + * @ignore + */ +var UL = _commandManager2.default.command('markdown', /** @lends UL */{ + name: 'UL', + keyMap: ['CTRL+U', 'META+U'], + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var range = mde.getCurrentRange(); + var listManager = mde.componentManager.getManager('list'); + + listManager.changeSyntax(range, 'ul'); + } +}); /** + * @fileoverview Implements UL markdown command + * @author NHN FE Development Lab + */ +exports.default = UL; + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * OL + * Add ordered list markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/OL + * @ignore + */ +var OL = _commandManager2.default.command('markdown', /** @lends OL */{ + name: 'OL', + keyMap: ['CTRL+O', 'META+O'], + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var range = mde.getCurrentRange(); + var listManager = mde.componentManager.getManager('list'); + + listManager.changeSyntax(range, 'ol'); + } +}); /** + * @fileoverview Implements OL markdown command + * @author NHN FE Development Lab + */ + +exports.default = OL; + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Indent + * Add Indent markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/inent + * @ignore + */ +var Indent = _commandManager2.default.command('markdown', /** @lends Indent */{ + name: 'Indent', + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + cm.execCommand('indentOrderedList'); + } +}); /** + * @fileoverview Implements Indent markdown command + * @author NHN FE Development Lab + */ + +exports.default = Indent; + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Outdent + * Add Outdent markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/outdent + * @ignore + */ +var Outdent = _commandManager2.default.command('markdown', /** @lends Outdent */{ + name: 'Outdent', + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + cm.execCommand('indentLessOrderedList'); + } +}); /** + * @fileoverview Implements Outdent markdown command + * @author NHN FE Development Lab + */ + +exports.default = Outdent; + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Table + * Add table markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/Table + * @ignore + */ +var Table = _commandManager2.default.command('markdown', /** @lends Table */{ + name: 'Table', + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + * @param {number} col column count + * @param {number} row row count + * @param {Array} data initial table data + */ + exec: function exec(mde, col, row, data) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + var table = '\n'; + + if (cm.getCursor().ch > 0) { + table += '\n'; + } + + table += makeHeader(col, data); + table += makeBody(col, row - 1, data); + + doc.replaceSelection(table); + + if (!data) { + cm.setCursor(cm.getCursor().line - row, 2); + } + + mde.focus(); + } +}); + +/** + * makeHeader + * make table header markdown string + * @param {number} col Column count + * @param {array} data Cell's text content + * @returns {string} markdown string + */ +/** + * @fileoverview Implements Table markdown command + * @author NHN FE Development Lab + */ + +function makeHeader(col, data) { + var header = '|'; + var border = '|'; + var index = 0; + + while (col) { + if (data) { + header += ' ' + data[index] + ' |'; + index += 1; + } else { + header += ' |'; + } + + border += ' --- |'; + + col -= 1; + } + + return header + '\n' + border + '\n'; +} + +/** + * makeBody + * make table body markdown string + * @param {number} col column count + * @param {number} row row count + * @param {Array} data initial table data + * @returns {string} html string + */ +function makeBody(col, row, data) { + var body = ''; + var index = col; + + for (var irow = 0; irow < row; irow += 1) { + body += '|'; + + for (var icol = 0; icol < col; icol += 1) { + if (data) { + body += ' ' + data[index] + ' |'; + index += 1; + } else { + body += ' |'; + } + } + + body += '\n'; + } + + body = body.replace(/\n$/g, ''); + + return body; +} +exports.default = Table; + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Task + * @extends Command + * @module markdownCommands/Task + * @ignore + */ +var Task = _commandManager2.default.command('markdown', /** @lends Task */{ + name: 'Task', + keyMap: ['ALT+T', 'ALT+T'], + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var range = mde.getCurrentRange(); + var listManager = mde.componentManager.getManager('list'); + + listManager.changeSyntax(range, 'task'); + } +}); /** + * @fileoverview Implements Task markdown command + * @author NHN FE Development Lab + */ +exports.default = Task; + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var codeRangeRegex = /^`([^`]+)`$/; /** + * @fileoverview Implements Code markdown command + * @author NHN FE Development Lab + */ + +var codeContentRegex = /`([^`]+)`/g; + +/** + * Code + * Add code markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/Code + * @ignore + */ +var Code = _commandManager2.default.command('markdown', /** @lends Code */{ + name: 'Code', + keyMap: ['SHIFT+CTRL+C', 'SHIFT+META+C'], + /** + * Command Handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + var selection = doc.getSelection(); + var cursor = cm.getCursor(); + var hasSyntax = this.hasStrikeSyntax(selection); + + var result = void 0; + if (hasSyntax) { + result = this.remove(selection); + result = this._removeCodeSyntax(result); + } else { + result = this._removeCodeSyntax(selection); + result = this.append(result); + } + + doc.replaceSelection(result, 'around'); + + if (!selection && !hasSyntax) { + this.setCursorToCenter(doc, cursor, hasSyntax); + } + + cm.focus(); + }, + + + /** + * set cursor to center + * @param {CodeMirror.doc} doc - codemirror document + * @param {object} cursor - codemirror cursor + * @param {boolean} isRemoved - whether it involes deletion + */ + setCursorToCenter: function setCursorToCenter(doc, cursor, isRemoved) { + var pos = isRemoved ? -1 : 1; + doc.setCursor(cursor.line, cursor.ch + pos); + }, + + + /** + * has code syntax + * @param {string} text Source text + * @returns {boolean} true if the given text has a code syntax + */ + hasStrikeSyntax: function hasStrikeSyntax(text) { + return codeRangeRegex.test(text); + }, + + + /** + * apply Code + * @param {string} text - selected text + * @returns {string} - text after code syntax applied + */ + append: function append(text) { + return '`' + text + '`'; + }, + + + /** + * remove Code + * @param {string} text - selected text + * @returns {string} - text after code syntax removed + */ + remove: function remove(text) { + return text.substr(1, text.length - 2); + }, + + + /** + * remove bold syntax in the middle of given text + * @param {string} text - text selected + * @returns {string} - text eliminated all code in the middle of it's content + * @private + */ + _removeCodeSyntax: function _removeCodeSyntax(text) { + return text ? text.replace(codeContentRegex, '$1') : ''; + } +}); + +exports.default = Code; + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * CodeBlock + * Add CodeBlock markdown syntax to markdown editor + * @extends Command + * @module markdownCommands/CodeBlock + * @ignore + */ +var CodeBlock = _commandManager2.default.command('markdown', /** @lends CodeBlock */{ + name: 'CodeBlock', + keyMap: ['SHIFT+CTRL+P', 'SHIFT+META+P'], + /** + * Command handler + * @param {MarkdownEditor} mde MarkdownEditor instance + */ + exec: function exec(mde) { + var cm = mde.getEditor(); + var doc = cm.getDoc(); + var range = mde.getCurrentRange(); + var replaceText = ['```', doc.getSelection(), '```']; + var cursorOffset = 1; + // insert a line break to the front if the selection starts in the middle of a text + if (range.from.ch !== 0) { + replaceText.unshift(''); + cursorOffset += 1; + } + // insert a line break to the end if the selection has trailing text + if (range.to.ch !== doc.getLine(range.to.line).length) { + replaceText.push(''); + } + doc.replaceSelection(replaceText.join('\n')); + + cm.setCursor(range.from.line + cursorOffset, 0); + + cm.focus(); + } +}); /** + * @fileoverview Implements CodeBlock markdown command + * @author NHN FE Development Lab + */ +exports.default = CodeBlock; + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Bold + * Add bold to selected wysiwyg editor content + * @extends Command + * @module wysiwygCommands/Bold + * @ignore + */ +/** + * @fileoverview Implements bold WysiwygCommand + * @author NHN FE Development Lab + */ +var Bold = _commandManager2.default.command('wysiwyg', /** @lends Bold */{ + name: 'Bold', + keyMap: ['CTRL+B', 'META+B'], + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var tableSelectionManager = wwe.componentManager.getManager('tableSelection'); + + wwe.focus(); + + if (sq.hasFormat('table') && tableSelectionManager.getSelectedCells().length) { + tableSelectionManager.styleToSelectedCells(styleBold); + + var range = sq.getSelection(); + range.collapse(true); + sq.setSelection(range); + } else { + styleBold(sq); + _domUtils2.default.optimizeRange(sq.getSelection(), 'B'); + } + } +}); + +/** + * Style bold. + * @param {object} sq - squire editor instance + */ +function styleBold(sq) { + if (sq.hasFormat('b') || sq.hasFormat('strong')) { + sq.changeFormat(null, { tag: 'b' }); + } else if (!sq.hasFormat('PRE')) { + if (sq.hasFormat('code')) { + sq.changeFormat(null, { tag: 'code' }); + } + sq.bold(); + } +} + +exports.default = Bold; + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Italic + * Add Italic to selected wysiwyg editor content + * @extends Command + * @module wysiwygCommands/Italic + * @ignore + */ +/** + * @fileoverview Implements italic WysiwygCommand + * @author NHN FE Development Lab + */ + +var Italic = _commandManager2.default.command('wysiwyg', /** @lends Italic */{ + name: 'Italic', + keyMap: ['CTRL+I', 'META+I'], + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var tableSelectionManager = wwe.componentManager.getManager('tableSelection'); + + wwe.focus(); + + if (sq.hasFormat('table') && tableSelectionManager.getSelectedCells().length) { + tableSelectionManager.styleToSelectedCells(styleItalic); + + var range = sq.getSelection(); + range.collapse(true); + sq.setSelection(range); + } else { + styleItalic(sq); + _domUtils2.default.optimizeRange(sq.getSelection(), 'I'); + } + } +}); + +/** + * Style italic. + * @param {object} sq - squire editor instance + */ +function styleItalic(sq) { + if (sq.hasFormat('i') || sq.hasFormat('em')) { + sq.changeFormat(null, { tag: 'i' }); + } else if (!sq.hasFormat('PRE')) { + if (sq.hasFormat('code')) { + sq.changeFormat(null, { tag: 'code' }); + } + sq.italic(); + } +} + +exports.default = Italic; + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Strike + * Add strike to selected wysiwyg editor content + * @extends Command + * @module wysiwygCommands/Strike + * @ignore + */ +/** + * @fileoverview Implements strike WysiwygCommand + * @author NHN FE Development Lab + */ + +var Strike = _commandManager2.default.command('wysiwyg', /** @lends Strike */{ + name: 'Strike', + keyMap: ['CTRL+S', 'META+S'], + /** + * command handler + * @param {WysiwygEditor} wwe WysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var tableSelectionManager = wwe.componentManager.getManager('tableSelection'); + + wwe.focus(); + + if (sq.hasFormat('table') && tableSelectionManager.getSelectedCells().length) { + tableSelectionManager.styleToSelectedCells(styleStrike); + + var range = sq.getSelection(); + range.collapse(true); + sq.setSelection(range); + } else { + styleStrike(sq); + _domUtils2.default.optimizeRange(sq.getSelection(), 'S'); + } + } +}); + +/** + * Style strike. + * @param {object} sq - squire editor instance + */ +function styleStrike(sq) { + if (sq.hasFormat('S')) { + sq.changeFormat(null, { tag: 'S' }); + } else if (!sq.hasFormat('PRE')) { + if (sq.hasFormat('code')) { + sq.changeFormat(null, { tag: 'code' }); + } + sq.strikethrough(); + } +} + +exports.default = Strike; + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Blockquote + * Add Blockquote to selected wysiwyg editor content + * @extends Command + * @module wysiwygCommands/Blockquote + * @ignore + */ +var Blockquote = _commandManager2.default.command('wysiwyg', /** @lends Blockquote */{ + name: 'Blockquote', + keyMap: ['ALT+Q', 'ALT+Q'], + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + + wwe.focus(); + + if (!sq.hasFormat('TABLE') && !sq.hasFormat('PRE')) { + if (sq.hasFormat('BLOCKQUOTE')) { + sq.decreaseQuoteLevel(); + } else { + sq.increaseQuoteLevel(); + } + } + } +}); /** + * @fileoverview Implements block quote WysiwygCommand + * @author NHN FE Development Lab + */ + +exports.default = Blockquote; + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _importManager = __webpack_require__(15); + +var _importManager2 = _interopRequireDefault(_importManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @fileoverview Implements AddImage wysiwyg command + * @author NHN FE Development Lab + */ +var decodeURIGraceful = _importManager2.default.decodeURIGraceful, + encodeMarkdownCharacters = _importManager2.default.encodeMarkdownCharacters; + +/** + * AddImage + * Add Image markdown syntax to wysiwyg Editor + * @extends Command + * @module wysiwygCommands/AddImage + * @ignore + */ + +var AddImage = _commandManager2.default.command('wysiwyg', /** @lends AddImage */{ + name: 'AddImage', + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + * @param {object} data data for image + */ + exec: function exec(wwe, data) { + var sq = wwe.getEditor(); + var altText = data.altText, + imageUrl = data.imageUrl; + + altText = decodeURIGraceful(altText); + imageUrl = encodeMarkdownCharacters(imageUrl); + + wwe.focus(); + + if (!sq.hasFormat('PRE')) { + sq.insertImage(imageUrl, { 'alt': altText }); + } + } +}); + +exports.default = AddImage; + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _importManager = __webpack_require__(15); + +var _importManager2 = _interopRequireDefault(_importManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @fileoverview Implements AddLink wysiwyg command + * @author NHN FE Development Lab + */ +var decodeURIGraceful = _importManager2.default.decodeURIGraceful, + encodeMarkdownCharacters = _importManager2.default.encodeMarkdownCharacters; + +/** + * AddLink + * Add link markdown syntax to wysiwyg Editor + * @extends Command + * @module wysiwygCommands/AddLink + * @ignore + */ + +var AddLink = _commandManager2.default.command('wysiwyg', /** @lends AddLink */{ + name: 'AddLink', + /** + * command handler + * @param {WysiwygEditor} wwe - wysiwygEditor instance + * @param {object} data - data for image + */ + exec: function exec(wwe, data) { + var sq = wwe.getEditor(); + var linkAttibute = wwe.getLinkAttribute(); + var url = data.url, + linkText = data.linkText; + + linkText = decodeURIGraceful(linkText); + url = encodeMarkdownCharacters(url); + + wwe.focus(); + + if (!sq.hasFormat('PRE')) { + sq.removeAllFormatting(); + + if (sq.getSelectedText()) { + sq.makeLink(url, linkAttibute); + } else { + var link = sq.createElement('A', _tuiCodeSnippet2.default.extend({ + href: url + }, linkAttibute)); + + (0, _jquery2.default)(link).text(linkText); + sq.insertElement(link); + } + } + } +}); + +exports.default = AddLink; + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * HR + * Add horizontal line markdown syntax to wysiwyg Editor + * @extends Command + * @module wysiwygCommands/HR + * @ignore + */ +/** + * @fileoverview Implements HR wysiwyg command + * @author NHN FE Development Lab + */ +var HR = _commandManager2.default.command('wysiwyg', /** @lends HR */{ + name: 'HR', + keyMap: ['CTRL+L', 'META+L'], + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var range = sq.getSelection(); + + if (range.collapsed && !sq.hasFormat('TABLE') && !sq.hasFormat('PRE')) { + var hr = document.createElement('hr'); + var currentNode = _domUtils2.default.getChildNodeByOffset(range.startContainer, range.startOffset); + var nextBlockNode = _domUtils2.default.getTopNextNodeUnder(currentNode, wwe.get$Body()[0]); + + // If nextBlockNode is div that has hr and has contenteditable as false, + // nextBlockNode should be set as nextSibling that is normal block. + if (nextBlockNode && !_domUtils2.default.isTextNode(nextBlockNode)) { + while (nextBlockNode && nextBlockNode.getAttribute('contenteditable') === 'false') { + nextBlockNode = nextBlockNode.nextSibling; + } + } + + if (!nextBlockNode) { + nextBlockNode = _domUtils2.default.createEmptyLine(); + wwe.get$Body().append(nextBlockNode); + } + + sq.modifyBlocks(function (frag) { + frag.appendChild(hr); + + return frag; + }); + + var previousSibling = hr.previousSibling; + + if (previousSibling && _domUtils2.default.isTextNode(previousSibling) && _domUtils2.default.getTextLength(previousSibling) === 0) { + hr.parentNode.removeChild(previousSibling); + } + + hr.parentNode.replaceChild(_domUtils2.default.createHorizontalRule(), hr); + + range.selectNodeContents(nextBlockNode); + range.collapse(true); + + sq.setSelection(range); + sq.saveUndoState(range); + } + + wwe.focus(); + } +}); + +exports.default = HR; + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Heading + * Convert selected root level contents to heading with size wysiwyg Editor + * @extends Command + * @module wysiwygCommands/Heading + * @ignore + */ +/** + * @fileoverview Implements Heading wysiwyg command + * @author NHN FE Development Lab + */ +var Heading = _commandManager2.default.command('wysiwyg', /** @lends Heading */{ + name: 'Heading', + /** + * Command handler + * @param {WysiwygEditor} wwe WYSIWYGEditor instance + * @param {Number} size size + */ + exec: function exec(wwe, size) { + var sq = wwe.getEditor(); + var blockTagName = 'h1, h2, h3, h4, h5, h6, div'; + + wwe.focus(); + + if (!sq.hasFormat('TABLE') && !sq.hasFormat('PRE')) { + sq.modifyBlocks(function (fragment) { + (0, _jquery2.default)(fragment).children(blockTagName).each(function (index, block) { + var headingHTML = ''; + var $block = (0, _jquery2.default)(block); + + if ($block.is('DIV')) { + $block.wrap(headingHTML); + } else { + var $wrapperHeading = (0, _jquery2.default)(headingHTML); + + $wrapperHeading.insertBefore(block); + $wrapperHeading.html($block.html()); + $block.remove(); + } + }); + + return fragment; + }); + } + } +}); + +exports.default = Heading; + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Paragraph + * Convert selected contents to paragraph only heading and list + * @extends Command + * @module wysiwygCommands/Paragraph + * @ignore + */ +/** + * @fileoverview Implements Paragraph wysiwyg command + * @author NHN FE Development Lab + */ +var Paragraph = _commandManager2.default.command('wysiwyg', /** @lends Paragraph */{ + name: 'Paragraph', + /** + * Command handler + * @param {WysiwygEditor} wwe WYSIWYGEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + + wwe.focus(); + + if (!sq.hasFormat('TABLE') && !sq.hasFormat('PRE')) { + sq.modifyBlocks(function (fragment) { + var $newFragment = (0, _jquery2.default)(document.createDocumentFragment()); + + (0, _jquery2.default)(fragment).children().each(function (index, block) { + if (block.nodeName.match(/h\d/i)) { + $newFragment.append((0, _jquery2.default)(block).children()); + } else if (block.nodeName.match(/ul|ol/i)) { + (0, _jquery2.default)(block).find('li').each(function (i, listItem) { + $newFragment.append((0, _jquery2.default)(listItem).children()); + }); + } else { + $newFragment.append(block); + } + }); + + return $newFragment[0]; + }); + } + } +}); + +exports.default = Paragraph; + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * UL + * Add UL to selected wysiwyg editor content + * @extends Command + * @module wysiwygCommands/UL + * @ignore + */ +var UL = _commandManager2.default.command('wysiwyg', /** @lends UL */{ + name: 'UL', + keyMap: ['CTRL+U', 'META+U'], + /** + * Command Handler + * @param {WysiwygEditor} wwe WYSIWYGEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var range = sq.getSelection(); + var listManager = wwe.componentManager.getManager('list'); + var startContainer = range.startContainer, + endContainer = range.endContainer, + startOffset = range.startOffset, + endOffset = range.endOffset; + + var newLIs = []; + + wwe.focus(); + sq.saveUndoState(range); + + if (listManager.isAvailableMakeListInTable()) { + newLIs = listManager.createListInTable(range, 'UL'); + } else { + var lines = listManager.getLinesOfSelection(startContainer, endContainer); + + for (var i = 0; i < lines.length; i += 1) { + var newLI = this._changeFormatToUnorderedListIfNeed(wwe, lines[i]); + if (newLI) { + newLIs.push(newLI); + } + } + } + + if (newLIs.length) { + listManager.adjustRange(startContainer, endContainer, startOffset, endOffset, newLIs); + } + }, + + + /** + * Change format to unordered list if need + * @param {WysiwygEditor} wwe Wysiwyg editor instance + * @param {HTMLElement} target Element target for change + * @returns {HTMLElement} newly created list + * @private + */ + _changeFormatToUnorderedListIfNeed: function _changeFormatToUnorderedListIfNeed(wwe, target) { + var sq = wwe.getEditor(); + var range = sq.getSelection(); + var taskManager = wwe.componentManager.getManager('task'); + var newLI = void 0; + + if (!sq.hasFormat('PRE')) { + range.setStart(target, 0); + range.collapse(true); + sq.setSelection(range); + + if (sq.hasFormat('LI')) { + wwe.saveSelection(range); + taskManager.unformatTask(range.startContainer); + sq.replaceParent(range.startContainer, 'ol', 'ul'); + wwe.restoreSavedSelection(); + } else { + wwe.unwrapBlockTag(); + sq.makeUnorderedList(); + } + + newLI = sq.getSelection().startContainer; + } + + return newLI; + } +}); /** + * @fileoverview Implements ul WysiwygCommand + * @author NHN FE Development Lab + */ +exports.default = UL; + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * OL + * Add OL to selected wysiwyg editor content + * @extends Command + * @module wysiwygCommands/OL + * @ignore + */ +var OL = _commandManager2.default.command('wysiwyg', /** @lends OL */{ + name: 'OL', + keyMap: ['CTRL+O', 'META+O'], + /** + * Command Handler + * @param {WysiwygEditor} wwe WYSIWYGEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var range = sq.getSelection(); + var listManager = wwe.componentManager.getManager('list'); + var startContainer = range.startContainer, + startOffset = range.startOffset, + endContainer = range.endContainer, + endOffset = range.endOffset; + + var newLIs = []; + + wwe.focus(); + sq.saveUndoState(range); + + if (listManager.isAvailableMakeListInTable()) { + newLIs = listManager.createListInTable(range, 'OL'); + } else { + var lines = listManager.getLinesOfSelection(startContainer, endContainer); + + for (var i = 0; i < lines.length; i += 1) { + var newLI = this._changeFormatToOrderedListIfNeed(wwe, lines[i]); + if (newLI) { + newLIs.push(newLI); + } + } + } + + if (newLIs.length) { + listManager.adjustRange(startContainer, endContainer, startOffset, endOffset, newLIs); + } + }, + + + /** + * Change format to unordered list if need + * @param {WysiwygEditor} wwe Wysiwyg editor instance + * @param {HTMLElement} target Element target for change + * @returns {HTMLElement} newly created list item + * @private + */ + _changeFormatToOrderedListIfNeed: function _changeFormatToOrderedListIfNeed(wwe, target) { + var sq = wwe.getEditor(); + var range = sq.getSelection(); + var taskManager = wwe.componentManager.getManager('task'); + var newLI = void 0; + + if (!sq.hasFormat('PRE')) { + range.setStart(target, 0); + range.collapse(true); + sq.setSelection(range); + + if (sq.hasFormat('LI')) { + wwe.saveSelection(range); + taskManager.unformatTask(range.startContainer); + sq.replaceParent(range.startContainer, 'ul', 'ol'); + wwe.restoreSavedSelection(); + } else { + wwe.unwrapBlockTag(); + sq.makeOrderedList(); + } + + newLI = sq.getSelection().startContainer; + } + + return newLI; + } +}); /** + * @fileoverview Implements ol WysiwygCommand + * @author NHN FE Development Lab + */ + +exports.default = OL; + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Table + * Add table to selected wysiwyg editor content + * @extends Command + * @module wysiwygCommands/Table + * @ignore + */ +var Table = _commandManager2.default.command('wysiwyg', /** @lends Table */{ + name: 'Table', + /** + * Command Handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + * @param {number} col column count + * @param {number} row row count + * @param {Array} data initial table data + */ + exec: function exec(wwe, col, row, data) { + var sq = wwe.getEditor(); + var tableIDClassName = wwe.componentManager.getManager('table').getTableIDClassName(); + var tableHTMLString = void 0; + + if (!sq.getSelection().collapsed || sq.hasFormat('TABLE') || sq.hasFormat('PRE')) { + wwe.focus(); + + return; + } + + tableHTMLString = ''; + tableHTMLString += makeHeader(col, data); + tableHTMLString += makeBody(col, row - 1, data); + tableHTMLString += '
    '; + + sq.insertHTML(tableHTMLString); + + wwe.focus(); + + if (!data) { + focusToFirstTh(sq, wwe.get$Body().find('.' + tableIDClassName)); + } + } +}); + +/** + * Focus to first th + * @param {Squire} sq Squire instance + * @param {jQuery} $table jQuery wrapped table element + */ +/** + * @fileoverview Implements table WysiwygCommand + * @author NHN FE Development Lab + */ +function focusToFirstTh(sq, $table) { + var range = sq.getSelection(); + + range.selectNodeContents($table.find('th')[0]); + range.collapse(true); + sq.setSelection(range); +} + +/** + * makeHeader + * make table header html string + * @param {number} col column count + * @param {string} data cell data + * @returns {string} html string + */ +function makeHeader(col, data) { + var header = ''; + var index = 0; + + while (col) { + header += ''; + + if (data) { + header += data[index]; + index += 1; + } + + header += ''; + col -= 1; + } + + header += ''; + + return header; +} + +/** + * makeBody + * make table body html string + * @param {number} col column count + * @param {number} row row count + * @param {string} data cell data + * @returns {string} html string + */ +function makeBody(col, row, data) { + var body = ''; + var index = col; + + for (var irow = 0; irow < row; irow += 1) { + body += ''; + + for (var icol = 0; icol < col; icol += 1) { + body += ''; + + if (data) { + body += data[index]; + index += 1; + } + + body += ''; + } + + body += ''; + } + + body += ''; + + return body; +} + +exports.default = Table; + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * AddRow + * Add Row to selected table + * @extends Command + * @module wysiwygCommands/TableAddRow + * @ignore + */ +var TableAddRow = _commandManager2.default.command('wysiwyg', /** @lends AddRow */{ + name: 'AddRow', + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var range = sq.getSelection().cloneRange(); + var selectedRowLength = getSelectedRowsLength(wwe); + var $tr = void 0, + $newRow = void 0; + + wwe.focus(); + + if (sq.hasFormat('TD')) { + sq.saveUndoState(range); + $tr = (0, _jquery2.default)(range.startContainer).closest('tr'); + for (var i = 0; i < selectedRowLength; i += 1) { + $newRow = getNewRow($tr); + $newRow.insertAfter($tr); + } + + focusToFirstTd(sq, $newRow); + } else if (sq.hasFormat('TH')) { + sq.saveUndoState(range); + $tr = (0, _jquery2.default)(range.startContainer).parents('thead').next('tbody').children('tr').eq(0); + for (var _i = 0; _i < selectedRowLength; _i += 1) { + $newRow = getNewRow($tr); + $newRow.insertBefore($tr); + } + + focusToFirstTd(sq, $newRow); + } + } +}); + +/** + * get number of selected rows + * @param {WysiwygEditor} wwe - wysiwygEditor instance + * @returns {number} - number of selected rows + * @ignore + */ +/** + * @fileoverview Implements table add row WysiwygCommand + * @author NHN FE Development Lab + */ +function getSelectedRowsLength(wwe) { + var selectionMgr = wwe.componentManager.getManager('tableSelection'); + var $selectedCells = selectionMgr.getSelectedCells(); + var length = 1; + + if ($selectedCells.length > 1) { + var first = $selectedCells.first().get(0); + var last = $selectedCells.last().get(0); + var range = selectionMgr.getSelectionRangeFromTable(first, last); + length = range.to.row - range.from.row + 1; + } + + return length; +} + +/** + * Get new row of given row + * @param {jQuery} $tr - jQuery wrapped table row + * @returns {jQuery} - new cloned jquery element + * @ignore + */ +function getNewRow($tr) { + var cloned = $tr.clone(); + var htmlString = _tuiCodeSnippet2.default.browser.msie ? '' : '
    '; + + cloned.find('td').html(htmlString); + + return cloned; +} + +/** + * Focus to first table cell + * @param {Squire} sq - Squire instance + * @param {jQuery} $tr - jQuery wrapped table row + * @ignore + */ +function focusToFirstTd(sq, $tr) { + var range = sq.getSelection(); + + range.selectNodeContents($tr.find('td')[0]); + range.collapse(true); + sq.setSelection(range); +} + +exports.default = TableAddRow; + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * AddCol + * Add col to selected table + * @extends Command + * @module wysiwygCommands/TableAddCol + * @ignore + */ +/** + * @fileoverview Implements table add column WysiwygCommand + * @author NHN FE Development Lab + */ +var TableAddCol = _commandManager2.default.command('wysiwyg', /** @lends AddCol */{ + name: 'AddCol', + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var range = sq.getSelection().cloneRange(); + var numberOfCols = getNumberOfCols(wwe); + var $cell = void 0; + + wwe.focus(); + + if (sq.hasFormat('TR')) { + sq.saveUndoState(range); + + $cell = getCellByRange(range); + addColToCellAfter($cell, numberOfCols); + + focusToNextCell(sq, $cell); + } + } +}); + +/** + * get number of selected cols + * @param {WysiwygEditor} wwe - wysiwyg editor instance + * @returns {number} - number of selected cols + * @ignore + */ +function getNumberOfCols(wwe) { + var selectionMgr = wwe.componentManager.getManager('tableSelection'); + var $selectedCells = selectionMgr.getSelectedCells(); + var length = 1; + + if ($selectedCells.length > 0) { + var maxLength = $selectedCells.get(0).parentNode.querySelectorAll('td, th').length; + length = Math.min(maxLength, $selectedCells.length); + } + + return length; +} + +/** + * Get cell by range object + * @param {Range} range - range + * @returns {jQuery} - jQuery html element + * @ignore + */ +function getCellByRange(range) { + var cell = range.startContainer; + + if (_domUtils2.default.getNodeName(cell) === 'TD' || _domUtils2.default.getNodeName(cell) === 'TH') { + cell = (0, _jquery2.default)(cell); + } else { + cell = (0, _jquery2.default)(cell).parentsUntil('tr'); + } + + return cell; +} + +/** + * Add column to after the current cell + * @param {jQuery} $cell - jQuery wrapped table cell + * @param {number} [numberOfCols=1] - number of cols + * @ignore + */ +function addColToCellAfter($cell) { + var numberOfCols = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + + var index = $cell.index(); + var cellToAdd = void 0; + + $cell.parents('table').find('tr').each(function (n, tr) { + var isTBody = _domUtils2.default.getNodeName(tr.parentNode) === 'TBODY'; + var isMSIE = _tuiCodeSnippet2.default.browser.msie; + var cell = tr.children[index]; + for (var i = 0; i < numberOfCols; i += 1) { + if (isTBody) { + cellToAdd = document.createElement('td'); + } else { + cellToAdd = document.createElement('th'); + } + if (!isMSIE) { + cellToAdd.appendChild(document.createElement('br')); + } + (0, _jquery2.default)(cellToAdd).insertAfter(cell); + } + }); +} + +/** + * Focus to next cell + * @param {Squire} sq - Squire instance + * @param {jQuery} $cell - jQuery wrapped table cell + * @ignore + */ +function focusToNextCell(sq, $cell) { + var range = sq.getSelection(); + + range.selectNodeContents($cell.next()[0]); + range.collapse(true); + + sq.setSelection(range); +} + +exports.default = TableAddCol; + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * RemoveRow + * remove Row to selected table + * @extends Command + * @module wysiwygCommands/TableRemoveRow + * @ignore + */ +/** + * @fileoverview Implements table remove row WysiwygCommand + * @author NHN FE Development Lab + */ +var TableRemoveRow = _commandManager2.default.command('wysiwyg', /** @lends RemoveRow */{ + name: 'RemoveRow', + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var range = sq.getSelection().cloneRange(); + var $table = (0, _jquery2.default)(range.startContainer).parents('table'); + var selectionMgr = wwe.componentManager.getManager('tableSelection'); + var tableMgr = wwe.componentManager.getManager('table'); + var $tr = getTrs(range, selectionMgr, $table); + var tbodyRowLength = $table.find('tbody tr').length; + + wwe.focus(); + + if ((sq.hasFormat('TD') || sq.hasFormat('TABLE')) && tbodyRowLength > 1) { + sq.saveUndoState(range); + var $nextFocus = $tr.last().next()[0] ? $tr.last().next() : $tr.first().prev(); + + if ($nextFocus.length) { + focusToFirstTd(sq, range, $nextFocus, tableMgr); + } + $tr.remove(); + } + selectionMgr.removeClassAttrbuteFromAllCellsIfNeed(); + } +}); + +/** + * Focus to first TD in given TR + * @param {SquireExt} sq Squire instance + * @param {Range} range Range object + * @param {jQuery} $tr jQuery wrapped TR + * @param {object} tableMgr Table manager + */ +function focusToFirstTd(sq, range, $tr, tableMgr) { + var nextFocusCell = $tr.find('td').get(0); + range.setStart(nextFocusCell, 0); + range.collapse(true); + + tableMgr.setLastCellNode(nextFocusCell); + sq.setSelection(range); +} + +/** + * Get start, end row index from current range + * @param {HTMLElement} firstSelectedCell Range object + * @param {object} rangeInformation Range information object + * @param {jQuery} $table jquery wrapped TABLE + * @returns {jQuery} + */ +function getSelectedRows(firstSelectedCell, rangeInformation, $table) { + var tbodyRowLength = $table.find('tbody tr').length; + var isStartContainerInThead = (0, _jquery2.default)(firstSelectedCell).parents('thead').length; + var startRowIndex = rangeInformation.from.row; + var endRowIndex = rangeInformation.to.row; + + if (isStartContainerInThead) { + startRowIndex += 1; + } + + var isWholeTbodySelected = (startRowIndex === 1 || isStartContainerInThead) && endRowIndex === tbodyRowLength; + + if (isWholeTbodySelected) { + endRowIndex -= 1; + } + + return $table.find('tr').slice(startRowIndex, endRowIndex + 1); +} + +/** + * Get TRs + * @param {Range} range Range object + * @param {object} selectionMgr Table selection manager + * @param {jQuery} $table current table + * @returns {jQuery} + */ +function getTrs(range, selectionMgr, $table) { + var $selectedCells = selectionMgr.getSelectedCells(); + var rangeInformation = void 0, + trs = void 0; + + if ($selectedCells.length) { + rangeInformation = selectionMgr.getSelectionRangeFromTable($selectedCells.first().get(0), $selectedCells.last().get(0)); + trs = getSelectedRows($selectedCells.first()[0], rangeInformation, $table); + } else { + var cell = (0, _jquery2.default)(range.startContainer).closest('td,th').get(0); + rangeInformation = selectionMgr.getSelectionRangeFromTable(cell, cell); + trs = getSelectedRows(cell, rangeInformation, $table); + } + + return trs; +} +exports.default = TableRemoveRow; + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * RemoveCol + * remove Row to selected table + * @extends Command + * @module wysiwygCommands/TableRemoveCol + * @ignore + */ +var TableRemoveCol = _commandManager2.default.command('wysiwyg', /** @lends RemoveCol */{ + name: 'RemoveCol', + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var range = sq.getSelection().cloneRange(); + var $table = (0, _jquery2.default)(range.startContainer).parents('table'); + var tableMgr = wwe.componentManager.getManager('table'); + var selectionMgr = wwe.componentManager.getManager('tableSelection'); + var hasMultipleCols = (0, _jquery2.default)(range.startContainer).closest('table').find('thead tr th').length > 1; + + wwe.focus(); + // IE 800a025e error on removing part of selection range. collapse + range.collapse(true); + sq.setSelection(range); + + if (sq.hasFormat('TR', null, range) && hasMultipleCols) { + var tbodyColLength = $table.find('tbody tr:first td').length; + var $selectedCellsByManager = selectionMgr.getSelectedCells(); + + if ($selectedCellsByManager.length < tbodyColLength) { + sq.saveUndoState(range); + var $nextFocus = void 0; + + if ($selectedCellsByManager.length > 1) { + var $tailCell = $selectedCellsByManager.last(); + var $headCell = $selectedCellsByManager.first(); + $nextFocus = $tailCell.next().length ? $tailCell.next() : $headCell.prev(); + + removeMultipleColsByCells($selectedCellsByManager); + } else { + var $cell = getCellByRange(range); + $nextFocus = $cell.next().length ? $cell.next() : $cell.prev(); + + removeColByCell($cell); + } + + focusToCell(sq, $nextFocus, tableMgr); + } + } + } +}); + +/** + * Get cell by range object + * @param {Range} range range + * @returns {HTMLElement|Node} + */ +/** + * @fileoverview Implements table remove column WysiwygCommand + * @author NHN FE Development Lab + */ +function getCellByRange(range) { + var cell = range.startContainer; + + if (_domUtils2.default.getNodeName(cell) === 'TD' || _domUtils2.default.getNodeName(cell) === 'TH') { + cell = (0, _jquery2.default)(cell); + } else { + cell = (0, _jquery2.default)(cell).parentsUntil('tr'); + } + + return cell; +} + +/** + * Remove columns by given cells + * @param {jQuery} $cells - jQuery table cells + */ +function removeMultipleColsByCells($cells) { + var numberOfCells = $cells.length; + for (var i = 0; i < numberOfCells; i += 1) { + var $cellToDelete = $cells.eq(i); + if ($cellToDelete.length > 0) { + removeColByCell($cells.eq(i)); + } + } +} + +/** + * Remove column by given cell + * @param {jQuery} $cell - jQuery wrapped table cell + */ +function removeColByCell($cell) { + var index = $cell.index(); + + $cell.parents('table').find('tr').each(function (n, tr) { + (0, _jquery2.default)(tr).children().eq(index).remove(); + }); +} + +/** + * Focus to given cell + * @param {Squire} sq - Squire instance + * @param {jQuery} $cell - jQuery wrapped table cell + * @param {object} tableMgr - Table manager instance + */ +function focusToCell(sq, $cell, tableMgr) { + var nextFocusCell = $cell.get(0); + + if ($cell.length && _jquery2.default.contains(document, $cell)) { + var range = sq.getSelection(); + range.selectNodeContents($cell[0]); + range.collapse(true); + sq.setSelection(range); + + tableMgr.setLastCellNode(nextFocusCell); + } +} + +exports.default = TableRemoveCol; + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * AlignCol + * Align selected column's text content to given direction + * @extends Command + * @module wysiwygCommands/TableAlignCol + * @ignore + */ +var TableAlignCol = _commandManager2.default.command('wysiwyg', /** @lends AlignCol */{ + name: 'AlignCol', + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + * @param {string} alignDirection Align direction + */ + exec: function exec(wwe, alignDirection) { + var sq = wwe.getEditor(); + var range = sq.getSelection().cloneRange(); + var selectionMgr = wwe.componentManager.getManager('tableSelection'); + var rangeInformation = getRangeInformation(range, selectionMgr); + + wwe.focus(); + + if (sq.hasFormat('TR')) { + sq.saveUndoState(range); + + var $table = (0, _jquery2.default)(range.startContainer).parents('table'); + + var selectionInformation = getSelectionInformation($table, rangeInformation); + + setAlignAttributeToTableCells($table, alignDirection, selectionInformation); + } + selectionMgr.removeClassAttrbuteFromAllCellsIfNeed(); + } +}); + +/** + * Set Column align + * @param {jQuery} $table jQuery wrapped TABLE + * @param {string} alignDirection 'left' or 'center' or 'right' + * @param {{ + * startColumnIndex: number, + * endColumnIndex: number, + * isDivided: boolean + * }} selectionInformation start, end column index and boolean value for whether range divided or not + */ +/** + * @fileoverview Implements table align column WysiwygCommand + * @author NHN FE Development Lab + */ +function setAlignAttributeToTableCells($table, alignDirection, selectionInformation) { + var isDivided = selectionInformation.isDivided || false; + var start = selectionInformation.startColumnIndex; + var end = selectionInformation.endColumnIndex; + var columnLength = $table.find('tr').eq(0).find('td,th').length; + + $table.find('tr').each(function (n, tr) { + (0, _jquery2.default)(tr).children('td,th').each(function (index, cell) { + if (isDivided && (start <= index && index <= columnLength || index <= end)) { + (0, _jquery2.default)(cell).attr('align', alignDirection); + } else if (start <= index && index <= end) { + (0, _jquery2.default)(cell).attr('align', alignDirection); + } + }); + }); +} + +/** + * Return start, end column index and boolean value for whether range divided or not + * @param {jQuery} $table jQuery wrapped TABLE + * @param {{startColumnIndex: number, endColumnIndex: number}} rangeInformation Range information + * @returns {{startColumnIndex: number, endColumnIndex: number, isDivided: boolean}} + */ +function getSelectionInformation($table, rangeInformation) { + var columnLength = $table.find('tr').eq(0).find('td,th').length; + var from = rangeInformation.from, + to = rangeInformation.to; + + var startColumnIndex = void 0, + endColumnIndex = void 0, + isDivided = void 0; + + if (from.row === to.row) { + startColumnIndex = from.cell; + endColumnIndex = to.cell; + } else if (from.row < to.row) { + if (from.cell <= to.cell) { + startColumnIndex = 0; + endColumnIndex = columnLength - 1; + } else { + startColumnIndex = from.cell; + endColumnIndex = to.cell; + isDivided = true; + } + } + + return { + startColumnIndex: startColumnIndex, + endColumnIndex: endColumnIndex, + isDivided: isDivided + }; +} + +/** + * Get range information + * @param {Range} range Range object + * @param {object} selectionMgr Table selection manager + * @returns {object} + */ +function getRangeInformation(range, selectionMgr) { + var $selectedCells = selectionMgr.getSelectedCells(); + var rangeInformation = void 0, + startCell = void 0; + + if ($selectedCells.length) { + rangeInformation = selectionMgr.getSelectionRangeFromTable($selectedCells.first().get(0), $selectedCells.last().get(0)); + } else { + var startContainer = range.startContainer; + + startCell = _domUtils2.default.isTextNode(startContainer) ? (0, _jquery2.default)(startContainer).parent('td,th')[0] : startContainer; + rangeInformation = selectionMgr.getSelectionRangeFromTable(startCell, startCell); + } + + return rangeInformation; +} + +exports.default = TableAlignCol; + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * RemoveTable + * Remove selected table + * @extends Command + * @module wysiwygCommands/TableRemove + * @ignore + */ +/** + * @fileoverview Implements table remove WysiwygCommand + * @author NHN FE Development Lab + */ +var TableRemove = _commandManager2.default.command('wysiwyg', /** @lends RemoveTable */{ + name: 'RemoveTable', + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var range = sq.getSelection().cloneRange(); + + if (sq.hasFormat('TABLE')) { + sq.saveUndoState(range); + var $table = (0, _jquery2.default)(range.startContainer).closest('table'); + + $table.remove(); + } + + wwe.focus(); + } +}); + +exports.default = TableRemove; + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Indent + * Indent list or task to wysiwyg Editor + * @extends Command + * @module wysiwygCommands/indent + * @ignore + */ +/** + * @fileoverview Implements Indent wysiwyg command + * @author NHN FE Development Lab + */ +var Indent = _commandManager2.default.command('wysiwyg', /** @lends Indent */{ + name: 'Indent', + /** + * Command Handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var listManager = wwe.componentManager.getManager('list'); + var range = wwe.getEditor().getSelection(); + var $node = (0, _jquery2.default)(range.startContainer).closest('li'); + var prevClasses = void 0, + nodeClasses = void 0, + nextClasses = void 0; + + var $prev = $node.prev(); + + if ($prev.length && $node.length) { + var $next = $node.find('li').eq(0); + + wwe.getEditor().saveUndoState(); + + nodeClasses = $node.attr('class'); + prevClasses = $prev.attr('class'); + nextClasses = $next.attr('class'); + + $node.removeAttr('class'); + $prev.removeAttr('class'); + + if ($next.length && !$next.children('div').length) { + $next.removeAttr('class'); + } + + wwe.getEditor().increaseListLevel(); + listManager.mergeList($node.get(0)); + + $node.attr('class', nodeClasses); + $prev.attr('class', prevClasses); + $next.attr('class', nextClasses); + } + } +}); + +exports.default = Indent; + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Outdent + * Outdent list or task to wysiwyg Editor + * @extends Command + * @module wysiwygCommands/Outdent + * @ignore + */ +/** + * @fileoverview Implements Outdent wysiwyg command + * @author NHN FE Development Lab + */ +var Outdent = _commandManager2.default.command('wysiwyg', /** @lends Outdent */{ + name: 'Outdent', + + /** + * Command Handler + * @param {WysiwygEditor} wwe WysiwygEditor instance + */ + exec: function exec(wwe) { + var $node = getCurrent$Li(wwe); + + if ($node.length && isExecutable($node)) { + wwe.getEditor().saveUndoState(); + + var nodeClasses = $node.attr('class'); + wwe.getEditor().decreaseListLevel(); + + $node = getCurrent$Li(wwe); + $node.attr('class', nodeClasses); + } + } +}); + +/** + * test if outdent the given list item + * arbitrary list allows list item to be in any position + * while markdown spec does not + * @param {jQuery} $currentLiNode - jQuery list item element + * @returns {boolean} - true to executable + * @ignore + */ +function isExecutable($currentLiNode) { + return !$currentLiNode.next().is('OL,UL'); +} + +/** + * Get list item element of current selection + * @param {object} wwe Wysiwyg editor instance + * @returns {jQuery} + * @ignore + */ +function getCurrent$Li(wwe) { + var range = wwe.getEditor().getSelection(); + + return (0, _jquery2.default)(range.startContainer).closest('li'); +} + +exports.default = Outdent; + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Task + * Add Task to selected wysiwyg editor content + * @extends Command + * @module wysiwygCommands/Task + * @ignore + */ +/** + * @fileoverview Implements Task WysiwygCommand + * @author NHN FE Development Lab + */ +var Task = _commandManager2.default.command('wysiwyg', /** @lends Task */{ + name: 'Task', + keyMap: ['ALT+T', 'ALT+T'], + /** + * Command Handler + * @param {WysiwygEditor} wwe WYSIWYGEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var range = sq.getSelection(); + var listManager = wwe.componentManager.getManager('list'); + var startContainer = range.startContainer, + endContainer = range.endContainer, + startOffset = range.startOffset, + endOffset = range.endOffset; + + var newLIs = []; + + wwe.focus(); + + sq.saveUndoState(range); + + if (listManager.isAvailableMakeListInTable()) { + newLIs = listManager.createListInTable(range, 'TASK'); + } else { + var lines = listManager.getLinesOfSelection(startContainer, endContainer); + + for (var i = 0; i < lines.length; i += 1) { + var newLI = this._changeFormatToTaskIfNeed(wwe, lines[i]); + if (newLI) { + newLIs.push(newLI); + } + } + } + + if (newLIs.length) { + listManager.adjustRange(startContainer, endContainer, startOffset, endOffset, newLIs); + } + }, + + + /** + * Change format to unordered list and return current li element if need + * @param {WysiwygEditor} wwe Wysiwyg editor instance + * @param {HTMLElement} target Element target for change + * @returns {HTMLElement} newly created list + * @private + */ + _changeFormatToTaskIfNeed: function _changeFormatToTaskIfNeed(wwe, target) { + var sq = wwe.getEditor(); + var range = sq.getSelection(); + var taskManager = wwe.componentManager.getManager('task'); + var newLI = void 0; + + if (!sq.hasFormat('PRE')) { + range.setStart(target, 0); + range.collapse(true); + sq.setSelection(range); + + if (!sq.hasFormat('li')) { + sq.makeUnorderedList(); + target = sq.getSelection().startContainer; + } + + if ((0, _jquery2.default)(target).hasClass('task-list-item')) { + taskManager.unformatTask(target); + } else { + taskManager.formatTask(target); + } + + newLI = sq.getSelection().startContainer; + } + + return newLI; + } +}); + +exports.default = Task; + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +var _domUtils = __webpack_require__(4); + +var _domUtils2 = _interopRequireDefault(_domUtils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Code + * Add bold to selected wysiwyg editor content + * @extends Command + * @module wysiwygCommands/Code + * @ignore + */ +/** + * @fileoverview Implements code WysiwygCommand + * @author NHN FE Development Lab + */ +var Code = _commandManager2.default.command('wysiwyg', /** @lends Code */{ + name: 'Code', + keyMap: ['SHIFT+CTRL+C', 'SHIFT+META+C'], + /** + * command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + */ + exec: function exec(wwe) { + var sq = wwe.getEditor(); + var tableSelectionManager = wwe.componentManager.getManager('tableSelection'); + var _styleCode = _tuiCodeSnippet2.default.bind(styleCode, null, wwe.getEditor()); + + wwe.focus(); + + if (sq.hasFormat('table') && tableSelectionManager.getSelectedCells().length) { + tableSelectionManager.styleToSelectedCells(_styleCode); + + var range = sq.getSelection(); + range.collapse(true); + sq.setSelection(range); + } else { + _styleCode(sq); + } + } +}); + +/** + * removeUnnecessaryCodeInNextToRange + * Remove unnecessary code tag next to range, code tag made by squire + * @param {Range} range range object + */ +function removeUnnecessaryCodeInNextToRange(range) { + if (_domUtils2.default.getNodeName(range.startContainer.nextSibling) === 'CODE' && _domUtils2.default.getTextLength(range.startContainer.nextSibling) === 0) { + (0, _jquery2.default)(range.startContainer.nextSibling).remove(); + } +} + +/** + * Style code. + * @param {object} editor - editor instance + * @param {object} sq - squire editor instance + */ +function styleCode(editor, sq) { + if (!sq.hasFormat('PRE') && sq.hasFormat('code')) { + sq.changeFormat(null, { tag: 'code' }); + removeUnnecessaryCodeInNextToRange(editor.getSelection().cloneRange()); + } else if (!sq.hasFormat('a') && !sq.hasFormat('PRE')) { + if (sq.hasFormat('b')) { + sq.removeBold(); + } else if (sq.hasFormat('i')) { + sq.removeItalic(); + } + + sq.changeFormat({ tag: 'code' }); + + var range = sq.getSelection().cloneRange(); + range.setStart(range.endContainer, range.endOffset); + range.collapse(true); + + sq.setSelection(range); + } +} + +exports.default = Code; + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _jquery = __webpack_require__(0); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _tuiCodeSnippet = __webpack_require__(1); + +var _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet); + +var _commandManager = __webpack_require__(2); + +var _commandManager2 = _interopRequireDefault(_commandManager); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var CODEBLOCK_CLASS_TEMP = 'te-content-codeblock-temp'; /** + * @fileoverview Implements code block WysiwygCommand + * @author NHN FE Development Lab + */ + +var CODEBLOCK_ATTR_NAME = 'data-te-codeblock'; + +/** + * CodeBlock + * Add CodeBlock to wysiwygEditor + * @extends Command + * @module wysiwygCommands/Codeblock + * @ignore + */ +var CodeBlock = _commandManager2.default.command('wysiwyg', /** @lends CodeBlock */{ + name: 'CodeBlock', + keyMap: ['SHIFT+CTRL+P', 'SHIFT+META+P'], + /** + * Command handler + * @param {WysiwygEditor} wwe wysiwygEditor instance + * @param {string} type of language + */ + exec: function exec(wwe, type) { + var sq = wwe.getEditor(); + var range = sq.getSelection().cloneRange(); + if (!sq.hasFormat('PRE') && !sq.hasFormat('TABLE')) { + var attr = CODEBLOCK_ATTR_NAME + ' class = "' + CODEBLOCK_CLASS_TEMP + '"'; + + if (type) { + attr += ' data-language="' + type + '"'; + } + + var codeBlockBody = getCodeBlockBody(range, wwe); + sq.insertHTML('
    ' + codeBlockBody + '
    '); + + focusToFirstCode(wwe.get$Body().find('.' + CODEBLOCK_CLASS_TEMP), wwe); + } + + wwe.focus(); + } +}); + +/** + * focusToFirstCode + * Focus to first code tag content of pre tag + * @param {jQuery} $pre pre tag + * @param {WysiwygEditor} wwe wysiwygEditor + */ +function focusToFirstCode($pre, wwe) { + var range = wwe.getEditor().getSelection().cloneRange(); + $pre.removeClass(CODEBLOCK_CLASS_TEMP); + + range.setStartBefore($pre.get(0).firstChild); + range.collapse(true); + + wwe.getEditor().setSelection(range); +} +/** + * getCodeBlockBody + * get text wrapped by code + * @param {object} range range object + * @param {object} wwe wysiwyg editor + * @returns {string} + */ +function getCodeBlockBody(range, wwe) { + var mgr = wwe.componentManager.getManager('codeblock'); + var codeBlock = void 0; + if (range.collapsed) { + codeBlock = '
    '; + } else { + var contents = range.extractContents(); + var nodes = _tuiCodeSnippet2.default.toArray(contents.childNodes); + var tempDiv = (0, _jquery2.default)('
    ').append(mgr.prepareToPasteOnCodeblock(nodes)); + codeBlock = tempDiv.html(); + } + + return codeBlock; +} + +exports.default = CodeBlock; + +/***/ }), +/* 154 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['en', 'en_US'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Write', + 'Preview': 'Preview', + 'Headings': 'Headings', + 'Paragraph': 'Paragraph', + 'Bold': 'Bold', + 'Italic': 'Italic', + 'Strike': 'Strike', + 'Code': 'Inline code', + 'Line': 'Line', + 'Blockquote': 'Blockquote', + 'Unordered list': 'Unordered list', + 'Ordered list': 'Ordered list', + 'Task': 'Task', + 'Indent': 'Indent', + 'Outdent': 'Outdent', + 'Insert link': 'Insert link', + 'Insert CodeBlock': 'Insert codeBlock', + 'Insert table': 'Insert table', + 'Insert image': 'Insert image', + 'Heading': 'Heading', + 'Image URL': 'Image URL', + 'Select image file': 'Select image file', + 'Description': 'Description', + 'OK': 'OK', + 'More': 'More', + 'Cancel': 'Cancel', + 'File': 'File', + 'URL': 'URL', + 'Link text': 'Link text', + 'Add row': 'Add row', + 'Add col': 'Add col', + 'Remove row': 'Remove row', + 'Remove col': 'Remove col', + 'Align left': 'Align left', + 'Align center': 'Align center', + 'Align right': 'Align right', + 'Remove table': 'Remove table', + 'Would you like to paste as table?': 'Would you like to paste as table?', + 'Text color': 'Text color', + 'Auto scroll enabled': 'Auto scroll enabled', + 'Auto scroll disabled': 'Auto scroll disabled', + 'Choose language': 'Choose language' +}); /** + * @fileoverview I18N for English + * @author NHN FE Development Lab + */ + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['ko', 'ko_KR'], { + 'Markdown': '마크다운', + 'WYSIWYG': '위지윅', + 'Write': '편집하기', + 'Preview': '미리보기', + 'Headings': '제목크기', + 'Paragraph': '본문', + 'Bold': '굵게', + 'Italic': '기울임꼴', + 'Strike': '취소선', + 'Code': '인라인 코드', + 'Line': '문단나눔', + 'Blockquote': '인용구', + 'Unordered list': '글머리 기호', + 'Ordered list': '번호 매기기', + 'Task': '체크박스', + 'Indent': '들여쓰기', + 'Outdent': '내어쓰기', + 'Insert link': '링크 삽입', + 'Insert CodeBlock': '코드블럭 삽입', + 'Insert table': '표 삽입', + 'Insert image': '이미지 삽입', + 'Heading': '제목', + 'Image URL': '이미지 주소', + 'Select image file': '이미지 파일을 선택하세요.', + 'Description': '설명', + 'OK': '확인', + 'More': '더 보기', + 'Cancel': '취소', + 'File': '파일', + 'URL': '주소', + 'Link text': '링크 텍스트', + 'Add row': '행 추가', + 'Add col': '열 추가', + 'Remove row': '행 삭제', + 'Remove col': '열 삭제', + 'Align left': '왼쪽 정렬', + 'Align center': '가운데 정렬', + 'Align right': '오른쪽 정렬', + 'Remove table': '표 삭제', + 'Would you like to paste as table?': '표형태로 붙여 넣겠습니까?', + 'Text color': '글자 색상', + 'Auto scroll enabled': '자동 스크롤 켜짐', + 'Auto scroll disabled': '자동 스크롤 꺼짐', + 'Choose language': '언어 선택' +}); /** + * @fileoverview I18N for Korean + * @author NHN FE Development Lab + */ + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['zh', 'zh_CN'], { + 'Markdown': 'Markdown', + 'WYSIWYG': '所见即所得', + 'Write': '编辑', + 'Preview': '预览', + 'Headings': '标题', + 'Paragraph': '文本', + 'Bold': '加粗', + 'Italic': '斜体字', + 'Strike': '删除线', + 'Code': '内嵌代码', + 'Line': '水平线', + 'Blockquote': '引用块', + 'Unordered list': '无序列表', + 'Ordered list': '有序列表', + 'Task': '任务', + 'Indent': '缩进', + 'Outdent': '减少缩进', + 'Insert link': '插入链接', + 'Insert CodeBlock': '插入代码块', + 'Insert table': '插入表格', + 'Insert image': '插入图片', + 'Heading': '标题', + 'Image URL': '图片网址', + 'Select image file': '选择图片文件', + 'Description': '说明', + 'OK': '确认', + 'More': '更多', + 'Cancel': '取消', + 'File': '文件', + 'URL': 'URL', + 'Link text': '链接文本', + 'Add row': '添加行', + 'Add col': '添加列', + 'Remove row': '删除行', + 'Remove col': '删除列', + 'Align left': '左对齐', + 'Align center': '居中对齐', + 'Align right': '右对齐', + 'Remove table': '删除表格', + 'Would you like to paste as table?': '需要粘贴为表格吗?', + 'Text color': '文字颜色', + 'Auto scroll enabled': '自动滚动已启用', + 'Auto scroll disabled': '自动滚动已禁用', + 'Choose language': '选择语言' +}); /** + * @fileoverview I18N for Chinese + * @author NHN FE Development Lab + */ + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['ja', 'ja_JP'], { + 'Markdown': 'マークダウン', + 'WYSIWYG': 'WYSIWYG', + 'Write': '編集する', + 'Preview': 'プレビュー', + 'Headings': '見出し', + 'Paragraph': '本文', + 'Bold': '太字', + 'Italic': 'イタリック', + 'Strike': 'ストライク', + 'Code': 'インラインコード', + 'Line': 'ライン', + 'Blockquote': '引用', + 'Unordered list': '番号なしリスト', + 'Ordered list': '順序付きリスト', + 'Task': 'タスク', + 'Indent': 'インデント', + 'Outdent': 'アウトデント', + 'Insert link': 'リンク挿入', + 'Insert CodeBlock': 'コードブロック挿入', + 'Insert table': 'テーブル挿入', + 'Insert image': '画像挿入', + 'Heading': '見出し', + 'Image URL': 'イメージURL', + 'Select image file': '画像ファイル選択', + 'Description': 'ディスクリプション ', + 'OK': 'はい', + 'More': 'もっと', + 'Cancel': 'キャンセル', + 'File': 'ファイル', + 'URL': 'URL', + 'Link text': 'リンクテキスト', + 'Add row': '行追加', + 'Add col': '列追加', + 'Remove row': '行削除', + 'Remove col': '列削除', + 'Align left': '左揃え', + 'Align center': '中央揃え', + 'Align right': '右揃え', + 'Remove table': 'テーブル削除', + 'Would you like to paste as table?': 'テーブルを貼り付けますか?', + 'Text color': '文字色相', + 'Auto scroll enabled': '自動スクロールが有効', + 'Auto scroll disabled': '自動スクロールを無効に', + 'Choose language': '言語選択' +}); /** + * @fileoverview I18N for Japanese + * @author NHN FE Development Lab + */ + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['nl', 'nl_NL'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Opslaan', + 'Preview': 'Voorbeeld', + 'Headings': 'Koppen', + 'Paragraph': 'Alinea', + 'Bold': 'Vet', + 'Italic': 'Cursief', + 'Strike': 'Doorhalen', + 'Code': 'Inline code', + 'Line': 'Regel', + 'Blockquote': 'Citaatblok', + 'Unordered list': 'Opsomming', + 'Ordered list': 'Genummerde opsomming', + 'Task': 'Taak', + 'Indent': 'Niveau verhogen', + 'Outdent': 'Niveau verlagen', + 'Insert link': 'Link invoegen', + 'Insert CodeBlock': 'Codeblok toevoegen', + 'Insert table': 'Tabel invoegen', + 'Insert image': 'Afbeelding invoegen', + 'Heading': 'Kop', + 'Image URL': 'Afbeelding URL', + 'Select image file': 'Selecteer een afbeelding', + 'Description': 'Omschrijving', + 'OK': 'OK', + 'More': 'Meer', + 'Cancel': 'Annuleren', + 'File': 'Bestand', + 'URL': 'URL', + 'Link text': 'Link tekst', + 'Add row': 'Rij toevoegen', + 'Add col': 'Kolom toevoegen', + 'Remove row': 'Rij verwijderen', + 'Remove col': 'Kolom verwijderen', + 'Align left': 'Links uitlijnen', + 'Align center': 'Centreren', + 'Align right': 'Rechts uitlijnen', + 'Remove table': 'Verwijder tabel', + 'Would you like to paste as table?': 'Wil je dit als tabel plakken?', + 'Text color': 'Tekstkleur', + 'Auto scroll enabled': 'Autoscroll ingeschakeld', + 'Auto scroll disabled': 'Autoscroll uitgeschakeld', + 'Choose language': 'Kies een taal' +}); /** + * @fileoverview I18N for Dutch + * @author NHN FE Development Lab + */ + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['es', 'es_ES'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Escribir', + 'Preview': 'Vista previa', + 'Headings': 'Encabezados', + 'Paragraph': 'Párrafo', + 'Bold': 'Negrita', + 'Italic': 'Itálica', + 'Strike': 'Tachado', + 'Code': 'Código', + 'Line': 'Línea', + 'Blockquote': 'Cita', + 'Unordered list': 'Lista desordenada', + 'Ordered list': 'Lista ordenada', + 'Task': 'Tarea', + 'Indent': 'Sangría', + 'Outdent': 'Saliendo', + 'Insert link': 'Insertar enlace', + 'Insert CodeBlock': 'Insertar bloque de código', + 'Insert table': 'Insertar tabla', + 'Insert image': 'Insertar imagen', + 'Heading': 'Encabezado', + 'Image URL': 'URL de la imagen', + 'Select image file': 'Seleccionar archivo de imagen', + 'Description': 'Descripción', + 'OK': 'Aceptar', + 'More': 'Más', + 'Cancel': 'Cancelar', + 'File': 'Archivo', + 'URL': 'URL', + 'Link text': 'Texto del enlace', + 'Add row': 'Agregar fila', + 'Add col': 'Agregar columna', + 'Remove row': 'Eliminar fila', + 'Remove col': 'Eliminar columna', + 'Align left': 'Alinear a la izquierda', + 'Align center': 'Centrar', + 'Align right': 'Alinear a la derecha', + 'Remove table': 'Eliminar tabla', + 'Would you like to paste as table?': '¿Desea pegar como tabla?', + 'Text color': 'Color del texto', + 'Auto scroll enabled': 'Desplazamiento automático habilitado', + 'Auto scroll disabled': 'Desplazamiento automático deshabilitado', + 'Choose language': 'Elegir idioma' +}); /** + * @fileoverview I18N for Spanish + * @author Enrico Lamperti + */ + +/***/ }), +/* 160 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['de', 'de_DE'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Verfassen', + 'Preview': 'Vorschau', + 'Headings': 'Überschriften', + 'Paragraph': 'Text', + 'Bold': 'Fett', + 'Italic': 'Kursiv', + 'Strike': 'Durchgestrichen', + 'Code': 'Code', + 'Line': 'Trennlinie', + 'Blockquote': 'Blocktext', + 'Unordered list': 'Aufzählung', + 'Ordered list': 'Nummerierte Aufzählung', + 'Task': 'Aufgabe', + 'Indent': 'Einrücken', + 'Outdent': 'Ausrücken', + 'Insert link': 'Link einfügen', + 'Insert CodeBlock': 'Codeblock einfügen', + 'Insert table': 'Tabelle einfügen', + 'Insert image': 'Grafik einfügen', + 'Heading': 'Titel', + 'Image URL': 'Bild URL', + 'Select image file': 'Grafik auswählen', + 'Description': 'Beschreibung', + 'OK': 'OK', + 'More': 'Mehr', + 'Cancel': 'Abbrechen', + 'File': 'Datei', + 'URL': 'URL', + 'Link text': 'Anzuzeigender Text', + 'Add row': 'Zeile hinzufügen', + 'Add col': 'Spalte hinzufügen', + 'Remove row': 'Zeile entfernen', + 'Remove col': 'Spalte entfernen', + 'Align left': 'Links ausrichten', + 'Align center': 'Zentrieren', + 'Align right': 'Rechts ausrichten', + 'Remove table': 'Tabelle entfernen', + 'Would you like to paste as table?': 'Möchten Sie eine Tabelle einfügen?', + 'Text color': 'Textfarbe', + 'Auto scroll enabled': 'Autoscrollen aktiviert', + 'Auto scroll disabled': 'Autoscrollen deaktiviert', + 'Choose language': 'Sprache auswählen' +}); /** + * @fileoverview I18N for German + * @author Jann-Niklas Kiepert + */ + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['ru', 'ru_RU'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Написать', + 'Preview': 'Предварительный просмотр', + 'Headings': 'Заголовки', + 'Paragraph': 'Абзац', + 'Bold': 'Жирный', + 'Italic': 'Курсив', + 'Strike': 'Зачеркнутый', + 'Code': 'Встроенный код', + 'Line': 'Строка', + 'Blockquote': 'Блок цитирования', + 'Unordered list': 'Неупорядоченный список', + 'Ordered list': 'Упорядоченный список', + 'Task': 'Задача', + 'Indent': 'отступ', + 'Outdent': 'Выступ', + 'Insert link': 'Вставить ссылку', + 'Insert CodeBlock': 'Вставить код', + 'Insert table': 'Вставить таблицу', + 'Insert image': 'Вставить изображение', + 'Heading': 'Заголовок', + 'Image URL': 'URL изображения', + 'Select image file': 'Выбрать файл изображения', + 'Description': 'Описание', + 'OK': 'Хорошо', + 'More': 'еще', + 'Cancel': 'Отмена', + 'File': 'Файл', + 'URL': 'URL', + 'Link text': 'Текст ссылки', + 'Add row': 'Добавить ряд', + 'Add col': 'Добавить столбец', + 'Remove row': 'Удалить ряд', + 'Remove col': 'Удалить столбец', + 'Align left': 'Выровнять по левому краю', + 'Align center': 'Выровнять по центру', + 'Align right': 'Выровнять по правому краю', + 'Remove table': 'Удалить таблицу', + 'Would you like to paste as table?': 'Вы хотите вставить в виде таблицы?', + 'Text color': 'Цвет текста', + 'Auto scroll enabled': 'Автоматическая прокрутка включена', + 'Auto scroll disabled': 'Автоматическая прокрутка отключена', + 'Choose language': 'Выбрать язык' +}); /** + * @fileoverview I18N for Russian + * @author Stepan Samko + */ + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['fr', 'fr_FR'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Écrire', + 'Preview': 'Aperçu', + 'Headings': 'En-têtes', + 'Paragraph': 'Paragraphe', + 'Bold': 'Gras', + 'Italic': 'Italique', + 'Strike': 'Barré', + 'Code': 'Code en ligne', + 'Line': 'Ligne', + 'Blockquote': 'Citation', + 'Unordered list': 'Liste non-ordonnée', + 'Ordered list': 'Liste ordonnée', + 'Task': 'Tâche', + 'Indent': 'Retrait', + 'Outdent': 'Sortir', + 'Insert link': 'Insérer un lien', + 'Insert CodeBlock': 'Insérer un bloc de code', + 'Insert table': 'Insérer un tableau', + 'Insert image': 'Insérer une image', + 'Heading': 'En-tête', + 'Image URL': 'URL de l\'image', + 'Select image file': 'Sélectionnez un fichier image', + 'Description': 'Description', + 'OK': 'OK', + 'More': 'de plus', + 'Cancel': 'Annuler', + 'File': 'Fichier', + 'URL': 'URL', + 'Link text': 'Texte du lien', + 'Add row': 'Ajouter une ligne', + 'Add col': 'Ajouter une colonne', + 'Remove row': 'Supprimer une ligne', + 'Remove col': 'Supprimer une colonne', + 'Align left': 'Aligner à gauche', + 'Align center': 'Aligner au centre', + 'Align right': 'Aligner à droite', + 'Remove table': 'Supprimer le tableau', + 'Would you like to paste as table?': 'Voulez-vous coller ce contenu en tant que tableau ?', + 'Text color': 'Couleur du texte', + 'Auto scroll enabled': 'Défilement automatique activé', + 'Auto scroll disabled': 'Défilement automatique désactivé', + 'Choose language': 'Choix de la langue' +}); /** + * @fileoverview I18N for French + * @author Stanislas Michalak + */ + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['uk', 'uk_UA'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Написати', + 'Preview': 'Попередній перегляд', + 'Headings': 'Заголовки', + 'Paragraph': 'Абзац', + 'Bold': 'Жирний', + 'Italic': 'Курсив', + 'Strike': 'Закреслений', + 'Code': 'Вбудований код', + 'Line': 'Лінія', + 'Blockquote': 'Блок цитування', + 'Unordered list': 'Невпорядкований список', + 'Ordered list': 'Упорядкований список', + 'Task': 'Завдання', + 'Indent': 'відступ', + 'Outdent': 'застарілий', + 'Insert link': 'Вставити посилання', + 'Insert CodeBlock': 'Вставити код', + 'Insert table': 'Вставити таблицю', + 'Insert image': 'Вставити зображення', + 'Heading': 'Заголовок', + 'Image URL': 'URL зображення', + 'Select image file': 'Вибрати файл зображення', + 'Description': 'Опис', + 'OK': 'OK', + 'More': 'ще', + 'Cancel': 'Скасувати', + 'File': 'Файл', + 'URL': 'URL', + 'Link text': 'Текст посилання', + 'Add row': 'Додати ряд', + 'Add col': 'Додати стовпчик', + 'Remove row': 'Видалити ряд', + 'Remove col': 'Видалити стовпчик', + 'Align left': 'Вирівняти по лівому краю', + 'Align center': 'Вирівняти по центру', + 'Align right': 'Вирівняти по правому краю', + 'Remove table': 'Видалити таблицю', + 'Would you like to paste as table?': 'Ви хочете вставити у вигляді таблиці?', + 'Text color': 'Колір тексту', + 'Auto scroll enabled': 'Автоматична прокрутка включена', + 'Auto scroll disabled': 'Автоматична прокрутка відключена', + 'Choose language': 'Вибрати мову' +}); /** + * @fileoverview I18N for Ukrainian + * @author Nikolya + */ + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['tr', 'tr_TR'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Düzenle', + 'Preview': 'Ön izleme', + 'Headings': 'Başlıklar', + 'Paragraph': 'Paragraf', + 'Bold': 'Kalın', + 'Italic': 'İtalik', + 'Strike': 'Altı çizgili', + 'Code': 'Satır içi kod', + 'Line': 'Çizgi', + 'Blockquote': 'Alıntı', + 'Unordered list': 'Sıralanmamış liste', + 'Ordered list': 'Sıralı liste', + 'Task': 'Görev kutusu', + 'Indent': 'Girintiyi arttır', + 'Outdent': 'Girintiyi azalt', + 'Insert link': 'Bağlantı ekle', + 'Insert CodeBlock': 'Kod bloku ekle', + 'Insert table': 'Tablo ekle', + 'Insert image': 'İmaj ekle', + 'Heading': 'Başlık', + 'Image URL': 'İmaj URL', + 'Select image file': 'İmaj dosyası seç', + 'Description': 'Açıklama', + 'OK': 'Onay', + 'More': 'Daha Fazla', + 'Cancel': 'İptal', + 'File': 'Dosya', + 'URL': 'URL', + 'Link text': 'Bağlantı yazısı', + 'Add row': 'Satır ekle', + 'Add col': 'Sütun ekle', + 'Remove row': 'Satır sil', + 'Remove col': 'Sütun sil', + 'Align left': 'Sola hizala', + 'Align center': 'Merkeze hizala', + 'Align right': 'Sağa hizala', + 'Remove table': 'Tabloyu kaldır', + 'Would you like to paste as table?': 'Tablo olarak yapıştırmak ister misiniz?', + 'Text color': 'Metin rengi', + 'Auto scroll enabled': 'Otomatik kaydırma açık', + 'Auto scroll disabled': 'Otomatik kaydırma kapalı', + 'Choose language': 'Dil seçiniz' +}); /** + * @fileoverview I18N for Turkish + * @author Mesut Gölcük + */ + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['fi', 'fi_FI'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Kirjoita', + 'Preview': 'Esikatselu', + 'Headings': 'Otsikot', + 'Paragraph': 'Kappale', + 'Bold': 'Lihavointi', + 'Italic': 'Kursivointi', + 'Strike': 'Yliviivaus', + 'Code': 'Koodi', + 'Line': 'Vaakaviiva', + 'Blockquote': 'Lainaus', + 'Unordered list': 'Luettelo', + 'Ordered list': 'Numeroitu luettelo', + 'Task': 'Tehtävä', + 'Indent': 'Suurenna sisennystä', + 'Outdent': 'Pienennä sisennystä', + 'Insert link': 'Lisää linkki', + 'Insert CodeBlock': 'Lisää koodia', + 'Insert table': 'Lisää taulukko', + 'Insert image': 'Lisää kuva', + 'Heading': 'Otsikko', + 'Image URL': 'Kuvan URL', + 'Select image file': 'Valitse kuvatiedosto', + 'Description': 'Kuvaus', + 'OK': 'OK', + 'More': 'Lisää', + 'Cancel': 'Peruuta', + 'File': 'Tiedosto', + 'URL': 'URL', + 'Link text': 'Linkkiteksti', + 'Add row': 'Lisää rivi', + 'Add col': 'Lisää sarake', + 'Remove row': 'Poista rivi', + 'Remove col': 'Poista sarake', + 'Align left': 'Tasaus vasemmalle', + 'Align center': 'Keskitä', + 'Align right': 'Tasaus oikealle', + 'Remove table': 'Poista taulukko', + 'Would you like to paste as table?': 'Haluatko liittää taulukkomuodossa?', + 'Text color': 'Tekstin väri', + 'Auto scroll enabled': 'Automaattinen skrollaus käytössä', + 'Auto scroll disabled': 'Automaattinen skrollaus pois käytöstä', + 'Choose language': 'Valitse kieli' +}); /** + * @fileoverview I18N for Finnish + * @author Tomi Mynttinen + */ + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['cs', 'cs_CZ'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Napsat', + 'Preview': 'Náhled', + 'Headings': 'Nadpisy', + 'Paragraph': 'Odstavec', + 'Bold': 'Tučné', + 'Italic': 'Kurzíva', + 'Strike': 'Přeškrtnuté', + 'Code': 'Kód', + 'Line': 'Vodorovná čára', + 'Blockquote': 'Citace', + 'Unordered list': 'Seznam s odrážkami', + 'Ordered list': 'Číslovaný seznam', + 'Task': 'Úkol', + 'Indent': 'Zvětšit odsazení', + 'Outdent': 'Zmenšit odsazení', + 'Insert link': 'Vložit odkaz', + 'Insert CodeBlock': 'Vložit blok kódu', + 'Insert table': 'Vložit tabulku', + 'Insert image': 'Vložit obrázek', + 'Heading': 'Nadpis', + 'Image URL': 'URL obrázku', + 'Select image file': 'Vybrat obrázek', + 'Description': 'Popis', + 'OK': 'OK', + 'More': 'Více', + 'Cancel': 'Zrušit', + 'File': 'Soubor', + 'URL': 'URL', + 'Link text': 'Text odkazu', + 'Add row': 'Přidat řádek', + 'Add col': 'Přidat sloupec', + 'Remove row': 'Odebrat řádek', + 'Remove col': 'Odebrat sloupec', + 'Align left': 'Zarovnat vlevo', + 'Align center': 'Zarovnat na střed', + 'Align right': 'Zarovnat vpravo', + 'Remove table': 'Odstranit tabulku', + 'Would you like to paste as table?': 'Chcete vložit jako tabulku?', + 'Text color': 'Barva textu', + 'Auto scroll enabled': 'Automatické rolování zapnuto', + 'Auto scroll disabled': 'Automatické rolování vypnuto', + 'Choose language': 'Vybrat jazyk' +}); /** + * @fileoverview I18N for Czech + * @author Dmitrij Tkačenko + */ + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['ar', 'ar_AR'], { + 'Markdown': 'لغة ترميز', + 'WYSIWYG': 'ما تراه هو ما تحصل عليه', + 'Write': 'يكتب', + 'Preview': 'عرض مسبق', + 'Headings': 'العناوين', + 'Paragraph': 'فقرة', + 'Bold': 'خط عريض', + 'Italic': 'خط مائل', + 'Strike': 'إضراب', + 'Code': 'رمز', + 'Line': 'خط', + 'Blockquote': 'فقرة مقتبسة', + 'Unordered list': 'قائمة غير مرتبة', + 'Ordered list': 'قائمة مرتبة', + 'Task': 'مهمة', + 'Indent': 'المسافة البادئة', + 'Outdent': 'المسافة الخارجة', + 'Insert link': 'أدخل الرابط', + 'Insert CodeBlock': 'أدخل الكود', + 'Insert table': 'أدخل جدول', + 'Insert image': 'أدخل صورة', + 'Heading': 'عنوان', + 'Image URL': 'رابط الصورة', + 'Select image file': 'حدد ملف الصورة', + 'Description': 'وصف', + 'OK': 'موافقة', + 'More': 'أكثر', + 'Cancel': 'إلغاء', + 'File': 'ملف', + 'URL': 'رابط', + 'Link text': 'نص الرابط', + 'Add row': 'ضف سطر', + 'Add col': 'ضف عمود', + 'Remove row': 'حذف سطر', + 'Remove col': 'حذف عمود', + 'Align left': 'محاذاة اليسار', + 'Align center': 'محاذاة الوسط', + 'Align right': 'محاذاة اليمين', + 'Remove table': 'حذف الجدول', + 'Would you like to paste as table?': 'هل تريد اللصق كجدول', + 'Text color': 'لون النص', + 'Auto scroll enabled': 'التحريك التلقائي ممكّن', + 'Auto scroll disabled': 'التحريك التلقائي معطّل', + 'Choose language': 'اختر اللغة' +}); /** + * @fileoverview I18N for Arabic + * @author Amira Salah + */ + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['pl', 'pl_PL'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Napisz', + 'Preview': 'Podgląd', + 'Headings': 'Nagłówki', + 'Paragraph': 'Akapit', + 'Bold': 'Pogrubienie', + 'Italic': 'Kursywa', + 'Strike': 'Przekreślenie', + 'Code': 'Fragment kodu', + 'Line': 'Linia', + 'Blockquote': 'Cytat', + 'Unordered list': 'Lista nieuporządkowana', + 'Ordered list': 'Lista uporządkowana', + 'Task': 'Zadanie', + 'Indent': 'Utwórz wcięcie', + 'Outdent': 'Usuń wcięcie', + 'Insert link': 'Umieść odnośnik', + 'Insert CodeBlock': 'Umieść blok kodu', + 'Insert table': 'Umieść tabelę', + 'Insert image': 'Umieść obraz', + 'Heading': 'Nagłówek', + 'Image URL': 'Adres URL obrazu', + 'Select image file': 'Wybierz plik obrazu', + 'Description': 'Opis', + 'OK': 'OK', + 'More': 'Więcej', + 'Cancel': 'Anuluj', + 'File': 'Plik', + 'URL': 'URL', + 'Link text': 'Tekst odnośnika', + 'Add row': 'Dodaj rząd', + 'Add col': 'Dodaj kolumnę', + 'Remove row': 'Usuń rząd', + 'Remove col': 'Usuń kolumnę', + 'Align left': 'Wyrównaj do lewej', + 'Align center': 'Wyśrodkuj', + 'Align right': 'Wyrównaj do prawej', + 'Remove table': 'Usuń tabelę', + 'Would you like to paste as table?': 'Czy chcesz wkleić tekst jako tabelę?', + 'Text color': 'Kolor tekstu', + 'Auto scroll enabled': 'Włączono automatyczne przewijanie', + 'Auto scroll disabled': 'Wyłączono automatyczne przewijanie', + 'Choose language': 'Wybierz język' +}); /** + * @fileoverview I18N for Polish + * @author Marcin Mikołajczak + */ + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['zhtw', 'zh_TW'], { + 'Markdown': 'Markdown', + 'WYSIWYG': '所見即所得', + 'Write': '編輯', + 'Preview': '預覽', + 'Headings': '標題', + 'Paragraph': '內文', + 'Bold': '粗體', + 'Italic': '斜體', + 'Strike': '刪除線', + 'Code': '內嵌程式碼', + 'Line': '分隔線', + 'Blockquote': '引言', + 'Unordered list': '項目符號清單', + 'Ordered list': '編號清單', + 'Task': '核取方塊清單', + 'Indent': '增加縮排', + 'Outdent': '減少縮排', + 'Insert link': '插入超連結', + 'Insert CodeBlock': '插入程式碼區塊', + 'Insert table': '插入表格', + 'Insert image': '插入圖片', + 'Heading': '標題', + 'Image URL': '圖片網址', + 'Select image file': '選擇圖片檔案', + 'Description': '描述', + 'OK': '確認', + 'More': '更多', + 'Cancel': '取消', + 'File': '檔案', + 'URL': 'URL', + 'Link text': '超連結文字', + 'Add row': '增加行', + 'Add col': '增加列', + 'Remove row': '刪除行', + 'Remove col': '刪除列', + 'Align left': '靠左對齊', + 'Align center': '置中', + 'Align right': '靠右對齊', + 'Remove table': '刪除表格', + 'Would you like to paste as table?': '您要以表格貼上嗎?', + 'Text color': '文字顏色', + 'Auto scroll enabled': '已啟用自動滾動', + 'Auto scroll disabled': '已停用自動滾動', + 'Choose language': '選擇語言' +}); /** + * @fileoverview I18N for Traditional Chinese + * @author Tzu-Ray Su + */ + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['gl', 'gl_ES'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Escribir', + 'Preview': 'Vista previa', + 'Headings': 'Encabezados', + 'Paragraph': 'Parágrafo', + 'Bold': 'Negriña', + 'Italic': 'Cursiva', + 'Strike': 'Riscado', + 'Code': 'Código', + 'Line': 'Liña', + 'Blockquote': 'Cita', + 'Unordered list': 'Lista desordenada', + 'Ordered list': 'Lista ordenada', + 'Task': 'Tarefa', + 'Indent': 'Sangría', + 'Outdent': 'Anular sangría', + 'Insert link': 'Inserir enlace', + 'Insert CodeBlock': 'Inserir bloque de código', + 'Insert table': 'Inserir táboa', + 'Insert image': 'Inserir imaxe', + 'Heading': 'Encabezado', + 'Image URL': 'URL da imaxe', + 'Select image file': 'Seleccionar arquivo da imaxe', + 'Description': 'Descrición', + 'OK': 'Aceptar', + 'More': 'Máis', + 'Cancel': 'Cancelar', + 'File': 'Arquivo', + 'URL': 'URL', + 'Link text': 'Texto do enlace', + 'Add row': 'Agregar fila', + 'Add col': 'Agregar columna', + 'Remove row': 'Eliminar fila', + 'Remove col': 'Eliminar columna', + 'Align left': 'Aliñar á esquerda', + 'Align center': 'Centrar', + 'Align right': 'Aliñar á dereita', + 'Remove table': 'Eliminar táboa', + 'Would you like to paste as table?': 'Desexa pegar como táboa?', + 'Text color': 'Cor do texto', + 'Auto scroll enabled': 'Desprazamento automático habilitado', + 'Auto scroll disabled': 'Desprazamento automático deshabilitado', + 'Choose language': 'Elixir idioma' +}); /** + * @fileoverview I18N for Spanish + * @author Aida Vidal + */ + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['sv', 'sv_SE'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Skriv', + 'Preview': 'Förhandsgranska', + 'Headings': 'Överskrifter', + 'Paragraph': 'Paragraf', + 'Bold': 'Fet', + 'Italic': 'Kursiv', + 'Strike': 'Genomstruken', + 'Code': 'Kodrad', + 'Line': 'Linje', + 'Blockquote': 'Citatblock', + 'Unordered list': 'Punktlista', + 'Ordered list': 'Numrerad lista', + 'Task': 'Att göra', + 'Indent': 'Öka indrag', + 'Outdent': 'Minska indrag', + 'Insert link': 'Infoga länk', + 'Insert CodeBlock': 'Infoga kodblock', + 'Insert table': 'Infoga tabell', + 'Insert image': 'Infoga bild', + 'Heading': 'Överskrift', + 'Image URL': 'Bildadress', + 'Select image file': 'Välj en bildfil', + 'Description': 'Beskrivning', + 'OK': 'OK', + 'More': 'Mer', + 'Cancel': 'Avbryt', + 'File': 'Fil', + 'URL': 'Adress', + 'Link text': 'Länktext', + 'Add row': 'Infoga rad', + 'Add col': 'Infoga kolumn', + 'Remove row': 'Radera rad', + 'Remove col': 'Radera kolumn', + 'Align left': 'Vänsterjustera', + 'Align center': 'Centrera', + 'Align right': 'Högerjustera', + 'Remove table': 'Radera tabell', + 'Would you like to paste as table?': 'Vill du klistra in som en tabell?', + 'Text color': 'Textfärg', + 'Auto scroll enabled': 'Automatisk scroll aktiverad', + 'Auto scroll disabled': 'Automatisk scroll inaktiverad', + 'Choose language': 'Välj språk' +}); /** + * @fileoverview I18N for Swedish + * @author Magnus Aspling + */ + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _i18n = __webpack_require__(3); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_i18n2.default.setLanguage(['it', 'it_IT'], { + 'Markdown': 'Markdown', + 'WYSIWYG': 'WYSIWYG', + 'Write': 'Scrivere', + 'Preview': 'Anteprima', + 'Headings': 'Intestazioni', + 'Paragraph': 'Paragrafo', + 'Bold': 'Grassetto', + 'Italic': 'Corsivo', + 'Strike': 'Barrato', + 'Code': 'Codice', + 'Line': 'Linea', + 'Blockquote': 'Blocco citazione', + 'Unordered list': 'Lista puntata', + 'Ordered list': 'Lista numerata', + 'Task': 'Attività', + 'Indent': 'Aggiungi indentazione', + 'Outdent': 'Rimuovi indentazione', + 'Insert link': 'Inserisci link', + 'Insert CodeBlock': 'Inserisci blocco di codice', + 'Insert table': 'Inserisci tabella', + 'Insert image': 'Inserisci immagine', + 'Heading': 'Intestazione', + 'Image URL': 'URL immagine', + 'Select image file': 'Seleziona file immagine', + 'Description': 'Descrizione', + 'OK': 'OK', + 'More': 'Più', + 'Cancel': 'Cancella', + 'File': 'File', + 'URL': 'URL', + 'Link text': 'Testo del collegamento', + 'Add row': 'Aggiungi riga', + 'Add col': 'Aggiungi colonna', + 'Remove row': 'Rimuovi riga', + 'Remove col': 'Rimuovi colonna', + 'Align left': 'Allinea a sinistra', + 'Align center': 'Allinea al centro', + 'Align right': 'Allinea a destra', + 'Remove table': 'Rimuovi tabella', + 'Would you like to paste as table?': 'Desideri incollare sotto forma di tabella?', + 'Text color': 'Colore del testo', + 'Auto scroll enabled': 'Scrolling automatico abilitato', + 'Auto scroll disabled': 'Scrolling automatico disabilitato', + 'Choose language': 'Scegli la lingua' +}); /** + * @fileoverview I18N for Italian + * @author Massimo Redaelli + */ + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +/* eslint-disable */ +/* + CSV-JS - A Comma-Separated Values parser for JS + + Built to rfc4180 standard, with options for adjusting strictness: + - optional carriage returns for non-microsoft sources + - automatically type-cast numeric an boolean values + - relaxed mode which: ignores blank lines, ignores gargabe following quoted tokens, does not enforce a consistent record length + + Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + Author Greg Kindel (twitter @gkindel), 2014 + */ +/** + * @modifier NHN FE Development Lab + */ + +(function (global) { + 'use strict'; + /** + * @name CSV + * @namespace + * @ignore + */ + // implemented as a singleton because JS is single threaded + + var CSV = {}; + CSV.RELAXED = false; + CSV.IGNORE_RECORD_LENGTH = false; + CSV.IGNORE_QUOTES = false; + CSV.LINE_FEED_OK = true; + CSV.CARRIAGE_RETURN_OK = true; + CSV.DETECT_TYPES = true; + CSV.IGNORE_QUOTE_WHITESPACE = true; + CSV.DEBUG = false; + + CSV.COLUMN_SEPARATOR = ","; + + CSV.ERROR_EOF = "UNEXPECTED_END_OF_FILE"; + CSV.ERROR_CHAR = "UNEXPECTED_CHARACTER"; + CSV.ERROR_EOL = "UNEXPECTED_END_OF_RECORD"; + CSV.WARN_SPACE = "UNEXPECTED_WHITESPACE"; // not per spec, but helps debugging + + var QUOTE = "\"", + CR = "\r", + LF = "\n", + SPACE = " ", + TAB = "\t"; + + // states + var PRE_TOKEN = 0, + MID_TOKEN = 1, + POST_TOKEN = 2, + POST_RECORD = 4; + /** + * @name CSV.parse + * @function + * @description rfc4180 standard csv parse + * with options for strictness and data type conversion + * By default, will automatically type-cast numeric an boolean values. + * @param {String} str A CSV string + * @return {Array} An array records, each of which is an array of scalar values. + * @example + * // simple + * var rows = CSV.parse("one,two,three\nfour,five,six") + * // rows equals [["one","two","three"],["four","five","six"]] + * @example + * // Though not a jQuery plugin, it is recommended to use with the $.ajax pipe() method: + * $.get("csv.txt") + * .pipe( CSV.parse ) + * .done( function(rows) { + * for( var i =0; i < rows.length; i++){ + * console.log(rows[i]) + * } + * }); + * @see http://www.ietf.org/rfc/rfc4180.txt + */ + CSV.parse = function (str) { + var result = CSV.result = []; + CSV.COLUMN_SEPARATOR = CSV.COLUMN_SEPARATOR instanceof RegExp ? new RegExp('^' + CSV.COLUMN_SEPARATOR.source) : CSV.COLUMN_SEPARATOR; + + CSV.offset = 0; + CSV.str = str; + CSV.record_begin(); + + CSV.debug("parse()", str); + + var c; + while (1) { + // pull char + c = str[CSV.offset++]; + CSV.debug("c", c); + + // detect eof + if (c == null) { + if (CSV.escaped) { + CSV.error(CSV.ERROR_EOF); + } + + if (CSV.record) { + CSV.token_end(); + CSV.record_end(); + } + + CSV.debug("...bail", c, CSV.state, CSV.record); + CSV.reset(); + break; + } + + if (CSV.record == null) { + // if relaxed mode, ignore blank lines + if (CSV.RELAXED && (c == LF || c == CR && str[CSV.offset + 1] == LF)) { + continue; + } + CSV.record_begin(); + } + + // pre-token: look for start of escape sequence + if (CSV.state == PRE_TOKEN) { + + if ((c === SPACE || c === TAB) && CSV.next_nonspace() == QUOTE) { + if (CSV.RELAXED || CSV.IGNORE_QUOTE_WHITESPACE) { + continue; + } else { + // not technically an error, but ambiguous and hard to debug otherwise + CSV.warn(CSV.WARN_SPACE); + } + } + + if (c == QUOTE && !CSV.IGNORE_QUOTES) { + CSV.debug("...escaped start", c); + CSV.escaped = true; + CSV.state = MID_TOKEN; + continue; + } + CSV.state = MID_TOKEN; + } + + // mid-token and escaped, look for sequences and end quote + if (CSV.state == MID_TOKEN && CSV.escaped) { + if (c == QUOTE) { + if (str[CSV.offset] == QUOTE) { + CSV.debug("...escaped quote", c); + CSV.token += QUOTE; + CSV.offset++; + } else { + CSV.debug("...escaped end", c); + CSV.escaped = false; + CSV.state = POST_TOKEN; + } + } else { + CSV.token += c; + CSV.debug("...escaped add", c, CSV.token); + } + continue; + } + + // fall-through: mid-token or post-token, not escaped + if (c == CR) { + if (str[CSV.offset] == LF) CSV.offset++;else if (!CSV.CARRIAGE_RETURN_OK) CSV.error(CSV.ERROR_CHAR); + CSV.token_end(); + CSV.record_end(); + } else if (c == LF) { + if (!(CSV.LINE_FEED_OK || CSV.RELAXED)) CSV.error(CSV.ERROR_CHAR); + CSV.token_end(); + CSV.record_end(); + } else if (CSV.test_regex_separator(str) || CSV.COLUMN_SEPARATOR == c) { + CSV.token_end(); + } else if (CSV.state == MID_TOKEN) { + CSV.token += c; + CSV.debug("...add", c, CSV.token); + } else if (c === SPACE || c === TAB) { + if (!CSV.IGNORE_QUOTE_WHITESPACE) CSV.error(CSV.WARN_SPACE); + } else if (!CSV.RELAXED) { + CSV.error(CSV.ERROR_CHAR); + } + } + return result; + }; + + /** + * @name CSV.stream + * @function + * @description stream a CSV file + * @example + * node -e "c=require('CSV-JS');require('fs').createReadStream('csv.txt').pipe(c.stream()).pipe(c.stream.json()).pipe(process.stdout)" + * @ignore + */ + CSV.stream = function () { + var stream = __webpack_require__(47); + var s = new stream.Transform({ objectMode: true }); + s.EOL = '\n'; + s.prior = ""; + s.emitter = function (s) { + return function (e) { + s.push(CSV.parse(e + s.EOL)); + }; + }(s); + + s._transform = function (chunk, encoding, done) { + var lines = this.prior == "" ? chunk.toString().split(this.EOL) : (this.prior + chunk.toString()).split(this.EOL); + this.prior = lines.pop(); + lines.forEach(this.emitter); + done(); + }; + + s._flush = function (done) { + if (this.prior != "") { + this.emitter(this.prior); + this.prior = ""; + } + done(); + }; + return s; + }; + + CSV.test_regex_separator = function (str) { + if (!(CSV.COLUMN_SEPARATOR instanceof RegExp)) { + return false; + } + + var match; + str = str.slice(CSV.offset - 1); + match = CSV.COLUMN_SEPARATOR.exec(str); + if (match) { + CSV.offset += match[0].length - 1; + } + + return match !== null; + }; + + CSV.stream.json = function () { + var os = __webpack_require__(187); + var stream = __webpack_require__(47); + var s = new streamTransform({ objectMode: true }); + s._transform = function (chunk, encoding, done) { + s.push(JSON.stringify(chunk.toString()) + os.EOL); + done(); + }; + return s; + }; + + CSV.reset = function () { + CSV.state = null; + CSV.token = null; + CSV.escaped = null; + CSV.record = null; + CSV.offset = null; + CSV.result = null; + CSV.str = null; + }; + + CSV.next_nonspace = function () { + var i = CSV.offset; + var c; + while (i < CSV.str.length) { + c = CSV.str[i++]; + if (!(c == SPACE || c === TAB)) { + return c; + } + } + return null; + }; + + CSV.record_begin = function () { + CSV.escaped = false; + CSV.record = []; + CSV.token_begin(); + CSV.debug("record_begin"); + }; + + CSV.record_end = function () { + CSV.state = POST_RECORD; + if (!(CSV.IGNORE_RECORD_LENGTH || CSV.RELAXED) && CSV.result.length > 0 && CSV.record.length != CSV.result[0].length) { + CSV.error(CSV.ERROR_EOL); + } + CSV.result.push(CSV.record); + CSV.debug("record end", CSV.record); + CSV.record = null; + }; + + CSV.resolve_type = function (token) { + if (token.match(/^[-+]?[0-9]+(\.[0-9]+)?([eE][-+]?[0-9]+)?$/)) { + token = parseFloat(token); + } else if (token.match(/^(true|false)$/i)) { + token = Boolean(token.match(/true/i)); + } else if (token === "undefined") { + token = undefined; + } else if (token === "null") { + token = null; + } + return token; + }; + + CSV.token_begin = function () { + CSV.state = PRE_TOKEN; + // considered using array, but http://www.sitepen.com/blog/2008/05/09/string-performance-an-analysis/ + CSV.token = ""; + }; + + CSV.token_end = function () { + if (CSV.DETECT_TYPES) { + CSV.token = CSV.resolve_type(CSV.token); + } + CSV.record.push(CSV.token); + CSV.debug("token end", CSV.token); + CSV.token_begin(); + }; + + CSV.debug = function () { + if (CSV.DEBUG) console.log(arguments); + }; + + CSV.dump = function (msg) { + return [msg, "at char", CSV.offset, ":", CSV.str.substr(CSV.offset - 50, 50).replace(/\r/mg, "\\r").replace(/\n/mg, "\\n").replace(/\t/mg, "\\t")].join(" "); + }; + + CSV.error = function (err) { + var msg = CSV.dump(err); + CSV.reset(); + throw msg; + }; + + CSV.warn = function (err) { + if (!CSV.DEBUG) { + return; + } + + var msg = CSV.dump(err); + try { + console.warn(msg); + return; + } catch (e) {} + + try { + console.log(msg); + } catch (e) {} + }; + + // Node, PhantomJS, etc + // eg. var CSV = require("CSV"); CSV.parse(...); + if ( true && module.exports) { + module.exports = CSV; + } + + // CommonJS http://wiki.commonjs.org/wiki/Modules + // eg. var CSV = require("CSV").CSV; CSV.parse(...); + else if (true) { + exports.CSV = CSV; + } + + // AMD https://github.com/amdjs/amdjs-api/wiki/AMD + // eg. require(['./csv.js'], function (CSV) { CSV.parse(...); } ); + else {} +})(undefined); + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function getLens (b64) { + var len = b64.length + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] +} + +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) + + var curByte = 0 + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen + + var i + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk( + uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) + )) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } + + return parts.join('') +} + + +/***/ }), +/* 175 */ +/***/ (function(module, exports) { + +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + + +/***/ }), +/* 176 */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = __webpack_require__(20).Buffer; +var util = __webpack_require__(178); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} + +/***/ }), +/* 178 */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) || + (typeof self !== "undefined" && self) || + window; +var apply = Function.prototype.apply; + +// DOM APIs, for completeness + +exports.setTimeout = function() { + return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout); +}; +exports.setInterval = function() { + return new Timeout(apply.call(setInterval, scope, arguments), clearInterval); +}; +exports.clearTimeout = +exports.clearInterval = function(timeout) { + if (timeout) { + timeout.close(); + } +}; + +function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; +} +Timeout.prototype.unref = Timeout.prototype.ref = function() {}; +Timeout.prototype.close = function() { + this._clearFn.call(scope, this._id); +}; + +// Does not start the time, just sets up the members needed. +exports.enroll = function(item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; +}; + +exports.unenroll = function(item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; +}; + +exports._unrefActive = exports.active = function(item) { + clearTimeout(item._idleTimeoutId); + + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } +}; + +// setimmediate attaches itself to the global object +__webpack_require__(180); +// On some exotic environments, it's not clear which object `setimmediate` was +// able to install onto. Search each possibility in the same order as the +// `setimmediate` library. +exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) || + (typeof global !== "undefined" && global.setImmediate) || + (this && this.setImmediate); +exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || + (typeof global !== "undefined" && global.clearImmediate) || + (this && this.clearImmediate); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(11))) + +/***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { + "use strict"; + + if (global.setImmediate) { + return; + } + + var nextHandle = 1; // Spec says greater than zero + var tasksByHandle = {}; + var currentlyRunningATask = false; + var doc = global.document; + var registerImmediate; + + function setImmediate(callback) { + // Callback can either be a function or a string + if (typeof callback !== "function") { + callback = new Function("" + callback); + } + // Copy function arguments + var args = new Array(arguments.length - 1); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i + 1]; + } + // Store and register the task + var task = { callback: callback, args: args }; + tasksByHandle[nextHandle] = task; + registerImmediate(nextHandle); + return nextHandle++; + } + + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + + function run(task) { + var callback = task.callback; + var args = task.args; + switch (args.length) { + case 0: + callback(); + break; + case 1: + callback(args[0]); + break; + case 2: + callback(args[0], args[1]); + break; + case 3: + callback(args[0], args[1], args[2]); + break; + default: + callback.apply(undefined, args); + break; + } + } + + function runIfPresent(handle) { + // From the spec: "Wait until any invocations of this algorithm started before this one have completed." + // So if we're currently running a task, we'll need to delay this invocation. + if (currentlyRunningATask) { + // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a + // "too much recursion" error. + setTimeout(runIfPresent, 0, handle); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + run(task); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + + function installNextTickImplementation() { + registerImmediate = function(handle) { + process.nextTick(function () { runIfPresent(handle); }); + }; + } + + function canUsePostMessage() { + // The test against `importScripts` prevents this implementation from being installed inside a web worker, + // where `global.postMessage` means something completely different and can't be used for this purpose. + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage("", "*"); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + + function installPostMessageImplementation() { + // Installs an event handler on `global` for the `message` event: see + // * https://developer.mozilla.org/en/DOM/window.postMessage + // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages + + var messagePrefix = "setImmediate$" + Math.random() + "$"; + var onGlobalMessage = function(event) { + if (event.source === global && + typeof event.data === "string" && + event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + + if (global.addEventListener) { + global.addEventListener("message", onGlobalMessage, false); + } else { + global.attachEvent("onmessage", onGlobalMessage); + } + + registerImmediate = function(handle) { + global.postMessage(messagePrefix + handle, "*"); + }; + } + + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + + registerImmediate = function(handle) { + channel.port2.postMessage(handle); + }; + } + + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + registerImmediate = function(handle) { + // Create a + * "; + * var result = util.encodeHTMLEntity(htmlEntityString); + * //"<script> alert('test');</script><a href='test'>" + */ + function encodeHTMLEntity(html) { + var entities = { + '"': 'quot', + '&': 'amp', + '<': 'lt', + '>': 'gt', + '\'': '#39' + }; + + return html.replace(/[<>&"']/g, function(m0) { + return entities[m0] ? '&' + entities[m0] + ';' : m0; + }); + } + + /** + * Return whether the string capable to transform into plain string is in the given string or not. + * @param {String} string - test string + * @memberof tui.util + * @returns {boolean} + */ + function hasEncodableString(string) { + return (/[<>&"']/).test(string); + } + + /** + * Return duplicate charters + * @param {string} operandStr1 The operand string + * @param {string} operandStr2 The operand string + * @private + * @memberof tui.util + * @returns {string} + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * util.getDuplicatedChar('fe dev', 'nhn entertainment'); // 'e' + * util.getDuplicatedChar('fdsa', 'asdf'); // 'asdf' + */ + function getDuplicatedChar(operandStr1, operandStr2) { + var i = 0; + var len = operandStr1.length; + var pool = {}; + var dupl, key; + + for (; i < len; i += 1) { + key = operandStr1.charAt(i); + pool[key] = 1; + } + + for (i = 0, len = operandStr2.length; i < len; i += 1) { + key = operandStr2.charAt(i); + if (pool[key]) { + pool[key] += 1; + } + } + + pool = collection.filter(pool, function(item) { + return item > 1; + }); + + pool = object.keys(pool).sort(); + dupl = pool.join(''); + + return dupl; + } + + module.exports = { + decodeHTMLEntity: decodeHTMLEntity, + encodeHTMLEntity: encodeHTMLEntity, + hasEncodableString: hasEncodableString, + getDuplicatedChar: getDuplicatedChar + }; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + /** + * @fileoverview collections of some technic methods. + * @author NHN. + * FE Development Lab + */ + + 'use strict'; + + var tricks = {}; + var aps = Array.prototype.slice; + + /** + * Creates a debounced function that delays invoking fn until after delay milliseconds has elapsed + * since the last time the debouced function was invoked. + * @param {function} fn The function to debounce. + * @param {number} [delay=0] The number of milliseconds to delay + * @memberof tui.util + * @returns {function} debounced function. + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * function someMethodToInvokeDebounced() {} + * + * var debounced = util.debounce(someMethodToInvokeDebounced, 300); + * + * // invoke repeatedly + * debounced(); + * debounced(); + * debounced(); + * debounced(); + * debounced(); + * debounced(); // last invoke of debounced() + * + * // invoke someMethodToInvokeDebounced() after 300 milliseconds. + */ + function debounce(fn, delay) { + var timer, args; + + /* istanbul ignore next */ + delay = delay || 0; + + function debounced() { // eslint-disable-line require-jsdoc + args = aps.call(arguments); + + window.clearTimeout(timer); + timer = window.setTimeout(function() { + fn.apply(null, args); + }, delay); + } + + return debounced; + } + + /** + * return timestamp + * @memberof tui.util + * @returns {number} The number of milliseconds from Jan. 1970 00:00:00 (GMT) + */ + function timestamp() { + return Number(new Date()); + } + + /** + * Creates a throttled function that only invokes fn at most once per every interval milliseconds. + * + * You can use this throttle short time repeatedly invoking functions. (e.g MouseMove, Resize ...) + * + * if you need reuse throttled method. you must remove slugs (e.g. flag variable) related with throttling. + * @param {function} fn function to throttle + * @param {number} [interval=0] the number of milliseconds to throttle invocations to. + * @memberof tui.util + * @returns {function} throttled function + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * function someMethodToInvokeThrottled() {} + * + * var throttled = util.throttle(someMethodToInvokeThrottled, 300); + * + * // invoke repeatedly + * throttled(); // invoke (leading) + * throttled(); + * throttled(); // invoke (near 300 milliseconds) + * throttled(); + * throttled(); + * throttled(); // invoke (near 600 milliseconds) + * // ... + * // invoke (trailing) + * + * // if you need reuse throttled method. then invoke reset() + * throttled.reset(); + */ + function throttle(fn, interval) { + var base; + var isLeading = true; + var tick = function(_args) { + fn.apply(null, _args); + base = null; + }; + var debounced, stamp, args; + + /* istanbul ignore next */ + interval = interval || 0; + + debounced = tricks.debounce(tick, interval); + + function throttled() { // eslint-disable-line require-jsdoc + args = aps.call(arguments); + + if (isLeading) { + tick(args); + isLeading = false; + + return; + } + + stamp = tricks.timestamp(); + + base = base || stamp; + + // pass array directly because `debounce()`, `tick()` are already use + // `apply()` method to invoke developer's `fn` handler. + // + // also, this `debounced` line invoked every time for implements + // `trailing` features. + debounced(args); + + if ((stamp - base) >= interval) { + tick(args); + } + } + + function reset() { // eslint-disable-line require-jsdoc + isLeading = true; + base = null; + } + + throttled.reset = reset; + + return throttled; + } + + tricks.timestamp = timestamp; + tricks.debounce = debounce; + tricks.throttle = throttle; + + module.exports = tricks; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview This module has some functions for handling object as collection. + * @author NHN. + * FE Development Lab + */ + 'use strict'; + + var object = __webpack_require__(1); + var collection = __webpack_require__(4); + var type = __webpack_require__(2); + var ms7days = 7 * 24 * 60 * 60 * 1000; + + /** + * Check if the date has passed 7 days + * @param {number} date - milliseconds + * @returns {boolean} + * @ignore + */ + function isExpired(date) { + var now = new Date().getTime(); + + return now - date > ms7days; + } + + /** + * Send hostname on DOMContentLoaded. + * To prevent hostname set tui.usageStatistics to false. + * @param {string} appName - application name + * @param {string} trackingId - GA tracking ID + * @ignore + */ + function sendHostname(appName, trackingId) { + var url = 'https://www.google-analytics.com/collect'; + var hostname = location.hostname; + var hitType = 'event'; + var eventCategory = 'use'; + var applicationKeyForStorage = 'TOAST UI ' + appName + ' for ' + hostname + ': Statistics'; + var date = window.localStorage.getItem(applicationKeyForStorage); + + // skip if the flag is defined and is set to false explicitly + if (!type.isUndefined(window.tui) && window.tui.usageStatistics === false) { + return; + } + + // skip if not pass seven days old + if (date && !isExpired(date)) { + return; + } + + window.localStorage.setItem(applicationKeyForStorage, new Date().getTime()); + + setTimeout(function() { + if (document.readyState === 'interactive' || document.readyState === 'complete') { + imagePing(url, { + v: 1, + t: hitType, + tid: trackingId, + cid: hostname, + dp: hostname, + dh: appName, + el: appName, + ec: eventCategory + }); + } + }, 1000); + } + + /** + * Request image ping. + * @param {String} url url for ping request + * @param {Object} trackingInfo infos for make query string + * @returns {HTMLElement} + * @memberof tui.util + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * util.imagePing('https://www.google-analytics.com/collect', { + * v: 1, + * t: 'event', + * tid: 'trackingid', + * cid: 'cid', + * dp: 'dp', + * dh: 'dh' + * }); + */ + function imagePing(url, trackingInfo) { + var queryString = collection.map(object.keys(trackingInfo), function(key, index) { + var startWith = index === 0 ? '' : '&'; + + return startWith + key + '=' + trackingInfo[key]; + }).join(''); + var trackingElement = document.createElement('img'); + + trackingElement.src = url + '?' + queryString; + + trackingElement.style.display = 'none'; + document.body.appendChild(trackingElement); + document.body.removeChild(trackingElement); + + return trackingElement; + } + + module.exports = { + imagePing: imagePing, + sendHostname: sendHostname + }; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + + /** + * @fileoverview This module detects the kind of well-known browser and version. + * @author NHN. + * FE Development Lab + */ + + 'use strict'; + + /** + * This object has an information that indicate the kind of browser.
    + * The list below is a detectable browser list. + * - ie8 ~ ie11 + * - chrome + * - firefox + * - safari + * - edge + * @memberof tui.util + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * util.browser.chrome === true; // chrome + * util.browser.firefox === true; // firefox + * util.browser.safari === true; // safari + * util.browser.msie === true; // IE + * util.browser.edge === true; // edge + * util.browser.others === true; // other browser + * util.browser.version; // browser version + */ + var browser = { + chrome: false, + firefox: false, + safari: false, + msie: false, + edge: false, + others: false, + version: 0 + }; + + if (window && window.navigator) { + detectBrowser(); + } + + /** + * Detect the browser. + * @private + */ + function detectBrowser() { + var nav = window.navigator; + var appName = nav.appName.replace(/\s/g, '_'); + var userAgent = nav.userAgent; + + var rIE = /MSIE\s([0-9]+[.0-9]*)/; + var rIE11 = /Trident.*rv:11\./; + var rEdge = /Edge\/(\d+)\./; + var versionRegex = { + firefox: /Firefox\/(\d+)\./, + chrome: /Chrome\/(\d+)\./, + safari: /Version\/([\d.]+).*Safari\/(\d+)/ + }; + + var key, tmp; + + var detector = { + Microsoft_Internet_Explorer: function() { // eslint-disable-line camelcase + var detectedVersion = userAgent.match(rIE); + + if (detectedVersion) { // ie8 ~ ie10 + browser.msie = true; + browser.version = parseFloat(detectedVersion[1]); + } else { // no version information + browser.others = true; + } + }, + Netscape: function() { // eslint-disable-line complexity + var detected = false; + + if (rIE11.exec(userAgent)) { + browser.msie = true; + browser.version = 11; + detected = true; + } else if (rEdge.exec(userAgent)) { + browser.edge = true; + browser.version = userAgent.match(rEdge)[1]; + detected = true; + } else { + for (key in versionRegex) { + if (versionRegex.hasOwnProperty(key)) { + tmp = userAgent.match(versionRegex[key]); + if (tmp && tmp.length > 1) { // eslint-disable-line max-depth + browser[key] = detected = true; + browser.version = parseFloat(tmp[1] || 0); + break; + } + } + } + } + if (!detected) { + browser.others = true; + } + } + }; + + var fn = detector[appName]; + + if (fn) { + detector[appName](); + } + } + + module.exports = browser; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview This module has some methods for handling popup-window + * @author NHN. + * FE Development Lab + */ + + 'use strict'; + + var collection = __webpack_require__(4); + var type = __webpack_require__(2); + var func = __webpack_require__(5); + var browser = __webpack_require__(10); + var object = __webpack_require__(1); + + var popupId = 0; + + /** + * Popup management class + * @constructor + * @memberof tui.util + * @example + * // node, commonjs + * var popup = require('tui-code-snippet').popup; + * @example + * // distribution file, script + * + * + * + */ + function CustomEvents() { + /** + * @type {HandlerItem[]} + */ + this.events = null; + + /** + * only for checking specific context event was binded + * @type {object[]} + */ + this.contexts = null; + } + + /** + * Mixin custom events feature to specific constructor + * @param {function} func - constructor + * @example + * //-- #1. Get Module --// + * var CustomEvents = require('tui-code-snippet').CustomEvents; // node, commonjs + * var CustomEvents = tui.util.CustomEvents; // distribution file + * + * //-- #2. Use property --// + * var model; + * function Model() { + * this.name = ''; + * } + * CustomEvents.mixin(Model); + * + * model = new Model(); + * model.on('change', function() { this.name = 'model'; }, this); + * model.fire('change'); + * alert(model.name); // 'model'; + */ + CustomEvents.mixin = function(func) { + object.extend(func.prototype, CustomEvents.prototype); + }; + + /** + * Get HandlerItem object + * @param {function} handler - handler function + * @param {object} [context] - context for handler + * @returns {HandlerItem} HandlerItem object + * @private + */ + CustomEvents.prototype._getHandlerItem = function(handler, context) { + var item = {handler: handler}; + + if (context) { + item.context = context; + } + + return item; + }; + + /** + * Get event object safely + * @param {string} [eventName] - create sub event map if not exist. + * @returns {(object|array)} event object. if you supplied `eventName` + * parameter then make new array and return it + * @private + */ + CustomEvents.prototype._safeEvent = function(eventName) { + var events = this.events; + var byName; + + if (!events) { + events = this.events = {}; + } + + if (eventName) { + byName = events[eventName]; + + if (!byName) { + byName = []; + events[eventName] = byName; + } + + events = byName; + } + + return events; + }; + + /** + * Get context array safely + * @returns {array} context array + * @private + */ + CustomEvents.prototype._safeContext = function() { + var context = this.contexts; + + if (!context) { + context = this.contexts = []; + } + + return context; + }; + + /** + * Get index of context + * @param {object} ctx - context that used for bind custom event + * @returns {number} index of context + * @private + */ + CustomEvents.prototype._indexOfContext = function(ctx) { + var context = this._safeContext(); + var index = 0; + + while (context[index]) { + if (ctx === context[index][0]) { + return index; + } + + index += 1; + } + + return -1; + }; + + /** + * Memorize supplied context for recognize supplied object is context or + * name: handler pair object when off() + * @param {object} ctx - context object to memorize + * @private + */ + CustomEvents.prototype._memorizeContext = function(ctx) { + var context, index; + + if (!type.isExisty(ctx)) { + return; + } + + context = this._safeContext(); + index = this._indexOfContext(ctx); + + if (index > -1) { + context[index][1] += 1; + } else { + context.push([ctx, 1]); + } + }; + + /** + * Forget supplied context object + * @param {object} ctx - context object to forget + * @private + */ + CustomEvents.prototype._forgetContext = function(ctx) { + var context, contextIndex; + + if (!type.isExisty(ctx)) { + return; + } + + context = this._safeContext(); + contextIndex = this._indexOfContext(ctx); + + if (contextIndex > -1) { + context[contextIndex][1] -= 1; + + if (context[contextIndex][1] <= 0) { + context.splice(contextIndex, 1); + } + } + }; + + /** + * Bind event handler + * @param {(string|{name:string, handler:function})} eventName - custom + * event name or an object {eventName: handler} + * @param {(function|object)} [handler] - handler function or context + * @param {object} [context] - context for binding + * @private + */ + CustomEvents.prototype._bindEvent = function(eventName, handler, context) { + var events = this._safeEvent(eventName); + this._memorizeContext(context); + events.push(this._getHandlerItem(handler, context)); + }; + + /** + * Bind event handlers + * @param {(string|{name:string, handler:function})} eventName - custom + * event name or an object {eventName: handler} + * @param {(function|object)} [handler] - handler function or context + * @param {object} [context] - context for binding + * //-- #1. Get Module --// + * var CustomEvents = require('tui-code-snippet').CustomEvents; // node, commonjs + * var CustomEvents = tui.util.CustomEvents; // distribution file + * + * //-- #2. Use property --// + * // # 2.1 Basic Usage + * CustomEvents.on('onload', handler); + * + * // # 2.2 With context + * CustomEvents.on('onload', handler, myObj); + * + * // # 2.3 Bind by object that name, handler pairs + * CustomEvents.on({ + * 'play': handler, + * 'pause': handler2 + * }); + * + * // # 2.4 Bind by object that name, handler pairs with context object + * CustomEvents.on({ + * 'play': handler + * }, myObj); + */ + CustomEvents.prototype.on = function(eventName, handler, context) { + var self = this; + + if (type.isString(eventName)) { + // [syntax 1, 2] + eventName = eventName.split(R_EVENTNAME_SPLIT); + collection.forEach(eventName, function(name) { + self._bindEvent(name, handler, context); + }); + } else if (type.isObject(eventName)) { + // [syntax 3, 4] + context = handler; + collection.forEach(eventName, function(func, name) { + self.on(name, func, context); + }); + } + }; + + /** + * Bind one-shot event handlers + * @param {(string|{name:string,handler:function})} eventName - custom + * event name or an object {eventName: handler} + * @param {function|object} [handler] - handler function or context + * @param {object} [context] - context for binding + */ + CustomEvents.prototype.once = function(eventName, handler, context) { + var self = this; + + if (type.isObject(eventName)) { + context = handler; + collection.forEach(eventName, function(func, name) { + self.once(name, func, context); + }); + + return; + } + + function onceHandler() { // eslint-disable-line require-jsdoc + handler.apply(context, arguments); + self.off(eventName, onceHandler, context); + } + + this.on(eventName, onceHandler, context); + }; + + /** + * Splice supplied array by callback result + * @param {array} arr - array to splice + * @param {function} predicate - function return boolean + * @private + */ + CustomEvents.prototype._spliceMatches = function(arr, predicate) { + var i = 0; + var len; + + if (!type.isArray(arr)) { + return; + } + + for (len = arr.length; i < len; i += 1) { + if (predicate(arr[i]) === true) { + arr.splice(i, 1); + len -= 1; + i -= 1; + } + } + }; + + /** + * Get matcher for unbind specific handler events + * @param {function} handler - handler function + * @returns {function} handler matcher + * @private + */ + CustomEvents.prototype._matchHandler = function(handler) { + var self = this; + + return function(item) { + var needRemove = handler === item.handler; + + if (needRemove) { + self._forgetContext(item.context); + } + + return needRemove; + }; + }; + + /** + * Get matcher for unbind specific context events + * @param {object} context - context + * @returns {function} object matcher + * @private + */ + CustomEvents.prototype._matchContext = function(context) { + var self = this; + + return function(item) { + var needRemove = context === item.context; + + if (needRemove) { + self._forgetContext(item.context); + } + + return needRemove; + }; + }; + + /** + * Get matcher for unbind specific hander, context pair events + * @param {function} handler - handler function + * @param {object} context - context + * @returns {function} handler, context matcher + * @private + */ + CustomEvents.prototype._matchHandlerAndContext = function(handler, context) { + var self = this; + + return function(item) { + var matchHandler = (handler === item.handler); + var matchContext = (context === item.context); + var needRemove = (matchHandler && matchContext); + + if (needRemove) { + self._forgetContext(item.context); + } + + return needRemove; + }; + }; + + /** + * Unbind event by event name + * @param {string} eventName - custom event name to unbind + * @param {function} [handler] - handler function + * @private + */ + CustomEvents.prototype._offByEventName = function(eventName, handler) { + var self = this; + var forEach = collection.forEachArray; + var andByHandler = type.isFunction(handler); + var matchHandler = self._matchHandler(handler); + + eventName = eventName.split(R_EVENTNAME_SPLIT); + + forEach(eventName, function(name) { + var handlerItems = self._safeEvent(name); + + if (andByHandler) { + self._spliceMatches(handlerItems, matchHandler); + } else { + forEach(handlerItems, function(item) { + self._forgetContext(item.context); + }); + + self.events[name] = []; + } + }); + }; + + /** + * Unbind event by handler function + * @param {function} handler - handler function + * @private + */ + CustomEvents.prototype._offByHandler = function(handler) { + var self = this; + var matchHandler = this._matchHandler(handler); + + collection.forEach(this._safeEvent(), function(handlerItems) { + self._spliceMatches(handlerItems, matchHandler); + }); + }; + + /** + * Unbind event by object(name: handler pair object or context object) + * @param {object} obj - context or {name: handler} pair object + * @param {function} handler - handler function + * @private + */ + CustomEvents.prototype._offByObject = function(obj, handler) { + var self = this; + var matchFunc; + + if (this._indexOfContext(obj) < 0) { + collection.forEach(obj, function(func, name) { + self.off(name, func); + }); + } else if (type.isString(handler)) { + matchFunc = this._matchContext(obj); + + self._spliceMatches(this._safeEvent(handler), matchFunc); + } else if (type.isFunction(handler)) { + matchFunc = this._matchHandlerAndContext(handler, obj); + + collection.forEach(this._safeEvent(), function(handlerItems) { + self._spliceMatches(handlerItems, matchFunc); + }); + } else { + matchFunc = this._matchContext(obj); + + collection.forEach(this._safeEvent(), function(handlerItems) { + self._spliceMatches(handlerItems, matchFunc); + }); + } + }; + + /** + * Unbind custom events + * @param {(string|object|function)} eventName - event name or context or + * {name: handler} pair object or handler function + * @param {(function)} handler - handler function + * @example + * //-- #1. Get Module --// + * var CustomEvents = require('tui-code-snippet').CustomEvents; // node, commonjs + * var CustomEvents = tui.util.CustomEvents; // distribution file + * + * //-- #2. Use property --// + * // # 2.1 off by event name + * CustomEvents.off('onload'); + * + * // # 2.2 off by event name and handler + * CustomEvents.off('play', handler); + * + * // # 2.3 off by handler + * CustomEvents.off(handler); + * + * // # 2.4 off by context + * CustomEvents.off(myObj); + * + * // # 2.5 off by context and handler + * CustomEvents.off(myObj, handler); + * + * // # 2.6 off by context and event name + * CustomEvents.off(myObj, 'onload'); + * + * // # 2.7 off by an Object. that is {eventName: handler} + * CustomEvents.off({ + * 'play': handler, + * 'pause': handler2 + * }); + * + * // # 2.8 off the all events + * CustomEvents.off(); + */ + CustomEvents.prototype.off = function(eventName, handler) { + if (type.isString(eventName)) { + // [syntax 1, 2] + this._offByEventName(eventName, handler); + } else if (!arguments.length) { + // [syntax 8] + this.events = {}; + this.contexts = []; + } else if (type.isFunction(eventName)) { + // [syntax 3] + this._offByHandler(eventName); + } else if (type.isObject(eventName)) { + // [syntax 4, 5, 6] + this._offByObject(eventName, handler); + } + }; + + /** + * Fire custom event + * @param {string} eventName - name of custom event + */ + CustomEvents.prototype.fire = function(eventName) { // eslint-disable-line + this.invoke.apply(this, arguments); + }; + + /** + * Fire a event and returns the result of operation 'boolean AND' with all + * listener's results. + * + * So, It is different from {@link CustomEvents#fire}. + * + * In service code, use this as a before event in component level usually + * for notifying that the event is cancelable. + * @param {string} eventName - Custom event name + * @param {...*} data - Data for event + * @returns {boolean} The result of operation 'boolean AND' + * @example + * var map = new Map(); + * map.on({ + * 'beforeZoom': function() { + * // It should cancel the 'zoom' event by some conditions. + * if (that.disabled && this.getState()) { + * return false; + * } + * return true; + * } + * }); + * + * if (this.invoke('beforeZoom')) { // check the result of 'beforeZoom' + * // if true, + * // doSomething + * } + */ + CustomEvents.prototype.invoke = function(eventName) { + var events, args, index, item; + + if (!this.hasListener(eventName)) { + return true; + } + + events = this._safeEvent(eventName); + args = Array.prototype.slice.call(arguments, 1); + index = 0; + + while (events[index]) { + item = events[index]; + + if (item.handler.apply(item.context, args) === false) { + return false; + } + + index += 1; + } + + return true; + }; + + /** + * Return whether at least one of the handlers is registered in the given + * event name. + * @param {string} eventName - Custom event name + * @returns {boolean} Is there at least one handler in event name? + */ + CustomEvents.prototype.hasListener = function(eventName) { + return this.getListenerLength(eventName) > 0; + }; + + /** + * Return a count of events registered. + * @param {string} eventName - Custom event name + * @returns {number} number of event + */ + CustomEvents.prototype.getListenerLength = function(eventName) { + var events = this._safeEvent(eventName); + + return events.length; + }; + + module.exports = CustomEvents; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview This module provides a Enum Constructor. + * @author NHN. + * FE Development Lab + * @example + * // node, commonjs + * var Enum = require('tui-code-snippet').Enum; + * @example + * // distribution file, script + * + * + * + * + * + *
    "; + * var result = util.encodeHTMLEntity(htmlEntityString); + * //"<script> alert('test');</script><a href='test'>" + */ + function encodeHTMLEntity(html) { + var entities = { + '"': 'quot', + '&': 'amp', + '<': 'lt', + '>': 'gt', + '\'': '#39' + }; + + return html.replace(/[<>&"']/g, function(m0) { + return entities[m0] ? '&' + entities[m0] + ';' : m0; + }); + } + + /** + * Return whether the string capable to transform into plain string is in the given string or not. + * @param {String} string - test string + * @memberof tui.util + * @returns {boolean} + */ + function hasEncodableString(string) { + return (/[<>&"']/).test(string); + } + + /** + * Return duplicate charters + * @param {string} operandStr1 The operand string + * @param {string} operandStr2 The operand string + * @private + * @memberof tui.util + * @returns {string} + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * util.getDuplicatedChar('fe dev', 'nhn entertainment'); // 'e' + * util.getDuplicatedChar('fdsa', 'asdf'); // 'asdf' + */ + function getDuplicatedChar(operandStr1, operandStr2) { + var i = 0; + var len = operandStr1.length; + var pool = {}; + var dupl, key; + + for (; i < len; i += 1) { + key = operandStr1.charAt(i); + pool[key] = 1; + } + + for (i = 0, len = operandStr2.length; i < len; i += 1) { + key = operandStr2.charAt(i); + if (pool[key]) { + pool[key] += 1; + } + } + + pool = collection.filter(pool, function(item) { + return item > 1; + }); + + pool = object.keys(pool).sort(); + dupl = pool.join(''); + + return dupl; + } + + module.exports = { + decodeHTMLEntity: decodeHTMLEntity, + encodeHTMLEntity: encodeHTMLEntity, + hasEncodableString: hasEncodableString, + getDuplicatedChar: getDuplicatedChar + }; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + /** + * @fileoverview collections of some technic methods. + * @author NHN. + * FE Development Lab + */ + + 'use strict'; + + var tricks = {}; + var aps = Array.prototype.slice; + + /** + * Creates a debounced function that delays invoking fn until after delay milliseconds has elapsed + * since the last time the debouced function was invoked. + * @param {function} fn The function to debounce. + * @param {number} [delay=0] The number of milliseconds to delay + * @memberof tui.util + * @returns {function} debounced function. + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * function someMethodToInvokeDebounced() {} + * + * var debounced = util.debounce(someMethodToInvokeDebounced, 300); + * + * // invoke repeatedly + * debounced(); + * debounced(); + * debounced(); + * debounced(); + * debounced(); + * debounced(); // last invoke of debounced() + * + * // invoke someMethodToInvokeDebounced() after 300 milliseconds. + */ + function debounce(fn, delay) { + var timer, args; + + /* istanbul ignore next */ + delay = delay || 0; + + function debounced() { // eslint-disable-line require-jsdoc + args = aps.call(arguments); + + window.clearTimeout(timer); + timer = window.setTimeout(function() { + fn.apply(null, args); + }, delay); + } + + return debounced; + } + + /** + * return timestamp + * @memberof tui.util + * @returns {number} The number of milliseconds from Jan. 1970 00:00:00 (GMT) + */ + function timestamp() { + return Number(new Date()); + } + + /** + * Creates a throttled function that only invokes fn at most once per every interval milliseconds. + * + * You can use this throttle short time repeatedly invoking functions. (e.g MouseMove, Resize ...) + * + * if you need reuse throttled method. you must remove slugs (e.g. flag variable) related with throttling. + * @param {function} fn function to throttle + * @param {number} [interval=0] the number of milliseconds to throttle invocations to. + * @memberof tui.util + * @returns {function} throttled function + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * function someMethodToInvokeThrottled() {} + * + * var throttled = util.throttle(someMethodToInvokeThrottled, 300); + * + * // invoke repeatedly + * throttled(); // invoke (leading) + * throttled(); + * throttled(); // invoke (near 300 milliseconds) + * throttled(); + * throttled(); + * throttled(); // invoke (near 600 milliseconds) + * // ... + * // invoke (trailing) + * + * // if you need reuse throttled method. then invoke reset() + * throttled.reset(); + */ + function throttle(fn, interval) { + var base; + var isLeading = true; + var tick = function(_args) { + fn.apply(null, _args); + base = null; + }; + var debounced, stamp, args; + + /* istanbul ignore next */ + interval = interval || 0; + + debounced = tricks.debounce(tick, interval); + + function throttled() { // eslint-disable-line require-jsdoc + args = aps.call(arguments); + + if (isLeading) { + tick(args); + isLeading = false; + + return; + } + + stamp = tricks.timestamp(); + + base = base || stamp; + + // pass array directly because `debounce()`, `tick()` are already use + // `apply()` method to invoke developer's `fn` handler. + // + // also, this `debounced` line invoked every time for implements + // `trailing` features. + debounced(args); + + if ((stamp - base) >= interval) { + tick(args); + } + } + + function reset() { // eslint-disable-line require-jsdoc + isLeading = true; + base = null; + } + + throttled.reset = reset; + + return throttled; + } + + tricks.timestamp = timestamp; + tricks.debounce = debounce; + tricks.throttle = throttle; + + module.exports = tricks; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview This module has some functions for handling object as collection. + * @author NHN. + * FE Development Lab + */ + 'use strict'; + + var object = __webpack_require__(1); + var collection = __webpack_require__(4); + var type = __webpack_require__(2); + var ms7days = 7 * 24 * 60 * 60 * 1000; + + /** + * Check if the date has passed 7 days + * @param {number} date - milliseconds + * @returns {boolean} + * @ignore + */ + function isExpired(date) { + var now = new Date().getTime(); + + return now - date > ms7days; + } + + /** + * Send hostname on DOMContentLoaded. + * To prevent hostname set tui.usageStatistics to false. + * @param {string} appName - application name + * @param {string} trackingId - GA tracking ID + * @ignore + */ + function sendHostname(appName, trackingId) { + var url = 'https://www.google-analytics.com/collect'; + var hostname = location.hostname; + var hitType = 'event'; + var eventCategory = 'use'; + var applicationKeyForStorage = 'TOAST UI ' + appName + ' for ' + hostname + ': Statistics'; + var date = window.localStorage.getItem(applicationKeyForStorage); + + // skip if the flag is defined and is set to false explicitly + if (!type.isUndefined(window.tui) && window.tui.usageStatistics === false) { + return; + } + + // skip if not pass seven days old + if (date && !isExpired(date)) { + return; + } + + window.localStorage.setItem(applicationKeyForStorage, new Date().getTime()); + + setTimeout(function() { + if (document.readyState === 'interactive' || document.readyState === 'complete') { + imagePing(url, { + v: 1, + t: hitType, + tid: trackingId, + cid: hostname, + dp: hostname, + dh: appName, + el: appName, + ec: eventCategory + }); + } + }, 1000); + } + + /** + * Request image ping. + * @param {String} url url for ping request + * @param {Object} trackingInfo infos for make query string + * @returns {HTMLElement} + * @memberof tui.util + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * util.imagePing('https://www.google-analytics.com/collect', { + * v: 1, + * t: 'event', + * tid: 'trackingid', + * cid: 'cid', + * dp: 'dp', + * dh: 'dh' + * }); + */ + function imagePing(url, trackingInfo) { + var queryString = collection.map(object.keys(trackingInfo), function(key, index) { + var startWith = index === 0 ? '' : '&'; + + return startWith + key + '=' + trackingInfo[key]; + }).join(''); + var trackingElement = document.createElement('img'); + + trackingElement.src = url + '?' + queryString; + + trackingElement.style.display = 'none'; + document.body.appendChild(trackingElement); + document.body.removeChild(trackingElement); + + return trackingElement; + } + + module.exports = { + imagePing: imagePing, + sendHostname: sendHostname + }; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + + /** + * @fileoverview This module detects the kind of well-known browser and version. + * @author NHN. + * FE Development Lab + */ + + 'use strict'; + + /** + * This object has an information that indicate the kind of browser.
    + * The list below is a detectable browser list. + * - ie8 ~ ie11 + * - chrome + * - firefox + * - safari + * - edge + * @memberof tui.util + * @example + * //-- #1. Get Module --// + * var util = require('tui-code-snippet'); // node, commonjs + * var util = tui.util; // distribution file + * + * //-- #2. Use property --// + * util.browser.chrome === true; // chrome + * util.browser.firefox === true; // firefox + * util.browser.safari === true; // safari + * util.browser.msie === true; // IE + * util.browser.edge === true; // edge + * util.browser.others === true; // other browser + * util.browser.version; // browser version + */ + var browser = { + chrome: false, + firefox: false, + safari: false, + msie: false, + edge: false, + others: false, + version: 0 + }; + + if (window && window.navigator) { + detectBrowser(); + } + + /** + * Detect the browser. + * @private + */ + function detectBrowser() { + var nav = window.navigator; + var appName = nav.appName.replace(/\s/g, '_'); + var userAgent = nav.userAgent; + + var rIE = /MSIE\s([0-9]+[.0-9]*)/; + var rIE11 = /Trident.*rv:11\./; + var rEdge = /Edge\/(\d+)\./; + var versionRegex = { + firefox: /Firefox\/(\d+)\./, + chrome: /Chrome\/(\d+)\./, + safari: /Version\/([\d.]+).*Safari\/(\d+)/ + }; + + var key, tmp; + + var detector = { + Microsoft_Internet_Explorer: function() { // eslint-disable-line camelcase + var detectedVersion = userAgent.match(rIE); + + if (detectedVersion) { // ie8 ~ ie10 + browser.msie = true; + browser.version = parseFloat(detectedVersion[1]); + } else { // no version information + browser.others = true; + } + }, + Netscape: function() { // eslint-disable-line complexity + var detected = false; + + if (rIE11.exec(userAgent)) { + browser.msie = true; + browser.version = 11; + detected = true; + } else if (rEdge.exec(userAgent)) { + browser.edge = true; + browser.version = userAgent.match(rEdge)[1]; + detected = true; + } else { + for (key in versionRegex) { + if (versionRegex.hasOwnProperty(key)) { + tmp = userAgent.match(versionRegex[key]); + if (tmp && tmp.length > 1) { // eslint-disable-line max-depth + browser[key] = detected = true; + browser.version = parseFloat(tmp[1] || 0); + break; + } + } + } + } + if (!detected) { + browser.others = true; + } + } + }; + + var fn = detector[appName]; + + if (fn) { + detector[appName](); + } + } + + module.exports = browser; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview This module has some methods for handling popup-window + * @author NHN. + * FE Development Lab + */ + + 'use strict'; + + var collection = __webpack_require__(4); + var type = __webpack_require__(2); + var func = __webpack_require__(5); + var browser = __webpack_require__(10); + var object = __webpack_require__(1); + + var popupId = 0; + + /** + * Popup management class + * @constructor + * @memberof tui.util + * @example + * // node, commonjs + * var popup = require('tui-code-snippet').popup; + * @example + * // distribution file, script + * + * + * + */ + function CustomEvents() { + /** + * @type {HandlerItem[]} + */ + this.events = null; + + /** + * only for checking specific context event was binded + * @type {object[]} + */ + this.contexts = null; + } + + /** + * Mixin custom events feature to specific constructor + * @param {function} func - constructor + * @example + * //-- #1. Get Module --// + * var CustomEvents = require('tui-code-snippet').CustomEvents; // node, commonjs + * var CustomEvents = tui.util.CustomEvents; // distribution file + * + * //-- #2. Use property --// + * var model; + * function Model() { + * this.name = ''; + * } + * CustomEvents.mixin(Model); + * + * model = new Model(); + * model.on('change', function() { this.name = 'model'; }, this); + * model.fire('change'); + * alert(model.name); // 'model'; + */ + CustomEvents.mixin = function(func) { + object.extend(func.prototype, CustomEvents.prototype); + }; + + /** + * Get HandlerItem object + * @param {function} handler - handler function + * @param {object} [context] - context for handler + * @returns {HandlerItem} HandlerItem object + * @private + */ + CustomEvents.prototype._getHandlerItem = function(handler, context) { + var item = {handler: handler}; + + if (context) { + item.context = context; + } + + return item; + }; + + /** + * Get event object safely + * @param {string} [eventName] - create sub event map if not exist. + * @returns {(object|array)} event object. if you supplied `eventName` + * parameter then make new array and return it + * @private + */ + CustomEvents.prototype._safeEvent = function(eventName) { + var events = this.events; + var byName; + + if (!events) { + events = this.events = {}; + } + + if (eventName) { + byName = events[eventName]; + + if (!byName) { + byName = []; + events[eventName] = byName; + } + + events = byName; + } + + return events; + }; + + /** + * Get context array safely + * @returns {array} context array + * @private + */ + CustomEvents.prototype._safeContext = function() { + var context = this.contexts; + + if (!context) { + context = this.contexts = []; + } + + return context; + }; + + /** + * Get index of context + * @param {object} ctx - context that used for bind custom event + * @returns {number} index of context + * @private + */ + CustomEvents.prototype._indexOfContext = function(ctx) { + var context = this._safeContext(); + var index = 0; + + while (context[index]) { + if (ctx === context[index][0]) { + return index; + } + + index += 1; + } + + return -1; + }; + + /** + * Memorize supplied context for recognize supplied object is context or + * name: handler pair object when off() + * @param {object} ctx - context object to memorize + * @private + */ + CustomEvents.prototype._memorizeContext = function(ctx) { + var context, index; + + if (!type.isExisty(ctx)) { + return; + } + + context = this._safeContext(); + index = this._indexOfContext(ctx); + + if (index > -1) { + context[index][1] += 1; + } else { + context.push([ctx, 1]); + } + }; + + /** + * Forget supplied context object + * @param {object} ctx - context object to forget + * @private + */ + CustomEvents.prototype._forgetContext = function(ctx) { + var context, contextIndex; + + if (!type.isExisty(ctx)) { + return; + } + + context = this._safeContext(); + contextIndex = this._indexOfContext(ctx); + + if (contextIndex > -1) { + context[contextIndex][1] -= 1; + + if (context[contextIndex][1] <= 0) { + context.splice(contextIndex, 1); + } + } + }; + + /** + * Bind event handler + * @param {(string|{name:string, handler:function})} eventName - custom + * event name or an object {eventName: handler} + * @param {(function|object)} [handler] - handler function or context + * @param {object} [context] - context for binding + * @private + */ + CustomEvents.prototype._bindEvent = function(eventName, handler, context) { + var events = this._safeEvent(eventName); + this._memorizeContext(context); + events.push(this._getHandlerItem(handler, context)); + }; + + /** + * Bind event handlers + * @param {(string|{name:string, handler:function})} eventName - custom + * event name or an object {eventName: handler} + * @param {(function|object)} [handler] - handler function or context + * @param {object} [context] - context for binding + * //-- #1. Get Module --// + * var CustomEvents = require('tui-code-snippet').CustomEvents; // node, commonjs + * var CustomEvents = tui.util.CustomEvents; // distribution file + * + * //-- #2. Use property --// + * // # 2.1 Basic Usage + * CustomEvents.on('onload', handler); + * + * // # 2.2 With context + * CustomEvents.on('onload', handler, myObj); + * + * // # 2.3 Bind by object that name, handler pairs + * CustomEvents.on({ + * 'play': handler, + * 'pause': handler2 + * }); + * + * // # 2.4 Bind by object that name, handler pairs with context object + * CustomEvents.on({ + * 'play': handler + * }, myObj); + */ + CustomEvents.prototype.on = function(eventName, handler, context) { + var self = this; + + if (type.isString(eventName)) { + // [syntax 1, 2] + eventName = eventName.split(R_EVENTNAME_SPLIT); + collection.forEach(eventName, function(name) { + self._bindEvent(name, handler, context); + }); + } else if (type.isObject(eventName)) { + // [syntax 3, 4] + context = handler; + collection.forEach(eventName, function(func, name) { + self.on(name, func, context); + }); + } + }; + + /** + * Bind one-shot event handlers + * @param {(string|{name:string,handler:function})} eventName - custom + * event name or an object {eventName: handler} + * @param {function|object} [handler] - handler function or context + * @param {object} [context] - context for binding + */ + CustomEvents.prototype.once = function(eventName, handler, context) { + var self = this; + + if (type.isObject(eventName)) { + context = handler; + collection.forEach(eventName, function(func, name) { + self.once(name, func, context); + }); + + return; + } + + function onceHandler() { // eslint-disable-line require-jsdoc + handler.apply(context, arguments); + self.off(eventName, onceHandler, context); + } + + this.on(eventName, onceHandler, context); + }; + + /** + * Splice supplied array by callback result + * @param {array} arr - array to splice + * @param {function} predicate - function return boolean + * @private + */ + CustomEvents.prototype._spliceMatches = function(arr, predicate) { + var i = 0; + var len; + + if (!type.isArray(arr)) { + return; + } + + for (len = arr.length; i < len; i += 1) { + if (predicate(arr[i]) === true) { + arr.splice(i, 1); + len -= 1; + i -= 1; + } + } + }; + + /** + * Get matcher for unbind specific handler events + * @param {function} handler - handler function + * @returns {function} handler matcher + * @private + */ + CustomEvents.prototype._matchHandler = function(handler) { + var self = this; + + return function(item) { + var needRemove = handler === item.handler; + + if (needRemove) { + self._forgetContext(item.context); + } + + return needRemove; + }; + }; + + /** + * Get matcher for unbind specific context events + * @param {object} context - context + * @returns {function} object matcher + * @private + */ + CustomEvents.prototype._matchContext = function(context) { + var self = this; + + return function(item) { + var needRemove = context === item.context; + + if (needRemove) { + self._forgetContext(item.context); + } + + return needRemove; + }; + }; + + /** + * Get matcher for unbind specific hander, context pair events + * @param {function} handler - handler function + * @param {object} context - context + * @returns {function} handler, context matcher + * @private + */ + CustomEvents.prototype._matchHandlerAndContext = function(handler, context) { + var self = this; + + return function(item) { + var matchHandler = (handler === item.handler); + var matchContext = (context === item.context); + var needRemove = (matchHandler && matchContext); + + if (needRemove) { + self._forgetContext(item.context); + } + + return needRemove; + }; + }; + + /** + * Unbind event by event name + * @param {string} eventName - custom event name to unbind + * @param {function} [handler] - handler function + * @private + */ + CustomEvents.prototype._offByEventName = function(eventName, handler) { + var self = this; + var forEach = collection.forEachArray; + var andByHandler = type.isFunction(handler); + var matchHandler = self._matchHandler(handler); + + eventName = eventName.split(R_EVENTNAME_SPLIT); + + forEach(eventName, function(name) { + var handlerItems = self._safeEvent(name); + + if (andByHandler) { + self._spliceMatches(handlerItems, matchHandler); + } else { + forEach(handlerItems, function(item) { + self._forgetContext(item.context); + }); + + self.events[name] = []; + } + }); + }; + + /** + * Unbind event by handler function + * @param {function} handler - handler function + * @private + */ + CustomEvents.prototype._offByHandler = function(handler) { + var self = this; + var matchHandler = this._matchHandler(handler); + + collection.forEach(this._safeEvent(), function(handlerItems) { + self._spliceMatches(handlerItems, matchHandler); + }); + }; + + /** + * Unbind event by object(name: handler pair object or context object) + * @param {object} obj - context or {name: handler} pair object + * @param {function} handler - handler function + * @private + */ + CustomEvents.prototype._offByObject = function(obj, handler) { + var self = this; + var matchFunc; + + if (this._indexOfContext(obj) < 0) { + collection.forEach(obj, function(func, name) { + self.off(name, func); + }); + } else if (type.isString(handler)) { + matchFunc = this._matchContext(obj); + + self._spliceMatches(this._safeEvent(handler), matchFunc); + } else if (type.isFunction(handler)) { + matchFunc = this._matchHandlerAndContext(handler, obj); + + collection.forEach(this._safeEvent(), function(handlerItems) { + self._spliceMatches(handlerItems, matchFunc); + }); + } else { + matchFunc = this._matchContext(obj); + + collection.forEach(this._safeEvent(), function(handlerItems) { + self._spliceMatches(handlerItems, matchFunc); + }); + } + }; + + /** + * Unbind custom events + * @param {(string|object|function)} eventName - event name or context or + * {name: handler} pair object or handler function + * @param {(function)} handler - handler function + * @example + * //-- #1. Get Module --// + * var CustomEvents = require('tui-code-snippet').CustomEvents; // node, commonjs + * var CustomEvents = tui.util.CustomEvents; // distribution file + * + * //-- #2. Use property --// + * // # 2.1 off by event name + * CustomEvents.off('onload'); + * + * // # 2.2 off by event name and handler + * CustomEvents.off('play', handler); + * + * // # 2.3 off by handler + * CustomEvents.off(handler); + * + * // # 2.4 off by context + * CustomEvents.off(myObj); + * + * // # 2.5 off by context and handler + * CustomEvents.off(myObj, handler); + * + * // # 2.6 off by context and event name + * CustomEvents.off(myObj, 'onload'); + * + * // # 2.7 off by an Object. that is {eventName: handler} + * CustomEvents.off({ + * 'play': handler, + * 'pause': handler2 + * }); + * + * // # 2.8 off the all events + * CustomEvents.off(); + */ + CustomEvents.prototype.off = function(eventName, handler) { + if (type.isString(eventName)) { + // [syntax 1, 2] + this._offByEventName(eventName, handler); + } else if (!arguments.length) { + // [syntax 8] + this.events = {}; + this.contexts = []; + } else if (type.isFunction(eventName)) { + // [syntax 3] + this._offByHandler(eventName); + } else if (type.isObject(eventName)) { + // [syntax 4, 5, 6] + this._offByObject(eventName, handler); + } + }; + + /** + * Fire custom event + * @param {string} eventName - name of custom event + */ + CustomEvents.prototype.fire = function(eventName) { // eslint-disable-line + this.invoke.apply(this, arguments); + }; + + /** + * Fire a event and returns the result of operation 'boolean AND' with all + * listener's results. + * + * So, It is different from {@link CustomEvents#fire}. + * + * In service code, use this as a before event in component level usually + * for notifying that the event is cancelable. + * @param {string} eventName - Custom event name + * @param {...*} data - Data for event + * @returns {boolean} The result of operation 'boolean AND' + * @example + * var map = new Map(); + * map.on({ + * 'beforeZoom': function() { + * // It should cancel the 'zoom' event by some conditions. + * if (that.disabled && this.getState()) { + * return false; + * } + * return true; + * } + * }); + * + * if (this.invoke('beforeZoom')) { // check the result of 'beforeZoom' + * // if true, + * // doSomething + * } + */ + CustomEvents.prototype.invoke = function(eventName) { + var events, args, index, item; + + if (!this.hasListener(eventName)) { + return true; + } + + events = this._safeEvent(eventName); + args = Array.prototype.slice.call(arguments, 1); + index = 0; + + while (events[index]) { + item = events[index]; + + if (item.handler.apply(item.context, args) === false) { + return false; + } + + index += 1; + } + + return true; + }; + + /** + * Return whether at least one of the handlers is registered in the given + * event name. + * @param {string} eventName - Custom event name + * @returns {boolean} Is there at least one handler in event name? + */ + CustomEvents.prototype.hasListener = function(eventName) { + return this.getListenerLength(eventName) > 0; + }; + + /** + * Return a count of events registered. + * @param {string} eventName - Custom event name + * @returns {number} number of event + */ + CustomEvents.prototype.getListenerLength = function(eventName) { + var events = this._safeEvent(eventName); + + return events.length; + }; + + module.exports = CustomEvents; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview This module provides a Enum Constructor. + * @author NHN. + * FE Development Lab + * @example + * // node, commonjs + * var Enum = require('tui-code-snippet').Enum; + * @example + * // distribution file, script + * + * + * + * + *