Basically working svelte interaction with orchard

This commit is contained in:
2024-04-19 09:54:24 -05:00
parent 7471d531bf
commit 6836ef68ea
68 changed files with 4077 additions and 11187 deletions

View File

@@ -1,13 +1,13 @@
root = true root = true
[*] [*]
indent_style = tab indent_style = tab
indent_size = tab indent_size = tab
tab_width = 4 tab_width = 4
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true
end_of_line = crlf end_of_line = lf
[*.{yml,csproj}] [*.{yml,csproj}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2

188
Twain.sln
View File

@@ -1,94 +1,94 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59 VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Twain.Web", "src\Twain.Web\Twain.Web.csproj", "{9D30C377-C660-416B-A27A-53D2189BFF24}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Twain.Web", "src\Twain.Web\Twain.Web.csproj", "{9D30C377-C660-416B-A27A-53D2189BFF24}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7C34E548-E385-4902-8A50-B7F49CABAC10}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7C34E548-E385-4902-8A50-B7F49CABAC10}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
azure-pipelines.yml = azure-pipelines.yml azure-pipelines.yml = azure-pipelines.yml
EndProjectSection EndProjectSection
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "tools\Build\Build.csproj", "{97FFBB7D-C82D-47B2-B110-377B5F6B49C2}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "tools\Build\Build.csproj", "{97FFBB7D-C82D-47B2-B110-377B5F6B49C2}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MarkdownImport", "src\Modules\MarkdownImport\MarkdownImport.csproj", "{7B0477DA-BCD5-47ED-8B88-76D046524434}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MarkdownImport", "src\Modules\MarkdownImport\MarkdownImport.csproj", "{7B0477DA-BCD5-47ED-8B88-76D046524434}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenRamey.Theme", "src\BenRamey\BenRamey.Theme\BenRamey.Theme.csproj", "{A7498019-5941-479B-ADB2-56B6C984C608}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenRamey.Theme", "src\BenRamey\BenRamey.Theme\BenRamey.Theme.csproj", "{A7498019-5941-479B-ADB2-56B6C984C608}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{3DA05917-02EA-4B04-9C48-B86C77A73584}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{3DA05917-02EA-4B04-9C48-B86C77A73584}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OapApi.v1.Client", "src\OAP\OapApi.v1.Client\OapApi.v1.Client.csproj", "{5C30AB89-B3D4-468F-A029-3D26FECD0083}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap.Api.v1", "src\OAP\Oap.Api.v1\Oap.Api.v1.csproj", "{5C30AB89-B3D4-468F-A029-3D26FECD0083}"
EndProject 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.Content", "src\OAP\Oap.Content\Oap.Content.csproj", "{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap.Content", "src\OAP\Oap.Content\Oap.Content.csproj", "{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OAP", "OAP", "{E6EDFA50-6BFE-44C5-BEEB-18108A20F625}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OAP", "OAP", "{E6EDFA50-6BFE-44C5-BEEB-18108A20F625}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BenRamey", "BenRamey", "{03C1520E-5ABF-4AF7-858B-8BE234ACE0FB}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BenRamey", "BenRamey", "{03C1520E-5ABF-4AF7-858B-8BE234ACE0FB}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap", "src\OAP\Oap\Oap.csproj", "{E6BF474A-1186-496E-899E-2B7AA6180E30}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap", "src\OAP\Oap\Oap.csproj", "{E6BF474A-1186-496E-899E-2B7AA6180E30}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap.Theme", "src\OAP\Oap.Theme\Oap.Theme.csproj", "{6ECAEC1D-21A1-455E-8BE4-66399C85E45B}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap.Theme", "src\OAP\Oap.Theme\Oap.Theme.csproj", "{6ECAEC1D-21A1-455E-8BE4-66399C85E45B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oap.Api", "src\OAP\Oap.Api\Oap.Api.csproj", "{9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9D30C377-C660-416B-A27A-53D2189BFF24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9D30C377-C660-416B-A27A-53D2189BFF24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D30C377-C660-416B-A27A-53D2189BFF24}.Debug|Any CPU.Build.0 = Debug|Any CPU {9D30C377-C660-416B-A27A-53D2189BFF24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D30C377-C660-416B-A27A-53D2189BFF24}.Release|Any CPU.ActiveCfg = Release|Any CPU {9D30C377-C660-416B-A27A-53D2189BFF24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D30C377-C660-416B-A27A-53D2189BFF24}.Release|Any CPU.Build.0 = Release|Any CPU {9D30C377-C660-416B-A27A-53D2189BFF24}.Release|Any CPU.Build.0 = Release|Any CPU
{97FFBB7D-C82D-47B2-B110-377B5F6B49C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {97FFBB7D-C82D-47B2-B110-377B5F6B49C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97FFBB7D-C82D-47B2-B110-377B5F6B49C2}.Debug|Any CPU.Build.0 = Debug|Any CPU {97FFBB7D-C82D-47B2-B110-377B5F6B49C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97FFBB7D-C82D-47B2-B110-377B5F6B49C2}.Release|Any CPU.ActiveCfg = Release|Any CPU {97FFBB7D-C82D-47B2-B110-377B5F6B49C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97FFBB7D-C82D-47B2-B110-377B5F6B49C2}.Release|Any CPU.Build.0 = Release|Any CPU {97FFBB7D-C82D-47B2-B110-377B5F6B49C2}.Release|Any CPU.Build.0 = Release|Any CPU
{7B0477DA-BCD5-47ED-8B88-76D046524434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7B0477DA-BCD5-47ED-8B88-76D046524434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B0477DA-BCD5-47ED-8B88-76D046524434}.Debug|Any CPU.Build.0 = Debug|Any CPU {7B0477DA-BCD5-47ED-8B88-76D046524434}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B0477DA-BCD5-47ED-8B88-76D046524434}.Release|Any CPU.ActiveCfg = Release|Any CPU {7B0477DA-BCD5-47ED-8B88-76D046524434}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B0477DA-BCD5-47ED-8B88-76D046524434}.Release|Any CPU.Build.0 = Release|Any CPU {7B0477DA-BCD5-47ED-8B88-76D046524434}.Release|Any CPU.Build.0 = Release|Any CPU
{A7498019-5941-479B-ADB2-56B6C984C608}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A7498019-5941-479B-ADB2-56B6C984C608}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A7498019-5941-479B-ADB2-56B6C984C608}.Debug|Any CPU.Build.0 = Debug|Any CPU {A7498019-5941-479B-ADB2-56B6C984C608}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7498019-5941-479B-ADB2-56B6C984C608}.Release|Any CPU.ActiveCfg = Release|Any CPU {A7498019-5941-479B-ADB2-56B6C984C608}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7498019-5941-479B-ADB2-56B6C984C608}.Release|Any CPU.Build.0 = Release|Any CPU {A7498019-5941-479B-ADB2-56B6C984C608}.Release|Any CPU.Build.0 = Release|Any CPU
{5C30AB89-B3D4-468F-A029-3D26FECD0083}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5C30AB89-B3D4-468F-A029-3D26FECD0083}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C30AB89-B3D4-468F-A029-3D26FECD0083}.Debug|Any CPU.Build.0 = Debug|Any CPU {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.ActiveCfg = Release|Any CPU
{5C30AB89-B3D4-468F-A029-3D26FECD0083}.Release|Any CPU.Build.0 = 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 {D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D414342C-EA8D-4115-BF22-DC8B62FB3CBF}.Release|Any CPU.ActiveCfg = Release|Any CPU {D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.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}.Release|Any CPU.Build.0 = Release|Any CPU
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E6BF474A-1186-496E-899E-2B7AA6180E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Debug|Any CPU.Build.0 = Debug|Any CPU {E6BF474A-1186-496E-899E-2B7AA6180E30}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Release|Any CPU.ActiveCfg = Release|Any CPU {E6BF474A-1186-496E-899E-2B7AA6180E30}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F}.Release|Any CPU.Build.0 = Release|Any CPU {E6BF474A-1186-496E-899E-2B7AA6180E30}.Release|Any CPU.Build.0 = Release|Any CPU
{E6BF474A-1186-496E-899E-2B7AA6180E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6BF474A-1186-496E-899E-2B7AA6180E30}.Debug|Any CPU.Build.0 = Debug|Any CPU {6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6BF474A-1186-496E-899E-2B7AA6180E30}.Release|Any CPU.ActiveCfg = Release|Any CPU {6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6BF474A-1186-496E-899E-2B7AA6180E30}.Release|Any CPU.Build.0 = Release|Any CPU {6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Release|Any CPU.Build.0 = Release|Any CPU
{6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Debug|Any CPU.Build.0 = Debug|Any CPU {9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6ECAEC1D-21A1-455E-8BE4-66399C85E45B}.Release|Any CPU.ActiveCfg = Release|Any CPU {9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9}.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}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{97FFBB7D-C82D-47B2-B110-377B5F6B49C2} = {7C34E548-E385-4902-8A50-B7F49CABAC10} {97FFBB7D-C82D-47B2-B110-377B5F6B49C2} = {7C34E548-E385-4902-8A50-B7F49CABAC10}
{7B0477DA-BCD5-47ED-8B88-76D046524434} = {3DA05917-02EA-4B04-9C48-B86C77A73584} {7B0477DA-BCD5-47ED-8B88-76D046524434} = {3DA05917-02EA-4B04-9C48-B86C77A73584}
{A7498019-5941-479B-ADB2-56B6C984C608} = {03C1520E-5ABF-4AF7-858B-8BE234ACE0FB} {A7498019-5941-479B-ADB2-56B6C984C608} = {03C1520E-5ABF-4AF7-858B-8BE234ACE0FB}
{5C30AB89-B3D4-468F-A029-3D26FECD0083} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625} {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}
{D2827FDB-33A0-45E9-9F75-EB81BCE3833F} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625} {E6BF474A-1186-496E-899E-2B7AA6180E30} = {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}
{6ECAEC1D-21A1-455E-8BE4-66399C85E45B} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625} {9C540EF9-FA7A-4D5F-9FE2-7B0FAE7EBBD9} = {E6EDFA50-6BFE-44C5-BEEB-18108A20F625}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0F7F9D4C-DF95-43AF-9E9A-DA09B5EE03C7} SolutionGuid = {0F7F9D4C-DF95-43AF-9E9A-DA09B5EE03C7}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,147 +1,146 @@
[http(url: "https://oaprotection.org/api/v1")] [http(url: "https://oaprotection.org/api/v1")]
[csharp(namespace: OapApi.v1)] [csharp(namespace: Oap.Api.v1)]
service OapApiV1 service OapApiV1
{ {
/// Gets applications for the current user. /// Gets applications for the current user.
[http(method: GET, path: "/applications")] [http(method: GET, path: "/applications")]
[tag(name:"bob")] method getApplications
method getApplications {
{ /// Filter applications by the given status.
/// Filter applications by the given status. status: ApplicationStatus;
status: ApplicationStatus;
/// The limit of returned results.
/// The limit of returned results. limit: int32;
limit: int32;
/// The token presenting the next page of applications to get.
/// The token presenting the next page of applications to get. nextToken: string;
nextToken: string; }:
}: {
{ /// The applications.
/// The applications. applications: Application[];
applications: Application[];
/// The total number of applications.
/// The total number of applications. total: int64;
total: int64;
/// The token representing the next page of results.
/// The token representing the next page of results. nextToken: string;
nextToken: string;
/// True if this is the last page of results, false otherwise.
/// True if this is the last page of results, false otherwise. isLastPage: boolean;
isLastPage: boolean; }
}
/// Creates a new application for the current user.
/// Creates a new application for the current user. [http(method: POST, path: "/applications/", code: 201)]
[http(method: POST, path: "/applications/", code: 201)] method createApplication
method createApplication {
{ /// The application to create.
/// The application to create. [http(from: body)]
[http(from: body)] applicationCreateSet: ApplicationCreateSet;
applicationCreateSet: ApplicationCreateSet; }:
}: {
{ /// The created application.
/// The created application. [http(from: body)]
[http(from: body)] application: Application;
application: Application; }
}
/// Gets the specified application for the current user.
/// Gets the specified application for the current user. [http(method: GET, path: "/applications/{id}")]
[http(method: GET, path: "/applications/{id}")] method getApplication
method getApplication {
{ /// The widget ID.
/// The widget ID. id: string;
id: string; }:
}: {
{ /// The requested widget.
/// The requested widget. [http(from: body)]
[http(from: body)] application: Application;
application: Application;
[http(from: header)]
[http(from: header)] eTag: string;
eTag: string;
[http(from: body, code: 304)]
[http(from: body, code: 304)] notModified: boolean;
notModified: boolean; }
}
/// Updates the application.
/// Updates the application. [http(method: PATCH, path: "/applications/{id}")]
[http(method: PATCH, path: "/applications/{id}")] method updateApplication
method updateApplication {
{ /// The application ID.
/// The application ID. id: string;
id: string;
/// The application update set.
/// The application update set. [http(from: body)]
[http(from: body)] applicationChangeSet: ApplicationChangeSet;
applicationChangeSet: ApplicationChangeSet; }:
}: {
{ /// The updated Application.
/// The updated Application. [http(from: body, code: 200)]
[http(from: body, code: 200)] application: Application;
application: Application; }
}
/// An application.
/// An application. data Application
data Application {
{ /// A unique identifier for the application.
/// A unique identifier for the application. id: string;
id: string;
/// The current status of this application.
/// The current status of this application. status: ApplicationStatus;
status: ApplicationStatus;
/// Terms the user must accept to start, continue an accept an application.
/// Terms the user must accept to start, continue an accept an application. terms: ApplicationTerms;
terms: ApplicationTerms; }
}
data ApplicationCreateSet
data ApplicationCreateSet {
{ /// Terms a user must accept to start an application.
/// Terms a user must accept to start an application. terms: ApplicationTermsCreateSet!;
terms: ApplicationTermsCreateSet!; }
}
data ApplicationChangeSet
data ApplicationChangeSet {
{ }
}
data ApplicationTermsCreateSet
data ApplicationTermsCreateSet {
{ hasReadInstructions: boolean!;
hasReadInstructions: boolean!; }
}
data ApplicationTerms
data ApplicationTerms {
{ hasReadInstructions: boolean;
hasReadInstructions: boolean; }
}
enum ApplicationStatus
enum ApplicationStatus {
{ InProgress,
InProgress, Submitted
Submitted }
} }
}
# OapApiV1
# OapApiV1
API providing OAP functionality for the application form, calculator and more.
API providing OAP functionality for the application form, calculator and more.
## Heading
## Heading
Use a primary heading to indicate the member name.
Use a primary heading to indicate the member name.
# getApplications
# getApplications
Gets the current user's applications in pages.
Gets the current user's applications in pages.
# createApplication
# createApplication
Creates a new application for the current user.
Creates a new application for the current user.
# updateApplication
# updateApplication
Updates an application for the current user, given the ID of the application to update.
Updates an application for the current user, given the ID of the application to update.
# Application
# Application
Represents a user's application, whether in progress or submitted.
Represents a user's application, whether in progress or submitted.

