@xwiki/cristal-sharedworker-impl 1.0.0 → 1.1.0-rc-1

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-eCtrZdjN.js",
6
+ "/assets/worker-D7QAxgKq.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-eCtrZdjN.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-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"})}));
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.0.0",
3
+ "version": "1.1.0-rc-1",
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.0.0",
32
- "@xwiki/platform-configuration-api": "18.0.0",
33
- "@xwiki/platform-document-api": "18.0.0",
31
+ "@xwiki/platform-api": "18.1.0-rc-1",
32
+ "@xwiki/platform-configuration-api": "18.1.0-rc-1",
33
+ "@xwiki/platform-document-api": "18.1.0-rc-1",
34
34
  "comlink": "4.4.2",
35
35
  "reflect-metadata": "0.2.2",
36
- "@xwiki/cristal-alerts-default": "1.0.0",
37
- "@xwiki/cristal-backend-dexie": "1.0.0",
38
- "@xwiki/cristal-authentication-default": "1.0.0",
39
- "@xwiki/cristal-backend-github": "1.0.0",
40
- "@xwiki/cristal-backend-nextcloud": "1.0.0",
41
- "@xwiki/cristal-backend-xwiki": "1.0.0",
42
- "@xwiki/cristal-configuration-web": "1.0.0",
43
- "@xwiki/cristal-extension-manager": "1.0.0",
44
- "@xwiki/cristal-sharedworker-api": "1.0.0"
36
+ "@xwiki/cristal-alerts-default": "1.1.0-rc-1",
37
+ "@xwiki/cristal-authentication-default": "1.1.0-rc-1",
38
+ "@xwiki/cristal-backend-dexie": "1.1.0-rc-1",
39
+ "@xwiki/cristal-backend-github": "1.1.0-rc-1",
40
+ "@xwiki/cristal-backend-nextcloud": "1.1.0-rc-1",
41
+ "@xwiki/cristal-backend-xwiki": "1.1.0-rc-1",
42
+ "@xwiki/cristal-configuration-web": "1.1.0-rc-1",
43
+ "@xwiki/cristal-extension-manager": "1.1.0-rc-1",
44
+ "@xwiki/cristal-sharedworker-api": "1.1.0-rc-1"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "inversify": "7.x",
@@ -50,13 +50,13 @@
50
50
  "vue-router": "4.x"
51
51
  },
52
52
  "devDependencies": {
53
- "@types/sharedworker": "0.0.204",
53
+ "@types/sharedworker": "0.0.216",
54
54
  "inversify": "7.11.0",
55
55
  "typescript": "5.9.3",
56
56
  "vite": "7.3.1",
57
57
  "vue-router": "4.6.4",
58
- "vue": "3.5.26",
59
- "@xwiki/cristal-dev-config": "1.0.0"
58
+ "vue": "3.5.28",
59
+ "@xwiki/cristal-dev-config": "1.1.0-rc-1"
60
60
  },
