Add Designer package
This commit is contained in:
parent
bfb781c0da
commit
a21ed913ff
7
Elsa.sln
7
Elsa.sln
|
|
@ -118,6 +118,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Persistence.EntityFram
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Email", "src\modules\Elsa.Email\Elsa.Email.csproj", "{1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Workflows.Designer", "src\modules\Elsa.Workflows.Designer\Elsa.Workflows.Designer.csproj", "{B191F11D-583D-44D9-8A08-F5B0DC58B822}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -300,6 +302,10 @@ Global
|
|||
{1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B191F11D-583D-44D9-8A08-F5B0DC58B822}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B191F11D-583D-44D9-8A08-F5B0DC58B822}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B191F11D-583D-44D9-8A08-F5B0DC58B822}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B191F11D-583D-44D9-8A08-F5B0DC58B822}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{155227F0-A33B-40AA-A4B4-06F813EB921B} = {61017E64-6D00-49CB-9E81-5002DC8F7D5F}
|
||||
|
|
@ -353,5 +359,6 @@ Global
|
|||
{1AA0AEFC-BD58-4284-A6C5-AD15C5C79782} = {873BFC3E-63C2-4495-A503-5EC05DCD84E4}
|
||||
{555A4306-3BAB-409E-8BB8-3171A5867B2C} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
|
||||
{1E5BD8D9-55BE-41E2-B389-6AB9F26C22AF} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
|
||||
{B191F11D-583D-44D9-8A08-F5B0DC58B822} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
<ProjectReference Include="..\..\modules\Elsa.Persistence.EntityFrameworkCore\Elsa.Persistence.EntityFrameworkCore.csproj" />
|
||||
<ProjectReference Include="..\..\modules\Elsa.Quartz\Elsa.Quartz.csproj" />
|
||||
<ProjectReference Include="..\..\modules\Elsa.Workflows.Api\Elsa.Workflows.Api.csproj" />
|
||||
<ProjectReference Include="..\..\modules\Elsa.Workflows.Designer\Elsa.Workflows.Designer.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,29 @@
|
|||
@page
|
||||
<!--Use the studio shell component to handle automatic interaction with the Elsa Server API-->
|
||||
@page "/"
|
||||
@inject IConfiguration Configuration;
|
||||
@{
|
||||
var serverUrl = Url.Content("~/elsa/api");
|
||||
var basePath = Configuration["Hosting:BasePath"];
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>Elsa Workflows 3.0</title>
|
||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
|
||||
<link rel="stylesheet" href="@basePath/_content/Elsa.Workflows.Designer/elsa-workflows-designer/elsa-workflows-designer.css">
|
||||
<script src="@basePath/_content/Elsa.Workflows.Designer/monaco-editor/min/vs/loader.js"></script>
|
||||
<script type="module" src="@basePath/_content/Elsa.Workflows.Designer/elsa-workflows-designer/elsa-workflows-designer.esm.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<elsa-workflow-toolbar></elsa-workflow-toolbar>
|
||||
<div class="absolute inset-0" style="top: 64px;">
|
||||
<elsa-studio server="/elsa/api" monaco-lib-path="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.31.1/min"></elsa-studio>
|
||||
<elsa-studio server="@serverUrl" monaco-lib-path="@basePath.TrimStart('/')/_content/Elsa.Workflows.Designer/monaco-editor/min"></elsa-studio>
|
||||
<elsa-custom-activities-manager></elsa-custom-activities-manager>
|
||||
<elsa-notifications-manager></elsa-notifications-manager>
|
||||
</div>
|
||||
<elsa-custom-activities-manager></elsa-custom-activities-manager>
|
||||
<elsa-notifications-manager></elsa-notifications-manager>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>Elsa Workflows 3.0</title>
|
||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/@@elsa-workflows/elsa-workflows-designer@3.0.2-preview.2/dist/elsa-workflows-designer/elsa-workflows-designer.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@RenderBody()
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.31.1/min/vs/loader.min.js"></script>
|
||||
<script type="module" src="https://unpkg.com/@@elsa-workflows/elsa-workflows-designer@3.0.2-preview.2/dist/elsa-workflows-designer/elsa-workflows-designer.esm.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
|
|
@ -99,6 +99,10 @@ app.UseAuthentication();
|
|||
app.UseAuthorization();
|
||||
app.UseElsaFastEndpoints();
|
||||
app.UseHttpActivities();
|
||||
app.MapRazorPages();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapFallbackToPage("/Index");
|
||||
});
|
||||
|
||||
app.Run();
|
||||
|
|
@ -10,6 +10,9 @@
|
|||
"ConnectionStrings": {
|
||||
"Sqlite": "Data Source=elsa.sqlite.db;Cache=Shared;"
|
||||
},
|
||||
"Hosting": {
|
||||
"BasePath": ""
|
||||
},
|
||||
"Identity": {
|
||||
"SigningKey": "secret-signing-key"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@elsa-workflows/elsa-workflows-designer",
|
||||
"version": "3.0.2-preview.8",
|
||||
"version": "3.0.2-preview.4",
|
||||
"description": "A workflow designer for Elsa 3",
|
||||
"main": "./dist/index.cjs.js",
|
||||
"module": "./dist/index.js",
|
||||
|
|
|
|||
|
|
@ -28,8 +28,4 @@
|
|||
<ProjectReference Include="..\Elsa.Mediator\Elsa.Mediator.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Notifications" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<Import Project="..\..\..\common.props" />
|
||||
<Import Project="..\..\..\configureawait.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Description>
|
||||
Provides Razor components to render the workflows designer in ASP.NET applications.
|
||||
</Description>
|
||||
<PackageTags>elsa module workflows razor designer</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<SupportedPlatform Include="browser" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="6.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\Elsa.Features\Elsa.Features.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
15
src/modules/Elsa.Workflows.Designer/ElsaStudio.razor
Normal file
15
src/modules/Elsa.Workflows.Designer/ElsaStudio.razor
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<elsa-workflow-toolbar></elsa-workflow-toolbar>
|
||||
<div class="absolute inset-0" style="top: 64px;">
|
||||
<elsa-studio server="@ServerUrl" monaco-lib-path="@MonacoLibPath"></elsa-studio>
|
||||
<elsa-custom-activities-manager></elsa-custom-activities-manager>
|
||||
<elsa-notifications-manager></elsa-notifications-manager>
|
||||
</div>
|
||||
|
||||
@code{
|
||||
|
||||
[Parameter]
|
||||
public string ServerUrl { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string MonacoLibPath { get; set; } = "_content/Elsa.Workflows.Designer/monaco-editor/min";
|
||||
}
|
||||
3
src/modules/Elsa.Workflows.Designer/FodyWeavers.xml
Normal file
3
src/modules/Elsa.Workflows.Designer/FodyWeavers.xml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ConfigureAwait />
|
||||
</Weavers>
|
||||
1
src/modules/Elsa.Workflows.Designer/_Imports.razor
Normal file
1
src/modules/Elsa.Workflows.Designer/_Imports.razor
Normal file
|
|
@ -0,0 +1 @@
|
|||
@using Microsoft.AspNetCore.Components.Web
|
||||
0
src/modules/Elsa.Workflows.Designer/index.js
Normal file
0
src/modules/Elsa.Workflows.Designer/index.js
Normal file
4060
src/modules/Elsa.Workflows.Designer/package-lock.json
generated
Normal file
4060
src/modules/Elsa.Workflows.Designer/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
16
src/modules/Elsa.Workflows.Designer/package.json
Normal file
16
src/modules/Elsa.Workflows.Designer/package.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "npm run build:release",
|
||||
"build:release": "cross-env webpack --mode=production --env configuration=Release",
|
||||
"build:debug": "cross-env webpack --mode=development --env configuration=Debug"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@elsa-workflows/elsa-workflows-designer": "^3.0.2-preview.4",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"monaco-editor": "^0.34.1",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^5.0.1"
|
||||
}
|
||||
}
|
||||
30
src/modules/Elsa.Workflows.Designer/webpack.config.js
Normal file
30
src/modules/Elsa.Workflows.Designer/webpack.config.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
const path = require('path');
|
||||
const CopyPlugin = require("copy-webpack-plugin");
|
||||
|
||||
module.exports = env => {
|
||||
|
||||
return {
|
||||
entry: ['./index.js'],
|
||||
devtool: env && env.production ? 'none' : 'source-map',
|
||||
resolve: {
|
||||
extensions: ['.js'],
|
||||
},
|
||||
experiments: {
|
||||
outputModule: true
|
||||
},
|
||||
output: {
|
||||
filename: 'elsa-workflows-designer.js',
|
||||
path: path.resolve(__dirname, 'wwwroot'),
|
||||
libraryTarget: 'module'
|
||||
},
|
||||
plugins: [
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{ from: "node_modules/@elsa-workflows/elsa-workflows-designer/dist/elsa-workflows-designer", to: "elsa-workflows-designer" },
|
||||
{ from: "node_modules/monaco-editor/min", to: "monaco-editor/min" },
|
||||
{ from: "node_modules/monaco-editor/min-maps", to: "monaco-editor/min-maps" },
|
||||
],
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
Loading…
Reference in a new issue