View File

@@ -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 REM fsdgenaspnet .\fsd\OapApi.v1.fsd ./src/OAP/OapApi.v1 --target core --namespace OapApi.v1 --apinamespace OapApi.v1.Client

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
public sealed partial class ApplicationChangeSetDto : ServiceDto<ApplicationChangeSetDto> public sealed partial class ApplicationChangeSetDto : ServiceDto<ApplicationChangeSetDto>

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
public sealed partial class ApplicationCreateSetDto : ServiceDto<ApplicationCreateSetDto> public sealed partial class ApplicationCreateSetDto : ServiceDto<ApplicationCreateSetDto>

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// An application. /// An application.

View File

@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
[Newtonsoft.Json.JsonConverter(typeof(ApplicationStatusJsonConverter))] [Newtonsoft.Json.JsonConverter(typeof(ApplicationStatusJsonConverter))]

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
public sealed partial class ApplicationTermsCreateSetDto : ServiceDto<ApplicationTermsCreateSetDto> public sealed partial class ApplicationTermsCreateSetDto : ServiceDto<ApplicationTermsCreateSetDto>

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
public sealed partial class ApplicationTermsDto : ServiceDto<ApplicationTermsDto> public sealed partial class ApplicationTermsDto : ServiceDto<ApplicationTermsDto>

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// Request for CreateApplication. /// Request for CreateApplication.

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// Response for CreateApplication. /// Response for CreateApplication.

