@social-mail/social-mail-client 1.2.422 → 1.2.424
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/AdminAppIndex.pack.js +19 -17
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +5 -5
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.js +4 -4
- package/dist/public/channel/ChannelView.pack.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.min.js +4 -4
- package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
- package/dist/public/contact-us/ContactUsApp.pack.js +3 -3
- package/dist/public/contact-us/ContactUsApp.pack.js.map +1 -1
- package/dist/public/contact-us/ContactUsApp.pack.min.js +3 -3
- package/dist/public/contact-us/ContactUsApp.pack.min.js.map +1 -1
- package/dist/public/store/Store.pack.js +4 -4
- package/dist/public/store/Store.pack.js.map +1 -1
- package/dist/public/store/Store.pack.min.js +4 -4
- package/dist/public/store/Store.pack.min.js.map +1 -1
- package/dist/public/store/StoreApp.pack.js +3 -3
- package/dist/public/store/StoreApp.pack.js.map +1 -1
- package/dist/public/store/StoreApp.pack.min.js +3 -3
- package/dist/public/store/StoreApp.pack.min.js.map +1 -1
- package/dist/site-editor/SiteEditorApp.pack.js +3 -3
- package/dist/site-editor/SiteEditorApp.pack.js.map +1 -1
- package/dist/site-editor/SiteEditorApp.pack.min.js +3 -3
- package/dist/site-editor/SiteEditorApp.pack.min.js.map +1 -1
- package/dist/web/AppIndex.pack.js +19 -17
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +5 -5
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/node_modules/@positron-js/context/.github/workflows/node.yml +23 -0
- package/node_modules/@positron-js/context/.vscode/settings.json +15 -0
- package/node_modules/{@web-atoms/hybrid-clr → @positron-js/context}/LICENSE +1 -1
- package/node_modules/@positron-js/context/README.md +2 -0
- package/node_modules/@positron-js/context/build.js +17 -0
- package/node_modules/@positron-js/context/dist/CLR.d.ts +7 -0
- package/node_modules/{@web-atoms/hybrid-clr/dist/RootObject.js → @positron-js/context/dist/CLR.js} +1 -7
- package/node_modules/@positron-js/context/dist/CLR.js.map +1 -0
- package/node_modules/@positron-js/context/dist/IClassOf.d.ts +3 -0
- package/node_modules/@positron-js/context/dist/IClassOf.js +13 -0
- package/node_modules/@positron-js/context/dist/IClassOf.js.map +1 -0
- package/node_modules/@positron-js/context/dist/IPositronContext.d.ts +4 -0
- package/node_modules/@positron-js/context/dist/IPositronContext.js +13 -0
- package/node_modules/@positron-js/context/dist/IPositronContext.js.map +1 -0
- package/node_modules/@positron-js/context/dist/PositronInBrowser.d.ts +17 -0
- package/node_modules/@positron-js/context/dist/PositronInBrowser.js +34 -0
- package/node_modules/@positron-js/context/dist/PositronInBrowser.js.map +1 -0
- package/node_modules/@positron-js/context/dist/clr/Microsoft.Maui.Essentials.d.ts +1350 -0
- package/node_modules/@positron-js/context/dist/clr/Microsoft.Maui.Essentials.js +13 -0
- package/node_modules/@positron-js/context/dist/clr/Microsoft.Maui.Essentials.js.map +1 -0
- package/node_modules/@positron-js/context/dist/clr/Microsoft.Maui.Graphics.d.ts +1362 -0
- package/node_modules/@positron-js/context/dist/clr/Microsoft.Maui.Graphics.js +13 -0
- package/node_modules/@positron-js/context/dist/clr/Microsoft.Maui.Graphics.js.map +1 -0
- package/node_modules/@positron-js/context/dist/clr/NeuroSpeech.Positron.d.ts +22 -0
- package/node_modules/@positron-js/context/dist/clr/NeuroSpeech.Positron.js +13 -0
- package/node_modules/@positron-js/context/dist/clr/NeuroSpeech.Positron.js.map +1 -0
- package/node_modules/@positron-js/context/dist/test/PTest.d.ts +1 -0
- package/node_modules/@positron-js/context/dist/test/PTest.js +24 -0
- package/node_modules/@positron-js/context/dist/test/PTest.js.map +1 -0
- package/node_modules/@positron-js/context/dist/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@positron-js/context/index.d.ts +2 -0
- package/node_modules/@positron-js/context/index.js +2 -0
- package/node_modules/@positron-js/context/maui/SourceGenerator/AssemblyInfo.cs +103 -0
- package/node_modules/@positron-js/context/maui/SourceGenerator/DictionaryExtensions.cs +17 -0
- package/node_modules/@positron-js/context/maui/SourceGenerator/MethodExtensions.cs +21 -0
- package/node_modules/@positron-js/context/maui/SourceGenerator/Program.cs +145 -0
- package/node_modules/@positron-js/context/maui/SourceGenerator/SourceGenerator.csproj +15 -0
- package/node_modules/@positron-js/context/maui/SourceGenerator/SourceGenerator.sln +25 -0
- package/node_modules/@positron-js/context/maui/SourceGenerator/StringExtensions.cs +10 -0
- package/node_modules/@positron-js/context/maui/SourceGenerator/TypeExtensions.cs +95 -0
- package/node_modules/@positron-js/context/package.json +16 -0
- package/node_modules/@positron-js/context/src/CLR.ts +10 -0
- package/node_modules/@positron-js/context/src/IClassOf.ts +3 -0
- package/node_modules/@positron-js/context/src/IPositronContext.ts +5 -0
- package/node_modules/@positron-js/context/src/PositronInBrowser.ts +31 -0
- package/node_modules/@positron-js/context/src/clr/Microsoft.Maui.Essentials.ts +2215 -0
- package/node_modules/@positron-js/context/src/clr/Microsoft.Maui.Graphics.ts +1879 -0
- package/node_modules/@positron-js/context/src/clr/NeuroSpeech.Positron.ts +32 -0
- package/node_modules/@positron-js/context/src/test/PTest.ts +17 -0
- package/node_modules/@positron-js/context/tsconfig.json +26 -0
- package/node_modules/@web-atoms/core/dist/core/Command.d.ts.map +1 -1
- package/node_modules/@web-atoms/core/dist/core/Command.js +1 -1
- package/node_modules/@web-atoms/core/dist/core/Command.js.map +1 -1
- package/node_modules/@web-atoms/core/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@web-atoms/core/dist/web/core/HtmlNode.d.ts.map +1 -1
- package/node_modules/@web-atoms/core/dist/web/core/HtmlNode.js +5 -1
- package/node_modules/@web-atoms/core/dist/web/core/HtmlNode.js.map +1 -1
- package/node_modules/@web-atoms/core/dist/web/services/PopupWindow.js +2 -2
- package/node_modules/@web-atoms/core/package.json +1 -1
- package/node_modules/@web-atoms/core/src/core/Command.ts +1 -1
- package/node_modules/@web-atoms/core/src/web/core/HtmlNode.tsx +6 -1
- package/node_modules/@web-atoms/core/src/web/services/PopupWindow.tsx +2 -2
- package/node_modules/@web-atoms/web-controls/dist/basic/AtomRepeater.js +1 -1
- package/node_modules/@web-atoms/web-controls/dist/basic/AtomRepeater.js.map +1 -1
- package/node_modules/@web-atoms/web-controls/dist/basic/Select.d.ts.map +1 -1
- package/node_modules/@web-atoms/web-controls/dist/basic/Select.js +13 -11
- package/node_modules/@web-atoms/web-controls/dist/basic/Select.js.map +1 -1
- package/node_modules/@web-atoms/web-controls/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@web-atoms/web-controls/package.json +1 -1
- package/node_modules/@web-atoms/web-controls/src/basic/AtomRepeater.tsx +1 -1
- package/node_modules/@web-atoms/web-controls/src/basic/Select.tsx +13 -11
- package/package.json +4 -4
- package/node_modules/@web-atoms/hybrid-clr/.eslintrc.js +0 -233
- package/node_modules/@web-atoms/hybrid-clr/README.md +0 -1
- package/node_modules/@web-atoms/hybrid-clr/dist/DotNet.d.ts +0 -13
- package/node_modules/@web-atoms/hybrid-clr/dist/DotNet.d.ts.map +0 -1
- package/node_modules/@web-atoms/hybrid-clr/dist/DotNet.js +0 -49
- package/node_modules/@web-atoms/hybrid-clr/dist/DotNet.js.map +0 -1
- package/node_modules/@web-atoms/hybrid-clr/dist/RootObject.d.ts +0 -5
- package/node_modules/@web-atoms/hybrid-clr/dist/RootObject.d.ts.map +0 -1
- package/node_modules/@web-atoms/hybrid-clr/dist/RootObject.js.map +0 -1
- package/node_modules/@web-atoms/hybrid-clr/dist/WebAtoms.d.ts +0 -49
- package/node_modules/@web-atoms/hybrid-clr/dist/WebAtoms.d.ts.map +0 -1
- package/node_modules/@web-atoms/hybrid-clr/dist/WebAtoms.js +0 -118
- package/node_modules/@web-atoms/hybrid-clr/dist/WebAtoms.js.map +0 -1
- package/node_modules/@web-atoms/hybrid-clr/package.json +0 -23
- package/node_modules/@web-atoms/hybrid-clr/src/DotNet.ts +0 -49
- package/node_modules/@web-atoms/hybrid-clr/src/RootObject.ts +0 -5
- package/node_modules/@web-atoms/hybrid-clr/src/WebAtoms.ts +0 -83
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=Microsoft.Maui.Graphics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Microsoft.Maui.Graphics.js","sourceRoot":"","sources":["../../src/clr/Microsoft.Maui.Graphics.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare class Positron {
|
|
2
|
+
static instance: Positron;
|
|
3
|
+
deviceToken: string;
|
|
4
|
+
appUrl: string;
|
|
5
|
+
shareRequested: string;
|
|
6
|
+
}
|
|
7
|
+
/** Don't forget to call dispose */
|
|
8
|
+
export declare class ProgressPanel {
|
|
9
|
+
static create(name: string): ProgressPanel;
|
|
10
|
+
progress: number;
|
|
11
|
+
dispose(): void;
|
|
12
|
+
}
|
|
13
|
+
export interface INeuroSpeechPositron {
|
|
14
|
+
NeuroSpeech: {
|
|
15
|
+
Positron: {
|
|
16
|
+
Positron: typeof Positron;
|
|
17
|
+
Controls: {
|
|
18
|
+
ProgressPanel: typeof ProgressPanel;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=NeuroSpeech.Positron.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NeuroSpeech.Positron.js","sourceRoot":"","sources":["../../src/clr/NeuroSpeech.Positron.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../PositronInBrowser"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const PositronInBrowser_1 = require("../PositronInBrowser");
|
|
13
|
+
PositronInBrowser_1.default.run(function () {
|
|
14
|
+
const Positron = this.clr.assembly("NeuroSpeech.Positron")
|
|
15
|
+
.NeuroSpeech.Positron.Positron;
|
|
16
|
+
const essentials = this.clr.assembly("Microsoft.Maui.Essentials");
|
|
17
|
+
const { MediaPicker } = essentials.Microsoft.Maui.Media;
|
|
18
|
+
const graphics = this.clr.assembly("Microsoft.Maui.Graphics");
|
|
19
|
+
const { Colors } = graphics.Microsoft.Maui.Graphics;
|
|
20
|
+
Colors.orange;
|
|
21
|
+
return Positron.instance.deviceToken;
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=PTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PTest.js","sourceRoot":"","sources":["../../src/test/PTest.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,4DAAqD;IAErD,2BAAiB,CAAC,GAAG,CAAC;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,sBAAsB,CAAC;aACrD,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAEnC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;QAClE,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;QAExD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC;QAE9D,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;QAEpD,MAAM,CAAC,MAAM,CAAA;QAEb,OAAO,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC;IACzC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es5.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.dom.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../../opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/clr/NeuroSpeech.Positron.ts","../src/clr/Microsoft.Maui.Essentials.ts","../src/clr/Microsoft.Maui.Graphics.ts","../src/CLR.ts","../src/IClassOf.ts","../src/IPositronContext.ts","../src/PositronInBrowser.ts","../src/test/PTest.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"7f1f23c9653c8989adf30c34aa3107f51841fffd38b6fd014f8ffa3fd8d08594","signature":"fd41d429c54c9cc03629770e3fbc06888c77d291e54ebe8e6f77fb1bfd1191fc"},{"version":"06e35071f7ce5fd5a7bdab33f30d35e9caec92f7051149459ec97d4531f31699","signature":"8bec173f322d764adaf3e31e86a97a82d3f0a9bc61b8a8d6fae1961714f55fb7"},{"version":"86d57d31e47e9abd2e0357ef5599b956526e95f37518c709c277ce93c13bbb06","signature":"2becc8a84da2c6f414c9e275ffc3d57a20f9a822c64d056f2ca7862cb99030dc"},{"version":"696b0495cd84277fd4ad3cd728196ed4e42dd7b455c40b3448afec9acfb0fb7a","signature":"0f4a6afa81d5fc85768d8bab3120558771a543935adee53c421b24105926dbfb"},{"version":"2b18a262f466b7646cd8f474b6e86237aa6d4687d08b2c847b71fd2eabdacaa3","signature":"d519f2ce91618e98b2dbb34a5bd8876836221ec8d40558f8113c8a98cbbc20c0"},{"version":"ea2e9791fc33de3beb45612da8a44fa854dd55c576c6ef91d9fa7aa8a185d5bc","signature":"db4d56a6d766410dd103ce403cdb47f9c47e569f644bfb5c67d22f15267a4d4e"},{"version":"d4bbd9f3a8c7cc6312913b75c3feb887111fe5b49fbf082b8e231c569d8c2ab2","signature":"435e69f1a958f084b9ead35ed9b71d7902293b49d1fb1efd18d77ccf54063a8f"},{"version":"663cbd0618987b847a18dd3bb7a2615018209132dd883589edd69f12da695144","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"}],"root":[[15,22]],"options":{"declaration":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"jsx":2,"module":3,"outDir":"./","sourceMap":true,"target":2},"fileIdsList":[[15,16,17],[18],[20],[21]],"referencedMap":[[18,1],[20,2],[21,3],[22,4]]},"version":"5.5.4"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.CodeDom.Compiler;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using System.Linq;
|
|
5
|
+
using System.Text;
|
|
6
|
+
using System.Threading.Tasks;
|
|
7
|
+
|
|
8
|
+
namespace SourceGenerator;
|
|
9
|
+
|
|
10
|
+
public class AssemblyInfo
|
|
11
|
+
{
|
|
12
|
+
public AssemblyInfo(string name,
|
|
13
|
+
AssemblyInfo? parent = null,
|
|
14
|
+
Type? type = null
|
|
15
|
+
)
|
|
16
|
+
{
|
|
17
|
+
this.Parent = parent;
|
|
18
|
+
this.Name = name;
|
|
19
|
+
this.Fullname = parent == null
|
|
20
|
+
? this.Name
|
|
21
|
+
: $"{parent.Fullname}.{this.Name}";
|
|
22
|
+
this.Type = type;
|
|
23
|
+
|
|
24
|
+
//if (this.Parent != null)
|
|
25
|
+
//{
|
|
26
|
+
// var c = this.Parent.Children ??= new Dictionary<string, AssemblyInfo>();
|
|
27
|
+
// // c[this.Name] = this;
|
|
28
|
+
//}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public AssemblyInfo? Parent { get; }
|
|
32
|
+
public string Name { get; }
|
|
33
|
+
public string Fullname { get; }
|
|
34
|
+
public Type? Type { get; }
|
|
35
|
+
|
|
36
|
+
public Dictionary<string, AssemblyInfo>? Children { get; private set; }
|
|
37
|
+
|
|
38
|
+
public Type Resolve(string name)
|
|
39
|
+
{
|
|
40
|
+
if (Children == null)
|
|
41
|
+
{
|
|
42
|
+
throw new InvalidOperationException($"Type {name} not found in {this.Fullname}");
|
|
43
|
+
}
|
|
44
|
+
if (Children.TryGetValue(name, out var value))
|
|
45
|
+
{
|
|
46
|
+
if (value.Type != null)
|
|
47
|
+
{
|
|
48
|
+
return value.Type;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
throw new InvalidOperationException($"Type {name} not found in {this.Fullname}");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
internal AssemblyInfo GetOrCreate(string token)
|
|
55
|
+
{
|
|
56
|
+
this.Children ??= new();
|
|
57
|
+
return this.Children.GetOrCreate(token, (x) => new AssemblyInfo(x, this));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
internal void AddType(Type type)
|
|
61
|
+
{
|
|
62
|
+
this.Children ??= new();
|
|
63
|
+
this.Children.Add(type.Name, new AssemblyInfo(type.Name, this, type));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public override string ToString()
|
|
67
|
+
{
|
|
68
|
+
var sb = new StringBuilder();
|
|
69
|
+
var tb = new IndentedTextWriter(new StringWriter(sb));
|
|
70
|
+
this.Print(tb);
|
|
71
|
+
return sb.ToString();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private void Print(IndentedTextWriter sb)
|
|
75
|
+
{
|
|
76
|
+
|
|
77
|
+
var hasName = this.Name != null && this.Name.Length > 0;
|
|
78
|
+
if (hasName) {
|
|
79
|
+
var name = this.Name;
|
|
80
|
+
if (this.Type != null)
|
|
81
|
+
{
|
|
82
|
+
name = this.Type.GetJSTypeName();
|
|
83
|
+
}
|
|
84
|
+
sb.Write($"{name}: ");
|
|
85
|
+
}
|
|
86
|
+
if (this.Type != null) {
|
|
87
|
+
sb.WriteLine($"typeof {this.Type.GetJSType(this.Type.Assembly)};");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (this.Children != null)
|
|
91
|
+
{
|
|
92
|
+
sb.WriteLine("{");
|
|
93
|
+
sb.Indent++;
|
|
94
|
+
foreach (var child in this.Children.Values)
|
|
95
|
+
{
|
|
96
|
+
child.Print(sb);
|
|
97
|
+
}
|
|
98
|
+
sb.Indent--;
|
|
99
|
+
sb.WriteLine("}");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
namespace SourceGenerator;
|
|
2
|
+
|
|
3
|
+
internal static class DictionaryExtensions
|
|
4
|
+
{
|
|
5
|
+
|
|
6
|
+
public static TValue GetOrCreate<TKey, TValue>(this IDictionary<TKey, TValue> @this, TKey key, Func<TKey, TValue> factory)
|
|
7
|
+
{
|
|
8
|
+
if (@this.TryGetValue(key, out TValue? value))
|
|
9
|
+
{
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
value = factory(key);
|
|
13
|
+
@this[key] = value;
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using System.Reflection;
|
|
5
|
+
using System.Text;
|
|
6
|
+
using System.Threading.Tasks;
|
|
7
|
+
|
|
8
|
+
namespace SourceGenerator;
|
|
9
|
+
|
|
10
|
+
internal static class MethodExtensions
|
|
11
|
+
{
|
|
12
|
+
|
|
13
|
+
internal static string GetJSParameters(this MethodBase method, Assembly a)
|
|
14
|
+
{
|
|
15
|
+
return string.Join(",", method.GetParameters().Select(p => {
|
|
16
|
+
|
|
17
|
+
return $"{p.Name}: {p.ParameterType.GetJSType(a)}";
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
using System.Reflection;
|
|
2
|
+
using System.Text;
|
|
3
|
+
|
|
4
|
+
namespace SourceGenerator;
|
|
5
|
+
|
|
6
|
+
internal class Program
|
|
7
|
+
{
|
|
8
|
+
static void Main(string[] args)
|
|
9
|
+
{
|
|
10
|
+
var input = args[0];
|
|
11
|
+
|
|
12
|
+
var generated = Build(input);
|
|
13
|
+
|
|
14
|
+
Console.WriteLine(generated);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static string Build(string assemblyName)
|
|
18
|
+
{
|
|
19
|
+
|
|
20
|
+
var a = Assembly.Load(assemblyName);
|
|
21
|
+
|
|
22
|
+
var ai = new AssemblyInfo("");
|
|
23
|
+
|
|
24
|
+
var sb = new StringBuilder();
|
|
25
|
+
|
|
26
|
+
foreach(var type in a.GetExportedTypes()) {
|
|
27
|
+
|
|
28
|
+
if (type.Namespace == null || type.Namespace.Length == 0)
|
|
29
|
+
{
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (type.IsEnum)
|
|
34
|
+
{
|
|
35
|
+
|
|
36
|
+
sb.AppendLine($"export type {type.GetJSType(a)} = ");
|
|
37
|
+
var i = 0;
|
|
38
|
+
foreach (var field in Enum.GetNames(type))
|
|
39
|
+
{
|
|
40
|
+
if (i++>0)
|
|
41
|
+
{
|
|
42
|
+
sb.Append("|");
|
|
43
|
+
}
|
|
44
|
+
sb.AppendLine(System.Text.Json.JsonSerializer.Serialize(field));
|
|
45
|
+
}
|
|
46
|
+
sb.AppendLine(";");
|
|
47
|
+
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var ns = ai;
|
|
52
|
+
foreach(var token in type.Namespace.Split("."))
|
|
53
|
+
{
|
|
54
|
+
ns = ns.GetOrCreate(token);
|
|
55
|
+
}
|
|
56
|
+
ns.AddType(type);
|
|
57
|
+
|
|
58
|
+
var fullClassName = type.GetJSType(a);
|
|
59
|
+
|
|
60
|
+
var extends = "";
|
|
61
|
+
|
|
62
|
+
sb.AppendLine($@"
|
|
63
|
+
// {type.GetNamespaceName()}
|
|
64
|
+
export declare class {fullClassName} {extends} {{");
|
|
65
|
+
|
|
66
|
+
foreach (var property in type.GetProperties( BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public ))
|
|
67
|
+
{
|
|
68
|
+
if (property.CanRead)
|
|
69
|
+
{
|
|
70
|
+
sb.AppendLine($"\t\t\tstatic get {property.Name.ToCamelCase()}(): {property.PropertyType.GetJSType(a)}");
|
|
71
|
+
}
|
|
72
|
+
if (property.CanWrite)
|
|
73
|
+
{
|
|
74
|
+
sb.AppendLine($"\t\t\tstatic set {property.Name.ToCamelCase()}(v: {property.PropertyType.GetJSType(a)});");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
foreach (var property in type.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public))
|
|
83
|
+
{
|
|
84
|
+
if (property.CanRead)
|
|
85
|
+
{
|
|
86
|
+
sb.AppendLine($"\t\t\tget {property.Name.ToCamelCase()}(): {property.PropertyType.GetJSType(a)}");
|
|
87
|
+
}
|
|
88
|
+
if (property.CanWrite)
|
|
89
|
+
{
|
|
90
|
+
sb.AppendLine($"\t\t\tset {property.Name.ToCamelCase()}(v: {property.PropertyType.GetJSType(a)});");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
foreach (var field in type.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public))
|
|
95
|
+
{
|
|
96
|
+
sb.AppendLine($"\t\t\tstatic {field.Name.ToCamelCase()}: {field.FieldType.GetJSType(a)}");
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
foreach (var field in type.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public))
|
|
101
|
+
{
|
|
102
|
+
sb.AppendLine($"\t\t\t{field.Name.ToCamelCase()}: {field.FieldType.GetJSType(a)}");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
foreach (var c in type.GetConstructors(BindingFlags.DeclaredOnly | BindingFlags.Public))
|
|
106
|
+
{
|
|
107
|
+
sb.AppendLine($"\t\t\tconstructor({ c.GetJSParameters(a)});");
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
foreach (var method in type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public))
|
|
112
|
+
{
|
|
113
|
+
if (method.IsSpecialName)
|
|
114
|
+
{
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
sb.AppendLine($"\t\t\tstatic {method.Name.ToCamelCase()}({method.GetJSParameters(a)}): {method.ReturnType.GetJSType(a)}");
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
foreach (var method in type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public))
|
|
122
|
+
{
|
|
123
|
+
if (method.IsSpecialName)
|
|
124
|
+
{
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
sb.AppendLine($"\t\t\t{method.Name.ToCamelCase()}({method.GetJSParameters(a)}): {method.ReturnType.GetJSType(a)}");
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
sb.AppendLine($@"
|
|
132
|
+
}}
|
|
133
|
+
");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
sb.AppendLine();
|
|
139
|
+
sb.AppendLine();
|
|
140
|
+
|
|
141
|
+
sb.AppendLine(@$"export default interface I{assemblyName.Replace(".", "_")} {ai.ToString()}");
|
|
142
|
+
|
|
143
|
+
return sb.ToString();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
2
|
+
|
|
3
|
+
<PropertyGroup>
|
|
4
|
+
<OutputType>Exe</OutputType>
|
|
5
|
+
<TargetFramework>net8.0</TargetFramework>
|
|
6
|
+
<ImplicitUsings>enable</ImplicitUsings>
|
|
7
|
+
<Nullable>enable</Nullable>
|
|
8
|
+
</PropertyGroup>
|
|
9
|
+
|
|
10
|
+
<ItemGroup>
|
|
11
|
+
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.71" />
|
|
12
|
+
<PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.82" />
|
|
13
|
+
</ItemGroup>
|
|
14
|
+
|
|
15
|
+
</Project>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
3
|
+
# Visual Studio Version 17
|
|
4
|
+
VisualStudioVersion = 17.11.35222.181
|
|
5
|
+
MinimumVisualStudioVersion = 10.0.40219.1
|
|
6
|
+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourceGenerator", "SourceGenerator.csproj", "{02F53956-BFF2-40E9-9E3D-EAE3A527176C}"
|
|
7
|
+
EndProject
|
|
8
|
+
Global
|
|
9
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
10
|
+
Debug|Any CPU = Debug|Any CPU
|
|
11
|
+
Release|Any CPU = Release|Any CPU
|
|
12
|
+
EndGlobalSection
|
|
13
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
14
|
+
{02F53956-BFF2-40E9-9E3D-EAE3A527176C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
15
|
+
{02F53956-BFF2-40E9-9E3D-EAE3A527176C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
16
|
+
{02F53956-BFF2-40E9-9E3D-EAE3A527176C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
17
|
+
{02F53956-BFF2-40E9-9E3D-EAE3A527176C}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
18
|
+
EndGlobalSection
|
|
19
|
+
GlobalSection(SolutionProperties) = preSolution
|
|
20
|
+
HideSolutionNode = FALSE
|
|
21
|
+
EndGlobalSection
|
|
22
|
+
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
23
|
+
SolutionGuid = {C2F69C1A-CF77-4C2D-8D05-FF00BABD2A5F}
|
|
24
|
+
EndGlobalSection
|
|
25
|
+
EndGlobal
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using System.Reflection;
|
|
5
|
+
using System.Text;
|
|
6
|
+
using System.Threading.Tasks;
|
|
7
|
+
|
|
8
|
+
namespace SourceGenerator;
|
|
9
|
+
|
|
10
|
+
internal static class TypeExtensions
|
|
11
|
+
{
|
|
12
|
+
public static string GetNamespaceName(this Type type)
|
|
13
|
+
{
|
|
14
|
+
if (type.Namespace?.Length > 0)
|
|
15
|
+
{
|
|
16
|
+
return type.Namespace + "." + type.GetJSTypeName();
|
|
17
|
+
}
|
|
18
|
+
return type.GetJSTypeName();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public static string GetJSTypeName(this Type type)
|
|
22
|
+
{
|
|
23
|
+
return type.Name.Replace("`", "_");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public static string GetJSType(this Type type, Assembly callingAssembly)
|
|
27
|
+
{
|
|
28
|
+
type = Nullable.GetUnderlyingType(type) ?? type;
|
|
29
|
+
|
|
30
|
+
if (type.IsGenericTypeDefinition)
|
|
31
|
+
{
|
|
32
|
+
return type.GetJSTypeName();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (type.IsGenericTypeParameter || type.ContainsGenericParameters)
|
|
36
|
+
{
|
|
37
|
+
return "any";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (type.IsByRef || type.IsByRefLike)
|
|
41
|
+
{
|
|
42
|
+
return "any";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if (!type.IsEnum)
|
|
47
|
+
{
|
|
48
|
+
var tc = Type.GetTypeCode(type);
|
|
49
|
+
|
|
50
|
+
switch (tc)
|
|
51
|
+
{
|
|
52
|
+
case TypeCode.Boolean:
|
|
53
|
+
return "boolean";
|
|
54
|
+
case TypeCode.Char:
|
|
55
|
+
return "string";
|
|
56
|
+
case TypeCode.SByte:
|
|
57
|
+
return "number";
|
|
58
|
+
case TypeCode.Byte:
|
|
59
|
+
return "number";
|
|
60
|
+
case TypeCode.Int16:
|
|
61
|
+
return "number";
|
|
62
|
+
case TypeCode.UInt16:
|
|
63
|
+
return "number";
|
|
64
|
+
case TypeCode.Int32:
|
|
65
|
+
return "number";
|
|
66
|
+
case TypeCode.UInt32:
|
|
67
|
+
return "number";
|
|
68
|
+
case TypeCode.Int64:
|
|
69
|
+
return "number";
|
|
70
|
+
case TypeCode.UInt64:
|
|
71
|
+
return "number";
|
|
72
|
+
case TypeCode.Single:
|
|
73
|
+
return "number";
|
|
74
|
+
case TypeCode.Double:
|
|
75
|
+
return "number";
|
|
76
|
+
case TypeCode.Decimal:
|
|
77
|
+
return "number";
|
|
78
|
+
case TypeCode.DateTime:
|
|
79
|
+
return "Date";
|
|
80
|
+
case TypeCode.String:
|
|
81
|
+
return "string";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (callingAssembly != type.Assembly)
|
|
85
|
+
{
|
|
86
|
+
return "any";
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
var name = type.GetNamespaceName();
|
|
90
|
+
name = name.Replace(".", "_");
|
|
91
|
+
return name;
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@positron-js/context",
|
|
3
|
+
"version": "1.0.9",
|
|
4
|
+
"description": "Positron Context definitions to access CLR inside a positron function",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 0",
|
|
9
|
+
"postversion": "git push --follow-tags"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"url": "https://github.com/Positron-JS/context.git"
|
|
13
|
+
},
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC"
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { INeuroSpeechPositron } from "./clr/NeuroSpeech.Positron";
|
|
2
|
+
|
|
3
|
+
export interface ICLR {
|
|
4
|
+
|
|
5
|
+
assembly<TA>(name: string): TA;
|
|
6
|
+
|
|
7
|
+
assembly(name: "NeuroSpeech.Positron"): INeuroSpeechPositron;
|
|
8
|
+
assembly(name: "Microsoft.Maui.Essentials"): import("./clr/Microsoft.Maui.Essentials").default;
|
|
9
|
+
assembly(name: "Microsoft.Maui.Graphics"): import("./clr/Microsoft.Maui.Graphics").default;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IPositronContext } from "./IPositronContext";
|
|
2
|
+
|
|
3
|
+
declare let positron;
|
|
4
|
+
|
|
5
|
+
export default class PositronInBrowser {
|
|
6
|
+
|
|
7
|
+
static isAvailable = typeof positron !== "undefined";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This method does not accept any parameters.
|
|
11
|
+
* @param fx Function to be executed in Positron App
|
|
12
|
+
*/
|
|
13
|
+
static run<T>(fx: (this: IPositronContext) => T): Promise<T>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* This method accepts parameters as an object with fields
|
|
17
|
+
* that does not contain any cyclic references. As this will
|
|
18
|
+
* be sent to Positron App as JSON.
|
|
19
|
+
* @param a Arguments object without any cyclic references.
|
|
20
|
+
* @param fx Function to be executed in Positron App.
|
|
21
|
+
*/
|
|
22
|
+
static run<P, T>(a: P, fx: (this: IPositronContext, p: P) => T): Promise<T>
|
|
23
|
+
static async run(p, fx?): Promise<any> {
|
|
24
|
+
if (typeof p === "function") {
|
|
25
|
+
return positron.run(p);
|
|
26
|
+
}
|
|
27
|
+
return positron.run(fx, p);
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|