@xwiki/cristal-sharedworker-impl 0.14.0 → 0.15.0
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/CHANGELOG.md +23 -0
- package/dist/assets/worker-CVVf8kUK.js +11682 -0
- package/dist/assets/worker-CVVf8kUK.js.map +1 -0
- package/dist/components/workerCristalApp.d.ts +1 -1
- package/dist/index.es.js +13 -13
- package/dist/index.umd.js +1 -1
- package/package.json +17 -16
- package/src/components/worker.ts +2 -0
- package/src/components/workerCristalApp.ts +1 -1
- package/dist/assets/worker-BhIfpacL.js +0 -9530
- package/dist/assets/worker-BhIfpacL.js.map +0 -1
|
@@ -19,7 +19,7 @@ export declare class WorkerCristalApp implements CristalApp {
|
|
|
19
19
|
setAvailableConfigurations(configs: Configurations): void;
|
|
20
20
|
getAvailableConfigurations(): Map<string, WikiConfig>;
|
|
21
21
|
run(): Promise<void>;
|
|
22
|
-
getUIXTemplates(): Component[]
|
|
22
|
+
getUIXTemplates(): Promise<Component[]>;
|
|
23
23
|
getMenuEntries(): string[];
|
|
24
24
|
getCurrentPage(): string;
|
|
25
25
|
getCurrentContent(): string;
|
package/dist/index.es.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { name as d } from "@xwiki/cristal-document-api";
|
|
2
2
|
import * as i from "comlink";
|
|
3
|
-
import { injectable as
|
|
4
|
-
function
|
|
3
|
+
import { injectable as g, inject as c } from "inversify";
|
|
4
|
+
function h(e) {
|
|
5
5
|
return new SharedWorker(
|
|
6
|
-
"/assets/worker-
|
|
6
|
+
"/assets/worker-CVVf8kUK.js",
|
|
7
7
|
{
|
|
8
8
|
type: "module",
|
|
9
9
|
name: e == null ? void 0 : e.name
|
|
10
10
|
}
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
var w = Object.defineProperty, k = Object.getOwnPropertyDescriptor,
|
|
14
|
-
for (var
|
|
15
|
-
(s = e[a]) && (
|
|
16
|
-
return o &&
|
|
17
|
-
}, u = (e, r) => (
|
|
13
|
+
var w = Object.defineProperty, k = Object.getOwnPropertyDescriptor, f = (e, r, n, o) => {
|
|
14
|
+
for (var t = o > 1 ? void 0 : o ? k(r, n) : r, a = e.length - 1, s; a >= 0; a--)
|
|
15
|
+
(s = e[a]) && (t = (o ? s(r, n, t) : s(t)) || t);
|
|
16
|
+
return o && t && w(r, n, t), t;
|
|
17
|
+
}, u = (e, r) => (n, o) => r(n, o, e);
|
|
18
18
|
let l = class {
|
|
19
19
|
constructor(e, r) {
|
|
20
20
|
this.initialize(), this.logger = e, this.cristalApp = r;
|
|
@@ -35,14 +35,14 @@ let l = class {
|
|
|
35
35
|
initialize() {
|
|
36
36
|
try {
|
|
37
37
|
if (this.workerInstance == null) {
|
|
38
|
-
const e = new
|
|
38
|
+
const e = new h({
|
|
39
39
|
name: "cristal-sharedworker"
|
|
40
40
|
});
|
|
41
41
|
this.workerInstance = i.wrap(e.port);
|
|
42
42
|
const r = this;
|
|
43
43
|
this.workerInstance.setPageLoadedCallback(
|
|
44
|
-
i.proxy(function(
|
|
45
|
-
r.pageLoaded(
|
|
44
|
+
i.proxy(function(n) {
|
|
45
|
+
r.pageLoaded(n);
|
|
46
46
|
})
|
|
47
47
|
), console.debug("Worker initialized", this.workerInstance);
|
|
48
48
|
} else
|
|
@@ -69,8 +69,8 @@ let l = class {
|
|
|
69
69
|
return console.log("worker Calling getQueueSize"), this.workerInstance == null ? -1 : await this.workerInstance.getQueueSize();
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
l =
|
|
73
|
-
|
|
72
|
+
l = f([
|
|
73
|
+
g(),
|
|
74
74
|
u(0, c("Logger")),
|
|
75
75
|
u(1, c("CristalApp"))
|
|
76
76
|
], l);
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@xwiki/cristal-document-api"),require("comlink"),require("inversify")):typeof define=="function"&&define.amd?define(["exports","@xwiki/cristal-document-api","comlink","inversify"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.cristal_impl={},n.cristalDocumentApi,n.Comlink,n.inversify))})(this,function(n,a,g,s){"use strict";function h(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const d=h(g);function w(e){return new SharedWorker("/assets/worker-
|
|
1
|
+
(function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@xwiki/cristal-document-api"),require("comlink"),require("inversify")):typeof define=="function"&&define.amd?define(["exports","@xwiki/cristal-document-api","comlink","inversify"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.cristal_impl={},n.cristalDocumentApi,n.Comlink,n.inversify))})(this,function(n,a,g,s){"use strict";function h(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const d=h(g);function w(e){return new SharedWorker("/assets/worker-CVVf8kUK.js",{type:"module",name:e==null?void 0:e.name})}var k=Object.defineProperty,p=Object.getOwnPropertyDescriptor,m=(e,r,t,o)=>{for(var i=o>1?void 0:o?p(r,t):r,c=e.length-1,u;c>=0;c--)(u=e[c])&&(i=(o?u(r,t,i):u(i))||i);return o&&i&&k(r,t,i),i},f=(e,r)=>(t,o)=>r(t,o,e);let l=class{constructor(e,r){this.initialize(),this.logger=e,this.cristalApp=r}pageLoaded(e){try{this.logger.debug("Received callback that new document has been loaded",e),this.cristalApp.getContainer().get(a.name).refreshCurrentDocument(),this.logger.debug("Done callback that new document has been loaded",e)}catch(r){this.logger.error("Error calling loadPage",r)}}initialize(){try{if(this.workerInstance==null){const e=new w({name:"cristal-sharedworker"});this.workerInstance=d.wrap(e.port);const r=this;this.workerInstance.setPageLoadedCallback(d.proxy(function(t){r.pageLoaded(t)})),console.debug("Worker initialized",this.workerInstance)}else console.debug("Already initialized")}catch(e){console.error("Failed to initialize shared worker",e)}}getStatus(){return this.workerInstance!=null?(console.log("workerInstance is ready"),!0):(console.log("workerInstance is null. Cannot call"),!1)}async increment(){if(this.workerInstance==null)return console.log("workerInstance is null. Cannot call"),-1;{const e=await this.workerInstance.add(1);return console.log("Results from shared worker: ",e),e}}async addToQueue(e){console.log("worker Calling addToQueue",e),this.workerInstance!=null?await this.workerInstance.addToQueue(e):console.log("workerInstance is null. Cannot call")}async getQueueSize(){return console.log("worker Calling getQueueSize"),this.workerInstance==null?-1:await this.workerInstance.getQueueSize()}};l=m([s.injectable(),f(0,s.inject("Logger")),f(1,s.inject("CristalApp"))],l);class b{constructor(r){r.bind("QueueWorker").to(l)}}n.ComponentInit=b,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xwiki/cristal-sharedworker-impl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"license": "LGPL 2.1",
|
|
5
5
|
"author": "XWiki Org Community <contact@xwiki.org>",
|
|
6
6
|
"homepage": "https://cristal.xwiki.org/",
|
|
@@ -24,29 +24,30 @@
|
|
|
24
24
|
"types": "./dist/index.d.ts",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"comlink": "4.4.2",
|
|
27
|
-
"inversify": "6.2.
|
|
27
|
+
"inversify": "6.2.2",
|
|
28
28
|
"reflect-metadata": "0.2.2",
|
|
29
29
|
"vue": "3.5.13",
|
|
30
30
|
"vue-router": "4.5.0",
|
|
31
|
-
"@xwiki/cristal-alerts-default": "0.
|
|
32
|
-
"@xwiki/cristal-
|
|
33
|
-
"@xwiki/cristal-
|
|
34
|
-
"@xwiki/cristal-
|
|
35
|
-
"@xwiki/cristal-backend-
|
|
36
|
-
"@xwiki/cristal-
|
|
37
|
-
"@xwiki/cristal-backend-xwiki": "0.
|
|
38
|
-
"@xwiki/cristal-configuration-
|
|
39
|
-
"@xwiki/cristal-
|
|
40
|
-
"@xwiki/cristal-
|
|
41
|
-
"@xwiki/cristal-
|
|
42
|
-
"@xwiki/cristal-
|
|
31
|
+
"@xwiki/cristal-alerts-default": "0.15.0",
|
|
32
|
+
"@xwiki/cristal-authentication-default": "0.15.0",
|
|
33
|
+
"@xwiki/cristal-api": "0.15.0",
|
|
34
|
+
"@xwiki/cristal-backend-dexie": "0.15.0",
|
|
35
|
+
"@xwiki/cristal-backend-github": "0.15.0",
|
|
36
|
+
"@xwiki/cristal-backend-nextcloud": "0.15.0",
|
|
37
|
+
"@xwiki/cristal-backend-xwiki": "0.15.0",
|
|
38
|
+
"@xwiki/cristal-configuration-api": "0.15.0",
|
|
39
|
+
"@xwiki/cristal-document-api": "0.15.0",
|
|
40
|
+
"@xwiki/cristal-configuration-web": "0.15.0",
|
|
41
|
+
"@xwiki/cristal-extension-manager": "0.15.0",
|
|
42
|
+
"@xwiki/cristal-configuration-electron-renderer": "0.15.0",
|
|
43
|
+
"@xwiki/cristal-sharedworker-api": "0.15.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"typescript": "5.7.3",
|
|
46
|
-
"vite": "6.0
|
|
47
|
+
"vite": "6.1.0",
|
|
47
48
|
"vite-plugin-comlink": "5.1.0",
|
|
48
49
|
"vue-tsc": "2.2.0",
|
|
49
|
-
"@xwiki/cristal-dev-config": "0.
|
|
50
|
+
"@xwiki/cristal-dev-config": "0.15.0"
|
|
50
51
|
},
|
|
51
52
|
"scripts": {
|
|
52
53
|
"build": "pnpm compile",
|
package/src/components/worker.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { ComponentInit as AlertsDefaultComponentInit } from "@xwiki/cristal-aler
|
|
|
25
25
|
import { CristalApp, WrappingStorage } from "@xwiki/cristal-api";
|
|
26
26
|
import { ComponentInit as AuthenticationDefaultComponentInit } from "@xwiki/cristal-authentication-default";
|
|
27
27
|
import { ComponentInit as DexieBackendComponentInit } from "@xwiki/cristal-backend-dexie";
|
|
28
|
+
import { ComponentInit as GithubBackendComponentInit } from "@xwiki/cristal-backend-github";
|
|
28
29
|
import { ComponentInit as NextcloudBackendComponentInit } from "@xwiki/cristal-backend-nextcloud";
|
|
29
30
|
import { ComponentInit as XWikiBackendComponentInit } from "@xwiki/cristal-backend-xwiki";
|
|
30
31
|
import {
|
|
@@ -256,6 +257,7 @@ export class Worker implements MyWorker {
|
|
|
256
257
|
// TODO: find a way to do this loading differently. Here we need to
|
|
257
258
|
// explicitly depend on all required storage and this is not good.
|
|
258
259
|
new DexieBackendComponentInit(cristalLoader.container);
|
|
260
|
+
new GithubBackendComponentInit(cristalLoader.container);
|
|
259
261
|
new NextcloudBackendComponentInit(cristalLoader.container);
|
|
260
262
|
new XWikiBackendComponentInit(cristalLoader.container);
|
|
261
263
|
new AuthenticationDefaultComponentInit(cristalLoader.container);
|
|
@@ -100,7 +100,7 @@ export class WorkerCristalApp implements CristalApp {
|
|
|
100
100
|
throw new Error("Method not implemented.");
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
getUIXTemplates(): Component[] {
|
|
103
|
+
getUIXTemplates(): Promise<Component[]> {
|
|
104
104
|
throw new Error("Method not implemented.");
|
|
105
105
|
}
|
|
106
106
|
|