@xwiki/cristal-sharedworker-impl 1.4.0 → 1.6.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.
@@ -0,0 +1,7 @@
1
+ import { Container } from 'inversify';
2
+ /**
3
+ * @beta
4
+ */
5
+ export default class ComponentInit {
6
+ constructor(container: Container);
7
+ }
@@ -0,0 +1,14 @@
1
+ import { QueueWorker } from '@xwiki/cristal-sharedworker-api';
2
+ import { CristalApp, Logger } from '@xwiki/platform-api';
3
+ export default class DefaultQueueWorker implements QueueWorker {
4
+ private workerInstance;
5
+ private cristalApp;
6
+ private logger;
7
+ constructor(logger: Logger, cristalApp: CristalApp);
8
+ pageLoaded(page: string): Promise<void>;
9
+ initialize(): void;
10
+ getStatus(): boolean;
11
+ increment(): Promise<number>;
12
+ addToQueue(page: string): Promise<void>;
13
+ getQueueSize(): Promise<number>;
14
+ }
@@ -0,0 +1,21 @@
1
+ import { MyWorker } from '@xwiki/cristal-sharedworker-api';
2
+ import { WikiConfig } from '@xwiki/platform-api';
3
+ export declare class Worker implements MyWorker {
4
+ private currentNumber;
5
+ private queue;
6
+ private container;
7
+ private cristal;
8
+ private configMap;
9
+ private initialized;
10
+ private fct;
11
+ start(): Promise<void>;
12
+ setPageLoadedCallback(fct: (a: string) => void): void;
13
+ sleep(ms: number): Promise<unknown>;
14
+ checkQueue(): Promise<void>;
15
+ handleQueueItem(page: string): Promise<void>;
16
+ add(a: number): number;
17
+ addToQueue(page: string): void;
18
+ getQueueSize(): number;
19
+ getWikiConfig(configName: string): WikiConfig | undefined;
20
+ initialize(): Promise<void>;
21
+ }
@@ -0,0 +1,36 @@
1
+ import { CristalApp, Logger, LoggerConfig, PageData, SkinManager, WikiConfig } from '@xwiki/platform-api';
2
+ import { Configurations } from '@xwiki/platform-configuration-api';
3
+ import { Container } from 'inversify';
4
+ import { App, Component } from 'vue';
5
+ import { Router } from 'vue-router';
6
+ export declare class WorkerCristalApp implements CristalApp {
7
+ private wikiConfig;
8
+ private container;
9
+ private availableConfigurations;
10
+ constructor();
11
+ getApp(): App;
12
+ getRouter(): Router;
13
+ getContainer(): Container;
14
+ setContainer(container: Container): void;
15
+ getWikiConfig(): WikiConfig;
16
+ setWikiConfig(wikiConfig: WikiConfig): void;
17
+ getSkinManager(): SkinManager;
18
+ switchConfig(): void;
19
+ setAvailableConfigurations(configs: Configurations): void;
20
+ getAvailableConfigurations(): Map<string, WikiConfig>;
21
+ deleteAvailableConfiguration(configName: string): void;
22
+ run(): Promise<void>;
23
+ getUIXTemplates(): Promise<Component[]>;
24
+ getMenuEntries(): string[];
25
+ getCurrentPage(): string;
26
+ getCurrentContent(): string;
27
+ getCurrentSource(): string;
28
+ getCurrentSyntax(): string;
29
+ setCurrentPage(): Promise<void>;
30
+ setContentRef(): void;
31
+ loadPageFromURL(): Promise<void>;
32
+ loadPage(): Promise<void>;
33
+ getPage(): Promise<PageData>;
34
+ getLogger(): Logger;
35
+ getLoggerConfig(): LoggerConfig;
36
+ }
@@ -0,0 +1,9 @@
1
+ import { QueueWorker } from '@xwiki/cristal-sharedworker-api';
2
+ export default class WorkerQueueWorker implements QueueWorker {
3
+ constructor();
4
+ initialize(): void;
5
+ getStatus(): boolean;
6
+ increment(): Promise<number>;
7
+ addToQueue(): Promise<void>;
8
+ getQueueSize(): Promise<number>;
9
+ }
@@ -0,0 +1,4 @@
1
+ import { default as ComponentInit } from './components/componentsInit';
2
+ import { QueueWorker } from '@xwiki/cristal-sharedworker-api';
3
+ export type { QueueWorker };
4
+ export { ComponentInit };
@@ -0,0 +1,4 @@
1
+ import { default as ComponentInit } from './components/componentsInit';
2
+ import { QueueWorker } from '@xwiki/cristal-sharedworker-api';
3
+ export type { QueueWorker };
4
+ export { ComponentInit };
@@ -0,0 +1,90 @@
1
+ import { name as d } from "@xwiki/platform-document-api";
2
+ import * as i from "comlink";
3
+ import { injectable as g, inject as c } from "inversify";
4
+ function w(e) {
5
+ return new SharedWorker(
6
+ "/assets/worker-Dv23hWY7.js",
7
+ {
8
+ type: "module",
9
+ name: e?.name
10
+ }
11
+ );
12
+ }
13
+ var h = Object.getOwnPropertyDescriptor, k = (e, r, t, n) => {
14
+ for (var o = n > 1 ? void 0 : n ? h(r, t) : r, a = e.length - 1, l; a >= 0; a--)
15
+ (l = e[a]) && (o = l(o) || o);
16
+ return o;
17
+ }, u = (e, r) => (t, n) => r(t, n, e);
18
+ let s = class {
19
+ // TODO remove use of any
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ workerInstance;
22
+ cristalApp;
23
+ logger;
24
+ constructor(e, r) {
25
+ this.initialize(), this.logger = e, this.cristalApp = r;
26
+ }
27
+ async pageLoaded(e) {
28
+ try {
29
+ this.logger.debug(
30
+ "Received callback that new document has been loaded",
31
+ e
32
+ ), await this.cristalApp.getContainer().get(d).refreshCurrentDocument(), this.logger.debug(
33
+ "Done callback that new document has been loaded",
34
+ e
35
+ );
36
+ } catch (r) {
37
+ this.logger.error("Error calling loadPage", r);
38
+ }
39
+ }
40
+ initialize() {
41
+ try {
42
+ if (this.workerInstance == null) {
43
+ const e = new w({
44
+ name: "cristal-sharedworker"
45
+ });
46
+ this.workerInstance = i.wrap(e.port);
47
+ const r = this;
48
+ this.workerInstance.setPageLoadedCallback(
49
+ i.proxy(async (t) => {
50
+ await r.pageLoaded(t);
51
+ })
52
+ ), console.debug("Worker initialized", this.workerInstance);
53
+ } else
54
+ console.debug("Already initialized");
55
+ } catch (e) {
56
+ console.error("Failed to initialize shared worker", e);
57
+ }
58
+ }
59
+ getStatus() {
60
+ return this.workerInstance != null ? (console.log("workerInstance is ready"), !0) : (console.log("workerInstance is null. Cannot call"), !1);
61
+ }
62
+ async increment() {
63
+ if (this.workerInstance == null)
64
+ return console.log("workerInstance is null. Cannot call"), -1;
65
+ {
66
+ const e = await this.workerInstance.add(1);
67
+ return console.log("Results from shared worker: ", e), e;
68
+ }
69
+ }
70
+ async addToQueue(e) {
71
+ console.log("worker Calling addToQueue", e), this.workerInstance != null ? await this.workerInstance.addToQueue(e) : console.log("workerInstance is null. Cannot call");
72
+ }
73
+ async getQueueSize() {
74
+ return console.log("worker Calling getQueueSize"), this.workerInstance == null ? -1 : await this.workerInstance.getQueueSize();
75
+ }
76
+ };
77
+ s = k([
78
+ g(),
79
+ u(0, c("Logger")),
80
+ u(1, c("CristalApp"))
81
+ ], s);
82
+ class I {
83
+ constructor(r) {
84
+ r.bind("QueueWorker").to(s);
85
+ }
86
+ }
87
+ export {
88
+ I as ComponentInit
89
+ };
90
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../src/components/defaultQueueWorker.ts","../src/components/componentsInit.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { default as Worker } from \"./worker?sharedworker\";\nimport { name as documentServiceName } from \"@xwiki/platform-document-api\";\nimport * as Comlink from \"comlink\";\nimport { inject, injectable } from \"inversify\";\nimport type { MyWorker, QueueWorker } from \"@xwiki/cristal-sharedworker-api\";\nimport type { CristalApp, Logger } from \"@xwiki/platform-api\";\nimport type { DocumentService } from \"@xwiki/platform-document-api\";\n\n@injectable()\nexport default class DefaultQueueWorker implements QueueWorker {\n // TODO remove use of any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private workerInstance: any;\n private cristalApp: CristalApp;\n private logger: Logger;\n\n public constructor(\n @inject(\"Logger\") logger: Logger,\n @inject(\"CristalApp\") cristalApp: CristalApp,\n ) {\n this.initialize();\n this.logger = logger;\n this.cristalApp = cristalApp;\n }\n\n async pageLoaded(page: string): Promise<void> {\n try {\n this.logger.debug(\n \"Received callback that new document has been loaded\",\n page,\n );\n // We need to access the DocumentService lasily as otherwise the\n // internal pinia instance is initialized too early.\n const documentService = this.cristalApp\n .getContainer()\n .get<DocumentService>(documentServiceName);\n\n await documentService.refreshCurrentDocument();\n\n this.logger.debug(\n \"Done callback that new document has been loaded\",\n page,\n );\n } catch (e) {\n this.logger.error(\"Error calling loadPage\", e);\n }\n }\n\n public initialize(): void {\n try {\n if (this.workerInstance == null) {\n // this.workerInstance = new ComlinkWorker<typeof import('./worker')>(new URL('./worker',\n // import.meta.url), {/* normal Worker options*/})\n const sworker = new Worker({\n name: \"cristal-sharedworker\",\n });\n this.workerInstance = Comlink.wrap<MyWorker>(sworker.port);\n // TODO get rid of aliasing\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n\n this.workerInstance.setPageLoadedCallback(\n Comlink.proxy(async (page: string) => {\n await that.pageLoaded(page);\n }),\n );\n\n console.debug(\"Worker initialized\", this.workerInstance);\n } else {\n console.debug(\"Already initialized\");\n }\n } catch (e) {\n console.error(\"Failed to initialize shared worker\", e);\n }\n }\n\n public getStatus(): boolean {\n if (this.workerInstance != null) {\n console.log(\"workerInstance is ready\");\n return true;\n } else {\n console.log(\"workerInstance is null. Cannot call\");\n return false;\n }\n }\n\n public async increment(): Promise<number> {\n if (this.workerInstance == null) {\n console.log(\"workerInstance is null. Cannot call\");\n return -1;\n } else {\n const result = await this.workerInstance.add(1);\n console.log(\"Results from shared worker: \", result);\n return result;\n }\n }\n\n public async addToQueue(page: string): Promise<void> {\n console.log(\"worker Calling addToQueue\", page);\n if (this.workerInstance != null) {\n await this.workerInstance.addToQueue(page);\n } else {\n console.log(\"workerInstance is null. Cannot call\");\n }\n }\n\n public async getQueueSize(): Promise<number> {\n console.log(\"worker Calling getQueueSize\");\n if (this.workerInstance == null) {\n return -1;\n } else {\n return await this.workerInstance.getQueueSize();\n }\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport DefaultQueueWorker from \"./defaultQueueWorker\";\nimport type { QueueWorker } from \"@xwiki/cristal-sharedworker-api\";\nimport type { Container } from \"inversify\";\n\n/**\n * @beta\n */\nexport default class ComponentInit {\n constructor(container: Container) {\n container.bind<QueueWorker>(\"QueueWorker\").to(DefaultQueueWorker);\n }\n}\n"],"names":["DefaultQueueWorker","logger","cristalApp","page","documentServiceName","e","sworker","Worker","Comlink","that","result","__decorateClass","injectable","__decorateParam","ComponentInit","container"],"mappings":";;;;;;;;;;;;;;;;;AA6BA,IAAqBA,IAArB,MAA+D;AAAA;AAAA;AAAA,EAGrD;AAAA,EACA;AAAA,EACA;AAAA,EAED,YACaC,GACIC,GACtB;AACA,SAAK,WAAA,GACL,KAAK,SAASD,GACd,KAAK,aAAaC;AAAA,EACpB;AAAA,EAEA,MAAM,WAAWC,GAA6B;AAC5C,QAAI;AACF,WAAK,OAAO;AAAA,QACV;AAAA,QACAA;AAAA,MAAA,GAQF,MAJwB,KAAK,WAC1B,aAAA,EACA,IAAqBC,CAAmB,EAErB,uBAAA,GAEtB,KAAK,OAAO;AAAA,QACV;AAAA,QACAD;AAAA,M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A;AAAA,EADCC,EAAA;AAAA,EASIC,OAAO,QAAQ,CAAA;AAAA,EACfA,OAAO,YAAY,CAAA;AAAA,GATHb,CAAA;ACFrB,MAAqBc,EAAc;AAAA,EACjC,YAAYC,GAAsB;AAChC,IAAAA,EAAU,KAAkB,aAAa,EAAE,GAAGf,CAAkB;AAAA,EAClE;AACF;"}
@@ -0,0 +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-Dv23hWY7.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
+ //# sourceMappingURL=index.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.umd.js","sources":["../src/components/defaultQueueWorker.ts","../src/components/componentsInit.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { default as Worker } from \"./worker?sharedworker\";\nimport { name as documentServiceName } from \"@xwiki/platform-document-api\";\nimport * as Comlink from \"comlink\";\nimport { inject, injectable } from \"inversify\";\nimport type { MyWorker, QueueWorker } from \"@xwiki/cristal-sharedworker-api\";\nimport type { CristalApp, Logger } from \"@xwiki/platform-api\";\nimport type { DocumentService } from \"@xwiki/platform-document-api\";\n\n@injectable()\nexport default class DefaultQueueWorker implements QueueWorker {\n // TODO remove use of any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private workerInstance: any;\n private cristalApp: CristalApp;\n private logger: Logger;\n\n public constructor(\n @inject(\"Logger\") logger: Logger,\n @inject(\"CristalApp\") cristalApp: CristalApp,\n ) {\n this.initialize();\n this.logger = logger;\n this.cristalApp = cristalApp;\n }\n\n async pageLoaded(page: string): Promise<void> {\n try {\n this.logger.debug(\n \"Received callback that new document has been loaded\",\n page,\n );\n // We need to access the DocumentService lasily as otherwise the\n // internal pinia instance is initialized too early.\n const documentService = this.cristalApp\n .getContainer()\n .get<DocumentService>(documentServiceName);\n\n await documentService.refreshCurrentDocument();\n\n this.logger.debug(\n \"Done callback that new document has been loaded\",\n page,\n );\n } catch (e) {\n this.logger.error(\"Error calling loadPage\", e);\n }\n }\n\n public initialize(): void {\n try {\n if (this.workerInstance == null) {\n // this.workerInstance = new ComlinkWorker<typeof import('./worker')>(new URL('./worker',\n // import.meta.url), {/* normal Worker options*/})\n const sworker = new Worker({\n name: \"cristal-sharedworker\",\n });\n this.workerInstance = Comlink.wrap<MyWorker>(sworker.port);\n // TODO get rid of aliasing\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n\n this.workerInstance.setPageLoadedCallback(\n Comlink.proxy(async (page: string) => {\n await that.pageLoaded(page);\n }),\n );\n\n console.debug(\"Worker initialized\", this.workerInstance);\n } else {\n console.debug(\"Already initialized\");\n }\n } catch (e) {\n console.error(\"Failed to initialize shared worker\", e);\n }\n }\n\n public getStatus(): boolean {\n if (this.workerInstance != null) {\n console.log(\"workerInstance is ready\");\n return true;\n } else {\n console.log(\"workerInstance is null. Cannot call\");\n return false;\n }\n }\n\n public async increment(): Promise<number> {\n if (this.workerInstance == null) {\n console.log(\"workerInstance is null. Cannot call\");\n return -1;\n } else {\n const result = await this.workerInstance.add(1);\n console.log(\"Results from shared worker: \", result);\n return result;\n }\n }\n\n public async addToQueue(page: string): Promise<void> {\n console.log(\"worker Calling addToQueue\", page);\n if (this.workerInstance != null) {\n await this.workerInstance.addToQueue(page);\n } else {\n console.log(\"workerInstance is null. Cannot call\");\n }\n }\n\n public async getQueueSize(): Promise<number> {\n console.log(\"worker Calling getQueueSize\");\n if (this.workerInstance == null) {\n return -1;\n } else {\n return await this.workerInstance.getQueueSize();\n }\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport DefaultQueueWorker from \"./defaultQueueWorker\";\nimport type { QueueWorker } from \"@xwiki/cristal-sharedworker-api\";\nimport type { Container } from \"inversify\";\n\n/**\n * @beta\n */\nexport default class ComponentInit {\n constructor(container: Container) {\n container.bind<QueueWorker>(\"QueueWorker\").to(DefaultQueueWorker);\n }\n}\n"],"names":["DefaultQueueWorker","logger","cristalApp","page","documentServiceName","e","sworker","Worker","Comlink","that","result","__decorateClass","injectable","__decorateParam","ComponentInit","container"],"mappings":"47BA6BA,IAAqBA,EAArB,KAA+D,CAGrD,eACA,WACA,OAED,YACaC,EACIC,EACtB,CACA,KAAK,WAAA,EACL,KAAK,OAASD,EACd,KAAK,WAAaC,CACpB,CAEA,MAAM,WAAWC,EAA6B,CAC5C,GAAI,CACF,KAAK,OAAO,MACV,sDACAA,CAAA,EAQF,MAJwB,KAAK,WAC1B,aAAA,EACA,IAAqBC,MAAmB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MAAqBc,CAAc,CACjC,YAAYC,EAAsB,CAChCA,EAAU,KAAkB,aAAa,EAAE,GAAGf,CAAkB,CAClE,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xwiki/cristal-sharedworker-impl",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "license": "LGPL 2.1",
5
5
  "author": "XWiki Org Community <contact@xwiki.org>",