61
61
  "scripts": {
62
62
  "api-extractor:local": "api-extractor run --local",
@@ -0,0 +1,246 @@
1
+ {
2
+ "metadata": {
3
+ "toolPackage": "@microsoft/api-extractor",
4
+ "toolVersion": "7.56.3",
5
+ "schemaVersion": 1011,
6
+ "oldestForwardsCompatibleVersion": 1001,
7
+ "tsdocConfig": {
8
+ "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
9
+ "noStandardTags": true,
10
+ "tagDefinitions": [
11
+ {
12
+ "tagName": "@alpha",
13
+ "syntaxKind": "modifier"
14
+ },
15
+ {
16
+ "tagName": "@beta",
17
+ "syntaxKind": "modifier"
18
+ },
19
+ {
20
+ "tagName": "@defaultValue",
21
+ "syntaxKind": "block"
22
+ },
23
+ {
24
+ "tagName": "@decorator",
25
+ "syntaxKind": "block",
26
+ "allowMultiple": true
27
+ },
28
+ {
29
+ "tagName": "@deprecated",
30
+ "syntaxKind": "block"
31
+ },
32
+ {
33
+ "tagName": "@eventProperty",
34
+ "syntaxKind": "modifier"
35
+ },
36
+ {
37
+ "tagName": "@example",
38
+ "syntaxKind": "block",
39
+ "allowMultiple": true
40
+ },
41
+ {
42
+ "tagName": "@experimental",
43
+ "syntaxKind": "modifier"
44
+ },
45
+ {
46
+ "tagName": "@inheritDoc",
47
+ "syntaxKind": "inline"
48
+ },
49
+ {
50
+ "tagName": "@internal",
51
+ "syntaxKind": "modifier"
52
+ },
53
+ {
54
+ "tagName": "@label",
55
+ "syntaxKind": "inline"
56
+ },
57
+ {
58
+ "tagName": "@link",
59
+ "syntaxKind": "inline",
60
+ "allowMultiple": true
61
+ },
62
+ {
63
+ "tagName": "@override",
64
+ "syntaxKind": "modifier"
65
+ },
66
+ {
67
+ "tagName": "@packageDocumentation",
68
+ "syntaxKind": "modifier"
69
+ },
70
+ {
71
+ "tagName": "@param",
72
+ "syntaxKind": "block",
73
+ "allowMultiple": true
74
+ },
75
+ {
76
+ "tagName": "@privateRemarks",
77
+ "syntaxKind": "block"
78
+ },
79
+ {
80
+ "tagName": "@public",
81
+ "syntaxKind": "modifier"
82
+ },
83
+ {
84
+ "tagName": "@readonly",
85
+ "syntaxKind": "modifier"
86
+ },
87
+ {
88
+ "tagName": "@remarks",
89
+ "syntaxKind": "block"
90
+ },
91
+ {
92
+ "tagName": "@returns",
93
+ "syntaxKind": "block"
94
+ },
95
+ {
96
+ "tagName": "@sealed",
97
+ "syntaxKind": "modifier"
98
+ },
99
+ {
100
+ "tagName": "@see",
101
+ "syntaxKind": "block"
102
+ },
103
+ {
104
+ "tagName": "@throws",
105
+ "syntaxKind": "block",
106
+ "allowMultiple": true
107
+ },
108
+ {
109
+ "tagName": "@typeParam",
110
+ "syntaxKind": "block",
111
+ "allowMultiple": true
112
+ },
113
+ {
114
+ "tagName": "@virtual",
115
+ "syntaxKind": "modifier"
116
+ },
117
+ {
118
+ "tagName": "@jsx",
119
+ "syntaxKind": "block"
120
+ },
121
+ {
122
+ "tagName": "@jsxRuntime",
123
+ "syntaxKind": "block"
124
+ },
125
+ {
126
+ "tagName": "@jsxFrag",
127
+ "syntaxKind": "block"
128
+ },
129
+ {
130
+ "tagName": "@jsxImportSource",
131
+ "syntaxKind": "block"
132
+ },
133
+ {
134
+ "tagName": "@betaDocumentation",
135
+ "syntaxKind": "modifier"
136
+ },
137
+ {
138
+ "tagName": "@internalRemarks",
139
+ "syntaxKind": "block"
140
+ },
141
+ {
142
+ "tagName": "@preapproved",
143
+ "syntaxKind": "modifier"
144
+ }
145
+ ],
146
+ "supportForTags": {
147
+ "@alpha": true,
148
+ "@beta": true,
149
+ "@defaultValue": true,
150
+ "@decorator": true,
151
+ "@deprecated": true,
152
+ "@eventProperty": true,
153
+ "@example": true,
154
+ "@experimental": true,
155
+ "@inheritDoc": true,
156
+ "@internal": true,
157
+ "@label": true,
158
+ "@link": true,
159
+ "@override": true,
160
+ "@packageDocumentation": true,
161
+ "@param": true,
162
+ "@privateRemarks": true,
163
+ "@public": true,
164
+ "@readonly": true,
165
+ "@remarks": true,
166
+ "@returns": true,
167
+ "@sealed": true,
168
+ "@see": true,
169
+ "@throws": true,
170
+ "@typeParam": true,
171
+ "@virtual": true,
172
+ "@betaDocumentation": true,
173
+ "@internalRemarks": true,
174
+ "@preapproved": true
175
+ },
176
+ "reportUnsupportedHtmlElements": false
177
+ }
178
+ },
179
+ "kind": "Package",
180
+ "canonicalReference": "@xwiki/cristal-sharedworker-impl!",
181
+ "docComment": "",
182
+ "name": "@xwiki/cristal-sharedworker-impl",
183
+ "preserveMemberOrder": false,
184
+ "members": [
185
+ {
186
+ "kind": "EntryPoint",
187
+ "canonicalReference": "@xwiki/cristal-sharedworker-impl!",
188
+ "name": "",
189
+ "preserveMemberOrder": false,
190
+ "members": [
191
+ {
192
+ "kind": "Class",
193
+ "canonicalReference": "@xwiki/cristal-sharedworker-impl!ComponentInit:class",
194
+ "docComment": "/**\n * @beta\n */\n",
195
+ "excerptTokens": [
196
+ {
197
+ "kind": "Content",
198
+ "text": "export default class ComponentInit "
199
+ }
200
+ ],
201
+ "fileUrlPath": "dist/components/componentsInit.d.ts",
202
+ "releaseTag": "Beta",
203
+ "isAbstract": false,
204
+ "name": "ComponentInit",
205
+ "preserveMemberOrder": false,
206
+ "members": [
207
+ {
208
+ "kind": "Constructor",
209
+ "canonicalReference": "@xwiki/cristal-sharedworker-impl!ComponentInit:constructor(1)",
210
+ "docComment": "/**\n * Constructs a new instance of the `ComponentInit` class\n */\n",
211
+ "excerptTokens": [
212
+ {
213
+ "kind": "Content",
214
+ "text": "constructor(container: "
215
+ },
216
+ {
217
+ "kind": "Reference",
218
+ "text": "Container",
219
+ "canonicalReference": "@inversifyjs/container!Container:class"
220
+ },
221
+ {
222
+ "kind": "Content",
223
+ "text": ");"
224
+ }
225
+ ],
226
+ "releaseTag": "Beta",
227
+ "isProtected": false,
228
+ "overloadIndex": 1,
229
+ "parameters": [
230
+ {
231
+ "parameterName": "container",
232
+ "parameterTypeTokenRange": {
233
+ "startIndex": 1,
234
+ "endIndex": 2
235
+ },
236
+ "isOptional": false
237
+ }
238
+ ]
239
+ }
240
+ ],
241
+ "implementsTokenRanges": []
242
+ }
243
+ ]
244
+ }
245
+ ]
246
+ }
@@ -0,0 +1,19 @@
1
+ ## API Report File for "@xwiki/cristal-sharedworker-impl"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { Container } from 'inversify';
8
+ import { QueueWorker } from '@xwiki/cristal-sharedworker-api';
9
+
10
+ // @beta (undocumented)
11
+ export class ComponentInit {
12
+ constructor(container: Container);
13
+ }
14
+
15
+ export { QueueWorker }
16
+
17
+ // (No @packageDocumentation comment for this package)
18
+
19
+ ```
package/unit-tests.xml ADDED
@@ -0,0 +1,3 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <testsuites name="vitest tests" tests="0" failures="0" errors="0" time="0">
3
+ </testsuites>