@xwiki/cristal-sharedworker-impl 1.1.0 → 1.2.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/dist/index.es.js CHANGED
@@ -3,7 +3,7 @@ import * as i from "comlink";
3
3
  import { injectable as g, inject as c } from "inversify";
4
4
  function w(e) {
5
5
  return new SharedWorker(
6
- "/assets/worker-D7QAxgKq.js",
6
+ "/assets/worker-jC4O7JRI.js",
7
7
  {
8
8
  type: "module",
9
9
  name: e?.name
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@xwiki/platform-document-api"),require("comlink"),require("inversify")):typeof define=="function"&&define.amd?define(["exports","@xwiki/platform-document-api","comlink","inversify"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.cristal_impl={},n.platformDocumentApi,n.Comlink,n.inversify))})(this,(function(n,a,p,s){"use strict";function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const u=w(p);function f(e){return new SharedWorker("/assets/worker-D7QAxgKq.js",{type:"module",name:e?.name})}var k=Object.getOwnPropertyDescriptor,h=(e,t,r,o)=>{for(var i=o>1?void 0:o?k(t,r):t,c=e.length-1,g;c>=0;c--)(g=e[c])&&(i=g(i)||i);return i},d=(e,t)=>(r,o)=>t(r,o,e);let l=class{workerInstance;cristalApp;logger;constructor(e,t){this.initialize(),this.logger=e,this.cristalApp=t}async pageLoaded(e){try{this.logger.debug("Received callback that new document has been loaded",e),await this.cristalApp.getContainer().get(a.name).refreshCurrentDocument(),this.logger.debug("Done callback that new document has been loaded",e)}catch(t){this.logger.error("Error calling loadPage",t)}}initialize(){try{if(this.workerInstance==null){const e=new f({name:"cristal-sharedworker"});this.workerInstance=u.wrap(e.port);const t=this;this.workerInstance.setPageLoadedCallback(u.proxy(async r=>{await t.pageLoaded(r)})),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=h([s.injectable(),d(0,s.inject("Logger")),d(1,s.inject("CristalApp"))],l);class m{constructor(t){t.bind("QueueWorker").to(l)}}n.ComponentInit=m,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@xwiki/platform-document-api"),require("comlink"),require("inversify")):typeof define=="function"&&define.amd?define(["exports","@xwiki/platform-document-api","comlink","inversify"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.cristal_impl={},n.platformDocumentApi,n.Comlink,n.inversify))})(this,(function(n,a,p,s){"use strict";function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const u=w(p);function f(e){return new SharedWorker("/assets/worker-jC4O7JRI.js",{type:"module",name:e?.name})}var k=Object.getOwnPropertyDescriptor,h=(e,t,r,o)=>{for(var i=o>1?void 0:o?k(t,r):t,c=e.length-1,g;c>=0;c--)(g=e[c])&&(i=g(i)||i);return i},d=(e,t)=>(r,o)=>t(r,o,e);let l=class{workerInstance;cristalApp;logger;constructor(e,t){this.initialize(),this.logger=e,this.cristalApp=t}async pageLoaded(e){try{this.logger.debug("Received callback that new document has been loaded",e),await this.cristalApp.getContainer().get(a.name).refreshCurrentDocument(),this.logger.debug("Done callback that new document has been loaded",e)}catch(t){this.logger.error("Error calling loadPage",t)}}initialize(){try{if(this.workerInstance==null){const e=new f({name:"cristal-sharedworker"});this.workerInstance=u.wrap(e.port);const t=this;this.workerInstance.setPageLoadedCallback(u.proxy(async r=>{await t.pageLoaded(r)})),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=h([s.injectable(),d(0,s.inject("Logger")),d(1,s.inject("CristalApp"))],l);class m{constructor(t){t.bind("QueueWorker").to(l)}}n.ComponentInit=m,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": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "license": "LGPL 2.1",
5
5
  "author": "XWiki Org Community <contact@xwiki.org>",
6
6
  "homepage": "https://cristal.xwiki.org/",
@@ -28,35 +28,35 @@
28
28
  "main": "./dist/index.es.js",
29
29
  "types": "./dist/index.d.ts",
30
30
  "dependencies": {
31
- "@xwiki/platform-api": "18.1.0",
32
- "@xwiki/platform-configuration-api": "18.1.0",
33
- "@xwiki/platform-document-api": "18.1.0",
31
+ "@xwiki/platform-api": "18.2.0",
32
+ "@xwiki/platform-configuration-api": "18.2.0",
33
+ "@xwiki/platform-document-api": "18.2.0",
34
34
  "comlink": "4.4.2",
35
35
  "reflect-metadata": "0.2.2",
36
- "@xwiki/cristal-alerts-default": "1.1.0",
37
- "@xwiki/cristal-authentication-default": "1.1.0",
38
- "@xwiki/cristal-backend-nextcloud": "1.1.0",
39
- "@xwiki/cristal-backend-dexie": "1.1.0",
40
- "@xwiki/cristal-backend-github": "1.1.0",
41
- "@xwiki/cristal-configuration-web": "1.1.0",
42
- "@xwiki/cristal-backend-xwiki": "1.1.0",
43
- "@xwiki/cristal-extension-manager": "1.1.0",
44
- "@xwiki/cristal-sharedworker-api": "1.1.0"
36
+ "@xwiki/cristal-alerts-default": "1.2.0",
37
+ "@xwiki/cristal-backend-nextcloud": "1.2.0",
38
+ "@xwiki/cristal-backend-dexie": "1.2.0",
39
+ "@xwiki/cristal-extension-manager": "1.2.0",
40
+ "@xwiki/cristal-backend-xwiki": "1.2.0",
41
+ "@xwiki/cristal-authentication-default": "1.2.0",
42
+ "@xwiki/cristal-backend-github": "1.2.0",
43
+ "@xwiki/cristal-configuration-web": "1.2.0",
44
+ "@xwiki/cristal-sharedworker-api": "1.2.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "inversify": "7.x",
48
48
  "reflect-metadata": "0.x",
49
49
  "vue": "3.x",
50
- "vue-router": "4.x"
50
+ "vue-router": "5.x"
51
51
  },
52
52
  "devDependencies": {
53
- "@types/sharedworker": "0.0.216",
53
+ "@types/sharedworker": "0.0.223",
54
54
  "inversify": "7.11.0",
55
55
  "typescript": "5.9.3",
56
56
  "vite": "7.3.1",
57
- "vue-router": "4.6.4",
58
- "vue": "3.5.28",
59
- "@xwiki/cristal-dev-config": "1.1.0"
57
+ "vue-router": "5.0.3",
58
+ "vue": "3.5.30",
59
+ "@xwiki/cristal-dev-config": "1.2.0"
60
60
  },
61
61
  "scripts": {
62
62
  "api-extractor:local": "api-extractor run --local",