6
6
  "homepage": "https://cristal.xwiki.org/",
@@ -28,20 +28,20 @@
28
28
  "main": "./dist/index.es.js",
29
29
  "types": "./dist/index.d.ts",
30
30
  "dependencies": {
31
- "@xwiki/platform-api": "18.4.0",
32
- "@xwiki/platform-configuration-api": "18.4.0",
33
- "@xwiki/platform-document-api": "18.4.0",
31
+ "@xwiki/platform-api": "18.6.0",
32
+ "@xwiki/platform-configuration-api": "18.6.0",
33
+ "@xwiki/platform-document-api": "18.6.0",
34
34
  "comlink": "4.4.2",
35
35
  "reflect-metadata": "0.2.2",
36
- "@xwiki/cristal-alerts-default": "1.4.0",
37
- "@xwiki/cristal-backend-dexie": "1.4.0",
38
- "@xwiki/cristal-authentication-default": "1.4.0",
39
- "@xwiki/cristal-backend-github": "1.4.0",
40
- "@xwiki/cristal-backend-nextcloud": "1.4.0",
41
- "@xwiki/cristal-configuration-web": "1.4.0",
42
- "@xwiki/cristal-extension-manager": "1.4.0",
43
- "@xwiki/cristal-backend-xwiki": "1.4.0",
44
- "@xwiki/cristal-sharedworker-api": "1.4.0"
36
+ "@xwiki/cristal-alerts-default": "1.6.0",
37
+ "@xwiki/cristal-backend-github": "1.6.0",
38
+ "@xwiki/cristal-authentication-default": "1.6.0",
39
+ "@xwiki/cristal-backend-nextcloud": "1.6.0",
40
+ "@xwiki/cristal-backend-dexie": "1.6.0",
41
+ "@xwiki/cristal-backend-xwiki": "1.6.0",
42
+ "@xwiki/cristal-configuration-web": "1.6.0",
43
+ "@xwiki/cristal-extension-manager": "1.6.0",
44
+ "@xwiki/cristal-sharedworker-api": "1.6.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "inversify": "8.x",
@@ -51,12 +51,14 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/sharedworker": "0.0.223",
54
- "inversify": "8.1.0",
54
+ "@xwiki/platform-tool-apiextractorconfig": "18.6.0",
55
+ "@xwiki/platform-tool-tsconfig": "18.6.0",
56
+ "inversify": "8.1.1",
55
57
  "typescript": "5.9.3",
56
- "vite": "7.3.2",
58
+ "vite": "7.3.5",
59
+ "vue": "3.5.38",
57
60
  "vue-router": "5.0.3",
58
- "vue": "3.5.30",
59
- "@xwiki/cristal-dev-config": "1.4.0"
61
+ "@xwiki/cristal-dev-config": "1.6.0"
60
62
  },
61
63
  "scripts": {
62
64
  "api-extractor:local": "api-extractor run --local",
package/tsconfig.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "@types/sharedworker"
9
9
  ]
10
10
  },
11
- "extends": "./../../tsconfig.json",
11
+ "extends": "@xwiki/platform-tool-tsconfig/tsconfig.json",
12
12
  "include": [
13
13
  "./src/index.ts",
14
14
  "./src/**/*"