View File

@@ -6,7 +6,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// A delegating implementation of OapApiV1. /// A delegating implementation of OapApiV1.

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// Request for GetApplication. /// Request for GetApplication.

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// Response for GetApplication. /// Response for GetApplication.

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// Request for GetApplications. /// Request for GetApplications.

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// Response for GetApplications. /// Response for GetApplications.

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
using Facility.Core; using Facility.Core;
using Facility.Core.Http; using Facility.Core.Http;
namespace OapApi.v1.Client.Http namespace Oap.Api.v1.Http
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
public sealed partial class HttpClientOapApiV1 : HttpClientService, IOapApiV1 public sealed partial class HttpClientOapApiV1 : HttpClientService, IOapApiV1

View File

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
using Facility.Core; using Facility.Core;
using Facility.Core.Http; using Facility.Core.Http;
namespace OapApi.v1.Client.Http namespace Oap.Api.v1.Http
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
public sealed partial class OapApiV1HttpHandler : ServiceHttpHandler public sealed partial class OapApiV1HttpHandler : ServiceHttpHandler

View File

@@ -11,7 +11,7 @@ using Facility.Core.Http;
#pragma warning disable 612, 618 // member is obsolete #pragma warning disable 612, 618 // member is obsolete
namespace OapApi.v1.Client.Http namespace Oap.Api.v1.Http
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
public static partial class OapApiV1HttpMapping public static partial class OapApiV1HttpMapping

