Basically working svelte interaction with orchard
This commit is contained in:
@@ -6,7 +6,7 @@ indent_size = tab
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = crlf
|
||||
end_of_line = lf
|
||||
|
||||
[*.{yml,csproj}]
|
||||
indent_style = space
|
||||
|
||||
16
Twain.sln
16
Twain.sln
@@ -18,9 +18,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenRamey.Theme", "src\BenRa
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{3DA05917-02EA-4B04-9C48-B86C77A73584}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OapApi.v1.Client", "src\OAP\OapApi.v1.Client\OapApi.v1.Client.csproj", "{5C30AB89-B3D4-468F-A029-3D26FECD0083}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OapApi.v1", "src\OAP\OapApi.v1\OapApi.v1.csproj", "{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap.Api.v1", "src\OAP\Oap.Api.v1\Oap.Api.v1.csproj", "{5C30AB89-B3D4-468F-A029-3D26FECD0083}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap.Content", "src\OAP\Oap.Content\Oap.Content.csproj", "{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}"
|
||||
EndProject
|
||||
@@ -32,6 +30,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap", "src\OAP\Oap\Oap.cspr
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap.Theme", "src\OAP\Oap.Theme\Oap.Theme.csproj", "{6ECAEC1D-21A1-455E-8BE4-66399C85E45B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap.Api", "src\OAP\Oap.Api\Oap.Api.csproj", "{9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -58,10 +58,6 @@ Global
|
||||
{5C30AB89-B3D4-468F-A029-3D26FECD0083}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5C30AB89-B3D4-468F-A029-3D26FECD0083}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5C30AB89-B3D4-468F-A029-3D26FECD0083}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@@ -74,6 +70,10 @@ Global
|
||||
{6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -83,10 +83,10 @@ Global
|
||||
{7B0477DA-BCD5-47ED-8B88-76D046524434} = {3DA05917-02EA-4B04-9C48-B86C77A73584}
|
||||
{A7498019-5941-479B-ADB2-56B6C984C608} = {03C1520E-5ABF-4AF7-858B-8BE234ACE0FB}
|
||||
{5C30AB89-B3D4-468F-A029-3D26FECD0083} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
{E6BF474A-1186-496E-899E-2B7AA6180E30} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
{6ECAEC1D-21A1-455E-8BE4-66399C85E45B} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
{9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {0F7F9D4C-DF95-43AF-9E9A-DA09B5EE03C7}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
[http(url: "https://oaprotection.org/api/v1")]
|
||||
[csharp(namespace: OapApi.v1)]
|
||||
[csharp(namespace: Oap.Api.v1)]
|
||||
service OapApiV1
|
||||
{
|
||||
/// Gets applications for the current user.
|
||||
[http(method: GET, path: "/applications")]
|
||||
[tag(name:"bob")]
|
||||
method getApplications
|
||||
{
|
||||
/// Filter applications by the given status.
|
||||
@@ -1,2 +1,2 @@
|
||||
fsdgencsharp .\fsd\OapApi.v1.fsd ./src/OAP/OapApi.v1.Client --namespace OapApi.v1.Client
|
||||
fsdgencsharp .\fsd\Oap.Api.v1.fsd ./src/OAP/Oap.Api.v1 --namespace Oap.Api.v1
|
||||
REM fsdgenaspnet .\fsd\OapApi.v1.fsd ./src/OAP/OapApi.v1 --target core --namespace OapApi.v1 --apinamespace OapApi.v1.Client
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
public sealed partial class ApplicationChangeSetDto : ServiceDto<ApplicationChangeSetDto>
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
public sealed partial class ApplicationCreateSetDto : ServiceDto<ApplicationCreateSetDto>
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// An application.
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(ApplicationStatusJsonConverter))]
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
public sealed partial class ApplicationTermsCreateSetDto : ServiceDto<ApplicationTermsCreateSetDto>
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
public sealed partial class ApplicationTermsDto : ServiceDto<ApplicationTermsDto>
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// Request for CreateApplication.
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// Response for CreateApplication.
|
||||
@@ -6,7 +6,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// A delegating implementation of OapApiV1.
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// Request for GetApplication.
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// Response for GetApplication.
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// Request for GetApplications.
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// Response for GetApplications.
|
||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
using Facility.Core;
|
||||
using Facility.Core.Http;
|
||||
|
||||
namespace OapApi.v1.Client.Http
|
||||
namespace Oap.Api.v1.Http
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
public sealed partial class HttpClientOapApiV1 : HttpClientService, IOapApiV1
|
||||
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
||||
using Facility.Core;
|
||||
using Facility.Core.Http;
|
||||
|
||||
namespace OapApi.v1.Client.Http
|
||||
namespace Oap.Api.v1.Http
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
public sealed partial class OapApiV1HttpHandler : ServiceHttpHandler
|
||||
@@ -11,7 +11,7 @@ using Facility.Core.Http;
|
||||
|
||||
#pragma warning disable 612, 618 // member is obsolete
|
||||
|
||||
namespace OapApi.v1.Client.Http
|
||||
namespace Oap.Api.v1.Http
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
public static partial class OapApiV1HttpMapping
|
||||
@@ -6,7 +6,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
public partial interface IOapApiV1
|
||||
@@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
|
||||
internal static class OapApiV1Methods
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// Request for UpdateApplication.
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Facility.Core;
|
||||
|
||||
namespace OapApi.v1.Client
|
||||
namespace Oap.Api.v1
|
||||
{
|
||||
/// <summary>
|
||||
/// Response for UpdateApplication.
|
||||
@@ -1,9 +1,9 @@
|
||||
using OrchardCore.Modules.Manifest;
|
||||
|
||||
[assembly: Module(
|
||||
Name = "Overseas Auto Protection API v1",
|
||||
Name = "Overseas Auto Protection API",
|
||||
Author = "Overseas Auto Protection",
|
||||
Website = "https://oaprotection.org/api/v1/",
|
||||
Website = "https://oaprotection.org/api/",
|
||||
Version = "0.0.1",
|
||||
Description = "API for OAP services",
|
||||
Category = "Content Management",
|
||||
@@ -16,7 +16,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OapApi.v1.Client\OapApi.v1.Client.csproj" />
|
||||
<ProjectReference Include="..\Oap.Api.v1\Oap.Api.v1.csproj" />
|
||||
<ProjectReference Include="..\Oap\Oap.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using Facility.Core;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using OapApi.v1.Client;
|
||||
using Oap.Api.v1;
|
||||
|
||||
namespace OapApi.v1;
|
||||
namespace Oap.Api;
|
||||
|
||||
public sealed class OapApiV1 : IOapApiV1
|
||||
{
|
||||
33
src/OAP/Oap.Api/Startup.cs
Normal file
33
src/OAP/Oap.Api/Startup.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Facility.AspNetCore;
|
||||
using Facility.Core.Http;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Oap.Api.v1;
|
||||
using Oap.Api.v1.Http;
|
||||
|
||||
namespace Oap.Api;
|
||||
|
||||
public class Startup : OrchardCore.Modules.StartupBase
|
||||
{
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<IOapApiV1, OapApiV1>();
|
||||
|
||||
services.AddScoped(sp =>
|
||||
{
|
||||
return new OapApiV1HttpHandler(
|
||||
sp.GetRequiredService<IOapApiV1>(),
|
||||
new ServiceHttpHandlerSettings
|
||||
{
|
||||
RootPath = "/oap/api/v1",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
|
||||
{
|
||||
builder.UseFacilityExceptionHandler();
|
||||
builder.UseFacilityHttpHandler<OapApiV1HttpHandler>();
|
||||
}
|
||||
}
|
||||
24
src/OAP/Oap.Theme.Svelte/.gitignore
vendored
Normal file
24
src/OAP/Oap.Theme.Svelte/.gitignore
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
3
src/OAP/Oap.Theme.Svelte/.vscode/extensions.json
vendored
Normal file
3
src/OAP/Oap.Theme.Svelte/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["svelte.svelte-vscode"]
|
||||
}
|
||||
47
src/OAP/Oap.Theme.Svelte/README.md
Normal file
47
src/OAP/Oap.Theme.Svelte/README.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Svelte + TS + Vite
|
||||
|
||||
This template should help get you started developing with Svelte and TypeScript in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).
|
||||
|
||||
## Need an official Svelte framework?
|
||||
|
||||
Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.
|
||||
|
||||
## Technical considerations
|
||||
|
||||
**Why use this over SvelteKit?**
|
||||
|
||||
- It brings its own routing solution which might not be preferable for some users.
|
||||
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
|
||||
|
||||
This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
|
||||
|
||||
Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.
|
||||
|
||||
**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**
|
||||
|
||||
Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.
|
||||
|
||||
**Why include `.vscode/extensions.json`?**
|
||||
|
||||
Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.
|
||||
|
||||
**Why enable `allowJs` in the TS template?**
|
||||
|
||||
While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.
|
||||
|
||||
**Why is HMR not preserving my local component state?**
|
||||
|
||||
HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).
|
||||
|
||||
If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.
|
||||
|
||||
```ts
|
||||
// store.ts
|
||||
// An extremely simple external store
|
||||
import { writable } from 'svelte/store'
|
||||
export default writable(0)
|
||||
```
|
||||
15
src/OAP/Oap.Theme.Svelte/index.html
Normal file
15
src/OAP/Oap.Theme.Svelte/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Overseas Auto Protection - Svelte</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
<div id="OapApplicationForm-1" class="OapApplicationForm"></div>
|
||||
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
2897
src/OAP/Oap.Theme.Svelte/package-lock.json
generated
Normal file
2897
src/OAP/Oap.Theme.Svelte/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
24
src/OAP/Oap.Theme.Svelte/package.json
Normal file
24
src/OAP/Oap.Theme.Svelte/package.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "oap-theme-svelte",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.2",
|
||||
"@tsconfig/svelte": "^5.0.2",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"postcss": "^8.4.38",
|
||||
"svelte": "^4.2.12",
|
||||
"svelte-check": "^3.6.7",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.2.0"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: {
|
||||
'postcss-import': {},
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
}
|
||||
5
src/OAP/Oap.Theme.Svelte/src/App.svelte
Normal file
5
src/OAP/Oap.Theme.Svelte/src/App.svelte
Normal file
@@ -0,0 +1,5 @@
|
||||
<script lang="ts">
|
||||
import Counter from "./lib/Counter.svelte";
|
||||
</script>
|
||||
|
||||
<p>I love bob</p>
|
||||
3
src/OAP/Oap.Theme.Svelte/src/OapApplicationForm.svelte
Normal file
3
src/OAP/Oap.Theme.Svelte/src/OapApplicationForm.svelte
Normal file
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
This is an application form
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "tailwindcss/base";
|
||||
@import "tailwindcss/base";
|
||||
@import "tailwindcss/components";
|
||||
@import "./richtext.css";
|
||||
@import "./validation.css";
|
||||
10
src/OAP/Oap.Theme.Svelte/src/lib/Counter.svelte
Normal file
10
src/OAP/Oap.Theme.Svelte/src/lib/Counter.svelte
Normal file
@@ -0,0 +1,10 @@
|
||||
<script lang="ts">
|
||||
let count: number = 0
|
||||
const increment = () => {
|
||||
count += 1
|
||||
}
|
||||
</script>
|
||||
|
||||
<button on:click={increment}>
|
||||
count is {count}
|
||||
</button>
|
||||
9
src/OAP/Oap.Theme.Svelte/src/main.ts
Normal file
9
src/OAP/Oap.Theme.Svelte/src/main.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import "./app.css";
|
||||
import OapApplicationForm from "./OapApplicationForm.svelte";
|
||||
|
||||
console.log(document.getElementsByClassName("OapApplicationForm"))
|
||||
const oapApplicationForm = new OapApplicationForm({
|
||||
target: document.getElementsByClassName("OapApplicationForm")[0],
|
||||
});
|
||||
|
||||
export { oapApplicationForm };
|
||||
2
src/OAP/Oap.Theme.Svelte/src/vite-env.d.ts
vendored
Normal file
2
src/OAP/Oap.Theme.Svelte/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/// <reference types="svelte" />
|
||||
/// <reference types="vite/client" />
|
||||
7
src/OAP/Oap.Theme.Svelte/svelte.config.js
Normal file
7
src/OAP/Oap.Theme.Svelte/svelte.config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
||||
|
||||
export default {
|
||||
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
|
||||
// for more information about preprocessors
|
||||
preprocess: vitePreprocess(),
|
||||
};
|
||||
12
src/OAP/Oap.Theme.Svelte/tailwind.config.js
Normal file
12
src/OAP/Oap.Theme.Svelte/tailwind.config.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: [
|
||||
"../Oap.Theme/**/*.cshtml",
|
||||
"./index.html",
|
||||
"./src/**/*.{svelte,js,ts,jsx,tsx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
20
src/OAP/Oap.Theme.Svelte/tsconfig.json
Normal file
20
src/OAP/Oap.Theme.Svelte/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"extends": "@tsconfig/svelte/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"resolveJsonModule": true,
|
||||
/**
|
||||
* Typecheck JS in `.svelte` and `.js` files by default.
|
||||
* Disable checkJs if you'd like to use dynamic types in JS.
|
||||
* Note that setting allowJs false does not prevent the use
|
||||
* of JS in `.svelte` files.
|
||||
*/
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"isolatedModules": true
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
10
src/OAP/Oap.Theme.Svelte/tsconfig.node.json
Normal file
10
src/OAP/Oap.Theme.Svelte/tsconfig.node.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
15
src/OAP/Oap.Theme.Svelte/vite.config.ts
Normal file
15
src/OAP/Oap.Theme.Svelte/vite.config.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/** @type {import('vite').UserConfig} */
|
||||
import { defineConfig } from "vite";
|
||||
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [svelte()],
|
||||
build: {
|
||||
outDir: "../Oap.Theme/wwwroot",
|
||||
assetsDir: ".",
|
||||
emptyOutDir: true,
|
||||
manifest: true,
|
||||
minify: false,
|
||||
},
|
||||
});
|
||||
@@ -29,4 +29,8 @@
|
||||
<ProjectReference Include="..\Oap\Oap.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="wwwroot\.vite\manifest.json" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using Microsoft.Extensions.Options;
|
||||
using OrchardCore.ResourceManagement;
|
||||
|
||||
namespace Oap.Theme;
|
||||
@@ -9,15 +11,42 @@ public class ResourceManagementOptionsConfiguration : IConfigureOptions<Resource
|
||||
{
|
||||
m_manifest = new ResourceManifest();
|
||||
|
||||
m_manifest
|
||||
.DefineScript("OapTheme-scripts")
|
||||
.SetUrl("~/Oap.Theme/site.min.js", "~/Oap.Theme/site.js")
|
||||
.SetVersion("6.0.7");
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
const string manifestJsonResourceName = "Oap.Theme.wwwroot>.vite>manifest.json";
|
||||
using (Stream? stream = assembly.GetManifestResourceStream(manifestJsonResourceName))
|
||||
{
|
||||
if (stream != null)
|
||||
{
|
||||
var manifestJson = JsonDocument.Parse(stream);
|
||||
|
||||
foreach (var jsonProperty in manifestJson.RootElement.EnumerateObject())
|
||||
{
|
||||
var name = jsonProperty.Name;
|
||||
var value = jsonProperty.Value;
|
||||
|
||||
var jsFile = value.GetProperty("file").GetString();
|
||||
|
||||
m_manifest
|
||||
.DefineStyle("OapTheme-styles")
|
||||
.SetUrl("~/Oap.Theme/site.css")
|
||||
.DefineScript("OapTheme-scripts")
|
||||
.SetUrl($"~/Oap.Theme/{jsFile}")
|
||||
.SetVersion("1.0.0");
|
||||
|
||||
var cssFiles = value.GetProperty("css");
|
||||
var cssFileNames = cssFiles.EnumerateArray().Select(f => f.GetString()).ToList();
|
||||
|
||||
for (var i = 0; i < cssFileNames.Count; i++)
|
||||
{
|
||||
var resourceDefinition = m_manifest
|
||||
.DefineStyle(i == cssFileNames.Count - 1 ? "OapTheme-styles" : cssFileNames[i])
|
||||
.SetUrl($"~/Oap.Theme/{cssFileNames[i]}")
|
||||
.SetVersion("1.0.0");
|
||||
|
||||
if (i > 0)
|
||||
resourceDefinition.SetDependencies(cssFileNames[i - 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Configure(ResourceManagementOptions options)
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
import "../Styles/site.css";
|
||||
import 'htmx.org';
|
||||
@@ -2,4 +2,4 @@
|
||||
@Model.Header.TitlePart.Title
|
||||
</h1>
|
||||
|
||||
@await DisplayAsync(Model.Content)
|
||||
<div id="@Model.ContentItem.ContentType-@Model.ContentItem.Id" class="@Model.ContentItem.ContentType"></div>
|
||||
@@ -17,7 +17,7 @@
|
||||
<link type="image/x-icon" rel="shortcut icon" href="~/Oap.Theme/assets/favicon.ico">
|
||||
|
||||
<style asp-name="oaptheme-styles"></style>
|
||||
<script asp-name="oaptheme-scripts" at="Foot"></script>
|
||||
<script asp-name="oaptheme-scripts" type="module"></script>
|
||||
|
||||
<resources type="HeadLink" />
|
||||
<resources type="Stylesheet" />
|
||||
@@ -35,6 +35,5 @@
|
||||
@await RenderSectionAsync("Footer", required: false)
|
||||
|
||||
<resources type="FootScript" />
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
10429
src/OAP/Oap.Theme/package-lock.json
generated
10429
src/OAP/Oap.Theme/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"name": "tailwindtheme",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "webpack",
|
||||
"watch": "webpack --watch"
|
||||
},
|
||||
"browserslist": "> 5%",
|
||||
"devDependencies": {
|
||||
"aspnet-client-validation": "0.9.2",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"css-loader": "^6.8.1",
|
||||
"css-minimizer-webpack-plugin": "^5.0.1",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"htmx.org": "^1.9.8",
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-import": "^15.1.0",
|
||||
"postcss-loader": "^7.3.3",
|
||||
"style-loader": "^3.3.3",
|
||||
"tailwindcss": "3.3.5",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: ['./**/*.cshtml', './**/*.liquid'],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
/// <binding ProjectOpened='Watch - Development' />
|
||||
const path = require('path');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
entry: {
|
||||
site: './Scripts/site.js',
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'wwwroot'),
|
||||
filename: '[name].js',
|
||||
},
|
||||
plugins: [new MiniCssExtractPlugin()],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: [MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader'],
|
||||
},
|
||||
],
|
||||
},
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new CssMinimizerPlugin(),
|
||||
],
|
||||
},
|
||||
watchOptions: {
|
||||
ignored: '**/node_modules',
|
||||
},
|
||||
};
|
||||
11
src/OAP/Oap.Theme/wwwroot/.vite/manifest.json
Normal file
11
src/OAP/Oap.Theme/wwwroot/.vite/manifest.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"index.html": {
|
||||
"file": "index-bxmYv9y4.js",
|
||||
"name": "index",
|
||||
"src": "index.html",
|
||||
"isEntry": true,
|
||||
"css": [
|
||||
"index-ClWnXPkW.css"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
/*!*************************************************************************************************************!*\
|
||||
!*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./Styles/site.css ***!
|
||||
\*************************************************************************************************************/
|
||||
/*
|
||||
! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com
|
||||
! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com
|
||||
*//*
|
||||
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
||||
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
||||
@@ -29,15 +26,20 @@
|
||||
4. Use the user's configured `sans` font-family by default.
|
||||
5. Use the user's configured `sans` font-feature-settings by default.
|
||||
6. Use the user's configured `sans` font-variation-settings by default.
|
||||
7. Disable tap highlights on iOS
|
||||
*/
|
||||
|
||||
html {
|
||||
html,
|
||||
:host {
|
||||
line-height: 1.5; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */ /* 3 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
-moz-tab-size: 4; /* 3 */
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4; /* 3 */
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
|
||||
font-feature-settings: normal; /* 5 */
|
||||
font-variation-settings: normal; /* 6 */
|
||||
-webkit-tap-highlight-color: transparent; /* 7 */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -67,6 +69,7 @@ Add the correct text decoration in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
abbr:where([title]) {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
|
||||
@@ -103,8 +106,10 @@ strong {
|
||||
}
|
||||
|
||||
/*
|
||||
1. Use the user's configured `mono` font family by default.
|
||||
2. Correct the odd `em` font sizing in all browsers.
|
||||
1. Use the user's configured `mono` font-family by default.
|
||||
2. Use the user's configured `mono` font-feature-settings by default.
|
||||
3. Use the user's configured `mono` font-variation-settings by default.
|
||||
4. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
@@ -112,7 +117,9 @@ kbd,
|
||||
samp,
|
||||
pre {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
font-feature-settings: normal; /* 2 */
|
||||
font-variation-settings: normal; /* 3 */
|
||||
font-size: 1em; /* 4 */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -172,6 +179,7 @@ textarea {
|
||||
font-size: 100%; /* 1 */
|
||||
font-weight: inherit; /* 1 */
|
||||
line-height: inherit; /* 1 */
|
||||
letter-spacing: inherit; /* 1 */
|
||||
color: inherit; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
padding: 0; /* 3 */
|
||||
@@ -192,9 +200,9 @@ select {
|
||||
*/
|
||||
|
||||
button,
|
||||
[type='button'],
|
||||
[type='reset'],
|
||||
[type='submit'] {
|
||||
input:where([type='button']),
|
||||
input:where([type='reset']),
|
||||
input:where([type='submit']) {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
background-color: transparent; /* 2 */
|
||||
background-image: none; /* 2 */
|
||||
@@ -326,6 +334,11 @@ textarea {
|
||||
2. Set the default placeholder color to the user's configured gray 400 color.
|
||||
*/
|
||||
|
||||
input::-moz-placeholder, textarea::-moz-placeholder {
|
||||
opacity: 1; /* 1 */
|
||||
color: #9ca3af; /* 2 */
|
||||
}
|
||||
|
||||
input::placeholder,
|
||||
textarea::placeholder {
|
||||
opacity: 1; /* 1 */
|
||||
@@ -429,6 +442,10 @@ video {
|
||||
--tw-backdrop-opacity: ;
|
||||
--tw-backdrop-saturate: ;
|
||||
--tw-backdrop-sepia: ;
|
||||
--tw-contain-size: ;
|
||||
--tw-contain-layout: ;
|
||||
--tw-contain-paint: ;
|
||||
--tw-contain-style: ;
|
||||
}
|
||||
|
||||
::backdrop {
|
||||
@@ -479,6 +496,10 @@ video {
|
||||
--tw-backdrop-opacity: ;
|
||||
--tw-backdrop-saturate: ;
|
||||
--tw-backdrop-sepia: ;
|
||||
--tw-contain-size: ;
|
||||
--tw-contain-layout: ;
|
||||
--tw-contain-paint: ;
|
||||
--tw-contain-style: ;
|
||||
}
|
||||
.container {
|
||||
width: 100%;
|
||||
@@ -561,14 +582,6 @@ span.field-validation-error {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.my-1 {
|
||||
margin-top: 0.25rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
.my-2 {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
.mb-6 {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
@@ -578,18 +591,12 @@ span.field-validation-error {
|
||||
.mt-2 {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
.mb-4 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.block {
|
||||
display: block;
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.table {
|
||||
display: table;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
@@ -624,9 +631,11 @@ span.field-validation-error {
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.gap-x-3 {
|
||||
-moz-column-gap: 0.75rem;
|
||||
column-gap: 0.75rem;
|
||||
}
|
||||
.gap-x-4 {
|
||||
-moz-column-gap: 1rem;
|
||||
column-gap: 1rem;
|
||||
}
|
||||
.space-y-2 > :not([hidden]) ~ :not([hidden]) {
|
||||
@@ -751,6 +760,10 @@ span.field-validation-error {
|
||||
--tw-ring-opacity: 1;
|
||||
--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
|
||||
}
|
||||
.placeholder\:text-gray-400::-moz-placeholder {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(156 163 175 / var(--tw-text-opacity));
|
||||
}
|
||||
.placeholder\:text-gray-400::placeholder {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(156 163 175 / var(--tw-text-opacity));
|
||||
@@ -802,4 +815,3 @@ span.field-validation-error {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
339
src/OAP/Oap.Theme/wwwroot/index-bxmYv9y4.js
Normal file
339
src/OAP/Oap.Theme/wwwroot/index-bxmYv9y4.js
Normal file
@@ -0,0 +1,339 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __publicField = (obj, key, value) => {
|
||||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
||||
return value;
|
||||
};
|
||||
(function polyfill() {
|
||||
const relList = document.createElement("link").relList;
|
||||
if (relList && relList.supports && relList.supports("modulepreload")) {
|
||||
return;
|
||||
}
|
||||
for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
|
||||
processPreload(link);
|
||||
}
|
||||
new MutationObserver((mutations) => {
|
||||
for (const mutation of mutations) {
|
||||
if (mutation.type !== "childList") {
|
||||
continue;
|
||||
}
|
||||
for (const node of mutation.addedNodes) {
|
||||
if (node.tagName === "LINK" && node.rel === "modulepreload")
|
||||
processPreload(node);
|
||||
}
|
||||
}
|
||||
}).observe(document, { childList: true, subtree: true });
|
||||
function getFetchOpts(link) {
|
||||
const fetchOpts = {};
|
||||
if (link.integrity)
|
||||
fetchOpts.integrity = link.integrity;
|
||||
if (link.referrerPolicy)
|
||||
fetchOpts.referrerPolicy = link.referrerPolicy;
|
||||
if (link.crossOrigin === "use-credentials")
|
||||
fetchOpts.credentials = "include";
|
||||
else if (link.crossOrigin === "anonymous")
|
||||
fetchOpts.credentials = "omit";
|
||||
else
|
||||
fetchOpts.credentials = "same-origin";
|
||||
return fetchOpts;
|
||||
}
|
||||
function processPreload(link) {
|
||||
if (link.ep)
|
||||
return;
|
||||
link.ep = true;
|
||||
const fetchOpts = getFetchOpts(link);
|
||||
fetch(link.href, fetchOpts);
|
||||
}
|
||||
})();
|
||||
function noop() {
|
||||
}
|
||||
function run(fn) {
|
||||
return fn();
|
||||
}
|
||||
function blank_object() {
|
||||
return /* @__PURE__ */ Object.create(null);
|
||||
}
|
||||
function run_all(fns) {
|
||||
fns.forEach(run);
|
||||
}
|
||||
function is_function(thing) {
|
||||
return typeof thing === "function";
|
||||
}
|
||||
function safe_not_equal(a, b) {
|
||||
return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function";
|
||||
}
|
||||
function is_empty(obj) {
|
||||
return Object.keys(obj).length === 0;
|
||||
}
|
||||
function insert(target, node, anchor) {
|
||||
target.insertBefore(node, anchor || null);
|
||||
}
|
||||
function detach(node) {
|
||||
if (node.parentNode) {
|
||||
node.parentNode.removeChild(node);
|
||||
}
|
||||
}
|
||||
function element(name) {
|
||||
return document.createElement(name);
|
||||
}
|
||||
function children(element2) {
|
||||
return Array.from(element2.childNodes);
|
||||
}
|
||||
let current_component;
|
||||
function set_current_component(component) {
|
||||
current_component = component;
|
||||
}
|
||||
const dirty_components = [];
|
||||
const binding_callbacks = [];
|
||||
let render_callbacks = [];
|
||||
const flush_callbacks = [];
|
||||
const resolved_promise = /* @__PURE__ */ Promise.resolve();
|
||||
let update_scheduled = false;
|
||||
function schedule_update() {
|
||||
if (!update_scheduled) {
|
||||
update_scheduled = true;
|
||||
resolved_promise.then(flush);
|
||||
}
|
||||
}
|
||||
function add_render_callback(fn) {
|
||||
render_callbacks.push(fn);
|
||||
}
|
||||
const seen_callbacks = /* @__PURE__ */ new Set();
|
||||
let flushidx = 0;
|
||||
function flush() {
|
||||
if (flushidx !== 0) {
|
||||
return;
|
||||
}
|
||||
const saved_component = current_component;
|
||||
do {
|
||||
try {
|
||||
while (flushidx < dirty_components.length) {
|
||||
const component = dirty_components[flushidx];
|
||||
flushidx++;
|
||||
set_current_component(component);
|
||||
update(component.$$);
|
||||
}
|
||||
} catch (e) {
|
||||
dirty_components.length = 0;
|
||||
flushidx = 0;
|
||||
throw e;
|
||||
}
|
||||
set_current_component(null);
|
||||
dirty_components.length = 0;
|
||||
flushidx = 0;
|
||||
while (binding_callbacks.length)
|
||||
binding_callbacks.pop()();
|
||||
for (let i = 0; i < render_callbacks.length; i += 1) {
|
||||
const callback = render_callbacks[i];
|
||||
if (!seen_callbacks.has(callback)) {
|
||||
seen_callbacks.add(callback);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
render_callbacks.length = 0;
|
||||
} while (dirty_components.length);
|
||||
while (flush_callbacks.length) {
|
||||
flush_callbacks.pop()();
|
||||
}
|
||||
update_scheduled = false;
|
||||
seen_callbacks.clear();
|
||||
set_current_component(saved_component);
|
||||
}
|
||||
function update($$) {
|
||||
if ($$.fragment !== null) {
|
||||
$$.update();
|
||||
run_all($$.before_update);
|
||||
const dirty = $$.dirty;
|
||||
$$.dirty = [-1];
|
||||
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
||||
$$.after_update.forEach(add_render_callback);
|
||||
}
|
||||
}
|
||||
function flush_render_callbacks(fns) {
|
||||
const filtered = [];
|
||||
const targets = [];
|
||||
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
|
||||
targets.forEach((c) => c());
|
||||
render_callbacks = filtered;
|
||||
}
|
||||
const outroing = /* @__PURE__ */ new Set();
|
||||
function transition_in(block, local) {
|
||||
if (block && block.i) {
|
||||
outroing.delete(block);
|
||||
block.i(local);
|
||||
}
|
||||
}
|
||||
function mount_component(component, target, anchor) {
|
||||
const { fragment, after_update } = component.$$;
|
||||
fragment && fragment.m(target, anchor);
|
||||
add_render_callback(() => {
|
||||
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
||||
if (component.$$.on_destroy) {
|
||||
component.$$.on_destroy.push(...new_on_destroy);
|
||||
} else {
|
||||
run_all(new_on_destroy);
|
||||
}
|
||||
component.$$.on_mount = [];
|
||||
});
|
||||
after_update.forEach(add_render_callback);
|
||||
}
|
||||
function destroy_component(component, detaching) {
|
||||
const $$ = component.$$;
|
||||
if ($$.fragment !== null) {
|
||||
flush_render_callbacks($$.after_update);
|
||||
run_all($$.on_destroy);
|
||||
$$.fragment && $$.fragment.d(detaching);
|
||||
$$.on_destroy = $$.fragment = null;
|
||||
$$.ctx = [];
|
||||
}
|
||||
}
|
||||
function make_dirty(component, i) {
|
||||
if (component.$$.dirty[0] === -1) {
|
||||
dirty_components.push(component);
|
||||
schedule_update();
|
||||
component.$$.dirty.fill(0);
|
||||
}
|
||||
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
|
||||
}
|
||||
function init(component, options, instance, create_fragment2, not_equal, props, append_styles = null, dirty = [-1]) {
|
||||
const parent_component = current_component;
|
||||
set_current_component(component);
|
||||
const $$ = component.$$ = {
|
||||
fragment: null,
|
||||
ctx: [],
|
||||
// state
|
||||
props,
|
||||
update: noop,
|
||||
not_equal,
|
||||
bound: blank_object(),
|
||||
// lifecycle
|
||||
on_mount: [],
|
||||
on_destroy: [],
|
||||
on_disconnect: [],
|
||||
before_update: [],
|
||||
after_update: [],
|
||||
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
||||
// everything else
|
||||
callbacks: blank_object(),
|
||||
dirty,
|
||||
skip_bound: false,
|
||||
root: options.target || parent_component.$$.root
|
||||
};
|
||||
append_styles && append_styles($$.root);
|
||||
let ready = false;
|
||||
$$.ctx = instance ? instance(component, options.props || {}, (i, ret, ...rest) => {
|
||||
const value = rest.length ? rest[0] : ret;
|
||||
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
||||
if (!$$.skip_bound && $$.bound[i])
|
||||
$$.bound[i](value);
|
||||
if (ready)
|
||||
make_dirty(component, i);
|
||||
}
|
||||
return ret;
|
||||
}) : [];
|
||||
$$.update();
|
||||
ready = true;
|
||||
run_all($$.before_update);
|
||||
$$.fragment = create_fragment2 ? create_fragment2($$.ctx) : false;
|
||||
if (options.target) {
|
||||
if (options.hydrate) {
|
||||
const nodes = children(options.target);
|
||||
$$.fragment && $$.fragment.l(nodes);
|
||||
nodes.forEach(detach);
|
||||
} else {
|
||||
$$.fragment && $$.fragment.c();
|
||||
}
|
||||
if (options.intro)
|
||||
transition_in(component.$$.fragment);
|
||||
mount_component(component, options.target, options.anchor);
|
||||
flush();
|
||||
}
|
||||
set_current_component(parent_component);
|
||||
}
|
||||
class SvelteComponent {
|
||||
constructor() {
|
||||
/**
|
||||
* ### PRIVATE API
|
||||
*
|
||||
* Do not use, may change at any time
|
||||
*
|
||||
* @type {any}
|
||||
*/
|
||||
__publicField(this, "$$");
|
||||
/**
|
||||
* ### PRIVATE API
|
||||
*
|
||||
* Do not use, may change at any time
|
||||
*
|
||||
* @type {any}
|
||||
*/
|
||||
__publicField(this, "$$set");
|
||||
}
|
||||
/** @returns {void} */
|
||||
$destroy() {
|
||||
destroy_component(this, 1);
|
||||
this.$destroy = noop;
|
||||
}
|
||||
/**
|
||||
* @template {Extract<keyof Events, string>} K
|
||||
* @param {K} type
|
||||
* @param {((e: Events[K]) => void) | null | undefined} callback
|
||||
* @returns {() => void}
|
||||
*/
|
||||
$on(type, callback) {
|
||||
if (!is_function(callback)) {
|
||||
return noop;
|
||||
}
|
||||
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
|
||||
callbacks.push(callback);
|
||||
return () => {
|
||||
const index = callbacks.indexOf(callback);
|
||||
if (index !== -1)
|
||||
callbacks.splice(index, 1);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* @param {Partial<Props>} props
|
||||
* @returns {void}
|
||||
*/
|
||||
$set(props) {
|
||||
if (this.$$set && !is_empty(props)) {
|
||||
this.$$.skip_bound = true;
|
||||
this.$$set(props);
|
||||
this.$$.skip_bound = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
const PUBLIC_VERSION = "4";
|
||||
if (typeof window !== "undefined")
|
||||
(window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION);
|
||||
function create_fragment(ctx) {
|
||||
let div;
|
||||
return {
|
||||
c() {
|
||||
div = element("div");
|
||||
div.textContent = "This is an application form";
|
||||
},
|
||||
m(target, anchor) {
|
||||
insert(target, div, anchor);
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d(detaching) {
|
||||
if (detaching) {
|
||||
detach(div);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
class OapApplicationForm extends SvelteComponent {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, null, create_fragment, safe_not_equal, {});
|
||||
}
|
||||
}
|
||||
console.log(document.getElementsByClassName("OapApplicationForm"));
|
||||
new OapApplicationForm({
|
||||
target: document.getElementsByClassName("OapApplicationForm")[0]
|
||||
});
|
||||
16
src/OAP/Oap.Theme/wwwroot/index.html
Normal file
16
src/OAP/Oap.Theme/wwwroot/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Overseas Auto Protection - Svelte</title>
|
||||
<script type="module" crossorigin src="/index-bxmYv9y4.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/index-ClWnXPkW.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
<div id="OapApplicationForm-1" class="OapApplicationForm"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,35 +0,0 @@
|
||||
using Facility.AspNetCore;
|
||||
using Facility.Core.Http;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using OapApi.v1.Client;
|
||||
using OapApi.v1.Client.Http;
|
||||
using OrchardCore.Mvc.Core.Utilities;
|
||||
|
||||
namespace OapApi.v1
|
||||
{
|
||||
public class Startup : OrchardCore.Modules.StartupBase
|
||||
{
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<IOapApiV1, OapApiV1>();
|
||||
|
||||
services.AddScoped(sp =>
|
||||
{
|
||||
return new OapApiV1HttpHandler(
|
||||
sp.GetRequiredService<IOapApiV1>(),
|
||||
new ServiceHttpHandlerSettings
|
||||
{
|
||||
RootPath = "/oap/api/v1",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
|
||||
{
|
||||
builder.UseFacilityExceptionHandler();
|
||||
builder.UseFacilityHttpHandler<OapApiV1HttpHandler>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,9 +27,9 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BenRamey\BenRamey.Theme\BenRamey.Theme.csproj" />
|
||||
<ProjectReference Include="..\Modules\MarkdownImport\MarkdownImport.csproj" />
|
||||
<ProjectReference Include="..\OAP\Oap.Api\Oap.Api.csproj" />
|
||||
<ProjectReference Include="..\OAP\Oap.Content\Oap.Content.csproj" />
|
||||
<ProjectReference Include="..\OAP\Oap.Theme\Oap.Theme.csproj" />
|
||||
<ProjectReference Include="..\OAP\OapApi.v1\OapApi.v1.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user