@xwiki/cristal-browser-electron 0.8.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 +13 -0
- package/LICENSE +505 -0
- package/dist/default/components/browser-api-electron.d.ts +10 -0
- package/dist/default/componentsInit.d.ts +5 -0
- package/dist/default/electron/main/index.d.ts +26 -0
- package/dist/default/electron/preload/apiTypes.d.ts +27 -0
- package/dist/default/electron/preload/index.d.ts +25 -0
- package/dist/default/index.d.ts +3 -0
- package/dist/default/index.es.js +48 -0
- package/dist/default/index.es.js.map +1 -0
- package/dist/default/index.umd.js +25 -0
- package/dist/default/index.umd.js.map +1 -0
- package/dist/main/components/browser-api-electron.d.ts +10 -0
- package/dist/main/componentsInit.d.ts +5 -0
- package/dist/main/electron/main/index.d.ts +26 -0
- package/dist/main/electron/preload/apiTypes.d.ts +27 -0
- package/dist/main/electron/preload/index.d.ts +25 -0
- package/dist/main/index.d.ts +3 -0
- package/dist/main/index.es.js +48 -0
- package/dist/main/index.es.js.map +1 -0
- package/dist/main/index.umd.js +25 -0
- package/dist/main/index.umd.js.map +1 -0
- package/dist/preload/components/browser-api-electron.d.ts +10 -0
- package/dist/preload/componentsInit.d.ts +5 -0
- package/dist/preload/electron/main/index.d.ts +26 -0
- package/dist/preload/electron/preload/apiTypes.d.ts +27 -0
- package/dist/preload/electron/preload/index.d.ts +25 -0
- package/dist/preload/index.d.ts +3 -0
- package/dist/preload/index.es.js +48 -0
- package/dist/preload/index.es.js.map +1 -0
- package/dist/preload/index.umd.js +25 -0
- package/dist/preload/index.umd.js.map +1 -0
- package/package.json +50 -0
- package/src/components/browser-api-electron.ts +43 -0
- package/src/componentsInit.ts +34 -0
- package/src/electron/main/index.ts +42 -0
- package/src/electron/preload/apiTypes.ts +28 -0
- package/src/electron/preload/index.ts +34 -0
- package/src/index.ts +28 -0
- package/tsconfig.json +11 -0
- package/vite.config.ts +37 -0
- package/vite.main.config.ts +37 -0
- package/vite.preload.config.ts +37 -0
|
@@ -0,0 +1 @@
|
|
|
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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport { injectable } from \"inversify\";\nimport { APITypes } from \"../electron/preload/apiTypes\";\nimport { WikiConfig } from \"@xwiki/cristal-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) {\n window.localStorage.setItem(\"currentApp\", wikiConfig.name);\n browserElectron.reloadBrowser();\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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport type { Container } from \"inversify\";\nimport { BrowserApiElectron } from \"./components/browser-api-electron\";\nimport { BrowserApi, name } from \"@xwiki/cristal-browser-api\";\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":";;;;;;;AAqCO,IAAMA,IAAN,MAA+C;AAAA,EACpD,eAAeC,GAAwB;AACrC,WAAO,aAAa,QAAQ,cAAcA,EAAW,IAAI,GACzD,gBAAgB,cAAc;AAAA,EAChC;AACF;AALaD,IAANE,EAAA;AAAA,EADNC,EAAW;AAAA,GACCH,CAAA;ACrCb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BO,MAAMI,EAAc;AAAA,EACzB,YAAYC,GAAsB;AAChC,IAAAA,EAAU,KAAiBC,CAAI,EAAE,GAAGN,CAAkB,EAAE;EAC1D;AACF;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("inversify"),require("@xwiki/cristal-browser-api")):typeof define=="function"&&define.amd?define(["exports","inversify","@xwiki/cristal-browser-api"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.cristal_browser={},e.inversify,e.cristalBrowserApi))})(this,function(e,n,l){"use strict";var a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,w=(t,i,c,o)=>{for(var r=o>1?void 0:o?u(i,c):i,p=t.length-1,f;p>=0;p--)(f=t[p])&&(r=(o?f(i,c,r):f(r))||r);return o&&r&&a(i,c,r),r};let s=class{switchLocation(t){window.localStorage.setItem("currentApp",t.name),browserElectron.reloadBrowser()}};s=w([n.injectable()],s);/**
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/class d{constructor(i){i.bind(l.name).to(s).inSingletonScope()}}e.ComponentInit=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
25
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport { injectable } from \"inversify\";\nimport { APITypes } from \"../electron/preload/apiTypes\";\nimport { WikiConfig } from \"@xwiki/cristal-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) {\n window.localStorage.setItem(\"currentApp\", wikiConfig.name);\n browserElectron.reloadBrowser();\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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport type { Container } from \"inversify\";\nimport { BrowserApiElectron } from \"./components/browser-api-electron\";\nimport { BrowserApi, name } from \"@xwiki/cristal-browser-api\";\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":"+iBAqCO,IAAMA,EAAN,KAA+C,CACpD,eAAeC,EAAwB,CACrC,OAAO,aAAa,QAAQ,aAAcA,EAAW,IAAI,EACzD,gBAAgB,cAAc,CAChC,CACF,EALaD,EAANE,EAAA,CADNC,aAAW,CAAA,EACCH,CAAA,ECrCb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IA6BO,MAAMI,CAAc,CACzB,YAAYC,EAAsB,CAChCA,EAAU,KAAiBC,MAAI,EAAE,GAAGN,CAAkB,EAAE,kBAC1D,CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BrowserApi } from '@xwiki/cristal-browser-api';
|
|
2
|
+
import { WikiConfig } from '@xwiki/cristal-api';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Remembers the current location in the locale storage, then reload the
|
|
6
|
+
* browser.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BrowserApiElectron implements BrowserApi {
|
|
9
|
+
switchLocation(wikiConfig: WikiConfig): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/
|
|
25
|
+
import BrowserWindow = Electron.BrowserWindow;
|
|
26
|
+
export default function load(window: BrowserWindow): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/
|
|
25
|
+
export interface APITypes {
|
|
26
|
+
reloadBrowser(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { injectable as p } from "inversify";
|
|
2
|
+
import { name as i } from "@xwiki/cristal-browser-api";
|
|
3
|
+
var a = Object.defineProperty, m = Object.getOwnPropertyDescriptor, w = (o, e, n, t) => {
|
|
4
|
+
for (var r = t > 1 ? void 0 : t ? m(e, n) : e, c = o.length - 1, s; c >= 0; c--)
|
|
5
|
+
(s = o[c]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
6
|
+
return t && r && a(e, n, r), r;
|
|
7
|
+
};
|
|
8
|
+
let l = class {
|
|
9
|
+
switchLocation(o) {
|
|
10
|
+
window.localStorage.setItem("currentApp", o.name), browserElectron.reloadBrowser();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
l = w([
|
|
14
|
+
p()
|
|
15
|
+
], l);
|
|
16
|
+
/**
|
|
17
|
+
* See the LICENSE file distributed with this work for additional
|
|
18
|
+
* information regarding copyright ownership.
|
|
19
|
+
*
|
|
20
|
+
* This is free software; you can redistribute it and/or modify it
|
|
21
|
+
* under the terms of the GNU Affero General Public License as
|
|
22
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
23
|
+
* the License, or (at your option) any later version.
|
|
24
|
+
*
|
|
25
|
+
* This software is distributed in the hope that it will be useful,
|
|
26
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
28
|
+
* Lesser General Public License for more details.
|
|
29
|
+
*
|
|
30
|
+
* You should have received a copy of the GNU Affero General Public
|
|
31
|
+
* License along with this software; if not, write to the Free
|
|
32
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
33
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
34
|
+
*
|
|
35
|
+
* This file is part of the Cristal Wiki software prototype
|
|
36
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
37
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
38
|
+
*
|
|
39
|
+
**/
|
|
40
|
+
class _ {
|
|
41
|
+
constructor(e) {
|
|
42
|
+
e.bind(i).to(l).inSingletonScope();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
_ as ComponentInit
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport { injectable } from \"inversify\";\nimport { APITypes } from \"../electron/preload/apiTypes\";\nimport { WikiConfig } from \"@xwiki/cristal-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) {\n window.localStorage.setItem(\"currentApp\", wikiConfig.name);\n browserElectron.reloadBrowser();\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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport type { Container } from \"inversify\";\nimport { BrowserApiElectron } from \"./components/browser-api-electron\";\nimport { BrowserApi, name } from \"@xwiki/cristal-browser-api\";\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":";;;;;;;AAqCO,IAAMA,IAAN,MAA+C;AAAA,EACpD,eAAeC,GAAwB;AACrC,WAAO,aAAa,QAAQ,cAAcA,EAAW,IAAI,GACzD,gBAAgB,cAAc;AAAA,EAChC;AACF;AALaD,IAANE,EAAA;AAAA,EADNC,EAAW;AAAA,GACCH,CAAA;ACrCb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BO,MAAMI,EAAc;AAAA,EACzB,YAAYC,GAAsB;AAChC,IAAAA,EAAU,KAAiBC,CAAI,EAAE,GAAGN,CAAkB,EAAE;EAC1D;AACF;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("inversify"),require("@xwiki/cristal-browser-api")):typeof define=="function"&&define.amd?define(["exports","inversify","@xwiki/cristal-browser-api"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.cristal_browser={},e.inversify,e.cristalBrowserApi))})(this,function(e,n,l){"use strict";var a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,w=(t,i,c,o)=>{for(var r=o>1?void 0:o?u(i,c):i,p=t.length-1,f;p>=0;p--)(f=t[p])&&(r=(o?f(i,c,r):f(r))||r);return o&&r&&a(i,c,r),r};let s=class{switchLocation(t){window.localStorage.setItem("currentApp",t.name),browserElectron.reloadBrowser()}};s=w([n.injectable()],s);/**
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/class d{constructor(i){i.bind(l.name).to(s).inSingletonScope()}}e.ComponentInit=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
25
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport { injectable } from \"inversify\";\nimport { APITypes } from \"../electron/preload/apiTypes\";\nimport { WikiConfig } from \"@xwiki/cristal-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) {\n window.localStorage.setItem(\"currentApp\", wikiConfig.name);\n browserElectron.reloadBrowser();\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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport type { Container } from \"inversify\";\nimport { BrowserApiElectron } from \"./components/browser-api-electron\";\nimport { BrowserApi, name } from \"@xwiki/cristal-browser-api\";\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":"+iBAqCO,IAAMA,EAAN,KAA+C,CACpD,eAAeC,EAAwB,CACrC,OAAO,aAAa,QAAQ,aAAcA,EAAW,IAAI,EACzD,gBAAgB,cAAc,CAChC,CACF,EALaD,EAANE,EAAA,CADNC,aAAW,CAAA,EACCH,CAAA,ECrCb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IA6BO,MAAMI,CAAc,CACzB,YAAYC,EAAsB,CAChCA,EAAU,KAAiBC,MAAI,EAAE,GAAGN,CAAkB,EAAE,kBAC1D,CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BrowserApi } from '@xwiki/cristal-browser-api';
|
|
2
|
+
import { WikiConfig } from '@xwiki/cristal-api';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Remembers the current location in the locale storage, then reload the
|
|
6
|
+
* browser.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BrowserApiElectron implements BrowserApi {
|
|
9
|
+
switchLocation(wikiConfig: WikiConfig): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/
|
|
25
|
+
import BrowserWindow = Electron.BrowserWindow;
|
|
26
|
+
export default function load(window: BrowserWindow): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/
|
|
25
|
+
export interface APITypes {
|
|
26
|
+
reloadBrowser(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { injectable as p } from "inversify";
|
|
2
|
+
import { name as i } from "@xwiki/cristal-browser-api";
|
|
3
|
+
var a = Object.defineProperty, m = Object.getOwnPropertyDescriptor, w = (o, e, n, t) => {
|
|
4
|
+
for (var r = t > 1 ? void 0 : t ? m(e, n) : e, c = o.length - 1, s; c >= 0; c--)
|
|
5
|
+
(s = o[c]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
6
|
+
return t && r && a(e, n, r), r;
|
|
7
|
+
};
|
|
8
|
+
let l = class {
|
|
9
|
+
switchLocation(o) {
|
|
10
|
+
window.localStorage.setItem("currentApp", o.name), browserElectron.reloadBrowser();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
l = w([
|
|
14
|
+
p()
|
|
15
|
+
], l);
|
|
16
|
+
/**
|
|
17
|
+
* See the LICENSE file distributed with this work for additional
|
|
18
|
+
* information regarding copyright ownership.
|
|
19
|
+
*
|
|
20
|
+
* This is free software; you can redistribute it and/or modify it
|
|
21
|
+
* under the terms of the GNU Affero General Public License as
|
|
22
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
23
|
+
* the License, or (at your option) any later version.
|
|
24
|
+
*
|
|
25
|
+
* This software is distributed in the hope that it will be useful,
|
|
26
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
28
|
+
* Lesser General Public License for more details.
|
|
29
|
+
*
|
|
30
|
+
* You should have received a copy of the GNU Affero General Public
|
|
31
|
+
* License along with this software; if not, write to the Free
|
|
32
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
33
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
34
|
+
*
|
|
35
|
+
* This file is part of the Cristal Wiki software prototype
|
|
36
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
37
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
38
|
+
*
|
|
39
|
+
**/
|
|
40
|
+
class _ {
|
|
41
|
+
constructor(e) {
|
|
42
|
+
e.bind(i).to(l).inSingletonScope();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
_ as ComponentInit
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport { injectable } from \"inversify\";\nimport { APITypes } from \"../electron/preload/apiTypes\";\nimport { WikiConfig } from \"@xwiki/cristal-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) {\n window.localStorage.setItem(\"currentApp\", wikiConfig.name);\n browserElectron.reloadBrowser();\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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport type { Container } from \"inversify\";\nimport { BrowserApiElectron } from \"./components/browser-api-electron\";\nimport { BrowserApi, name } from \"@xwiki/cristal-browser-api\";\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":";;;;;;;AAqCO,IAAMA,IAAN,MAA+C;AAAA,EACpD,eAAeC,GAAwB;AACrC,WAAO,aAAa,QAAQ,cAAcA,EAAW,IAAI,GACzD,gBAAgB,cAAc;AAAA,EAChC;AACF;AALaD,IAANE,EAAA;AAAA,EADNC,EAAW;AAAA,GACCH,CAAA;ACrCb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BO,MAAMI,EAAc;AAAA,EACzB,YAAYC,GAAsB;AAChC,IAAAA,EAAU,KAAiBC,CAAI,EAAE,GAAGN,CAAkB,EAAE;EAC1D;AACF;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("inversify"),require("@xwiki/cristal-browser-api")):typeof define=="function"&&define.amd?define(["exports","inversify","@xwiki/cristal-browser-api"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.cristal_browser={},e.inversify,e.cristalBrowserApi))})(this,function(e,n,l){"use strict";var a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,w=(t,i,c,o)=>{for(var r=o>1?void 0:o?u(i,c):i,p=t.length-1,f;p>=0;p--)(f=t[p])&&(r=(o?f(i,c,r):f(r))||r);return o&&r&&a(i,c,r),r};let s=class{switchLocation(t){window.localStorage.setItem("currentApp",t.name),browserElectron.reloadBrowser()}};s=w([n.injectable()],s);/**
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/class d{constructor(i){i.bind(l.name).to(s).inSingletonScope()}}e.ComponentInit=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
25
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport { BrowserApi } from \"@xwiki/cristal-browser-api\";\nimport { injectable } from \"inversify\";\nimport { APITypes } from \"../electron/preload/apiTypes\";\nimport { WikiConfig } from \"@xwiki/cristal-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) {\n window.localStorage.setItem(\"currentApp\", wikiConfig.name);\n browserElectron.reloadBrowser();\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 Affero 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 Affero 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 * This file is part of the Cristal Wiki software prototype\n * @copyright Copyright (c) 2023 XWiki SAS\n * @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0\n *\n **/\n\nimport type { Container } from \"inversify\";\nimport { BrowserApiElectron } from \"./components/browser-api-electron\";\nimport { BrowserApi, name } from \"@xwiki/cristal-browser-api\";\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":"+iBAqCO,IAAMA,EAAN,KAA+C,CACpD,eAAeC,EAAwB,CACrC,OAAO,aAAa,QAAQ,aAAcA,EAAW,IAAI,EACzD,gBAAgB,cAAc,CAChC,CACF,EALaD,EAANE,EAAA,CADNC,aAAW,CAAA,EACCH,CAAA,ECrCb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IA6BO,MAAMI,CAAc,CACzB,YAAYC,EAAsB,CAChCA,EAAU,KAAiBC,MAAI,EAAE,GAAGN,CAAkB,EAAE,kBAC1D,CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xwiki/cristal-browser-electron",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"license": "AGPL-3.0",
|
|
5
|
+
"author": "XWiki Org Community <contact@xwiki.org>",
|
|
6
|
+
"homepage": "https://cristal.xwiki.org/",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"directory": "electron/browser",
|
|
10
|
+
"url": "https://github.com/xwiki-contrib/cristal/"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://jira.xwiki.org/projects/CRISTAL/"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/main/index.es.js",
|
|
19
|
+
"require": "./dist/main/index.umd.js",
|
|
20
|
+
"types": "./dist/main/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./preload": {
|
|
23
|
+
"import": "./dist/preload/index.es.js",
|
|
24
|
+
"require": "./dist/preload/index.umd.js",
|
|
25
|
+
"types": "./dist/preload/index.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./main": {
|
|
28
|
+
"import": "./dist/main/index.es.js",
|
|
29
|
+
"require": "./dist/main/index.umd.js",
|
|
30
|
+
"types": "./dist/main/index.d.ts"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"main": "./dist/main/index.es.js",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"inversify": "6.0.2",
|
|
36
|
+
"@xwiki/cristal-api": "0.8.0",
|
|
37
|
+
"@xwiki/cristal-browser-api": "0.8.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"electron": "29.4.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"typescript": "5.4.5",
|
|
44
|
+
"vite": "5.2.11"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc --project tsconfig.json --noEmit && vite build && vite build -c vite.preload.config.ts && vite build -c vite.main.config.ts"
|
|
48
|
+
},
|
|
49
|
+
"types": "./dist/main/index.d.ts"
|
|
50
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/
|
|
25
|
+
|
|
26
|
+
import { BrowserApi } from "@xwiki/cristal-browser-api";
|
|
27
|
+
import { injectable } from "inversify";
|
|
28
|
+
import { APITypes } from "../electron/preload/apiTypes";
|
|
29
|
+
import { WikiConfig } from "@xwiki/cristal-api";
|
|
30
|
+
|
|
31
|
+
declare const browserElectron: APITypes;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Remembers the current location in the locale storage, then reload the
|
|
35
|
+
* browser.
|
|
36
|
+
*/
|
|
37
|
+
@injectable()
|
|
38
|
+
export class BrowserApiElectron implements BrowserApi {
|
|
39
|
+
switchLocation(wikiConfig: WikiConfig) {
|
|
40
|
+
window.localStorage.setItem("currentApp", wikiConfig.name);
|
|
41
|
+
browserElectron.reloadBrowser();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/
|
|
25
|
+
|
|
26
|
+
import type { Container } from "inversify";
|
|
27
|
+
import { BrowserApiElectron } from "./components/browser-api-electron";
|
|
28
|
+
import { BrowserApi, name } from "@xwiki/cristal-browser-api";
|
|
29
|
+
|
|
30
|
+
export class ComponentInit {
|
|
31
|
+
constructor(container: Container) {
|
|
32
|
+
container.bind<BrowserApi>(name).to(BrowserApiElectron).inSingletonScope();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 Affero 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 Affero 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
|
+
* This file is part of the Cristal Wiki software prototype
|
|
21
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
22
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
23
|
+
*
|
|
24
|
+
**/
|
|
25
|
+
|
|
26
|
+
import { ipcMain, app } from "electron";
|
|
27
|
+
import BrowserWindow = Electron.BrowserWindow;
|
|
28
|
+
import { resolve } from "node:path";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Reload the browser by reloading the index file.
|
|
32
|
+
* @param window
|
|
33
|
+
*/
|
|
34
|
+
function reloadBrowser(window: BrowserWindow) {
|
|
35
|
+
window.loadFile(resolve(app.getAppPath(), "./renderer/dist/index.html"));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default function load(window: BrowserWindow) {
|
|
39
|
+
ipcMain.handle("reloadBrowser", () => {
|
|
40
|
+
return reloadBrowser(window);
|
|
41
|
+
});
|
|
42
|
+
}
|