View File

@@ -6,7 +6,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
public partial interface IOapApiV1 public partial interface IOapApiV1

View File

@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Facility.Core" Version="2.27.0" /> <PackageReference Include="Facility.Core" Version="2.27.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -4,7 +4,7 @@
using System; using System;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
[System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")] [System.CodeDom.Compiler.GeneratedCode("fsdgencsharp", "")]
internal static class OapApiV1Methods internal static class OapApiV1Methods

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// Request for UpdateApplication. /// Request for UpdateApplication.

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Facility.Core; using Facility.Core;
namespace OapApi.v1.Client namespace Oap.Api.v1
{ {
/// <summary> /// <summary>
/// Response for UpdateApplication. /// Response for UpdateApplication.

View File

@@ -1,13 +1,13 @@
using OrchardCore.Modules.Manifest; using OrchardCore.Modules.Manifest;
[assembly: Module( [assembly: Module(
Name = "Overseas Auto Protection API v1", Name = "Overseas Auto Protection API",
Author = "Overseas Auto Protection", Author = "Overseas Auto Protection",
Website = "https://oaprotection.org/api/v1/", Website = "https://oaprotection.org/api/",
Version = "0.0.1", Version = "0.0.1",
Description = "API for OAP services", Description = "API for OAP services",
Category = "Content Management", Category = "Content Management",
Dependencies = [ Dependencies = [
"OAP.Content" "OAP.Content"
] ]
)] )]

View File

@@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization> <InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Facility.AspNetCore" Version="3.9.0" /> <PackageReference Include="Facility.AspNetCore" Version="3.9.0" />
<PackageReference Include="Facility.Core" Version="2.27.0" /> <PackageReference Include="Facility.Core" Version="2.27.0" />
<PackageReference Include="OrchardCore.Module.Targets" Version="1.8.2" /> <PackageReference Include="OrchardCore.Module.Targets" Version="1.8.2" />
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.8.2" /> <PackageReference Include="OrchardCore.DisplayManagement" Version="1.8.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup> </ItemGroup>
<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" /> <ProjectReference Include="..\Oap\Oap.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,8 +1,7 @@
using Facility.Core; using Facility.Core;
using Microsoft.AspNetCore.Mvc; using Oap.Api.v1;
using OapApi.v1.Client;
namespace OapApi.v1; namespace Oap.Api;
public sealed class OapApiV1 : IOapApiV1 public sealed class OapApiV1 : IOapApiV1
{ {

View 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
View 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?

View File

@@ -0,0 +1,3 @@
{
"recommendations": ["svelte.svelte-vscode"]
}

View 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)
```

View 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

File diff suppressed because it is too large Load Diff

View 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"
}
}

View File

@@ -1,7 +1,6 @@
module.exports = { export default {
plugins: { plugins: {
'postcss-import': {},
tailwindcss: {}, tailwindcss: {},
autoprefixer: {}, autoprefixer: {},
}, },
}; }

View File

@@ -0,0 +1,5 @@
<script lang="ts">
import Counter from "./lib/Counter.svelte";
</script>
<p>I love bob</p>

View File

@@ -0,0 +1,3 @@
<div>
This is an application form
</div>

View File

@@ -1,4 +1,4 @@
@import "tailwindcss/base"; @import "tailwindcss/base";
@import "tailwindcss/components"; @import "tailwindcss/components";
@import "./richtext.css"; @import "./richtext.css";
@import "./validation.css"; @import "./validation.css";

View 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>

View 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 };

View File

@@ -0,0 +1,2 @@
/// <reference types="svelte" />
/// <reference types="vite/client" />

View 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(),
};

View 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: [],
};

View 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" }]
}

View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true
},
"include": ["vite.config.ts"]
}

View 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,
},
});

View File

@@ -1,9 +1,9 @@
using OrchardCore.DisplayManagement.Manifest; using OrchardCore.DisplayManagement.Manifest;
[assembly: Theme( [assembly: Theme(
Name = "OAP Theme", Name = "OAP Theme",
Author = "Overseas Auto Protection", Author = "Overseas Auto Protection",
Website = "https://oaprotection.org/", Website = "https://oaprotection.org/",
Version = "0.0.1", Version = "0.0.1",
Description = "Overseas Auto Protection site theme." Description = "Overseas Auto Protection site theme."
)] )]

View File

@@ -1,32 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> <AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="OrchardCore.Autoroute" Version="1.8.2" /> <PackageReference Include="OrchardCore.Autoroute" Version="1.8.2" />
<PackageReference Include="OrchardCore.ContentFields" Version="1.8.2" /> <PackageReference Include="OrchardCore.ContentFields" Version="1.8.2" />
<PackageReference Include="OrchardCore.Flows" Version="1.8.2" /> <PackageReference Include="OrchardCore.Flows" Version="1.8.2" />
<PackageReference Include="OrchardCore.Forms" Version="1.8.2" /> <PackageReference Include="OrchardCore.Forms" Version="1.8.2" />
<PackageReference Include="OrchardCore.Html" Version="1.8.2" /> <PackageReference Include="OrchardCore.Html" Version="1.8.2" />
<PackageReference Include="OrchardCore.Lists" Version="1.8.2" /> <PackageReference Include="OrchardCore.Lists" Version="1.8.2" />
<PackageReference Include="OrchardCore.Menu" Version="1.8.2" /> <PackageReference Include="OrchardCore.Menu" Version="1.8.2" />
<PackageReference Include="OrchardCore.Theme.Targets" Version="1.8.2" /> <PackageReference Include="OrchardCore.Theme.Targets" Version="1.8.2" />
<PackageReference Include="OrchardCore.ContentManagement" Version="1.8.2" /> <PackageReference Include="OrchardCore.ContentManagement" Version="1.8.2" />
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.8.2" /> <PackageReference Include="OrchardCore.DisplayManagement" Version="1.8.2" />
<PackageReference Include="OrchardCore.ResourceManagement" Version="1.8.2" /> <PackageReference Include="OrchardCore.ResourceManagement" Version="1.8.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Oap\Oap.csproj" /> <ProjectReference Include="..\Oap\Oap.csproj" />
</ItemGroup> </ItemGroup>
</Project> <ItemGroup>
<EmbeddedResource Include="wwwroot\.vite\manifest.json" />
</ItemGroup>
</Project>

View File

@@ -1,29 +1,58 @@
using Microsoft.Extensions.Options; using System.Reflection;
using OrchardCore.ResourceManagement; using System.Text.Json;
using Microsoft.Extensions.Options;
namespace Oap.Theme; using OrchardCore.ResourceManagement;
public class ResourceManagementOptionsConfiguration : IConfigureOptions<ResourceManagementOptions> namespace Oap.Theme;
{
static ResourceManagementOptionsConfiguration() public class ResourceManagementOptionsConfiguration : IConfigureOptions<ResourceManagementOptions>
{ {
m_manifest = new ResourceManifest(); static ResourceManagementOptionsConfiguration()
{
m_manifest m_manifest = new ResourceManifest();
.DefineScript("OapTheme-scripts")
.SetUrl("~/Oap.Theme/site.min.js", "~/Oap.Theme/site.js") var assembly = Assembly.GetExecutingAssembly();
.SetVersion("6.0.7"); const string manifestJsonResourceName = "Oap.Theme.wwwroot>.vite>manifest.json";
using (Stream? stream = assembly.GetManifestResourceStream(manifestJsonResourceName))
m_manifest {
.DefineStyle("OapTheme-styles") if (stream != null)
.SetUrl("~/Oap.Theme/site.css") {
.SetVersion("1.0.0"); var manifestJson = JsonDocument.Parse(stream);
}
foreach (var jsonProperty in manifestJson.RootElement.EnumerateObject())
public void Configure(ResourceManagementOptions options) {
{ var name = jsonProperty.Name;
options.ResourceManifests.Add(m_manifest); var value = jsonProperty.Value;
}
var jsFile = value.GetProperty("file").GetString();
private static ResourceManifest m_manifest;
} m_manifest
.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)
{
options.ResourceManifests.Add(m_manifest);
}
private static ResourceManifest m_manifest;
}

View File

@@ -1,2 +0,0 @@
import "../Styles/site.css";
import 'htmx.org';

View File

@@ -1,5 +1,5 @@
<h1 class="mb-6 border-b-2 border-solid border-black pb-1 text-center text-2xl font-bold"> <h1 class="mb-6 border-b-2 border-solid border-black pb-1 text-center text-2xl font-bold">
@Model.Header.TitlePart.Title @Model.Header.TitlePart.Title
</h1> </h1>
@await DisplayAsync(Model.Content) <div id="@Model.ContentItem.ContentType-@Model.ContentItem.Id" class="@Model.ContentItem.ContentType"></div>

View File

@@ -1,40 +1,39 @@
@using OrchardCore.Admin.Models @using OrchardCore.Admin.Models
@using OrchardCore.DisplayManagement @using OrchardCore.DisplayManagement
@using OrchardCore.DisplayManagement.ModelBinding @using OrchardCore.DisplayManagement.ModelBinding
@using OrchardCore.Entities @using OrchardCore.Entities
@using OrchardCore.Users.Models @using OrchardCore.Users.Models
<!DOCTYPE html> <!DOCTYPE html>
<html lang="@Orchard.CultureName()" dir="@Orchard.CultureDir()"> <html lang="@Orchard.CultureName()" dir="@Orchard.CultureDir()">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@RenderTitleSegments(Site.SiteName, "before")</title> <title>@RenderTitleSegments(Site.SiteName, "before")</title>
<resources type="Meta" /> <resources type="Meta" />
<link type="image/x-icon" rel="shortcut icon" href="~/Oap.Theme/assets/favicon.ico"> <link type="image/x-icon" rel="shortcut icon" href="~/Oap.Theme/assets/favicon.ico">
<style asp-name="oaptheme-styles"></style> <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="HeadLink" />
<resources type="Stylesheet" /> <resources type="Stylesheet" />
<resources type="HeadScript" /> <resources type="HeadScript" />
@await RenderSectionAsync("HeadMeta", required: false) @await RenderSectionAsync("HeadMeta", required: false)
</head> </head>
<body> <body>
@await RenderSectionAsync("Header", required: false) @await RenderSectionAsync("Header", required: false)
<main class="container mx-auto flex flex-col max-w-screen-md p-6"> <main class="container mx-auto flex flex-col max-w-screen-md p-6">
@await RenderBodyAsync() @await RenderBodyAsync()
</main> </main>
@await RenderSectionAsync("Footer", required: false) @await RenderSectionAsync("Footer", required: false)
<resources type="FootScript" /> <resources type="FootScript" />
</body>
</body> </html>
</html>

View File

@@ -1,21 +1,21 @@
@using OrchardCore.Forms.Models @using OrchardCore.Forms.Models
@model ShapeViewModel<TextAreaPart> @model ShapeViewModel<TextAreaPart>
@{ @{
var formElementPart = Model.Value.ContentItem.As<FormElementPart>(); var formElementPart = Model.Value.ContentItem.As<FormElementPart>();
var formInputElementPart = Model.Value.ContentItem.As<FormInputElementPart>(); var formInputElementPart = Model.Value.ContentItem.As<FormInputElementPart>();
var elementId = formElementPart.Id; var elementId = formElementPart.Id;
var fieldName = formInputElementPart.Name; var fieldName = formInputElementPart.Name;
var fieldId = !string.IsNullOrEmpty(elementId) ? elementId : !string.IsNullOrEmpty(fieldName) ? Html.GenerateIdFromName(fieldName) : default(string); var fieldId = !string.IsNullOrEmpty(elementId) ? elementId : !string.IsNullOrEmpty(fieldName) ? Html.GenerateIdFromName(fieldName) : default(string);
var fieldValue = Model.Value.DefaultValue?.Trim(); var fieldValue = Model.Value.DefaultValue?.Trim();
var fieldClass = "block w-full rounded-md border-0 py-1.5 px-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600"; var fieldClass = "block w-full rounded-md border-0 py-1.5 px-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600";
if (ViewData.ModelState.TryGetValue(fieldName, out var fieldEntry)) if (ViewData.ModelState.TryGetValue(fieldName, out var fieldEntry))
{ {
fieldValue = fieldEntry.AttemptedValue; fieldValue = fieldEntry.AttemptedValue;
if (fieldEntry.Errors.Count > 0) if (fieldEntry.Errors.Count > 0)
{ {
fieldClass = "form-control input-validation-error is-invalid"; fieldClass = "form-control input-validation-error is-invalid";
} }
} }
} }
<textarea id="@fieldId" name="@fieldName" class="@fieldClass" placeholder="@Model.Value.Placeholder">@fieldValue</textarea> <textarea id="@fieldId" name="@fieldName" class="@fieldClass" placeholder="@Model.Value.Placeholder">@fieldValue</textarea>

File diff suppressed because it is too large Load Diff

View File

@@ -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"
}
}

View File

@@ -1,8 +0,0 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./**/*.cshtml', './**/*.liquid'],
theme: {
extend: {},
},
plugins: [],
};

View File

@@ -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',
},
};

View File

@@ -0,0 +1,11 @@
{
"index.html": {
"file": "index-bxmYv9y4.js",
"name": "index",
"src": "index.html",
"isEntry": true,
"css": [
"index-ClWnXPkW.css"
]
}
}

View File

@@ -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) 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) 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. 4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings 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. 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 */ line-height: 1.5; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */ /* 3 */ -webkit-text-size-adjust: 100%; /* 2 */
tab-size: 4; /* 3 */ -moz-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 */ -o-tab-size: 4;
tab-size: 4; /* 3 */
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-feature-settings: normal; /* 5 */
font-variation-settings: normal; /* 6 */ font-variation-settings: normal; /* 6 */
-webkit-tap-highlight-color: transparent; /* 7 */
} }
/* /*
@@ -67,7 +69,8 @@ Add the correct text decoration in Chrome, Edge, and Safari.
*/ */
abbr:where([title]) { abbr:where([title]) {
text-decoration: underline dotted; -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. 1. Use the user's configured `mono` font-family by default.
2. Correct the odd `em` font sizing in all browsers. 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, code,
@@ -112,7 +117,9 @@ kbd,
samp, samp,
pre { pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */ 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-size: 100%; /* 1 */
font-weight: inherit; /* 1 */ font-weight: inherit; /* 1 */
line-height: inherit; /* 1 */ line-height: inherit; /* 1 */
letter-spacing: inherit; /* 1 */
color: inherit; /* 1 */ color: inherit; /* 1 */
margin: 0; /* 2 */ margin: 0; /* 2 */
padding: 0; /* 3 */ padding: 0; /* 3 */
@@ -192,9 +200,9 @@ select {
*/ */
button, button,
[type='button'], input:where([type='button']),
[type='reset'], input:where([type='reset']),
[type='submit'] { input:where([type='submit']) {
-webkit-appearance: button; /* 1 */ -webkit-appearance: button; /* 1 */
background-color: transparent; /* 2 */ background-color: transparent; /* 2 */
background-image: none; /* 2 */ background-image: none; /* 2 */
@@ -326,6 +334,11 @@ textarea {
2. Set the default placeholder color to the user's configured gray 400 color. 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, input::placeholder,
textarea::placeholder { textarea::placeholder {
opacity: 1; /* 1 */ opacity: 1; /* 1 */
@@ -429,6 +442,10 @@ video {
--tw-backdrop-opacity: ; --tw-backdrop-opacity: ;
--tw-backdrop-saturate: ; --tw-backdrop-saturate: ;
--tw-backdrop-sepia: ; --tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
} }
::backdrop { ::backdrop {
@@ -479,6 +496,10 @@ video {
--tw-backdrop-opacity: ; --tw-backdrop-opacity: ;
--tw-backdrop-saturate: ; --tw-backdrop-saturate: ;
--tw-backdrop-sepia: ; --tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
} }
.container { .container {
width: 100%; width: 100%;
@@ -561,14 +582,6 @@ span.field-validation-error {
margin-left: auto; margin-left: auto;
margin-right: 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 { .mb-6 {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
} }
@@ -578,18 +591,12 @@ span.field-validation-error {
.mt-2 { .mt-2 {
margin-top: 0.5rem; margin-top: 0.5rem;
} }
.mb-4 {
margin-bottom: 1rem;
}
.block { .block {
display: block; display: block;
} }
.flex { .flex {
display: flex; display: flex;
} }
.table {
display: table;
}
.hidden { .hidden {
display: none; display: none;
} }
@@ -624,10 +631,12 @@ span.field-validation-error {
gap: 0.5rem; gap: 0.5rem;
} }
.gap-x-3 { .gap-x-3 {
column-gap: 0.75rem; -moz-column-gap: 0.75rem;
column-gap: 0.75rem;
} }
.gap-x-4 { .gap-x-4 {
column-gap: 1rem; -moz-column-gap: 1rem;
column-gap: 1rem;
} }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { .space-y-2 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0; --tw-space-y-reverse: 0;
@@ -751,6 +760,10 @@ span.field-validation-error {
--tw-ring-opacity: 1; --tw-ring-opacity: 1;
--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity)); --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 { .placeholder\:text-gray-400::placeholder {
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity)); color: rgb(156 163 175 / var(--tw-text-opacity));
@@ -802,4 +815,3 @@ span.field-validation-error {
} }
} }

View 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]
});

View 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

View File

@@ -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>();
}
}
}

View File

@@ -1,35 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Folder Include="wwwroot\" /> <Folder Include="wwwroot\" />
<Folder Include="Localization\" /> <Folder Include="Localization\" />
</ItemGroup> </ItemGroup>
<!-- Watcher include and excludes --> <!-- Watcher include and excludes -->
<ItemGroup> <ItemGroup>
<Watch Include="**\*.cs" Exclude="Recipes\**;Assets\**;node_modules\**\*;**\*.js.map;obj\**\*;bin\**\*" /> <Watch Include="**\*.cs" Exclude="Recipes\**;Assets\**;node_modules\**\*;**\*.js.map;obj\**\*;bin\**\*" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="OrchardCore.AutoSetup" Version="1.8.2" /> <PackageReference Include="OrchardCore.AutoSetup" Version="1.8.2" />
<PackageReference Include="OrchardCore.Logging.NLog" Version="1.8.2" /> <PackageReference Include="OrchardCore.Logging.NLog" Version="1.8.2" />
<PackageReference Include="OrchardCore.Application.Cms.Targets" Version="1.8.2" /> <PackageReference Include="OrchardCore.Application.Cms.Targets" Version="1.8.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\BenRamey\BenRamey.Theme\BenRamey.Theme.csproj" /> <ProjectReference Include="..\BenRamey\BenRamey.Theme\BenRamey.Theme.csproj" />
<ProjectReference Include="..\Modules\MarkdownImport\MarkdownImport.csproj" /> <ProjectReference Include="..\Modules\MarkdownImport\MarkdownImport.csproj" />
<ProjectReference Include="..\OAP\Oap.Content\Oap.Content.csproj" /> <ProjectReference Include="..\OAP\Oap.Api\Oap.Api.csproj" />
<ProjectReference Include="..\OAP\Oap.Theme\Oap.Theme.csproj" /> <ProjectReference Include="..\OAP\Oap.Content\Oap.Content.csproj" />
<ProjectReference Include="..\OAP\OapApi.v1\OapApi.v1.csproj" /> <ProjectReference Include="..\OAP\Oap.Theme\Oap.Theme.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>