@xwiki/cristal-browser-electron 1.3.0 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xwiki/cristal-browser-electron",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "license": "LGPL 2.1",
5
5
  "author": "XWiki Org Community <contact@xwiki.org>",
6
6
  "homepage": "https://cristal.xwiki.org/",
@@ -12,6 +12,9 @@
12
12
  "bugs": {
13
13
  "url": "https://jira.xwiki.org/projects/CRISTAL/"
14
14
  },
15
+ "engines": {
16
+ "node": ">=24.0.0"
17
+ },
15
18
  "type": "module",
16
19
  "exports": {
17
20
  ".": {
@@ -48,9 +51,9 @@
48
51
  "main": "./dist/main/index.es.js",
49
52
  "types": "./dist/main/index.d.ts",
50
53
  "dependencies": {
51
- "@xwiki/platform-api": "18.3.0",
52
- "@xwiki/cristal-browser-api": "1.3.0",
53
- "@xwiki/cristal-electron-state": "1.3.0"
54
+ "@xwiki/platform-api": "18.4.0",
55
+ "@xwiki/cristal-browser-api": "1.4.0",
56
+ "@xwiki/cristal-electron-state": "1.4.0"
54
57
  },
55
58
  "peerDependencies": {
56
59
  "electron": "41.1.0",
@@ -62,7 +65,7 @@
62
65
  "reflect-metadata": "0.2.2",
63
66
  "typescript": "5.9.3",
64
67
  "vite": "7.3.2",
65
- "@xwiki/cristal-dev-config": "1.3.0"
68
+ "@xwiki/cristal-dev-config": "1.4.0"
66
69
  },
67
70
  "scripts": {
68
71
  "build": "tsc --project tsconfig.json && vite build && vite build -c vite.preload.config.ts && vite build -c vite.main.config.ts",
@@ -1,12 +0,0 @@
1
- import { BrowserApi } from '@xwiki/cristal-browser-api';
2
- import { WikiConfig } from '@xwiki/platform-api';
3
- /**
4
- * Remembers the current location in the locale storage, then reload the
5
- * browser.
6
- */
7
- export declare class BrowserApiElectron implements BrowserApi {
8
- switchLocation(wikiConfig: WikiConfig): void;
9
- reload(): void;
10
- onClose(): void;
11
- setLocation(wikiConfig: WikiConfig): void;
12
- }
@@ -1,7 +0,0 @@
1
- import { Container } from 'inversify';
2
- /**
3
- * @beta
4
- */
5
- export declare class ComponentInit {
6
- constructor(container: Container);
7
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * See the LICENSE file distributed with this work for additional
3
- * information regarding copyright ownership.
4
- *
5
- * This is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU Lesser General Public License as
7
- * published by the Free Software Foundation; either version 2.1 of
8
- * the License, or (at your option) any later version.
9
- *
10
- * This software is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this software; if not, write to the Free
17
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
- */
20
- import BrowserWindow = Electron.BrowserWindow;
21
- export default function load(window: BrowserWindow): void;
@@ -1,23 +0,0 @@
1
- /**
2
- * See the LICENSE file distributed with this work for additional
3
- * information regarding copyright ownership.
4
- *
5
- * This is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU Lesser General Public License as
7
- * published by the Free Software Foundation; either version 2.1 of
8
- * the License, or (at your option) any later version.
9
- *
10
- * This software is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this software; if not, write to the Free
17
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
- */
20
- export interface APITypes {
21
- reloadBrowser(): void;
22
- setStorageRoot(storageRoot?: string): void;
23
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * See the LICENSE file distributed with this work for additional
3
- * information regarding copyright ownership.
4
- *
5
- * This is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU Lesser General Public License as
7
- * published by the Free Software Foundation; either version 2.1 of
8
- * the License, or (at your option) any later version.
9
- *
10
- * This software is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this software; if not, write to the Free
17
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
- */
20
- export {};
@@ -1,2 +0,0 @@
1
- import { ComponentInit } from './componentsInit';
2
- export { ComponentInit };
@@ -1,2 +0,0 @@
1
- import { ComponentInit } from './componentsInit';
2
- export { ComponentInit };
@@ -1,32 +0,0 @@
1
- import { injectable as l } from "inversify";
2
- import { name as i } from "@xwiki/cristal-browser-api";
3
- var p = Object.getOwnPropertyDescriptor, w = (o, e, c, s) => {
4
- for (var r = s > 1 ? void 0 : s ? p(e, c) : e, t = o.length - 1, a; t >= 0; t--)
5
- (a = o[t]) && (r = a(r) || r);
6
- return r;
7
- };
8
- let n = class {
9
- switchLocation(o) {
10
- this.setLocation(o), browserElectron.reloadBrowser();
11
- }
12
- reload() {
13
- browserElectron.reloadBrowser();
14
- }
15
- onClose() {
16
- }
17
- setLocation(o) {
18
- window.localStorage.setItem("currentApp", o.name), browserElectron.setStorageRoot(o.storageRoot);
19
- }
20
- };
21
- n = w([
22
- l()
23
- ], n);
24
- class g {
25
- constructor(e) {
26
- e.bind(i).to(n).inSingletonScope();
27
- }
28
- }
29
- export {
30
- g as ComponentInit
31
- };
32
- //# sourceMappingURL=index.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.es.js","sources":["../../src/components/browser-api-electron.ts","../../src/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 { injectable } from \"inversify\";\nimport type { APITypes } from \"../electron/preload/apiTypes\";\nimport type { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport type { WikiConfig } from \"@xwiki/platform-api\";\n\ndeclare const browserElectron: APITypes;\n\n/**\n * Remembers the current location in the locale storage, then reload the\n * browser.\n */\n@injectable()\nexport class BrowserApiElectron implements BrowserApi {\n switchLocation(wikiConfig: WikiConfig): void {\n this.setLocation(wikiConfig);\n browserElectron.reloadBrowser();\n }\n\n reload(): void {\n browserElectron.reloadBrowser();\n }\n\n onClose(): void {\n // TODO: CRISTAL-429 we did not find a viable implementation to intercept the close action and display a confirm\n // dialog to ask for the user if the confirm closing the page.\n }\n\n setLocation(wikiConfig: WikiConfig): void {\n window.localStorage.setItem(\"currentApp\", wikiConfig.name);\n browserElectron.setStorageRoot(wikiConfig.storageRoot);\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 { BrowserApiElectron } from \"./components/browser-api-electron\";\nimport { name } from \"@xwiki/cristal-browser-api\";\nimport type { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport type { Container } from \"inversify\";\n\n/**\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container.bind<BrowserApi>(name).to(BrowserApiElectron).inSingletonScope();\n }\n}\n"],"names":["BrowserApiElectron","wikiConfig","__decorateClass","injectable","ComponentInit","container","name"],"mappings":";;;;;;;AAgCO,IAAMA,IAAN,MAA+C;AAAA,EACpD,eAAeC,GAA8B;AAC3C,SAAK,YAAYA,CAAU,GAC3B,gBAAgB,cAAA;AAAA,EAClB;AAAA,EAEA,SAAe;AACb,oBAAgB,cAAA;AAAA,EAClB;AAAA,EAEA,UAAgB;AAAA,EAGhB;AAAA,EAEA,YAAYA,GAA8B;AACxC,WAAO,aAAa,QAAQ,cAAcA,EAAW,IAAI,GACzD,gBAAgB,eAAeA,EAAW,WAAW;AAAA,EACvD;AACF;AAnBaD,IAANE,EAAA;AAAA,EADNC,EAAA;AAAW,GACCH,CAAA;ACJN,MAAMI,EAAc;AAAA,EACzB,YAAYC,GAAsB;AAChC,IAAAA,EAAU,KAAiBC,CAAI,EAAE,GAAGN,CAAkB,EAAE,iBAAA;AAAA,EAC1D;AACF;"}
@@ -1,2 +0,0 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("inversify"),require("@xwiki/cristal-browser-api")):typeof define=="function"&&define.amd?define(["exports","inversify","@xwiki/cristal-browser-api"],o):(e=typeof globalThis<"u"?globalThis:e||self,o(e.cristal_browser={},e.inversify,e.cristalBrowserApi))})(this,(function(e,o,l){"use strict";var p=Object.getOwnPropertyDescriptor,f=(r,t,d,c)=>{for(var n=c>1?void 0:c?p(t,d):t,s=r.length-1,a;s>=0;s--)(a=r[s])&&(n=a(n)||n);return n};let i=class{switchLocation(r){this.setLocation(r),browserElectron.reloadBrowser()}reload(){browserElectron.reloadBrowser()}onClose(){}setLocation(r){window.localStorage.setItem("currentApp",r.name),browserElectron.setStorageRoot(r.storageRoot)}};i=f([o.injectable()],i);class w{constructor(t){t.bind(l.name).to(i).inSingletonScope()}}e.ComponentInit=w,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
2
- //# sourceMappingURL=index.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.umd.js","sources":["../../src/components/browser-api-electron.ts","../../src/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 { injectable } from \"inversify\";\nimport type { APITypes } from \"../electron/preload/apiTypes\";\nimport type { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport type { WikiConfig } from \"@xwiki/platform-api\";\n\ndeclare const browserElectron: APITypes;\n\n/**\n * Remembers the current location in the locale storage, then reload the\n * browser.\n */\n@injectable()\nexport class BrowserApiElectron implements BrowserApi {\n switchLocation(wikiConfig: WikiConfig): void {\n this.setLocation(wikiConfig);\n browserElectron.reloadBrowser();\n }\n\n reload(): void {\n browserElectron.reloadBrowser();\n }\n\n onClose(): void {\n // TODO: CRISTAL-429 we did not find a viable implementation to intercept the close action and display a confirm\n // dialog to ask for the user if the confirm closing the page.\n }\n\n setLocation(wikiConfig: WikiConfig): void {\n window.localStorage.setItem(\"currentApp\", wikiConfig.name);\n browserElectron.setStorageRoot(wikiConfig.storageRoot);\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 { BrowserApiElectron } from \"./components/browser-api-electron\";\nimport { name } from \"@xwiki/cristal-browser-api\";\nimport type { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport type { Container } from \"inversify\";\n\n/**\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container.bind<BrowserApi>(name).to(BrowserApiElectron).inSingletonScope();\n }\n}\n"],"names":["BrowserApiElectron","wikiConfig","__decorateClass","injectable","ComponentInit","container","name"],"mappings":"4fAgCO,IAAMA,EAAN,KAA+C,CACpD,eAAeC,EAA8B,CAC3C,KAAK,YAAYA,CAAU,EAC3B,gBAAgB,cAAA,CAClB,CAEA,QAAe,CACb,gBAAgB,cAAA,CAClB,CAEA,SAAgB,CAGhB,CAEA,YAAYA,EAA8B,CACxC,OAAO,aAAa,QAAQ,aAAcA,EAAW,IAAI,EACzD,gBAAgB,eAAeA,EAAW,WAAW,CACvD,CACF,EAnBaD,EAANE,EAAA,CADNC,EAAAA,WAAA,CAAW,EACCH,CAAA,ECJN,MAAMI,CAAc,CACzB,YAAYC,EAAsB,CAChCA,EAAU,KAAiBC,EAAAA,IAAI,EAAE,GAAGN,CAAkB,EAAE,iBAAA,CAC1D,CACF"}
@@ -1,21 +0,0 @@
1
- /**
2
- * See the LICENSE file distributed with this work for additional
3
- * information regarding copyright ownership.
4
- *
5
- * This is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU Lesser General Public License as
7
- * published by the Free Software Foundation; either version 2.1 of
8
- * the License, or (at your option) any later version.
9
- *
10
- * This software is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this software; if not, write to the Free
17
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
- */
20
- import BrowserWindow = Electron.BrowserWindow;
21
- export default function load(window: BrowserWindow): void;
@@ -1,21 +0,0 @@
1
- /**
2
- * See the LICENSE file distributed with this work for additional
3
- * information regarding copyright ownership.
4
- *
5
- * This is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU Lesser General Public License as
7
- * published by the Free Software Foundation; either version 2.1 of
8
- * the License, or (at your option) any later version.
9
- *
10
- * This software is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this software; if not, write to the Free
17
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
- */
20
- import BrowserWindow = Electron.BrowserWindow;
21
- export default function load(window: BrowserWindow): void;
@@ -1,16 +0,0 @@
1
- import { setStorageRoot as r } from "@xwiki/cristal-electron-state";
2
- import { ipcMain as e, app as a } from "electron";
3
- import { resolve as n } from "node:path";
4
- function i(o) {
5
- o.loadFile(n(a.getAppPath(), "./renderer/dist/index.html"));
6
- }
7
- function d(o) {
8
- r(o);
9
- }
10
- function m(o) {
11
- e.handle("reloadBrowser", () => i(o)), e.handle("setStorageRoot", (l, { storageRoot: t }) => d(t));
12
- }
13
- export {
14
- m as default
15
- };
16
- //# sourceMappingURL=index.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.es.js","sources":["../../src/electron/main/index.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 { setStorageRoot as stateSetStorageRoot } from \"@xwiki/cristal-electron-state\";\nimport { app, ipcMain } from \"electron\";\nimport { resolve } from \"node:path\";\nimport BrowserWindow = Electron.BrowserWindow;\n\n/**\n * Reload the browser by reloading the index file.\n * @param window - the window instance in which the default index page is loaded\n */\nfunction reloadBrowser(window: BrowserWindow) {\n window.loadFile(resolve(app.getAppPath(), \"./renderer/dist/index.html\"));\n}\n\nfunction setStorageRoot(storageRoot?: string): void {\n stateSetStorageRoot(storageRoot);\n}\n\nexport default function load(window: BrowserWindow): void {\n ipcMain.handle(\"reloadBrowser\", () => {\n return reloadBrowser(window);\n });\n ipcMain.handle(\"setStorageRoot\", (_event, { storageRoot }) => {\n return setStorageRoot(storageRoot);\n });\n}\n"],"names":["reloadBrowser","window","resolve","app","setStorageRoot","storageRoot","stateSetStorageRoot","load","ipcMain","_event"],"mappings":";;;AA6BA,SAASA,EAAcC,GAAuB;AAC5C,EAAAA,EAAO,SAASC,EAAQC,EAAI,WAAA,GAAc,4BAA4B,CAAC;AACzE;AAEA,SAASC,EAAeC,GAA4B;AAClDC,EAAAA,EAAoBD,CAAW;AACjC;AAEA,SAAwBE,EAAKN,GAA6B;AACxD,EAAAO,EAAQ,OAAO,iBAAiB,MACvBR,EAAcC,CAAM,CAC5B,GACDO,EAAQ,OAAO,kBAAkB,CAACC,GAAQ,EAAE,aAAAJ,QACnCD,EAAeC,CAAW,CAClC;AACH;"}
@@ -1,2 +0,0 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t(require("@xwiki/cristal-electron-state"),require("electron"),require("node:path")):typeof define=="function"&&define.amd?define(["@xwiki/cristal-electron-state","electron","node:path"],t):(e=typeof globalThis<"u"?globalThis:e||self,e.cristal_browser=t(e.cristalElectronState,e.electron,e.node_path))})(this,(function(e,t,r){"use strict";function o(n){n.loadFile(r.resolve(t.app.getAppPath(),"./renderer/dist/index.html"))}function i(n){e.setStorageRoot(n)}function d(n){t.ipcMain.handle("reloadBrowser",()=>o(n)),t.ipcMain.handle("setStorageRoot",(a,{storageRoot:s})=>i(s))}return d}));
2
- //# sourceMappingURL=index.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.umd.js","sources":["../../src/electron/main/index.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 { setStorageRoot as stateSetStorageRoot } from \"@xwiki/cristal-electron-state\";\nimport { app, ipcMain } from \"electron\";\nimport { resolve } from \"node:path\";\nimport BrowserWindow = Electron.BrowserWindow;\n\n/**\n * Reload the browser by reloading the index file.\n * @param window - the window instance in which the default index page is loaded\n */\nfunction reloadBrowser(window: BrowserWindow) {\n window.loadFile(resolve(app.getAppPath(), \"./renderer/dist/index.html\"));\n}\n\nfunction setStorageRoot(storageRoot?: string): void {\n stateSetStorageRoot(storageRoot);\n}\n\nexport default function load(window: BrowserWindow): void {\n ipcMain.handle(\"reloadBrowser\", () => {\n return reloadBrowser(window);\n });\n ipcMain.handle(\"setStorageRoot\", (_event, { storageRoot }) => {\n return setStorageRoot(storageRoot);\n });\n}\n"],"names":["reloadBrowser","window","resolve","app","setStorageRoot","storageRoot","stateSetStorageRoot","load","ipcMain","_event"],"mappings":"6ZA6BA,SAASA,EAAcC,EAAuB,CAC5CA,EAAO,SAASC,EAAAA,QAAQC,EAAAA,IAAI,WAAA,EAAc,4BAA4B,CAAC,CACzE,CAEA,SAASC,EAAeC,EAA4B,CAClDC,EAAAA,eAAoBD,CAAW,CACjC,CAEA,SAAwBE,EAAKN,EAA6B,CACxDO,UAAQ,OAAO,gBAAiB,IACvBR,EAAcC,CAAM,CAC5B,EACDO,EAAAA,QAAQ,OAAO,iBAAkB,CAACC,EAAQ,CAAE,YAAAJ,KACnCD,EAAeC,CAAW,CAClC,CACH"}
@@ -1,23 +0,0 @@
1
- /**
2
- * See the LICENSE file distributed with this work for additional
3
- * information regarding copyright ownership.
4
- *
5
- * This is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU Lesser General Public License as
7
- * published by the Free Software Foundation; either version 2.1 of
8
- * the License, or (at your option) any later version.
9
- *
10
- * This software is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this software; if not, write to the Free
17
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
- */
20
- export interface APITypes {
21
- reloadBrowser(): void;
22
- setStorageRoot(storageRoot?: string): void;
23
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * See the LICENSE file distributed with this work for additional
3
- * information regarding copyright ownership.
4
- *
5
- * This is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU Lesser General Public License as
7
- * published by the Free Software Foundation; either version 2.1 of
8
- * the License, or (at your option) any later version.
9
- *
10
- * This software is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this software; if not, write to the Free
17
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
- */
20
- export {};
@@ -1,20 +0,0 @@
1
- /**
2
- * See the LICENSE file distributed with this work for additional
3
- * information regarding copyright ownership.
4
- *
5
- * This is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU Lesser General Public License as
7
- * published by the Free Software Foundation; either version 2.1 of
8
- * the License, or (at your option) any later version.
9
- *
10
- * This software is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this software; if not, write to the Free
17
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
- */
20
- export {};
@@ -1,11 +0,0 @@
1
- import { contextBridge as o, ipcRenderer as e } from "electron";
2
- const t = {
3
- reloadBrowser() {
4
- return e.invoke("reloadBrowser", {});
5
- },
6
- setStorageRoot(r) {
7
- return e.invoke("setStorageRoot", { storageRoot: r });
8
- }
9
- };
10
- o.exposeInMainWorld("browserElectron", t);
11
- //# sourceMappingURL=index.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.es.js","sources":["../../src/electron/preload/index.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 { contextBridge, ipcRenderer } from \"electron\";\nimport type { APITypes } from \"./apiTypes\";\n\nconst api: APITypes = {\n reloadBrowser() {\n return ipcRenderer.invoke(\"reloadBrowser\", {});\n },\n setStorageRoot(storageRoot?: string) {\n return ipcRenderer.invoke(\"setStorageRoot\", { storageRoot });\n },\n};\ncontextBridge.exposeInMainWorld(\"browserElectron\", api);\n"],"names":["api","ipcRenderer","storageRoot","contextBridge"],"mappings":";AAuBA,MAAMA,IAAgB;AAAA,EACpB,gBAAgB;AACd,WAAOC,EAAY,OAAO,iBAAiB,EAAE;AAAA,EAC/C;AAAA,EACA,eAAeC,GAAsB;AACnC,WAAOD,EAAY,OAAO,kBAAkB,EAAE,aAAAC,GAAa;AAAA,EAC7D;AACF;AACAC,EAAc,kBAAkB,mBAAmBH,CAAG;"}
@@ -1,2 +0,0 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?o(require("electron")):typeof define=="function"&&define.amd?define(["electron"],o):(e=typeof globalThis<"u"?globalThis:e||self,o(e.electron))})(this,(function(e){"use strict";const o={reloadBrowser(){return e.ipcRenderer.invoke("reloadBrowser",{})},setStorageRoot(n){return e.ipcRenderer.invoke("setStorageRoot",{storageRoot:n})}};e.contextBridge.exposeInMainWorld("browserElectron",o)}));
2
- //# sourceMappingURL=index.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.umd.js","sources":["../../src/electron/preload/index.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 { contextBridge, ipcRenderer } from \"electron\";\nimport type { APITypes } from \"./apiTypes\";\n\nconst api: APITypes = {\n reloadBrowser() {\n return ipcRenderer.invoke(\"reloadBrowser\", {});\n },\n setStorageRoot(storageRoot?: string) {\n return ipcRenderer.invoke(\"setStorageRoot\", { storageRoot });\n },\n};\ncontextBridge.exposeInMainWorld(\"browserElectron\", api);\n"],"names":["api","ipcRenderer","storageRoot","contextBridge"],"mappings":"2OAuBA,MAAMA,EAAgB,CACpB,eAAgB,CACd,OAAOC,cAAY,OAAO,gBAAiB,EAAE,CAC/C,EACA,eAAeC,EAAsB,CACnC,OAAOD,EAAAA,YAAY,OAAO,iBAAkB,CAAE,YAAAC,EAAa,CAC7D,CACF,EACAC,EAAAA,cAAc,kBAAkB,kBAAmBH,CAAG"}