@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.
Files changed (43) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +505 -0
  3. package/dist/default/components/browser-api-electron.d.ts +10 -0
  4. package/dist/default/componentsInit.d.ts +5 -0
  5. package/dist/default/electron/main/index.d.ts +26 -0
  6. package/dist/default/electron/preload/apiTypes.d.ts +27 -0
  7. package/dist/default/electron/preload/index.d.ts +25 -0
  8. package/dist/default/index.d.ts +3 -0
  9. package/dist/default/index.es.js +48 -0
  10. package/dist/default/index.es.js.map +1 -0
  11. package/dist/default/index.umd.js +25 -0
  12. package/dist/default/index.umd.js.map +1 -0
  13. package/dist/main/components/browser-api-electron.d.ts +10 -0
  14. package/dist/main/componentsInit.d.ts +5 -0
  15. package/dist/main/electron/main/index.d.ts +26 -0
  16. package/dist/main/electron/preload/apiTypes.d.ts +27 -0
  17. package/dist/main/electron/preload/index.d.ts +25 -0
  18. package/dist/main/index.d.ts +3 -0
  19. package/dist/main/index.es.js +48 -0
  20. package/dist/main/index.es.js.map +1 -0
  21. package/dist/main/index.umd.js +25 -0
  22. package/dist/main/index.umd.js.map +1 -0
  23. package/dist/preload/components/browser-api-electron.d.ts +10 -0
  24. package/dist/preload/componentsInit.d.ts +5 -0
  25. package/dist/preload/electron/main/index.d.ts +26 -0
  26. package/dist/preload/electron/preload/apiTypes.d.ts +27 -0
  27. package/dist/preload/electron/preload/index.d.ts +25 -0
  28. package/dist/preload/index.d.ts +3 -0
  29. package/dist/preload/index.es.js +48 -0
  30. package/dist/preload/index.es.js.map +1 -0
  31. package/dist/preload/index.umd.js +25 -0
  32. package/dist/preload/index.umd.js.map +1 -0
  33. package/package.json +50 -0
  34. package/src/components/browser-api-electron.ts +43 -0
  35. package/src/componentsInit.ts +34 -0
  36. package/src/electron/main/index.ts +42 -0
  37. package/src/electron/preload/apiTypes.ts +28 -0
  38. package/src/electron/preload/index.ts +34 -0
  39. package/src/index.ts +28 -0
  40. package/tsconfig.json +11 -0
  41. package/vite.config.ts +37 -0
  42. package/vite.main.config.ts +37 -0
  43. package/vite.preload.config.ts +37 -0
@@ -0,0 +1,28 @@
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
+ export interface APITypes {
27
+ reloadBrowser(): void;
28
+ }
@@ -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 { contextBridge, ipcRenderer } from "electron";
27
+ import { APITypes } from "./apiTypes";
28
+
29
+ const api: APITypes = {
30
+ reloadBrowser() {
31
+ return ipcRenderer.invoke("reloadBrowser", {});
32
+ },
33
+ };
34
+ contextBridge.exposeInMainWorld("browserElectron", api);
package/src/index.ts ADDED
@@ -0,0 +1,28 @@
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 { ComponentInit } from "./componentsInit";
27
+
28
+ export { ComponentInit };
package/tsconfig.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "rootDir": "src",
4
+ "outDir": "dist"
5
+ },
6
+ "extends": "../../tsconfig.json",
7
+ "include": [
8
+ "./src/index.ts",
9
+ "./src/**/*"
10
+ ]
11
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,37 @@
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 { generateConfig } from "../../vite.config";
27
+ import { mergeConfig } from "vitest/config";
28
+ import { defineConfig } from "vite";
29
+
30
+ export default mergeConfig(
31
+ generateConfig(import.meta.url),
32
+ defineConfig({
33
+ build: {
34
+ outDir: "dist/default",
35
+ },
36
+ }),
37
+ );
@@ -0,0 +1,37 @@
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 { generateConfig } from "../../vite.config";
27
+ import { mergeConfig } from "vitest/config";
28
+ import { defineConfig } from "vite";
29
+
30
+ export default mergeConfig(
31
+ generateConfig(import.meta.url),
32
+ defineConfig({
33
+ build: {
34
+ outDir: "dist/main",
35
+ },
36
+ }),
37
+ );
@@ -0,0 +1,37 @@
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 { generateConfig } from "../../vite.config";
27
+ import { mergeConfig } from "vitest/config";
28
+ import { defineConfig } from "vite";
29
+
30
+ export default mergeConfig(
31
+ generateConfig(import.meta.url),
32
+ defineConfig({
33
+ build: {
34
+ outDir: "dist/preload",
35
+ },
36
+ }),
37
+ );